/* latin-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-500-italic-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-500-italic-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-500-normal-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-500-normal-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Gentium Plus';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/gentium-plus-400-italic-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Gentium Plus';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/gentium-plus-400-italic-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Gentium Plus';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/gentium-plus-400-normal-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Gentium Plus';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/gentium-plus-400-normal-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Gentium Plus';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/gentium-plus-700-normal-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Gentium Plus';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/gentium-plus-700-normal-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Stage tokens, ported from the :root block of mocks/theater/motion-theater.css (READ-R1.1).
   The six contract tokens (--soot, --lamp, --lx, --ly, --creep, --dawn) are declared once, here, on :root.
   html[data-fright="nightmare"] reuses them and adds none. */
:root {
  color-scheme: dark;

  /* D41 "Blood & Ash" (docs/decisions.md): void, ash surface, bone, muted ash, dried arterial blood, dying tallow. */
  --soot: #030304;
  --soot-2: #0a0909;
  --ink-line: rgba(166, 30, 23, 0.42); /* the blood hairline */
  --lamp: #c87d32;
  --lamp-hot: #e29a4f;
  --ochre: #c87d32;
  --tallow: #c87d32;
  --bone: #e2dcd2;
  --bone-dim: #8a8177;
  --blood: #a61e17;
  --blood-text: #e0584c; /* the stamp's ink: --blood is too dark to read as text on the void */
  --ash: #b9afa2; /* drifting specks */
  --edge: 2px; /* sharp chrome instead of pills */
  --danger: #a61e17;
  --lamp-r: 34vmax;
  --dark: 0.94;
  --lx: 52%;
  --ly: 44%;
  --flame: 1;
  --creep: 0;
  --dawn: 0;
}

/* Reduced motion (media query and in-app switch): no smooth scrolling. The tokens are only ever written by the engine,
   which does not animate --creep or the lamp under reduced motion (READ-R11 to READ-R18, later tasks). */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

html[data-reduced-motion="true"] {
  scroll-behavior: auto;
}
/* /judges, /sources, /pricing, /how-its-made, /faq, /press (docs/ui/screens.md S13–S15) — Blood & Ash Archival Folio (D41).
   Uses tokens.css stage tokens; adds none. Controls >= 44x44 px, text >= 12 px, reading measure <= 75 ch. */
.pub {
  background: var(--soot);
  color: var(--bone);
  min-height: 100vh;
  font-family: "Gentium Plus", Georgia, serif;
  line-height: 1.55;
}
.pub * { box-sizing: border-box; }
.pub a { color: var(--lamp-hot); }
.pub a:focus-visible,
.pub button:focus-visible,
.pub input:focus-visible {
  outline: 2px solid var(--lamp-hot);
  outline-offset: 2px;
}

/* Header: borderless uppercase Cormorant masthead + eroded crimson-ash relief band */
.pub-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ink-line);
}
.pub-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 5px;
  background-image:
    repeating-linear-gradient(45deg, var(--ink-line) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(-45deg, var(--blood) 0 1px, transparent 1px 11px);
  opacity: 0.85;
  pointer-events: none;
}
.pub-brand {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.375rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone) !important;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.pub-pill {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--bone-dim) !important;
  text-decoration: none;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.9375rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 160ms ease, border-color 160ms ease;
}
.pub-pill:hover {
  color: var(--bone) !important;
  border-bottom-color: var(--ink-line);
}
.pub-pill[aria-current="page"] {
  background: transparent;
  color: var(--bone) !important;
  border-bottom-color: var(--blood-text);
  font-weight: 600;
}

/* Main archival reading column */
.pub-main {
  max-width: 760px;
  margin: 0 auto;
}
/* .mkt-main owns the page padding (16px sides and top, 48px bottom); the extra
   20px above the h1 and 16px below the last block keep the old 36/64 rhythm. */
.pub-main > h1:first-child { margin-top: 28px; }
.pub-main > :last-child { margin-bottom: 16px; }
.pub h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2.35rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 8px 0 12px;
  line-height: 1.05;
  color: var(--bone);
}
@media (min-width: 720px) {
  .pub h1 { font-size: 3.1rem; }
}
.pub h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 40px 0 14px;
  color: var(--blood-text);
  display: flex;
  align-items: center;
  gap: 14px;
}
.pub h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ink-line);
}
.pub h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  margin: 0 0 8px;
  color: var(--bone);
}
.pub p, .pub li { font-size: 1rem; max-width: 66ch; }
.pub-lede {
  color: var(--bone);
  font-style: italic;
  font-size: 1.125rem;
  margin: 0 0 24px;
  opacity: 0.88;
}
.pub-muted { color: var(--bone-dim); font-size: 0.9375rem; }
.pub code { font-size: 0.9375rem; color: var(--lamp-hot); overflow-wrap: anywhere; }
.pub-note {
  border: 0;
  border-left: 3px solid var(--blood);
  border-top: 1px solid var(--ink-line);
  border-bottom: 1px solid var(--ink-line);
  background: var(--soot-2);
  border-radius: var(--edge);
  padding: 14px 18px;
}
.pub-sub { margin-top: 24px; color: var(--bone-dim); }

/* Chipped dried arterial crimson primary action (matches / and /shelf CTAs) */
.pub-button {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border-radius: var(--edge);
  border: 0;
  background-color: transparent;
  background-image:
    linear-gradient(135deg, transparent 6px, var(--blood) 0),
    linear-gradient(-135deg, transparent 6px, var(--blood) 0),
    linear-gradient(45deg, transparent 6px, var(--blood) 0),
    linear-gradient(-45deg, transparent 6px, var(--blood) 0);
  background-position: top left, top right, bottom left, bottom right;
  background-size: 51% 51%;
  background-repeat: no-repeat;
  color: var(--bone) !important;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: filter 160ms ease;
}
.pub-button:hover { filter: brightness(1.18); }
/* The reader's phone stylesheet hides #btn-judge-tour in the reader header (reader-phone.css). On this page it is the drawer's opener. */
.pub #btn-judge-tour { display: inline-flex; }
.pub-button:disabled { opacity: 0.65; cursor: progress; }

/* Archival ledger entries (left-ruled slabs instead of generic rounded cards) */
.pub-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 720px) { .pub-cards { grid-template-columns: 1fr 1fr; gap: 20px; } }
.pub-card {
  border: 0;
  border-top: 1px solid var(--ink-line);
  border-left: 2px solid var(--blood);
  border-radius: var(--edge);
  background: var(--soot-2);
  padding: 16px 18px;
}
.pub-dl { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 0; }
.pub-dl dt {
  color: var(--blood-text);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 10px;
}
.pub-dl dd { margin: 0; overflow-wrap: anywhere; }
.pub-links { list-style: none; margin: 0; padding: 0; }
.pub-links a { min-height: 44px; display: inline-flex; align-items: center; }
.pub-credits li { margin: 6px 0; }

.pub-counts, .pub-gate { list-style: none; margin: 0 0 14px; padding: 0; }
.pub-counts { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.pub-counts li {
  border: 0;
  border-right: 1px solid var(--ink-line);
  padding: 2px 14px 2px 0;
  font-size: 0.9375rem;
  color: var(--bone-dim);
}
.pub-counts li:last-child { border-right: 0; padding-right: 0; }
.pub-gate li { padding: 3px 0; overflow-wrap: anywhere; }
.pub-end { border-top: 1px solid var(--ink-line); margin-top: 36px; padding-top: 16px; }

/* Forms: obsidian incised ledger inputs */
.pub-form {
  border: 0;
  border-top: 1px solid var(--ink-line);
  border-left: 2px solid var(--blood);
  border-radius: var(--edge);
  background: var(--soot-2);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 16px 0;
}
.pub-field { display: flex; flex-direction: column; gap: 6px; }
.pub-field label {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.9375rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.pub-field input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--edge);
  border: 1px solid var(--ink-line);
  background: var(--soot);
  color: var(--bone);
  font: inherit;
  font-size: 1rem;
}
.pub-field input:focus { border-color: var(--lamp-hot); }
.pub-field input[aria-invalid="true"] { border: 2px solid var(--blood-text); }
.pub-err { margin: 0; color: var(--bone); font-size: 0.9375rem; border-left: 3px solid var(--danger); padding-left: 10px; }
.pub-status { margin: 0; min-height: 1.5em; font-size: 0.9375rem; }
.pub-form[data-state="success"] .pub-status { border-left: 3px solid var(--lamp); padding-left: 10px; }
.pub-form .pub-button { align-self: flex-start; }

/* The walkthrough drawer, ported from the mock — Blood & Ash dossier */
.judge-drawer {
  margin: 18px 0 24px;
  padding: 18px 20px;
  border-radius: var(--edge);
  border: 1px solid var(--ink-line);
  border-left: 3px solid var(--blood);
  background: var(--soot-2);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.82);
}
.judge-drawer[hidden] { display: none; }
.judge-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; border-bottom: 1px solid var(--ink-line); padding-bottom: 8px; }
.pub .judge-head h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--blood-text);
}
.pub .judge-head h2::after { display: none; }
.icon-close {
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--edge);
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--bone-dim);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.625rem;
  cursor: pointer;
}
.icon-close:hover { color: var(--bone); border-bottom-color: var(--blood-text); }
.judge-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.judge-jump {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  text-align: left;
  padding: 10px 14px;
  border-radius: var(--edge);
  border: 1px solid var(--ink-line);
  background: var(--soot);
  font-size: 1rem;
  line-height: 1.42;
  color: var(--bone) !important;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.judge-jump:hover {
  border-color: var(--lamp-hot);
  background: rgba(166, 30, 23, 0.14);
}
.judge-skip { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .pub *, .pub *::before, .pub *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
html[data-reduced-motion="true"] .pub *,
html[data-reduced-motion="true"] .pub *::before,
html[data-reduced-motion="true"] .pub *::after { animation: none !important; transition: none !important; }

/* D41 edges: sharp chrome instead of pills (docs/decisions.md D41). */
html .pub-pill, html .pub-button, html .judge-drawer, html .judge-jump { border-radius: var(--edge); }
/* The marketing shell (MKT 3.1; MKT-R15.1, R15.2). Colours and fonts come from tokens.css and fonts.css only.
   Spacing and sizes go through the --mkt-* properties below, declared once. Controls are at least 44x44 px, text at least 12 px.
   Every animation has a reduced-motion override. */
.mkt, .mkt-foot, .mkt-preview {
  --mkt-space-1: 4px;
  --mkt-space-2: 8px;
  --mkt-space-3: 12px;
  --mkt-space-4: 16px;
  --mkt-space-6: 24px;
  --mkt-space-8: 32px;
  --mkt-space-12: 48px;
  --mkt-h1: 2.25rem;
  --mkt-h2: 2.125rem;
  --mkt-label-col: 12rem;
  --mkt-step-img: 15.5rem;
  --mkt-shelf-col: 1120px;
  --mkt-target: 44px;
  --mkt-rail-cue:
    linear-gradient(to right, var(--soot) 30%, transparent) left center / 36px 100% no-repeat local,
    linear-gradient(to left, var(--soot) 30%, transparent) right center / 36px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.7), transparent) left center / 16px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(150, 140, 125, 0.28), transparent) right center / 16px 100% no-repeat scroll;
  --mkt-hero-pad: 40px;
  --mkt-vignette: radial-gradient(ellipse at center, transparent 56%, var(--soot) 100%);
  --mkt-hero-sink: linear-gradient(to bottom, transparent 64%, var(--soot) 100%);
  --mkt-door-eyes:
    radial-gradient(circle 48% at 50% 42%, var(--ink-line) 0%, transparent 72%),
    radial-gradient(circle 4px at 46% 38%, var(--bone) 0%, var(--blood) 55%, transparent 100%),
    radial-gradient(circle 4px at 54% 38%, var(--bone) 0%, var(--blood) 55%, transparent 100%);
  --mkt-soot-fade: linear-gradient(to bottom, transparent 42%, var(--soot-2) 100%);
  --mkt-mask-ink: #000; /* mask alpha only: the opaque stop of the preview plate's lamp-reveal (MKT-R5.2) */
  --mkt-measure: 58ch;
  --mkt-measure-wide: 64ch;
  --mkt-page: 1180px;
  --mkt-radius: 2px; /* D41: sharp edges, no pill chrome */
  --mkt-chip: 8px; /* D41 A: the chipped corner of a call to action */
  --mkt-stamp: 0.8125rem; /* D41 B: folio stamp text, 13 px */
  --mkt-sigil: 28px;
  --mkt-relief-h: 6px;
  --mkt-text: 1rem;
  --mkt-small: 0.9375rem;
  --mkt-brand-size: 1.5rem;
  --mkt-form: 480px;
  --mkt-lede: 1.1875rem;
}

.mkt { position: relative; background: var(--soot); color: var(--bone); min-height: 100vh; display: flex; flex-direction: column; font-family: "Gentium Plus", Georgia, serif; font-size: var(--mkt-text); line-height: 1.5; }
.mkt::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 40; background: var(--mkt-vignette); opacity: 0.65; }
.mkt *, .mkt *::before, .mkt *::after { box-sizing: border-box; }
.mkt a { color: var(--lamp-hot); }
.mkt a:focus-visible, .mkt button:focus-visible, .mkt input:focus-visible { outline: 2px solid var(--lamp-hot); outline-offset: 2px; }

.mkt-skip { position: absolute; left: var(--mkt-space-2); top: 0; z-index: 10; min-height: var(--mkt-target); display: inline-flex; align-items: center; padding: 0 var(--mkt-space-4); background: var(--lamp); color: var(--soot) !important; border-radius: var(--mkt-radius); transform: translateY(-120%); }
.mkt-skip:focus { transform: none; }

.mkt-head { position: relative; z-index: 50; border-bottom: 1px solid var(--ink-line); background: var(--soot); }
.mkt-head-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--mkt-space-2) var(--mkt-space-4); padding: var(--mkt-space-3) var(--mkt-space-4); max-width: var(--mkt-page); width: 100%; margin: 0 auto; }
/* Inside the marketing shell the page column is .mkt-main's; a second, narrower centred column would shift the h1 off the brand's edge. */
.mkt-main .pub-main { max-width: none; margin: 0; }
.mkt-brand { font-family: "Cormorant Garamond", Georgia, serif; font-size: var(--mkt-brand-size); letter-spacing: 0.18em; text-transform: uppercase; color: var(--bone) !important; text-decoration: none; min-height: var(--mkt-target); display: inline-flex; align-items: center; }
.mkt-nav { display: flex; flex-wrap: wrap; gap: var(--mkt-space-1) var(--mkt-space-3); order: 3; width: 100%; }
.mkt-link { min-height: var(--mkt-target); min-width: var(--mkt-target); display: inline-flex; align-items: center; justify-content: center; padding: 0 var(--mkt-space-1); border: 0; border-bottom: 1px solid transparent; border-radius: 0; color: var(--bone-dim) !important; font-family: "Cormorant Garamond", Georgia, serif; font-size: var(--mkt-small); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; transition: color 160ms ease, border-color 160ms ease; }
@media (min-width: 900px) { .mkt-link { letter-spacing: 0.14em; padding: 0 var(--mkt-space-2); } }
.mkt-link:hover { color: var(--bone) !important; border-bottom-color: var(--ink-line); }
.mkt-link[aria-current="page"] { background: transparent; color: var(--bone) !important; border-bottom-color: var(--blood-text); }
.mkt-link.is-soon { border: 0; min-height: 0; min-width: 0; padding: 0 var(--mkt-space-1); color: var(--bone-dim) !important; }
.mkt-soon { font-size: var(--mkt-small); margin-left: var(--mkt-space-1); }
.mkt-button {
  min-height: var(--mkt-target);
  min-width: var(--mkt-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--mkt-space-6);
  border-radius: var(--mkt-radius);
  border: 1px solid var(--blood);
  background: var(--blood);
  color: var(--bone) !important;
  font: inherit;
  font-size: var(--mkt-text);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
}
@media (min-width: 900px) { .mkt-nav { order: 0; width: auto; flex: 1; justify-content: center; } }

.mkt-main { flex: 1; width: 100%; max-width: var(--mkt-page); margin: 0 auto; padding: var(--mkt-space-4) var(--mkt-space-4) var(--mkt-space-12); }

.mkt-foot { position: relative; z-index: 45; border-top: 1px solid var(--ink-line); padding: var(--mkt-space-8) var(--mkt-space-4); display: grid; grid-template-columns: 100%; gap: var(--mkt-space-4); max-width: var(--mkt-page); width: 100%; margin: 0 auto; font-family: "Gentium Plus", Georgia, serif; color: var(--bone); line-height: 1.5; }
@media (min-width: 900px) {
  .mkt-foot { grid-template-columns: 1fr 1fr; align-items: start; gap: var(--mkt-space-3) var(--mkt-space-8); }
  .mkt-foot::before { grid-column: 1 / -1; }
  .mkt-foot .pub-form { grid-row: span 3; }
}
.mkt-foot *, .mkt-foot *::before, .mkt-foot *::after { box-sizing: border-box; }
.mkt-foot a { color: var(--lamp-hot); }
.mkt-foot .mkt-link { color: var(--bone) !important; }
.mkt-foot a:focus-visible, .mkt-foot button:focus-visible, .mkt-foot input:focus-visible { outline: 2px solid var(--lamp-hot); outline-offset: 2px; }
.mkt-foot-links { display: flex; flex-wrap: wrap; gap: var(--mkt-space-2); margin: 0; }
.mkt-muted { color: var(--bone-dim); font-size: var(--mkt-small); margin: 0; max-width: var(--mkt-measure); }
.mkt-foot .pub-form { max-width: var(--mkt-form); }
.mkt-foot .pub-form-title { font-size: var(--mkt-lede); margin: 0 0 var(--mkt-space-1); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .mkt *, .mkt *::before, .mkt *::after, .mkt-foot * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* The lamp-lit hero (MKT 4.2 to 4.5; MKT-R2.1 to R2.6). The Calm hero is the base: a static plate lit at the token position (--lx, --ly
   from tokens.css, not redeclared here). The live loop only sets those two properties and --mkt-breath inline on #hero-stage.
   The viewport height is written in vh first; the dynamic unit replaces it only where the browser understands it (@supports), so an
   old browser keeps vh. (Keep a digit and the dynamic unit apart in comments: tests/e2e/no-dvh-360x640.spec.ts strips declarations
   only, and a bare mention in a comment made its observer rewrite the stylesheet forever.) */
.mkt-hero {
  --mkt-vh: 100vh;
  --mkt-head: 15.5rem;
  --mkt-hero-min: 16rem;
  --mkt-aperture: 9rem;
  --mkt-breath: 1;
  --mkt-hero-title: 1.875rem;
  --mkt-note: 0.8125rem;
  --mkt-hint-size: 1.125rem;
}
@supports (height: 100dvh) {
  .mkt-hero {
    --mkt-vh: 100vh;
    --mkt-vh: 100dvh;
  }
}
@media (min-width: 900px) {
  .mkt-hero {
    --mkt-aperture: 22rem;
    --mkt-head: 5.75rem;
    --mkt-hero-title: 4.75rem;
  }
}

.mkt-hero { position: relative; display: flex; flex-direction: column; gap: var(--mkt-space-3); height: calc(var(--mkt-vh) - var(--mkt-head)); min-height: var(--mkt-hero-min); }
.mkt-hero-plate { position: relative; flex: 1 1 0; min-height: 0; margin: 0; overflow: hidden; border-radius: var(--mkt-radius); background: var(--soot); border: 1px solid var(--ink-line); }
.mkt-hero-plate::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 4; background: var(--mkt-hero-sink); }
.mkt-hero-stage { position: absolute; inset: 0; overflow: hidden; touch-action: pan-y; cursor: crosshair; background: var(--soot); }
.mkt-hero-stage[data-live="true"] { touch-action: none; }
.mkt-hero-stage[data-live="false"] { cursor: default; }
.mkt-hero-stage:focus-visible { outline: 2px solid var(--lamp-hot); outline-offset: -2px; }
.mkt-hero-dark, .mkt-hero-lit { position: absolute; inset: 0; pointer-events: none; }
.mkt-hero-dark { opacity: 0.54; filter: contrast(1.12); }
.mkt-hero-lit {
  filter: contrast(1.16) brightness(calc(1.15 * var(--mkt-breath))) saturate(0.92);
  -webkit-mask-image: radial-gradient(circle var(--mkt-aperture) at var(--lx) var(--ly), var(--soot) 0, var(--soot) 58%, transparent 100%);
  mask-image: radial-gradient(circle var(--mkt-aperture) at var(--lx) var(--ly), var(--soot) 0, var(--soot) 58%, transparent 100%);
}
.mkt-hero-stage picture { position: absolute; inset: 0; display: block; }
.mkt-hero-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; user-select: none; -webkit-user-drag: none; }
/* The creature is the lair scene's own cutout, drawn only inside the lit (masked) layer and dimmed as the reader dims it (R4 N1). */
.mkt-hero-creature img { filter: brightness(0.55) saturate(0.72) contrast(1.15); }

.mkt-hero-label { position: absolute; left: var(--mkt-space-2); bottom: var(--mkt-space-2); margin: 0; padding: var(--mkt-space-1) var(--mkt-space-2); border-radius: var(--mkt-radius); background: var(--soot); color: var(--bone); font-size: var(--mkt-small); line-height: 1.3; pointer-events: none; }
.mkt-hero-hint { position: absolute; left: 0; right: 0; top: var(--mkt-space-8); z-index: 6; margin: 0; text-align: center; color: var(--lamp-hot); font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: var(--mkt-hint-size); letter-spacing: 0.06em; pointer-events: none; }
.mkt-hero-hint[hidden] { display: none; }
.mkt-hero-tools { position: absolute; top: var(--mkt-space-3); left: var(--mkt-space-3); right: var(--mkt-space-3); z-index: 8; display: flex; justify-content: space-between; gap: var(--mkt-space-2); pointer-events: none; }
.mkt-hero-tools > * { pointer-events: auto; opacity: 0.82; }
.mkt-hero-tools > *:hover { opacity: 1; }
.mkt-hero-tools > :only-child { margin-left: auto; }

.mkt-ghost { min-height: var(--mkt-target); min-width: var(--mkt-target); display: inline-flex; align-items: center; justify-content: center; padding: 0 var(--mkt-space-4); border-radius: var(--mkt-radius); border: 1px solid var(--ink-line); background: var(--soot-2); color: var(--bone); font: inherit; font-size: var(--mkt-small); cursor: pointer; transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease; }
.mkt-ghost:hover { border-color: var(--blood-text); color: var(--bone); }
.mkt-ghost[aria-pressed="true"] { background: var(--blood); color: var(--bone); border-color: var(--blood); }
.mkt-ghost:disabled { cursor: default; color: var(--bone-dim); opacity: 0.55; }
.mkt-ghost[aria-pressed="true"]:disabled { color: var(--bone); }

.mkt-hero-copy { display: flex; flex-direction: column; gap: var(--mkt-space-2); }
.mkt-hero-copy h1 { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: var(--mkt-hero-title); line-height: 0.96; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bone); }
.mkt-hero-sentence { margin: 0; font-size: var(--mkt-text); font-style: italic; color: var(--bone); max-width: var(--mkt-measure); }
@media (min-width: 900px) { .mkt-hero-sentence { font-size: var(--mkt-lede); } }
.mkt-hero-actions { display: flex; flex-wrap: wrap; gap: var(--mkt-space-3); margin-top: var(--mkt-space-1); }
.mkt-hero-notes, .mkt-hero-calmwhy { margin: 0; color: var(--bone-dim); font-size: var(--mkt-note); line-height: 1.35; max-width: var(--mkt-measure); }

