:root {
  --paper: #ede5d5;
  --paper-deep: #dcd0bb;
  --ink: #20251f;
  --forest: #263d31;
  --forest-deep: #1c2d24;
  --signal: #b53b13;
  --signal-hot: #ff7a3d;
  --muted: #66675e;
  --rule: #b9ad99;
  --dark-rule: #596057;
  --dark-muted: #a5a293;
  --dark-text: #c7c1b2;
  --white: #f3ecdf;
  --content: 1180px;
  color-scheme: light;
  font-family: "Aptos", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: inherit; }

.site-header {
  position: absolute;
  z-index: 10;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 76px;
  padding: 0 4vw;
  border-bottom: 1px solid var(--rule);
}

.brand {
  font: 400 27px/1 Georgia, serif;
  letter-spacing: -.05em;
  text-decoration: none;
}

.brand span { color: var(--signal); }
.site-header nav { display: flex; gap: 32px; }
.site-header nav a, .nav-cta { font-size: 13px; text-decoration: none; }
.nav-cta {
  justify-self: end;
  display: flex;
  gap: 22px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ink);
}

.nav-cta span, .text-link span { display: inline-block; transition: transform .2s ease; }
.nav-cta:hover span, .text-link:hover span { transform: translate(5px, -5px); }

.case-hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(360px, .72fr) minmax(540px, 1.28fr);
  gap: clamp(45px, 7vw, 120px);
  align-items: center;
  padding: 118px 6vw 62px;
  background:
    radial-gradient(circle at 9% 18%, rgba(255,255,255,.34), transparent 31%),
    linear-gradient(106deg, var(--paper) 0 48%, var(--paper-deep) 48% 100%);
}

