/*  hero.css — the 0k.computer entry page: ontology-projection hero,
 *  waitlist CTA, and the demoted live-surface garnish.
 *
 *  Register: illuminated-manuscript / colophon (paper, engraved gold
 *  rules, IM Fell italics), mobile-first single column. The first screen
 *  is pure HTML/CSS — the spine projection animates and responds to taps
 *  with JavaScript disabled (radio-group selection), on any browser,
 *  with nothing to fetch beyond this page. The live wasm surface is a
 *  late-page garnish, never load-bearing.                               */

/*  Self-hosted fonts — the same files the repo already carries. No CDN. */
@font-face {
  font-family: 'IM Fell English';
  src: url('/ontology/brand/fonts/IMFellEnglish.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Cormorant';
  src: url('/ontology/brand/fonts/Cormorant.ttf') format('truetype');
  font-weight: 300 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/ontology/brand/fonts/IBMPlexMono.ttf') format('truetype');
  font-weight: 400 500; font-style: normal; font-display: swap;
}

:root {
  --paper: var(--color-paper, #fffff8);
  --ink: var(--color-text, #1a1611);
  --ink-2: var(--color-text-muted, #3c3427);
  --ink-3: var(--color-text-faint, #6b5f4b);
  --gold: #b88e44;
  --gold-soft: rgba(184, 142, 68, 0.55);
  --accent: var(--color-accent, #b22222);
  --serif: 'Cormorant', 'EB Garamond', Georgia, serif;
  --fell: 'IM Fell English', var(--serif);
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
}

.hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1.1rem env(safe-area-inset-bottom);
  max-width: 640px;
  margin: 0 auto;
}

/* — Masthead — */
.hero-masthead {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: calc(0.9rem + env(safe-area-inset-top));
  gap: 0.45rem;
}
.hero-wordmark {
  font-family: var(--fell);
  font-size: 1.25rem;
  letter-spacing: 0.14em;
  color: var(--ink);
}
.hero-rule {
  width: 72%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft) 20%, var(--gold-soft) 80%, transparent);
  position: relative;
}
.hero-rule::after {
  content: '✦';
  position: absolute;
  top: -0.62em;
  left: 50%;
  transform: translateX(-50%);
  background: var(--paper);
  color: var(--gold);
  font-size: 0.72rem;
  padding: 0 0.5em;
}
.hero-statement {
  margin: 0.35rem 0 0;
  font-family: var(--fell);
  font-size: 1.35rem;
  line-height: 1.3;
  color: var(--ink);
  text-align: center;
}
.hero-statement em { font-style: italic; }
.hero-tagline {
  margin: 0.35rem 0 0;
  font-family: var(--fell);
  font-style: italic;
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--ink-3);
  text-align: center;
  max-width: 36em;
}

/*  The brand zero must not read as a lowercase 'o' — request the font's
 *  slashed-zero form, and draw a hairline slash overlay as insurance for
 *  fonts that lack the feature. */
.zero {
  position: relative;
  font-feature-settings: 'zero' on;
  font-variant-numeric: slashed-zero;
}
.zero::after {
  content: '';
  position: absolute;
  left: 18%; right: 18%;
  top: 52%;
  border-top: 0.045em solid currentColor;
  transform: rotate(-58deg);
  transform-origin: center;
  pointer-events: none;
}

/* ═══ Medallion — the engraved emblem, reserved-space fade-in ═══
 *  The box is sized before the image arrives (aspect-ratio), so the page
 *  never shifts; where JS runs, garnish.js adds .fade at parse time and
 *  .loaded when the bytes land, giving a slow candle-up. With no JS the
 *  image renders plainly. */
.hero-medallion {
  margin: 0.9rem auto 0;
  width: min(58vw, 280px);
  aspect-ratio: 1 / 1;
}
.hero-medallion img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.hero-medallion.fade img {
  opacity: 0;
  transition: opacity 1400ms ease;
}
.hero-medallion.fade img.loaded { opacity: 1; }

/*  Scroll-reveal (JS-gated): garnish.js marks sections .will-reveal on
 *  parse and .revealed as they enter the viewport. Without JS neither
 *  class exists and everything renders plainly. */
.will-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 700ms ease, transform 700ms ease;
}
.will-reveal.revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .hero-medallion.fade img { opacity: 1; transition: none; }
  .will-reveal { opacity: 1; transform: none; transition: none; }
}

