:root {
  --ink: #172b2f;
  --muted: #677477;
  --paper: #f7f1e6;
  --paper-2: #efe6d7;
  --white: #fffdf8;
  --orange: #e8633b;
  --yellow: #ffcf66;
  --teal: #2d6870;
  --blue: #5a86a6;
  --purple: #85698f;
  --green: #708b68;
  --line: rgba(23, 43, 47, 0.18);
  --serif: Iowan Old Style, Baskerville, "Noto Serif SC", "Songti SC", SimSun, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); line-height: 1.65; }
a { color: inherit; }
button { font: inherit; }
.progress { position: fixed; z-index: 100; inset: 0 0 auto; height: 3px; background: rgba(255,255,255,.25); }
.progress span { display: block; width: 0; height: 100%; background: var(--orange); }
.topbar { position: sticky; z-index: 50; top: 0; height: 58px; padding: 0 clamp(18px,4vw,60px); display: flex; align-items: center; justify-content: space-between; background: rgba(247,241,230,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-decoration: none; }
.brand span { display: grid; place-items: center; width: 30px; height: 30px; color: var(--paper); background: var(--ink); border-radius: 50%; font-family: var(--serif); font-size: 17px; }
.brand b { font: inherit; }
.topbar nav { display: flex; gap: 26px; }
.topbar nav a { color: var(--muted); font-size: 12px; font-weight: 700; text-decoration: none; }
.topbar nav a:hover, .topbar nav a:focus-visible { color: var(--orange); }

.hero { min-height: calc(100vh - 58px); padding: clamp(56px,8vw,110px) clamp(22px,7vw,110px); display: grid; grid-template-columns: minmax(0, .9fr) minmax(400px, 1.1fr); align-items: center; gap: clamp(34px,6vw,100px); overflow: hidden; }
.eyebrow,.kicker { margin: 0 0 18px; color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
h1,h2,h3,p { margin-top: 0; }
h1 { margin-bottom: 28px; font: 700 clamp(52px,6vw,92px)/.94 var(--serif); letter-spacing: -.06em; }
h1 > span { white-space: nowrap; }
h1 em { color: var(--orange); font-style: italic; font-weight: 400; }
.deck { max-width: 670px; color: #384b4f; font-size: clamp(16px,1.6vw,21px); line-height: 1.8; }
.hero-actions { display: flex; gap: 12px; margin: 34px 0 52px; }
.button { padding: 12px 18px; border: 1px solid var(--ink); border-radius: 3px; font-size: 13px; font-weight: 750; text-decoration: none; }
.button.primary { color: var(--paper); background: var(--ink); }
.button.secondary { background: transparent; }
.button:hover,.button:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(23,43,47,.12); }
.hero-stats { display: flex; gap: 32px; margin: 0; }
.hero-stats div { min-width: 92px; padding-top: 12px; border-top: 1px solid var(--line); }
.hero-stats dt { font: 700 32px/1 var(--serif); }
.hero-stats dd { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.hero-visual { max-width: 680px; justify-self: end; }
.hero-visual svg { width: 100%; height: auto; filter: drop-shadow(0 28px 50px rgba(23,43,47,.12)); }

.section { padding: clamp(78px,10vw,150px) clamp(22px,7vw,110px); border-top: 1px solid var(--line); }
.section-head { max-width: 850px; margin-bottom: 60px; }
.section-head.compact { margin-bottom: 40px; }
.section-head h2 { margin-bottom: 22px; font: 700 clamp(42px,5vw,72px)/1.04 var(--serif); letter-spacing: -.045em; }
.section-head > p:last-child { max-width: 700px; color: var(--muted); font-size: 16px; }
.rule-section { color: var(--paper); background: var(--ink); }
.rule-section .section-head > p:last-child { color: #b9c5c5; }
.gate-grid { display: grid; grid-template-columns: 1fr 64px 1fr; gap: 24px; align-items: stretch; max-width: 1220px; }
.gate { min-height: 250px; padding: clamp(24px,4vw,48px); display: grid; grid-template-columns: auto 1fr; gap: 30px; border: 1px solid rgba(255,255,255,.22); border-radius: 12px; }
.gate-s { background: #244c53; }
.gate-c { background: #5e4d68; }
.gate-letter { font: italic 400 80px/1 var(--serif); opacity: .42; }
.gate-label { margin-bottom: 16px; color: var(--yellow); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.gate h3 { margin-bottom: 16px; font: 700 clamp(24px,3vw,38px)/1.15 var(--serif); }
.gate p:last-child { color: rgba(255,255,255,.78); }
.or-mark { display: grid; place-items: center; color: var(--yellow); font: italic 700 20px var(--serif); }
.reject-strip { display: flex; flex-wrap: wrap; gap: 10px; max-width: 1220px; margin: 20px 0 46px; }
.reject-strip > * { padding: 8px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: #c5cece; font-size: 11px; }
.reject-strip b { color: var(--ink); background: var(--yellow); border-color: var(--yellow); }
.window-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; max-width: 1220px; margin: 0 0 52px; }
.window-grid article { padding: 22px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: rgba(255,255,255,.045); }
.window-grid span { display: block; margin-bottom: 8px; color: var(--yellow); font-size: 10px; font-weight: 850; letter-spacing: .14em; }
.window-grid strong { display: block; margin-bottom: 12px; font: 700 26px/1 var(--serif); }
.window-grid p { margin: 0; color: #b9c5c5; font-size: 12px; }
.decision-figure { max-width: 1000px; margin: 30px auto 0; }
.decision-figure svg { width: 100%; }
.flow-lines { stroke: rgba(255,255,255,.38); }
.flow-boxes rect { fill: rgba(255,255,255,.06); stroke: rgba(255,255,255,.32); }
.flow-text { fill: #fff; font-size: 14px; font-weight: 700; }
figcaption { margin-top: 12px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.decision-figure figcaption { color: #9dacaf; text-align: center; }

.map-section { background: var(--paper-2); }
.chart-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 18px; }
.chart-panel { margin: 0; min-height: 360px; padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; }
.chart-panel.wide { grid-row: span 2; }
.chart-title { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 20px; font-size: 13px; font-weight: 800; }
.chart-title small { color: var(--muted); font-size: 10px; font-weight: 500; }
#timelineChart { width: 100%; min-height: 320px; overflow: visible; }
.journal-bars { display: grid; gap: 14px; }
.journal-row { display: grid; grid-template-columns: 142px 1fr 24px; gap: 10px; align-items: center; font-size: 11px; }
.journal-row .track { height: 10px; overflow: hidden; background: var(--paper-2); border-radius: 99px; }
.journal-row .fill { display: block; height: 100%; background: var(--orange); border-radius: inherit; }
.journal-row b { text-align: right; }
.venn { position: relative; width: 290px; height: 190px; margin: 22px auto 0; }
.venn-circle { position: absolute; top: 10px; width: 170px; height: 170px; padding: 46px 36px; border-radius: 50%; color: #fff; }
.venn-circle.s { left: 0; background: rgba(45,104,112,.84); text-align: left; }
.venn-circle.c { right: 0; background: rgba(133,105,143,.82); text-align: right; }
.venn-circle strong,.venn-both strong { display: block; font: 700 32px/1 var(--serif); }
.venn-circle span,.venn-both span { font-size: 10px; }
.venn-both { position: absolute; z-index: 2; top: 62px; left: 116px; width: 58px; color: #fff; text-align: center; }
.venn-both strong { font-size: 28px; }
.field-reading { display: grid; grid-template-columns: repeat(3,1fr); gap: 28px; max-width: 1220px; margin-top: 28px; }
.field-reading div { display: grid; grid-template-columns: 32px 1fr; gap: 14px; padding-top: 18px; border-top: 2px solid var(--ink); }
.field-reading span { color: var(--orange); font: 700 15px var(--serif); }
.field-reading p { margin: 0; font-size: 13px; }

.atlas-section { background: var(--paper); }
.filter-bar { position: sticky; z-index: 20; top: 70px; display: flex; flex-wrap: wrap; gap: 8px; max-width: max-content; padding: 8px; background: rgba(247,241,230,.92); border: 1px solid var(--line); border-radius: 7px; backdrop-filter: blur(12px); }
.filter { padding: 8px 12px; color: var(--muted); background: transparent; border: 0; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: 750; }
.filter.active { color: var(--paper); background: var(--ink); }
.filter span { opacity: .7; }
.filter-status { margin: 18px 0 48px; color: var(--muted); font-size: 11px; }
.paper-group { margin-bottom: 72px; }
.group-heading { display: grid; grid-template-columns: 70px 1fr auto; gap: 18px; align-items: end; margin-bottom: 22px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.group-no { color: var(--orange); font: italic 700 30px/1 var(--serif); }
.group-heading h3 { margin: 0; font: 700 clamp(28px,3vw,42px)/1 var(--serif); }
.group-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.paper-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.paper-card { position: relative; min-height: 325px; padding: 22px; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 7px; transition: transform .2s ease, box-shadow .2s ease; }
.paper-card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(23,43,47,.1); }
.paper-card[hidden] { display: none; }
.paper-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.paper-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.paper-source { color: var(--orange); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-decoration: none; }
.paper-source:hover,.paper-source:focus-visible { text-decoration: underline; }
.paper-read { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 8px 11px; color: var(--white); background: var(--ink); border-radius: 4px; font-size: 10px; font-weight: 850; letter-spacing: .06em; text-decoration: none; text-transform: uppercase; transition: background .2s ease, transform .2s ease; }
.paper-read:hover,.paper-read:focus-visible { background: var(--orange); transform: translateX(2px); }
.track-badge { padding: 3px 7px; border: 1px solid currentColor; border-radius: 99px; font-size: 9px; font-weight: 850; }
.track-S { color: var(--teal); }
.track-C { color: var(--purple); }
.track-SC { color: var(--orange); }
.new-badge { padding: 3px 7px; color: #fff; background: var(--orange); border-radius: 99px; font-size: 8px; font-weight: 850; letter-spacing: .05em; }
.paper-card h4 { margin: 0 0 6px; font: 700 21px/1.22 var(--serif); }
.paper-en { min-height: 32px; margin-bottom: 20px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.paper-note { display: grid; grid-template-columns: 42px 1fr; gap: 10px; margin-top: 13px; }
.paper-note b { color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.paper-note p { margin: 0; font-size: 12px; line-height: 1.65; }
.paper-card-expanded { min-height: 0; padding: 24px; border-top: 4px solid var(--orange); }
.paper-card-expanded .paper-en { min-height: 0; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.paper-card-expanded .paper-note { grid-template-columns: 54px 1fr; margin-top: 0; padding: 13px 0; border-bottom: 1px solid rgba(23,43,47,.1); }
.paper-card-expanded .paper-note b { color: var(--ink); line-height: 1.5; }
.paper-card-expanded .paper-note-hard { margin-inline: -12px; padding-inline: 12px; background: rgba(255,207,102,.14); border-radius: 4px; }
.paper-card-expanded .paper-note-new { border-bottom: 0; }
.paper-card-expanded .paper-note-new b { color: var(--orange); }
.paper-card-expanded .paper-glyph { opacity: .055; }
.paper-glyph { position: absolute; right: -12px; bottom: -14px; width: 112px; height: 82px; opacity: .11; }
.paper-glyph path,.paper-glyph line,.paper-glyph circle,.paper-glyph rect { vector-effect: non-scaling-stroke; }
.empty-message { padding: 50px; color: var(--muted); text-align: center; border: 1px dashed var(--line); }

.edges-section { color: var(--paper); background: #26383c; }
.edges-section .section-head > p:last-child { color: #b7c1c3; }
.edge-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.edge-grid article { padding: 28px; border: 1px solid rgba(255,255,255,.18); border-radius: 7px; }
.edge-grid span { color: var(--yellow); font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.edge-grid h3 { margin: 22px 0 12px; font: 700 25px/1.2 var(--serif); }
.edge-grid p { margin: 0; color: #bdc7c8; font-size: 13px; }
.boundary-note { max-width: 850px; margin-top: 44px; padding-left: 24px; border-left: 3px solid var(--orange); }
.boundary-note p { color: #bdc7c8; font-size: 12px; }
.boundary-note b { color: #fff; }
footer { min-height: 100px; padding: 35px clamp(22px,7vw,110px); display: flex; justify-content: space-between; gap: 20px; align-items: center; color: var(--muted); background: #102326; font-size: 10px; letter-spacing: .08em; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { max-width: 620px; justify-self: center; }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-panel.wide { grid-row: auto; }
  .paper-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .field-reading,.edge-grid { grid-template-columns: 1fr; }
  .window-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .topbar nav { display: none; }
  .hero { padding-top: 58px; }
  h1 { font-size: clamp(46px,13vw,58px); }
  .hero-stats { gap: 14px; }
  .hero-stats div { min-width: 0; flex: 1; }
  .gate-grid { grid-template-columns: 1fr; }
  .or-mark { min-height: 44px; }
  .gate { grid-template-columns: 1fr; }
  .gate-letter { font-size: 48px; }
  .decision-figure { overflow-x: auto; }
  .decision-figure svg { min-width: 700px; }
  .chart-panel { padding: 16px; overflow-x: auto; }
  #timelineChart { min-width: 680px; }
  .paper-grid { grid-template-columns: 1fr; }
  .group-heading { grid-template-columns: 52px 1fr; }
  .group-heading p { grid-column: 2; }
  .filter-bar { top: 64px; max-width: none; flex-wrap: nowrap; overflow-x: auto; }
  .filter { white-space: nowrap; }
  .paper-card { min-height: 300px; }
  footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { transition: none !important; animation: none !important; }
}
