:root {
  --paper: #f5f0e7;
  --paper-deep: #e9e1d4;
  --ink: #14243a;
  --teal: #087e78;
  --teal-dark: #075f5b;
  --orange: #b94e17;
  --rule: #b9b1a5;
  --purple: #5f4b8b;
  --white: #fffdf8;
  --shadow: 0 16px 42px rgb(20 36 58 / 12%);
  --radius: 18px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Segoe UI', Arial, sans-serif;
  --mono: Consolas, 'Courier New', monospace;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  background:
    linear-gradient(rgb(20 36 58 / 3%) 1px, transparent 1px) 0 0 / 100% 28px,
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}
a { color: var(--teal-dark); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { color: var(--orange); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; }
.skip-link { position: fixed; z-index: 100; left: 1rem; top: -5rem; background: var(--ink); color: white; padding: .7rem 1rem; }
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  z-index: 40;
  top: 0;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto minmax(170px, 1fr);
  align-items: center;
  gap: 1.25rem;
  min-height: 72px;
  padding: .7rem clamp(1rem, 3vw, 3rem);
  border-bottom: 1px solid var(--rule);
  background: rgb(245 240 231 / 94%);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); font: 700 1.08rem/1 var(--serif); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--ink); color: var(--paper); font: 800 .72rem/1 var(--mono); letter-spacing: -.04em; }
.task-nav { display: flex; gap: .25rem; align-items: center; }
.task-nav a { padding: .52rem .78rem; border-radius: 999px; color: var(--ink); font-size: .82rem; font-weight: 800; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.task-nav a:hover, .task-nav a[aria-current='page'] { background: var(--ink); color: var(--paper); }
.header-tools { display: flex; justify-content: flex-end; align-items: center; gap: .75rem; }
.age-mark { border: 2px solid var(--orange); border-radius: 999px; padding: .16rem .42rem; color: var(--orange); font: 800 .78rem/1 var(--mono); }
.help-link { color: var(--purple); font-weight: 800; }
.menu-button { display: none; border: 1px solid var(--ink); border-radius: 999px; background: transparent; padding: .45rem .72rem; color: var(--ink); font-weight: 800; }

.page-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: start; gap: clamp(1.4rem, 4vw, 5rem); max-width: 1500px; margin: 0 auto; padding: 2rem clamp(1rem, 3vw, 3rem) 5rem; }
.side-rail { position: sticky; top: 98px; display: grid; gap: 1.5rem; max-height: calc(100vh - 118px); overflow: auto; padding: 1rem 1rem 1rem 0; }
.rail-group { border-top: 2px solid var(--ink); padding-top: .75rem; }
.rail-label { margin: 0 0 .5rem; color: var(--orange); font: 800 .72rem/1.2 var(--mono); letter-spacing: .09em; text-transform: uppercase; }
.rail-group a { display: block; padding: .3rem 0; color: var(--ink); font-size: .9rem; text-decoration: none; }
.rail-group a:hover, .rail-group a[aria-current='page'] { color: var(--teal-dark); text-decoration: underline; }
.scope-note { padding: .8rem; border-left: 4px solid var(--purple); background: rgb(95 75 139 / 8%); font-size: .78rem; line-height: 1.45; }

