/* Virage — the Ex-Libris identity on the web.
   Same values as Virage/UI/Theme.swift: leather binding, gold tooling, Didot and Georgia.
   No web fonts and no external requests: two files, one round trip.

   Note on the CSP in _headers: style-src is 'self' and script-src is 'none'. There is no
   inline style attribute and no JavaScript anywhere on this site, so everything that moves
   moves in CSS — including the mark drawing itself, which is the app's welcome screen
   (Virage/UI/OnboardingView.swift) translated line for line into keyframes.

   Per-volume cover colours arrive as custom properties in covers.css, written by build.py. */

:root {
  --leather: #4a1620;
  --night: #22090f;
  --night-deep: #160709;
  --gold: #c9a227;
  --gold-bright: #e8c96a;
  --gold-dark: #a37c14;
  --lamp: #fff3c4;
  --ember: #d4562e;
  --gold-soft: rgba(201, 162, 39, 0.42);
  --gold-hair: rgba(201, 162, 39, 0.22);
  --ivory: #efe3c8;
  /* Was 0.62 and too faint to read against near-black at small sizes. */
  --ivory-dim: rgba(239, 227, 200, 0.74);
  --ivory-faint: rgba(239, 227, 200, 0.5);

  --display: "Didot", "Bodoni 72", "Bodoni MT", "Playfair Display", "Hoefler Text", Garamond, serif;
  --prose: Georgia, "Iowan Old Style", "Palatino Linotype", serif;

  /* The one line that keeps the native audio player from arriving as a light grey pill
     on a leather page: browsers dress their own controls to match. */
  color-scheme: dark;

  --page: 76rem;
  --measure: 36rem;
  --band: clamp(4.75rem, 10vw, 11rem);
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--night-deep);
  color: var(--ivory);
  font-family: var(--prose);
  font-size: 1.0625rem;
  line-height: 1.72;
  background-image:
    radial-gradient(120% 55% at 50% -8%, rgba(74, 22, 32, 0.85) 0%, rgba(34, 9, 15, 0) 60%),
    linear-gradient(180deg, var(--night) 0%, var(--night-deep) 45%);
  background-attachment: fixed;
  overflow-x: clip;
}

/* Leather has a tooth. One tiling of noise over the whole page, drawn by the browser
   rather than downloaded — img-src allows data:, which is the only reason this is free. */
.grain {
  position: fixed; inset: 0; z-index: 9; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* The gradients the mark is painted with live once, here, and every instance of the mark
   on the page points at them. Duplicating them per <svg> would duplicate their ids. */
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* `.wrap` is horizontal only. It used to carry `padding: 0 1.5rem`, which — being a class
   against a bare `section` selector — won on specificity and silently deleted every
   section's vertical rhythm. Spacing now lives on `.band`, which never also centres. */
.wrap { max-width: var(--page); margin-inline: auto; padding-inline: 1.5rem; }
.band { padding-block: var(--band); position: relative; }
.band + .band { padding-top: 0; }

.engraved {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 0.7rem;
  color: var(--gold);
  margin: 0 0 1rem;
}

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.12; margin: 0; }
h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); margin-bottom: 1rem; text-wrap: balance; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1.25rem; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }
a { color: var(--gold); }

.sub { color: var(--ivory-dim); }

/* --- Masthead ------------------------------------------------------------ */

/* Sticky, and only dressed once the page has moved: at the top it is part of the hero,
   further down it is a bar with the night behind it. */
.masthead {
  position: sticky; top: 0; z-index: 8;
  border-bottom: 1px solid transparent;
}
.masthead::before {
  content: ""; position: absolute; inset: 0;
  background: rgba(22, 7, 9, 0.72);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  opacity: 0;
}
.masthead-inner {
  position: relative;
  display: flex; align-items: center; gap: 1rem;
  padding-block: 1.3rem;
}
.wordmark {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--display); font-size: 1.45rem; color: var(--ivory);
  text-decoration: none; letter-spacing: 0.02em;
  margin-right: auto;
}
.wordmark .mark { width: 1.9rem; height: 1.9rem; }