/* ═══ Preface — why malleability, for whom ═══ */
.hero-preface {
  margin: 1.15rem 0 0;
  width: 100%;
}
.hero-preface p {
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.62;
  color: var(--ink-2);
}
.hero-preface em { font-family: var(--fell); font-style: italic; }
.hero-preface strong { font-weight: 600; color: var(--ink); }

/* ═══ Signup — chapter I closes on the one quick action ═══ */
.signup {
  margin: 1.5rem 0 0;
  width: 100%;
  text-align: center;
}
.signup-line {
  margin: 0 auto 0.8rem;
  max-width: 30em;
  font-size: 0.97rem;
  line-height: 1.6;
}
.signup-line strong { font-weight: 600; color: var(--ink); }

/*  Chapter rules — an engraved divider with the ✦ station mark. */
.chapter-rule {
  width: 78%;
  border: 0;
  height: 1px;
  margin: 2.2rem auto 0;
  background: linear-gradient(90deg, transparent, var(--gold-soft) 22%, var(--gold-soft) 78%, transparent);
  position: relative;
  overflow: visible;
}
.chapter-rule::after {
  content: '✦';
  position: absolute;
  top: -0.62em;
  left: 50%;
  transform: translateX(-50%);
  background: var(--paper);
  color: var(--gold);
  font-size: 0.72rem;
  padding: 0 0.5em;
}
.chapter-title {
  margin: 1.6rem 0 0;
  font-family: var(--fell);
  font-weight: 400;
  font-size: 1.45rem;
  color: var(--ink);
  text-align: center;
}
.chapter-sub {
  margin: 0.25rem auto 0;
  max-width: 30em;
  font-family: var(--fell);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-3);
  text-align: center;
}

/* ═══ The projection — hero ═══ */
.projection {
  margin: 1.1rem 0 0;
  width: 100%;
}
.st-radio,
.tr-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/*  Hint variants: one per trace, toggled by the checked trace radio. */
.hv { display: none; }
#tr-flow:checked   ~ .projection-plate .hv-flow   { display: inline; }
#tr-chat:checked   ~ .projection-plate .hv-chat   { display: inline; }
#tr-files:checked  ~ .projection-plate .hv-files  { display: inline; }
#tr-agents:checked ~ .projection-plate .hv-agents { display: inline; }
.projection-plate {
  position: relative;
  border: 1px solid var(--gold-soft);
  outline: 1px solid rgba(184, 142, 68, 0.25);
  outline-offset: 3px;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(240, 196, 104, 0.10), transparent 65%),
    var(--paper);
  padding: 1rem 1rem 0.9rem;
  overflow: hidden;
}
/*  Corner marks — engraved cartouche without an image asset. */
.projection-plate::before,
.projection-plate::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border-color: var(--gold);
  border-style: solid;
  opacity: 0.8;
  pointer-events: none;
}
.projection-plate::before { top: 5px; left: 5px; border-width: 1px 0 0 1px; }
.projection-plate::after  { bottom: 5px; right: 5px; border-width: 0 1px 1px 0; }

/*  Faint sacred-geometry backdrop — the entity-graph texture behind the
 *  spine, same engraved-gold watermark family as the ontology landing. */