@media (min-width: 900px) {
  .mkt-hero-copy {
    position: absolute;
    left: var(--mkt-hero-pad);
    right: var(--mkt-hero-pad);
    bottom: var(--mkt-hero-pad);
    z-index: 8;
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    align-items: end;
    gap: var(--mkt-space-2) var(--mkt-space-8);
    pointer-events: none;
  }
  .mkt-hero-copy > * { pointer-events: auto; }
  .mkt-hero-copy h1 { grid-column: 1; grid-row: 1; }
  .mkt-hero-sentence { grid-column: 1; grid-row: 2; }
  .mkt-hero-actions { grid-column: 2; grid-row: 1 / span 2; justify-content: flex-end; align-self: end; margin-top: 0; }
  .mkt-hero-notes { grid-column: 1 / -1; grid-row: 3; margin-top: var(--mkt-space-2); }
  .mkt-hero-calmwhy { grid-column: 1 / -1; grid-row: 4; }
}

@media (prefers-reduced-motion: reduce) {
  .mkt-hero-hint { display: none; }
  .mkt-hero-lit { filter: none; }
}

/* MKT 7.7 (MKT-R13.5): a device that asks to save data gets the still hero and no lamp-reveal or hint motion (the script half is calmReason). */
@media (prefers-reduced-data: reduce) {
  .mkt-hero-hint { display: none; }
  .mkt-hero-lit { filter: none; }
  .mkt *, .mkt *::before, .mkt *::after { animation: none !important; transition: none !important; }
  .mkt-preview-plate picture { -webkit-mask-image: none; mask-image: none; }
}

/* Home without a header bar (owner ruling 27 Nov 2026, docs/spec-issues.md "Home without a header bar"; NightHead.tsx,
   tests/e2e/home-night-head.spec.ts). The storyteller's call and one sentence sit over the top of the hero plate, the eyes in its top
   right corner. Order of arrival: the words (from --mkt-night-say-at), then the eyes. Every reveal
   starts from its final state, so Reduced Motion (the rule near the top of this file removes all animation) shows everything at once.
   The eyes blink only while the hero is live (Calm, Gentle and Reduced Motion keep #hero-stage at data-live="false"). */
.mkt[data-head="own"] {
  --mkt-night-pad: var(--mkt-space-3);
  --mkt-half: 50%;
  --mkt-night-round: 50%;
  --mkt-night-rule: 1px;
  --mkt-night-eyes-w: 4.5rem;
  --mkt-night-eyes-h: 3rem;
  --mkt-night-eye-w: 0.5rem;
  --mkt-night-eye-h: 0.25rem;
  --mkt-night-eye-top: calc(50% - 0.125rem);
  --mkt-night-eye-gap: 0.875rem;
  --mkt-night-call: 0.8125rem;
  --mkt-night-say: 1.0625rem;
  --mkt-night-say-w: 34rem;
  --mkt-night-sheet-link: 1.875rem;
  --mkt-night-sheet-row: 3.25rem;
  --mkt-night-sheet-top: 6rem;
  --mkt-night-say-at: 1.1s;
  --mkt-night-eyes-at: 0.2s;
  --mkt-night-cue-at: 1.4s;
  --mkt-night-wait-1: 20s;
  --mkt-night-wait-2: 34s;
  --mkt-night-icon: 1rem;
  --mkt-w1-x: 22%;
  --mkt-w1-y: 30vh;
  --mkt-w2-x: 58%;
  --mkt-w2-y: 38vh;
  --mkt-night-sink: linear-gradient(to bottom, rgba(3, 3, 4, 0.86), rgba(3, 3, 4, 0.4) 42%, transparent 62%);
  --mkt-night-ink: 0 1px 8px rgba(3, 3, 4, 0.95);
  --mkt-night-flame: 0 0 18px rgba(226, 154, 79, 0.45);
  --mkt-night-ember: 0 0 22px rgba(166, 30, 23, 0.9);
  --mkt-eye-core: radial-gradient(circle, var(--lamp-hot), var(--blood-text));
  --mkt-eye-glow: 0 0 5px 2px rgba(224, 88, 76, 0.85), 0 0 20px 7px rgba(166, 30, 23, 0.5);
  --mkt-night-sheet-bg: radial-gradient(circle at calc(100% - 4rem) 3rem, rgba(90, 14, 10, 0.35), rgba(3, 3, 4, 0.95) 30%, rgba(3, 3, 4, 0.985));
}
.mkt-sr { position: absolute; width: var(--mkt-night-rule); height: var(--mkt-night-rule); margin: 0; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.mkt[data-head="own"] .mkt-main { position: relative; }
.mkt[data-head="own"] .mkt-hero { --mkt-head: var(--mkt-space-8); }
.mkt[data-head="own"] .mkt-hero-plate::before { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; background: var(--mkt-night-sink); }
.mkt[data-head="own"] .mkt-hero-tools { top: auto; bottom: var(--mkt-space-2); flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 0 var(--mkt-space-3); }
.mkt[data-head="own"] .mkt-hero-tools > * { opacity: 1; }
.mkt[data-head="own"] .mkt-hero-tools > :last-child:not(:only-child) { margin-left: auto; }
/* One quiet row: words with a thin rule under them, not boxes. A pressed switch gets a heavier rule (never colour alone). */
.mkt[data-head="own"] .mkt-hero-tools .mkt-ghost { padding: 0 var(--mkt-space-2); border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: transparent; color: var(--ash); text-shadow: var(--mkt-night-ink); }
.mkt[data-head="own"] .mkt-hero-tools .mkt-ghost:hover { color: var(--bone); border-bottom-color: var(--blood-text); }
.mkt[data-head="own"] .mkt-hero-tools .mkt-ghost[aria-pressed="true"] { background: transparent; color: var(--bone); border-bottom: 2px solid var(--blood-text); }
.mkt[data-head="own"] .mkt-hero-tools .mkt-ghost:disabled { color: var(--ash); opacity: 1; }
.mkt-flame {
  --mkt-flame-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='20 4 24 30'%3E%3Cpath d='M32 6c5 8 8 12 8 18a8 8 0 0 1-16 0c0-4 2-6 4-9 0 3 1 4 3 4-1-5-1-9 1-13z'/%3E%3C/svg%3E");
  display: inline-block; width: var(--mkt-night-icon); height: var(--mkt-night-icon); margin-right: var(--mkt-space-2); background: var(--lamp-hot); flex: none;
  -webkit-mask: var(--mkt-flame-shape) center / contain no-repeat; mask: var(--mkt-flame-shape) center / contain no-repeat;
}
.mkt[data-head="own"] .mkt-hero-hint { top: auto; bottom: calc(var(--mkt-target) + var(--mkt-target) + var(--mkt-space-6)); }

.mkt-night { position: absolute; top: 0; left: 0; right: 0; z-index: 50; pointer-events: none; }
.mkt-night-inner { position: relative; width: 100%; max-width: var(--mkt-page); margin: 0 auto; padding: calc(var(--mkt-space-4) + var(--mkt-night-pad)) calc(var(--mkt-space-4) + var(--mkt-night-pad)) 0; }
.mkt-night-say { margin: 0 calc(var(--mkt-night-eyes-w) + var(--mkt-space-2)) 0 0; color: var(--bone); font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: var(--mkt-night-say); line-height: 1.7; text-shadow: var(--mkt-night-ink); }
.mkt-night-call { display: block; margin: 0 0 var(--mkt-space-1); font-style: normal; font-size: var(--mkt-night-call); line-height: 1.6; letter-spacing: 0.16em; white-space: nowrap; text-transform: uppercase; color: var(--lamp-hot); text-shadow: var(--mkt-night-flame); animation: mkt-night-in 1400ms ease backwards; animation-delay: var(--mkt-night-say-at); }
@keyframes mkt-night-in { from { opacity: 0; } }

.mkt-eyes { position: absolute; top: calc(var(--mkt-space-4) + var(--mkt-space-2)); right: calc(var(--mkt-space-4) + var(--mkt-space-2)); pointer-events: auto; }
.mkt-eyes-summary { position: relative; z-index: 2; display: block; width: var(--mkt-night-eyes-w); height: var(--mkt-night-eyes-h); list-style: none; cursor: pointer; animation: mkt-night-in 1200ms ease backwards; animation-delay: var(--mkt-night-eyes-at); }
.mkt-eyes-summary::-webkit-details-marker { display: none; }
.mkt-eyes-summary:focus-visible { outline: 2px solid var(--lamp-hot); outline-offset: 2px; animation: none; }
.mkt-eyes-pair { position: absolute; inset: 0; transition: transform 500ms ease-out; }
.mkt-eye { position: absolute; top: var(--mkt-night-eye-top); width: var(--mkt-night-eye-w); height: var(--mkt-night-eye-h); border-radius: var(--mkt-night-round); background: var(--mkt-eye-core); box-shadow: var(--mkt-eye-glow); }
.mkt-eye:first-child { left: calc(var(--mkt-half) - var(--mkt-night-eye-gap)); }
.mkt-eye:last-child { left: calc(var(--mkt-half) + var(--mkt-night-eye-gap) - var(--mkt-night-eye-w)); }
.mkt[data-head="own"]:has(#hero-stage[data-live="true"]) .mkt-eye { animation: mkt-night-blink 7300ms infinite; }
@keyframes mkt-night-blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.08); } }
/* The cue under the eyes (owner, 28 Nov 2026, review O-2): "Pages" while shut, "Close" while open, so a judge knows the eyes are a menu. */
.mkt-eyes-cue { position: absolute; top: var(--mkt-night-eyes-h); right: 0; font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: var(--mkt-night-call); letter-spacing: 0.1em; color: var(--ash); text-shadow: var(--mkt-night-ink); pointer-events: none; }
.mkt-eyes-cue { animation: mkt-cue-in 1ms linear var(--mkt-night-cue-at) backwards; }
@keyframes mkt-cue-in { from { visibility: hidden; } } /* hidden until the eyes have finished opening: never read mid-fade */
.mkt-eyes[open] .mkt-eyes-cue { font-size: 0; }
.mkt-eyes[open] .mkt-eyes-cue::after { content: "Close"; font-size: var(--mkt-night-call); }
.mkt-eyes-summary:hover .mkt-eyes-cue, .mkt-eyes-summary:focus-visible .mkt-eyes-cue { color: var(--bone); }

.mkt-eyes-sheet { position: fixed; inset: 0; z-index: 1; overflow-y: auto; padding: var(--mkt-night-sheet-top) calc(var(--mkt-space-8) + var(--mkt-space-2)) var(--mkt-space-8) var(--mkt-space-4); background: var(--mkt-night-sheet-bg); animation: mkt-night-in 600ms ease; }
.mkt-eyes-sheet ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: flex-end; }
.mkt-eyes-sheet li { animation: mkt-night-whisper 900ms ease backwards; }
.mkt-eyes-sheet li:nth-child(1) { animation-delay: 200ms; }
.mkt-eyes-sheet li:nth-child(2) { animation-delay: 550ms; margin-right: var(--mkt-space-12); }
.mkt-eyes-sheet li:nth-child(3) { animation-delay: 900ms; margin-right: var(--mkt-space-4); }
.mkt-eyes-sheet li:nth-child(4) { animation-delay: 1250ms; margin-right: calc(var(--mkt-space-12) + var(--mkt-space-8)); }
.mkt-eyes-sheet li:nth-child(5) { animation-delay: 1600ms; margin-right: var(--mkt-space-8); }
@keyframes mkt-night-whisper { from { opacity: 0; filter: blur(6px); transform: translateY(-6px); } }
.mkt-eyes-sheet a { display: inline-flex; align-items: center; min-height: var(--mkt-night-sheet-row); font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: var(--mkt-night-sheet-link); letter-spacing: 0.04em; color: var(--ash) !important; text-decoration: none; transition: color 300ms ease, text-shadow 300ms ease; }
.mkt-eyes-sheet a:hover, .mkt-eyes-sheet a:focus-visible { color: var(--blood-text) !important; text-shadow: var(--mkt-night-ember); }

/* The eyes shut while the lamp is on them (night-watch.ts toggles is-shut; they stay where they are, they are the menu). */
.mkt-eyes-summary { transition: filter 300ms ease; }
.mkt-eyes.is-shut .mkt-eyes-summary { filter: opacity(0.25); }

/* Two more pairs wait in the dark. Armed by CSS alone, only while the hero is live: after a while with no input the second pair opens,
   then the third. night-watch.ts takes is-wait off at any movement (they shut) and puts it back 1.5 s after the last one, which
   restarts the wait. A pair the lamp comes near shuts (is-shut) and opens elsewhere. They are decorative and never take a tap. */
.mkt-watchers { position: absolute; inset: 0; pointer-events: none; }
.mkt-watch {
  --mkt-wx: var(--mkt-w1-x);
  --mkt-wy: var(--mkt-w1-y);
  position: absolute; left: var(--mkt-wx); top: var(--mkt-wy); width: var(--mkt-night-eyes-w); height: var(--mkt-night-eyes-h); opacity: 0; pointer-events: none; transition: filter 300ms ease, transform 300ms ease;
}
.mkt-watch[data-w="2"] { --mkt-wx: var(--mkt-w2-x); --mkt-wy: var(--mkt-w2-y); }
.mkt-watch.is-shut { filter: opacity(0); transform: scaleY(0.1); }
.mkt[data-head="own"]:has(#hero-stage[data-live="true"]) .mkt-watchers.is-wait .mkt-watch { animation: mkt-night-watch 1600ms ease forwards; animation-delay: var(--mkt-night-wait-1); }
.mkt[data-head="own"]:has(#hero-stage[data-live="true"]) .mkt-watchers.is-wait .mkt-watch[data-w="2"] { animation-delay: var(--mkt-night-wait-2); }
@keyframes mkt-night-watch { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 900px) {
  .mkt[data-head="own"] { --mkt-night-pad: var(--mkt-hero-pad); --mkt-night-say: 1.375rem; --mkt-night-sheet-link: 2.375rem; }
  .mkt-night-say { margin: 0; max-width: var(--mkt-night-say-w); }
  .mkt-night-call { font-size: var(--mkt-small); letter-spacing: 0.3em; }
  .mkt[data-head="own"] .mkt-hero-tools { left: auto; justify-content: flex-end; }
  .mkt[data-head="own"] .mkt-hero-tools > :last-child:not(:only-child) { margin-left: 0; }
  .mkt[data-head="own"] .mkt-hero-copy { bottom: calc(var(--mkt-hero-pad) + var(--mkt-target)); }
  .mkt[data-head="own"] .mkt-hero-hint { top: var(--mkt-space-8); bottom: auto; }
  .mkt-eyes-sheet { padding: var(--mkt-night-sheet-top) calc(var(--mkt-space-12) + var(--mkt-space-6)) var(--mkt-space-8) var(--mkt-space-4); }
}

/* The trailer (MKT 5.4; MKT-R3.5, R3.6, R17.2). A poster first; the stage is drawn by TrailerStage only after a press. The live cut lights
   each plate through a lamp circle (--mkt-tr-x, --mkt-tr-y, --mkt-tr-open set by the script); the Calm cut shows the plate whole and cross-fades. The one
   brightness spike (data-peak, 250 ms, once) never runs in the Calm cut, and the reduced-motion rule below removes it as well. */
.mkt-trailer {
  --mkt-trailer-title: 1.75rem;
  --mkt-trailer-end: 2rem;
}
.mkt-trailer { display: flex; flex-direction: column; gap: var(--mkt-space-3); max-width: var(--mkt-page); width: 100%; margin: 0 auto; padding: var(--mkt-space-6) var(--mkt-space-4); }
.mkt-trailer h2 { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: var(--mkt-trailer-title); font-weight: 600; }
.mkt-trailer-frame { position: relative; margin: 0; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--mkt-radius); background: var(--soot); border: 1px solid var(--ink-line); }
.mkt-trailer-poster, .mkt-trailer-poster img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.mkt-trailer-poster img { filter: brightness(0.45); }
.mkt-trailer-stage {
  --mkt-tr-open: 0;
  --mkt-tr-fade: 1;
  --mkt-tr-x: 50%;
  --mkt-tr-y: 45%;
  --mkt-tr-aperture: 9rem;
}
.mkt-trailer-stage { position: absolute; inset: 0; overflow: hidden; background: var(--soot); }
@media (min-width: 900px) {
  .mkt-trailer-stage {
    --mkt-tr-aperture: 15rem;
  }
}
.mkt-trailer-lit { position: absolute; inset: 0; opacity: var(--mkt-tr-fade);
  -webkit-mask-image: radial-gradient(circle calc(var(--mkt-tr-open) * var(--mkt-tr-aperture)) at var(--mkt-tr-x) var(--mkt-tr-y), var(--soot) 0, var(--soot) 55%, transparent 100%);
  mask-image: radial-gradient(circle calc(var(--mkt-tr-open) * var(--mkt-tr-aperture)) at var(--mkt-tr-x) var(--mkt-tr-y), var(--soot) 0, var(--soot) 55%, transparent 100%); }
.mkt-trailer-stage[data-calm="true"] .mkt-trailer-lit { -webkit-mask-image: none; mask-image: none; }
.mkt-trailer-lit picture, .mkt-trailer-capture { position: absolute; inset: 0; display: block; }
.mkt-trailer-lit img, .mkt-trailer-capture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; user-select: none; -webkit-user-drag: none; }
.mkt-trailer-capture { opacity: var(--mkt-tr-fade); background: var(--soot); }
.mkt-trailer-capture img { object-fit: contain; }
.mkt-trailer-creature img { filter: brightness(0.5) saturate(0.7); }
.mkt-trailer-frame[data-peak="true"] .mkt-trailer-stage { filter: brightness(1.6); }
.mkt-trailer-levels { position: absolute; left: var(--mkt-space-3); top: var(--mkt-space-3); margin: 0; padding: var(--mkt-space-2) var(--mkt-space-3); list-style: none; background: var(--soot); border-radius: var(--mkt-radius); color: var(--bone-dim); font-size: var(--mkt-small); }
.mkt-trailer-levels li[data-on="true"] { color: var(--bone); font-weight: 700; text-decoration: underline; }
.mkt-trailer-levels li[data-on="true"]::before { content: "\203A  "; }
.mkt-trailer-endcard { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--mkt-space-2); padding: var(--mkt-space-4); text-align: center; background: var(--soot); }
.mkt-trailer-endcard p { margin: 0; }
.mkt-trailer-endname { font-family: "Cormorant Garamond", Georgia, serif; font-size: var(--mkt-trailer-end); font-weight: 600; }
.mkt-trailer-endlabels { color: var(--bone-dim); font-size: var(--mkt-small); }
.mkt-trailer-caption { position: absolute; left: var(--mkt-space-3); right: var(--mkt-space-3); bottom: var(--mkt-space-8); margin: 0; padding: var(--mkt-space-1) var(--mkt-space-3); border-radius: var(--mkt-radius); background: var(--soot); color: var(--bone); text-align: center; font-size: var(--mkt-small); line-height: 1.35; }
.mkt-trailer-caption[data-visual="false"] { position: absolute; width: 0; height: 0; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; background: transparent; }
.mkt-trailer-label, .mkt-trailer-source { position: absolute; left: var(--mkt-space-2); bottom: var(--mkt-space-2); margin: 0; padding: var(--mkt-space-1) var(--mkt-space-2); border-radius: var(--mkt-radius); background: var(--soot); color: var(--bone); font-size: var(--mkt-small); line-height: 1.3; pointer-events: none; }
.mkt-trailer-failed { margin: 0; color: var(--bone); font-size: var(--mkt-small); line-height: 1.35; max-width: var(--mkt-measure); }
.mkt-trailer-actions { display: flex; flex-wrap: wrap; gap: var(--mkt-space-2); }
.mkt-trailer-notes, .mkt-trailer-calmwhy, .mkt-trailer-voice { margin: 0; color: var(--bone-dim); font-size: var(--mkt-small); line-height: 1.35; max-width: var(--mkt-measure); }
.mkt-trailer-transcript summary { min-height: var(--mkt-target); min-width: var(--mkt-target); display: flex; align-items: center; cursor: pointer; }
.mkt-trailer-transcript ol { margin: 0; padding-left: var(--mkt-space-6); }
.mkt-trailer-time { color: var(--bone-dim); font-variant-numeric: tabular-nums; margin-right: var(--mkt-space-2); }
@media (prefers-reduced-motion: reduce) {
  .mkt-trailer-frame[data-peak="true"] .mkt-trailer-stage { filter: none; }
}

/* Home sections, tale preview, /tales list, how it's made and FAQ (MKT 6.1 to 6.6). One column at 360; steps, /tales cards and tiers are a two-column grid from 900, and the home tale rail stays a scrolling row. Images never exceed their box.
   The preview classes are also used on the tale page, outside .mkt, so they carry their own colours. */
.mkt-section { display: flex; flex-direction: column; gap: var(--mkt-space-4); padding: var(--mkt-space-8) 0; border-top: 1px solid var(--ink-line); }
.mkt-section h1, .mkt-section h2, .mkt-article h1, .mkt-article h2 { font-family: "Cormorant Garamond", Georgia, serif; margin: 0; font-weight: 600; letter-spacing: 0.04em; }
.mkt-section h2, .mkt-article h2 { font-size: var(--mkt-h2); }
.mkt-section h1, .mkt-article h1 { font-size: var(--mkt-h1); }
.mkt-section p, .mkt-article p { margin: 0; max-width: var(--mkt-measure); }
.mkt-sub { font-size: var(--mkt-lede); margin: var(--mkt-space-4) 0 0; }
.mkt-steps, .mkt-cards, .mkt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--mkt-space-4); grid-template-columns: 100%; }
.mkt-step, .mkt-card { display: flex; flex-direction: column; gap: var(--mkt-space-2); min-width: 0; }
.mkt-card { padding: var(--mkt-space-4); border: 1px solid var(--ink-line); border-radius: var(--mkt-radius); background: var(--soot-2); }
.mkt-card h3, .mkt-step h3 { margin: 0; font-size: var(--mkt-lede); }
.mkt-card a { color: var(--lamp-hot); }
.mkt-card h3 a { display: inline-flex; align-items: center; min-height: var(--mkt-target); }
.mkt-step-n { color: var(--lamp-hot); }
.mkt-step-media, .mkt-preview-plate { margin: 0; display: flex; flex-direction: column; gap: var(--mkt-space-1); }
.mkt-step-media picture, .mkt-preview-plate picture { display: block; overflow: hidden; border-radius: var(--mkt-radius); background: var(--soot); }
.mkt-step-media img, .mkt-preview-plate img { display: block; width: 100%; max-width: 100%; height: auto; }
/* MKT-R13.6: every plate is a 1376x768 canvas (lessons PL-2), so the box is reserved before the image arrives and nothing below it moves. */
.mkt-step-media picture, .mkt-preview-plate picture { aspect-ratio: 1376 / 768; }
.mkt-step-media figcaption, .mkt-preview-plate figcaption { color: var(--bone-dim); font-size: var(--mkt-small); }
/* MKT-R5.2: a short lamp-reveal on the preview plate (review S-10). A lamp-shaped mask opens once from the lamp's place and stays
   open; no flash, no loop, no sound. Reduced Motion (system or in-app) shows the static, fully lit plate. */