.nav { display: none; gap: 1.6rem; margin-right: 1.4rem; }
.nav a {
  font-family: var(--display); font-size: 0.95rem; color: var(--ivory-dim);
  text-decoration: none; padding-block: 0.3rem;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.nav a:hover { color: var(--gold); border-bottom-color: var(--gold-soft); }
@media (min-width: 56rem) { .nav { display: flex; } }

.masthead-end { display: flex; align-items: center; gap: 0.9rem; }
.lang { display: flex; gap: 0.35rem; align-items: center; }
.lang a, .lang span {
  font-family: var(--display); text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 0.72rem; text-decoration: none; padding: 0.35rem 0.6rem; border-radius: 4px;
  border: 1px solid transparent;
}
.lang a { color: var(--ivory-dim); border-color: var(--gold-hair); }
.lang a:hover { color: var(--gold); border-color: var(--gold-soft); }
.lang [aria-current] { color: var(--night); background: var(--gold); }

.masthead .gilded { display: none; }
@media (min-width: 48rem) { .masthead .gilded { display: inline-flex; } }

/* --- The mark ------------------------------------------------------------ */

/* docs/brand/logo-sceau.svg, exactly — and, in the hero, struck rather than shown:
   the rule tooled, the road laid, the lane dashes painted nearest first, the lamps lit.
   The order and the timings are OnboardingView.VirageMark's. */
.mark { display: block; }
.mk-dash { transform-box: fill-box; }

@media (prefers-reduced-motion: no-preference) {
  .mark.struck .mk-rule {
    stroke-dasharray: 100; stroke-dashoffset: 100;
    animation: tool 1s cubic-bezier(0.65, 0, 0.35, 1) forwards;
  }
  .mark.struck .mk-road {
    animation: pave 0.7s var(--ease) 0.43s both;
  }
  .mark.struck .mk-dash { opacity: 0; animation: paint 0.3s ease-out both; }
  .mark.struck .mk-dash:nth-child(1) { animation-delay: 0.86s; }
  .mark.struck .mk-dash:nth-child(2) { animation-delay: 0.98s; }
  .mark.struck .mk-dash:nth-child(3) { animation-delay: 1.1s; }
  .mark.struck .mk-dash:nth-child(4) { animation-delay: 1.22s; }
  .mark.struck .mk-halo { opacity: 0; animation: glow 0.9s ease-out 1.34s forwards; }
  .mark.struck .mk-lamps {
    transform-box: fill-box; transform-origin: center;
    animation: light 0.7s cubic-bezier(0.2, 1.5, 0.4, 1) 1.34s both;
  }
  .mark.struck .mk-glow {
    transform-box: fill-box; transform-origin: center;
    animation: breathe 3.4s ease-in-out 2.1s infinite alternate;
  }
}

@keyframes tool { to { stroke-dashoffset: 0; } }
@keyframes pave { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes paint { from { opacity: 0; } to { opacity: 1; } }
@keyframes glow { from { opacity: 0; } to { opacity: 1; } }
@keyframes light { from { opacity: 0; scale: 0.2; } to { opacity: 1; scale: 1; } }
@keyframes breathe { from { scale: 1; opacity: 0.82; } to { scale: 1.14; opacity: 1; } }

/* --- Hero ---------------------------------------------------------------- */

.hero { position: relative; padding-block: clamp(2.5rem, 6vw, 5.5rem) var(--band); overflow: hidden; }

/* The lamp in the night, and the dust rising through it — LampBackdrop and GoldDust,
   which is what the app opens on. */
.stage { position: absolute; inset: -6rem 0 0; pointer-events: none; z-index: 0; }
.lamp {
  position: absolute; left: 50%; top: 0;
  width: min(120rem, 190%); aspect-ratio: 1.6 / 1;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(74, 22, 32, 0.62) 0%, rgba(74, 22, 32, 0.22) 45%, transparent 72%);
}
.dust { position: absolute; inset: 0; overflow: hidden; }
.dust i {
  position: absolute; bottom: -2rem; display: block; border-radius: 50%;
  background: var(--gold); opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .lamp { animation: lamp 5.5s ease-in-out infinite alternate; }
  .dust i { animation: mote linear infinite; }
}
@keyframes lamp {
  from { opacity: 0.72; transform: translateX(-50%) scale(0.94); }
  to { opacity: 1; transform: translateX(-50%) scale(1.07); }
}
@keyframes mote {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  12% { opacity: 0.34; }
  80% { opacity: 0.18; }
  100% { transform: translate3d(1.5rem, -85vh, 0); opacity: 0; }
}

/* Sixteen motes, scattered by hand — the same trick as the app's deterministic hash,
   with the shuffling done once here instead of every launch. */
.dust i:nth-child(1)  { left: 6%;  width: 2px; height: 2px; animation-duration: 26s; animation-delay: -3s; }
.dust i:nth-child(2)  { left: 13%; width: 3px; height: 3px; animation-duration: 34s; animation-delay: -14s; }
.dust i:nth-child(3)  { left: 21%; width: 2px; height: 2px; animation-duration: 22s; animation-delay: -8s; }
.dust i:nth-child(4)  { left: 27%; width: 4px; height: 4px; animation-duration: 40s; animation-delay: -22s; }
.dust i:nth-child(5)  { left: 34%; width: 2px; height: 2px; animation-duration: 30s; animation-delay: -1s; }
.dust i:nth-child(6)  { left: 41%; width: 3px; height: 3px; animation-duration: 24s; animation-delay: -17s; }
.dust i:nth-child(7)  { left: 47%; width: 2px; height: 2px; animation-duration: 36s; animation-delay: -6s; }
.dust i:nth-child(8)  { left: 53%; width: 2px; height: 2px; animation-duration: 28s; animation-delay: -25s; }
.dust i:nth-child(9)  { left: 59%; width: 4px; height: 4px; animation-duration: 44s; animation-delay: -11s; }
.dust i:nth-child(10) { left: 65%; width: 2px; height: 2px; animation-duration: 23s; animation-delay: -19s; }
.dust i:nth-child(11) { left: 71%; width: 3px; height: 3px; animation-duration: 32s; animation-delay: -4s; }
.dust i:nth-child(12) { left: 77%; width: 2px; height: 2px; animation-duration: 27s; animation-delay: -30s; }
.dust i:nth-child(13) { left: 83%; width: 2px; height: 2px; animation-duration: 38s; animation-delay: -9s; }
.dust i:nth-child(14) { left: 88%; width: 3px; height: 3px; animation-duration: 21s; animation-delay: -15s; }
.dust i:nth-child(15) { left: 93%; width: 2px; height: 2px; animation-duration: 42s; animation-delay: -27s; }
.dust i:nth-child(16) { left: 97%; width: 2px; height: 2px; animation-duration: 29s; animation-delay: -20s; }

.hero-inner {
  position: relative; z-index: 1;
  display: grid; gap: clamp(3.25rem, 6vw, 6rem); align-items: center;
}
@media (min-width: 62rem) {
  .hero-inner { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
}

.hero-copy .engraved { margin-bottom: 0.9rem; }
.hero h1 {
  font-size: clamp(3.6rem, 9vw, 7rem);
  margin: 0;
  letter-spacing: 0.005em;
  line-height: 0.95;
}
.hero .tagline {
  font-family: var(--display); font-style: italic;
  font-size: clamp(1.35rem, 2.7vw, 2.05rem);
  color: var(--gold); margin: 0.6rem 0 1.6rem;
  max-width: none;
  text-wrap: balance;
}
.hero .lede { font-size: 1.1rem; color: var(--ivory-dim); }

.actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: clamp(2.2rem, 3.5vw, 3rem); }
.aside { font-size: 0.9rem; color: var(--ivory-dim); max-width: 16rem; }

/* The three facts a reader wants before the fold, set like the engraved metadata on a
   volume's cover. */
.facts {
  list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem;
  margin: clamp(2.4rem, 4vw, 3.4rem) 0 0; padding: 1.25rem 0 0;
  border-top: 1px solid var(--gold-hair);
}
.facts li {
  font-family: var(--display); text-transform: uppercase; letter-spacing: 0.16em;
  font-size: 0.66rem; color: var(--ivory-faint);
}
.facts strong { color: var(--gold); font-weight: 400; letter-spacing: 0.16em; }

/* --- The gilded button --------------------------------------------------- */

.gilded {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
  background: linear-gradient(160deg, var(--gold-bright), var(--gold) 55%, var(--gold-dark));
  color: var(--night);
  font-family: var(--display); font-size: 1.08rem;
  padding: 0.95rem 2rem; border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 8px 24px rgba(201, 162, 39, 0.18);
  transition: box-shadow 0.25s ease, transform 0.25s var(--ease), filter 0.2s ease;
}
.gilded > span { position: relative; z-index: 1; }
/* Foil catches the light when you reach for it. */
.gilded::after {
  content: ""; position: absolute; top: -60%; bottom: -60%; left: -30%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-160%) rotate(8deg);
}
.gilded:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(201, 162, 39, 0.3);
  filter: brightness(1.05);
}
.gilded:active { transform: translateY(0); }
@media (prefers-reduced-motion: no-preference) {
  .gilded:hover::after { animation: sheen 0.8s ease-out; }
}
@keyframes sheen { to { transform: translateX(420%) rotate(8deg); } }