.projection-plate {
  background-image:
    radial-gradient(ellipse at 50% 30%, rgba(240, 196, 104, 0.10), transparent 65%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 800' fill='none' stroke='%23b88e44' stroke-width='0.6'%3E%3Ccircle cx='400' cy='400' r='300'/%3E%3Ccircle cx='400' cy='400' r='200'/%3E%3Ccircle cx='400' cy='400' r='100'/%3E%3Cpolygon points='400,100 659.81,550 140.19,550'/%3E%3Cpolygon points='400,700 140.19,250 659.81,250'/%3E%3Cline x1='400' y1='100' x2='400' y2='700'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center 40%;
  background-size: 420px;
}

.projection-title {
  margin: 0 0 0.55rem;
  font-family: var(--fell);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink);
  text-align: center;
}
.projection-intro {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.projection-intro em {
  font-family: var(--fell);
  font-style: italic;
  color: var(--ink);
}

/* — The Confluence: three tributaries, one method, one mouth —
 *   The wrap is position:relative so the stream headings (the controls)
 *   and the inline notes ride the SVG at viewBox-fraction offsets.      */
.confluence-wrap {
  position: relative;
  width: 100%;
}
.stream-head {
  position: absolute;
  top: calc(100% * 40 / 560);
  transform: translate(-50%, -50%);
  font-family: var(--fell);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--ink-2);
  padding: 0.05rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: color 250ms ease, border-color 250ms ease, background 250ms ease, box-shadow 250ms ease;
  -webkit-tap-highlight-color: transparent;
}
.stream-head:hover { background: rgba(255, 247, 200, 0.5); }
.stream-head-chat   { left: calc(100% * 88 / 390); }
.stream-head-files  { left: calc(100% * 150 / 390); }
.stream-head-agents { left: calc(100% * 212 / 390); }
#tr-chat:checked   ~ .projection-plate .stream-head-chat,
#tr-files:checked  ~ .projection-plate .stream-head-files,
#tr-agents:checked ~ .projection-plate .stream-head-agents {
  color: var(--ink);
  border-color: var(--gold);
  background: rgba(255, 247, 200, 0.7);
  box-shadow: 0 0 8px rgba(240, 196, 104, 0.45);
}

/*  Dashed entries: a desire is not yet in the system. */
.confluence .entry {
  fill: none;
  stroke: #8b6e3a;
  stroke-width: 1.1;
  stroke-dasharray: 3 5;
  opacity: 0.4;
  transition: stroke 350ms ease, opacity 350ms ease;
}
#tr-chat:checked   ~ .projection-plate .entry-chat,
#tr-files:checked  ~ .projection-plate .entry-files,
#tr-agents:checked ~ .projection-plate .entry-agents {
  stroke: var(--gold);
  opacity: 0.85;
}

/*  Inline notes beside each band, vertically centred on the band line. */
.flow-note {
  position: absolute;
  left: 61.5%;
  width: 37%;
  top: calc(100% * var(--band-y) / 560);
  transform: translateY(-50%);
  font-size: 0.78rem;
  line-height: 1.35;
  font-style: italic;
  color: var(--ink-3);
}
#tr-chat:checked   ~ .projection-plate .flow-note,
#tr-files:checked  ~ .projection-plate .flow-note,
#tr-agents:checked ~ .projection-plate .flow-note {
  font-style: normal;
  color: var(--ink-2);
}
.flow-note-desire { font-style: italic; }
.flow-note-bundle { color: var(--ink-2); }
@media (max-width: 480px) {
  .flow-note { font-size: 0.72rem; line-height: 1.3; }
}

/*  The way back to the abstract view — quiet, and only offered while a
 *  stream is selected. */
.flow-reset {
  position: absolute;
  right: 0;
  bottom: -0.4rem;
  font-family: var(--fell);
  font-style: italic;
  font-size: 0.78rem;
  color: var(--ink-3);
  cursor: pointer;
  visibility: hidden;
}
.flow-reset:hover { color: var(--ink); }
#tr-chat:checked   ~ .projection-plate .flow-reset,
#tr-files:checked  ~ .projection-plate .flow-reset,
#tr-agents:checked ~ .projection-plate .flow-reset { visibility: visible; }