@property --mkt-reveal { syntax: "<percentage>"; inherits: false; initial-value: 160%; }
@keyframes mkt-lamp-reveal { from { --mkt-reveal: 12%; } to { --mkt-reveal: 160%; } }
.mkt-preview-plate picture {
  --mkt-reveal: 160%; /* the static, fully lit state; the animation overrides it while it runs */
  -webkit-mask-image: radial-gradient(circle at 52% 44%, var(--mkt-mask-ink) calc(var(--mkt-reveal) - 10%), transparent var(--mkt-reveal));
  mask-image: radial-gradient(circle at 52% 44%, var(--mkt-mask-ink) calc(var(--mkt-reveal) - 10%), transparent var(--mkt-reveal));
  animation: mkt-lamp-reveal 1.8s ease-out 0.2s 1 both;
}
@media (prefers-reduced-motion: reduce) {
  .mkt-preview-plate picture { animation: none; -webkit-mask-image: none; mask-image: none; }
}
html[data-reduced-motion="true"] .mkt-preview-plate picture,
html[data-fright="gentle"] .mkt-preview-plate picture { animation: none; -webkit-mask-image: none; mask-image: none; } /* N-f: Gentle too */
.mkt-label { color: var(--bone-dim); font-size: var(--mkt-small); }
.mkt-badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--mkt-space-2); }
.mkt-badge { display: inline-block; padding: var(--mkt-space-1) var(--mkt-space-3); border: 1px solid var(--ochre); border-radius: var(--mkt-radius); font-size: var(--mkt-small); color: var(--bone); }
.mkt-list li { min-height: var(--mkt-target); display: flex; flex-wrap: wrap; align-items: center; gap: var(--mkt-space-2); }
.mkt-list a { min-height: var(--mkt-target); display: inline-flex; align-items: center; }
.mkt-preview { display: flex; flex-direction: column; gap: var(--mkt-space-3); margin: var(--mkt-space-4) 0; max-width: 100%; color: var(--bone); font-family: "Gentium Plus", Georgia, serif; }
.mkt-preview p { margin: 0; max-width: var(--mkt-measure); }
.mkt-preview .mkt-muted { color: var(--bone-dim); font-size: var(--mkt-small); }
.mkt-preview-beat { display: flex; flex-direction: column; gap: var(--mkt-space-1); padding: var(--mkt-space-3) var(--mkt-space-4); border-left: 3px solid var(--lamp); }
.mkt-preview-ha { font-size: var(--mkt-lede); line-height: 1.5; }
.mkt-preview-en { line-height: 1.5; }
.mkt-coming { display: flex; flex-wrap: wrap; align-items: center; gap: var(--mkt-space-2); }
.mkt-coming a { min-height: var(--mkt-target); display: inline-flex; align-items: center; color: var(--lamp-hot); }
.mkt-article { display: flex; flex-direction: column; gap: var(--mkt-space-4); padding: var(--mkt-space-6) 0; }
.mkt-article section { display: flex; flex-direction: column; gap: var(--mkt-space-2); }
.mkt-article ol, .mkt-article ul { margin: 0; padding-left: var(--mkt-space-6); max-width: var(--mkt-measure); }
.mkt-faq details { border: 1px solid var(--ink-line); border-radius: var(--mkt-radius); padding: 0 var(--mkt-space-4); background: var(--soot-2); }
.mkt-faq summary { min-height: var(--mkt-target); display: flex; align-items: center; cursor: pointer; font-size: var(--mkt-lede); }
.mkt-faq details p { padding-bottom: var(--mkt-space-3); }
@media (min-width: 900px) {
  .mkt-steps, .mkt-cards { grid-template-columns: repeat(2, 1fr); }
}

/* Each home section is at most one phone screen tall (MKT-R2.7): on a narrow screen a list of steps, cards or tiers is a rail that scrolls
   inside its own box, so the page itself never scrolls sideways. From 900 px the same lists are a grid. */
.mkt-rail { display: flex; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; gap: var(--mkt-space-3); padding-bottom: var(--mkt-space-2); scrollbar-width: thin; scrollbar-color: var(--ink-line) transparent; }
.mkt-rail > li { flex: 0 0 82%; scroll-snap-align: start; }
.mkt-rail:focus-visible { outline: 2px solid var(--lamp-hot); outline-offset: 2px; }
/* Scroll cue (reviewer 27 Nov): a lamp-lit glow on the edge that still has more cards, covered by the soot at the end it is scrolled to. */
.mkt-rail { background: var(--mkt-rail-cue); }
@media (min-width: 900px) { .mkt-rail { background: none; } }
.mkt-rail .mkt-step-media { position: relative; }
.mkt-rail .mkt-step-media picture { width: 100%; height: var(--mkt-step-img); aspect-ratio: 1376 / 768; }
.mkt-rail .mkt-step-media img { width: 100%; height: 100%; max-height: var(--mkt-step-img); object-fit: cover; object-position: center top; }
.mkt-rail .mkt-step-media figcaption { position: absolute; left: var(--mkt-space-2); bottom: var(--mkt-space-2); padding: var(--mkt-space-1) var(--mkt-space-2); background: var(--soot); border: 1px solid var(--ink-line); border-radius: var(--mkt-radius); color: var(--bone); font-size: var(--mkt-stamp); line-height: 1.2; }
.mkt-table-wrap { overflow-x: auto; max-width: 100%; background: var(--mkt-rail-cue); } /* the same edge fade as the rails: it shows the table scrolls (review S-1) */
.mkt-table { border-collapse: collapse; width: 100%; font-size: var(--mkt-small); }
.mkt-table th, .mkt-table td { text-align: left; vertical-align: top; padding: var(--mkt-space-2) var(--mkt-space-3); border-bottom: 1px solid var(--ink-line); }
.mkt-table th[scope="row"] { font-weight: 600; min-width: var(--mkt-label-col); }
@media (min-width: 900px) {
  .mkt-rail > li { flex-basis: 31%; }
  .mkt-steps.mkt-rail > li { flex-basis: 24%; }
}

/* D41 A + B (docs/decisions.md): the Dagin Arewa sigil, eroded relief bands, chipped calls to action and the folio stamp.
   All static: nothing here moves, so there is nothing for Reduced Motion to stop. Colours are tokens only. */
.mkt-brand { gap: var(--mkt-space-2); }
.mkt-brand .arewa-sigil {
  display: inline-block;
  width: var(--mkt-sigil);
  height: var(--mkt-sigil);
  flex: none;
  background-color: var(--blood-text);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='black' stroke-width='2.4'%3E%3Cpath d='M24 4l6 8-6 8-6-8zM44 24l-8 6-8-6 8-6zM24 44l-6-8 6-8 6 8zM4 24l8-6 8 6-8 6zM24 14l10 10-10 10-10-10z'/%3E%3Cpath d='M12 12l24 24M36 12L12 36' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='black' stroke-width='2.4'%3E%3Cpath d='M24 4l6 8-6 8-6-8zM44 24l-8 6-8-6 8-6zM24 44l-6-8 6-8 6 8zM4 24l8-6 8 6-8 6zM24 14l10 10-10 10-10-10z'/%3E%3Cpath d='M12 12l24 24M36 12L12 36' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.mkt-head::after, .mkt-foot::before {
  content: "";
  display: block;
  height: var(--mkt-relief-h);
  border-top: 1px solid var(--ink-line);
  background-image:
    repeating-linear-gradient(45deg, var(--ink-line) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(-45deg, var(--blood) 0 1px, transparent 1px 11px);
  opacity: 0.8;
}
.mkt-head { border-bottom-color: transparent; }
.mkt-foot { border-top-color: transparent; }
.mkt-button {
  border-color: transparent;
  background-color: transparent;
  color: var(--bone) !important;
  background-image:
    linear-gradient(135deg, transparent var(--mkt-chip), var(--blood) 0),
    linear-gradient(-135deg, transparent var(--mkt-chip), var(--blood) 0),
    linear-gradient(45deg, transparent var(--mkt-chip), var(--blood) 0),
    linear-gradient(-45deg, transparent var(--mkt-chip), var(--blood) 0);
  background-position: top left, top right, bottom left, bottom right;
  background-size: 51% 51%;
  background-repeat: no-repeat;
  transition: filter 160ms ease, transform 140ms ease;
}
.mkt-button:hover { filter: brightness(1.16); }
.mkt-button:active { transform: translateY(1px); }
.mkt-button:focus-visible { outline: 2px solid var(--lamp-hot); outline-offset: 2px; }

/* Blood & Ash hybrid visuals (26 Nov 2026): visual-first haunted doorways with active unhovered ember pulse,
   compact hairline metadata, and deeper soot vignette while keeping D41 sigil, relief bands and folio stamps. */
.mkt-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--mkt-space-1) var(--mkt-space-4); }
.mkt-card > .mkt-ghost { margin-top: auto; align-self: flex-start; }
#closing .mkt-button { align-self: flex-start; }
.mkt-hero-plate { box-shadow: inset 0 0 0 1px var(--ink-line), inset 0 -48px 64px -24px var(--soot); }

.mkt-door-card { padding: 0; overflow: hidden; background: var(--soot-2); border-color: var(--ink-line); transition: border-color 220ms ease, transform 220ms ease; }
.mkt-door-card:hover { border-color: var(--blood-text); transform: translateY(-2px); }
.mkt-door-card.is-coming { padding: var(--mkt-space-4); border-style: dashed; }
.mkt-door-art { position: relative; margin: 0; aspect-ratio: 16 / 9; overflow: hidden; background: var(--soot); }
.mkt-door-art picture, .mkt-door-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 420ms ease, filter 320ms ease; filter: brightness(0.98) contrast(1.06); }
.mkt-door-card:hover .mkt-door-art img { transform: scale(1.04); filter: brightness(1.14) contrast(1.08); }
.mkt-door-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--mkt-soot-fade);
}
@keyframes mkt-door-ember {
  0%, 100% { opacity: 0.28; }
  50% { opacity: 0.78; }
}
.mkt-door-ember {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--mkt-door-eyes);
  animation: mkt-door-ember 4.2s ease-in-out infinite;
}
.mkt-door-body { display: flex; flex-direction: column; gap: var(--mkt-space-1); padding: var(--mkt-space-2) var(--mkt-space-3) var(--mkt-space-3); }
.mkt-door-body h3 { font-family: "Cormorant Garamond", Georgia, serif; font-size: var(--mkt-lede); line-height: 1.15; }
.mkt-door-credit { font-size: var(--mkt-stamp); }
.mkt-door-notes { font-size: var(--mkt-stamp); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mkt-door-card .mkt-badges { gap: var(--mkt-space-1); }
.mkt-door-card .mkt-badge { border: 0; border-right: 1px solid var(--ink-line); padding: 0 var(--mkt-space-2) 0 0; font-size: var(--mkt-stamp); color: var(--bone-dim); }
.mkt-door-card .mkt-badge:last-child { border-right: 0; padding-right: 0; }
.mkt-door-card .mkt-badge[data-fright] { color: var(--blood-text); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .mkt-door-ember { animation: none; opacity: 0.45; }
  .mkt-door-card:hover { transform: none; }
  .mkt-door-card:hover .mkt-door-art img { transform: none; }
}
@media (prefers-reduced-data: reduce) {
  .mkt-door-ember { animation: none; opacity: 0.35; }
}
html[data-reduced-motion="true"] .mkt-door-ember,
html[data-fright="gentle"] .mkt-door-ember { animation: none; opacity: 0.2; }
.mkt-preview-beat { border-left-color: var(--blood); position: relative; }
.folio-stamp {
  align-self: flex-start;
  margin: 0 0 var(--mkt-space-1);
  padding: var(--mkt-space-1) var(--mkt-space-2);
  border: 2px double var(--blood);
  color: var(--blood-text);
  font-family: "Gentium Plus", Georgia, serif;
  font-size: var(--mkt-stamp);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  transform: rotate(-2.5deg);
  transform-origin: left center;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.pub-card .folio-stamp { display: inline-block; }

/* MKT 6.7: the press kit. D41 B: the contest quote sits in a double-ruled manuscript frame. */
.mkt-article .mkt-lede { font-size: var(--mkt-lede); }
.mkt-press section { display: flex; flex-direction: column; gap: var(--mkt-space-3); margin-top: var(--mkt-space-8); }
.mkt-press h3 { margin: var(--mkt-space-2) 0 0; font-size: var(--mkt-lede); }
.mkt-facts { display: grid; grid-template-columns: 100%; gap: var(--mkt-space-1) var(--mkt-space-4); margin: 0; }
.mkt-facts dt { font-weight: 700; color: var(--bone); }
.mkt-facts dd { margin: 0 0 var(--mkt-space-2); color: var(--bone); }
.mkt-fact-row { display: contents; }
@media (min-width: 720px) { .mkt-facts { grid-template-columns: var(--mkt-label-col) 1fr; } }
.mkt-plain { margin: 0; padding: 0 0 0 var(--mkt-space-4); display: flex; flex-direction: column; gap: var(--mkt-space-1); }
.mkt-quote { margin: 0; padding: var(--mkt-space-3) var(--mkt-space-4); border: 3px double var(--blood); background: var(--soot-2); font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: var(--mkt-lede); }

/* MKT 6.9: the lamp that went out. Static: nothing animates, at any level or motion setting. */
.mkt-not-found { display: flex; flex-direction: column; gap: var(--mkt-space-4); align-items: flex-start; padding-top: var(--mkt-space-8); }
.lamp-out { color: var(--bone-dim); }
.lamp-out-ember { fill: var(--blood); }
.mkt-not-found-links { display: flex; flex-wrap: wrap; gap: var(--mkt-space-3); }
.mkt-not-found .mkt-button, .mkt-not-found .mkt-ghost { transition: none; }

/* The home sections below the hero (owner, 28 Nov 2026): the header's pattern carried down the page. Nothing is boxed. Words sit in the dark,
   a thread of ember divides one section from the next, plates are dim until the lamp (hover or focus) reaches them, and each of the trailer
   and the closing call keeps one pair of eyes. Home only (data-head="own"); /shelf and the other pages keep their own layout. All of it is
   CSS, so it adds no script to the first load. The eyes blink only while the hero lamp is live (never in Calm, Gentle or Reduced Motion),
   and every plate is back to near full brightness for a visitor who asked for stillness. Tests: tests/e2e/home-dark-sections.spec.ts. */
.mkt[data-head="own"] {
  --mkt-dim: brightness(0.95) contrast(1.05) saturate(0.96);
  --mkt-warm: brightness(1.18) contrast(1.06) saturate(1.02);
  --mkt-still: brightness(0.9);
  --mkt-thread: linear-gradient(to right, transparent, var(--blood) 30%, var(--lamp-hot) 50%, var(--blood) 70%, transparent);
  --mkt-thread-h: 1px;
  --mkt-thread-w: 14rem;
  --mkt-section-pad: var(--mkt-space-12);
  --mkt-whisper: 0.8125rem;
  --mkt-fade-art: linear-gradient(to bottom, var(--soot) 0%, transparent 22%, transparent 55%, var(--soot) 100%);
  --mkt-fade-edge: radial-gradient(ellipse at center, transparent 48%, var(--soot) 100%);
  --mkt-ember-line: 2px;
  --mkt-eye-a-x: 14%;
  --mkt-eye-a-y: 14%;
  --mkt-eye-gap: 1.75rem;
  --mkt-eye-wait: 600ms;
}
.mkt[data-head="own"] .mkt-section { position: relative; align-items: flex-start; border-top: 0; padding: var(--mkt-section-pad) 0 var(--mkt-space-6); }
.mkt[data-head="own"] .mkt-section > .mkt-rail { align-self: stretch; min-width: 0; max-width: 100%; }
.mkt[data-head="own"] .mkt-section::before { content: ""; position: absolute; top: 0; left: 0; width: var(--mkt-thread-w); height: var(--mkt-thread-h); background: var(--mkt-thread); opacity: 0.8; }
.mkt[data-head="own"] .mkt-section h2 { font-style: italic; font-weight: 500; color: var(--bone); }
.mkt[data-head="own"] .mkt-section-head { flex-direction: column; align-items: flex-start; align-self: stretch; gap: var(--mkt-space-1); }
.mkt[data-head="own"] .mkt-section-head .mkt-muted { color: var(--ash); font-size: var(--mkt-whisper); letter-spacing: 0.14em; text-transform: uppercase; }

/* Eyes: two ember points, no face. Only on the trailer's poster and above the closing call, and never over text a visitor must read. */
.mkt[data-head="own"] .mkt-trailer-frame::before,
.mkt[data-head="own"] .mkt-trailer-frame::after,
.mkt[data-head="own"] #closing::before,
.mkt[data-head="own"] #closing::after { content: ""; position: absolute; z-index: 5; width: var(--mkt-night-eye-w); height: var(--mkt-night-eye-h); border-radius: var(--mkt-night-round); background: var(--mkt-eye-core); box-shadow: var(--mkt-eye-glow); pointer-events: none; animation: none; transition: transform var(--mkt-eye-wait) ease; }
.mkt[data-head="own"] .mkt-trailer-frame:not([data-state="poster"])::before,
.mkt[data-head="own"] .mkt-trailer-frame:not([data-state="poster"])::after { display: none; }
.mkt[data-head="own"] .mkt-trailer-frame::before { top: var(--mkt-eye-a-y); right: calc(var(--mkt-eye-a-x) + var(--mkt-eye-gap)); }
.mkt[data-head="own"] .mkt-trailer-frame::after { top: var(--mkt-eye-a-y); right: var(--mkt-eye-a-x); }
.mkt[data-head="own"] #closing::before { top: var(--mkt-space-6); left: calc(var(--mkt-half) - var(--mkt-eye-gap)); max-width: none; height: var(--mkt-night-eye-h); }
.mkt[data-head="own"] #closing::after { top: var(--mkt-space-6); left: var(--mkt-half); }
.mkt[data-head="own"]:has(#hero-stage[data-live="true"]) .mkt-trailer-frame::before,
.mkt[data-head="own"]:has(#hero-stage[data-live="true"]) .mkt-trailer-frame::after,
.mkt[data-head="own"]:has(#hero-stage[data-live="true"]) #closing::before,
.mkt[data-head="own"]:has(#hero-stage[data-live="true"]) #closing::after { animation: mkt-night-blink 7300ms infinite; }
.mkt[data-head="own"] .mkt-trailer-frame:hover::before, .mkt[data-head="own"] .mkt-trailer-frame:hover::after,
.mkt[data-head="own"] #closing:hover::before, .mkt[data-head="own"] #closing:hover::after { transform: scaleY(0.08); }

/* Trailer: no frame, a plate in the dark that fades at its edges. Controls become words with a rule, like the hero's row. */
.mkt[data-head="own"] .mkt-trailer { padding: var(--mkt-section-pad) 0 var(--mkt-space-6); position: relative; }
.mkt[data-head="own"] .mkt-trailer h2 { font-style: italic; font-weight: 500; }
.mkt[data-head="own"] .mkt-trailer-frame { border: 0; border-radius: 0; background: transparent; }
.mkt[data-head="own"] .mkt-trailer-poster::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--mkt-fade-edge); }
.mkt[data-head="own"] .mkt-trailer-notes, .mkt[data-head="own"] .mkt-trailer-calmwhy, .mkt[data-head="own"] .mkt-trailer-voice { color: var(--ash); font-size: var(--mkt-small); letter-spacing: 0.02em; }
.mkt[data-head="own"] .mkt-trailer-actions .mkt-ghost { padding: 0 var(--mkt-space-2); border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: transparent; color: var(--ash); }
.mkt[data-head="own"] .mkt-trailer-actions .mkt-ghost:hover { color: var(--bone); border-bottom-color: var(--blood-text); }
.mkt[data-head="own"] .mkt-trailer-actions .mkt-ghost[aria-pressed="true"] { background: transparent; color: var(--bone); border-bottom: var(--mkt-ember-line) solid var(--blood-text); }
.mkt[data-head="own"] .mkt-trailer-transcript summary { color: var(--ash); font-size: var(--mkt-whisper); }

/* How it works: four plates in the dark, lit under the lamp. */
.mkt[data-head="own"] .mkt-step-media picture { position: relative; filter: var(--mkt-dim); transition: filter 700ms ease; }
.mkt[data-head="own"] .mkt-step:hover .mkt-step-media picture, .mkt[data-head="own"] .mkt-step:focus-within .mkt-step-media picture { filter: var(--mkt-warm); }
.mkt[data-head="own"] .mkt-step-media picture::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--mkt-fade-art); }
.mkt[data-head="own"] .mkt-rail .mkt-step-media figcaption { position: static; padding: var(--mkt-space-1) 0 0; background: transparent; border: 0; color: var(--ash); font-size: var(--mkt-small); }
/* The notes lines carry the content warnings, so they are the brightest small text on the page: ash on soot, 15 px, over the plate with an ink shadow. */
.mkt[data-head="own"] .mkt-hero-notes, .mkt[data-head="own"] .mkt-trailer-notes, .mkt[data-head="own"] .mkt-door-notes { color: var(--ash); font-size: var(--mkt-small); line-height: 1.4; text-shadow: var(--mkt-night-ink); }
.mkt[data-head="own"] .mkt-step h3 { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-weight: 500; }
.mkt[data-head="own"] .mkt-step-n { color: var(--blood-text); letter-spacing: 0.12em; text-transform: uppercase; font-size: var(--mkt-whisper); }
.mkt[data-head="own"] .mkt-step p { color: var(--bone-dim); }

/* The tales: plates fade into the dark; the card is a plate and a name, not a box. A Full Dark tale carries a thread of ember under its plate. */
.mkt[data-head="own"] .mkt-card { padding: 0; border: 0; border-radius: 0; background: transparent; }
.mkt[data-head="own"] .mkt-door-card:hover { transform: none; }
.mkt[data-head="own"] .mkt-door-card.is-coming { padding: 0; border: 0; opacity: 0.7; }
.mkt[data-head="own"] .mkt-door-art::after { background: var(--mkt-fade-art); }
.mkt[data-head="own"] .mkt-door-card[data-level="Full Dark"] .mkt-door-art::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: var(--mkt-ember-line); background: var(--mkt-thread); }
.mkt[data-head="own"] .mkt-door-body { padding: var(--mkt-space-2) 0 var(--mkt-space-3); }
.mkt[data-head="own"] .mkt-door-body h3 { font-style: italic; font-weight: 500; }
.mkt[data-head="own"] .mkt-door-card .mkt-badges { text-transform: uppercase; letter-spacing: 0.1em; }
.mkt[data-head="own"] .mkt-door-card .mkt-badge { font-size: var(--mkt-whisper); }

/* What costs what: three quiet columns. Free is the one that is lit. */
.mkt[data-head="own"] .mkt-card[data-tier] { gap: var(--mkt-space-3); padding: var(--mkt-space-3) 0 0; position: relative; }
.mkt[data-head="own"] .mkt-card[data-tier]::before { content: ""; position: absolute; top: 0; left: 0; width: var(--mkt-space-12); height: var(--mkt-thread-h); background: var(--blood); }
.mkt[data-head="own"] .mkt-card[data-tier] h3 { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-weight: 500; color: var(--bone); }
.mkt[data-head="own"] .mkt-card[data-tier="free"] h3 { color: var(--lamp-hot); }
.mkt[data-head="own"] .mkt-card[data-tier] p { color: var(--bone-dim); }
.mkt[data-head="own"] .mkt-card[data-tier] .mkt-ghost { padding: 0 var(--mkt-space-2) 0 0; border: 0; border-bottom: 1px solid var(--blood); border-radius: 0; background: transparent; color: var(--bone); }

/* The closing call: alone in the dark under a pair of eyes. */
.mkt[data-head="own"] #closing { align-items: center; text-align: center; padding-top: var(--mkt-space-12); padding-bottom: var(--mkt-section-pad); }
.mkt[data-head="own"] #closing h2 { font-size: var(--mkt-h1); }
.mkt[data-head="own"] #closing p { color: var(--bone-dim); }
.mkt[data-head="own"] #closing .mkt-button { align-self: center; }

@media (min-width: 900px) {
  .mkt[data-head="own"] { --mkt-eye-gap: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .mkt[data-head="own"] .mkt-step-media picture { filter: var(--mkt-still); }
}
html[data-reduced-motion="true"] .mkt[data-head="own"] .mkt-step-media picture,
html[data-fright="gentle"] .mkt[data-head="own"] .mkt-step-media picture { filter: var(--mkt-still); }

/* Inner pages (everything but home) share the night head: the call top left, the eyes top right, the pages in the dark sheet. The head sits
   over the top of the page, so main leaves room for it. There is no hero lamp here, so the eyes blink on their own, and the in-app Gentle
   level and Reduced Motion hold them still (the media query is handled by the rule near the top of this file). Tests: tests/e2e/inner-pages-night-head.spec.ts. */
.mkt[data-page="inner"] {
  --mkt-page-top: 5.5rem;
  --mkt-night-pad: 0px;
}
.mkt[data-page="inner"] .mkt-main { padding-top: var(--mkt-page-top); }
.mkt[data-page="inner"] .mkt-eye { animation: mkt-night-blink 7300ms infinite; }
html[data-reduced-motion="true"] .mkt[data-page="inner"] .mkt-eye,
html[data-fright="gentle"] .mkt[data-page="inner"] .mkt-eye { animation: none; }
/* MKT-R11.3: the 404 lamp-out page is Calm; nothing moves there, the night head included. */
.mkt:has([data-page="not-found"]) *, .mkt:has([data-page="not-found"]) *::before, .mkt:has([data-page="not-found"]) *::after { animation: none !important; transition: none !important; }
/* MKT-P33: a running line on an inner page is never wider than 66ch of its own font (64ch leaves room for the 3% slack). */
.mkt[data-page="inner"] .mkt-main p, .mkt[data-page="inner"] .mkt-main li:not(:has(> *:not(a, em, strong, code, span, b, i))) { max-width: var(--mkt-measure-wide); }
@media (min-width: 900px) {
  .mkt[data-page="inner"] { --mkt-page-top: 7.5rem; }
}

/* Inner page bodies: the home sections' pattern. Nothing boxed, a thread of ember at the top, italic headings. Done from here, over the
   public pages' own rules (public-pages.css is left as it is). A form field keeps its border: it must look like a field. */
.mkt[data-page="inner"] .mkt-article { position: relative; }
.mkt[data-page="inner"] .mkt-article::before { content: ""; position: absolute; top: 0; left: 0; width: var(--mkt-thread-w); height: var(--mkt-thread-h); background: var(--mkt-thread); opacity: 0.8; }
.mkt[data-page="inner"] .mkt-article h1, .mkt[data-page="inner"] .mkt-article h2 { font-style: italic; font-weight: 500; }
.mkt[data-page="inner"] .mkt-article h1 { padding-top: var(--mkt-space-4); }
.mkt[data-page="inner"] .mkt-article section > h2 { color: var(--bone); }
.mkt[data-page="inner"] .mkt-faq section { gap: var(--mkt-space-2); padding: var(--mkt-space-2) 0 var(--mkt-space-4); }
.mkt[data-page="inner"] .mkt-article p, .mkt[data-page="inner"] .mkt-article li { color: var(--bone); }
.mkt[data-page="inner"] .mkt-table th { color: var(--ash); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; font-size: var(--mkt-whisper); }
.mkt[data-page="inner"] .mkt-quote { background: transparent; }

.mkt[data-page="inner"] .pub-card, .mkt[data-page="inner"] .pub-form { border: 0; background: transparent; box-shadow: none; padding-left: 0; padding-right: 0; position: relative; }
.mkt[data-page="inner"] .pub-card::before, .mkt[data-page="inner"] .pub-form::before { content: ""; position: absolute; top: 0; left: 0; width: var(--mkt-space-12); height: var(--mkt-thread-h); background: var(--blood); }
.mkt[data-page="inner"] .pub-card h3, .mkt[data-page="inner"] .pub-form h3, .mkt[data-page="inner"] .pub-form-title { font-style: italic; font-weight: 500; }
.mkt[data-page="inner"] #free h2, .mkt[data-page="inner"] [data-tier="free"] h2 { color: var(--lamp-hot); }
.mkt[data-page="inner"] .pub-note { border-left: 0; background: transparent; padding-left: 0; }
@media (max-width: 899px) {
  .mkt[data-page="inner"] {
    --mkt-faq-q: 1.5rem;
  }
  .mkt[data-page="inner"] .mkt-faq h2 { font-size: var(--mkt-faq-q); line-height: 1.2; }
}

/* Wide screens (owner, 28 Nov 2026): How it's made and the FAQ put each heading beside its text instead of one narrow column with the
   right half of the page empty. Text keeps a readable measure inside its column. */
@media (min-width: 1100px) {
  .mkt[data-page="inner"] {
    --mkt-side: 22rem;
    --mkt-measure-wide: 64ch; /* MKT-P33: no line over 66ch of its own font */
  }
  .mkt[data-page="inner"] .mkt-article > section { display: grid; grid-template-columns: var(--mkt-side) minmax(0, 1fr); column-gap: var(--mkt-space-12); row-gap: var(--mkt-space-2); align-items: start; padding: var(--mkt-space-6) 0; border-top: 1px solid var(--ink-line); }
  .mkt[data-page="inner"] .mkt-article > section > h2 { grid-column: 1; grid-row: 1; margin: 0; }
  .mkt[data-page="inner"] .mkt-article > section > :not(h2) { grid-column: 2; max-width: var(--mkt-measure-wide); }
  .mkt[data-page="inner"] .mkt-article > section > .mkt-table-wrap { max-width: none; }
  .mkt[data-page="inner"] .mkt-faq h2 { font-size: var(--mkt-lede); line-height: 1.3; }
}

/* Pricing (owner, 28 Nov 2026): the Night Edition leads in the dark, the free tales and the Course Licence follow quietly. */
.mkt[data-page="inner"] .pub-tier { padding-top: var(--mkt-space-6); }
.mkt[data-page="inner"] .pub-tier.is-lead h2 { color: var(--lamp-hot); }
.mkt[data-page="inner"] .pub-tier-call { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: var(--mkt-lede); color: var(--bone); }
.mkt[data-page="inner"] .pub-tier:not(.is-lead) .pub-cards { gap: var(--mkt-space-3); }

/* How it's made, one line's journey (owner, 28 Nov 2026). A numbered column with an ember thread down the left; each step shows the thing
   large and its record small. The lamp step lights the plate with a still circle (no motion, so nothing for Reduced Motion to stop). */
.mkt[data-page="inner"] {
  --mkt-journey-rail: 1px;
  --mkt-journey-dot: 9px;
  --mkt-journey-indent: 2rem;
  --mkt-journey-line: 1.25rem;
  --mkt-journey-scan: 15rem;
  --mkt-journey-thread: linear-gradient(to bottom, var(--blood), var(--lamp-hot) 50%, var(--blood));
  --mkt-journey-lamp: radial-gradient(ellipse 30% 52% at 44% 52%, var(--mkt-mask-ink) 0%, var(--mkt-mask-ink) 45%, transparent 100%);
}
.mkt[data-page="inner"] .mkt-article > .mkt-journey { display: flex; flex-direction: column; gap: var(--mkt-space-4); border-top: 0; padding: var(--mkt-space-8) 0; }
.mkt-journey h2 { color: var(--lamp-hot); }
.mkt-journey-lede { color: var(--bone-dim); }
.mkt-journey-steps { list-style: none; margin: 0; padding: 0 0 0 var(--mkt-journey-indent); position: relative; display: flex; flex-direction: column; gap: var(--mkt-space-12); }
.mkt-journey-steps::before { content: ""; position: absolute; top: var(--mkt-space-2); bottom: var(--mkt-space-2); left: var(--mkt-space-1); width: var(--mkt-journey-rail); background: var(--mkt-journey-thread); }
.mkt-journey-steps > li { position: relative; display: flex; flex-direction: column; gap: var(--mkt-space-3); max-width: 100%; }
.mkt-journey-steps > li::before { content: ""; position: absolute; top: var(--mkt-space-2); left: calc(var(--mkt-space-1) - var(--mkt-journey-indent) - var(--mkt-space-1)); width: var(--mkt-journey-dot); height: var(--mkt-journey-dot); border-radius: var(--mkt-night-round); background: var(--mkt-eye-core); box-shadow: var(--mkt-eye-glow); }
.mkt-journey-n { margin: 0; color: var(--blood-text); font-size: var(--mkt-whisper); letter-spacing: 0.18em; text-transform: uppercase; }
.mkt-journey-line { margin: 0; font-family: "Gentium Plus", Georgia, serif; font-size: var(--mkt-journey-line); line-height: 1.55; color: var(--bone); max-width: var(--mkt-measure); }
.mkt-journey-line mark { background: transparent; color: var(--lamp-hot); border-bottom: 1px solid var(--blood-text); }
.mkt-journey-record { margin: 0; color: var(--ash); font-size: var(--mkt-small); max-width: var(--mkt-measure); }
.mkt-journey-scans { display: flex; flex-wrap: wrap; gap: var(--mkt-space-4); }
.mkt-journey-scans figure { margin: 0; display: flex; flex-direction: column; gap: var(--mkt-space-1); width: var(--mkt-journey-scan); max-width: 100%; }
.mkt-journey-scans img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: contain; background: var(--soot); filter: sepia(0.25) brightness(0.85); }
.mkt-journey-scans figcaption, .mkt-journey-plate figcaption { color: var(--ash); font-size: var(--mkt-small); }
.mkt-journey-plate { margin: 0; display: flex; flex-direction: column; gap: var(--mkt-space-1); max-width: var(--mkt-measure); }
.mkt-journey-plate picture { display: block; aspect-ratio: 1376 / 768; overflow: hidden; background: var(--soot); }
.mkt-journey-plate img { display: block; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.8); }
/* Step VI (review S-6): the plate lies dark, and a second copy of it shows through one lamp circle, so the step shows a lamp and not a repeat of V. */
.mkt-journey-plate.is-lamp { position: relative; }
.mkt-journey-plate.is-lamp picture:not(.is-lit) img { filter: brightness(0.22); }
.mkt-journey-plate.is-lamp picture.is-lit { position: absolute; top: 0; left: 0; right: 0; }
.mkt-journey-plate.is-lamp picture.is-lit img { filter: brightness(1.1) contrast(1.1); -webkit-mask-image: var(--mkt-journey-lamp); mask-image: var(--mkt-journey-lamp); }
@media (min-width: 1100px) {
  .mkt[data-page="inner"] .mkt-article > .mkt-journey { display: flex; }
  .mkt[data-page="inner"] .mkt-article > .mkt-journey > :not(h2) { max-width: none; }
  .mkt-journey-steps > li { display: grid; grid-template-columns: var(--mkt-side) minmax(0, 1fr); column-gap: var(--mkt-space-12); row-gap: var(--mkt-space-2); }
  .mkt-journey-steps > li > .mkt-journey-n { grid-column: 1; grid-row: 1; }
  .mkt-journey-steps > li > :not(.mkt-journey-n) { grid-column: 2; }
}