.gilded.small { font-size: 0.92rem; padding: 0.6rem 1.1rem; border-radius: 6px; }

.quiet {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--display); font-size: 1rem; color: var(--gold);
  text-decoration: none; padding: 0.9rem 1.4rem;
  border: 1px solid var(--gold-soft); border-radius: 8px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.quiet:hover { background: rgba(201, 162, 39, 0.09); border-color: var(--gold); }

/* --- The hero stage: the mark, and the shelf under it -------------------- */

.hero-stage { display: grid; justify-items: center; }
.hero-stage .mark {
  width: clamp(9rem, 26vw, 15rem); height: clamp(9rem, 26vw, 15rem);
  filter: drop-shadow(0 0 40px rgba(201, 162, 39, 0.16));
}

.fan {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem; width: min(100%, 27rem);
  margin-top: clamp(-2rem, -2vw, -0.75rem);
  perspective: 1400px;
}
.fan .cover { transition: transform 0.45s var(--ease), box-shadow 0.45s ease; }
.fan .cover:nth-child(1) { transform: rotate(-6deg) rotateY(18deg) translateY(1.1rem); }
.fan .cover:nth-child(2) { transform: translateY(-0.6rem) scale(1.05); z-index: 2; }
.fan .cover:nth-child(3) { transform: rotate(6deg) rotateY(-18deg) translateY(1.1rem); }
.fan:hover .cover:nth-child(1) { transform: rotate(-8deg) rotateY(10deg) translateY(0.5rem); }
.fan:hover .cover:nth-child(2) { transform: translateY(-1.2rem) scale(1.07); }
.fan:hover .cover:nth-child(3) { transform: rotate(8deg) rotateY(-10deg) translateY(0.5rem); }

