/* ============================================================================
   DMBox — design system + marketing styles.
   Cinematic, scene-reactive dark. Editorial serif display + clean sans body,
   one ember accent, a scene spectrum the product breathes with. Shared by
   every generated marketing page (build.py); landing-specific bits at the end.
   ========================================================================== */

:root {
  --bg: #08090d;
  --bg-elev: #0d0f15;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);

  --ink: #eef0f6;
  --ink-2: #b7bdcc;
  --dim: #828a9a;
  --faint: #565d6c;

  --ember: #ff6a3a;
  --ember-2: #ffa766;
  --ember-soft: rgba(255, 106, 58, 0.14);

  /* scene spectrum — combat / tavern / exploration / arcane */
  --combat: #ff5b4a;
  --tavern: #ffb24d;
  --explore: #4fd1c5;
  --arcane: #9a8cff;

  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1120px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --font-sans: "Inter", ui-sans-serif, -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --scene: var(--combat); /* live mock recolors this */
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 106, 58, 0.10), transparent 60%),
    radial-gradient(80% 60% at 100% 0%, rgba(154, 140, 255, 0.06), transparent 55%);
  background-attachment: fixed;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- type ---------------------------------------------------------------- */
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); margin-top: 0.2em; }
h3 { font-size: 1.3rem; }
p { color: var(--ink-2); margin: 0 0 1rem; }
a { color: var(--ember-2); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--ember); }
code, pre, .mono { font-family: var(--font-mono); font-size: 0.9em; }
strong { color: var(--ink); font-weight: 600; }
.lede { font-size: clamp(1.05rem, 1.8vw, 1.35rem); color: var(--ink-2); max-width: 46ch; }

main.container { padding-top: 40px; padding-bottom: 96px; }

/* ---- header / footer ----------------------------------------------------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(8, 9, 13, 0.72);
  border-bottom: 1px solid var(--line);
}
header.site .container {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--ink);
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.brand::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 14px 2px var(--ember);
  animation: pulse 2.6s var(--ease) infinite;
}
.brand:hover { color: var(--ink); }
header.site nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
header.site nav a {
  color: var(--dim);
  font-size: 0.92rem;
  padding: 8px 10px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
header.site nav a:hover { color: var(--ink); background: var(--panel); }
header.site nav a.nav-cta {
  color: var(--ember);
  border: 1px solid var(--ember-soft);
  background: var(--ember-soft);
}
header.site nav a.nav-cta:hover { background: rgba(255, 106, 58, 0.22); color: var(--ember-2); }
@media (max-width: 720px) {
  header.site nav a:nth-child(1),  /* How it works */
  header.site nav a:nth-child(3) { display: none; }  /* FAQ */
  header.site nav a.nav-cta { padding: 9px 15px; }
}
@media (max-width: 360px) {
  header.site nav a:nth-child(2) { display: none; }  /* Pricing — CTA only on tiny screens */
}

footer.site {
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 40px 0;
  color: var(--dim);
  font-size: 0.9rem;
}
footer.site .container { display: flex; flex-direction: column; gap: 14px; }
footer.site a { color: var(--dim); margin-right: 16px; }
footer.site a:hover { color: var(--ink); }

/* ---- buttons ------------------------------------------------------------- */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 500;
  padding: 13px 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: #1a0f08;
  background: linear-gradient(180deg, var(--ember-2), var(--ember));
  box-shadow: 0 6px 24px -8px var(--ember), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.15s var(--ease), box-shadow 0.2s;
}
.cta:hover { color: #1a0f08; transform: translateY(-1px); box-shadow: 0 10px 30px -8px var(--ember); }
.cta.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: none;
}
.cta.ghost:hover { background: var(--panel); color: var(--ink); }

/* ---- generic sections / cards ------------------------------------------- */
.notice {
  border: 1px solid var(--line);
  border-left: 3px solid var(--ember);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--ink-2);
}
ul { color: var(--ink-2); padding-left: 1.1rem; }
li { margin: 0.3rem 0; }