/* FAQ (owner, 28 Nov 2026): three groups; each question opens in place under a thin ember rule. One pair of eyes by the scary question:
   they blink like the header's and are still in Gentle and Reduced Motion (the rules above). */
.mkt[data-page="inner"] .mkt-faq-list { display: flex; flex-direction: column; }
.mkt[data-page="inner"] .mkt-faq details.mkt-faq-item { border: 0; border-bottom: 1px solid var(--ink-line); border-radius: 0; padding: 0; background: transparent; }
.mkt[data-page="inner"] .mkt-faq details.mkt-faq-item summary { display: flex; align-items: center; gap: var(--mkt-space-3); min-height: var(--mkt-target); padding: var(--mkt-space-2) 0; cursor: pointer; list-style: none; }
.mkt[data-page="inner"] .mkt-faq details.mkt-faq-item summary::-webkit-details-marker { display: none; }
.mkt[data-page="inner"] .mkt-faq details.mkt-faq-item summary::after { content: "+"; margin-left: auto; color: var(--blood-text); font-size: var(--mkt-lede); }
.mkt[data-page="inner"] .mkt-faq details.mkt-faq-item[open] summary::after { content: "\2212"; }
.mkt[data-page="inner"] .mkt-faq details.mkt-faq-item summary:hover h3 { color: var(--lamp-hot); }
.mkt[data-page="inner"] .mkt-faq h3 { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-weight: 500; font-size: var(--mkt-lede); color: var(--bone); }
.mkt[data-page="inner"] .mkt-faq details.mkt-faq-item p { padding: 0 0 var(--mkt-space-4); color: var(--bone); }
.mkt[data-page="inner"] .mkt-faq h2 { color: var(--blood-text); font-size: var(--mkt-lede); letter-spacing: 0.04em; }
.mkt-faq-eyes { position: relative; display: inline-block; flex: none; width: var(--mkt-night-eyes-w); height: var(--mkt-night-eyes-h); }

/* Sources (owner, 28 Nov 2026): each launch card leads with its own first printed page, so the proof is in view; the Coming tales are one
   compact line each. */
.mkt[data-page="inner"] .pub-card-scan { margin: 0 0 var(--mkt-space-2); display: flex; flex-direction: column; gap: var(--mkt-space-1); width: var(--mkt-journey-scan); max-width: 100%; }
/* The whole page, never a crop: where on the page the tale starts is not measured (its source box is a placeholder, UI-11). */
.mkt[data-page="inner"] .pub-card-scan img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: contain; background: var(--soot); filter: sepia(0.3) brightness(0.7); }
.mkt[data-page="inner"] .pub-card-scan figcaption { color: var(--ash); font-size: var(--mkt-small); }
.mkt[data-page="inner"] .pub-coming-line { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--mkt-space-2); }
.mkt[data-page="inner"] .pub-coming-line li { color: var(--bone-dim); font-size: var(--mkt-small); line-height: 1.6; }
.mkt[data-page="inner"] .pub-coming-line a { min-height: var(--mkt-target); display: inline-flex; align-items: center; }
.mkt[data-page="inner"] .pub-coming-title { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: var(--mkt-lede); color: var(--bone); }

/* Trailer shot 6 (owner check, 28 Nov 2026): the white page scan cut in at full brightness between dark shots and read as a glare. On the
   home page it is warmed and dimmed like the How it's made scans; the page stays fully legible. */
.mkt[data-head="own"] .mkt-trailer-capture img { filter: sepia(0.3) brightness(0.72); }
/* Visual review r1 S-18: in shot 6 the caption sat across the page scan. The scan now stops above the caption band, so the caption sits
   under the page and the page is never covered. */
.mkt[data-head="own"] .mkt-trailer-capture { bottom: calc(var(--mkt-space-8) + var(--mkt-space-8)); }

/* Review S-3 (28 Nov 2026): Pricing and Sources get the ember thread and italic headings like the other inner pages. They sit in .pub-main
   (public-pages.css draws their capitals), so the override is scoped to those two pages; /judges keeps its own layout. */
.pub[data-page="pricing"] .pub-main, .pub[data-page="sources"] .pub-main { position: relative; }
.pub[data-page="pricing"] .pub-main::before, .pub[data-page="sources"] .pub-main::before { content: ""; position: absolute; top: 0; left: 0; width: var(--mkt-thread-w); height: var(--mkt-thread-h); background: var(--mkt-thread); opacity: 0.8; }
.pub[data-page="pricing"] .pub-main h1, .pub[data-page="sources"] .pub-main h1,
.pub[data-page="pricing"] .pub-main h2, .pub[data-page="sources"] .pub-main h2 { font-style: italic; font-weight: 500; text-transform: none; letter-spacing: 0.01em; }

/* The shelf wears the night head (review O-1): the head draws itself over the top of the page, so this wrapper takes no room, and the
   Settings and 90s Tour row sits under the call. */
.shelf-night { min-height: 0; height: 0; display: block; background: transparent; z-index: 60; } /* above .shelf-head (z 50), whose soot bar would paint over the call and the eyes */

/* Review round 2 (visual-reviewer r1 S-2, S-5, S-8, S-10, S-11, S-12, S-13, S-14; tests/e2e/marketing-polish.spec.ts). */
/* S-14: the vignette sits under the text, so it can no longer dim a line of it. .mkt is its own stacking context so the layer stays above
   the page background and below everything drawn in the page. */
.mkt { isolation: isolate; }
.mkt::after { z-index: -1; }
/* S-2: a list row is a line of text with its link, not a row of flex items, so inline code stays inside its sentence. */
.mkt-list li { display: block; }
.mkt-list li > a { margin-right: var(--mkt-space-2); }
/* S-5: a rule between the sections on a phone too, and a tight two-line heading. */
.mkt[data-page="inner"] .mkt-article > section:not(.mkt-journey) { border-top: 1px solid var(--ink-line); padding: var(--mkt-space-6) 0; }
.mkt[data-page="inner"] .mkt-article > section > h2 { line-height: 1.2; }
/* S-8: the four steps stand level: the cards take the height of the tallest (the scan step has a caption) and the picture takes the spare,
   so every heading starts on one line. */
.mkt[data-head="own"] .mkt-step { display: flex; flex-direction: column; }
.mkt[data-head="own"] .mkt-step-media { flex: 1 1 auto; }
/* S-10: no separators between the badges, only space; an empty badge takes no room. */
.mkt-door-card .mkt-badges { gap: var(--mkt-space-1) var(--mkt-space-3); }
.mkt-door-card .mkt-badge { border: 0; padding: 0; }
.mkt-door-card .mkt-badge:empty { display: none; }
/* S-11: the footer waitlist and the Press quote lose their boxes and take the short ember rule the other inner pages use. */
.mkt-foot form.pub-form { background: transparent; border: 0; box-shadow: none; padding: var(--mkt-space-3) 0 0; position: relative; }
.mkt-foot form.pub-form::before { content: ""; position: absolute; top: 0; left: 0; width: var(--mkt-space-12); height: var(--mkt-thread-h); background: var(--blood); }
.mkt[data-page="inner"] .mkt-quote { border: 0; padding: var(--mkt-space-3) 0 0; position: relative; }
.mkt[data-page="inner"] .mkt-quote::before { content: ""; position: absolute; top: 0; left: 0; width: var(--mkt-space-12); height: var(--mkt-thread-h); background: var(--blood); }
/* S-12: the footer reads top to bottom in one column: the form, the links, the licence line, the art line. */
.mkt-foot { grid-template-columns: 100%; }
.mkt-foot .pub-form { grid-row: auto; }
/* S-13: the FAQ group headings are small red labels. They are not questions and do not open. */
.mkt[data-page="inner"] .mkt-faq section > h2 { font-style: normal; text-transform: uppercase; letter-spacing: 0.18em; font-size: var(--mkt-whisper); color: var(--blood-text); }
/* The shelf's head sits on the shelf's own column (shelf review r2 #2). */
.shelf-night .mkt-night-inner { max-width: var(--mkt-shelf-col); padding-left: var(--mkt-space-4); padding-right: var(--mkt-space-4); }
.shelf-night .mkt-eyes { right: var(--mkt-space-4); }
/* Edition Shelf (docs/ui/screens.md S1) — The Zaure Corridor of Arched Doors (Blood & Ash Folk-Horror).
   NOT a dark-mode card grid: open folio spreads, arched Northern mud doorways swallowed in soot,
   hidden creature silhouettes emerging as your oil lamp approaches, and incised manuscript typography.
   Uses ONLY tokens declared in tokens.css / motion-theater.css (LIB-P24). Controls >= 44x44, text >= 12px. */
.shelf {
  position: relative;
  background: var(--soot);
  color: var(--bone);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Gentium Plus", Georgia, serif;
}
/* Heavy organic soot vignette around the edges of the corridor */
.shelf::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  background: radial-gradient(ellipse at center, transparent 40%, var(--soot) 100%);
  opacity: 0.82;
}
/* Interactive oil-lamp beam following the reader through the dark shelf (gutters after 4s idle) */
.shelf-lamp-wash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 35;
  background: radial-gradient(circle 280px at var(--lx) var(--ly), var(--ink-line) 0%, transparent 72%);
  opacity: 0.26;
  mix-blend-mode: screen;
  transition: opacity 1800ms ease;
}
.shelf[data-wick="guttering"] .shelf-lamp-wash {
  opacity: 0.07;
}
/* Peripheral watcher eyes in the outer dark margins (desktop, non-gentle, non-reduced-motion) */
.shelf-watchers {
  display: none;
}
@media (min-width: 1240px) and (hover: hover) {
  .shelf-watchers {
    display: block;
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 42;
  }
}
@keyframes shelf-watcher-blink {
  0%, 42%, 46%, 100% { opacity: 0.52; transform: scaleY(1); }
  44% { opacity: 0.04; transform: scaleY(0.1); }
}
.shelf-watcher {
  position: absolute;
  display: inline-flex;
  gap: 7px;
  animation: shelf-watcher-blink 7.5s ease-in-out infinite;
  transition: opacity 120ms ease, transform 120ms ease;
}
.shelf-watcher.is-left { left: 2.2vw; }
.shelf-watcher.is-right { right: 2.2vw; animation-delay: 2.8s; }
.shelf-watcher[data-snapped="true"] {
  opacity: 0 !important;
  transform: scaleY(0.05);
}
.shelf-watcher-eye {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--bone);
  box-shadow: 0 0 8px 2px var(--danger);
}
.shelf-watchers,
html[data-fright="gentle"] .shelf-watchers,
html[data-reduced-motion="true"] .shelf-watchers {
  display: none;
}
.shelf * { box-sizing: border-box; }

/* Header: borderless archival masthead + Dagin Arewa sigil + eroded blood-ash relief */
.shelf-head {
  position: relative;
  z-index: 50;
  background: var(--soot);
}
.shelf-head-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 14px 16px;
}
.shelf-head::after,
.shelf-foot::before {
  content: "";
  display: block;
  height: 6px;
  border-top: 1px solid var(--ink-line);
  background-image:
    repeating-linear-gradient(45deg, var(--ink-line) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(-45deg, var(--danger) 0 1px, transparent 1px 11px);
  opacity: 0.85;
}
.shelf-brand {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
@media (min-width: 720px) {
  .shelf-brand { font-size: 1.5rem; letter-spacing: 0.22em; }
}
.shelf-brand .arewa-sigil {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: none;
  background-color: #e0584c;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='black' stroke-width='2.4'%3E%3Cpath d='M24 4l6 8-6 8-6-8zM44 24l-8 6-8-6 8-6zM24 44l-6-8 6-8 6 8zM4 24l8-6 8 6-8 6zM24 14l10 10-10 10-10-10z'/%3E%3Cpath d='M12 12l24 24M36 12L12 36' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='black' stroke-width='2.4'%3E%3Cpath d='M24 4l6 8-6 8-6-8zM44 24l-8 6-8-6 8-6zM24 44l-6-8 6-8 6 8zM4 24l8-6 8 6-8 6zM24 14l10 10-10 10-10-10z'/%3E%3Cpath d='M12 12l24 24M36 12L12 36' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.shelf-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* The night head draws over the top of the page (marketing.css .shelf-night); Settings and the tour sit in a row beneath its call. */
.shelf-night + .shelf-head .shelf-head-inner { justify-content: flex-start; padding-top: 56px; }
/* The pill's own 8 px of side padding is pulled out so the word "Settings" starts on the content column (review r2 #2). */
.shelf-night + .shelf-head .shelf-head-actions { margin-left: -8px; }
/* Borderless margin utilities (kills corporate dark-mode boxes) */
.shelf-pill {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0 8px;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--bone-dim);
  text-decoration: none;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.9375rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 160ms ease, border-color 160ms ease;
}
.shelf-pill:hover { color: var(--bone); border-bottom-color: #e0584c; }

/* Main column */
.shelf main {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 16px 64px;
  position: relative;
  z-index: 10;
}

/* Forbidden folio masthead */
.shelf-masthead {
  padding-bottom: 24px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--ink-line);
}
.shelf-kicker {
  margin: 0 0 8px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.875rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #e0584c;
}
.shelf h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 0.98;
  margin: 0 0 12px;
  font-weight: 500;
  color: var(--bone);
}
@media (min-width: 900px) {
  .shelf h1 { font-size: 4.5rem; }
}
.shelf-lede {
  color: var(--bone);
  font-style: italic;
  margin: 0 0 8px;
  font-size: 1.1875rem;
  opacity: 0.9;
}
.shelf-count {
  color: var(--bone-dim);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  margin: 0;
}

/* Continue reading blood-lined strip */
.shelf-continue {
  border-left: 3px solid var(--danger);
  border-top: 1px solid var(--ink-line);
  border-bottom: 1px solid var(--ink-line);
  background: var(--soot-2);
  padding: 14px 20px;
  margin: 0 0 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}
.shelf-continue p { margin: 0; font-size: 1.0625rem; }
.shelf-continue strong { color: #e0584c; font-weight: 600; }

/* Incised borderless chapter index tabs (zero pill/dashboard chrome) */
.shelf-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  align-items: center;
  padding-bottom: 14px;
  margin: 0 0 36px;
  border-bottom: 1px solid var(--ink-line);
}
.shelf-filter,
.shelf-switch {
  min-height: 44px;
  min-width: 44px;
  padding: 0 6px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--bone-dim);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease;
}
.shelf-filter:hover,
.shelf-switch:hover {
  color: var(--bone);
  border-bottom-color: var(--ink-line);
}
.shelf-filter[aria-pressed="true"],
.shelf-switch[aria-checked="true"] {
  color: var(--bone);
  border-bottom-color: #e0584c;
  font-weight: 600;
}
.shelf-switch { gap: 8px; margin-left: auto; }
/* On-state dot: a diamond drawn as four hard-stop triangles in the background of the 44 px switch,
   left of the label, so no sub-44 px box exists. */