@media (prefers-reduced-motion: no-preference) {
  /* `translate` rather than `transform`, so the float and the fan pose do not fight. */
  .fan .cover { animation: float 7s ease-in-out infinite alternate; }
  .fan .cover:nth-child(2) { animation-duration: 6s; animation-delay: -2s; }
  .fan .cover:nth-child(3) { animation-duration: 8s; animation-delay: -4s; }
}
@keyframes float { from { translate: 0 0.35rem; } to { translate: 0 -0.35rem; } }

/* The shelf they lean on: a rule, a bloom of lamplight, and nothing else. */
.board { width: min(100%, 30rem); margin-top: 1.6rem; position: relative; height: 3rem; }
.board::before {
  content: ""; position: absolute; inset-inline: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft) 25%, var(--gold-soft) 75%, transparent);
}
.board::after {
  content: ""; position: absolute; left: 50%; top: -1.5rem; transform: translateX(-50%);
  width: 78%; height: 4rem;
  background: radial-gradient(closest-side, rgba(201, 162, 39, 0.2), transparent 70%);
  filter: blur(6px);
}

/* --- Ornament rule ------------------------------------------------------- */

.rule { display: flex; align-items: center; gap: 1.2rem; color: var(--gold-hair); }
.rule::before, .rule::after { content: ""; height: 1px; background: currentColor; flex: 1; }
.rule span { color: var(--gold); opacity: 0.75; font-size: 1rem; }

/* --- Section headings ---------------------------------------------------- */

.head { margin-bottom: clamp(2.6rem, 4.5vw, 4rem); }
.head .sub { max-width: var(--measure); margin-bottom: 0; }
.head .rule { margin-bottom: 2rem; }

/* Heading in one column, prose in the other. A measure of 36rem is right for reading and
   wrong for a 76rem page: alone it leaves half the screen empty and the page looks
   unfinished rather than airy. */
.split { display: grid; gap: 2.75rem; align-items: center; }
@media (min-width: 62rem) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(4rem, 7vw, 7rem); }
  .split .head { margin-bottom: 1.4rem; }
  .split.narrow-first { grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); align-items: start; }
}

/* --- Cards --------------------------------------------------------------- */

.framed {
  border: 1px solid var(--gold-hair);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(74, 22, 32, 0.32), rgba(34, 9, 15, 0.5));
  padding: clamp(1.7rem, 2.6vw, 2.4rem) clamp(1.8rem, 2.8vw, 2.5rem);
  position: relative;
  transition: border-color 0.3s ease, transform 0.3s var(--ease);
}
.framed::after {
  content: ""; position: absolute; inset: 4px;
  border: 1px solid rgba(201, 162, 39, 0.14); border-radius: 8px;
  pointer-events: none;
}
.framed:hover { border-color: var(--gold-soft); }
.framed p { max-width: none; color: var(--ivory-dim); }