/* ============================================================================
   Landing-specific
   ========================================================================== */
.hero {
  position: relative;
  padding: clamp(56px, 11vw, 120px) 0 56px;
  min-height: clamp(620px, 86vh, 900px);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 120%;
  background: radial-gradient(50% 50% at 30% 30%, rgba(255, 106, 58, 0.18), transparent 70%);
  filter: blur(20px);
  animation: drift 18s ease-in-out infinite alternate;
  pointer-events: none;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember-2);
  margin-bottom: 18px;
}
.hero h1 { max-width: 16ch; }
.hero h1 .grad {
  background: linear-gradient(180deg, #fff, var(--ember-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.section { padding: 64px 0; }
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 12px;
}

/* live cockpit mock ------------------------------------------------------- */
.stage {
  margin-top: 52px;
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, var(--bg-elev), #0a0c11);
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.02);
  padding: 22px;
  overflow: hidden;
}
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 120% at 0% 0%, color-mix(in srgb, var(--scene) 22%, transparent), transparent 60%);
  transition: background 1.2s var(--ease);
  pointer-events: none;
}
.stage-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.dot-live {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--scene);
  box-shadow: 0 0 14px 2px var(--scene);
  animation: pulse 1.8s var(--ease) infinite;
  transition: background 1.2s var(--ease), box-shadow 1.2s var(--ease);
}
.stage-label { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.stage-scene { margin-left: auto; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--scene); transition: color 1.2s var(--ease); }
.stage-track { position: relative; font-family: var(--font-display); font-size: clamp(1.5rem, 3.5vw, 2.4rem); margin: 8px 0 18px; }
.eq { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 54px; }
.eq span {
  flex: 1;
  background: linear-gradient(180deg, var(--scene), color-mix(in srgb, var(--scene) 30%, transparent));
  border-radius: 3px;
  height: 30%;
  animation: eq 1.1s ease-in-out infinite;
  transition: background 1.2s var(--ease);
}
.eq span:nth-child(2n) { animation-duration: 0.9s; animation-delay: -0.3s; }
.eq span:nth-child(3n) { animation-duration: 1.4s; animation-delay: -0.6s; }
.eq span:nth-child(4n) { animation-duration: 0.7s; animation-delay: -0.15s; }
.chips { position: relative; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 7px 14px 7px 8px;
  font-size: 0.86rem;
  color: var(--ink-2);
}
.chip .ring {
  --p: 70;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: conic-gradient(var(--scene) calc(var(--p) * 1%), rgba(255, 255, 255, 0.12) 0);
  -webkit-mask: radial-gradient(circle 6px at center, transparent 98%, #000 0);
  mask: radial-gradient(circle 6px at center, transparent 98%, #000 0);
  transition: background 1.2s var(--ease);
}
.chip.listening { color: var(--scene); border-color: color-mix(in srgb, var(--scene) 40%, transparent); }

/* how it works ------------------------------------------------------------ */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 36px; }
.step {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 22px 20px;
}
.step .n { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ember); letter-spacing: 0.1em; }
.step h3 { margin: 10px 0 6px; font-family: var(--font-sans); font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.step p { font-size: 0.92rem; margin: 0; color: var(--dim); }

/* features ---------------------------------------------------------------- */
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 36px; }
.feature {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), transparent);
  border-radius: var(--radius);
  padding: 26px;
}
.feature h3 { font-family: var(--font-sans); font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.feature p { margin: 0; color: var(--dim); }
.feature .glyph { font-size: 1.4rem; margin-bottom: 12px; display: block; filter: saturate(1.2); }

/* pricing (shared with pricing.html) -------------------------------------- */
.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 28px 0; }
.tier {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 24px;
}
.tier.pro, .tier.studio { border-color: color-mix(in srgb, var(--ember) 45%, transparent); box-shadow: 0 0 0 1px var(--ember-soft); }
.price { font-family: var(--font-display); font-size: 2.2rem; color: var(--ink); }
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ember);
  border: 1px solid var(--ember-soft);
  background: var(--ember-soft);
  border-radius: 999px;
  padding: 3px 9px;
}