/* — legacy block header kept for the rules below — */
.confluence {
  display: block;
  width: 100%;
  height: auto;
  margin: 0.2rem 0 0.4rem;
}
.confluence .bands line {
  stroke: rgba(184, 142, 68, 0.28);
  stroke-width: 1;
}
.confluence .bands .band-outside { stroke-dasharray: 3 5; }
.confluence .band-label-outside { font-style: italic; opacity: 0.85; }
.confluence .band-label {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  fill: var(--ink-3);
}
.confluence .stream {
  fill: none;
  stroke: #8b6e3a;
  stroke-width: 1.3;
  opacity: 0.55;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: stream-draw 1600ms ease-out forwards;
  transition: stroke 350ms ease, stroke-width 350ms ease, opacity 350ms ease;
}
.confluence .stream-files  { animation-delay: 180ms; }
.confluence .stream-agents { animation-delay: 360ms; }
.confluence .stream-mouth {
  stroke: var(--gold);
  stroke-width: 2.4;
  opacity: 1;
  animation-delay: 1500ms;
  animation-duration: 500ms;
}
@keyframes stream-draw {
  to { stroke-dashoffset: 0; }
}
.confluence .dots circle {
  fill: var(--paper);
  stroke: var(--gold);
  stroke-width: 1;
  opacity: 0;
  animation: dot-arrive 500ms ease-out forwards;
  transition: fill 350ms ease;
}
.confluence .dots circle:nth-child(1) { animation-delay: 350ms; }
.confluence .dots circle:nth-child(2) { animation-delay: 550ms; }
.confluence .dots circle:nth-child(3) { animation-delay: 750ms; }
.confluence .dots circle:nth-child(4) { animation-delay: 950ms; }
.confluence .dots circle:nth-child(5) { animation-delay: 1150ms; }
.confluence .dots circle:nth-child(6) { animation-delay: 1350ms; }
@keyframes dot-arrive {
  to { opacity: 1; }
}
.confluence .seal rect {
  fill: rgba(240, 196, 104, 0.9);
  stroke: var(--gold);
  stroke-width: 1;
}
.confluence .seal-label {
  font-family: var(--fell);
  font-size: 14px;
  fill: var(--ink);
}
.confluence .seal-zero { text-decoration: line-through; }

/*  Selection: the checked trace gilds its stream, its label, and its
 *  cargo dots; the others recede. "the method" keeps all three equal. */
#tr-chat:checked   ~ .projection-plate .stream-chat,
#tr-files:checked  ~ .projection-plate .stream-files,
#tr-agents:checked ~ .projection-plate .stream-agents {
  stroke: var(--gold);
  stroke-width: 2.6;
  opacity: 1;
}
#tr-chat:checked   ~ .projection-plate .dots-chat circle,
#tr-files:checked  ~ .projection-plate .dots-files circle,
#tr-agents:checked ~ .projection-plate .dots-agents circle {
  fill: rgba(255, 232, 168, 0.95);
}
#tr-chat:checked   ~ .projection-plate .stream-files,
#tr-chat:checked   ~ .projection-plate .stream-agents,
#tr-files:checked  ~ .projection-plate .stream-chat,
#tr-files:checked  ~ .projection-plate .stream-agents,
#tr-agents:checked ~ .projection-plate .stream-chat,
#tr-agents:checked ~ .projection-plate .stream-files {
  opacity: 0.3;
}



.projection-caption {
  margin: 0.8rem 0 0;
  font-family: var(--fell);
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--ink-2);
  text-align: center;
}
.projection-enter {
  color: var(--ink);
  text-decoration-color: var(--gold-soft);
  text-underline-offset: 3px;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .confluence .stream, .confluence .dots circle { animation: none !important; stroke-dashoffset: 0; opacity: 1; }
}

/* ═══ Waitlist — primary CTA ═══ */
.waitlist {
  margin: 1.9rem 0 0;
  width: 100%;
  text-align: center;
}
.waitlist-title {
  margin: 0;
  font-family: var(--fell);
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--ink);
}
.waitlist-body {
  margin: 0.6rem 0 0;
  font-size: 0.97rem;
  line-height: 1.6;
  text-align: left;
}
.waitlist-body em { font-family: var(--fell); font-style: italic; }
.waitlist-body a {
  color: var(--ink);
  text-decoration-color: var(--gold-soft);
  text-underline-offset: 2px;
}
.waitlist-desires {
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
  font-size: 0.94rem;
  line-height: 1.5;
}
.waitlist-desires li {
  position: relative;
  padding-left: 1.35em;
  margin-top: 0.45em;
}
.waitlist-desires li::before {
  content: '✦';
  position: absolute;
  left: 0.15em;
  color: var(--gold);
  font-size: 0.8em;
  top: 0.25em;
}
.waitlist-form { margin: 1rem 0 0; }
.waitlist-label {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.waitlist-row {
  display: flex;
  gap: 0.5rem;
}
.waitlist-input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 0.65rem 0.7rem;
  color: var(--ink);
  background: rgba(255, 252, 240, 0.9);
  border: 1px solid var(--gold-soft);
  border-radius: 2px;
}
.waitlist-input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.waitlist-button {
  flex: 0 0 auto;
  font-family: var(--fell);
  font-size: 0.95rem;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  color: var(--ink);
  background: rgba(255, 247, 200, 0.5);
  border: 1px solid var(--gold);
  border-radius: 2px;
  box-shadow: inset 0 0 0 3px rgba(255, 247, 200, 0.25), 0 0 12px rgba(240, 196, 104, 0.18);
  transition: background 200ms ease, box-shadow 200ms ease;
}
.waitlist-button:hover,
.waitlist-button:focus-visible {
  background: rgba(255, 247, 200, 0.85);
  box-shadow: inset 0 0 0 3px rgba(255, 247, 200, 0.4), 0 0 18px rgba(240, 196, 104, 0.35);
}
.waitlist-note {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--ink-3);
}