.shelf-switch[aria-checked="true"] {
  padding-left: 22px;
  background-repeat: no-repeat;
  background-size: 4px 4px;
  background-position:
    6px calc(50% - 2px),
    10px calc(50% - 2px),
    6px calc(50% + 2px),
    10px calc(50% + 2px);
  background-image:
    linear-gradient(to bottom right, transparent 50%, var(--lamp-hot) 50%),
    linear-gradient(to bottom left, transparent 50%, var(--lamp-hot) 50%),
    linear-gradient(to top right, transparent 50%, var(--lamp-hot) 50%),
    linear-gradient(to top left, transparent 50%, var(--lamp-hot) 50%);
}
.shelf-filter:focus-visible,
.shelf-switch:focus-visible,
.shelf-read:focus-visible,
.shelf-clear:focus-visible,
.shelf a:focus-visible {
  outline: 2px solid var(--lamp-hot);
  outline-offset: 2px;
}

/* Chapter tier headers */
.shelf-tier { margin-top: 48px; }
.shelf-tier:first-of-type { margin-top: 0; }
.shelf-tier h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.125rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin: 0 0 24px;
  color: #e0584c;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 16px;
}
.shelf-tier h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ink-line);
}

/* CORRIDOR OF ARCHED DOORS: 1-column cinematic folio spreads (NO 3-col SaaS grid!) */
.shelf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.shelf-card {
  position: relative;
  border: 0;
  border-bottom: 1px solid var(--ink-line);
  background: transparent;
  padding: 32px 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: center;
}
.shelf-card:first-child { padding-top: 8px; }
@media (min-width: 820px) {
  .shelf-card {
    grid-template-columns: 1.08fr 1fr;
    gap: 44px;
    padding: 40px 0;
  }
  /* Alternate doorway left/right down the corridor like stepping past opposing chambers */
  .shelf-card:nth-child(even) .shelf-door { order: 2; }
  .shelf-card:nth-child(even) .shelf-card-body { order: 1; }
}

/* Physical Northern mud-arch doorway frame (sharp polygon arch, zero round pill border-radius) */
.shelf-door {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--soot);
  clip-path: polygon(0% 100%, 0% 28%, 4% 14%, 13% 5%, 28% 1%, 50% 0%, 72% 1%, 87% 5%, 96% 14%, 100% 28%, 100% 100%);
  border-bottom: 2px solid var(--ink-line);
}
.shelf-door-bg,
.shelf-door-creature,
.shelf-door-bg img,
.shelf-door-creature img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Clearly visible chiaroscuro at rest so the horror art hits immediately on scroll, flaring brighter on approach */
.shelf-door-bg img {
  filter: brightness(0.8) contrast(1.22) saturate(0.84);
  transform: scale(1.01);
  transition: filter 480ms ease, transform 680ms ease;
}
.shelf-card:hover .shelf-door-bg img,
.shelf-card:focus-within .shelf-door-bg img {
  filter: brightness(0.98) contrast(1.18) saturate(0.95);
  transform: scale(1.05);
}
/* Hidden creature lurking inside the dark arch — immediately ominous at rest, lunging forward on approach */
.shelf-door-creature img {
  opacity: 0.68;
  filter: brightness(0.82) contrast(1.34) saturate(0.72);
  transform: scale(0.98);
  transition: opacity 440ms ease, filter 480ms ease, transform 680ms ease;
}
.shelf-card:hover .shelf-door-creature img,
.shelf-card:focus-within .shelf-door-creature img {
  opacity: 1;
  filter: brightness(1) contrast(1.28) saturate(0.86);
  transform: scale(1.04);
}
.shelf-door-shadow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.42;
  transform: scale(0.97);
  transition: opacity 440ms ease, transform 680ms ease;
}
.shelf-card:hover .shelf-door-shadow,
.shelf-card:focus-within .shelf-door-shadow {
  opacity: 0.94;
  transform: scale(1.04);
}
@media (hover: none) {
  .shelf-door-bg img { filter: brightness(0.72) contrast(1.26) saturate(0.78); }
  .shelf-door-creature img { opacity: 0.72; filter: brightness(0.84) contrast(1.35) saturate(0.7); }
}
/* Heavy dark portal edge + bottom sink inside the arch */
.shelf-door-arch {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 42%, transparent 38%, var(--soot) 100%),
    linear-gradient(to bottom, transparent 62%, var(--soot) 100%);
}
/* Twin pinpoint eyes + arterial threshold glow pulsing in the pitch black */
@keyframes shelf-door-ember {
  0%, 100% { opacity: 0.38; }
  50% { opacity: 0.96; }
}
.shelf-door-ember {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(circle 48% at 50% 44%, var(--ink-line) 0%, transparent 72%),
    radial-gradient(circle 3px at 47.4% 36%, var(--bone) 0%, var(--danger) 58%, transparent 100%),
    radial-gradient(circle 3px at 52.6% 36%, var(--bone) 0%, var(--danger) 58%, transparent 100%);
  animation: shelf-door-ember 3.2s ease-in-out infinite;
}
.shelf-card.is-dark .shelf-door {
  border-bottom-color: var(--danger);
}

/* Archival dossier beside the doorway */
.shelf-card-body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0;
}
.shelf-roman {
  position: absolute;
  top: -18px;
  right: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 4.5rem;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ochre);
  opacity: 0.7; /* 28 Nov 2026: was --danger at 0.16 (1.2:1, failing axe on every shelf and tale page). Large text needs 3:1: ochre at 0.7 is about 3.5:1 on soot. Mock tokens only (LIB-P24). */
  pointer-events: none;
  user-select: none;
}
.shelf-folio-kicker {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #e0584c;
}
/* Reviewer 27 Nov: the big numeral sat on the folio line (phone and desktop). Smaller, lifted, and the line sits below it. */
.shelf-roman { font-size: 2.25rem; top: -26px; }
.shelf-folio-kicker { margin-top: 12px; }
.shelf-card h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.875rem;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0.02em;
  color: var(--bone);
}
@media (min-width: 900px) {
  .shelf-card h3 { font-size: 2.35rem; }
}
.shelf-card h3 a {
  color: var(--bone);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color 160ms ease;
}
.shelf-card h3 a:hover { color: var(--lamp-hot); }
.shelf-ha {
  margin: 0;
  font-style: italic;
  color: var(--lamp-hot);
  font-size: 1.0625rem;
}
.shelf-source {
  margin: 0;
  color: var(--bone-dim);
  font-size: 0.9375rem;
}

/* Raw inline manuscript annotations (zero boxed badges) */
.shelf-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 6px 0 12px;
  padding: 0;
  list-style: none;
}
.shelf-badge {
  border: 0;
  border-right: 1px solid var(--ink-line);
  padding: 0 12px 0 0;
  font-size: 0.875rem;
  color: var(--bone-dim);
}
.shelf-badge:last-child { border-right: 0; padding-right: 0; }
.shelf-badge.is-fright { color: #e0584c; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-family: "Cormorant Garamond", Georgia, serif; }
.shelf-badge.is-free { color: var(--lamp-hot); font-weight: 600; }
.shelf-badge.is-coming { color: var(--bone-dim); font-style: italic; }

/* Action row: chipped arterial crimson Read CTA + quiet pack controls */
.shelf-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}
.shelf-read {
  min-height: 44px;
  min-width: 112px;
  padding: 0 24px;
  border-radius: 2px;
  border: 0;
  background-color: transparent;
  background-image:
    linear-gradient(135deg, transparent 7px, var(--danger) 0),
    linear-gradient(-135deg, transparent 7px, var(--danger) 0),
    linear-gradient(45deg, transparent 7px, var(--danger) 0),
    linear-gradient(-45deg, transparent 7px, var(--danger) 0);
  background-position: top left, top right, bottom left, bottom right;
  background-size: 51% 51%;
  background-repeat: no-repeat;
  color: var(--bone);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: filter 160ms ease, transform 140ms ease;
}
.shelf-read:hover { filter: brightness(1.18); }
.shelf-read:active { transform: translateY(1px); }

/* Coming tales: compact archival ledger row below the playable chambers */
.shelf-list.is-coming-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 820px) {
  .shelf-list.is-coming-list { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}
.shelf-card.is-coming {
  display: flex;
  flex-direction: column;
  padding: 18px 0;
  border-bottom: 1px dashed var(--ink-line);
}
/* 28 Nov 2026: a Coming card was dimmed with opacity 0.72, which put its folio line, source line and numeral under contrast (axe).
   It now reads as Coming by its dashed rule, its smaller italic title and the Coming badge, not by fading its words. */
.shelf-card.is-coming h3 { font-size: 1.375rem; font-style: italic; color: var(--bone-dim); }


/* Tale landing (S2) primary Read button compatibility */
.shelf-read.is-primary {
  background-image:
    linear-gradient(135deg, transparent 7px, var(--danger) 0),
    linear-gradient(-135deg, transparent 7px, var(--danger) 0),
    linear-gradient(45deg, transparent 7px, var(--danger) 0),
    linear-gradient(-45deg, transparent 7px, var(--danger) 0);
  color: var(--bone);
  font-weight: 600;
}

.shelf-empty {
  border: 1px dashed var(--ink-line);
  border-radius: 2px;
  padding: 20px;
  color: var(--bone-dim);
}
.shelf-utility {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--ink-line);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
}
.shelf-note {
  color: var(--bone-dim);
  font-size: 0.875rem;
  margin: 0;
}
.shelf-skip {
  position: absolute;
  left: 8px;
  top: 0;
  z-index: 60;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  background: var(--lamp);
  color: var(--soot);
  border-radius: 2px;
  transform: translateY(-120%);
}
.shelf-skip:focus { transform: none; }

.shelf-foot {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 36px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 10;
}
.shelf-foot .shelf-note {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
}
.shelf-foot .shelf-note a {
  color: var(--bone-dim);
  text-decoration: none;
  font-family: "Cormorant Garamond", Georgia, serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.shelf-foot .shelf-note a:hover { color: var(--bone); }

.shelf-clear {
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: 2px;
  border: 1px solid var(--ink-line);
  background: transparent;
  color: var(--bone-dim);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease;
}
.shelf-clear:hover,
.shelf-clear.is-danger {
  border-color: var(--danger);
  color: var(--bone);
}
.shelf-confirm {
  border: 1px solid var(--danger);
  background: var(--soot-2);
  padding: 14px 16px;
  border-radius: 2px;
  max-width: 48ch;
}
.shelf-confirm p { margin: 0 0 10px; font-size: 0.9375rem; }
.shelf-confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.shelf-status { color: var(--bone-dim); font-size: 0.9375rem; margin: 8px 0 0; }

/* Tale landing (S2) shared styles — Blood & Ash dossier */
.shelf-landing-head {
  position: relative;
}
/* 29 Nov: on a phone the kicker runs under the big numeral; the kicker already names the story, so the numeral goes. */
@media (max-width: 599px) {
  .shelf-landing-head .shelf-roman { display: none; }
}
/* 29 Nov: the content notes are a small caution at the end of the badge row, in place of the dark notice block. */
.shelf-badge.is-caution { color: var(--bone-dim); font-style: italic; text-transform: none; letter-spacing: 0; max-width: 64ch; }
.shelf-dark-notice {
  border: 0;
  border-left: 3px solid var(--danger);
  border-top: 1px solid var(--ink-line);
  border-bottom: 1px solid var(--ink-line);
  background: var(--soot-2);
  border-radius: 2px;
  padding: 16px 20px;
  margin: 20px 0 24px;
}
.shelf-dark-notice h2 {
  margin: 0 0 6px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #e0584c;
}
.shelf-dark-notice p { margin: 0; font-size: 1rem; color: var(--bone); }
.shelf-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 18px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid var(--ink-line);
  color: var(--bone-dim);
  text-decoration: none;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.9375rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 160ms ease, border-color 160ms ease;
}
.shelf-back:hover {
  color: var(--bone);
  border-bottom-color: #e0584c;
}
.shelf-note a { color: var(--lamp-hot); min-height: 44px; display: inline-flex; align-items: center; }
.shelf main > .shelf-read { margin-top: 12px; }
.shelf main p { max-width: 66ch; }

/* Reduced motion & Gentle: zero animation on cards, doorways, lamp wash or embers (LIB-R / shelf.spec.ts) */
@media (prefers-reduced-motion: reduce) {
  .shelf *, .shelf *::before, .shelf *::after { animation: none !important; transition: none !important; }
  .shelf-lamp-wash, .shelf-watchers { display: none; }
  .shelf-door-bg img { filter: brightness(0.62) contrast(1.18); transform: none; }
  .shelf-door-creature img { opacity: 0.55; transform: none; }
  .shelf-door-shadow { opacity: 0.55; transform: none; }
  .shelf-door-ember { opacity: 0.35; }
}
html[data-reduced-motion="true"] .shelf-door-ember,
html[data-fright="gentle"] .shelf-door-ember { animation: none; opacity: 0.2; }
html[data-reduced-motion="true"] .shelf-lamp-wash,
html[data-fright="gentle"] .shelf-lamp-wash { display: none; }

/* Review r2 #1: on a phone the four filters share one line. */
@media (max-width: 420px) {
  .shelf-controls { gap: 4px 4px; }
  .shelf-filter { padding: 0 4px; letter-spacing: 0.08em; font-size: 0.9375rem; }
}
/* ---------- Lamp-and-ink + 2.5D Shadow Theater Tokens (R1–R8, F1–F74) ---------- */
/* port: the six contract tokens (--soot, --lamp, --lx, --ly, --creep, --dawn) and their siblings are declared once,
   in src/styles/tokens.css (READ-R1.1). This block holds only the derived tokens. */
:root {
  /* Mapped surface tokens */
  --bg: var(--soot);
  --surface: var(--soot-2);
  --surface-elev: #141110;
  --ink: var(--bone);
  --muted: var(--bone-dim);
  --accent: var(--lamp);
  --ember: #d66933;
  --cold: #82b4d9;
  --hair: var(--ink-line);

  --display: "Cormorant Garamond", Georgia, serif;
  --serif: "Gentium Plus", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;

  /* Reactive Fitila Lighting State (updated cleanly via JS) */
  --lamp-x: 52%;
  --lamp-y: 44%;
  --lamp-inner: 190px;
  --lamp-mid: 380px;
  --lamp-outer: 700px;
  --veil-edge: 0.72;
  --voice-glow: 0;

  /* 2.5D Pointer & Beat Camera Rig (compositor transform properties only) */
  --px: 0px;
  --py: 0px;
  --cam-x: 0%;
  --cam-y: 0%;
  --cam-zoom: 1.03;
  --threat-creep: 0px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
  cursor: pointer;
}

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================================================================
   HEADER BAR
   ========================================================================= */
.site-head {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  min-height: 54px;
  padding: 6px clamp(10px, 3vw, 28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(to bottom, rgba(8, 6, 5, 0.94) 0%, rgba(8, 6, 5, 0.72) 72%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.brand h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(20px, 2.4vw, 25px);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}

.brand-sub {
  margin: 0;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.25;
  color: var(--muted);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.head-pill {
  min-block-size: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: rgba(20, 15, 11, 0.85);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.head-pill:hover {
  background: rgba(34, 24, 17, 0.96);
  border-color: var(--accent);
}

.head-pill-accent {
  border-color: rgba(200, 125, 50, 0.58);
  color: var(--accent);
}

.pill-ha {
  color: var(--muted);
  font-weight: 400;
}

@media (max-width: 680px) {
  .brand {
    flex-direction: column;
    gap: 2px;
  }
  .brand-sub {
    font-size: 12px;
    max-width: 100%;
  }
  .head-pill {
    min-block-size: 44px;
    padding: 0 10px;
    font-size: 12px;
  }
  .head-pill .pill-ha {
    display: none;
  }
}

/* =========================================================================
   THEATER SHELL & 2.5D PARALLAX VIEWPORT (contained height without locking html)
   ========================================================================= */
.theater-shell {
  position: relative;
  width: 100%;
  height: 100vh; /* port: fallback for browsers without dvh (TATSU-SI-60) */
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

.stage-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  perspective: 960px;
}

.parallax-rig {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  /* r5 F3: the plate planes are lifted on a portrait view (engine.js applyPlateLift); 0 elsewhere. The lamp masks inside
     the rig read --lamp-y, so here it is the lamp's screen position plus the lift (set by the engine as --lamp-y-rig). */
  --lamp-y: var(--lamp-y-rig, 44%);
  transform: translate3d(0, calc(-1 * var(--plate-lift, 0px)), 0);
  transition: transform 950ms cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-reduced-motion: reduce) {
  .parallax-rig {
    transition: none;
  }
}
html[data-reduced-motion="true"] .parallax-rig {
  transition: none;
}

.depth-plane {
  position: absolute;
  inset: -4%;
  will-change: transform;
}

/* Base painting + subtle camera focus pan & zoom (compositor transform only). --layer-depth comes from the scene's
   layers[] (READ-R18.1); the fallback is the mock's depth. */
.plane-bg {
  transform: translate3d(
    calc(var(--cam-x) + var(--px) * var(--layer-depth, 0.35)),
    calc(var(--cam-y) + var(--py) * var(--layer-depth, 0.35)),
    0
  ) scale(var(--cam-zoom));
  transition: transform 950ms cubic-bezier(0.22, 1, 0.36, 1);
}

.plane-mid {
  pointer-events: none;
  transform: translate3d(
    calc(var(--cam-x) * 1.15 + var(--px) * var(--layer-depth, 0.75)),
    calc(var(--cam-y) * 1.15 + var(--py) * var(--layer-depth, 0.75)),
    0
  ) scale(var(--cam-zoom));
  transition: transform 950ms cubic-bezier(0.22, 1, 0.36, 1);
}

.plane-fg {
  pointer-events: none;
  z-index: 14;
  transform: translate3d(
    calc(var(--px) * var(--layer-depth, 1.25)),
    calc(var(--py) * var(--layer-depth, 1.25)),
    0
  ) scale(1.04);
  transition: transform 280ms ease-out;
}

/* Extra image layers from layers[] (READ 8.1): they fill their plane and take no input. */
.layer-img {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* R4 N1: the creature cutout is dimmed to the plate's own values; in Night and darker only the lamp reveals it
   (the same aperture the atlas creature uses). Gentle keeps it visible, dimmed. No animation, so no override needed. */
.layer-img[data-layer="mid-threat"] {
  filter: brightness(0.5) saturate(0.7);
}
/* R4 N5: only the lair creature hides in the dark. The dead Dodo sits in the lit dawn plate and is never masked away. */
html[data-fright="night"] .layer-img[data-layer="mid-threat"][data-layer-id="dodo-lair"],
html[data-fright="fulldark"] .layer-img[data-layer="mid-threat"][data-layer-id="dodo-lair"],
html[data-fright="nightmare"] .layer-img[data-layer="mid-threat"][data-layer-id="dodo-lair"] {
  -webkit-mask-image: radial-gradient(circle at var(--lamp-x) var(--lamp-y), #000 0, #000 calc(var(--lamp-inner, 360px) * 0.6), transparent var(--lamp-inner, 360px));
  mask-image: radial-gradient(circle at var(--lamp-x) var(--lamp-y), #000 0, #000 calc(var(--lamp-inner, 360px) * 0.6), transparent var(--lamp-inner, 360px));
}

/* The creature atlas (READ 8.2, READ-R18.2): a full-plane wrapper masked by the lamp aperture, so the creature is
   seen only where the lamp falls. The frames are stepped by JS (atlas.js); Reduced Motion, Gentle and
   baby-witch-town hold the still frame there, so there is no CSS animation to override. */
.atlas-creature {
  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle at var(--lamp-x) var(--lamp-y), #000 0, #000 calc(var(--lamp-inner) * 0.6), transparent var(--lamp-inner));
  mask-image: radial-gradient(circle at var(--lamp-x) var(--lamp-y), #000 0, #000 calc(var(--lamp-inner) * 0.6), transparent var(--lamp-inner));
}
.atlas-frame {
  position: absolute;
  inset-inline-start: 50%;
  inset-block-end: 8%;
  block-size: 45%;
  overflow: hidden;
  transform: translateX(-50%);
}
.atlas-sheet {
  display: block;
  max-inline-size: none;
}

/* Canvas effects (READ 8.3, READ-R18.3): fog, flicker, embers and soot on one canvas over the mid plane. Drawn by
   effects.js, which holds one still frame under Reduced Motion, in Gentle and in baby-witch-town; no CSS animation. */
.fx-layer {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
}

/* Looping clips (READ 8.4, READ-R18.4): composited through the lamp mask like the creature. The video loops on its
   own clock, muted; Reduced Motion and Gentle show only the poster image (clips.js), so nothing here animates. */
.clip-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle at var(--lamp-x) var(--lamp-y), #000 0, #000 calc(var(--lamp-inner) * 0.6), transparent var(--lamp-inner));
  mask-image: radial-gradient(circle at var(--lamp-x) var(--lamp-y), #000 0, #000 calc(var(--lamp-inner) * 0.6), transparent var(--lamp-inner));
}
.clip-layer video,
.clip-layer img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.hotspot-plane {
  position: absolute;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}

/* Strict Reduced Motion: freeze camera pan/zoom & 2.5D parallax */
@media (prefers-reduced-motion: reduce) {
  .plane-bg,
  .plane-mid,
  .plane-fg {
    transform: none !important;
    transition: opacity 150ms linear !important;
  }
}

html[data-reduced-motion="true"] .plane-bg,
html[data-reduced-motion="true"] .plane-mid,
html[data-reduced-motion="true"] .plane-fg {
  transform: none !important;
  transition: opacity 150ms linear !important;
}

.stage-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: opacity 480ms ease;
}

.stage-art.is-fading {
  opacity: 0;
}

.mid-svg,
.fg-frame-svg {
  width: 100%;
  height: 100%;
  display: block;
}

#spider-silk-silhouette {
  transform-origin: 612px 0px;
}

@media (prefers-reduced-motion: no-preference) {
  html:not([data-reduced-motion="true"]) #spider-silk-silhouette {
    animation: spiderSway 6.5s ease-in-out infinite;
  }
}

@keyframes spiderSway {
  0%, 100% { transform: rotate(-1.5deg); }
  50% { transform: rotate(1.8deg); }
}

/* Voice-reactive glow pulse on the courtyard earthen lamp */
#svg-door-glow {
  opacity: calc(0.68 + var(--voice-glow) * 0.32);
  transform-origin: 215px 590px;
  transform: scale(calc(1 + var(--voice-glow) * 0.14));
}

/* =========================================================================
   INDEPENDENT MIDGROUND THREAT LAYER (Dodo Silhouette & Unlit Eyes)
   ========================================================================= */
.dodo-threat-plane {
  position: absolute;
  width: clamp(180px, 24vw, 310px);
  aspect-ratio: 1;
  left: 75%;
  top: 24%;
  z-index: 12;
  opacity: 0.25;
  transform: translate3d(-50%, calc(-50% + var(--threat-creep)), 0) scale(0.96);
  transition: opacity 280ms ease, transform 900ms cubic-bezier(0.22, 1, 0.36, 1), filter 280ms ease;
}

.dodo-silhouette-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 22px rgba(0, 0, 0, 0.92));
}

.dodo-eye {
  position: absolute;
  top: 38.5%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff7a45 0%, #c92d1c 68%, transparent 100%);
  box-shadow: 0 0 12px rgba(232, 68, 42, 0.85);
}

.dodo-eye-l { left: 45%; }
.dodo-eye-r { left: 53.5%; }

@media (prefers-reduced-motion: no-preference) {
  html:not([data-reduced-motion="true"]) .dodo-eye {
    animation: eyeBreath 2.6s ease-in-out infinite;
  }
}

@keyframes eyeBreath {
  0%, 100% { opacity: 0.45; transform: scale(0.88); }
  50% { opacity: 1; transform: scale(1.16); }
}

html[data-fright="fulldark"] .dodo-threat-plane[data-lit="false"],
html[data-fright="nightmare"] .dodo-threat-plane[data-lit="false"] {
  opacity: 0.92;
}

html[data-fright="fulldark"] .dodo-threat-plane[data-lit="false"] .dodo-silhouette-svg,
html[data-fright="nightmare"] .dodo-threat-plane[data-lit="false"] .dodo-silhouette-svg {
  opacity: 0.08;
}

.dodo-threat-plane[data-lit="true"] {
  opacity: 1;
  transform: translate3d(-50%, -50%, 0) scale(1.03);
}

.dodo-threat-plane[data-lit="true"] .dodo-silhouette-svg {
  opacity: 0;
  filter: drop-shadow(0 0 26px rgba(130, 180, 217, 0.38));
}

/* R4 N2: the tale's own cutout replaces the mock's ember eyes and silhouette. */
.dodo-threat-plane[data-cutout="true"] .dodo-eye,
.dodo-threat-plane[data-cutout="true"] .dodo-silhouette-svg {
  display: none;
}

/* R-3: Gentle has no glowing red eyes (a creeping threat cue). The silhouette stays, static, so the story still shows it. */
html[data-fright="gentle"] .dodo-eye {
  display: none;
}

/* =========================================================================
   FITILA LIGHTING VEIL & SHADOW CANVAS
   ========================================================================= */
.shadow-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 15;
  pointer-events: none;
}

.fitila-veil {
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--lamp-x) var(--lamp-y),
    rgba(200, 125, 50, calc(0.12 + var(--voice-glow) * 0.07)) 0%,
    rgba(10, 9, 9, 0.14) calc(var(--lamp-inner) * var(--lamp-scale, 1)),
    rgba(8, 6, 5, min(var(--veil-edge), calc(1 - var(--ambient-floor, 0.18)))) calc(var(--lamp-mid) * var(--lamp-scale, 1)),
    rgba(3, 3, 4, calc(1 - var(--ambient-floor, 0.18))) calc(var(--lamp-outer) * var(--lamp-scale, 1))
  );
  transition: background 180ms ease-out;
}