/* billing toggle (Monthly | Annual) -------------------------------------- */
.billing-toggle {
  display: inline-flex;
  gap: 4px;
  margin: 18px 0 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}
.billing-toggle .bt-opt {
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.billing-toggle .bt-opt.is-on {
  color: var(--ink);
  background: var(--ember-soft);
  box-shadow: 0 0 0 1px var(--ember-soft);
}
.bt-tag, .price-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ember);
  border: 1px solid var(--ember-soft);
  border-radius: 999px;
  padding: 2px 7px;
}

/* monthly / annual price swap -------------------------------------------- */
.price-sub { font-size: 0.82rem; color: var(--dim); margin-top: 4px; line-height: 1.5; }
.price-was { text-decoration: line-through; color: var(--dim); margin: 0 4px; }
.tier-grid[data-billing="annual"] .price-monthly { display: none; }
.tier-grid[data-billing="annual"] .price-annual { display: block; }
.tier-grid[data-billing="monthly"] .price-monthly { display: block; }
.tier-grid[data-billing="monthly"] .price-annual { display: none; }
/* the Free card has no annual variant — never hide its price */
.tier.free .price { display: block !important; }

/* Studio: coming-soon / de-emphasized ------------------------------------ */
.tier.coming-soon { opacity: 0.72; }
.tier.coming-soon .price { color: var(--ink-2); }
.badge.soon {
  color: var(--dim);
  border-color: var(--line);
  background: transparent;
  margin-left: 6px;
}
.soon-note { font-size: 0.85rem; color: var(--dim); margin: 8px 0 0; font-style: italic; }
table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
th { color: var(--ink); font-weight: 600; }

/* responsive safety: long words never push width; wide tables scroll in-place */
p, li, h1, h2, h3, td, th, .lede, .stage-track { overflow-wrap: break-word; }
img, svg, video { max-width: 100%; }
@media (max-width: 680px) {
  main table { display: block; width: 100%; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  main table th, main table td { padding: 9px 10px; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
  /* keep both posters legible rather than crushing 4-up; 2-up reads best */
  .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .poster .meta { padding: 12px; }
  .poster h3 { font-size: 1.1rem; }
  /* the play control is always visible on touch (no hover) */
  .poster .play { opacity: 1; transform: none; }
  /* prose pages: tighten the section rhythm + card padding on small screens */
  main.container > h2 { margin-top: 1.9em; padding-top: 1.05em; }
  .prose-section { padding: 18px; border-radius: var(--radius); }
  /* the full-bleed hero scene: soften the vignette a touch tighter so the
     glow stays centred behind the headline on narrow viewports */
  .hero-scene { --m-vig: radial-gradient(ellipse 110% 70% at 50% 30%, #000 50%, transparent 88%); }
}

/* reveal-on-scroll (progressive enhancement: visible without JS) -----------
   NO-JS / CRAWLER SAFETY: the hidden state is scoped to `.js` (added by an
   inline <head> script before paint). With JS off, or for a crawler that
   ignores scripts, `.js` is never present, so .reveal / .poster keep their
   natural opacity:1 and ALL content is rendered + indexable. The Intersection
   observer only adds `.in`; if it never runs (e.g. very old browser) the
   `.js`-guarded opacity:0 would strand content, so we also force reveals
   visible when reduced-motion is on (no animation to wait for). */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* atmospheric hero backdrop + drifting embers ----------------------------- */
/* Full-bleed to the viewport (not clipped to the centred content column) so
   there is no rectangle. An all-edges composite mask fades the sky-glow and
   mountains smoothly into the page on top + left + right + bottom — a radial
   vignette intersected with a soft horizontal fade kills every hard line.
   .hero has overflow:hidden, so the 100vw child never causes a scrollbar. */
.hero-scene {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: none;
  height: 96%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
  --m-vert: linear-gradient(180deg, #000 58%, transparent 96%);
  --m-horz: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent);
  --m-vig: radial-gradient(ellipse 78% 84% at 50% 36%, #000 52%, transparent 86%);
  -webkit-mask-image: var(--m-vig), var(--m-vert), var(--m-horz);
  mask-image: var(--m-vig), var(--m-vert), var(--m-horz);
  -webkit-mask-composite: source-in, source-in;
  mask-composite: intersect;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}
#sun { transition: opacity 0.2s linear; }
.hero-scene svg { width: 100%; height: 100%; display: block; }
.hero > *:not(.hero-scene):not(.embers) { position: relative; z-index: 2; }
.embers { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.embers i {
  position: absolute;
  bottom: -8px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ember-2);
  box-shadow: 0 0 8px 1px var(--ember);
  opacity: 0;
  animation: rise linear infinite;
}

/* animated divider -------------------------------------------------------- */
.aurora { position: relative; height: 1px; margin: 8px 0; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }
.aurora::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 3px;
  background: linear-gradient(90deg, transparent 12%, color-mix(in srgb, var(--ember) 65%, transparent), color-mix(in srgb, var(--arcane) 65%, transparent), transparent 88%);
  filter: blur(3px);
  animation: sheen 9s ease-in-out infinite;
}

/* inline icons ------------------------------------------------------------ */
.istep, .ifeat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), transparent);
  color: var(--ember-2);
  margin-bottom: 14px;
}
.istep svg, .ifeat svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* scene poster gallery ---------------------------------------------------- */
.poster-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 36px; }
.poster {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.poster::before { content: ""; display: block; padding-top: 125%; }  /* 4:5 ratio box — works everywhere */
.poster:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--pc) 55%, transparent);
  box-shadow: 0 22px 55px -26px var(--pc);
}
.poster svg.art { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; }
.poster .meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px;
  z-index: 2;
  background: linear-gradient(0deg, rgba(5, 6, 9, 0.94) 30%, transparent);
}
.poster .tag { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pc); }
.poster h3 { font-family: var(--font-display); font-size: 1.3rem; margin: 0.1em 0 0.15em; }
.poster p { font-size: 0.82rem; color: var(--dim); margin: 0; }

