:root {
  color-scheme: light;
  --paper: #f2f5f2;
  --surface: #ffffff;
  --sage: #8da28c;
  --sage-soft: #e7ede7;
  --cream: #eee9c1;
  --caramel: #a4530c;
  --brown: #3a230a;
  --muted: rgba(58, 35, 10, .7);
  --line: rgba(58, 35, 10, .2);
  --shadow: 0 24px 70px rgba(58, 35, 10, .13);
  --serif: Georgia, "Times New Roman", "Noto Serif SC", serif;
  --sans: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  font-family: var(--sans);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: clip; background: var(--paper); color: var(--brown); }
img, video { display: block; max-width: 100%; }
button, a { font: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(164, 83, 12, .48);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 1000;
  padding: 11px 14px;
  background: var(--brown);
  color: white;
}
.skip-link:focus { top: 14px; }

.project-header {
  position: sticky;
  top: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 74px;
  padding: 10px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(242, 245, 242, .9);
  backdrop-filter: blur(14px);
}
.wordmark { display: grid; width: fit-content; text-decoration: none; }
.wordmark > span { font: 700 1.14rem/1 var(--serif); letter-spacing: .08em; }
.wordmark small { margin-top: 4px; color: var(--muted); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; }
.view-switch { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); background: var(--surface); }
.view-switch a { display: grid; min-width: 128px; padding: 8px 12px; text-align: center; text-decoration: none; font-size: .78rem; font-weight: 750; }
.view-switch a span { color: inherit; font-size: .62rem; font-weight: 500; opacity: .68; }
.view-switch a:hover { background: var(--sage-soft); }
.view-switch .is-current { background: var(--brown); color: white; }
.motion-toggle { justify-self: end; border: 0; background: transparent; color: var(--caramel); cursor: pointer; font-size: .7rem; font-weight: 800; }
.motion-toggle span { display: block; color: var(--muted); font-size: .58rem; font-weight: 500; }