.grid { display: grid; gap: clamp(1.1rem, 2vw, 1.8rem); }
@media (min-width: 48rem) { .grid.three { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 42rem) { .grid.two { grid-template-columns: repeat(2, 1fr); } }

/* --- How it reads: the fork, and the three steps ------------------------- */

.road-panel {
  display: grid; place-items: center;
  padding: clamp(2.5rem, 5vw, 4rem) 1.5rem;
  border: 1px solid var(--gold-hair); border-radius: 14px;
  background:
    radial-gradient(80% 60% at 50% 100%, rgba(74, 22, 32, 0.55), transparent 70%),
    rgba(22, 7, 9, 0.45);
}
.road { width: min(100%, 20rem); height: auto; }
.road .trunk, .road .branch { fill: none; stroke-linecap: round; }
.road .trunk { stroke: rgba(201, 162, 39, 0.55); stroke-width: 2.4; }
.road .branch { stroke: rgba(239, 227, 200, 0.22); stroke-width: 1.6; }
.road .end { fill: rgba(239, 227, 200, 0.25); }

@media (prefers-reduced-motion: no-preference) {
  .road .trunk { stroke-dasharray: 100; stroke-dashoffset: 100; animation: tool 0.55s ease-out forwards; }
  .road .branch { stroke-dasharray: 100; stroke-dashoffset: 100; animation: tool 0.75s ease-out 0.42s forwards, chosen 3.4s ease-in-out 1.6s infinite; }
  .road .branch.right, .road .end.right { animation-delay: 0.42s, 3.3s; }
  .road .end { opacity: 0; animation: paint 0.4s ease-out 1s forwards, chosen-dot 3.4s ease-in-out 1.6s infinite; }
  .road .end.right { animation-delay: 1s, 3.3s; }
}
/* One branch lights, then the other: the choice, on a loop. */
@keyframes chosen {
  0%, 44% { stroke: rgba(239, 227, 200, 0.22); stroke-width: 1.6; filter: none; }
  8%, 36% { stroke: var(--gold-bright); stroke-width: 2.6; filter: drop-shadow(0 0 6px rgba(201, 162, 39, 0.8)); }
  50%, 100% { stroke: rgba(239, 227, 200, 0.22); stroke-width: 1.6; filter: none; }
}
@keyframes chosen-dot {
  0%, 44% { fill: rgba(239, 227, 200, 0.25); r: 3.5; filter: none; }
  8%, 36% { fill: var(--gold-bright); r: 5; filter: drop-shadow(0 0 8px rgba(201, 162, 39, 0.9)); }
  50%, 100% { fill: rgba(239, 227, 200, 0.25); r: 3.5; filter: none; }
}

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(1.6rem, 2.6vw, 2.4rem); }
.steps li { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.steps .num {
  font-family: var(--display); font-size: 1.5rem; color: var(--gold);
  line-height: 1.1; text-align: center;
  border-right: 1px solid var(--gold-hair); padding-right: 0.9rem;
}
.steps h3 { margin-bottom: 0.3rem; }
.steps p { color: var(--ivory-dim); max-width: none; font-size: 0.98rem; }

/* --- The car screen ------------------------------------------------------ */

/* Not a photograph of a dashboard — the volume as it actually appears on the car's
   screen: the title, the narration running, and two roads with no clock on them. */
.dash {
  border-radius: 16px; padding: 0.7rem;
  background: linear-gradient(180deg, rgba(74, 22, 32, 0.5), rgba(22, 7, 9, 0.8));
  border: 1px solid var(--gold-hair);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.55);
}
.dash-screen {
  border-radius: 11px; padding: 1.1rem 1.2rem 1.2rem;
  background: linear-gradient(160deg, var(--leather), var(--night-deep) 80%);
  border: 1px solid var(--gold-soft);
}
.dash-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-bottom: 0.7rem; border-bottom: 1px solid var(--gold-hair);
}
.dash-bar .name { font-family: var(--display); font-size: 1rem; color: var(--ivory); }
.dash-bar .clock {
  font-family: var(--display); letter-spacing: 0.18em; font-size: 0.66rem; color: var(--gold);
}
.wave { display: flex; align-items: flex-end; gap: 3px; height: 1.5rem; margin: 1rem 0 0.9rem; }
.wave i { display: block; width: 3px; border-radius: 2px; background: var(--gold); height: 22%; opacity: 0.85; }
@media (prefers-reduced-motion: no-preference) {
  .wave i { animation: wave 1.1s ease-in-out infinite alternate; }
  .wave i:nth-child(2n) { animation-duration: 0.85s; }
  .wave i:nth-child(3n) { animation-duration: 1.4s; }
  .wave i:nth-child(1) { animation-delay: -0.1s; }
  .wave i:nth-child(2) { animation-delay: -0.5s; }
  .wave i:nth-child(3) { animation-delay: -0.9s; }
  .wave i:nth-child(4) { animation-delay: -0.3s; }
  .wave i:nth-child(5) { animation-delay: -0.7s; }
  .wave i:nth-child(6) { animation-delay: -1.1s; }
  .wave i:nth-child(7) { animation-delay: -0.2s; }
  .wave i:nth-child(8) { animation-delay: -0.6s; }
  .wave i:nth-child(9) { animation-delay: -1s; }
  .wave i:nth-child(10) { animation-delay: -0.4s; }
  .wave i:nth-child(11) { animation-delay: -0.8s; }
  .wave i:nth-child(12) { animation-delay: -1.2s; }
}
@keyframes wave { from { height: 18%; } to { height: 100%; } }

