/* =====================================================================
   THORNBURY STUDIO -- BASIN
   Ported from the Next.js/Three.js source build (Thornbury_WebGL_Foundation)
   into this repo's own flat HTML/CSS/JS pattern. See DESIGN.md for the
   port decision. Fonts loaded via Google Fonts <link>, not next/font.
   ===================================================================== */

/* ---- minimal reset, ported from the source project's app/globals.css
   (the box-sizing/margin/anchor reset that normally lives at the Next
   root layout, outside the site.css this build was merged from) ---- */
* { box-sizing: border-box; padding: 0; margin: 0; }
html, body { max-width: 100vw; overflow-x: hidden; height: 100%; }
a { color: inherit; text-decoration: none; }

/* ---- from basin.css ---- */
/* =====================================================================
   BASIN — DOM layer
   Same discipline as before: the type owns the calm left/top zone, the
   canvas owns the rest, and neither ever depends on the other. Strictly
   cool palette; the only warm thing on the page is the caption's ember
   rule — the same rationing as the scene itself.
   ===================================================================== */

.basin {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
  background: #0a0e19; /* the water — identical to scene fog */
  color: #dfe7f8;
}

.basin-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.1s ease 0.15s;
}

.basin[data-status="live"] .basin-canvas {
  opacity: 1;
}