@media (max-width: 860px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features { grid-template-columns: 1fr; }
  .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ambient page-wide drifting motes (behind content) ----------------------- */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.ambient i {
  position: absolute;
  bottom: -12px;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--ember-2);
  box-shadow: 0 0 7px 1px rgba(255, 106, 58, 0.5);
  opacity: 0;
  animation: amb-rise linear infinite;
}

/* poster: "preview" affordance + staggered entrance + living scenes -------- */
.poster .play {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--pc);
  background: rgba(5, 6, 9, 0.66);
  border: 1px solid color-mix(in srgb, var(--pc) 45%, transparent);
  border-radius: 999px;
  padding: 4px 10px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.poster:hover .play { opacity: 1; transform: none; }
/* keep the control discoverable on touch (no hover) and once it's playing */
.poster .play:focus-visible,
.poster .play.is-playing { opacity: 1; transform: none; }
.poster .play { cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* Item C — click-to-play audio controls (one clip at a time; user-gesture only).
   The .play span doubles as a button; .is-playing flips the glyph to a pause/stop
   and lights it in the scene colour with a soft ring so it reads as "live". */
.poster .play.is-playing {
  color: #0b0a0e;
  background: var(--pc);
  border-color: var(--pc);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 28%, transparent), 0 6px 18px -8px var(--pc);
  font-weight: 500;
}
.poster .play.is-loading { opacity: 1; color: var(--pc); }
.poster .play[aria-disabled="true"] { opacity: 0.55; cursor: default; }

/* hero "Now playing" stage gets a real play/pause control top-right */
.stage-play {
  position: relative;
  margin-left: 8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--scene);
  background: color-mix(in srgb, var(--scene) 12%, rgba(5, 6, 9, 0.5));
  border: 1px solid color-mix(in srgb, var(--scene) 38%, transparent);
  border-radius: 999px;
  padding: 6px 13px 6px 11px;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.stage-play:hover { background: color-mix(in srgb, var(--scene) 22%, rgba(5, 6, 9, 0.5)); }
