/* ============================================================
   OUBLIETTE — immersive escape rooms & live theatre
   Dark = the dungeon (default); light = parchment. Tokens flip
   on :root[data-theme]. Candlelit ambient is pure CSS; the hero
   combination-lock is progressive vanilla JS.
   ============================================================ */

:root {
  --max: 1200px;
  --ease: cubic-bezier(.72, 0, .22, 1);        /* a curtain drawn — slow, then decisive */
  --ease-latch: cubic-bezier(.34, 1.56, .64, 1); /* the shackle springs open (overshoot) */
  --candle: #e6a94b;                            /* candle-amber, shared glow both themes */
  --oxblood: #7a1f2b;                           /* the second colour of the house */
  --font-d: "Cinzel", "Times New Roman", serif;
  --font-b: "Crimson Pro", Georgia, serif;
  --font-m: "Space Mono", ui-monospace, monospace;
}

/* ---- dark: the dungeon (default) ---- */
:root[data-theme="dark"] {
  --bg: #0e0b09;
  --bg-2: #14100c;
  --panel: #1a140d;
  --panel-2: #221a10;
  --ink: #ece3d0;          /* warm bone */
  --dim: #a89a82;
  --faint: #95866b;        /* raised to meet WCAG AA (>=4.5:1) on panel/bg */
  --line: rgba(236, 227, 208, .13);
  --line-2: rgba(236, 227, 208, .06);
  --accent: #e6a94b;       /* candle-amber */
  --accent-ink: #17110a;   /* text on amber */
  --blood: #a23742;        /* oxblood, decorative use (borders, glow, bullets) */
  --blood-ink: #cf5f69;    /* lighter oxblood for AA-legible TEXT on dark */
  --iron: #3a3128;
  --iron-2: #241d15;
  --shadow: 0 30px 70px -34px rgba(0, 0, 0, .85);
}
/* ---- light: parchment ---- */
:root[data-theme="light"] {
  --bg: #e7dcc5;
  --bg-2: #ddd0b4;
  --panel: #efe6d0;
  --panel-2: #e5d8ba;
  --ink: #241c12;
  --dim: #5b4d38;
  --faint: #635640;        /* darkened to meet WCAG AA (>=4.5:1) on bg-2/panel */
  --line: rgba(36, 28, 18, .17);
  --line-2: rgba(36, 28, 18, .08);
  --accent: #7c4f13;       /* amber, darkened further for AA text on parchment */
  --accent-ink: #f6efdd;
  --blood: #7a1f2b;        /* true oxblood reads well on parchment */
  --blood-ink: #7a1f2b;    /* oxblood is already AA as text on parchment */
  --iron: #b3a684;
  --iron-2: #cabf9d;
  --shadow: 0 30px 66px -36px rgba(58, 42, 22, .5);
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-b);
  font-size: clamp(16px, 1vw + 14px, 18.5px);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .5s var(--ease), color .5s var(--ease);
}

.mono { font-family: var(--font-m); font-variant-ligatures: none; }
.wrap { width: min(100% - 2.4rem, var(--max)); margin-inline: auto; }
h1, h2, h3 { font-family: var(--font-d); font-weight: 600; line-height: 1.05; margin: 0; letter-spacing: .005em; }
em { font-style: normal; color: var(--accent); }
a { color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- candlelit ambient background (pure CSS) ---------- */
.film {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -20%, color-mix(in oklab, var(--candle) 10%, transparent), transparent 55%),
    radial-gradient(140% 120% at 50% 130%, var(--bg-2), transparent 60%);
}
/* stone-grain vignette that darkens the edges like a cell */
.film::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(100% 100% at 50% 45%, transparent 52%, color-mix(in oklab, var(--bg) 88%, #000) 100%),
    radial-gradient(circle at 1px 1px, var(--line-2) 1px, transparent 0);
  background-size: 100% 100%, 5px 5px;
  opacity: .9;
}
.glow {
  position: absolute; border-radius: 50%; filter: blur(46px); mix-blend-mode: screen;
  background: radial-gradient(circle, color-mix(in oklab, var(--candle) 70%, transparent), transparent 68%);
}
:root[data-theme="light"] .glow { mix-blend-mode: multiply; opacity: .5; }
.glow-a { width: 44vmax; height: 44vmax; left: -8vmax; top: -10vmax; }
.glow-b { width: 38vmax; height: 38vmax; right: -10vmax; bottom: -12vmax; background: radial-gradient(circle, color-mix(in oklab, var(--blood) 55%, transparent), transparent 66%); }
.js .glow-a { animation: flicker 5.5s var(--ease) infinite; }
.js .glow-b { animation: flicker 7.3s var(--ease) infinite .8s; }
@keyframes flicker {
  0%, 100% { opacity: .8; transform: scale(1); }
  22% { opacity: .62; transform: scale(1.02); }
  46% { opacity: .9; transform: scale(.99); }
  60% { opacity: .55; transform: scale(1.015); }
  78% { opacity: .82; transform: scale(1.005); }
}

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: .5rem .9rem; border-radius: 8px; font-weight: 600; font-family: var(--font-m);
}
.skip:focus { left: 12px; }