.chapter-rail {
  position: fixed;
  top: 50%;
  left: clamp(12px, 2vw, 30px);
  z-index: 50;
  display: grid;
  grid-template-columns: 2px 34px 1fr;
  gap: 10px;
  align-items: start;
  width: 190px;
  transform: translateY(-42%);
}
.chapter-progress { height: 210px; background: rgba(58, 35, 10, .12); }
.chapter-progress span { display: block; width: 100%; height: 20%; background: var(--caramel); transition: height .5s cubic-bezier(.22,1,.36,1); }
.chapter-rail > p { margin: 0; font: 700 .72rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.chapter-rail nav { display: grid; gap: 13px; }
.chapter-rail nav a { display: grid; grid-template-columns: 20px 1fr; gap: 7px; color: var(--muted); text-decoration: none; font-size: .65rem; line-height: 1.25; transition: color .2s ease, transform .2s ease; }
.chapter-rail nav a span { color: var(--caramel); font-variant-numeric: tabular-nums; }
.chapter-rail nav a.is-active { color: var(--brown); font-weight: 800; transform: translateX(4px); }

main { width: min(1440px, calc(100% - 48px)); margin: 0 auto; }
.eyebrow, .chapter-no { margin: 0; font-size: .67rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.translation, [lang="en"] { color: var(--muted); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(480px, 1.15fr);
  gap: clamp(30px, 5vw, 88px);
  align-items: center;
  min-height: calc(100dvh - 74px);
  padding: clamp(56px, 8vw, 116px) 0;
}
.hero-copy { padding-left: clamp(0px, 10vw, 150px); }
.hero h1 { max-width: 760px; margin: 18px 0 20px; font: 700 clamp(3rem, 6vw, 7rem)/.92 var(--serif); letter-spacing: -.065em; }
.hero-en { max-width: 660px; margin: 0 0 36px; font: italic clamp(1rem, 1.45vw, 1.35rem)/1.5 var(--serif); }
.hero-summary { max-width: 640px; margin: 0 0 12px; font-size: 1rem; line-height: 1.85; }
.hero .translation { max-width: 660px; margin: 0; font-size: .84rem; line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.primary-link, .secondary-link {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 15px;
  border: 1px solid var(--brown);
  text-decoration: none;
  font-weight: 800;
  transition: transform .18s ease, background-color .18s ease, color .18s ease;
}
.primary-link { background: var(--brown); color: white; }
.secondary-link { background: var(--surface); color: var(--brown); }
.primary-link span, .secondary-link span { font-size: .68rem; font-weight: 500; opacity: .78; }
.primary-link:hover, .secondary-link:hover { transform: translateY(-2px); }
.secondary-link:hover { background: var(--sage-soft); }
.primary-link:hover { background: #573817; }

.hero-media { margin: 0; }
.hero-media-frame { position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: var(--sage); box-shadow: var(--shadow); clip-path: inset(0 0 0 0 round 1px); }
.hero-media-frame::after { content: "T2 / PROTOTYPE EVIDENCE"; position: absolute; right: 12px; bottom: 12px; padding: 6px 8px; background: rgba(58,35,10,.86); color: white; font-size: .58rem; letter-spacing: .12em; }
.hero-media-frame img, .hero-media-frame video { width: 100%; height: 100%; object-fit: cover; }
.hero-media-frame img { animation: material-breathe 9s ease-in-out infinite alternate; }
.hero-media.is-video .hero-media-frame img { display: none; }
.hero-media video { opacity: 0; transition: opacity .45s ease; }
.hero-media.is-video video { opacity: 1; }
.video-control { position: absolute; right: 12px; top: 12px; z-index: 2; border: 1px solid rgba(255,255,255,.72); background: rgba(58,35,10,.72); color: white; padding: 8px 10px; cursor: pointer; font-size: .7rem; }
.hero-media figcaption { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 12px; color: var(--muted); font-size: .68rem; line-height: 1.5; }
@keyframes material-breathe { from { transform: scale(1.005) translateY(0); } to { transform: scale(1.025) translateY(-4px); } }

.story-trail { margin: 0 0 clamp(100px, 14vw, 190px); padding: 26px; border: 1px solid var(--line); background: var(--sage); }
.trail-heading { display: flex; justify-content: space-between; gap: 30px; align-items: end; padding-bottom: 22px; border-bottom: 1px solid rgba(58,35,10,.24); }
.trail-heading h2 { margin: 7px 0 6px; font: 700 clamp(1.8rem, 3.4vw, 3.8rem)/1 var(--serif); letter-spacing: -.04em; }
.trail-heading p { margin: 0; max-width: 660px; line-height: 1.6; }
.trail-instruction { flex: 0 0 auto; text-align: right; font-size: .72rem; }
.trail-field { position: relative; min-height: 430px; overflow: hidden; isolation: isolate; cursor: crosshair; }
.trail-axis { position: absolute; inset: auto 5% 34px; display: grid; grid-template-columns: repeat(5,1fr); height: 1px; background: rgba(58,35,10,.25); }
.trail-axis span { width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--brown); }
.trail-axis span:last-child { justify-self: end; }
.trail-empty { position: absolute; inset: 50% auto auto 50%; margin: 0; transform: translate(-50%,-50%); white-space: nowrap; color: rgba(58,35,10,.6); font: italic clamp(.8rem, 1.2vw, 1.05rem) var(--serif); }
.trail-card { position: absolute; z-index: var(--z,1); width: clamp(190px, 21vw, 310px); margin: 0; pointer-events: none; background: var(--surface); box-shadow: 0 18px 50px rgba(58,35,10,.2); animation: trail-in .42s cubic-bezier(.22,1,.36,1) both; }
.trail-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.trail-card figcaption { display: grid; gap: 2px; padding: 9px 10px; font-size: .64rem; }
.trail-card figcaption span { color: var(--muted); }
.trail-card.is-leaving { animation: trail-out .3s ease both; }
@keyframes trail-in { from { opacity: 0; transform: translate(-50%,-42%) scale(.92); clip-path: inset(0 45%); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); clip-path: inset(0); } }
@keyframes trail-out { to { opacity: 0; transform: translate(-50%,-58%) scale(.96); } }

.project-section { position: relative; min-height: 82vh; padding: clamp(92px, 13vw, 180px) 0; border-top: 1px solid var(--line); scroll-margin-top: 72px; }
.section-heading { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 28px; align-items: start; margin-left: clamp(0px, 10vw, 150px); }
.section-heading h2 { max-width: 960px; margin: 0; font: 700 clamp(2.45rem, 5vw, 5.6rem)/.98 var(--serif); letter-spacing: -.055em; }
.section-heading .translation { grid-column: 2; margin: 10px 0 0; font: italic 1rem/1.5 var(--serif); }

.context-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 80px; margin: clamp(70px, 9vw, 130px) 0 0 clamp(0px, 10vw, 150px); }
.big-copy { margin: 0; font: 400 clamp(1.7rem, 3vw, 3.4rem)/1.3 var(--serif); letter-spacing: -.025em; }
.context-statement .translation { margin: 26px 0 0; line-height: 1.7; }
.fact-ledger { margin: 0; border-top: 1px solid var(--brown); }
.fact-ledger div { display: grid; grid-template-columns: 105px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.fact-ledger dt { color: var(--caramel); font-size: .68rem; font-weight: 850; }
.fact-ledger dd { margin: 0; font-size: .86rem; line-height: 1.55; }
.fact-ledger dd span { display: block; margin-top: 5px; font-size: .68rem; }

.archive-shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; margin: clamp(70px, 8vw, 120px) 0 0 clamp(0px, 10vw, 150px); }
.archive-index { border-top: 1px solid var(--brown); }
.archive-index button { display: grid; grid-template-columns: 30px 1fr; width: 100%; padding: 16px 5px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--muted); text-align: left; cursor: pointer; transition: padding-left .2s ease, background-color .2s ease, color .2s ease; }
.archive-index button span { color: inherit; font-weight: 800; }
.archive-index button small { grid-column: 2; margin-top: 3px; font-size: .64rem; }
.archive-index button:hover { padding-left: 10px; background: var(--sage-soft); }
.archive-index button[aria-selected="true"] { padding-left: 10px; background: var(--brown); color: white; }
.archive-viewer { min-width: 0; margin: 0; }
.archive-image-mask { overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.archive-image-mask img { width: 100%; aspect-ratio: 16/9; object-fit: contain; transition: opacity .22s ease, transform .55s cubic-bezier(.22,1,.36,1), clip-path .45s ease; }
.archive-viewer.is-switching img { opacity: 0; transform: translateX(22px) scale(.985); clip-path: inset(0 0 0 18%); }
.archive-viewer figcaption { display: grid; grid-template-columns: 1fr auto; gap: 5px 20px; padding-top: 13px; font-size: .68rem; }
.archive-viewer figcaption strong { font-size: .8rem; }
.archive-viewer figcaption span { color: var(--muted); }
.archive-viewer figcaption [lang="en"] { grid-column: 1 / -1; }

.comparison-report { display: grid; grid-template-columns: .9fr 1.1fr; gap: 70px; align-items: end; margin: 90px 0 0 clamp(0px, 10vw, 150px); padding: 30px; border: 1px solid var(--line); background: var(--surface); }
.comparison-report h3 { max-width: 620px; margin: 8px 0 18px; font: 700 clamp(1.6rem, 2.8vw, 3rem)/1.05 var(--serif); }
.comparison-report p { margin: 8px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.7; }
.score-comparison { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; align-items: end; min-height: 250px; }
.score-comparison div { display: grid; grid-template-rows: auto auto 1fr; height: 100%; padding: 13px; border: 1px solid var(--line); }
.score-comparison span { font-size: .7rem; }
.score-comparison strong { font: 700 2.2rem/1 var(--serif); }
.score-comparison i { align-self: end; display: block; width: 100%; height: calc(var(--score) * 4px); max-height: 170px; background: var(--sage); transform-origin: bottom; animation: score-rise .8s cubic-bezier(.22,1,.36,1) both; }
.score-comparison .is-emphasized { background: var(--sage-soft); border-color: var(--sage); }
.score-comparison .is-emphasized i { background: var(--brown); }
@keyframes score-rise { from { transform: scaleY(0); } }

.behaviour-visuals { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: clamp(70px, 8vw, 120px) 0 0 clamp(0px, 10vw, 150px); }
.behaviour-visuals figure { margin: 0; background: var(--surface); }
.behaviour-visuals img { width: 100%; aspect-ratio: 16/9; object-fit: contain; }
.behaviour-visuals figcaption { padding: 10px 12px; color: var(--muted); font-size: .67rem; }
.state-report { margin: 22px 0 0 clamp(0px, 10vw, 150px); padding: 30px; border: 1px solid var(--line); background: var(--surface); }
.state-report-heading { display: flex; justify-content: space-between; gap: 30px; align-items: end; }
.state-report h3 { margin: 7px 0 8px; font: 700 clamp(1.5rem, 2.6vw, 2.8rem)/1 var(--serif); }
.state-report-heading p { max-width: 620px; margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.6; }
.state-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.state-tabs button { border: 1px solid var(--line); background: var(--surface); color: var(--brown); padding: 9px 12px; cursor: pointer; font-size: .7rem; font-weight: 800; }
.state-tabs button:hover { background: var(--sage-soft); }
.state-tabs button[aria-selected="true"] { background: var(--brown); color: white; }
.parameter-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; margin-top: 24px; border: 1px solid var(--line); background: var(--line); }
.parameter-grid div { min-height: 78px; padding: 10px; background: var(--paper); transition: background-color .2s ease, transform .2s ease; }
.parameter-grid div:hover { z-index: 1; background: var(--sage-soft); transform: translateY(-2px); }
.parameter-grid span { display: block; color: var(--caramel); font-size: .64rem; font-weight: 850; }
.parameter-grid strong { display: block; margin-top: 12px; font: 700 1.25rem/1 var(--serif); }
.parameter-grid strong small { font: 500 .62rem var(--sans); }
.data-source { margin: 12px 0 0; color: var(--muted); font-size: .64rem; }