/* FRIGHT-R12.2: the lamp is out. The veil is uniform at the ambient floor, so the plate is never fully black.
   FRIGHT-R12.1, R5.1: Reduced Motion and Gentle keep the full aperture and never show the lamp out. */
html[data-lamp="out"] .fitila-veil {
  background: rgba(3, 3, 4, calc(1 - var(--ambient-floor, 0.18)));
}
html[data-reduced-motion="true"] .fitila-veil,
html[data-fright="gentle"] .fitila-veil {
  --lamp-scale: 1;
}
/* R-7: dawn. The veil thins to a light wash, so the plate reads as morning at every level. */
html[data-dawn-scene] .fitila-veil {
  --ambient-floor: 0.82;
  --lamp-scale: 2;
}

/* Readable chiaroscuro ambient floors by fright level (owner ruling 26 Nov 2026):
   every painting stays visible across the frame without needing to scrub a flashlight; the oil lamp intensifies
   tallow warmth and reveals hidden creature layers. */
html[data-fright="gentle"]:not([data-dawn-scene]) .fitila-veil {
  --ambient-floor: 0.78;
}
html[data-fright="fulldark"]:not([data-dawn-scene]) .fitila-veil {
  --ambient-floor: 0.32;
}
html[data-fright="nightmare"]:not([data-dawn-scene]) .fitila-veil {
  --ambient-floor: 0.24;
}

/* D41 C: lingering pinpoint eyes. Above the veil, decorative, no taps; shown for LINGER_MS (linger-eyes.js), then one fade. */
.linger-eyes {
  position: absolute;
  inset: 0;
  z-index: 19;
  pointer-events: none;
  opacity: 0;
  transition: opacity 600ms ease-out;
}
.linger-eyes[data-linger="true"] {
  opacity: 0.85;
  transition: none;
}
.linger-eye {
  position: absolute;
  top: var(--linger-y, 50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ash);
  box-shadow: 0 0 6px rgba(185, 175, 162, 0.55);
}
.linger-eye-l { left: calc(var(--linger-x, 50%) - 7px); }
.linger-eye-r { left: calc(var(--linger-x, 50%) + 4px); }
html[data-fright="gentle"] .linger-eyes,
html[data-reduced-motion="true"] .linger-eyes {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .linger-eyes {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fitila-veil { --lamp-scale: 1; transition: none; }
}

/* FRIGHT-R10.4 (review SF-D): a peak that made no sound (sound off) shows its non-sound counterpart. "lamp" narrows the
   lamp for a moment; "text" and "still" are carried by the line and the held plate, which need no extra style. Peaks are
   never routed under Reduced Motion or Gentle, so no override is needed beyond the existing lamp-scale ones. */
html[data-counterpart="lamp"]:not([data-reduced-motion="true"]):not([data-fright="gentle"]) .fitila-veil {
  --lamp-scale: 0.7;
}
/* S-3: "text" holds the line as a pale, spaced beat; "still" darkens and holds the plate. Neither moves. */
html[data-counterpart="text"]:not([data-reduced-motion="true"]):not([data-fright="gentle"]) .sub-boko,
html[data-counterpart="text"]:not([data-reduced-motion="true"]):not([data-fright="gentle"]) .sub-en {
  letter-spacing: 0.06em;
  opacity: 0.72;
}
html[data-counterpart="still"]:not([data-reduced-motion="true"]):not([data-fright="gentle"]) .stage-art {
  filter: brightness(0.55);
}

/* FRIGHT-R12.3: a receded word. It stays in the DOM and in the accessibility tree; "Show text" or a tap restores it. */
.word-token[data-dropped="true"] {
  opacity: 0.12;
}
html[data-reduced-motion="true"] .word-token[data-dropped="true"],
html[data-fright="gentle"] .word-token[data-dropped="true"] {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .word-token[data-dropped="true"] { opacity: 1; }
}

html[data-fright="gentle"] {
  --lamp-inner: 340px;
  --lamp-mid: 680px;
  --lamp-outer: 1120px;
  --veil-edge: 0.36;
}

html[data-fright="night"] {
  --lamp-inner: 210px;
  --lamp-mid: 400px;
  --lamp-outer: 720px;
  --veil-edge: 0.72;
}

html[data-fright="fulldark"],
html[data-fright="nightmare"] {
  --lamp-inner: 96px;
  --lamp-mid: 175px;
  --lamp-outer: 270px;
  --veil-edge: 0.975;
}

.stage-cue {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(130, 180, 217, 0.45);
  background: rgba(12, 16, 22, 0.9);
  color: var(--cold);
  font-family: var(--sans);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}

/* =========================================================================
   HOTSPOT PINS (crop-mapped + viewport-clamped)
   ========================================================================= */
.hotspot-pin {
  position: absolute;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-block-size: 44px;
  padding: 4px 11px 4px 8px;
  white-space: nowrap; /* S2-F3: a label is one line in a pill, never a wrapped circle */
  border-radius: 999px;
  border: 1px solid rgba(200, 125, 50, 0.5);
  background: rgba(16, 11, 8, 0.84);
  backdrop-filter: blur(4px);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  /* port: cap the pin so clampPin's post-condition [8, W-8] is reachable on any viewport (TATSU-SI-62). */
  max-inline-size: calc(100% - 16px);
  box-sizing: border-box;
  transform: translate(-50%, -50%);
  transition: opacity 220ms ease, border-color 180ms ease, background-color 180ms ease;
}

.hotspot-pin:hover,
.hotspot-pin[data-lit="true"] {
  border-color: var(--accent);
  background: rgba(28, 19, 13, 0.95);
}

/* The dot is a 44x44 box with a 9 px painted dot inside it; negative margins keep the pin's layout width. */
.hotspot-dot {
  position: relative;
  width: 44px;
  height: 44px;
  margin: -17px;
  flex-shrink: 0;
}

.hotspot-dot::before {
  content: "";
  position: absolute;
  inset: 17.5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(200, 125, 50, 0.85);
}

.hotspot-pin.is-monster {
  border-color: rgba(130, 180, 217, 0.65);
}

.hotspot-pin.is-monster .hotspot-dot::before {
  background: var(--cold);
  box-shadow: 0 0 12px rgba(130, 180, 217, 0.9);
}

/* Hidden in Full Dark until swept under the fitila lamp */
html[data-fright="fulldark"] .hotspot-pin.is-monster[data-lit="false"],
html[data-fright="nightmare"] .hotspot-pin.is-monster[data-lit="false"] {
  opacity: 0;
  pointer-events: none;
}

html[data-fright="fulldark"] .hotspot-pin.is-monster[data-lit="true"],
html[data-fright="nightmare"] .hotspot-pin.is-monster[data-lit="true"] {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 520px) {
  .hotspot-pin {
    font-size: 12px; /* port: raised from 11px (text at least 12 px, SI-34) */
    padding: 4px 9px 4px 7px;
  }
}

/* =========================================================================
   FLOATING 90-SECOND JUDGE GUIDE
   ========================================================================= */
.judge-drawer {
  position: fixed;
  top: 62px;
  right: clamp(10px, 2vw, 24px);
  z-index: 50;
  width: min(390px, calc(100vw - 20px));
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(200, 125, 50, 0.45);
  background: rgba(16, 12, 9, 0.96);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.72);
  font-family: var(--sans);
}

.judge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.judge-head h2 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.judge-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}

.judge-jump {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  line-height: 1.42;
  color: var(--ink);
}

.judge-jump:hover {
  border-color: var(--accent);
  background: rgba(200, 125, 50, 0.1);
}

.judge-jump code {
  font-size: 12px; /* port: was 11px (text at least 12 px) */
  color: var(--accent);
}

/* =========================================================================
   STORY HUD: CAPTIONS + HIKIMA + SINGLE-ROW BOTTOM BAR
   ========================================================================= */
.stage-hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 32;
  padding: 44px clamp(12px, 3vw, 32px) max(10px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(8, 6, 5, 0.96) 0%, rgba(8, 6, 5, 0.86) 58%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.stage-hud > * {
  pointer-events: auto;
}

.hud-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
}

.story-kicker,
.audio-badge {
  margin: 0;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}
/* R-5: the page line sits over a plate, so it takes the full ink colour and a dark halo to hold AA contrast on a pale plate. */
.story-kicker {
  color: var(--ink);
  text-shadow: 0 0 3px rgba(5, 3, 2, 0.95), 0 1px 2px rgba(5, 3, 2, 0.9);
}

.audio-badge {
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(200, 125, 50, 0.3);
  background: rgba(8, 6, 5, 0.82); /* F9: a dark pill so the label holds AA over the brightest plate */
  color: var(--accent);
}

.caption-stack {
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sub-ajami-wrap {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.sub-ajami-img {
  max-height: 44px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid rgba(200, 125, 50, 0.25);
  background: #0d0a08;
}

.sub-ajami-cap {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}

.sub-boko {
  font-family: var(--serif);
  font-size: clamp(21px, 3.2vw, 30px);
  line-height: 1.32;
  color: var(--ink);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}

.sub-word {
  display: inline;
  padding: 1px 2px;
  border-radius: 4px;
  transition: background-color 120ms ease, color 120ms ease;
}

.sub-word.has-note {
  text-decoration: underline dotted rgba(200, 125, 50, 0.58);
  text-underline-offset: 4px;
}

.sub-word.is-spoken {
  background: rgba(200, 125, 50, 0.26);
  color: #fff5df;
}

.sub-word.is-past {
  color: #e8dbc4;
}

.sub-en {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(13.5px, 1.8vw, 15.5px);
  line-height: 1.45;
  color: var(--muted);
}

/* PACK-R3 Exam mode: English blurred and unselectable until Reveal; underlines and the popover cue
   come back on hover, focus or reveal. The Hausa stays readable. Blur is a static state (no motion). */
.sub-en[data-masked="true"],
.hikima-en[data-masked="true"] {
  filter: blur(5px);
  user-select: none;
}
html[data-exam="true"]:not([data-exam-revealed="true"]) .sub-word.has-note {
  text-decoration: none;
}
html[data-exam="true"]:not([data-exam-revealed="true"]) .sub-word.has-note:hover,
html[data-exam="true"]:not([data-exam-revealed="true"]) .sub-word.has-note:focus,
html[data-exam="true"]:not([data-exam-revealed="true"]) .sub-word.has-note:focus-visible {
  text-decoration: underline dotted rgba(200, 125, 50, 0.58);
  text-underline-offset: 4px;
}
[data-exam-reveal][hidden] { display: none; }

.hikima-card {
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  background: rgba(28, 20, 13, 0.9);
  border-radius: 0 10px 10px 0;
}

.hikima-eyebrow {
  margin: 0 0 2px;
  font-family: var(--sans);
  font-size: 12px; /* port: was 11px (text at least 12 px) */
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.hikima-ha {
  margin: 0 0 2px;
  font-size: 16px;
}

.hikima-en {
  margin: 0;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--muted);
}

/* =========================================================================
   SINGLE-ROW BOTTOM CONTROL BAR (fits cleanly down to 360px)
   ========================================================================= */
.bottom-bar {
  max-width: 880px;
  width: 100%;
  margin: 2px auto 0;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.steps-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.steps {
  display: flex;
  align-items: center;
  gap: 0;
}

/* QA fix (docs/evidence/qa/defects.md QA-1): 44x44 hit area, the drawn dot stays small */
.step-dot {
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
}

.step-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(244, 236, 222, 0.25);
  transition: width 220ms ease, background-color 220ms ease;
}

.step-dot.is-fear::before {
  background: rgba(179, 56, 42, 0.65);
}

.step-dot.is-current::before {
  width: 18px;
  background: var(--accent);
}

/* ---------- Interactive Seven Stones Module ---------- */
.stones-bar {
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: rgba(21, 17, 13, 0.88);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.stones-track {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stones-label {
  font-family: var(--sans);
  font-size: 12px; /* port: was 11px (text at least 12 px) */
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ochre);
}

.stones-count {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ochre);
  min-inline-size: 4.2em;
}

.stones-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stone-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--lamp);
  box-shadow: 0 0 8px var(--lamp);
  transition: opacity 220ms ease, transform 220ms ease;
}

.stone-dot.is-used {
  background: transparent;
  border: 1px solid var(--hair);
  box-shadow: none;
  opacity: 0.45;
}

.stones-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stone-throw-btn {
  min-block-size: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--lamp);
  color: var(--soot);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
}

.stone-throw-btn .pill-ha {
  color: rgba(11, 9, 7, 0.75);
}

.stone-skip-btn {
  min-block-size: 44px;
  min-inline-size: 44px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}

.beat-counter {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.player-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.circle-nav {
  min-inline-size: 44px;
  min-block-size: 44px;
  border-radius: 50%;
  border: 1px solid var(--hair);
  background: rgba(22, 16, 12, 0.9);
  font-size: 20px;
  line-height: 1;
}

.circle-play {
  position: relative;
  min-inline-size: 48px;
  min-block-size: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #160f09;
  font-size: 16px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.play-voice-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(200, 125, 50, 0.72);
  opacity: calc(var(--voice-glow) * 0.9);
  transform: scale(calc(1 + var(--voice-glow) * 0.26));
  pointer-events: none;
}

.utility-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bar-btn {
  min-block-size: 44px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: rgba(22, 16, 12, 0.88);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.bar-btn-more {
  min-inline-size: 44px;
  padding: 0 8px;
  font-size: 16px;
}

.bar-ha {
  color: var(--muted);
  font-weight: 400;
}

@media (max-width: 660px) {
  .steps {
    display: none;
  }
}

@media (max-width: 480px) {
  .bottom-bar {
    gap: 4px;
  }
  .bar-btn .bar-ha {
    display: none;
  }
  .bar-btn {
    padding: 0 9px;
    font-size: 12px;
  }
  .player-group {
    gap: 4px;
  }
}

@media (max-width: 380px) {
  .stage-hud {
    padding-left: 6px;
    padding-right: 6px;
  }
  .bottom-bar {
    gap: 2px;
  }
  .beat-counter {
    font-size: 12px; /* port: was 11px (text at least 12 px) */
  }
  .circle-nav,
  .bar-btn-more {
    min-inline-size: 44px;
    min-block-size: 44px;
  }
  .circle-play {
    min-inline-size: 46px;
    min-block-size: 46px;
  }
  .bar-btn {
    min-inline-size: 44px;
    min-block-size: 44px;
    padding: 0 6px;
    font-size: 12px; /* port: was 11px (text at least 12 px) */
  }
  .utility-group,
  .player-group {
    gap: 2px;
  }
}

/* =========================================================================
   POPOVERS (More Overflow + Word / Hotspot Note)
   ========================================================================= */
[popover]:is(:popover-open, .\:popover-open) {
  opacity: 1;
}

.more-popover,
.note-popover {
  margin: 0;
  color: var(--ink);
  background: var(--surface-elev);
  border: 1px solid rgba(200, 125, 50, 0.45);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.78);
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 220ms;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

.more-popover {
  position: fixed;
  inset: auto 12px 72px auto;
  padding: 6px;
  list-style: none;
  width: min(260px, calc(100vw - 24px));
}

.more-item {
  width: 100%;
  min-block-size: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  text-align: left;
  font-family: var(--sans);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.more-item:hover {
  background: rgba(200, 125, 50, 0.14);
}

/* D41: the muted ash (#8a8177) falls under AA on the menu while it fades in (axe, layout-a11y "more"); the Hausa gloss in a menu
   item is told apart by italic, not by a dimmer colour. */
.more-item .pill-ha {
  color: var(--ink);
  font-style: italic;
}

.note-popover {
  position: fixed;
  inset: auto auto 96px 50%;
  transform: translateX(-50%);
  width: min(410px, calc(100vw - 24px));
  padding: 14px;
}

:is(.more-popover, .note-popover):is(:popover-open, .\:popover-open):where(:not([data-closing])) {
  opacity: 1;

  @starting-style {
    opacity: 0;
  }

  @media (prefers-reduced-motion: no-preference) {
    translate: 0 0;

    @starting-style {
      translate: 0 10px;
    }
  }
}

.note-pop-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.note-pop-term {
  font-size: 20px;
  color: var(--accent);
}

.note-pop-pos {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--sans);
  font-size: 12px; /* port: was 11px (text at least 12 px) */
  color: var(--muted);
}

.note-pop-gloss {
  margin: 8px 0 0;
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.48;
}

.note-pop-diff {
  margin: 8px 0 0;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(200, 125, 50, 0.1);
  border: 1px solid rgba(200, 125, 50, 0.25);
  font-family: var(--sans);
  font-size: 12px;
  color: #f3d29b;
}

.note-pop-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pop-action-btn {
  min-block-size: 44px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  font-family: var(--sans);
  font-size: 12px;
}

.pop-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* =========================================================================
   MODALS / NATIVE <dialog> (Top-layer animation + overscroll containment)
   ========================================================================= */
.sheet-dialog {
  margin: auto;
  padding: 0;
  width: min(680px, calc(100vw - 24px));
  max-height: min(88vh, 820px);
  max-height: min(88dvh, 820px);
  overflow-y: auto;
  border: 1px solid var(--ink-line);
  border-radius: 2px;
  background: var(--soot);
  color: var(--ink);
  box-shadow: 0 32px 96px rgba(0, 0, 0, 0.94), 0 0 0 1px rgba(166, 30, 23, 0.18);
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 240ms;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}
.sheet-dialog::before {
  content: "";
  display: block;
  height: 5px;
  background-image:
    repeating-linear-gradient(45deg, var(--ink-line) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(-45deg, var(--blood) 0 1px, transparent 1px 11px);
  opacity: 0.9;
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background-color: rgba(4, 3, 2, 0);
  transition-property: background-color, display, overlay;
  transition-duration: 240ms;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

dialog[open]:where(:not([data-closing])) {
  opacity: 1;

  @starting-style {
    opacity: 0;
  }

  @media (prefers-reduced-motion: no-preference) {
    transform: scale(1);

    @starting-style {
      transform: scale(0.95);
    }
  }

  &::backdrop {
    background-color: rgba(4, 3, 2, 0.86);

    @starting-style {
      background-color: rgba(4, 3, 2, 0);
    }
  }
}

.ritual-dialog[open]::backdrop {
  background-color: rgba(6, 4, 3, 0.99);
}

@media (prefers-reduced-motion: reduce) {
  .sheet-dialog,
  .more-popover,
  .note-popover {
    transition-duration: 100ms;
  }
}

.sheet-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 24px 14px;
  background: var(--soot);
  border-bottom: 1px solid var(--ink-line);
}

.sheet-eyebrow {
  margin: 0 0 3px;
  font-family: var(--display);
  font-size: 12px; /* port: was 11px (text at least 12 px) */
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--blood-text);
}

.sheet-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.icon-close,
.pop-close {
  min-inline-size: 44px;
  min-block-size: 44px;
  border-radius: 2px;
  font-family: var(--display);
  font-size: 26px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border-bottom: 1px solid transparent;
}
.icon-close:hover,
.pop-close:hover {
  color: var(--ink);
  border-bottom-color: var(--blood-text);
}

.sheet-lead {
  margin: 0 0 12px;
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

.ritual-body,
.source-body,
.settings-body,
.share-body,
.packet-body,
.report-body {
  padding: 16px 18px 20px;
}

.ritual-actions,
.share-actions,
.packet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.primary-btn,
.ghost-btn {
  min-block-size: 44px;
  padding: 0 18px;
  border-radius: var(--edge);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.primary-btn {
  background-color: transparent;
  background-image:
    linear-gradient(135deg, transparent 6px, var(--blood) 0),
    linear-gradient(-135deg, transparent 6px, var(--blood) 0),
    linear-gradient(45deg, transparent 6px, var(--blood) 0),
    linear-gradient(-45deg, transparent 6px, var(--blood) 0);
  background-position: top left, top right, bottom left, bottom right;
  background-size: 51% 51%;
  background-repeat: no-repeat;
  color: var(--bone);
}
.primary-btn:hover {
  filter: brightness(1.18);
}

.ghost-btn {
  border: 1px solid var(--ink-line);
  background: var(--soot-2);
  color: var(--ink);
}
.ghost-btn:hover {
  border-color: var(--lamp-hot);
}

/* Source Sheet */
.source-spread {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.scan-leaf {
  margin: 0;
}

.scan-frame {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.scan-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.scan-mark {
  position: absolute;
  border: 2px solid var(--accent);
  background: rgba(200, 125, 50, 0.18);
  border-radius: 4px;
}

.scan-leaf figcaption {
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}

.diff-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-elev);
  border: 1px solid var(--hair);
}

.diff-box h3 {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--accent);
}

.diff-old,
.diff-new,
.diff-note {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.45;
}

.diff-old {
  font-family: var(--sans);
  color: #d6a492;
  font-size: 13px;
}

.diff-note {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}

/* Settings — Blood & Ash Archival Folio (matches shelf SettingsSheet 1:1) */
.set-group {
  margin: 0;
  padding: 18px 0 20px;
  border: 0;
  border-bottom: 1px solid var(--ink-line);
  border-radius: 0;
}
.set-group:last-child {
  border-bottom: 0;
  padding-bottom: 4px;
}

.set-group legend {
  float: left;
  width: 100%;
  padding: 0;
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blood-text);
}
.set-group::after {
  content: "";
  display: table;
  clear: both;
}

.seg-row {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seg-btn {
  min-block-size: 44px;
  min-inline-size: 44px;
  padding: 0 15px;
  border-radius: var(--edge);
  border: 1px solid var(--ink-line);
  background: var(--soot-2);
  color: var(--muted);
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.06em;
}
.seg-btn:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--lamp-hot);
}

.seg-btn.is-active,
.seg-btn[aria-pressed="true"] {
  border-color: var(--blood);
  background-color: transparent;
  background-image:
    linear-gradient(135deg, transparent 5px, var(--blood) 0),
    linear-gradient(-135deg, transparent 5px, var(--blood) 0),
    linear-gradient(45deg, transparent 5px, var(--blood) 0),
    linear-gradient(-45deg, transparent 5px, var(--blood) 0);
  background-position: top left, top right, bottom left, bottom right;
  background-size: 51% 51%;
  background-repeat: no-repeat;
  color: var(--bone);
  font-weight: 600;
}

.check-grid {
  clear: both;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px 16px;
  font-family: var(--serif);
  font-size: 15px;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-block-size: 44px;
  cursor: pointer;
}

/* R-8: the box itself is a 44 px target; styled as an incised obsidian seal with crimson diamond fill. */
.check-grid input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  inline-size: 44px;
  block-size: 44px;
  flex: none;
  margin: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  /* The mark is drawn as backgrounds on the 44 px input (a 20 px box with a 1 px edge), so no
     sub-44 px box exists. */
  background-repeat: no-repeat;
  background-position: center, center;
  background-size: 18px 18px, 20px 20px;
  background-image:
    linear-gradient(var(--soot-2), var(--soot-2)),
    linear-gradient(var(--ink-line), var(--ink-line));
}
/* Checked: filled box plus a diamond (four hard-stop triangles) centred on it. */
.check-grid input[type="checkbox"]:checked {
  background-position:
    calc(50% - 2.5px) calc(50% - 2.5px),
    calc(50% + 2.5px) calc(50% - 2.5px),
    calc(50% - 2.5px) calc(50% + 2.5px),
    calc(50% + 2.5px) calc(50% + 2.5px),
    center, center;
  background-size: 5px 5px, 5px 5px, 5px 5px, 5px 5px, 18px 18px, 20px 20px;
  background-image:
    linear-gradient(to bottom right, transparent 50%, var(--bone) 50%),
    linear-gradient(to bottom left, transparent 50%, var(--bone) 50%),
    linear-gradient(to top right, transparent 50%, var(--bone) 50%),
    linear-gradient(to top left, transparent 50%, var(--bone) 50%),
    linear-gradient(var(--blood), var(--blood)),
    linear-gradient(var(--blood), var(--blood));
}
.check-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* Share Card */
.share-preview-canvas {
  display: block;
  width: min(360px, 100%);
  height: auto;
  margin: 0 auto 14px;
  border-radius: 12px;
  border: 1px solid var(--hair);
}