:where(a, button, input, textarea, select, [role="spinbutton"]):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px;
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: min(100% - 2.4rem, var(--max)); margin: .7rem auto 0;
  padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 14px;
  background: color-mix(in oklab, var(--bg) 74%, transparent);
  backdrop-filter: blur(12px);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; font-family: var(--font-d); font-weight: 600; font-size: 1.12rem; letter-spacing: .06em; text-transform: uppercase; }
.brand-mark { width: 25px; height: 25px; color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: .25rem; }
.nav-links a { text-decoration: none; color: var(--dim); font-size: .84rem; padding: .45rem .7rem; border-radius: 9px; transition: color .25s, background .25s; }
.nav-links a:hover { color: var(--ink); background: var(--line-2); }
.nav-cta { color: var(--ink) !important; border: 1px solid var(--line); }
.nav-cta:hover { background: var(--accent) !important; color: var(--accent-ink) !important; border-color: transparent; }
@media (max-width: 820px) { .nav-links a:not(.nav-cta) { display: none; } }

.theme-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; margin-left: .2rem;
  border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--dim); cursor: pointer;
  transition: color .25s, border-color .25s, transform .2s;
}
.theme-btn:hover { color: var(--ink); border-color: var(--accent); }
.theme-btn:active { transform: scale(.92); }
.theme-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
:root[data-theme="dark"] .ico-sun { display: block; }
:root[data-theme="dark"] .ico-moon { display: none; }
:root[data-theme="light"] .ico-sun { display: none; }
:root[data-theme="light"] .ico-moon { display: block; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; text-decoration: none;
  padding: .72rem 1.2rem; border-radius: 10px; font-family: var(--font-m); font-weight: 700; font-size: .8rem;
  letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid transparent; cursor: pointer; transition: transform .22s var(--ease-latch), background .25s, border-color .25s, color .25s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -14px var(--accent); }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; justify-content: center; }

/* ---------- section scaffolding ---------- */
main { position: relative; z-index: 1; }
section { position: relative; }
.sec-head { max-width: 60ch; margin-bottom: 2.8rem; }
.kicker { color: var(--accent); font-size: .72rem; letter-spacing: .28em; text-transform: uppercase; margin: 0 0 1rem; }
.kicker--blood { color: var(--blood-ink); }
.eyebrow { color: var(--faint); font-size: .72rem; letter-spacing: .26em; text-transform: uppercase; margin: 0 0 1.4rem; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 600; }
.lede { color: var(--dim); font-size: clamp(1.02rem, 1.4vw, 1.18rem); margin: 1rem 0 0; }
.wm {
  position: absolute; top: 4%; right: -1%; z-index: 0; pointer-events: none; user-select: none;
  font-family: var(--font-d); font-weight: 700; font-size: clamp(5rem, 20vw, 17rem); color: var(--ink); opacity: .035; letter-spacing: .1em; text-transform: uppercase;
}