.iteration-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 50px; margin: clamp(70px, 8vw, 120px) 0 0 clamp(0px, 10vw, 150px); }
.iteration-diagram { margin: 0; }
.iteration-diagram img { width: 100%; background: var(--surface); box-shadow: var(--shadow); }
.iteration-diagram figcaption { margin-top: 10px; color: var(--muted); font-size: .68rem; }
.decision-notes ol { margin: 0; padding: 0; list-style: none; counter-reset: decisions; border-top: 1px solid var(--brown); }
.decision-notes li { position: relative; padding: 20px 0 20px 42px; border-bottom: 1px solid var(--line); counter-increment: decisions; }
.decision-notes li::before { content: "0" counter(decisions); position: absolute; left: 0; top: 21px; color: var(--caramel); font-size: .68rem; font-weight: 850; }
.decision-notes span { display: block; margin-bottom: 7px; color: var(--muted); font-size: .65rem; }
.decision-notes strong { font: 700 1.08rem/1.35 var(--serif); }
.decision-notes p { margin: 7px 0 0; font-size: .68rem; line-height: 1.55; }

.outcome-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 30px; margin: clamp(70px, 8vw, 120px) 0 0 clamp(0px, 10vw, 150px); }
.outcome-evidence { margin: 0; background: var(--surface); box-shadow: var(--shadow); }
.outcome-evidence img { width: 100%; }
.outcome-evidence figcaption { display: grid; gap: 6px; padding: 18px; font-size: .72rem; line-height: 1.55; }
.outcome-evidence figcaption span { color: var(--muted); }
.evidence-status { display: grid; gap: 14px; }
.evidence-status article { padding: 22px; border: 1px solid var(--line); background: var(--surface); }
.status-label { width: fit-content; margin: 0 0 30px; padding: 5px 7px; font-size: .62rem; font-weight: 850; }
.status-label.is-present { background: var(--sage); }
.status-label.is-needed { background: var(--cream); }
.evidence-status h3 { margin: 0 0 10px; font: 700 1.35rem var(--serif); }
.evidence-status p { color: var(--muted); font-size: .74rem; line-height: 1.65; }