.dash-line {
  font-style: italic; font-size: 0.95rem; color: var(--ivory-dim);
  margin: 0 0 1.1rem; max-width: none;
}
.plates { display: grid; gap: 0.6rem; }
.plate {
  font-family: var(--display); font-size: 0.98rem; color: var(--ivory);
  padding: 0.75rem 0.95rem; border-radius: 8px;
  border: 1px solid var(--gold-soft);
  background: rgba(74, 22, 32, 0.55);
  position: relative;
}
.plate::after {
  content: ""; position: absolute; inset: 3px;
  border: 1px solid rgba(201, 162, 39, 0.2); border-radius: 6px;
}
@media (prefers-reduced-motion: no-preference) {
  .plate { animation: offered 3.4s ease-in-out infinite; }
  .plate:nth-child(2) { animation-delay: 1.7s; }
}
@keyframes offered {
  0%, 40%, 100% { border-color: var(--gold-soft); background: rgba(74, 22, 32, 0.55); }
  12%, 28% { border-color: var(--gold-bright); background: rgba(74, 22, 32, 0.85); }
}

/* --- The extract --------------------------------------------------------- */

/* The player is the app's own page, not a media widget bolted on: the engraved slug,
   the take, and then the choice the recording stops on — the same bookplates the
   listener would be looking at when it stops. */
.player {
  border: 1px solid var(--gold-hair); border-radius: 14px;
  padding: clamp(1.7rem, 2.6vw, 2.3rem) clamp(1.5rem, 2.4vw, 2.1rem);
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(74, 22, 32, 0.55), transparent 70%),
    rgba(22, 7, 9, 0.5);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
}
.player .engraved { margin-bottom: 0.9rem; }
.player audio {
  display: block; width: 100%; border-radius: 8px;
}
.player .stops {
  font-size: 0.84rem; color: var(--ivory-faint); max-width: none;
  margin: 1.5rem 0 0.5rem;
}
.player .prompt {
  font-family: var(--display); font-style: italic; font-size: 1.15rem;
  color: var(--gold); max-width: none; margin: 0 0 0.9rem;
}

/* The scene in writing — typeset like the app's transcript: narration as prose,
   dialogue centred under a small-caps name. Also the whole reason the extract is
   readable by someone who cannot hear it. */
.transcript { margin-top: 2.2rem; border-top: 1px solid var(--gold-hair); padding-top: 1rem; }
.transcript summary {
  font-family: var(--display); font-size: 0.98rem; color: var(--gold);
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 0.6rem;
}
.transcript summary::-webkit-details-marker { display: none; }
.transcript summary::before {
  content: "▸"; font-size: 0.8rem; transition: transform 0.2s ease; display: inline-block;
}
.transcript[open] summary::before { transform: rotate(90deg); }
.transcript .scene { padding-top: 1.2rem; }
.transcript .narration { color: var(--ivory-dim); font-size: 0.95rem; }
.transcript .said {
  text-align: center; font-style: italic; color: var(--ivory);
  font-size: 0.95rem; margin-inline: auto;
}
.transcript .said .who {
  display: block; font-style: normal;
  font-family: var(--display); text-transform: uppercase; letter-spacing: 0.2em;
  font-size: 0.62rem; color: var(--ember); margin-bottom: 0.15rem;
}

/* --- The notebook -------------------------------------------------------- */