/* Class Packet & Wordbook */
.wordbook-list {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.wordbook-list li {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface-elev);
  font-family: var(--sans);
  font-size: 12.5px;
}

.packet-table-wrap {
  overflow-x: auto;
}

.packet-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 12.5px;
}

.packet-table th,
.packet-table td {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
  vertical-align: top;
}

.packet-table th {
  color: var(--accent);
}

/* Report Form */
.form-row {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-family: var(--sans);
  font-size: 13px;
}

.form-row select,
.form-row textarea {
  box-sizing: border-box;
  inline-size: 100%;
  min-block-size: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--hair);
  background: var(--surface-elev);
  color: var(--ink);
  font: inherit;
}

.report-status {
  margin: 8px 0 0;
  min-block-size: 1.4em;
  overflow-wrap: anywhere;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--accent);
}

@media print {
  body {
    background: #fff;
    color: #000;
  }
  .site-head,
  .theater-shell,
  .packet-actions,
  .icon-close {
    display: none !important;
  }
  .packet-dialog {
    position: static;
    border: none;
    box-shadow: none;
    max-height: none;
    background: #fff;
    color: #000;
  }
  .packet-table th,
  .packet-table td {
    border-color: #333;
    color: #000;
  }
}

/* =========================================================================
   THRESHOLD GATE (READ 3.1, READ-R4; new id #threshold-gate, D31)
   The stage and #player-bar stay inert and masked until the gate is answered or skipped.
   ========================================================================= */
[data-masked="true"] {
  opacity: 0;
  visibility: hidden;
}

.theater-shell {
  transition: opacity 360ms ease;
}