.workbench-extension { display: grid; grid-template-columns: 1fr 1.15fr; gap: 60px; margin: 100px 0 0 clamp(0px, 10vw, 150px); padding: clamp(28px, 5vw, 64px); background: var(--sage); }
.extension-intro h3 { margin: 8px 0 18px; font: 700 clamp(2rem, 3.5vw, 4rem)/1 var(--serif); letter-spacing: -.045em; }
.extension-intro p { line-height: 1.7; }
.extension-intro .translation { font-size: .76rem; }
.workflow-preview { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--brown); }
.workflow-preview li { display: grid; grid-template-columns: 34px 1fr; gap: 5px 10px; padding: 15px 0; border-bottom: 1px solid rgba(58,35,10,.25); }
.workflow-preview li > span { grid-row: span 2; color: var(--caramel); font-size: .7rem; font-weight: 850; }
.workflow-preview strong { font-size: .88rem; }
.workflow-preview small { color: var(--muted); font-size: .65rem; }
.extension-link { grid-column: 2; justify-self: start; }

.project-footer { display: grid; grid-template-columns: 1fr 1fr auto; gap: 30px; width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 36px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: .68rem; line-height: 1.55; }
.project-footer p { margin: 0; }
.project-footer a { color: var(--caramel); font-weight: 800; text-underline-offset: 4px; }