.notebook { display: flex; flex-direction: column; gap: 1rem; }
.notebook .tab {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.notebook .tab .engraved { margin: 0; }
.notebook .tab .engraved:last-child { color: var(--ivory-faint); }
.ruled { display: grid; gap: 0.85rem; margin: 0.2rem 0 0.4rem; }
.line { position: relative; height: 0.9rem; border-bottom: 1px solid rgba(239, 227, 200, 0.12); }
.line span {
  position: absolute; left: 0; bottom: 0.28rem; height: 3.5px; border-radius: 2px;
  background: var(--gold); opacity: 0.55;
  transform-origin: left center;
}
.line:nth-child(1) span { width: 82%; }
.line:nth-child(2) span { width: 64%; }
.line:nth-child(3) span { width: 90%; }
.notebook.blank .line span { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .notebook.writing .line span { animation: write 6s ease-out infinite; }
  .notebook.writing .line:nth-child(2) span { animation-delay: 0.33s; }
  .notebook.writing .line:nth-child(3) span { animation-delay: 0.66s; }
}
@keyframes write {
  0% { transform: scaleX(0); opacity: 0; }
  8%, 82% { transform: scaleX(1); opacity: 0.55; }
  92%, 100% { transform: scaleX(0); opacity: 0; }
}

.notebook .note {
  font-style: italic; font-size: 0.9rem; color: var(--ivory-faint);
  text-align: center; margin: 0;
}
.notebook h3 { margin-bottom: 0.35rem; }
.notebook > p { max-width: none; }

/* --- Stamps -------------------------------------------------------------- */

.medals { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0 0 2.2rem; padding: 0; list-style: none; }
.medal {
  width: 3.4rem; height: 3.4rem; border-radius: 50%;
  display: grid; place-items: center;
}
.medal svg { width: 46%; height: 46%; }
.medal.earned {
  background: radial-gradient(circle at 35% 30%, var(--gold-bright), var(--gold-dark));
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.28);
}
.medal.earned svg { stroke: #3a2705; }
/* Blind-embossed: the shape is visible, the secret is kept. */
.medal.blind { border: 1.2px solid rgba(239, 227, 200, 0.16); }
.medal.blind svg { stroke: rgba(239, 227, 200, 0.2); }

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .medal.earned { animation: strike 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both; animation-timeline: view(); animation-range: entry 10% cover 25%; }
    .medal.earned:nth-child(3) { animation-range: entry 18% cover 33%; }
  }
}
@keyframes strike {
  from { transform: scale(2.1) rotate(-12deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* --- The shelf ----------------------------------------------------------- */

.shelf { display: grid; gap: clamp(1.8rem, 3vw, 2.8rem) clamp(1.2rem, 1.8vw, 1.7rem); }
.shelf.produced { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.shelf.awaited { grid-template-columns: repeat(auto-fit, minmax(min(50% - 0.6rem, 10.5rem), 1fr)); }

.volume { display: flex; flex-direction: column; gap: 0.8rem; }

/* The app's VolumeTile: the mood colour sinking into the night, title on the cover,
   and the spine turned just enough to say it is a book. */
.cover {
  position: relative;
  aspect-ratio: 1 / 1.32;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--gold-soft);
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.1) 6%, rgba(201, 162, 39, 0.22) 6.6%, rgba(0, 0, 0, 0) 8.5%),
    linear-gradient(145deg, var(--mood, var(--leather)) 0%, var(--night) 100%);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.55);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 0.75rem 0.75rem 0.75rem 1.1rem;
}
.cover::after {
  content: ""; position: absolute; inset: 4px;
  border: 1px solid rgba(201, 162, 39, 0.28); border-radius: 7px;
  pointer-events: none;
}
/* The light that runs across the gilding when a volume is picked up. */
.cover::before {
  content: ""; position: absolute; inset: -50% -20%;
  background: linear-gradient(100deg, transparent 40%, rgba(255, 243, 196, 0.16) 50%, transparent 60%);
  transform: translateX(-60%);
  transition: transform 0.7s var(--ease);
  pointer-events: none;
}
.volume:hover .cover::before { transform: translateX(60%); }

.volume .cover { transition: transform 0.4s var(--ease), box-shadow 0.4s ease, border-color 0.3s ease; }
.volume:hover .cover {
  transform: translateY(-6px);
  border-color: var(--gold);
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.6);
}

.cover .band-tag {
  align-self: flex-start; position: relative; z-index: 1;
  font-family: var(--display); text-transform: uppercase; letter-spacing: 0.16em;
  font-size: 0.56rem; padding: 0.28rem 0.5rem; border-radius: 4px;
  border: 1px solid var(--gold-soft); color: var(--gold);
  background: rgba(22, 7, 9, 0.55);
}
.cover .band-tag.filled { background: var(--gold); color: var(--night); border-color: var(--gold); }
.cover .foot { position: relative; z-index: 1; }
.cover .title {
  font-family: var(--display); color: var(--ivory);
  font-size: clamp(0.98rem, 1.5vw, 1.25rem); line-height: 1.15;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75);
  margin: 0; padding: 0.2rem 0.25rem 0.1rem; max-width: none;
}
/* Announced volumes are there to be wanted, not mistaken for something you can open. */
.volume.awaited .cover { opacity: 0.7; }
.volume.awaited:hover .cover { opacity: 0.9; }

