﻿:root {
  --paper: #f2eee6;
  --paper-deep: #e9e3d7;
  --ink: #16150f;
  --ink-soft: #5b574c;
  --rule: #d9d3c5;
  --accent: #a64b1e;
  --accent-wash: rgba(166, 75, 30, 0.1);

  --serif: "Fraunces", Georgia, serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --step-0: 1.0625rem;
  --step-1: clamp(1.25rem, 1.6vw, 1.5rem);
  --step-2: clamp(1.75rem, 3.2vw, 2.75rem);
  --step-3: clamp(2.4rem, 5vw, 4rem);
  --display: clamp(3.6rem, 11vw, 8.5rem);

  --gutter: clamp(1.25rem, 5vw, 5rem);
  --section: clamp(3.75rem, 9vh, 6.5rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* A faint grain keeps the paper from looking like a flat fill. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.22;
  background-image: radial-gradient(circle at 1px 1px, rgba(22, 21, 15, 0.08) 1px, transparent 0);
  background-size: 6px 6px;
  mix-blend-mode: multiply;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  margin: 0;
}

p,
ul,
ol,
dl,
figure {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: background-color 180ms ease, border-color 180ms ease;
}

a:hover {
  background: var(--accent-wash);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip:focus {
  left: var(--gutter);
  top: 1rem;
  z-index: 10;
  background: var(--paper);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--ink);
}

.label {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.6rem var(--gutter);
  border-bottom: 1px solid var(--rule);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav a {
  border-bottom: none;
  color: var(--ink-soft);
}

.nav a:hover {
  color: var(--ink);
  background: none;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  padding: clamp(2.25rem, 6vh, 4rem) var(--gutter) clamp(3rem, 7vh, 5rem);
  overflow: clip;
}

.hero-copy {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.hero-facts {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  gap: 0.9rem;
  border-top: 1px solid var(--ink);
  padding-top: 1rem;
}

.hero-facts dt {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hero-facts dd {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.display {
  font-size: var(--display);
  line-height: 0.9;
  letter-spacing: -0.025em;
  font-weight: 300;
  margin: 0.5rem 0 1.5rem;
}

.display .line {
  display: block;
  overflow: hidden;
  /* The mask is what the letters rise out of. Without this padding it also
     crops descenders and the italic overhang. */
  padding-block: 0.06em 0.16em;
  margin-block: -0.06em -0.16em;
}

.display .line-inner {
  display: block;
}

.display .line:last-child {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

.standfirst {
  max-width: 34ch;
  font-size: var(--step-1);
  line-height: 1.5;
  font-weight: 400;
}

.stack-frame {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  width: clamp(180px, 26vw, 340px);
  translate: 0 -42%;
  perspective: 900px;
  pointer-events: none;
}

.stack {
  width: 100%;
  height: auto;
  overflow: visible;
}

.plate {
  stroke-width: 1;
}

.plate-1 {
  fill: var(--accent-wash);
  stroke: var(--accent);
}

.plate-2 {
  fill: rgba(22, 21, 15, 0.05);
  stroke: var(--ink-soft);
}

.plate-3 {
  fill: none;
  stroke: var(--rule);
}

.edge {
  stroke: var(--ink-soft);
  stroke-width: 1;
  opacity: 0.22;
  fill: none;
}

.scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  left: var(--gutter);
}

/* ---------- chapters ---------- */

.chapter {
  padding: var(--section) var(--gutter);
  border-top: 1px solid var(--rule);
}

.chapter > .label {
  margin-bottom: 1.5rem;
}

.chapter h2 {
  font-size: var(--step-2);
  line-height: 1.15;
  letter-spacing: -0.015em;
  max-width: 26ch;
  margin-bottom: clamp(2.5rem, 6vh, 4.5rem);
}

.spread {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 2rem;
}

.prose {
  grid-column: 1 / span 6;
  max-width: 62ch;
  display: grid;
  gap: 1.4rem;
}

.prose p {
  font-size: var(--step-1);
  line-height: 1.55;
  font-weight: 400;
}

.margin-note {
  grid-column: 8 / span 5;
  align-self: start;
  border-top: 1px solid var(--ink);
  padding-top: 1rem;
  display: grid;
  gap: 0.75rem;
  max-width: 40ch;
}

.margin-note p:last-child {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---------- cases ---------- */

.case {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(1.5rem, 5vw, 4.5rem);
  padding-block: clamp(2.75rem, 6vh, 4.5rem);
  border-top: 1px solid var(--rule);
}

.case:first-of-type {
  border-top: none;
}

.case-meta {
  display: grid;
  align-content: start;
  gap: 1rem;
}

.case-body {
  display: grid;
  align-content: start;
  gap: 1.5rem;
}

.case-meta h3 {
  font-size: var(--step-1);
  font-weight: 500;
}

.figure {
  font-family: var(--serif);
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 0.9;
  font-weight: 300;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.figure-unit {
  font-size: 0.35em;
  margin-left: 0.1em;
  color: var(--ink-soft);
}

.figure-caption {
  margin-top: 0.75rem;
  max-width: 38ch;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.55;
}

.prose-small {
  margin-top: 1.5rem;
  max-width: 52ch;
  line-height: 1.6;
}

.links {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- timeline ---------- */

.timeline {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0;
  border-left: 1px solid var(--rule);
  margin-left: 0.4rem;
}

.timeline li {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: 1rem 2.5rem;
  padding: 1.75rem 0 1.75rem clamp(1.25rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 2.4rem;
  width: 7px;
  height: 7px;
  background: var(--accent);
  rotate: 45deg;
}

.timeline li:last-child {
  border-bottom: none;
}

.timeline h3 {
  font-size: var(--step-1);
  font-weight: 400;
  margin-bottom: 0.5rem;
  grid-column: 2;
}

.timeline li > p.label {
  grid-row: 1;
}

.timeline li > p:last-child {
  grid-column: 2;
  max-width: 58ch;
  color: var(--ink-soft);
  font-size: 0.97rem;
}

/* ---------- spec ---------- */

.spec {
  display: grid;
  gap: 0;
  max-width: 62rem;
}

.spec > div {
  display: grid;
  grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
  gap: 1rem 2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}

.spec > div:first-child {
  border-top: 1px solid var(--rule);
}

.spec dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 0.2rem;
}

.spec dd {
  margin: 0;
  font-size: 1.02rem;
}

/* ---------- colophon ---------- */

.colophon {
  padding: var(--section) var(--gutter) 4rem;
  border-top: 1px solid var(--ink);
  display: grid;
  gap: 0.6rem;
}

.contact-line {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 300;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.contact-line a {
  border-bottom-width: 1px;
}


/* ---------- motion ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero {
    min-height: auto;
    padding-top: 3rem;
  }

  .stack-frame {
    position: static;
    translate: none;
    width: min(60vw, 320px);
    margin: 0.5rem 0 1rem;
    justify-self: end;
  }

  .spread {
    grid-template-columns: minmax(0, 1fr);
  }

  .prose,
  .margin-note {
    grid-column: 1 / -1;
  }

  .case {
    grid-template-columns: minmax(0, 1fr);
  }

  .timeline li {
    grid-template-columns: minmax(0, 1fr);
  }

  .timeline h3,
  .timeline li > p:last-child {
    grid-column: 1;
  }

  .spec > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
  }

  .scroll-hint {
    display: none;
  }
}

@media (max-width: 480px) {
  .display {
    font-size: clamp(3rem, 16vw, 4.2rem);
  }

  .nav {
    gap: 1rem;
  }
}

/* ---------- 2.5D stack ---------- */

.planes {
  position: absolute;
  right: calc(var(--gutter) + clamp(0rem, 3vw, 3rem));
  top: 50%;
  translate: 0 -50%;
  width: clamp(260px, 33vw, 440px);
  aspect-ratio: 1;
  perspective: 1100px;
  perspective-origin: 50% 45%;
  pointer-events: none;
}

.plane {
  position: absolute;
  inset: 26%;
  transform-style: preserve-3d;
  border-radius: 3px;
  transform: rotateX(62deg) rotateZ(-45deg) translateZ(0);
  box-shadow: 0 18px 40px -22px rgba(22, 21, 15, 0.55);
}

.plane-3 {
  border: 1px solid var(--rule);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.5), rgba(217, 211, 197, 0.18));
  transform: rotateX(62deg) rotateZ(-45deg) translateZ(78px);
}

.plane-2 {
  border: 1px solid rgba(91, 87, 76, 0.55);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.35), rgba(91, 87, 76, 0.08));
  transform: rotateX(62deg) rotateZ(-45deg) translateZ(39px);
}

.plane-1 {
  border: 1px solid var(--accent);
  background: linear-gradient(140deg, rgba(166, 75, 30, 0.16), rgba(166, 75, 30, 0.03));
  transform: rotateX(62deg) rotateZ(-45deg) translateZ(0);
}

.plane-legend {
  position: absolute;
  left: -1.5rem;
  bottom: 22%;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 2.1rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transform: translateX(-100%);
}

/* ---------- pinned narrative ---------- */

.js .chapter-pinned.is-pinned .pin {
  height: 200vh;
}

.js .chapter-pinned.is-pinned .pin-stage {
  position: sticky;
  top: 0;
  min-height: 100svh;
  display: grid;
  place-items: center start;
  padding: 2rem var(--gutter);
  overflow: clip;
}

.js .chapter-pinned.is-pinned .pin-step {
  grid-area: 1 / 1;
  position: relative;
  width: 100%;
  max-width: 44ch;
  opacity: 0;
  transform: translateY(28px);
  border-left: 1px solid var(--rule);
  padding-left: clamp(1rem, 3vw, 2.5rem);
}

.js .chapter-pinned.is-pinned .pin-step:first-child {
  opacity: 1;
  transform: none;
}

.pin-line {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 0.6rem 0 1.2rem;
}

/* Hidden unless the pinned sequence is active. Without this guard the ghost
   letters escape into the hero on narrow screens. */
.pin-ghost {
  display: none;
}

.js .chapter-pinned.is-pinned .pin-ghost {
  display: block;
  position: absolute;
  left: min(52ch, 48vw);
  top: 50%;
  translate: 0 -50%;
  font-family: var(--serif);
  font-size: clamp(11rem, 26vw, 22rem);
  line-height: 1;
  font-weight: 300;
  color: transparent;
  -webkit-text-stroke: 1px var(--rule);
  pointer-events: none;
  user-select: none;
}

.pin-sub {
  color: var(--ink-soft);
  max-width: 44ch;
  line-height: 1.6;
}

/* ---------- rail and cursor ---------- */

.rail {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--rule);
  z-index: 5;
  pointer-events: none;
}

.rail-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform-origin: top;
  transform: scaleY(0);
}





@media (max-width: 900px) {
  .planes {
    position: static;
    translate: none;
    width: min(64vw, 320px);
    margin: 0.5rem 0 1rem;
    justify-self: end;
  }

  .plane-legend { display: none; }

  .rail { display: none; }
}

/* ---------- hero planes, in flow ---------- */

.planes {
  position: static;
  translate: none;
  grid-column: 2;
  grid-row: 2;
  width: min(100%, 300px);
  justify-self: end;
  margin-top: 1.5rem;
  perspective: 900px;
}

.stack {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Drawn as SVG instead of rotated boxes: a 1px border on a div rotated in 3D
   aliases into a dashed line, and the plate edges never stay crisp. */
.stack-plate {
  fill: none;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.stack-plate-3 {
  stroke: var(--rule);
}

.stack-plate-2 {
  stroke: rgba(91, 87, 76, 0.5);
  fill: rgba(22, 21, 15, 0.03);
}

.stack-plate-1 {
  stroke: var(--accent);
  fill: rgba(166, 75, 30, 0.09);
}

@media (max-width: 900px) {
  .planes {
    justify-self: center;
    margin: 1.75rem auto 0;
    width: min(72vw, 300px);
  }
}

/* ---------- capability cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
}

.card {
  display: flex;
  flex-direction: column;
  padding: 1.6rem clamp(0rem, 2vw, 1.75rem) 1.9rem;
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}

.card:nth-child(2n) {
  border-right: none;
}

.card:nth-child(2n) {
  padding-right: 0;
}

.card:nth-child(2n + 1) {
  padding-left: 0;
}

.card-icon svg {
  width: 26px;
  height: 26px;
  color: var(--accent);
}

.card h3 {
  font-size: 1.3rem;
  margin: 1rem 0 0.6rem;
  font-weight: 500;
}

.card p {
  color: var(--ink-soft);
  font-size: 0.96rem;
  line-height: 1.6;
  max-width: 44ch;
}

/* ---------- stats ---------- */

.stats {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2.5rem);
  margin-top: clamp(2rem, 5vh, 3rem);
}

.stat-value {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1;
  font-weight: 300;
  letter-spacing: -0.02em;
}

.stat-label {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
  }

  .hero-copy,
  .hero-facts,
  .planes {
    grid-column: 1;
    grid-row: auto;
  }

  .planes {
    justify-self: start;
    width: min(58vw, 240px);
  }

  .cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .card {
    padding-inline: 0;
    border-right: none;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* ---------- pinned sequence on small screens ---------- */

@media (max-width: 900px) {
  .js .chapter-pinned.is-pinned .pin {
    height: 170vh;
  }

  .js .chapter-pinned.is-pinned .pin-stage {
    padding-inline: var(--gutter);
  }

  .js .chapter-pinned.is-pinned .pin-step {
    max-width: 100%;
  }

  .pin-line {
    font-size: clamp(1.8rem, 8.5vw, 2.6rem);
    line-height: 1.05;
  }

  /* The ghost letter collides with the paragraph at this width. */
  .js .chapter-pinned.is-pinned .pin-ghost {
    display: none;
  }

  .pin-sub {
    font-size: 0.98rem;
  }
}
/* ---------- figures and charts ---------- */

.figure-label {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 0.5rem;
  max-width: 30ch;
}

.chart {
  margin: 1.5rem 0 0;
}

.chart svg {
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto;
}

.chart figcaption {
  margin-top: 0.75rem;
  font-size: 0.62rem;
  max-width: 40ch;
}
/* ---------- card diagrams ---------- */

.card-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.card-head h3 {
  margin: 0;
}

.card-figure {
  margin-top: auto;
  padding-top: 1.5rem;
}

.card-figure svg {
  display: block;
  width: 100%;
  max-width: 240px;
  height: auto;
}

.card-figure text {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}