.hero-copy { animation: rise-in .7s ease-out both; }
.eyebrow, .section-number, .figure-label, .case-meta, .reading-index,
.bar-row, .bar-axis, .pipeline, .metric-label, .measurement-table {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.eyebrow, .section-number {
  margin: 0 0 24px;
  color: var(--signal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  font: 400 clamp(76px, 10vw, 154px)/.78 Georgia, serif;
  letter-spacing: -.075em;
}

.hero-copy h2 {
  max-width: 660px;
  margin: 38px 0 24px;
  font: 400 clamp(36px, 4vw, 58px)/1.02 Georgia, serif;
  letter-spacing: -.045em;
}

.hero-copy h2 em { color: var(--signal); font-style: normal; }
.hero-copy > p:not(.eyebrow):not(.case-meta) {
  max-width: 585px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.case-meta {
  margin-top: 36px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.hero-measurement {
  margin: 0;
  padding: clamp(24px, 3.4vw, 48px);
  background: var(--forest);
  color: var(--white);
  box-shadow: 0 25px 70px rgba(32, 25, 15, .14);
  animation: slide-in .85s .1s ease-out both;
}

.figure-label {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 35px;
  color: var(--dark-text);
  font-size: 11px;
}

.figure-label strong { color: var(--signal-hot); font-weight: 600; }
.bar-chart { display: grid; gap: 21px; }
.bar-row {
  display: grid;
  grid-template-columns: 142px minmax(160px, 1fr) 74px;
  gap: 15px;
  align-items: center;
  color: var(--white);
  font-size: 11px;
}

.bar-row b { font-weight: 500; text-align: right; }
.bar-row i {
  position: relative;
  display: block;
  height: 26px;
  border-inline: 1px solid rgba(243,236,223,.56);
  background-image:
    linear-gradient(to right,
      transparent 0 30.103%, rgba(243,236,223,.07) 30.103% calc(30.103% + 1px),
      transparent calc(30.103% + 1px) 47.712%, rgba(243,236,223,.07) 47.712% calc(47.712% + 1px),
      transparent calc(47.712% + 1px) 60.206%, rgba(243,236,223,.07) 60.206% calc(60.206% + 1px),
      transparent calc(60.206% + 1px) 69.897%, rgba(243,236,223,.07) 69.897% calc(69.897% + 1px),
      transparent calc(69.897% + 1px) 77.815%, rgba(243,236,223,.07) 77.815% calc(77.815% + 1px),
      transparent calc(77.815% + 1px) 84.510%, rgba(243,236,223,.07) 84.510% calc(84.510% + 1px),
      transparent calc(84.510% + 1px) 90.309%, rgba(243,236,223,.07) 90.309% calc(90.309% + 1px),
      transparent calc(90.309% + 1px) 95.424%, rgba(243,236,223,.07) 95.424% calc(95.424% + 1px),
      transparent calc(95.424% + 1px)),
    linear-gradient(to right, rgba(243,236,223,.14) 1px, transparent 1px);
  background-size: 25% 100%;
  background-repeat: repeat-x;
}

.bar-row i::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: max(var(--bar), 3px);
  background: var(--white);
  transform-origin: left;
  animation: grow-bar .8s calc(.25s + var(--delay)) ease-out both;
}

.bar-row.final { color: var(--signal-hot); }
.bar-row.final i::after { background: var(--signal-hot); }
.bar-axis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: -8px 89px 0 157px;
  color: var(--dark-muted);
  font-size: 10px;
}

.bar-axis span { grid-row: 1; text-align: center; }
.bar-axis span:nth-child(1) { grid-column: 1; justify-self: start; }
.bar-axis span:nth-child(2) { grid-column: 1 / 3; justify-self: center; }
.bar-axis span:nth-child(3) { grid-column: 2 / 4; justify-self: center; }
.bar-axis span:nth-child(4) { grid-column: 3 / 5; justify-self: center; }
.bar-axis span:nth-child(5) { grid-column: 4; justify-self: end; }

.hero-measurement figcaption {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--dark-rule);
  color: var(--dark-text);
  font: 12px/1.55 "SFMono-Regular", Consolas, monospace;
}

.case-body {
  display: grid;
  grid-template-columns: 190px minmax(0, 820px);
  gap: clamp(50px, 8vw, 125px);
  max-width: var(--content);
  margin: 0 auto;
  padding: 112px 32px 132px;
}

.reading-index {
  position: sticky;
  top: 32px;
  align-self: start;
  display: grid;
  gap: 14px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.reading-index::before {
  content: "Case study";
  margin-bottom: 11px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--rule);
  color: var(--signal);
  font-weight: 700;
}

.reading-index a { text-decoration: none; }
.reading-index a:hover { color: var(--signal); }
.article-flow { min-width: 0; }
.article-flow > section { scroll-margin-top: 30px; margin-bottom: 112px; }
.article-flow > section:last-child { margin-bottom: 0; }

.article-flow h2 {
  max-width: 760px;
  margin: 0 0 34px;
  font: 400 clamp(40px, 5vw, 66px)/1 Georgia, serif;
  letter-spacing: -.045em;
}

.article-flow h3 {
  margin: 48px 0 15px;
  font: 400 28px/1.2 Georgia, serif;
  letter-spacing: -.02em;
}

.article-flow p {
  max-width: 730px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.72;
}

.article-flow .lead {
  max-width: 790px;
  color: var(--ink);
  font: 400 clamp(27px, 3vw, 38px)/1.35 Georgia, serif;
  letter-spacing: -.025em;
}

.article-flow strong { color: var(--ink); }
.article-flow .diagnostic-prompt {
  max-width: 790px;
  margin: 44px 0 0;
  padding: 18px 0;
  border-top: 1px solid var(--signal);
  border-bottom: 1px solid var(--signal);
  color: var(--signal);
  font: 650 13px/1.6 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .015em;
}

.diagnostic-prompt strong { color: var(--signal); font-weight: 800; }
.mechanism-list { margin-top: 24px; }
.optimization-list { margin-top: 48px; }
.mechanism-list, .optimization-list { border-top: 1px solid var(--rule); }
.mechanism-list > div, .optimization-list > div {
  display: grid;
  grid-template-columns: minmax(170px, .75fr) minmax(0, 1.25fr);
  gap: 36px;
  padding: 23px 0;
  border-bottom: 1px solid var(--rule);
}

.mechanism-list dt, .optimization-list dt {
  font: 400 22px/1.3 Georgia, serif;
}

.mechanism-list dt span {
  display: block;
  margin-top: 9px;
  color: var(--signal);
  font: 700 10px/1.5 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: color .18s ease, transform .18s ease;
}

.mechanism-list > div:hover dt span {
  color: var(--ink);
  transform: translateX(3px);
}

.mechanism-list dd, .optimization-list dd {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.stage-progression { margin-top: 50px; border-top: 1px solid var(--rule); }
.stage {
  display: grid;
  grid-template-columns: 98px 175px 1fr;
  gap: 28px;
  padding: 28px 0 31px;
  border-bottom: 1px solid var(--rule);
}

.stage .time {
  color: var(--signal);
  font: 600 15px/1.4 "SFMono-Regular", Consolas, monospace;
}

.stage h3 { margin: 0; font-size: 24px; }
.stage p { margin: 0; font-size: 16px; line-height: 1.6; }

.architecture-section {
  width: 100%;
}

.architecture-figure {
  margin: 48px 0 0;
  padding: clamp(25px, 4vw, 52px);
  background: var(--forest);
  color: var(--white);
}

.boundary-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 18px;
  color: var(--dark-muted);
  font: 10px/1.4 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.boundary-labels span:last-child { text-align: right; }
.pipeline {
  display: grid;
  grid-template-columns: 1fr 34px 1.15fr 34px 1fr 34px 1.1fr;
  align-items: stretch;
}

.pipeline-step {
  min-height: 174px;
  padding: 18px;
  border: 1px solid var(--dark-rule);
}

.pipeline-step.kernel { border-color: rgba(255,122,61,.72); background: rgba(255,122,61,.08); }
.pipeline-step b {
  display: block;
  margin-bottom: 13px;
  color: var(--signal-hot);
  font-size: 11px;
  font-weight: 600;
}

.pipeline-step code {
  display: block;
  margin-bottom: 9px;
  color: var(--white);
  font-size: 11px;
  line-height: 1.45;
}

.pipeline-step small { display: block; color: var(--dark-text); font-size: 10px; line-height: 1.5; }
.pipeline-arrow { position: relative; min-width: 0; }
.pipeline-arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  border-top: 1px solid var(--signal-hot);
}

.pipeline-arrow::after {
  content: "›";
  position: absolute;
  top: calc(50% - 14px);
  right: -1px;
  color: var(--signal-hot);
  font: 22px/1 Georgia, serif;
}

.architecture-figure figcaption {
  margin-top: 24px;
  padding-top: 17px;
  border-top: 1px solid var(--dark-rule);
  color: var(--dark-text);
  font: 11px/1.6 "SFMono-Regular", Consolas, monospace;
}

.measurement-band {
  padding: 96px 6vw 104px;
  background: var(--forest);
  color: var(--white);
}

.measurement-inner { max-width: var(--content); margin: 0 auto; }
.measurement-band .section-number { color: var(--signal-hot); }
.measurement-band h2 {
  max-width: 820px;
  margin: 0 0 58px;
  font: 400 clamp(42px, 5vw, 68px)/1 Georgia, serif;
  letter-spacing: -.045em;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--dark-rule);
  border-bottom: 1px solid var(--dark-rule);
}