.loupes { display: flex; gap: 0.22rem; padding: 0.35rem 0.25rem 0; }
.loupes i {
  width: 0.5rem; height: 0.5rem; border-radius: 50%; display: block;
  border: 1px solid var(--gold); background: transparent;
}
.loupes i.on { background: var(--gold); }

.volume .caption {
  font-family: var(--display); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.6rem; color: var(--gold); margin: 0;
}
.volume .name { font-family: var(--display); font-size: 1.1rem; color: var(--ivory); margin: 0; }
.volume .blurb { font-size: 0.92rem; color: var(--ivory-dim); margin: 0.35rem 0 0; max-width: none; line-height: 1.6; }

/* --- Notice -------------------------------------------------------------- */

.notice {
  border-left: 3px solid var(--gold);
  background: rgba(74, 22, 32, 0.45);
  padding: 1.2rem 1.4rem; border-radius: 0 8px 8px 0;
  max-width: var(--measure);
}
.notice strong { color: var(--gold); font-weight: normal; font-family: var(--display); font-size: 1.05rem; }

/* --- Closing ------------------------------------------------------------- */

.closing { text-align: center; position: relative; }
.closing .inner {
  border: 1px solid var(--gold-hair); border-radius: 18px;
  padding: clamp(3rem, 7vw, 5.5rem) 1.5rem;
  background:
    radial-gradient(70% 100% at 50% 0%, rgba(74, 22, 32, 0.6), transparent 70%),
    rgba(22, 7, 9, 0.35);
}
.closing .mark { width: 5rem; height: 5rem; margin: 0 auto 1.4rem; }
.closing h2 { margin-bottom: 0.8rem; }
.closing p { margin-inline: auto; color: var(--ivory-dim); }
.closing .actions { justify-content: center; }

/* --- Footer -------------------------------------------------------------- */

footer { border-top: 1px solid var(--gold-hair); margin-top: var(--band); padding-block: clamp(2.75rem, 4vw, 3.75rem) clamp(3.5rem, 5vw, 5rem); }
footer p { font-size: 0.88rem; color: var(--ivory-faint); }
footer .links { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-bottom: 1rem; }
footer a { text-decoration: none; font-size: 0.9rem; }
footer a:hover { text-decoration: underline; }

/* --- Skip link ----------------------------------------------------------- */

.skip {
  position: absolute; left: -9999px;
  background: var(--gold); color: var(--night); padding: 0.6rem 1rem; border-radius: 0 0 6px 0;
}
.skip:focus { left: 0; top: 0; z-index: 10; }

:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; border-radius: 3px; }

/* --- Arrival ------------------------------------------------------------- */

/* The hero arrives on a clock, because it is on screen before anyone can scroll. */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *, .hero-stage { animation: rise 0.9s var(--ease) both; }
  .hero-copy .engraved { animation-delay: 0.15s; }
  .hero-copy h1 { animation-delay: 0.25s; }
  .hero-copy .tagline { animation-delay: 0.4s; }
  .hero-copy .lede { animation-delay: 0.55s; }
  .hero-copy .actions { animation-delay: 0.7s; }
  .hero-copy .facts { animation-delay: 0.85s; }
  .hero-stage { animation-delay: 0.2s; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(1.1rem); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* Everything below the fold arrives on the scroll instead. Where the browser cannot do
   scroll-driven animation the page is simply already there, which is the correct
   fallback for a page whose whole job is to be read. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .band .head, .band .framed, .band .volume, .band .dash, .band .player,
    .band .road-panel, .band .steps li, .band .medals, .closing .inner,
    .band .sub:not(.head *), .band .notebook {
      animation: rise 0.7s var(--ease) both;
      animation-timeline: view();
      animation-range: entry 4% cover 20%;
    }
    .grid > *:nth-child(2), .steps li:nth-child(2), .shelf > *:nth-child(2) { animation-range: entry 10% cover 26%; }
    .grid > *:nth-child(3), .steps li:nth-child(3), .shelf > *:nth-child(3) { animation-range: entry 16% cover 32%; }
    .shelf > *:nth-child(4) { animation-range: entry 20% cover 36%; }

    /* The masthead is bare over the hero and dressed once the page has moved. */
    .masthead { animation: dress linear both; animation-timeline: scroll(); animation-range: 0 6rem; }
    .masthead::before { animation: paint linear both; animation-timeline: scroll(); animation-range: 0 6rem; }
  }
}
@keyframes dress { to { border-bottom-color: var(--gold-hair); } }
