:root {
  color-scheme: light;
  --paper: #f4f1e9;
  --surface: #fffefa;
  --ink: #202a32;
  --muted: #5e6870;
  --line: #ded8ca;
  --navy: #142735;
  --navy-soft: #203d4b;
  --brass: #ad7d3a;
  --brass-light: #f2e8d6;
  --radius: 14px;
  --shadow: 0 10px 30px rgb(30 39 42 / 6%);
  font-family: system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.7; }
a { color: #245b73; text-underline-offset: .18em; }
a:hover { color: #123c50; }
img { max-width: 100%; height: auto; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 10; padding: .7rem 1rem; background: white; }
.skip-link:focus { left: 1rem; top: 1rem; }
.site-shell { width: min(1120px, 100% - 40px); margin: 0 auto; }
.site-header { padding: 22px 0 16px; border-bottom: 0; min-height: 0; }
.masthead { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.masthead img { width: 54px; height: 54px; object-fit: contain; border-radius: 9px; background: white; padding: 4px; }
.masthead .site { color: var(--navy); font-size: 1.28rem; font-weight: 700; letter-spacing: .015em; }
.masthead .desc { color: var(--muted); font-size: .88rem; }
.primary-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0 0 14px; border-bottom: 1px solid var(--line); }
.primary-nav a { padding: 6px 12px; border: 1px solid transparent; border-radius: 999px; color: var(--navy); font-size: .92rem; font-weight: 600; text-decoration: none; }
.primary-nav a:hover, .primary-nav a:focus-visible { border-color: var(--line); background: var(--surface); }
.breadcrumb { margin: 18px 0 12px; color: var(--muted); font-size: .88rem; }
.breadcrumb a { color: inherit; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.archive-banner { margin: 16px 0 20px; padding: 13px 16px; border: 1px solid #e4d3b5; border-left: 4px solid var(--brass); border-radius: 8px; background: var(--brass-light); color: #493a27; }
.content { min-height: 50vh; padding: clamp(22px, 4vw, 46px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.content > :first-child { margin-top: 0; }
.content h1, .content h2, .content h3 { color: var(--navy); line-height: 1.25; }
.content h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.content h2 { margin-top: 2rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
.content h3 { margin-top: 1.5rem; }
.content p, .content li { max-width: 78ch; }
.content blockquote { margin: 1.2rem 0; padding: .6rem 1.2rem; border-left: 3px solid var(--brass); color: var(--muted); background: #f8f5ee; }
.content code, .content pre { border-radius: 5px; background: #f1eee6; }
.content code { padding: .1em .3em; }
.content pre { overflow-x: auto; padding: 1rem; }
.content table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; }
.content th, .content td { padding: .65rem .75rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.content th { background: #f2efe7; color: var(--navy); }
.content figure { margin: 1.5rem 0; }
.content figcaption { color: var(--muted); font-size: .9rem; }
.local-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 20px; }
.local-nav a { padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--navy); font-size: .88rem; text-decoration: none; }
.local-nav a:hover, .local-nav a.is-active { border-color: var(--navy-soft); background: var(--navy); color: white; }
.site-footer { margin: 22px 0 32px; padding: 16px 2px; color: var(--muted); font-size: .88rem; }
:focus-visible { outline: 3px solid #b1803d; outline-offset: 3px; }

@media (max-width: 640px) {
  .site-shell { width: min(100% - 24px, 1120px); }
  .site-header { padding-top: 14px; }
  .masthead img { width: 46px; height: 46px; }
  .masthead .desc { max-width: 34ch; font-size: .8rem; }
  .primary-nav { gap: 4px; }
  .primary-nav a { padding: 6px 9px; font-size: .86rem; }
  .content { padding: 22px 17px; }
  .content h1 { font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; } }