.metric { padding: 32px 28px 34px 0; }
.metric + .metric { padding-left: 28px; border-left: 1px solid var(--dark-rule); }
.metric strong {
  display: block;
  margin-bottom: 10px;
  color: var(--signal-hot);
  font: 400 clamp(40px, 5vw, 64px)/1 Georgia, serif;
  letter-spacing: -.04em;
}

.metric-label { color: var(--dark-text); font-size: 10px; line-height: 1.5; text-transform: uppercase; }
.measurement-copy {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 8vw;
  margin-top: 65px;
}

.measurement-copy h3 { margin: 0; font: 400 34px/1.2 Georgia, serif; }
.measurement-copy p { margin: 0; color: var(--dark-text); font-size: 17px; line-height: 1.7; }
.measurement-table {
  width: 100%;
  margin-top: 45px;
  border-collapse: collapse;
  color: var(--dark-text);
  font-size: 11px;
  text-align: left;
}

.measurement-table th, .measurement-table td { padding: 14px 12px; border-bottom: 1px solid var(--dark-rule); }
.measurement-table caption { max-width: 760px; margin-bottom: 18px; color: var(--dark-muted); font-size: 10px; line-height: 1.55; text-align: left; }
.measurement-table th { color: var(--white); font-weight: 500; }
.measurement-table td:last-child { color: var(--signal-hot); }
.measurement-note {
  max-width: 760px;
  margin: 23px 0 0;
  color: var(--dark-muted);
  font: 10px/1.65 "SFMono-Regular", Consolas, monospace;
}

.lesson {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 9vw;
  max-width: var(--content);
  margin: 0 auto;
  padding: 126px 32px 140px;
}

.lesson h2 {
  margin: 0;
  font: 400 clamp(42px, 5vw, 68px)/1 Georgia, serif;
  letter-spacing: -.045em;
}