.threshold-gate {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 80;
  display: grid;
  gap: 14px;
  padding: 24px clamp(18px, 4vw, 32px) calc(24px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(ellipse at 50% 0%, rgba(166, 30, 23, 0.22) 0%, transparent 68%),
    var(--soot);
  border-top: 1px solid var(--ink-line);
  box-shadow: 0 -24px 80px rgba(0, 0, 0, 0.95);
  color: var(--ink);
  font-family: var(--serif);
}
.threshold-gate::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 5px;
  background-image:
    repeating-linear-gradient(45deg, var(--ink-line) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(-45deg, var(--blood) 0 1px, transparent 1px 11px);
  opacity: 0.9;
}

.threshold-gate[hidden] {
  display: none;
}

.gate-prompt {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.gate-title {
  margin: 0;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.gate-title[hidden] {
  display: none;
}

.gate-gloss {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.4;
  color: var(--text, inherit);
}

.gate-help {
  margin: 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

.gate-actions {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.gate-actions > button,
.gate-quiet > button {
  min-block-size: 44px;
  min-inline-size: 44px;
}

.gate-actions > button:focus-visible,
.gate-quiet > button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 29 Nov owner: one call, one reply, two quiet choices on one row; the help line sits last and small. */
.threshold-gate { text-align: center; justify-items: center; }
.gate-notice {
  margin: 0;
  max-width: 34ch;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
}
.gate-notice[hidden] { display: none; }
.threshold-gate .gate-prompt { font-size: clamp(28px, 7vw, 38px); line-height: 1.15; }
.threshold-gate .gate-gloss { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--muted); }
.gate-actions > .primary-btn { min-inline-size: min(100%, 300px); }
.gate-quiet { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; }
.gate-quiet-btn {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--ink-line);
  border-radius: 0;
  padding: 0 2px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: none;
  cursor: pointer;
}
.gate-quiet-btn:hover { color: var(--ink); }
.gate-quiet-btn[hidden] { display: none; }
.threshold-gate .gate-help { font-size: 12px; }

@media (max-width: 520px) {
  .gate-actions > .primary-btn {
    inline-size: 100%;
  }
}

@media (min-width: 900px) {
  .threshold-gate {
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: min(560px, calc(100vw - 32px));
    border: 1px solid var(--ink-line);
    border-radius: var(--edge);
    box-shadow: 0 32px 96px rgba(0, 0, 0, 0.96);
  }
}

/* Source sheet additions (READ 3.5): spread label, page and archive links */
.src-spread-label,
.src-beat-meta {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

.scan-fail {
  margin: 6px 0 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.scan-fail[hidden] {
  display: none;
}

.scan-link {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--accent);
}

.word-token.is-current {
  text-decoration-line: underline;
  text-decoration-style: solid;
}

/* Reduced motion: the gate and the stage reveal change instantly (screens.md S4). */
@media (prefers-reduced-motion: reduce) {
  .theater-shell {
    transition: none;
  }
}

html[data-reduced-motion="true"] .theater-shell {
  transition: none;
}

/* The 2.5D creature canvas (FRIGHT 2.8, monster-25d.js): drawn by JS for a few seconds after a `creature` event. It has
   no CSS animation to override; Reduced Motion and Gentle never draw it (their events are refused). */
.creature-25d {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
}

/* D41 edges: sharp chrome instead of pills (docs/decisions.md D41). Dots, eyes and rings stay round. */
html .head-pill, html .stage-cue, html .judge-drawer, html .judge-jump, html .audio-badge, html .hikima-card,
html .stones-bar, html .stone-throw-btn, html .stone-skip-btn, html .bar-btn, html .more-popover, html .note-popover,
html .more-item, html .pop-action-btn, html .sheet-dialog, html .primary-btn, html .ghost-btn, html .scan-frame,
html .diff-box, html .set-group, html .seg-btn, html .share-preview-canvas, html .wordbook-list li,
html .form-row select, html .form-row textarea, html .threshold-gate { border-radius: var(--edge); }
/* Reader additions on top of the ported mock CSS (READ 5 to 7). Loaded after reader.css.
   Declares no contract token. Every dvh use sits after a vh fallback (scripts/check-viewport-units.mjs).
   Every new animation has a reduced-motion override. */

:root {
  --ambient-floor: 0.42; /* fallback; the engine sets it from config/reader.json `ambientFloor` on mount */
  --chrome-budget: 50vh;
}

/* ---------- Stage touch (READ-R12.4): a finger drag moves the lamp, the browser does not claim it ---------- */
.stage-viewport {
  touch-action: none;
}

/* ---------- Header: compact, labels kept (READ-R15) ---------- */
.site-head {
  min-height: 48px;
}
.brand-sub {
  font-size: 12px;
}
.head-pill {
  font-size: 12px;
}

/* ---------- Lamp hint and the reduced-motion lamp control ---------- */
.drag-hint {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  margin: 0;
  padding: 8px 16px;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(200, 125, 50, 0.55);
  background: rgba(11, 9, 7, 0.9);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  pointer-events: none;
  white-space: nowrap;
}
.light-lamp-btn {
  position: absolute;
  top: 64px;
  /* F5 (d41-reader-r1): right-aligned so it never covers the static "AI-assisted art" label at the top left. */
  inset-inline-end: 8px;
  z-index: 31;
  min-block-size: 44px;
  min-inline-size: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: rgba(11, 9, 7, 0.92);
  font-family: var(--sans);
  font-size: 13px;
  white-space: nowrap;
}

/* FRIGHT-R10.1: the headphones prompt. Static (no animation), two 44 px buttons, never blocks the story. */
.headphones-prompt {
  position: absolute;
  inset-inline: 12px;
  top: 112px;
  z-index: 40;
  margin-inline: auto;
  max-inline-size: 340px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(200, 125, 50, 0.55);
  background: rgba(11, 9, 7, 0.94);
  color: var(--ink);
  font-family: var(--sans);
  text-align: center;
}
.headphones-prompt[hidden] { display: none; }
/* F7 (d41-reader-r1): compact, title and buttons on one row, so the plate keeps at least half the phone height. */
.headphones-prompt:not([hidden]) { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 10px; padding: 4px 10px; }
.headphones-title { margin: 0; font-size: 14px; }
.headphones-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.headphones-actions button { min-block-size: 44px; min-inline-size: 44px; }

/* FRIGHT-R6.3: the one-tap content notice, before the headphones prompt. Static, one 44 px button.
   READ-R19.1 (V-2, V-3): compact, so the plate keeps most of the phone height. Text and button sit on one row, the card
   hugs the top edge, and on wide screens it moves to the top-right corner clear of the kicker and the first Hausa line. */
.content-notice {
  position: absolute;
  inset-inline: 8px;
  top: 56px; /* R-1: below the 48px header, never over "Tatsuniya" or the lamp hint */
  z-index: 41;
  margin-inline: auto;
  max-inline-size: 340px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid rgba(200, 125, 50, 0.55);
  background: rgba(11, 9, 7, 0.96);
  color: var(--ink);
  font-family: var(--sans);
  text-align: start;
}
.content-notice[hidden] { display: none; }
.content-notice-title { margin: 0; font-size: 12px; font-weight: 600; flex: none; }
.content-notice-text { margin: 0; font-size: 12px; line-height: 1.3; flex: 1 1 auto; min-inline-size: 0; }
.content-notice button { flex: none; min-block-size: 44px; min-inline-size: 44px; font-size: 12px; padding: 0 10px; }
.content-notice { flex-wrap: wrap; }
/* R-1: the lamp hint waits until the notice is closed, so the two never overlap. */
:has(> .content-notice:not([hidden])) > .drag-hint { visibility: hidden; }
html:has(#content-notice:not([hidden])) .drag-hint { visibility: hidden; }
.content-notice-title { flex: 1 0 100%; }
@media (min-width: 900px) {
  .content-notice { inset-inline-start: auto; inset-inline-end: 16px; top: 72px; margin-inline: 0; max-inline-size: 300px; }
}

/* ---------- Hotspot labels sit on a chip, lit or unlit (READ-R16.2) ---------- */
.hotspot-pin {
  background: rgba(11, 9, 7, 0.9);
  color: var(--bone);
}

/* ---------- Density (READ-R11). Only in listening and immersive; reading, Gentle and reduced motion are plain. ---------- */
.story-kicker,
.mode-chip {
  background: none;
  cursor: pointer;
  text-align: left;
}
.draft-badge {
  flex: none;
  font-family: var(--sans);
  font-size: 12px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: rgba(8, 6, 5, 0.82); /* F9 */
  color: var(--accent);
  white-space: nowrap;
}
.mode-chip {
  margin: 0;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(200, 125, 50, 0.3);
  background: rgba(8, 6, 5, 0.82); /* F9 */
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
}
.density-btn {
  min-block-size: 44px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: rgba(22, 16, 12, 0.88);
  font-family: var(--sans);
  font-size: 12px;
  white-space: nowrap;
}
.caption-tools {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  flex: none;
}
.tool-btn {
  min-block-size: 44px;
  min-inline-size: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: rgba(22, 16, 12, 0.88);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.tool-btn-accent {
  border-color: rgba(200, 125, 50, 0.58);
  color: var(--accent);
}
.seg-reason {
  margin: 8px 0 0;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--bone-dim);
}
.seg-btn:disabled {
  opacity: 0.6;
  text-decoration: line-through;
}
.seg-row .seg-btn {
  min-block-size: 44px;
}

html[data-density="listening"] .sub-word[data-revealed="false"],
html[data-density="immersive"] .sub-word[data-revealed="false"] {
  opacity: 0.22;
}
html[data-density="immersive"] .sub-word[data-revealed="false"] {
  opacity: 0;
}
html[data-density="listening"] .sub-word[data-revealed="true"],
html[data-density="immersive"] .sub-word[data-revealed="true"] {
  opacity: 1;
}
@media (prefers-reduced-motion: no-preference) {
  html[data-density="listening"] .sub-word,
  html[data-density="immersive"] .sub-word {
    transition: opacity 260ms ease;
  }
}

/* ---------- Long beats: the text block sits below the header and scrolls inside (READ-R17.1) ---------- */
.stage-hud {
  max-height: calc(100vh - 56px);
  max-height: calc(100dvh - 56px);
}
.sub-boko-wrap {
  max-height: 45vh;
  max-height: 45dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.caption-stack {
  min-height: 0;
}

/* ---------- Overflow menu: placed by placeMenu() (READ-R17.2) ---------- */
.more-popover {
  overflow-y: auto;
  overscroll-behavior: contain;
}
.more-phone-only {
  display: none;
}

/* ---------- The phone screen is not too full (READ-R19) ---------- */
@media (max-width: 480px) {
  .site-head {
    min-height: 48px;
    height: 48px;
    padding: 2px 10px;
  }
  .brand {
    flex-direction: row;
    align-items: baseline;
  }
  .brand-sub {
    display: none;
  }
  html[data-prov-open="true"] .brand-sub {
    display: block;
    position: fixed;
    top: calc(48px + var(--prov-h, 44px));
    left: 0;
    right: 0;
    z-index: 41;
    padding: 8px 12px;
    background: rgba(11, 9, 7, 0.97);
    border-bottom: 1px solid var(--hair);
    font-size: 12px;
  }
  #btn-judge-tour {
    display: none;
  }
  .head-pill {
    min-block-size: 44px;
    padding: 0 10px;
    font-size: 12px;
  }
  .head-pill .pill-ha {
    display: inline;
  }

  .stage-hud {
    padding: 0 8px max(6px, env(safe-area-inset-bottom));
    gap: 6px;
    background: linear-gradient(to top, rgba(8, 6, 5, 0.94) 0%, rgba(8, 6, 5, 0.7) 70%, transparent 100%);
  }
  .hud-meta {
    height: 28px;
    flex-wrap: nowrap;
    overflow: hidden;
    gap: 6px;
  }
  .story-kicker {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    cursor: pointer;
  }
  .mode-chip,
  .audio-badge {
    flex: none;
    font-size: 12px;
    padding: 1px 7px;
    line-height: 22px;
  }
  /* BL-1: the voice label is an honesty label; it is never cut off. The provenance line gives way instead. */
  .audio-badge {
    flex: none;
    white-space: nowrap;
    padding: 1px 5px;
  }
  .mode-chip {
    padding: 1px 5px;
  }
  .density-btn {
    display: none;
  }

  /* The chrome budget: header 48 + meta 28 + player bar 56 + the caption stack stay within half the viewport. */
  .caption-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: calc(50vh - 164px);
    max-height: calc(50dvh - 164px);
    margin-bottom: 0;
  }
  html[data-stones="true"] .caption-stack {
    max-height: calc(50vh - 216px);
    max-height: calc(50dvh - 216px);
  }
  /* R5 N6: when the N4 caps leave the Hausa block shorter than its text, it scrolls and an amber fade marks the hidden edge
     (scroll-shadow: the "local" covers hide the cue when there is nothing more to scroll). No min-height: at 360x640 a floor pushed the tools under the player bar. */
  .sub-boko-wrap {
    flex: 0 1 auto;
    min-height: 0;
    max-height: none;
    background:
      linear-gradient(to bottom, rgba(8, 6, 5, 0.94), rgba(8, 6, 5, 0.94)) local,
      linear-gradient(to top, rgba(8, 6, 5, 0.94), rgba(8, 6, 5, 0.94)) local,
      linear-gradient(to bottom, rgba(232, 196, 120, 0.45), rgba(0, 0, 0, 0)) scroll,
      linear-gradient(to top, rgba(232, 196, 120, 0.45), rgba(0, 0, 0, 0)) scroll;
    background-size: 100% 24px, 100% 24px, 100% 24px, 100% 24px;
    background-position: top, bottom, top, bottom;
    background-repeat: no-repeat;
    background-attachment: local, local, scroll, scroll;
  }
  .sub-boko {
    font-size: 19px;
    line-height: 1.3;
  }
  .sub-en {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
  /* V-8: the moral is never clipped mid-line; the Hausa caption above it scrolls instead. */
  .hikima-card {
    flex: 0 0 auto;
    overflow: visible;
  }
  .hikima-card {
    padding: 6px 10px;
  }
  .hikima-ha {
    font-size: 14px;
  }

  .caption-tools {
    flex-wrap: nowrap;
    gap: 4px;
  }
  .caption-tools .tool-btn {
    flex: 1 1 auto;
    min-inline-size: 44px;
    padding: 0 8px;
  }
  /* R4 N4 (READ-R19.1): Listening and Immersive owe the plate at least half the phone screen. */
  html[data-density="listening"] .caption-stack,
  html[data-density="immersive"] .caption-stack {
    max-height: calc(50vh - 240px);
    max-height: calc(50dvh - 240px);
  }
  html[data-stones="true"][data-density="listening"] .caption-stack,
  html[data-stones="true"][data-density="immersive"] .caption-stack {
    max-height: calc(50vh - 290px);
    max-height: calc(50dvh - 290px);
  }

  /* English is collapsed behind "Show English": clipped, not removed, so assistive technology still reads it. */
  html:not([data-en-open="true"]) .sub-en {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  /* While the More sheet is open the text block collapses the same way, so the sheet and the text never share the budget. */
  html[data-sheet-open="true"] .sub-boko-wrap,
  html[data-sheet-open="true"] .sub-en,
  html[data-sheet-open="true"] .hikima-card {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .bottom-bar {
    margin: 0 auto;
    padding-top: 6px;
    height: 56px;
    flex-wrap: nowrap;
    justify-content: space-between;
  }
  .steps-group {
    flex: none;
  }
  /* Ruling 2 (27 Nov): Source stays on the phone bar; Settings moves to the More sheet. */
  .utility-group .bar-btn:not(.bar-btn-more):not(#btn-source) {
    display: none;
  }
  .more-popover li:has(> #act-source) {
    display: none;
  }
  #btn-source .bar-ha {
    display: none;
  }
  .bar-btn-more {
    min-inline-size: 44px;
    min-block-size: 44px;
  }
  .more-phone-only {
    display: list-item;
  }

  .stones-bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 2px 4px;
    min-height: 48px;
    flex-wrap: nowrap;
  }
  .stones-bar .stones-label,
  .stones-bar .pill-ha {
    display: none;
  }
  .stones-actions {
    display: flex;
    gap: 6px;
    flex: 1 1 auto;
  }
  .stone-throw-btn,
  .stone-skip-btn {
    min-block-size: 44px;
    min-inline-size: 44px;
    padding: 0 10px;
    font-size: 12px;
    flex: 1 1 auto;
  }
  /* F2: eight items in two columns of 44 px rows fit the budget, so nothing hides under a scroll nobody can see. */
  .more-popover {
    width: calc(100vw - 16px); /* S2-F6: edge to edge on a phone, so nothing behind the menu shows at its left */
    right: 8px;
    box-sizing: border-box;
    max-height: calc(50vh - 136px);
    max-height: calc(50dvh - 136px);
    display: none;
  }
  .more-popover:is(:popover-open, .\:popover-open) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
  }
  .more-popover > li {
    display: block;
    min-width: 0;
  }
  .more-popover .more-item {
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.2;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-content: center;
    gap: 0 4px;
  }

  /* F1: an open sheet keeps the plate its share: it sits above the player bar, within the same budget as the More sheet,
     and scrolls inside (the head stays sticky, so the 44 px close button is always there). */
  /* S2-F2 reverses the half-screen cap for Source and Settings: they are modal, the plate is behind the backdrop, and the
     scan and the Reduced Motion switch must be reachable without a 265 px keyhole. */
  .sheet-dialog {
    margin: auto auto 56px;
    max-height: calc(100vh - 56px - 64px);
    max-height: calc(100dvh - 56px - 64px);
  }

  /* F4: the meta line gives way before the voice label does; nothing runs past the right edge. */
  .prov-wrap {
    min-width: 0;
  }
  .hud-meta {
    gap: 4px;
  }
  .draft-badge {
    padding: 1px 5px;
  }
  /* Compact the three labels so the draft, level and voice labels (including "synthetic voice (AI)") share one row
     at 360: the voice label stays whole, only its padding and the gap give. */
  .hud-meta { gap: 3px; }
  .hud-meta .draft-badge, .hud-meta .mode-chip, .hud-meta .audio-badge { padding-inline: 3px; }
}

/* F5: a not-yet-revealed word in listening density stays readable (4.5:1); immersive still hides it on purpose. */
html[data-density="listening"] .sub-word[data-revealed="false"] {
  opacity: 0.62;
}

/* F6: English is collapsed, clipped not removed, whenever the reader's toggle says so at any width; the wide default is "open" (engine.js). */
html:not([data-en-open="true"]) .sub-en {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* F7 / S2-F4: at every level a label outside the lamp is as legible as one inside it (opaque dark ground, 4.5:1 text). */
.hotspot-pin,
html[data-fright="fulldark"] .hotspot-pin,
html[data-fright="nightmare"] .hotspot-pin {
  background: rgba(11, 9, 7, 0.96);
  color: #fff5df;
  border-color: var(--accent);
}
.hotspot-pin > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* F8: the archive links keep room under them inside the scrolling Source sheet. */
.source-body {
  padding-bottom: 56px; /* S2-F5: clear of the dialog's rounded bottom edge */
  padding-inline: 22px;
}
.scan-leaf .scan-link {
  margin-bottom: 4px;
}

/* ---------- Nightmare (tsoro) reuses the Full Dark tokens and adds none. ---------- */

/* ---------- Reduced motion: no drift, no sweep, no pulse (READ-R12.5, READ-R11.7) ---------- */
@media (prefers-reduced-motion: reduce) {
  .drag-hint {
    display: none;
  }
  .sub-word {
    transition: none !important;
  }
}
html[data-reduced-motion="true"] .drag-hint {
  display: none;
}
html[data-reduced-motion="true"] .sub-word {
  transition: none !important;
}

/* ---------- No Popover API: the sheet is a class toggle, display: none until opened (READ-R14, BL2) ---------- */
html[data-no-popover="true"] .more-popover {
  display: none;
}
html[data-no-popover="true"] .more-popover.\:popover-open {
  display: block;
  opacity: 1;
}

/* ---------- Phone provenance: one truncated line, a 44 px toggle over it; a tap opens the full line (READ-R19.3, BL1) ---------- */
.prov-wrap {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
}
.prov-toggle {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
@media (max-width: 480px) {
  /* F7 (d41-reader-r2): the prompt moves up to the lamp-hint row (64 px, under the header) instead of 112 px down the plate;
     "Drag the lamp" drops below it while it is open, and "Light the lamp" stays above it. */
  .headphones-prompt { top: 64px; padding: 2px 8px; border-radius: 4px; }
  /* READ-R19.1: the title on one line, both buttons side by side under it, so the prompt is two rows, not three. */
  .headphones-prompt:not([hidden]) { row-gap: 0; }
  .headphones-actions { flex-wrap: nowrap; gap: 6px; }
  .headphones-actions button { padding-inline: 12px; white-space: nowrap; }
  .drag-hint.is-below-prompt { top: 116px; }
  html[data-lamp="out"] .headphones-prompt { top: 116px; } /* the lamp is out: "Light the lamp" keeps the 64 px row */
  .light-lamp-btn { z-index: 45; }
  .hud-meta {
    overflow: visible;
    align-items: center;
  }
  /* S2-F1: the credit chip takes a row of its own, so the collector's name and the page are never cut to "Tre…";
     the voice and draft labels share the row under it. */
  .hud-meta {
    height: auto;
    min-height: 28px;
    flex-wrap: wrap;
    row-gap: 2px;
  }
  .prov-wrap {
    height: 24px;
    flex: 1 0 100%;
  }
  .kick-extra {
    display: none;
    pointer-events: none;
  }
  html[data-prov-open="true"] .kick-extra {
    display: inline;
  }
  .story-kicker {
    height: 24px;
    line-height: 24px;
    cursor: default;
  }
  .prov-toggle {
    display: block;
    inset: -20px 0 0; /* S2-F1: 44 px up from the credit row; the mode chip takes its 44 px downward */
    width: auto;
    min-width: 44px;
    min-height: 44px;
  }
  html[data-prov-open="true"] .story-kicker {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    z-index: 41;
    height: auto;
    min-height: 44px;
    line-height: 1.4;
    padding: 8px 12px;
    white-space: normal;
    overflow: visible;
    background: rgba(11, 9, 7, 0.97);
    border-bottom: 1px solid var(--hair);
    color: var(--ink);
  }
}

/* BL-B: the mode chip is a 44 px target through a taller hit area, as the provenance toggle does (READ-R19.5). */
.mode-chip {
  position: relative;
}
.mode-chip::after {
  content: "";
  position: absolute;
  inset: -14px 0;
}

/* S2-F1: the mode chip's hit area reaches down into the player bar's padding; the bar's own buttons stay on top. */
.bottom-bar .bar-btn {
  position: relative;
  z-index: 1;
}

/* V-5b (visual review auta-dodo-reader): the level labels carry Hausa hooked letters (sauƙi). The sans stack has no
   self-hosted face, so a system font may drop or blur the ƙ. The labels use the self-hosted Gentium Plus (its latin-ext
   faces cover the eight hooked letters, scripts/tests/font-glyphs.test.mjs). */
.mode-chip,
#settings-dialog [data-set-fright] {
  font-family: "Gentium Plus", Georgia, serif;
}

/* ---------- H-1: the AI-assisted art label on every plate. Static: nothing to override under Reduced Motion. ---------- */
.plate-label {
  position: absolute;
  top: 60px;
  inset-inline-start: 8px;
  z-index: 31;
  margin: 0;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(200, 125, 50, 0.4);
  background: rgba(11, 9, 7, 0.82);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 16px;
  pointer-events: none;
}

/* R-1 (READ-R19.1): the notice is a two-column card: title and notes on the left, one 44 px button on the right. */
.content-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  row-gap: 0;
  box-sizing: border-box;
  padding: 4px 8px;
}
.content-notice-title { grid-column: 1; flex: none; }
.content-notice-text { grid-column: 1; }
.content-notice button { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
/* R4 F2 (READ-R19.2, R19.5): on phones the notice is in the flow of the HUD column, between the meta row and the
   captions, so it reserves its own height and covers no text or control (the absolute card clipped the last Hausa line,
   hid "Show English" and "Back to shelf"). The HUD scrolls its own text if the card makes it tall. */
@media (max-width: 899px) {
  .content-notice { position: static; inset-inline: auto; margin-inline: 0; max-inline-size: none; flex: none; }
}
.plate-label[hidden] { display: none; }
@media (min-width: 900px) {
  .content-notice { position: fixed; top: 72px; }
  .plate-label { top: 60px; inset-inline-start: 16px; }
}

/* N-1: sixteen 44 px step targets are 704 px wide, so the 880 px bar pushed "More" past the right edge at 1440.
   On wide screens the bar is wide enough for them; narrower widths keep the dots hidden or the phone layout. */
@media (max-width: 1279px) {
  .steps { display: none; }
}
@media (min-width: 1280px) {
  .bottom-bar { max-width: 1240px; }
  .steps-group { flex: 1 1 0; min-inline-size: 0; }
  /* F4 (d41-reader-r1): 45-50 dots are wider than the group; they scroll inside it instead of running under the player. */
  .steps { flex: 1 1 0; min-inline-size: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
  .step-dot { flex: none; }
  .beat-counter { flex: none; }
  .player-group, .utility-group { flex: none; }
}

/* R-6: the end-of-telling link is an anchor styled as a tool button. */
a.tool-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
a.tool-btn[hidden] { display: none; }

/* R-5: the source line sits on a dark chip so it reads over the bright court plate at every level. */
.story-kicker {
  background: rgba(8, 6, 5, 0.78);
  color: var(--bone, #f4ecde);
  border-radius: 8px;
  padding: 2px 6px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

/* D41 edges: sharp chrome instead of pills (docs/decisions.md D41). */
html .drag-hint, html .light-lamp-btn, html .headphones-prompt, html .content-notice, html .draft-badge,
html .mode-chip, html .density-btn, html .tool-btn, html .plate-label { border-radius: var(--edge); }

/* Owner, 29 Nov 2026: quiet reader chrome. The badges, toggles, bottom bar and More menu lose their boxes and pills.
   Chips keep a dark strip behind the text (R-5: contrast over the brightest plate); only the boxes go. */
html .hud-meta { background: rgba(8, 6, 5, 0.78); }
html .draft-badge, html .mode-chip, html .density-btn, html .audio-badge {
  border: 0; border-radius: 0; background: none; padding-inline: 8px;
  font-size: 12px; color: var(--ink);
}
html .draft-badge { color: var(--accent); }
html .draft-badge ~ .mode-chip, html .mode-chip ~ .density-btn, html .density-btn ~ .audio-badge { border-inline-start: 1px solid var(--ink-line); }
html .tool-btn {
  border: 0; border-radius: 0; background: none; padding-inline: 10px;
  font-size: 13px; text-decoration: underline; text-decoration-color: var(--ink-line); text-underline-offset: 5px;
}
html .tool-btn:hover { text-decoration-color: var(--accent); }
html .tool-btn-accent { text-decoration-color: var(--accent); color: var(--accent); }
html .bottom-bar .bar-btn { border: 0; border-radius: 0; background: none; padding-inline: 10px; }
html .bottom-bar .bar-btn:hover { color: var(--accent); }
html .bottom-bar .circle-nav { border: 0; border-radius: 0; background: none; font-size: 30px; color: var(--ink); }
html .bottom-bar .circle-nav:hover { color: var(--accent); }

html .more-popover { border: 1px solid var(--ink-line); border-radius: 2px; background: var(--soot); padding: 0; }
html .more-popover li { display: block; }
html .more-item { border: 0; border-bottom: 1px solid var(--ink-line); border-radius: 0; background: none; padding: 8px 16px; font-size: 14px; }
html .more-popover li:last-child .more-item { border-bottom: 0; }
html .more-item:hover { background: none; color: var(--accent); }
html .more-item .pill-ha { font-size: 12px; font-style: italic; color: var(--bone-dim); }
/* On phones the More sheet is one plain column too (owner, 1 Dec 2026): seven 44 px rows, as tall as they need, no scroll (F2). */
@media (min-width: 481px) {
  html .more-popover { width: min(248px, calc(100vw - 24px)); } /* clear of the Hausa line's right end at 1440 (PACK-R6.4) */
  html .more-popover li.more-phone-only { display: none; } /* the bar and header carry Source, Settings and the tour */
}
@media (max-width: 480px) {
  html .more-popover { width: calc(100vw - 16px); max-height: none; }
  html .more-popover:is(:popover-open, .\:popover-open) { display: block; gap: 0; }
  html .more-popover .more-item { border-bottom: 1px solid var(--ink-line); min-block-size: 44px; box-sizing: border-box; font-size: 14px; padding-block: 0; }
}

/* Owner, 1 Dec 2026: the headphones prompt loses its boxes. A dark strip with the title and two text choices;
   "Sound on" is the accent link, as "Go darker" is. */
html .headphones-prompt { border: 0; border-radius: 0; background: rgba(8, 6, 5, 0.82); }
html .headphones-actions .primary-btn, html .headphones-actions .ghost-btn {
  border: 0; border-radius: 0; background: none; background-image: none;
  font-family: var(--sans); font-size: 14px; font-weight: 400; letter-spacing: 0; text-transform: none;
  text-decoration: underline; text-decoration-color: var(--ink-line); text-underline-offset: 5px;
  color: var(--ink); padding-inline: 12px;
}
html .headphones-actions .primary-btn { color: var(--accent); text-decoration-color: var(--accent); }
html .headphones-actions button:hover { text-decoration-color: var(--accent); filter: none; }

/* Owner, 1 Dec 2026: the reading screen is the plate, the text and the player bar. The provenance line and the draft,
   level and voice labels move to Source; Show text, Show English and Go darker move to More ("Back to shelf" stays, UI-5). */
html .stage-hud .hud-meta { display: none; }
html #btn-show-english, html #btn-show-text, html #btn-go-darker { display: none; }
/* Owner, 1 Dec 2026: in Immersive the line is hidden until it is spoken, so "Show text" stays on screen there (READ-R11.5). */
html[data-density="immersive"] #btn-show-text:not([hidden]) { display: inline-flex; }
/* Owner, 1 Dec 2026: no credit line in the header; Text density is in More at every width (its chip left the screen). */
html #brand-sub { display: none; }
html .more-popover li:has(> #act-density) { display: block; }
/* Print view of the class packet. PACK 1.3. Requirements PACK-R2.1 to PACK-R2.3. Property PACK-P5.
   Black on white, no stage, no player bar, no control; rows stay whole, the header repeats, the margin is 18 mm
   (the floor is 15 mm) on A4 and Letter. Declares no token and no animation, so it needs no motion override. */
@page {
  margin: 18mm;
}

@media print {
  html,
  body {
    background: #fff !important;
    color: #000 !important;
    -webkit-print-color-adjust: economy;
    print-color-adjust: economy;
  }

  /* The stage, the player bar, the header and every control are not printed. */
  .site-head,
  .theater-shell,
  #theater-shell,
  #stage,
  #player-bar,
  #threshold-gate,
  .packet-actions,
  .icon-close,
  .sheet-head button,
  audio,
  video,
  canvas,
  button,
  nav,
  [popover] {
    display: none !important;
  }

  .packet-dialog,
  .packet-body,
  .packet-table-wrap,
  .packet-print {
    position: static !important;
    display: block;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    background: #fff !important;
    color: #000 !important;
    filter: none;
  }

  /* The real dialog also carries .sheet-dialog (soot background, bone text); force black on white over it. */
  #packet-dialog,
  #packet-dialog.sheet-dialog,
  #packet-dialog .packet-print,
  #packet-dialog .packet-print * {
    background-color: #fff !important;
    color: #000 !important;
  }

  .packet-print,
  .packet-print * {
    /* Gentium Plus carries the hooked letters (ɓ ɗ ƙ ƴ). 11 pt is about 14.7 px, above the 12 px floor. */
    font-family: "Gentium Plus", "Gentium Book Plus", Georgia, serif;
    text-shadow: none;
    animation: none;
    transition: none;
  }

  .packet-print {
    font-size: 11pt;
    line-height: 1.4;
  }

  .packet-print h1 {
    font-size: 16pt;
    margin: 0 0 4pt;
  }

  .packet-print h2 {
    font-size: 13pt;
    margin: 14pt 0 4pt;
    break-after: avoid;
  }

  .packet-label {
    font-weight: 700;
    margin: 0 0 6pt;
  }

  .packet-credit,
  .packet-note {
    font-size: 10.5pt;
    margin: 0 0 3pt;
  }

  .packet-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 8pt 0;
    background: #fff;
  }

  .packet-table caption {
    text-align: left;
    font-weight: 700;
    margin-bottom: 3pt;
    color: #000;
    break-after: avoid;
  }

  .packet-table thead {
    display: table-header-group;
  }

  .packet-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .packet-table th,
  .packet-table td {
    border: 0.75pt solid #333;
    padding: 3pt 4pt;
    vertical-align: top;
    text-align: left;
    color: #000;
    background: transparent;
    font-size: 11pt;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .packet-table th {
    font-weight: 700;
  }

  .packet-table th:first-child,
  .packet-table td:first-child {
    width: 9%;
  }
}
/* Settings sheet and pack controls — Blood & Ash Archival Folio (D41).
   Ported selectors (.sheet-dialog, .set-group, .seg-row, .seg-btn, .check-grid).
   Uses ONLY mock :root tokens (LIB-P24) + sharp 2px edges (BloodAshPaletteTest). Controls >= 44x44, text >= 12px. */

/* Modal dialog: deep obsidian folio slab with eroded crimson-ash top relief */
.sheet-dialog {
  margin: auto;
  padding: 0;
  width: min(680px, calc(100vw - 24px));
  max-height: min(88vh, 820px);
  overflow-y: auto;
  border: 1px solid var(--ink-line);
  border-radius: 2px;
  background: var(--soot);
  color: var(--bone);
  box-shadow: 0 32px 96px rgba(0, 0, 0, 0.94), 0 0 0 1px rgba(166, 30, 23, 0.18);
  font-family: "Gentium Plus", Georgia, serif;
  overscroll-behavior: contain;
}
.sheet-dialog::before {
  content: "";
  display: block;
  height: 5px;
  background-image:
    repeating-linear-gradient(45deg, var(--ink-line) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(-45deg, var(--danger) 0 1px, transparent 1px 11px);
  opacity: 0.9;
}
.sheet-dialog::backdrop {
  background: rgba(3, 3, 4, 0.88);
  backdrop-filter: blur(5px);
}

/* Sticky masthead inside the settings ledger */
.sheet-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 24px 14px;
  background: var(--soot);
  border-bottom: 1px solid var(--ink-line);
}
.sheet-head h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone);
}
.icon-close {
  min-width: 44px;
  min-height: 44px;
  border-radius: 2px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--bone-dim);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: color 160ms ease, border-color 160ms ease;
}
.icon-close:hover {
  color: var(--bone);
  border-bottom-color: #e0584c;
}

/* Ledger body: borderless ruled chapters (NO ugly HTML <fieldset> boxes) */
.settings-body {
  padding: 8px 24px 28px;
}
.set-group {
  margin: 0;
  padding: 20px 0 22px;
  border: 0;
  border-bottom: 1px solid var(--ink-line);
  border-radius: 0;
}
.set-group:last-child {
  border-bottom: 0;
  padding-bottom: 4px;
}
.set-group legend {
  float: left;
  width: 100%;
  padding: 0;
  margin: 0 0 12px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #e0584c;
}
.set-group::after {
  content: "";
  display: table;
  clear: both;
}

/* Segmented choices: dark ash incised tabs; chipped arterial crimson when active (NO flat orange pills) */
.seg-row {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.seg-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border-radius: 2px;
  border: 1px solid var(--ink-line);
  background: var(--soot-2);
  color: var(--bone-dim);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, filter 160ms ease;
}
.seg-btn:hover:not(:disabled) {
  color: var(--bone);
  border-color: var(--lamp-hot);
}
.seg-btn.is-active,
.seg-btn[aria-pressed="true"] {
  border-color: var(--danger);
  background-color: transparent;
  background-image:
    linear-gradient(135deg, transparent 5px, var(--danger) 0),
    linear-gradient(-135deg, transparent 5px, var(--danger) 0),
    linear-gradient(45deg, transparent 5px, var(--danger) 0),
    linear-gradient(-45deg, transparent 5px, var(--danger) 0);
  background-position: top left, top right, bottom left, bottom right;
  background-size: 51% 51%;
  background-repeat: no-repeat;
  color: var(--bone);
  font-weight: 600;
}
.seg-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-style: dashed;
}
.set-reason {
  clear: both;
  margin: 10px 0 0;
  color: var(--bone-dim);
  font-style: italic;
  font-size: 0.875rem;
}

/* Checkboxes: 44x44 touch target with incised dark wax-seal square + crimson diamond fill */
.check-grid {
  clear: both;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px 16px;
  font-size: 0.9375rem;
}
.check-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--bone);
  cursor: pointer;
}
.check-grid input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  flex: none;
  margin: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  /* The mark is drawn as backgrounds on the 44 px input (a 20 px box with a 1 px edge), so no
     sub-44 px box exists. */
  background-repeat: no-repeat;
  background-position: center, center;
  background-size: 18px 18px, 20px 20px;
  background-image:
    linear-gradient(var(--soot-2), var(--soot-2)),
    linear-gradient(var(--ink-line), var(--ink-line));
}
.check-grid input[type="checkbox"]:hover {
  background-image:
    linear-gradient(var(--soot-2), var(--soot-2)),
    linear-gradient(var(--lamp-hot), var(--lamp-hot));
}
/* Checked: filled box plus a 5 px-per-quadrant diamond (four hard-stop triangles) centred on it. */
.check-grid input[type="checkbox"]:checked {
  background-position:
    calc(50% - 2.5px) calc(50% - 2.5px),
    calc(50% + 2.5px) calc(50% - 2.5px),
    calc(50% - 2.5px) calc(50% + 2.5px),
    calc(50% + 2.5px) calc(50% + 2.5px),
    center, center;
  background-size: 5px 5px, 5px 5px, 5px 5px, 5px 5px, 18px 18px, 20px 20px;
  background-image:
    linear-gradient(to bottom right, transparent 50%, var(--bone) 50%),
    linear-gradient(to bottom left, transparent 50%, var(--bone) 50%),
    linear-gradient(to top right, transparent 50%, var(--bone) 50%),
    linear-gradient(to top left, transparent 50%, var(--bone) 50%),
    linear-gradient(var(--danger), var(--danger)),
    linear-gradient(var(--danger), var(--danger));
}

.seg-btn:focus-visible,
.icon-close:focus-visible,
.check-grid input:focus-visible,
.pack-btn:focus-visible {
  outline: 2px solid var(--lamp-hot);
  outline-offset: 2px;
}

.shelf-pill-btn {
  background: transparent;
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
}
.shelf-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Pack controls: quiet archival margin metadata + borderless underlined action (NO boxy admin pills) */
.pack-controls {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 0;
}
.pack-state {
  font-size: 0.875rem;
  font-style: italic;
  color: var(--bone-dim);
  border: 0;
  padding: 0;
}
.pack-state.is-ready {
  color: var(--lamp-hot);
  font-style: normal;
}
.pack-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 4px;
  border-radius: 2px;
  border: 0;
  border-bottom: 1px solid var(--ink-line);
  background: transparent;
  color: var(--bone-dim);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.9375rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}
.pack-btn:hover {
  color: var(--bone);
  border-bottom-color: var(--lamp-hot);
}
.pack-btn[aria-busy="true"] {
  opacity: 0.65;
}
.pack-ask {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  flex-basis: 100%;
}
.pack-note {
  flex-basis: 100%;
  margin: 0;
  color: var(--bone-dim);
  font-size: 0.875rem;
}

/* Reduced motion: zero transition on dialog */
@media (prefers-reduced-motion: reduce) {
  .sheet-dialog,
  .sheet-dialog::backdrop,
  .seg-btn,
  .icon-close,
  .pack-btn {
    transition: none !important;
    animation: none !important;
  }
}

/* LIB 4.4 review F-3: the Not downloaded notice (UI-10: 44 px targets from the first write). */
#reader-not-downloaded { max-width: 32rem; margin: 0 auto; padding: 24px 16px; color: var(--bone); }
#reader-not-downloaded h1 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.75rem; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 12px; }
#reader-not-downloaded p { font-size: 1rem; line-height: 1.5; margin: 0 0 16px; }
#reader-not-downloaded a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 8px; color: var(--lamp-hot); }
#reader-not-downloaded a:focus-visible { outline: 2px solid var(--lamp-hot); outline-offset: 2px; }

/* D41 edges: sharp chrome instead of pills (docs/decisions.md D41). */
html .sheet-dialog, html .set-group, html .seg-btn, html .pack-btn { border-radius: 2px; } /* --edge; LIB-P24 keeps this sheet to the mock's tokens */