.stage-play .glyph { font-size: 0.78rem; line-height: 1; }
.stage-play.is-playing {
  color: #0b0a0e;
  background: var(--scene);
  border-color: var(--scene);
  box-shadow: 0 0 16px -2px var(--scene);
}
.stage-play:focus-visible { outline: 2px solid var(--scene); outline-offset: 2px; }

/* non-blocking note shown when a clip is missing / can't play — never an alert */
.audio-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--dim);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.audio-note.show { opacity: 1; transform: none; }
.audio-note::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--dim);
  flex: 0 0 auto;
}

/* ============================================================================
   Item E — visibility + polish primitives for the long-form pages.
   The generated pages (faq / refund / pricing / attribution / terms / privacy)
   drop bare h1/h2/h3/p/ul straight into <main class="container">. On the
   LANDING page every heading is wrapped in .hero / .section, so a bare
   `main.container > h2` only exists on the long-form pages — we use that as a
   precise, no-HTML-edit hook to give them rhythm, contrast, and structure.
   ========================================================================== */

/* long-form lead: bigger, calmer measure, separated from the body */
main.container > h1 { margin-bottom: 0.25em; }
main.container > h1 + p,
main.container > h1 + .lede { font-size: clamp(1.1rem, 1.9vw, 1.4rem); color: var(--ink-2); max-width: 60ch; margin-bottom: 8px; }

/* h2 section heads: an accent tick + a hairline rule reset the reading rhythm
   so long pages read as scannable sections instead of an undifferentiated wall */
main.container > h2 {
  position: relative;
  margin-top: 2.4em;
  margin-bottom: 0.5em;
  padding-top: 1.3em;
  border-top: 1px solid var(--line);
}
main.container > h2::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 56px; height: 2px;
  background: linear-gradient(90deg, var(--ember), color-mix(in srgb, var(--ember) 8%, transparent));
  border-radius: 2px;
}
main.container > h1 + h2,
main.container > .lede + h2,
main.container > .notice + h2 { margin-top: 1.4em; }

/* h3 sub-heads in long policies: clear, quieter than h2, with breathing room */
main.container > h3 { margin-top: 1.8em; color: var(--ink); font-size: 1.15rem; }
main.container > h3:first-of-type { margin-top: 1.2em; }

/* body copy in the prose pages: a touch more leading + a comfortable measure */
main.container > p { max-width: 72ch; color: var(--ink-2); }
main.container > ul { max-width: 72ch; }
main.container > ul > li { margin: 0.45rem 0; }
main.container > ul > li::marker { color: var(--ember); }

/* reusable surface other writers can opt into to lift a block off the black */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 30px);
}
.panel + .panel { margin-top: 16px; }

/* an opt-in container that boxes a long policy section as a readable card */
.prose-section {
  background: linear-gradient(180deg, var(--panel), transparent 120%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 4vw, 40px);
  margin: 24px 0;
}
.prose-section > :first-child { margin-top: 0; }
.prose-section > :last-child { margin-bottom: 0; }

/* a labelled prose card: an eyebrow-style heading sits on the panel edge so a
   stack of them reads as distinct, scannable sections instead of a flat wall */
.prose-section > h2:first-child,
.prose-section > h3:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.prose-section > h2:first-child::before { top: -2px; }

/* headings/copy NESTED inside a panel/prose-card don't match the
   `main.container > …` direct-child rules, so give them their own rhythm */
.panel h2, .prose-section h2,
.panel h3, .prose-section h3 { color: var(--ink); line-height: 1.25; }
.panel h3, .prose-section h3 { font-size: 1.15rem; margin: 0 0 0.4em; }
.panel p, .prose-section p,
.panel li, .prose-section li { color: var(--ink-2); }
.panel p:last-child, .prose-section p:last-child { margin-bottom: 0; }
.panel ul, .prose-section ul { margin: 0.4rem 0; }
.panel li::marker, .prose-section li::marker { color: var(--ember); }
.panel table, .prose-section table { margin: 0; }