.lesson-copy p { margin: 0 0 24px; color: var(--muted); font-size: 18px; line-height: 1.72; }
.lesson-copy .lesson-lead { color: var(--ink); font: 400 28px/1.4 Georgia, serif; }
.text-link {
  display: inline-flex;
  gap: 22px;
  margin-top: 22px;
  padding-bottom: 7px;
  border-bottom: 1px solid currentColor;
  color: var(--signal);
  font-size: 14px;
  text-decoration: none;
}
.lesson-copy .scope-note { margin-top: 22px; font: 11px/1.55 "SFMono-Regular", Consolas, monospace; }

.case-contact {
  min-height: 60svh;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 8vw;
  background: var(--forest-deep);
  color: var(--white);
  text-align: right;
}

.case-contact p { color: var(--dark-text); font: 11px/1.5 "SFMono-Regular", Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.case-contact > a {
  max-width: 980px;
  margin: 28px 0 45px;
  font: 400 clamp(48px, 6vw, 82px)/.96 Georgia, serif;
  letter-spacing: -.05em;
  text-decoration: none;
}

.case-contact > a span { color: var(--signal-hot); }
.case-contact small { color: var(--dark-muted); font: 10px/1.4 "SFMono-Regular", Consolas, monospace; letter-spacing: .07em; text-transform: uppercase; }

@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes grow-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 980px) {
  .case-hero { grid-template-columns: 1fr; gap: 58px; background: linear-gradient(165deg, var(--paper) 0 49%, var(--paper-deep) 49%); }
  .hero-copy { max-width: 760px; }
  .hero-copy h1 { font-size: 118px; }
  .case-body { grid-template-columns: 1fr; max-width: 860px; }
  .reading-index { position: static; grid-template-columns: repeat(5, auto); gap: 12px 22px; justify-content: start; }
  .reading-index::before { grid-column: 1 / -1; }
  .architecture-section { width: 100%; margin-left: 0; }
  .pipeline { grid-template-columns: 1fr; }
  .pipeline-arrow { min-height: 34px; }
  .pipeline-arrow::before { inset: 0 auto 0 24px; border-top: 0; border-left: 1px solid var(--signal-hot); }
  .pipeline-arrow::after { right: auto; bottom: -2px; left: 19px; top: auto; transform: rotate(90deg); }
}

@media (max-width: 700px) {
  .site-header { height: 70px; grid-template-columns: 1fr auto; padding: 0 18px; }
  .site-header nav { display: none; }
  .nav-cta { font-size: 12px; }
  .case-hero { padding: 108px 18px 48px; }
  .hero-copy h1 { font-size: clamp(72px, 25vw, 112px); }
  .hero-copy h2 { font-size: 39px; }
  .hero-copy > p:not(.eyebrow):not(.case-meta) { font-size: 17px; }
  .hero-measurement { padding: 24px 15px; overflow-x: hidden; }
  .figure-label { min-width: 0; gap: 12px; font-size: 9px; }
  .figure-label strong { text-align: right; }
  .bar-chart { min-width: 0; gap: 18px; }
  .bar-row { grid-template-columns: 92px minmax(0, 1fr) 58px; gap: 8px; font-size: 9px; }
  .bar-row b { font-size: 9px; }
  .bar-axis { margin-right: 66px; margin-left: 100px; font-size: 8px; }
  .case-body { gap: 50px; padding: 82px 20px 100px; }
  .reading-index { grid-template-columns: 1fr 1fr; }
  .article-flow > section { margin-bottom: 84px; }
  .article-flow h2 { font-size: 43px; }
  .article-flow p { font-size: 17px; }
  .mechanism-list > div, .optimization-list > div, .stage { grid-template-columns: 1fr; gap: 10px; }
  .stage { gap: 12px; }
  .architecture-section { width: 100%; }
  .architecture-figure { margin-inline: -20px; padding: 28px 20px; }
  .metrics, .measurement-copy, .lesson { grid-template-columns: 1fr; }
  .metric { padding: 27px 0; }
  .metric + .metric { padding-left: 0; border-top: 1px solid var(--dark-rule); border-left: 0; }
  .measurement-copy { gap: 28px; }
  .measurement-table { display: block; overflow-x: auto; white-space: nowrap; }
  .article-flow code { overflow-wrap: anywhere; word-break: break-word; }
  .lesson { gap: 46px; padding: 92px 20px 108px; }
  .case-contact { padding: 90px 20px; }
  .case-contact > a { font-size: 13vw; }
}

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