.basin[data-status="fallback"] {
  background: linear-gradient(178deg, #111726 0%, #0a0e19 55%, #06090f 100%);
}

/* ---------------------------------------------------------------
   Type block
   --------------------------------------------------------------- */
/* Low-left, seated on the same floor the shadow-pool defines — the
   type and the object stand in one room, on one ground line. */
.basin-type {
  position: absolute;
  left: clamp(24px, 6vw, 96px);
  bottom: clamp(96px, 17vh, 200px);
  max-width: 34rem;
  pointer-events: none;
}

.basin-eyebrow {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(223, 231, 248, 0.6);
  margin: 0 0 1.4rem;
}

.basin-wordmark {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 550;
  font-size: clamp(3.6rem, 7.8vw, 7rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 0;
  color: #eef3fe;
}

.basin-thesis {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
  line-height: 1.4;
  color: rgba(223, 231, 248, 0.75);
  margin: 1.6rem 0 0;
}

/* ---------------------------------------------------------------
   Caption — the page's one ember
   --------------------------------------------------------------- */
.basin-caption {
  position: absolute;
  right: clamp(24px, 6vw, 96px);
  bottom: clamp(20px, 4vh, 44px);
  display: flex;
  align-items: baseline;
  gap: 1em;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(223, 231, 248, 0.5);
  pointer-events: none;
}

.basin-caption::before {
  content: "";
  width: 2.4em;
  height: 2px;
  background: #ff4f33;
  align-self: center;
}

.basin-caption-note {
  letter-spacing: 0.08em;
  text-transform: none;
  color: rgba(223, 231, 248, 0.38);
}

/* ---------------------------------------------------------------
   Perf meter (?perf / ?report)
   --------------------------------------------------------------- */
.basin-perf {
  position: absolute;
  right: 14px;
  top: 14px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #dfe7f8;
  background: rgba(8, 13, 26, 0.8);
  border: 1px solid rgba(223, 231, 248, 0.22);
  border-radius: 4px;
  padding: 8px 11px;
  pointer-events: none;
}

.basin-perf-sent {
  color: #7ee08a;
}

/* ---------------------------------------------------------------
   Portrait — type up top, the basin below it
   --------------------------------------------------------------- */
@media (max-aspect-ratio: 4/5) {
  .basin-type {
    top: clamp(72px, 12vh, 128px);
    bottom: auto;
    max-width: 22rem;
  }

  .basin-caption {
    left: clamp(24px, 6vw, 96px);
    right: auto;
    color: rgba(223, 231, 248, 0.78);
  }
  .basin-caption-note {
    display: none;
  }
}


/* ---- from site.css ---- */
/* =====================================================================
   THORNBURY — site system, Phase 2c: THE DYE HOUSE IN DAYLIGHT
   Same room as BASIN's night, lights on. Porcelain-bone paper, the
   hero's water promoted to ink, madder as the only saturated mark, and
   full-bleed indigo PLATES as the recurring dark element — the hero is
   simply the largest plate in the book. One typeface (Fraunces, both
   optical cuts) carries the whole hierarchy; Geist Mono is the ledger
   hand. Space between groups always ≥ 2× space within them.
   ===================================================================== */

.site {
  --paper: #f1efe9;
  --paper-lit: #f8f7f3;
  --ink: #10141f;
  --ink-dim: rgba(16, 20, 31, 0.66);
  --ink-faint: rgba(16, 20, 31, 0.4);
  --hairline: rgba(16, 20, 31, 0.15);
  --madder: #a83a2e;
  --plate: #0a0e19;
  --plate-ink: #dfe7f8;
  --plate-ink-dim: rgba(223, 231, 248, 0.6);
  --band: 62px;

  background: var(--paper);
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  font-optical-sizing: auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.site ::selection {
  background: var(--madder);
  color: var(--paper);
}

/* Paper grain — a whisper of tooth over everything, the tactility that
   separates paper from #hex. Static, fixed, three-percent. */
.site::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
}

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

/* ---------------------------------------------------------------
   Navigation — the paper band. Always paper, always ink: the hero's
   dark stage sits BELOW it, framed, never behind it.
   --------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--band);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 clamp(20px, 4.5vw, 96px);
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
}

.nav-mark {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.nav-links {
  display: flex;
  gap: clamp(0.9rem, 2.4vw, 2.2rem);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-links a {
  color: var(--ink-dim);
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

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

.nav-links a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--madder);
}

/* The hero is a plate set into the paper: it yields the band's height
   and takes a hard ink edge at its foot. (/basin standalone is outside
   .site and keeps its own full-viewport dark room.) */
.site .basin {
  /* svh, NOT dvh: the small-viewport unit does not change when mobile
     browser chrome hides on scroll, so the hero box stays a fixed size
     and the scene never re-frames mid-scroll. */
  height: calc(100svh - var(--band));
  min-height: 520px;
  border-bottom: 1px solid var(--ink);
}

/* The hero keeps its own night palette — the site's ink rules must not
   reach into the plate (.site p would otherwise out-rank the hero's
   own classes and set its type dark-on-dark). */
.site .basin-eyebrow {
  color: rgba(223, 231, 248, 0.6);
  max-width: none;
}

.site .basin-thesis {
  color: rgba(223, 231, 248, 0.75);
}

/* ---------------------------------------------------------------
   Page scaffolding
   --------------------------------------------------------------- */
.page {
  flex: 1;
}

.sect {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(88px, 13vh, 168px) clamp(20px, 4.5vw, 96px);
}

.sect + .sect {
  border-top: 1px solid var(--hairline);
}

/* Page header — the page's one light is an over-lit pool of brighter
   paper, upper-left, full-bleed. Daylight, not glow. */
.page-head {
  position: relative;
  padding-top: clamp(120px, 18vh, 190px);
}

.page-head::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  pointer-events: none;
  background:
    radial-gradient(
      60% 95% at 28% -12%,
      rgba(255, 255, 255, 0.75),
      rgba(255, 255, 255, 0) 62%
    );
  animation: daylight 11s ease-in-out infinite alternate;
}

/* Daylight is never perfectly still — the page's one light breathes,
   slowly enough to be felt rather than watched. */
@keyframes daylight {
  from {
    opacity: 0.72;
    transform: translateX(-52%);
  }
  to {
    opacity: 1;
    transform: translateX(-48%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-head::before {
    animation: none;
  }
}

.page-head > * {
  position: relative;
}

/* ---------------------------------------------------------------
   PLATES — full-bleed indigo sections; the hero's world recurring
   through the site at smaller scales.
   --------------------------------------------------------------- */
.plate {
  position: relative;
  color: var(--plate-ink);
}

.plate::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  background: var(--plate);
  pointer-events: none;
}

.plate > * {
  position: relative;
}

.plate .display,
.plate .h3 {
  color: #f2f5fc;
}

.plate .dim,
.plate p {
  color: var(--plate-ink-dim);
}

.sect.plate + .sect,
.sect + .sect.plate {
  border-top: none;
}

/* ---------------------------------------------------------------
   Type roles — one family, real jumps
   --------------------------------------------------------------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9em;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 1.6rem;
}

.eyebrow::before {
  content: "";
  width: 2.4em;
  height: 2px;
  background: var(--madder);
  flex: none;
}

.plate .eyebrow {
  color: var(--plate-ink-dim);
}

/* Display XXL — the one enormous statement a page has earned. Breaks
   the measure, owns the viewport width, commands. */
.display-xxl {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 570;
  font-size: clamp(4rem, 12.5vw, 11.5rem);
  line-height: 0.94;
  letter-spacing: -0.028em;
  color: var(--ink);
  margin: 0 0 2.2rem;
  max-width: none;
}

.display-xxl em {
  font-style: italic;
  font-weight: 400;
}

/* Display XL — page titles. Oversized on purpose; allowed to cross
   the grid and own the top of the page. */
.display {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 560;
  font-size: clamp(3.4rem, 8.5vw, 7.6rem);
  line-height: 0.99;
  letter-spacing: -0.022em;
  color: var(--ink);
  margin: 0 0 2rem;
  max-width: 14ch;
}

.display em {
  font-style: italic;
  font-weight: 420;
}

/* Display L — section theses. A clear step down, still display-cut. */
.display-l {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 560;
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin: 0 0 1.4rem;
  max-width: 22ch;
}

.h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 580;
  font-size: clamp(1.35rem, 2.1vw, 1.65rem);
  line-height: 1.12;
  color: var(--ink);
  margin: 0 0 0.7rem;
}

.lede {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 430;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  line-height: 1.5;
  color: var(--ink-dim);
  max-width: 46ch;
  margin: 0 0 1.2rem;
}

/* Body — Fraunces at text optical size. 1.08rem/1.65 held to a book
   measure; the serif carries the register, the size carries the read. */
.body,
.site p {
  font-size: 1.08rem;
  line-height: 1.68;
  max-width: 34em;
  color: var(--ink);
  font-weight: 440;
}

.body + .body,
.site p + p {
  margin-top: 1em;
}

.dim {
  color: var(--ink-dim);
}

.mono {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}

.tlink {
  color: var(--ink);
  font-weight: 520;
  border-bottom: 2px solid var(--madder);
  padding-bottom: 2px;
  transition: opacity 0.2s ease;
}

.tlink:hover {
  opacity: 0.65;
}

.plate .tlink {
  color: #f2f5fc;
}

/* ---------------------------------------------------------------
   Two-column: sticky mono label left, content right, off one axis
   --------------------------------------------------------------- */
.cols {
  display: grid;
  grid-template-columns: minmax(160px, 280px) 1fr;
  gap: clamp(28px, 5vw, 96px);
  align-items: start;
}

@media (max-width: 760px) {
  .cols {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------
   Ledger rows. Word keys stay mono; numbered sequences get the
   oversized italic numerals — numbers as typographic objects.
   --------------------------------------------------------------- */
.rows {
  display: flex;
  flex-direction: column;
}

.row {
  display: grid;
  grid-template-columns: 5.2rem 1fr;
  gap: clamp(16px, 3vw, 48px);
  padding: 2rem 0;
  border-top: 1px solid var(--hairline);
}

.row:last-child {
  border-bottom: 1px solid var(--hairline);
}

.row-key {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  padding-top: 0.5rem;
}

.rows.numbered .row {
  grid-template-columns: 6.4rem 1fr;
}

.rows.numbered .row-key {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 420;
  font-size: clamp(2.8rem, 5vw, 4.4rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--ink);
  padding-top: 0;
  opacity: 0.92;
}

.row .h3 {
  margin-bottom: 0.5rem;
}

@media (max-width: 560px) {
  .row,
  .rows.numbered .row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ---------------------------------------------------------------
   Ledger tables
   --------------------------------------------------------------- */
.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.ledger caption {
  text-align: left;
  padding-bottom: 1.1rem;
}

.ledger caption .h3 {
  font-size: clamp(1.7rem, 2.8vw, 2.3rem);
}

.ledger th {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-faint);
  text-align: left;
  padding: 0.85rem 1.2rem 0.85rem 0;
  border-bottom: 1px solid var(--hairline);
  width: 8.5rem;
}

.ledger td {
  padding: 0.95rem 1.2rem 0.95rem 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
  vertical-align: top;
  line-height: 1.6;
}

.ledger td strong {
  color: var(--ink);
  font-weight: 620;
  font-size: 1.15em;
}

.ledger-wrap {
  overflow-x: auto;
}

/* ---------------------------------------------------------------
   Cases — meta ledger + plates (the dark captures ARE the plates)
   --------------------------------------------------------------- */
.case {
  display: grid;
  grid-template-columns: minmax(180px, 300px) 1fr;
  gap: clamp(24px, 4.5vw, 88px);
  padding: clamp(48px, 8vh, 88px) 0;
  border-top: 1px solid var(--hairline);
  align-items: start;
}

.case:last-of-type {
  border-bottom: 1px solid var(--hairline);
}

.case .h3 {
  font-size: clamp(1.7rem, 2.8vw, 2.4rem);
}

.case-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.2rem;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.case-meta dt {
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.case-meta dd {
  color: var(--ink-dim);
  margin: 0;
}

.case-panel {
  position: relative;
  aspect-ratio: 16 / 8.5;
  margin-top: 1.8rem;
  background: var(--plate);
  border: 1px solid var(--ink);
  overflow: hidden;
}

.case-panel::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 3.2rem;
  height: 2px;
  background: var(--madder);
  z-index: 2;
}

.case-panel img,
.media-still img,
.media-frame img,
.media-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.case-shots {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 14px;
  margin-top: 1.8rem;
}

.case-shots .case-panel {
  margin-top: 0;
}

/* THE DOMINANT PLATE — one case per book earns the full spread. The
   image runs edge to edge of the VIEWPORT; the title is enormous and
   overlaps the plate from the paper above; meta and body sit after,
   like a caption page. */
.case-hero {
  display: block;
  border-top: none;
  padding-top: clamp(40px, 7vh, 72px);
}

/* The Reveal wrappers are stacking contexts (they carry transforms),
   so the layering decision lives on them: title's wrapper above the
   plate's. The title dips a baseline into the plate — ink sinking into
   the vat — enough to bind them, not enough to drown the glyphs. */
.case-hero > .rv:first-child {
  position: relative;
  z-index: 2;
}

.case-hero .case-hero-title {
  margin-bottom: -0.18em;
  padding-left: 0;
}

.case-hero-plate {
  position: relative;
  z-index: 1;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: clamp(380px, 72vh, 760px);
  background: var(--plate);
  overflow: hidden;
}

.case-hero-plate img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.case-hero-plate::after {
  content: "";
  position: absolute;
  left: clamp(20px, 4.5vw, 96px);
  bottom: 0;
  width: 3.2rem;
  height: 3px;
  background: var(--madder);
  z-index: 2;
}

.case-hero-body {
  display: grid;
  grid-template-columns: minmax(180px, 300px) 1fr;
  gap: clamp(24px, 4.5vw, 88px);
  padding-top: clamp(28px, 4vh, 44px);
}

/* Wide case: the imagery spans the full content width UNDER the text
   instead of sitting politely in the right column. */
.case-wide {
  display: block;
}

.case-wide .case-wide-head {
  display: grid;
  grid-template-columns: minmax(180px, 300px) 1fr;
  gap: clamp(24px, 4.5vw, 88px);
  align-items: start;
}

.case-wide .case-shots {
  grid-template-columns: 1.7fr 1fr 1fr;
  margin-top: clamp(28px, 4vh, 44px);
}

/* Tile pair for cases with two live artefacts side by side. */
.tile-row {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
  margin-top: clamp(28px, 4vh, 44px);
}

.tile-row .case-panel,
.tile-row .media-frame {
  margin-top: 0;
}

@media (max-width: 760px) {
  .case,
  .case-hero-body,
  .case-wide .case-wide-head {
    grid-template-columns: 1fr;
  }
  .case-hero .case-hero-title {
    margin-bottom: 0.2em;
  }
}

@media (max-width: 560px) {
  .case-shots,
  .case-wide .case-shots,
  .tile-row {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------
   Media frames (video plates) + figures
   --------------------------------------------------------------- */
.media-frame {
  position: relative;
  aspect-ratio: 16 / 8.5;
  margin-top: 1.8rem;
  border: 1px solid var(--ink);
  overflow: hidden;
  cursor: pointer;
  background: var(--plate);
}

.media-frame::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 3.2rem;
  height: 2px;
  background: var(--madder);
  pointer-events: none;
}

.media-hint {
  position: absolute;
  left: 1rem;
  bottom: 0.9rem;
  z-index: 2;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--plate-ink);
  background: rgba(6, 9, 15, 0.72);
  border: 1px solid rgba(223, 231, 248, 0.25);
  border-radius: 3px;
  padding: 6px 10px;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.media-hint[data-hidden] {
  opacity: 0;
}

figure.media-figure {
  margin: 2rem 0 0;
}

figure.media-figure .media-still {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--ink);
  overflow: hidden;
  background: var(--plate);
}

figure.media-figure figcaption {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  padding-top: 0.9rem;
}

/* ---------------------------------------------------------------
   Standards strip (rendered as a plate on home)
   --------------------------------------------------------------- */
.standards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: clamp(24px, 3.5vw, 48px);
}

.standards .h3 {
  font-size: 1.2rem;
}

.plate .standards .h3 {
  color: #f2f5fc;
}

.standards p {
  font-size: 0.98rem;
}

/* ---------------------------------------------------------------
   CTA — a display moment, drawn underline
   --------------------------------------------------------------- */
.cta .display,
.cta .display-l {
  position: relative;
  padding-bottom: 0.35em;
}

.cta .display::after,
.cta .display-xxl::after,
.cta .display-l::after {
  content: "";
  position: absolute;
  left: 0.04em;
  bottom: 0;
  width: 1.6em;
  height: 3px;
  background: var(--madder);
}

.cta .display-xxl {
  position: relative;
  padding-bottom: 0.3em;
}

/* The madder stroke draws itself once the ink has dried. */
.rv.in .display::after,
.rv.in .display-xxl::after,
.rv.in .display-l::after {
  animation: stroke-draw 0.7s 0.6s cubic-bezier(0.6, 0, 0.2, 1) backwards;
}

@keyframes stroke-draw {
  from {
    width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rv.in .display::after,
  .rv.in .display-xxl::after,
  .rv.in .display-l::after {
    animation: none;
  }
}

/* ---------------------------------------------------------------
   Footer — the book's colophon, on a plate
   --------------------------------------------------------------- */
.foot {
  background: var(--plate);
  color: var(--plate-ink-dim);
  border-top: 1px solid var(--ink);
}

.foot-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(48px, 8vh, 88px) clamp(20px, 4.5vw, 96px);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: clamp(28px, 5vw, 88px);
}

.foot-mark {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.6rem;
  color: #f2f5fc;
  margin-bottom: 0.8rem;
}

.foot h4 {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
  color: rgba(223, 231, 248, 0.42);
  margin: 0 0 1rem;
}

.foot ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.95rem;
}

.foot a:hover {
  color: #f2f5fc;
}

.foot p {
  color: var(--plate-ink-dim);
}

.foot-note {
  font-size: 0.8rem;
  color: rgba(223, 231, 248, 0.42);
  margin-top: 1.5rem;
  max-width: 40ch;
}

@media (max-width: 760px) {
  .foot-inner {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------
   Reveal + probe
   --------------------------------------------------------------- */
/* Ink on paper: content is revealed by a diagonal wet-edge wipe that
   travels the SAME diagonal as the site's light and the hero's shaft
   (upper-left → lower-right). Text dries fast; plates are heavier and
   take longer — weight hierarchy in time, not just size. */
.rv {
  opacity: 0.001;
  transform: translateY(12px);
  -webkit-mask-image: linear-gradient(115deg, #000 44%, transparent 61%);
  mask-image: linear-gradient(115deg, #000 44%, transparent 61%);
  -webkit-mask-size: 280% 100%;
  mask-size: 280% 100%;
  -webkit-mask-position: 98% 0;
  mask-position: 98% 0;
}

.rv.in {
  animation:
    ink-wipe 1.05s cubic-bezier(0.62, 0.02, 0.16, 1) forwards,
    ink-settle 1.05s cubic-bezier(0.3, 0.6, 0.2, 1) forwards;
}

/* Heavy plates (often full-bleed) never wear the mask — a mask would
   clip their overflow and cost real fill on phones. They surface like
   something rising through water: slower, opacity and weight only. */
.rv[data-heavy] {
  -webkit-mask-image: none;
  mask-image: none;
  opacity: 0;
  transform: translateY(22px);
}

.rv.in[data-heavy] {
  animation: none;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 1.3s cubic-bezier(0.3, 0.6, 0.2, 1),
    transform 1.3s cubic-bezier(0.3, 0.6, 0.2, 1);
}

@keyframes ink-wipe {
  0% {
    opacity: 1;
    -webkit-mask-position: 98% 0;
    mask-position: 98% 0;
  }
  100% {
    opacity: 1;
    -webkit-mask-position: 0% 0;
    mask-position: 0% 0;
  }
}

@keyframes ink-settle {
  from {
    transform: translateY(12px);
  }
  to {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rv,
  .rv.in {
    opacity: 1;
    transform: none;
    animation: none;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* Manual meter (?perf). Sized to be read off a phone at arm's length —
   the number is the deliverable; nothing is transmitted anywhere. */
.probe {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: calc(var(--band) + 10px);
  right: auto;
  bottom: auto;
  z-index: 97;
  font-family: "Geist Mono", ui-monospace, monospace;
  color: #e9edf6;
  background: rgba(6, 9, 15, 0.9);
  border: 1px solid rgba(223, 231, 248, 0.25);
  border-radius: 5px;
  padding: 12px 20px;
  pointer-events: none;
  text-align: center;
}

.probe-big {
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.probe-sub {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(233, 237, 246, 0.62);
  padding-top: 3px;
}

/* =====================================================================
   PHASE 2e — THE ENERGY LAYER
   Four systems, all progressive enhancement: the site is complete and
   correct without any of them, and every one is off under
   prefers-reduced-motion.
   ===================================================================== */

/* ---------------------------------------------------------------
   1. THE LIFT — the opening. A sheet of paper with the name pressed
   into it, drawn away on the light's own diagonal.
   --------------------------------------------------------------- */
.entrance {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: var(--paper);
  display: grid;
  place-items: center;
  -webkit-mask-image: linear-gradient(115deg, #000 42%, transparent 58%);
  mask-image: linear-gradient(115deg, #000 42%, transparent 58%);
  -webkit-mask-size: 260% 100%;
  mask-size: 260% 100%;
  /* Starts fully opaque (0% = the mask's solid end) and travels to the
     transparent end: the sheet is drawn AWAY, not painted on. */
  -webkit-mask-position: 0% 0;
  mask-position: 0% 0;
  animation: lift-sheet 1.15s 0.85s cubic-bezier(0.66, 0, 0.16, 1) forwards;
}

@keyframes lift-sheet {
  to {
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
  }
}

.entrance-mark {
  position: relative;
  text-align: center;
  animation: mark-settle 1.9s cubic-bezier(0.3, 0.7, 0.2, 1) forwards;
}

@keyframes mark-settle {
  0% { opacity: 0; transform: translateY(14px) scale(0.985); }
  18% { opacity: 1; transform: none; }
  58% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-16px); }
}

.entrance-name {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 570;
  font-size: clamp(3rem, 11vw, 9rem);
  line-height: 1;
  letter-spacing: -0.028em;
  color: var(--ink);
}

.entrance-rule {
  display: block;
  height: 3px;
  width: 0;
  margin: 1.1rem auto 0;
  background: var(--madder);
  animation: rule-draw 0.75s 0.3s cubic-bezier(0.6, 0, 0.2, 1) forwards;
}

@keyframes rule-draw {
  to { width: min(38vw, 320px); }
}

/* ---------------------------------------------------------------
   2. INK CURSOR — one pigment, correct against either ground.
   --------------------------------------------------------------- */
.ink-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 95;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, width 0.28s cubic-bezier(0.3, 0.8, 0.2, 1),
    height 0.28s cubic-bezier(0.3, 0.8, 0.2, 1);
  will-change: transform;
}

.ink-cursor[data-live="1"] { opacity: 1; }
.ink-cursor[data-hot="1"] { width: 46px; height: 46px; }

@media (pointer: coarse) {
  .ink-cursor { display: none; }
}

/* ---------------------------------------------------------------
   3. KINETIC TYPE — Fraunces is variable on BOTH weight and optical
   size, so a headline can gain mass as it comes into the light
   instead of merely fading in. Runs on the ink-wipe's own timing.
   --------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .rv .display-xxl,
  .rv .display {
    animation: type-ink 1.25s cubic-bezier(0.4, 0.5, 0.15, 1) backwards;
  }
  .rv.in .display-xxl,
  .rv.in .display {
    animation-play-state: running;
  }
}

@keyframes type-ink {
  from {
    font-variation-settings: "wght" 300, "opsz" 9;
    letter-spacing: 0.012em;
  }
  to {
    font-variation-settings: "wght" 570, "opsz" 144;
    letter-spacing: -0.028em;
  }
}

/* ---------------------------------------------------------------
   4. SCROLL-DRIVEN DEPTH — decorative only, and gated: Safari gained
   these in 26, the studio's own test phone is on 18. Where absent,
   nothing is lost; the IO reveal already placed the content.
   --------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    /* Plates breathe: the image drifts inside its frame as the plate
       crosses the viewport — parallax between frame and content. */
    .case-panel img,
    .case-hero-plate img,
    .media-still img {
      animation: plate-drift auto linear;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }

    @keyframes plate-drift {
      from { transform: scale(1.09) translateY(-1.4%); }
      to { transform: scale(1.09) translateY(1.4%); }
    }

    /* Section rules draw themselves as they arrive. */
    .sect + .sect {
      animation: rule-wipe auto linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 45%;
    }

    @keyframes rule-wipe {
      from { border-top-color: transparent; }
      to { border-top-color: var(--hairline); }
    }
  }
}

/* =====================================================================
   PHASE 2f — DENSITY: the press room
   The pages were composed but sparse. These fill the page the way a
   proof sheet is filled — running bands, overlapping plates, and the
   printer's own furniture in the margins — without a single decorative
   shape that isn't doing a job.
   ===================================================================== */

/* ---------------------------------------------------------------
   1. MARQUEE — the press feeding paper. Motion at rest.
   --------------------------------------------------------------- */
.marquee {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  overflow: hidden;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 0.55em 0;
  background: var(--paper);
}

.marquee[data-plate] {
  background: var(--plate);
  border-color: rgba(223, 231, 248, 0.16);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-run var(--marquee-speed, 42s) linear infinite;
}

.marquee[data-reverse] .marquee-track {
  animation-direction: reverse;
}

@keyframes marquee-run {
  to { transform: translateX(-50%); }
}

.marquee-run {
  display: flex;
  align-items: center;
  flex: none;
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 1.1em;
  padding-right: 1.1em;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 520;
  font-size: clamp(1.5rem, 3.4vw, 2.9rem);
  letter-spacing: -0.015em;
  color: var(--ink);
  white-space: nowrap;
}

.marquee[data-plate] .marquee-item { color: #f2f5fc; }

.marquee-dot {
  font-size: 0.34em;
  color: var(--madder);
  transform: translateY(-0.15em);
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* ---------------------------------------------------------------
   2. PLATE WALL — the proof sheet. Overlapping, off-axis, varied
   scale: the density the sparse grid was missing.
   --------------------------------------------------------------- */
.wall {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 5.4vw;
  gap: 0;
  margin-top: clamp(32px, 5vh, 64px);
}

.wall-plate {
  position: relative;
  background: var(--plate);
  border: 1px solid var(--ink);
  overflow: hidden;
  box-shadow: 0 18px 44px -26px rgba(16, 20, 31, 0.55);
}

.wall-plate img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wall-plate figcaption {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--plate-ink);
  background: rgba(6, 9, 15, 0.72);
  padding: 5px 9px;
  border-top: 2px solid var(--madder);
}

/* Hand-placed, deliberately unequal — a wall, not a grid. Plates are
   pinned so they overlap at their corners, never over each other's
   caption, and no hole is left big enough to read as a gap. */
.wall-a { grid-column: 1 / 8;  grid-row: 1 / 8;  z-index: 1; }
.wall-e { grid-column: 7 / 13; grid-row: 1 / 6;  z-index: 2; }
.wall-c { grid-column: 9 / 13; grid-row: 5 / 10; z-index: 3; }
.wall-b { grid-column: 4 / 10; grid-row: 6 / 12; z-index: 4; }
.wall-d { grid-column: 1 / 5;  grid-row: 8 / 13; z-index: 5; }

@media (max-width: 760px) {
  .wall { grid-template-columns: repeat(6, 1fr); grid-auto-rows: 11vw; }
  .wall-a { grid-column: 1 / 6;  grid-row: 1 / 5;  z-index: 1; }
  .wall-e { grid-column: 3 / 7;  grid-row: 4 / 7;  z-index: 2; }
  .wall-c { grid-column: 1 / 4;  grid-row: 7 / 10; z-index: 3; }
  .wall-b { grid-column: 3 / 7;  grid-row: 9 / 13; z-index: 4; }
  .wall-d { grid-column: 1 / 4;  grid-row: 12 / 16; z-index: 5; }
}

/* ---------------------------------------------------------------
   3. PRESS FURNITURE — crop marks and a plate number in the margin.
   Empty space stops reading as unused when it is registered.
   --------------------------------------------------------------- */
.sect[data-mark] { position: relative; }

.sect[data-mark]::before {
  content: attr(data-mark);
  position: absolute;
  top: clamp(28px, 5vh, 60px);
  right: clamp(20px, 4.5vw, 96px);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  color: var(--ink-faint);
  pointer-events: none;
}

.sect[data-mark]::after {
  content: "";
  position: absolute;
  top: clamp(28px, 5vh, 60px);
  right: clamp(20px, 4.5vw, 96px);
  width: 22px;
  height: 22px;
  transform: translate(0, 26px);
  border-top: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  pointer-events: none;
}

.plate[data-mark]::before { color: rgba(223, 231, 248, 0.42); }
.plate[data-mark]::after { border-color: rgba(223, 231, 248, 0.2); }

/* Headline allowed to sit over the top of a wall — type and image
   sharing space instead of politely taking turns. */
.overlap-head {
  position: relative;
  z-index: 4;
  margin-bottom: -0.32em;
}

/* =====================================================================
   PHASE 2f-b — THE STATEMENT PANEL (Tesla/Lamborghini structure)
   Full-bleed image, one headline, one line, one link. The visual does
   the talking; the words get out of the way.
   ===================================================================== */
.panel {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  min-height: clamp(460px, 82svh, 900px);
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--plate);
  isolation: isolate;
}

.panel > img,
.panel .panel-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Ink wash: keeps type legible over any frame without dimming the
   whole image — the gradient only weights the corner the words sit in. */
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      to right,
      rgba(6, 9, 15, 0.72) 0%,
      rgba(6, 9, 15, 0.28) 42%,
      rgba(6, 9, 15, 0) 70%
    ),
    linear-gradient(
      to top,
      rgba(6, 9, 15, 0.9) 0%,
      rgba(6, 9, 15, 0.5) 30%,
      rgba(6, 9, 15, 0) 62%
    );
}

.panel-body {
  position: relative;
  z-index: 2;
  padding: clamp(32px, 7vh, 88px) clamp(20px, 4.5vw, 96px);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.panel-head {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 560;
  font-size: clamp(2.6rem, 7vw, 6.4rem);
  line-height: 0.98;
  letter-spacing: -0.026em;
  color: #f4f7ff;
  margin: 0 0 0.5rem;
  max-width: 16ch;
}

.panel-head em { font-style: italic; font-weight: 400; }

/* .site p (0,1,1) out-ranks a bare class, so this must be scoped or the
   line renders in dark ink on a dark image — the third time this exact
   cascade trap has bitten. Any text placed on a plate/panel gets a
   .site-scoped selector. */
.site .panel-line {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: rgba(236, 241, 255, 0.94);
  max-width: 34ch;
  margin: 0 0 1.2rem;
}

.panel-cta {
  display: inline-block;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #f4f7ff;
  border-bottom: 2px solid var(--madder);
  padding-bottom: 4px;
}

/* Panel imagery drifts slowly — a still that is not quite still. */
@media (prefers-reduced-motion: no-preference) {
  .panel > img {
    animation: panel-breathe 26s ease-in-out infinite alternate;
  }
}

@keyframes panel-breathe {
  from { transform: scale(1.04) translate3d(-0.8%, 0.4%, 0); }
  to   { transform: scale(1.11) translate3d(0.8%, -0.6%, 0); }
}