main { min-width: 0; }
.breadcrumbs { margin-bottom: 1.5rem; color: #4c5665; font-size: .78rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li:not(:last-child)::after { content: ' /'; color: var(--rule); }
.breadcrumbs a { color: inherit; }
.article { max-width: 920px; }
.article-header { position: relative; padding: clamp(1.2rem, 3vw, 2.5rem); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.eyebrow { margin: 0 0 1rem; color: var(--teal-dark); font: 800 .74rem/1.2 var(--mono); letter-spacing: .09em; text-transform: uppercase; }
h1, h2 { font-family: var(--serif); text-wrap: balance; }
h1 { max-width: 16ch; margin: 0; font-size: clamp(2.45rem, 6vw, 5.8rem); line-height: .98; letter-spacing: -.045em; }
.lead { max-width: 68ch; margin: 1.35rem 0 0; color: #283b52; font-size: clamp(1.08rem, 2vw, 1.35rem); line-height: 1.55; }
h2 { margin: 0 0 1rem; font-size: clamp(1.75rem, 4vw, 3.05rem); line-height: 1.08; letter-spacing: -.025em; }
h3 { margin: 1.6rem 0 .45rem; font-size: 1.15rem; line-height: 1.35; }
p { max-width: 76ch; }
.content-section { margin-top: clamp(2.3rem, 6vw, 5rem); padding-top: 1.4rem; border-top: 1px solid var(--rule); }
.content-section:nth-of-type(2n) { border-top-color: var(--teal); }
.content-section:last-child { margin-bottom: 2rem; }
.article ul, .article ol { max-width: 72ch; padding-left: 1.25rem; }
.article li { margin: .5rem 0; padding-left: .2rem; }

.editorial-figure { margin: 1.6rem 0 0; }
.editorial-figure img { width: 100%; border-radius: 14px; border: 1px solid var(--rule); background: var(--paper-deep); aspect-ratio: 3 / 2; object-fit: cover; }
.editorial-figure figcaption { margin-top: .45rem; color: #596473; font-size: .76rem; }
.article-header .editorial-figure { margin-inline: clamp(-.5rem, -1vw, -1rem); }
.table-figure { max-width: 100%; margin: 1.25rem 0; overflow-x: auto; border: 1px solid var(--rule); border-radius: 14px; background: var(--white); box-shadow: 0 8px 20px rgb(20 36 58 / 7%); }
table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: .91rem; }
th, td { padding: .8rem .9rem; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
th { position: sticky; top: 0; background: var(--ink); color: var(--paper); font: 800 .78rem/1.35 var(--sans); letter-spacing: .03em; }
tbody tr:nth-child(even) { background: rgb(8 126 120 / 5%); }
tbody tr:last-child td { border-bottom: 0; }

.route-panel { display: grid; grid-template-columns: .8fr 1.2fr; gap: 1rem; margin-top: 1.5rem; }
.trail, .route-cards { border-radius: 14px; padding: 1rem; }
.trail { counter-reset: step; background: var(--ink); color: var(--paper); }
.trail h2 { margin: 0 0 .85rem; font: 800 .76rem/1.2 var(--mono); color: #a8e4df; letter-spacing: .08em; text-transform: uppercase; }
.trail ol { display: grid; gap: .65rem; margin: 0; padding: 0; list-style: none; }
.trail li { counter-increment: step; display: grid; grid-template-columns: 2rem 1fr; gap: .6rem; align-items: center; margin: 0; }
.trail li::before { content: counter(step, decimal-leading-zero); color: #a8e4df; font: 700 .75rem/1 var(--mono); }
.route-cards { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; background: var(--paper-deep); }
.route-card { min-width: 0; padding: .8rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--white); color: var(--ink); text-decoration: none; }
.route-card span { display: block; color: var(--orange); font: 800 .68rem/1.2 var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.route-card strong { display: block; margin-top: .25rem; font-family: var(--serif); line-height: 1.15; }
.specimen-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.specimen { min-width: 0; min-height: 150px; padding: 1rem; border: 1px solid var(--rule); border-radius: 14px; background: var(--white); color: var(--ink); text-decoration: none; }
.specimen::before { content: ''; display: block; width: 42px; height: 42px; margin-bottom: 1.2rem; background: repeating-linear-gradient(45deg, var(--teal) 0 7px, var(--paper) 7px 14px); border: 1px solid var(--ink); border-radius: 8px; }
.specimen:nth-child(2)::before { border-radius: 50%; background: conic-gradient(var(--orange) 0 25%, var(--paper) 0 50%, var(--teal) 0 75%, var(--paper) 0); }
.specimen:nth-child(3)::before { background: linear-gradient(90deg, var(--purple) 0 30%, var(--paper) 30% 65%, var(--orange) 65%); }
.specimen strong { display: block; font-family: var(--serif); }
.specimen small { display: block; margin-top: .35rem; color: #536071; line-height: 1.4; }
.support-callout { margin: 1.5rem 0; padding: 1rem 1.15rem; border-left: 5px solid var(--purple); background: rgb(95 75 139 / 9%); }
.preview-stamp { display: inline-flex; margin-top: 1.1rem; transform: rotate(-1deg); border: 2px solid var(--orange); padding: .35rem .55rem; color: var(--orange); font: 800 .68rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }

.site-footer { border-top: 1px solid var(--rule); background: var(--ink); color: #e8e2d7; }
.footer-inner { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 2rem; max-width: 1500px; margin: 0 auto; padding: 3rem clamp(1rem, 3vw, 3rem); }
.footer-title { margin: 0 0 .65rem; color: white; font-family: var(--serif); font-size: 1.35rem; }
.footer-inner p { margin: .25rem 0; font-size: .86rem; }
.footer-links { display: grid; align-content: start; gap: .35rem; }
.footer-links a { color: #b8e0dc; font-size: .86rem; }
.footer-note { border-top: 1px solid rgb(255 255 255 / 15%); padding: 1rem clamp(1rem, 3vw, 3rem); text-align: center; font-size: .75rem; }

.mobile-sheet { position: fixed; z-index: 80; inset: 0; background: rgb(20 36 58 / 54%); }
.mobile-sheet[hidden] { display: none; }
.sheet-panel { position: absolute; right: 0; bottom: 0; left: 0; max-height: 84vh; overflow: auto; border-radius: 24px 24px 0 0; background: var(--paper); padding: 1rem 1rem 2rem; box-shadow: 0 -20px 60px rgb(0 0 0 / 25%); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.sheet-close { border: 1px solid var(--ink); border-radius: 999px; background: transparent; padding: .4rem .7rem; }
.sheet-links { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; padding-top: 1rem; }
.sheet-links a { padding: .8rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--white); color: var(--ink); font-weight: 700; text-decoration: none; }
.sheet-links .help { border-color: var(--purple); color: var(--purple); }

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto; }
  .task-nav, .header-tools .help-link { display: none; }
  .menu-button { display: inline-block; }
  .page-shell { grid-template-columns: minmax(0, 1fr); }
  .side-rail { display: none; }
  .article { margin: 0 auto; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .site-header { min-height: 62px; }
  .brand-mark { width: 34px; height: 34px; }
  .age-mark { display: none; }
  .page-shell { padding-top: 1rem; }
  .article-header { padding: 1.1rem; }
  h1 { font-size: clamp(2.35rem, 12vw, 4rem); }
  .route-panel { grid-template-columns: 1fr; }
  .specimen-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .site-header { padding-inline: .75rem; }
  .brand { font-size: 1rem; }
  .page-shell { padding-inline: .75rem; }
  .breadcrumbs { font-size: .72rem; }
  .route-cards, .sheet-links { grid-template-columns: 1fr; }
  .content-section { margin-top: 2.5rem; }
  .article-header .editorial-figure { margin-inline: 0; }
  th, td { padding: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