/* FAQ: every question/answer is its own card, so questions stop blurring into
   one another. A scene-tinted index tick + a clear question head + a calmer,
   wider answer measure give each entry a self-contained, premium structure. */
.faq-list { margin: 24px 0 8px; }
.faq-item {
  position: relative;
  margin: 0 0 14px;
  padding: clamp(18px, 2.6vw, 26px) clamp(18px, 2.6vw, 30px);
}
.faq-item::before {
  content: "";
  position: absolute;
  top: clamp(18px, 2.6vw, 26px);
  left: 0;
  width: 3px; height: 1.15em;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--ember), color-mix(in srgb, var(--ember) 14%, transparent));
}
.faq-item > h2 {
  margin: 0 0 0.5em;
  padding: 0;
  border: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.18rem, 2.1vw, 1.5rem);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.faq-item > :last-child { margin-bottom: 0; }
.faq-item p, .faq-item li { color: var(--ink-2); }
.faq-item p { max-width: 70ch; }
.faq-item a { color: var(--ember-2); }
.faq-item code {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.05em 0.4em;
}

/* attribution + other inline secondary notes */
.muted { color: var(--dim); font-size: 0.92em; }

/* md-driven legal pages (privacy / terms): one contained card so the long
   policy lifts off the black, while every h2 keeps the accent-tick divider so
   the document still reads as scannable sections. h3 sub-clauses stay quiet. */