/* ═══ Garnish — the demoted live surface ═══ */
.garnish {
  margin: 2.2rem 0 0;
  width: 100%;
  border-top: 1px solid rgba(184, 142, 68, 0.3);
  padding-top: 1.4rem;
}
.garnish-title {
  margin: 0;
  font-family: var(--fell);
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--ink);
  text-align: center;
}
.garnish-body {
  margin: 0.6rem 0 0.9rem;
  font-size: 0.92rem;
  line-height: 1.6;
}
/*  Capability-aware instruction: the recording line is the default (true
 *  without JS and without WebGPU); garnish.js flips the section to
 *  .gpu-ok where the graph can actually run. */
.cap-live { display: none; }
.gpu-ok .cap-live { display: inline; }
.gpu-ok .cap-recording { display: none; }
.surface-cartouche {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 480px;
  border: 1px solid var(--gold-soft);
  outline: 1px solid rgba(184, 142, 68, 0.25);
  outline-offset: 3px;
  box-shadow:
    0 0 0 1px rgba(255, 247, 200, 0.25) inset,
    0 6px 22px rgba(60, 40, 12, 0.14);
  background: #fffef6; /* the graph draws on the page's own paper */
  overflow: hidden;
}
.surface-cartouche::before,
.surface-cartouche::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border-color: var(--gold);
  border-style: solid;
  opacity: 0.8;
  pointer-events: none;
  z-index: 2;
}
.surface-cartouche::before { top: 5px; left: 5px; border-width: 1px 0 0 1px; }
.surface-cartouche::after  { bottom: 5px; right: 5px; border-width: 0 1px 1px 0; }

.surface-poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}
.surface-poster[hidden] { display: none; }

#garnish-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none; /* the graph owns its gestures: pan, pinch, tap */
}
#garnish-canvas[hidden] { display: none; }

.garnish-run {
  position: absolute;
  left: 50%;
  bottom: 10%;
  transform: translateX(-50%);
  z-index: 3;
  font-family: var(--fell);
  font-size: 0.95rem;
  padding: 0.55rem 1rem;
  cursor: pointer;
  color: var(--ink);
  background: rgba(255, 247, 200, 0.9);
  border: 1px solid var(--gold);
  border-radius: 2px;
  box-shadow: 0 0 16px rgba(240, 196, 104, 0.45);
}
.garnish-run[hidden] { display: none; }

/*  Fullscreen chip — lower-right of the cartouche once the graph runs
 *  live, clear of the document portal's ⟲ back control (top-right). */
.garnish-fullscreen {
  position: absolute;
  bottom: 0.55rem;
  right: 0.55rem;
  z-index: 7;
  appearance: none;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  padding: 0.32rem 0.55rem;
  cursor: pointer;
  color: var(--ink-3);
  background: rgba(255, 254, 246, 0.85);
  border: 1px solid var(--gold-soft);
  border-radius: 2px;
}
.garnish-fullscreen:hover,
.garnish-fullscreen:focus-visible { color: var(--accent); border-color: var(--accent); }
.garnish-fullscreen[hidden] { display: none; }