/* ---------- hero ---------- */
.hero { padding: clamp(2.6rem, 6vw, 5.2rem) 0 clamp(3rem, 6vw, 5rem); width: min(100% - 2.4rem, var(--max)); margin-inline: auto; scroll-margin-top: 5rem; }
.hero-grid { display: grid; grid-template-columns: 1.02fr .98fr; gap: clamp(1.6rem, 4vw, 3.6rem); align-items: center; }
@media (max-width: 1020px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-title { font-size: clamp(2.6rem, 7vw, 5.2rem); font-weight: 700; margin: .2rem 0 0; letter-spacing: .01em; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .04em; }
.hero-title .line > span { display: block; }
.js .hero-title .line > span { transform: translateY(112%); }
.js .hero.loaded .hero-title .line > span { animation: rise 1s var(--ease) forwards; }
.js .hero.loaded .hero-title .line:nth-child(2) > span { animation-delay: .11s; }
.js .hero.loaded .hero-title .line:nth-child(3) > span { animation-delay: .22s; }
@keyframes rise { to { transform: translateY(0); } }

.hero-sub { color: var(--dim); max-width: 48ch; margin: 1.5rem 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.9rem 0 0; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 1.9rem; margin: 2.4rem 0 0; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.hero-facts div { display: flex; flex-direction: column; gap: .25rem; }
.hero-facts dt { font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); }
.hero-facts dd { margin: 0; font-family: var(--font-d); font-weight: 500; font-size: 1.4rem; }

/* ---------- the lock ---------- */
.lock-fig { margin: 0; position: relative; }
.lock {
  position: relative; padding-top: 46px;
  filter: drop-shadow(var(--shadow));
}
.lock-shackle {
  position: absolute; top: 0; left: 50%; width: 132px; height: auto; z-index: 1;
  transform: translateX(-50%);
  color: var(--iron);
  transition: transform .7s var(--ease-latch);
}
:root[data-theme="light"] .lock-shackle { color: #8a7c5c; }
.lock.is-open .lock-shackle { transform: translateX(-50%) translateY(-26px) rotate(-9deg); }

.lock-body {
  position: relative; z-index: 2;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, var(--panel-2), var(--panel)),
    var(--panel);
  box-shadow: inset 0 1px 0 color-mix(in oklab, var(--ink) 10%, transparent), inset 0 -18px 40px -30px #000;
  padding: clamp(1.3rem, 3vw, 2.2rem) clamp(1.1rem, 3vw, 2rem) clamp(1.3rem, 3vw, 2rem);
  overflow: hidden;
}
.lock-body::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in oklab, var(--candle) 12%, transparent), transparent 60%);
  opacity: .8;
}

.dials { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(.5rem, 1.6vw, 1rem); position: relative; z-index: 1; }
@media (max-width: 420px) { .dials { grid-template-columns: repeat(2, 1fr); gap: 1rem; } }

.dial {
  --size: clamp(58px, 14vw, 88px);
  position: relative; width: 100%; aspect-ratio: 1; max-width: var(--size); margin-inline: auto;
  display: grid; place-items: center; cursor: grab; touch-action: none;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, var(--iron), var(--iron-2) 70%, #000 130%);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.5), 0 6px 14px -8px #000;
  transition: box-shadow .3s, transform .2s var(--ease-latch);
}
.dial:active, .dial.grabbing { cursor: grabbing; }
.dial:hover { box-shadow: inset 0 2px 5px rgba(0,0,0,.5), 0 8px 18px -8px #000, 0 0 0 1px color-mix(in oklab, var(--accent) 40%, transparent); }
.lock.is-open .dial { box-shadow: inset 0 2px 5px rgba(0,0,0,.5), 0 0 0 1px color-mix(in oklab, var(--accent) 70%, transparent), 0 0 18px -4px var(--accent); }

.dial-pointer {
  position: absolute; top: -3px; left: 50%; transform: translateX(-50%); z-index: 4;
  width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 8px solid var(--accent);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.6));
}
.dial-ring {
  position: absolute; inset: 8%; width: 84%; height: 84%; z-index: 1;
  transform: rotate(0deg); transition: transform .5s var(--ease-latch);
  color: var(--faint);
}
.ring-band { fill: none; stroke: color-mix(in oklab, var(--ink) 22%, transparent); stroke-width: 2; }
.tick { stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.tick-home { stroke: var(--accent); stroke-width: 3.4; }
.dial-glyph {
  position: relative; z-index: 3; width: 46%; height: 46%; color: var(--ink);
  display: grid; place-items: center;
}
.dial-glyph svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lock.is-open .dial-glyph { color: var(--accent); }
.dial-name {
  position: absolute; bottom: -1.35rem; left: 50%; transform: translateX(-50%);
  font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); white-space: nowrap;
}
@media (max-width: 420px) { .dial-name { bottom: -1.2rem; } }