.legal-prose { margin-top: 24px; }
.legal-prose > h2 {
  position: relative;
  margin: 2.2em 0 0.5em;
  padding-top: 1.25em;
  border-top: 1px solid var(--line);
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  color: var(--ink);
}
.legal-prose > h2:first-child,
.legal-prose > :first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.legal-prose > h2::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 52px; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ember), color-mix(in srgb, var(--ember) 8%, transparent));
}
.legal-prose > h2:first-child::before { display: none; }
.legal-prose > h3 { margin: 1.7em 0 0.4em; color: var(--ink); font-size: 1.1rem; }
.legal-prose > p,
.legal-prose > ul,
.legal-prose > ol { max-width: 74ch; color: var(--ink-2); }
.legal-prose > ul > li,
.legal-prose > ol > li { margin: 0.4rem 0; }
.legal-prose > ul > li::marker,
.legal-prose > ol > li::marker { color: var(--ember); }
.legal-prose a { color: var(--ember-2); }
.legal-prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* tables on the long-form pages get a contained, panelled look */
main.container table {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
main.container thead th { background: rgba(255, 255, 255, 0.03); }

.js .poster-grid .poster { opacity: 0; }
.poster-grid.in .poster { animation: posterIn 0.6s var(--ease) forwards; }
.poster-grid.in .poster:nth-child(2) { animation-delay: 0.09s; }
.poster-grid.in .poster:nth-child(3) { animation-delay: 0.18s; }
.poster-grid.in .poster:nth-child(4) { animation-delay: 0.27s; }

/* combat: throbbing battle glow + rising embers */
.cmb-glow { animation: cmb-throb 2.2s ease-in-out infinite; }
.cmb-embers circle { animation: spark-up 3s ease-in infinite; }
.cmb-embers circle:nth-child(2) { animation-duration: 3.8s; animation-delay: -1.4s; }
.cmb-embers circle:nth-child(3) { animation-duration: 2.6s; animation-delay: -0.7s; }
.cmb-embers circle:nth-child(4) { animation-duration: 3.4s; animation-delay: -2s; }
.cmb-embers circle:nth-child(5) { animation-duration: 2.9s; animation-delay: -0.4s; }
.cmb-embers circle:nth-child(6) { animation-duration: 3.6s; animation-delay: -1.1s; }
.cmb-embers circle:nth-child(7) { animation-duration: 3.1s; animation-delay: -2.4s; }

/* tavern: layered fire tongues + rising sparks + flickering lanterns */
.fire-back { transform-box: fill-box; transform-origin: bottom center; animation: flame-flick 1.9s ease-in-out infinite; }
.fire-mid  { transform-box: fill-box; transform-origin: bottom center; animation: flame-flick 1.3s ease-in-out infinite; animation-delay: -0.4s; }
.fire-core { transform-box: fill-box; transform-origin: bottom center; animation: flame-flick 1s ease-in-out infinite; animation-delay: -0.7s; }
.sparks circle { animation: spark-up 2.4s ease-in infinite; }
.sparks circle:nth-child(2) { animation-duration: 3s; animation-delay: -1s; }
.sparks circle:nth-child(3) { animation-duration: 2s; animation-delay: -1.6s; }
.sparks circle:nth-child(4) { animation-duration: 2.7s; animation-delay: -0.6s; }
.sparks circle:nth-child(5) { animation-duration: 2.3s; animation-delay: -1.9s; }
.lantern { animation: glow-flick 3.2s ease-in-out infinite; }
.lantern2 { animation: glow-flick 2.5s ease-in-out infinite; }

/* exploration: pulsing lantern + dripping water (legacy hooks, kept) */
.lanternpulse { transform-box: fill-box; transform-origin: center; animation: glow-pulse 3s ease-in-out infinite; }
.drips circle { animation: drip 3.2s ease-in infinite; }
.drips .d2 { animation-duration: 4s; animation-delay: -1.6s; }
.drips .d3 { animation-duration: 2.6s; animation-delay: -0.8s; }

/* exploration cave (W3): falling drips + splash ripples + breathing teal glow + drifting mist.
   Transforms/opacity only — GPU-cheap. Each .cave-drip animates a translate down its
   stalactite; its paired .cave-ripple expands a ring in the pool on the same loop.
   prefers-reduced-motion (below) nukes these — drips rest at their formed tip. */
.cave-glow { transform-box: fill-box; transform-origin: center; animation: cave-glow-breathe 5.5s ease-in-out infinite; }
.cave-mist { transform-box: fill-box; transform-origin: center; animation: cave-mist-drift 14s ease-in-out infinite; will-change: transform, opacity; }
.cave-mist.m2 { animation-duration: 18s; animation-delay: -6s; }
.cave-mist.m3 { animation-duration: 11s; animation-delay: -3s; }
.cave-drip { transform-box: fill-box; transform-origin: center top; animation: cave-fall 3.4s cubic-bezier(0.5, 0, 0.85, 0.4) infinite; will-change: transform, opacity; }
.cave-drip.k2 { animation-duration: 4.6s; animation-delay: -1.8s; }
.cave-drip.k3 { animation-duration: 2.9s; animation-delay: -0.9s; }
.cave-drip.k4 { animation-duration: 5.3s; animation-delay: -3.4s; }
.cave-ripple { transform-box: fill-box; transform-origin: center; opacity: 0; animation: cave-splash 3.4s ease-out infinite; }
.cave-ripple.k2 { animation-duration: 4.6s; animation-delay: -1.8s; }
.cave-ripple.k3 { animation-duration: 2.9s; animation-delay: -0.9s; }
.cave-ripple.k4 { animation-duration: 5.3s; animation-delay: -3.4s; }

/* ritual: whole sigil rotates around its true centre + rising purple smoke */
.rune-spin { transform-box: view-box; transform-origin: 160px 252px; animation: spin 26s linear infinite; }
.candle { animation: glow-flick 2.8s ease-in-out infinite; }
.rune-glow { transform-box: fill-box; transform-origin: center; animation: rune-breathe 3.6s ease-in-out infinite; }
.smoke ellipse { opacity: 0; transform-box: fill-box; transform-origin: center; }
.smoke .s1 { animation: smoke 5.2s ease-out infinite; }
.smoke .s2 { animation: smoke 5.2s ease-out infinite; animation-delay: -1.3s; }
.smoke .s3 { animation: smoke 5.2s ease-out infinite; animation-delay: -2.6s; }
.smoke .s4 { animation: smoke 5.2s ease-out infinite; animation-delay: -3.9s; }

/* ---- motion -------------------------------------------------------------- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes drift { from { transform: translate(-4%, -2%) scale(1); } to { transform: translate(6%, 3%) scale(1.1); } }
@keyframes eq { 0%, 100% { height: 28%; } 50% { height: 100%; } }
@keyframes rise { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: 0.9; } 100% { transform: translate(24px, -360px); opacity: 0; } }
@keyframes sheen { 0%, 100% { opacity: 0.22; } 50% { opacity: 0.6; } }
@keyframes hover-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes amb-rise { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: 0.5; } 88% { opacity: 0.4; } 100% { transform: translate(34px, -108vh); opacity: 0; } }
@keyframes posterIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes flame-flick { 0%, 100% { transform: scaleY(1) scaleX(1); } 30% { transform: scaleY(1.16) scaleX(0.92); } 55% { transform: scaleY(0.9) scaleX(1.06); } 80% { transform: scaleY(1.08) scaleX(0.96); } }
@keyframes glow-flick { 0%, 100% { opacity: 1; } 45% { opacity: 0.55; } 70% { opacity: 0.85; } }
@keyframes glow-pulse { 0%, 100% { transform: scale(1); opacity: 0.7; } 50% { transform: scale(1.18); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spark-up { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 0.9; } 80% { opacity: 0.5; } 100% { transform: translateY(-58px); opacity: 0; } }
@keyframes drip { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 0.8; } 100% { transform: translateY(46px); opacity: 0; } }
@keyframes smoke { 0% { transform: translateY(0) scale(0.45); opacity: 0; } 22% { opacity: 0.55; } 100% { transform: translateY(-120px) scale(1.8); opacity: 0; } }
@keyframes cmb-throb { 0%, 100% { opacity: 0.68; } 50% { opacity: 1; } }
@keyframes rune-breathe { 0%, 100% { transform: scale(0.85); opacity: 0.5; } 50% { transform: scale(1.18); opacity: 1; } }

/* cave (W3): a droplet swells at the tip, lets go, and falls accelerating into the pool */
@keyframes cave-fall {
  0%       { transform: translateY(0) scaleY(0.6); opacity: 0; }
  10%      { transform: translateY(2px) scaleY(1); opacity: 0.95; }
  22%      { transform: translateY(4px) scaleY(1.1); opacity: 0.95; }
  78%      { transform: translateY(150px) scaleY(1.5); opacity: 0.85; }
  88%, 100% { transform: translateY(168px) scaleY(0.4); opacity: 0; }
}
/* the splash ripple lands as the drop hits — a ring that expands and fades in the pool */
@keyframes cave-splash {
  0%, 76%  { transform: scale(0.2); opacity: 0; }
  82%      { transform: scale(0.6); opacity: 0.7; }
  100%     { transform: scale(1.7); opacity: 0; }
}
@keyframes cave-glow-breathe {
  0%, 100% { transform: scale(0.92); opacity: 0.55; }
  50%      { transform: scale(1.12); opacity: 0.95; }
}
@keyframes cave-mist-drift {
  0%       { transform: translateX(-6px) translateY(0); opacity: 0.12; }
  50%      { transform: translateX(8px) translateY(-4px); opacity: 0.28; }
  100%     { transform: translateX(-6px) translateY(0); opacity: 0.12; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto; }
  /* reveals must never stay hidden when motion is off (no transition to play) */
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .js .poster-grid .poster { opacity: 1 !important; }
  /* cave: with animation frozen, leave a formed droplet at each tip, the pool
     calm (ripples stay at their inline opacity:0), and the inner glow lit. */
  .cave-drip { transform: translateY(2px) scaleY(1); opacity: 0.95; }
  .cave-glow { transform: scale(1); opacity: 0.85; }
  .cave-mist { opacity: 0.2; }
}