/*  Fullscreen: the cartouche (canvas + document portal) edge-to-edge.
 *  Native :fullscreen where supported; the .pseudo-fullscreen class is the
 *  fixed-inset fallback (iOS Safari). Both drop the square aspect and the
 *  height cap — the ResizeObserver in the panel re-sizes the backing store. */
.surface-cartouche:fullscreen {
  aspect-ratio: auto;
  max-height: none;
  width: 100%;
  height: 100%;
  background: var(--paper);
}
.surface-cartouche.pseudo-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 50;
  aspect-ratio: auto;
  max-height: none;
  width: auto;
  height: auto;
  background: var(--paper);
}
html.pseudo-fullscreen-open { overflow: hidden; }
.garnish-run:hover { background: rgba(255, 240, 180, 1); }

.surface-plate {
  margin: 0.5rem 0 0;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  text-align: center;
}

/* ═══ Foot ═══ */
.hero-foot {
  margin: 2rem 0 1.2rem;
  font-family: var(--fell);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-3);
}
.hero-foot a { color: var(--ink-2); }

/*  Wider screens: the manuscript column stays narrow; mobile is the
 *  design target, desktop the graceful stretch. */
@media (min-width: 721px) {
  .hero { padding-top: 1.4rem; }
  .waitlist-row { max-width: 30rem; margin: 0 auto; }
}

/*  Desktop (≥ 980px): same content, richer composition — a two-column
 *  spread. The projection plate holds the left page like an engraved
 *  frontispiece; the right page carries the thesis, the waitlist, and
 *  the way into the walk, so the idea and the invitation share the
 *  first screen. The garnish becomes a plate-with-commentary pair.
 *  Nothing is added or removed relative to mobile — only recomposed. */
@media (min-width: 980px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: 3.2rem;
    align-content: start;
    max-width: 1120px;
    padding-left: 2rem;
    padding-right: 2rem;
  }
  .hero-masthead { grid-column: 1 / -1; }

  /*  The medallion is the frontispiece crest: centered under the masthead,
   *  spanning both columns — the one placement that reads at every width. */
  .hero-medallion {
    grid-column: 1 / -1;
    justify-self: center;
    width: 210px;
    margin-top: 1rem;
  }

  .hero-preface {
    grid-column: 1 / -1;
    max-width: 46em;
    justify-self: center;
    text-align: center;
    margin-top: 1.1rem;
  }
  .hero-preface p { font-size: 1.02rem; }

  .signup {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: 36em;
    margin-top: 1.4rem;
  }
  .chapter-rule { grid-column: 1 / -1; width: 60%; }
  .chapter-title { grid-column: 1 / -1; }
  .chapter-sub { grid-column: 1 / -1; justify-self: center; }

  /*  Chapter II reads as one centered column even on wide screens: the
   *  Confluence plate, then the first offering below it. */
  .projection {
    grid-column: 1 / -1;
    justify-self: center;
    width: 100%;
    max-width: 620px;
    align-self: start;
    margin-top: 1.4rem;
  }
  .projection-plate { padding: 1.4rem 1.6rem 1.2rem; }

  .waitlist {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: 44em;
    margin-top: 1.6rem;
    align-self: start;
    text-align: left;
  }
  .waitlist-title { font-size: 1.65rem; }
  .waitlist-body { font-size: 1rem; }
  .waitlist-row { max-width: none; margin: 0; }
  .waitlist-note { text-align: left; }


  /*  Chapter III: the body reads as a centered column, then the graph
   *  canvas takes the FULL grid width — a wide instrument, not a card.
   *  The square poster letterboxes inside it (contain) on paper. */
  .garnish {
    grid-column: 1 / -1;
    margin-top: 2.8rem;
  }
  .garnish-body {
    margin: 0.6rem auto 1.2rem;
    font-size: 0.98rem;
    max-width: 44em;
  }
  .surface-cartouche {
    width: 100%;
    max-width: none;
    aspect-ratio: 16 / 9;
    max-height: 620px;
  }
  .surface-poster { object-fit: contain; object-position: center; }
  .surface-plate { width: 100%; text-align: center; }

  .hero-foot { grid-column: 1 / -1; justify-self: center; }
}