.lock-plate { margin-top: 2.4rem; position: relative; z-index: 1; text-align: center; }
.lock-inscribe {
  margin: 0; font-family: var(--font-d); font-weight: 400; font-style: italic;
  font-size: clamp(.86rem, 2vw, 1.02rem); line-height: 1.75; color: var(--dim);
  letter-spacing: .01em;
}
.inscribe-lead { display: block; font-family: var(--font-m); font-style: normal; font-size: .6rem; letter-spacing: .22em; text-transform: uppercase; color: var(--faint); margin-bottom: .7rem; }
.lock-help { margin: 1rem 0 0; font-size: .6rem; letter-spacing: .1em; color: var(--faint); text-transform: uppercase; }

.lock-reveal {
  margin-top: 1.4rem; padding-top: 1.4rem; border-top: 1px solid color-mix(in oklab, var(--accent) 30%, var(--line));
  position: relative; z-index: 1; text-align: center;
}
.js .lock-reveal { opacity: 0; transform: translateY(10px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.lock-reveal.is-shown { opacity: 1; transform: none; }
.reveal-kick { font-size: .6rem; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); margin: 0 0 .5rem; }
.reveal-head { font-family: var(--font-d); font-weight: 700; font-size: clamp(1.3rem, 3vw, 1.7rem); margin: 0; color: var(--ink); }
.reveal-body { color: var(--dim); font-size: .92rem; margin: .6rem auto 0; max-width: 42ch; }
.reveal-body strong { font-family: var(--font-m); color: var(--accent); letter-spacing: .06em; }

.lock-cap { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.2rem; font-size: .64rem; letter-spacing: .06em; color: var(--faint); flex-wrap: wrap; }
.hero-scroll { margin: clamp(2rem, 5vw, 3.4rem) 0 0; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }

/* ---------- rooms ---------- */
.rooms { padding: clamp(4rem, 9vw, 7rem) 0; overflow: hidden; }
.room-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
@media (max-width: 720px) { .room-grid { grid-template-columns: 1fr; } }
.room {
  border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.room:hover { transform: translateY(-4px); border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); box-shadow: var(--shadow); }
.room--flag { border-color: color-mix(in oklab, var(--blood) 45%, var(--line)); }
.room-art { aspect-ratio: 16 / 7; display: grid; place-items: center; background: linear-gradient(160deg, var(--bg-2), var(--panel)); border-bottom: 1px solid var(--line); }
.room-art svg { width: 30%; height: auto; }
.room-art .ink { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.room--flag .room-art .ink { stroke: var(--blood); }
.room-info { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.room-top { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; }
.room-top h3 { font-size: clamp(1.25rem, 2.4vw, 1.5rem); font-weight: 600; }
.room-tier { font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; padding: .22rem .55rem; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; color: var(--dim); }
.tier--ii { color: #8aa06a; border-color: color-mix(in oklab, #8aa06a 45%, var(--line)); }
.tier--iii { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 45%, var(--line)); }
.tier--iv { color: #c9822f; border-color: color-mix(in oklab, #c9822f 45%, var(--line)); }
.tier--v { color: var(--blood); border-color: color-mix(in oklab, var(--blood) 55%, var(--line)); }
.room-blurb { color: var(--dim); font-size: .96rem; margin: .7rem 0 1rem; flex: 1; }
.room-meta { list-style: none; margin: 0; padding: .9rem 0 0; display: flex; gap: 1.4rem; flex-wrap: wrap; border-top: 1px solid var(--line-2); font-size: .74rem; color: var(--ink); }
.room-meta span { display: block; color: var(--faint); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .2rem; }

/* ---------- puzzle ---------- */
.puzzle { padding: clamp(4rem, 9vw, 7rem) 0; background: var(--bg-2); border-block: 1px solid var(--line); }
.puzzle-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(1.8rem, 5vw, 4rem); align-items: center; }
@media (max-width: 860px) { .puzzle-grid { grid-template-columns: 1fr; } }
.puzzle-copy p { color: var(--dim); margin: 1.1rem 0 0; max-width: 56ch; }
.puzzle-copy .mono { color: var(--accent); font-size: .82em; }
.puzzle-cta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.9rem; }
.puzzle-note { font-size: .64rem; letter-spacing: .08em; color: var(--faint); text-transform: uppercase; }
.stats { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.stats div { background: var(--panel); padding: 1.4rem 1.3rem; }
.stats dt { font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 0 0 .5rem; }
.stats dd { margin: 0; font-family: var(--font-d); font-weight: 600; font-size: clamp(1.7rem, 4vw, 2.4rem); color: var(--ink); line-height: 1; }

/* ---------- descent (tiers) ---------- */
.descent { padding: clamp(4rem, 9vw, 7rem) 0; }
.tiers { list-style: none; margin: 0; padding: 0; }
.tier {
  display: grid; grid-template-columns: auto 1fr; gap: clamp(1rem, 3vw, 2.4rem); align-items: start;
  padding: 1.9rem 0; border-top: 1px solid var(--line); position: relative;
}
.tier:last-child { border-bottom: 1px solid var(--line); }
.tier::before {
  content: ""; position: absolute; left: -1.4rem; top: 1.9rem; width: 5px; height: 0;
  background: var(--accent); border-radius: 3px; transition: height .8s var(--ease);
}
.tier.is-in::before { height: calc(100% - 3.8rem); }
.tier--last::before { background: var(--blood); }
.tier-num { font-family: var(--font-d); font-weight: 700; font-size: clamp(1.4rem, 3vw, 2rem); color: var(--faint); padding-top: .1rem; min-width: 1.4em; }
.tier-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.tier-head h3 { font-size: clamp(1.3rem, 2.6vw, 1.8rem); font-weight: 600; }
.tier-rate { font-size: .72rem; letter-spacing: .08em; color: var(--accent); white-space: nowrap; }
.tier--last .tier-rate { color: var(--blood-ink); }
.tier-body p { color: var(--dim); margin: .5rem 0 0; max-width: 58ch; font-size: .96rem; }
.meter { margin-top: 1rem; height: 6px; border-radius: 4px; overflow: hidden; background: var(--line-2); border: 1px solid var(--line); }
.meter i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--blood)); transition: width 1.1s var(--ease); }