.reveal-block, .reveal-media { transition: opacity .7s ease, transform .8s cubic-bezier(.22,1,.36,1), clip-path .8s cubic-bezier(.22,1,.36,1); }
.js .reveal-block:not(.is-visible) { opacity: 0; transform: translateY(28px); }
.js[data-scroll-direction="up"] .reveal-block:not(.is-visible) { transform: translateY(-22px); }
.js .reveal-media:not(.is-visible) { opacity: 0; transform: translateY(20px); clip-path: inset(0 0 35% 0); }
.is-visible { opacity: 1; transform: none; clip-path: inset(0); }

html[data-motion="off"] { scroll-behavior: auto; }
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after { animation: none !important; transition-duration: .001ms !important; }

@media (max-width: 1180px) {
  .chapter-rail { display: none; }
  .hero-copy, .section-heading, .context-grid, .archive-shell, .comparison-report, .behaviour-visuals, .state-report, .iteration-grid, .outcome-grid, .workbench-extension { margin-left: 0; }
  .hero { grid-template-columns: 1fr 1fr; }
  .hero-copy { padding-left: 0; }
  .parameter-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 820px) {
  .project-header { grid-template-columns: 1fr auto; gap: 12px; min-height: 64px; }
  .motion-toggle { display: none; }
  .view-switch a { min-width: 104px; padding: 7px 8px; }
  main, .project-footer { width: min(100% - 28px, 1440px); }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 64px; }
  .hero h1 { font-size: clamp(3.25rem, 14vw, 5.8rem); }
  .hero-media { max-width: 760px; }
  .trail-heading { align-items: start; flex-direction: column; }
  .trail-instruction { text-align: left; }
  .trail-field { min-height: 360px; }
  .section-heading { grid-template-columns: 1fr; gap: 12px; }
  .section-heading .translation { grid-column: 1; }
  .context-grid, .comparison-report, .iteration-grid, .outcome-grid, .workbench-extension { grid-template-columns: 1fr; gap: 34px; }
  .archive-shell { grid-template-columns: 1fr; }
  .archive-index { display: grid; grid-template-columns: 1fr 1fr; }
  .archive-index button { border-right: 1px solid var(--line); }
  .behaviour-visuals { grid-template-columns: 1fr; }
  .state-report-heading { align-items: start; flex-direction: column; }
  .parameter-grid { grid-template-columns: repeat(3, 1fr); }
  .extension-link { grid-column: 1; }
  .project-footer { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .project-header { padding-inline: 14px; }
  .wordmark small { display: none; }
  .view-switch a { min-width: 82px; font-size: .68rem; }
  .view-switch a span { display: none; }
  .hero { gap: 38px; padding-top: 45px; }
  .hero h1 { font-size: clamp(2.85rem, 15vw, 4.4rem); }
  .hero-media figcaption { grid-template-columns: 1fr; }
  .hero-actions, .primary-link, .secondary-link { width: 100%; }
  .story-trail { padding: 18px; }
  .trail-field { min-height: 330px; }
  .trail-empty { width: 82%; white-space: normal; text-align: center; line-height: 1.6; }
  .trail-card { width: min(240px, 72vw); }
  .project-section { min-height: auto; padding-block: 90px; }
  .section-heading h2 { font-size: clamp(2.25rem, 12vw, 3.5rem); }
  .archive-index { grid-template-columns: 1fr; }
  .archive-viewer figcaption { grid-template-columns: 1fr; }
  .score-comparison { min-height: 210px; }
  .score-comparison div { padding: 9px; }
  .score-comparison strong { font-size: 1.7rem; }
  .parameter-grid { grid-template-columns: repeat(2, 1fr); }
  .state-report { padding: 18px; }
  .workbench-extension { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal-block:not(.is-visible), .js .reveal-media:not(.is-visible) { opacity: 1; transform: none; clip-path: none; }
}