/*  ── The in-canvas document portal ───────────────────────────────────────
 *  Zooming into a document node on the living graph opens the reader
 *  INSIDE the canvas: the portal's rect, opacity, and pointer-events are
 *  driven frame-by-frame from the doc-open clock (doc-viewer.js), so there
 *  are no CSS transitions here — the zoom gesture IS the animation, and
 *  zooming back out reverses it. */
.doc-portal {
  position: absolute;
  z-index: 6;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 60px rgba(26, 22, 17, 0.35);
  border: 1px solid var(--gold-soft);
  opacity: 0;
  pointer-events: none;
}
.doc-portal[hidden] { display: none; }

.dv-head {
  padding: 1.1rem 1.2rem 0.85rem;
  border-bottom: 1px solid var(--gold-soft);
  background:
    linear-gradient(180deg, rgba(184, 142, 68, 0.07), transparent);
}
.dv-eyebrow {
  margin: 0 0 0.3rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  overflow-wrap: anywhere;
  padding-right: 5.5rem; /* clear the close button */
}
.dv-head h1 {
  margin: 0;
  font-family: var(--fell);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.15;
  color: var(--ink);
  padding-right: 4.5rem;
}
.dv-close {
  position: absolute;
  top: 0.85rem;
  right: 0.9rem;
  appearance: none;
  border: 1px solid var(--gold-soft);
  background: transparent;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}
.dv-close:hover, .dv-close:focus-visible { color: var(--accent); border-color: var(--accent); }

.dv-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.1rem 1.2rem 2rem;
  font-size: 1.02rem;
  line-height: 1.62;
}
.dv-body h2, .dv-body h3, .dv-body h4, .dv-body h5 {
  font-family: var(--fell);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
  margin: 1.6em 0 0.5em;
}
.dv-body h2 { font-size: 1.28rem; }
.dv-body h3 { font-size: 1.1rem; }
.dv-body h4, .dv-body h5 { font-size: 1rem; }
.dv-body p { margin: 0 0 0.9em; }
.dv-body ul, .dv-body ol { margin: 0 0 0.9em; padding-left: 1.4em; }
.dv-body li { margin-bottom: 0.35em; }
.dv-body blockquote {
  margin: 0 0 0.9em;
  padding: 0.1em 0 0.1em 0.9em;
  border-left: 2px solid var(--gold-soft);
  color: var(--ink-3);
}
.dv-body code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: rgba(184, 142, 68, 0.1);
  padding: 0.08em 0.3em;
  overflow-wrap: anywhere;
}
.dv-body pre {
  background: rgba(26, 22, 17, 0.045);
  border: 1px solid rgba(184, 142, 68, 0.28);
  padding: 0.8em 0.9em;
  overflow-x: auto;
  margin: 0 0 0.9em;
  font-size: 0.78rem;
  line-height: 1.5;
}
.dv-body pre code { background: none; padding: 0; font-size: inherit; }
.dv-body a { color: var(--accent); text-decoration-color: var(--gold-soft); }
.dv-doclink {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--ink-3);
  border-bottom: 1px dotted var(--gold-soft);
}
.dv-tablewrap { overflow-x: auto; margin: 0 0 0.9em; }
.dv-body table { border-collapse: collapse; font-size: 0.88rem; min-width: 100%; }
.dv-body th, .dv-body td {
  border: 1px solid var(--gold-soft);
  padding: 0.35em 0.6em;
  text-align: left;
  vertical-align: top;
}
.dv-body th { font-family: var(--fell); font-weight: 400; color: var(--ink); }
.dv-body hr {
  border: none;
  height: 1px;
  margin: 1.4em 0;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}
.dv-loading { color: var(--ink-3); font-style: italic; }
.dv-foot {
  padding: 0.6rem 1.2rem;
  border-top: 1px solid var(--gold-soft);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

/* Inside the portal the header stays compact — the canvas frame is the
 * page, so the reading column just fills it. */
.doc-portal .dv-head { padding: 0.8rem 1rem 0.65rem; }
.doc-portal .dv-head h1 { font-size: 1.25rem; }
.doc-portal .dv-body { padding: 0.9rem 1rem 1.6rem; font-size: 0.95rem; }