/* ---------- book ---------- */
.book { padding: clamp(4rem, 9vw, 7rem) 0; background: var(--bg-2); border-block: 1px solid var(--line); }
.book-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.6rem, 4vw, 3.4rem); align-items: center; }
@media (max-width: 860px) { .book-grid { grid-template-columns: 1fr; } }
.book-sub { color: var(--dim); margin: 1rem 0 1.4rem; max-width: 48ch; }
.book-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.book-list li { position: relative; padding-left: 1.4rem; color: var(--dim); font-size: .78rem; letter-spacing: .02em; }
.book-list li::before { content: "†"; position: absolute; left: 0; color: var(--blood); }
.book-form { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); padding: 1.5rem; box-shadow: var(--shadow); }
.field { margin-bottom: 1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field label { display: block; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: .4rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: .95rem; resize: vertical;
}
.field select { cursor: pointer; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.book-fine { margin: .8rem 0 0; font-size: .62rem; letter-spacing: .04em; color: var(--faint); text-align: center; }
.book-done { text-align: center; padding: 1.6rem .5rem; }
.book-done strong { font-family: var(--font-d); font-weight: 700; font-size: 1.5rem; display: block; color: var(--ink); }
.book-done .mono { display: block; margin-top: .6rem; font-size: .68rem; color: var(--faint); letter-spacing: .04em; line-height: 1.6; }

/* ---------- footer ---------- */
.footer { padding: 3rem 0 2.4rem; border-top: 1px solid var(--line); position: relative; z-index: 1; }
.foot-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-bottom: 1.4rem; }
.foot-brand { font-family: var(--font-d); font-weight: 600; font-size: 1.35rem; letter-spacing: .08em; text-transform: uppercase; }
.foot-links { display: flex; flex-wrap: wrap; gap: .3rem; }
.foot-links a { text-decoration: none; color: var(--dim); font-size: .82rem; padding: .35rem .6rem; border-radius: 8px; }
.foot-links a:hover { color: var(--ink); background: var(--line-2); }
.foot-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .68rem; letter-spacing: .02em; color: var(--faint); }
.foot-bottom a { color: var(--accent); text-decoration: none; }
.foot-bottom a:hover { text-decoration: underline; }

/* ---------- reveals (gated behind .js) ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ============================================================
   REDUCED MOTION — kill transforms/reveals/smooth-scroll; the
   lock is rendered solved & the reveal shown (via JS), and the
   candle flicker freezes to a single steady frame.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero-title .line > span { transform: none !important; animation: none !important; }
  .glow-a, .glow-b { animation: none !important; }
  .lock-shackle, .dial-ring, .dial, .lock-reveal, .meter i, .tier::before { transition: none !important; }
  .js .lock-reveal { opacity: 1; transform: none; }
  * { scroll-behavior: auto !important; }
}
