/* Tales of the Duskwhisper
   Three looks built from one set of parts. Night elf pages (.world-elf) are moonlit Teldrassil:
   violet night, silver moonlight, moonwell teal, hanging lanterns. Human pages (.world-storm) are
   Stormwind: blue and gold, lion heraldry, carved stone, with Duskwood's lantern light. The home
   page (.world-home) stands between the two shores. No scripts; all artwork is in /assets/art. */

:root {
  --font-body: "Crimson Pro", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Noto Serif", serif;
  --font-elf: "Cormorant Garamond", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-storm: "Cinzel", "Trajan Pro", "Palatino Linotype", "Book Antiqua", Georgia, serif;

  --elf-night: #07061a; --elf-deep: #100e2c; --elf-panel: #171438; --elf-panel-2: #221d52;
  --elf-violet: #7c67d9; --elf-lilac: #c3b6ff; --elf-moon: #eef1ff; --elf-silver: #bcc3ea; --elf-mist: #9398c4;
  --elf-teal: #6fe4d0; --elf-gold: #dcbb74; --elf-gold-dim: #8c7846;

  --sw-night: #070b16; --sw-deep: #0d1730; --sw-panel: #132245; --sw-panel-2: #1b2f5c;
  --sw-blue: #2f63b8; --sw-sky: #8fb2ec; --sw-gold: #d9b24f; --sw-gold-bright: #f1d57f; --sw-gold-dim: #8a7232;
  --sw-stone-light: #aab1c2; --sw-ivory: #f0e9d8; --sw-parchment: #d2c8b0; --sw-amber: #ffb347;

  --blood: #c9665a;
}

.world-elf, .world-home {
  --bg: var(--elf-night); --bg-2: var(--elf-deep);
  --panel: var(--elf-panel); --panel-2: var(--elf-panel-2);
  --text: var(--elf-moon); --text-2: var(--elf-silver); --muted: var(--elf-mist);
  --accent: var(--elf-teal); --accent-2: var(--elf-lilac);
  --gold: var(--elf-gold); --gold-dim: var(--elf-gold-dim);
  --font-display: var(--font-elf);
  --glow: 124, 103, 217;
  --line: rgba(220, 187, 116, 0.38);
}
.world-storm {
  --bg: var(--sw-night); --bg-2: var(--sw-deep);
  --panel: var(--sw-panel); --panel-2: var(--sw-panel-2);
  --text: var(--sw-ivory); --text-2: var(--sw-parchment); --muted: var(--sw-stone-light);
  --accent: var(--sw-sky); --accent-2: var(--sw-amber);
  --gold: var(--sw-gold); --gold-dim: var(--sw-gold-dim);
  --font-display: var(--font-storm);
  --glow: 47, 99, 184;
  --line: rgba(217, 178, 79, 0.45);
}
.world-home { --bg: #08091c; --bg-2: #0d1130; --glow: 90, 100, 200; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.7;
  background: var(--bg);
}
body.world-elf {
  background:
    radial-gradient(1100px 560px at 50% -220px, rgba(124, 103, 217, 0.34), transparent 70%),
    radial-gradient(700px 500px at 0% 45%, rgba(111, 228, 208, 0.06), transparent 70%),
    linear-gradient(180deg, var(--elf-night), var(--elf-deep) 38%, var(--elf-night));
}
body.world-storm {
  background:
    radial-gradient(1100px 560px at 50% -220px, rgba(47, 99, 184, 0.36), transparent 70%),
    radial-gradient(700px 420px at 100% 35%, rgba(255, 179, 71, 0.05), transparent 70%),
    linear-gradient(180deg, var(--sw-night), var(--sw-deep) 38%, var(--sw-night));
}
body.world-home {
  background: linear-gradient(100deg, #0f0d2c 0%, #090a1f 46%, #090d22 54%, #0d1b38 100%);
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover, a:focus-visible { color: var(--text); }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
img { display: block; }

.skip { position: absolute; left: -999px; top: 8px; padding: 8px 14px; background: var(--gold); color: #000; z-index: 9; }
.skip:focus { left: 8px; }

/* ---- top bar ---------------------------------------------------------------- */
.topbar {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1120px; margin: 0 auto; padding: 16px 22px 0;
  font-size: 0.74rem; letter-spacing: 0.24em; text-transform: uppercase;
}
.topbar .mark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 0.92rem; letter-spacing: 0.2em; color: var(--gold);
}
.topbar .mark svg { width: 24px; height: 24px; flex: none; }
.topbar nav a { color: var(--muted); margin-left: 22px; white-space: nowrap; }
.topbar nav a:hover, .topbar nav a:focus-visible { color: var(--gold); }

/* ---- hero: sky, scenery, title --------------------------------------------- */
.hero { position: relative; overflow: hidden; text-align: center; }
.hero .sky, .hero .scene, .hero .fade { position: absolute; inset: 0; pointer-events: none; }
.hero .sky { background: url(/assets/art/stars.svg) 0 0 / 420px 420px repeat; opacity: 0.85; }
.hero .sky::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(300px 300px at 50% 42%, rgba(var(--glow), 0.45), rgba(var(--glow), 0) 70%);
}
.hero .scene { background-repeat: no-repeat; background-size: auto 100%; background-position: left bottom; }
.hero .scene-r { transform: scaleX(-1); }
.hero-elf .scene { background-image: url(/assets/art/boughs.svg); }
.hero-storm .scene { background-image: url(/assets/art/towers.svg); }
.hero-home .scene-l { background-image: url(/assets/art/boughs.svg); }
.hero-home .scene-r { background-image: url(/assets/art/towers.svg); }
.hero .fade { top: auto; height: 140px; background: linear-gradient(180deg, rgba(0, 0, 0, 0), var(--bg)); }

.hero-inner { position: relative; z-index: 1; max-width: 780px; margin: 0 auto; padding: 44px 22px 60px; }
.hero-home .hero-inner { padding: 60px 22px 90px; }
.hero .sigil { width: 118px; height: 118px; margin: 0 auto; filter: drop-shadow(0 0 24px rgba(var(--glow), 0.6)); }
.hero-storm .sigil { width: 104px; height: 114px; filter: drop-shadow(0 0 22px rgba(217, 178, 79, 0.35)); }

.hero h1 {
  margin: 14px 0 6px;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.1rem, 6vw, 3.9rem); line-height: 1.08;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 34px rgba(var(--glow), 0.55), 0 2px 0 rgba(0, 0, 0, 0.7);
}
.hero-storm h1 { font-size: clamp(1.6rem, 4.6vw, 2.9rem); letter-spacing: 0.14em; }
.hero h1 a { color: inherit; }
.hero .tagline {
  margin: 0; color: var(--text-2); font-style: italic; font-size: 1.12rem; letter-spacing: 0.04em;
}
.hero-home .tagline { font-family: var(--font-storm); font-style: normal; font-size: 0.86rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--accent-2); }

.worlds { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 22px; margin: 34px 0 0; font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; }
.worlds a { padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-2); background: rgba(8, 9, 28, 0.55); }
.worlds a:hover, .worlds a:focus-visible { color: var(--gold); border-color: var(--gold); }
.worlds .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }

.crumb { display: inline-block; margin-bottom: 18px; font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--accent); }
.medal {
  display: inline-grid; place-items: center;
  width: 78px; height: 78px; margin: 14px auto 0;
  border-radius: 50%; border: 1px solid var(--gold);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--gold-dim), 0 0 34px rgba(var(--glow), 0.55);
  font-family: var(--font-display); font-size: 2rem; color: var(--gold);
  background: radial-gradient(circle at 50% 36%, var(--panel-2), var(--bg) 85%);
}
.world-storm .medal { border-radius: 12% 12% 50% 50% / 12% 12% 62% 62%; font-size: 1.5rem; }
.hero .era { margin: 10px 0 0; font-size: 0.72rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--accent); }
.epigraph {
  position: relative; max-width: 560px; margin: 20px auto 0; padding: 0 22px;
  font-style: italic; font-size: 1.15rem; color: var(--text-2);
}
.epigraph::before, .epigraph::after {
  position: absolute; top: -14px; font-family: var(--font-elf); font-size: 2.6rem; line-height: 1; color: var(--gold-dim);
}
.epigraph::before { content: "\201C"; left: -4px; }
.epigraph::after { content: "\201D"; right: -4px; }

/* wisps on Teldrassil pages, lantern motes on Stormwind pages */
.wisp {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 16px 6px rgba(111, 228, 208, 0.45);
  opacity: 0.6; pointer-events: none;
  animation: drift 24s ease-in-out infinite alternate;
}
.world-storm .wisp { background: var(--sw-amber); box-shadow: 0 0 14px 5px rgba(255, 179, 71, 0.4); animation-duration: 18s; }
.wisp.w1 { left: 12%; top: 64%; }
.wisp.w2 { left: 84%; top: 40%; animation-duration: 31s; animation-delay: -11s; }
.wisp.w3 { left: 56%; top: 78%; width: 4px; height: 4px; animation-duration: 27s; animation-delay: -5s; }
@keyframes drift {
  from { transform: translate(0, 0); opacity: 0.15; }
  50% { opacity: 0.7; }
  to { transform: translate(40px, -90px); opacity: 0.2; }
}
@media (prefers-reduced-motion: reduce) {
  .wisp { animation: none; }
  .tale, a { transition: none; }
}

/* ---- painted artwork (when the generated images are present) ------------------------- */
.hero.has-art { min-height: 600px; display: grid; align-items: end; }
.hero.has-art .hero-inner { padding-top: 250px; padding-bottom: 54px; }
.hero-home.has-art { min-height: 760px; }
.hero-home.has-art .hero-inner { padding-top: 330px; padding-bottom: 70px; }
.hero .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.hero .veil {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 4, 14, 0.38) 0%, rgba(4, 4, 14, 0.04) 28%, rgba(4, 4, 14, 0.5) 60%, var(--bg) 100%);
}
.hero.has-art .fade { display: none; }
.hero.has-art h1 { text-shadow: 0 2px 4px #000, 0 0 30px rgba(0, 0, 0, 0.9), 0 0 50px rgba(var(--glow), 0.5); }
.hero.has-art .tagline, .hero.has-art .era, .hero.has-art .crumb, .hero.has-art .epigraph { text-shadow: 0 1px 3px #000, 0 0 18px rgba(0, 0, 0, 0.9); }
.hero.has-art .sigil { filter: drop-shadow(0 2px 4px #000) drop-shadow(0 0 20px rgba(var(--glow), 0.6)); }
.hero.has-art:not(.hero-home) .sigil { display: none; }
.hero.has-art:not(.hero-home) .crumb { display: block; margin-bottom: 14px; }
.hero.has-art:not(.hero-home) .medal { display: grid; margin: 0 auto; }
.hero.has-art .medal { box-shadow: 0 0 0 4px rgba(4, 4, 14, 0.8), 0 0 0 5px var(--gold-dim), 0 0 34px rgba(0, 0, 0, 0.8); }
.hero.has-art .worlds a { background: rgba(4, 4, 14, 0.7); }

.book { overflow: hidden; }
.book .band {
  position: absolute; left: 0; top: 0; width: 100%; height: 340px; object-fit: cover; object-position: center 40%;
  opacity: 0.85; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 20%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 20%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
}
.book.has-band { padding-top: 60px; }
.book.has-band .book-head { position: relative; }
.book.has-band .book-head::before {
  content: ""; position: absolute; inset: -40px -60px -20px; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, var(--bg) 40%, rgba(0, 0, 0, 0) 100%); opacity: 0.85;
}
.book.has-band .book-head { z-index: 1; }
.portrait {
  display: block; width: 150px; height: 150px; margin: 0 auto 12px; border-radius: 50%; object-fit: cover; object-position: center 20%;
  border: 2px solid var(--gold); box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px var(--gold-dim), 0 0 44px rgba(var(--glow), 0.6);
}
/* poster cards: the painting fills the card and the words sit over its lower edge */
.tale:has(> .thumb) {
  aspect-ratio: 1 / 1; min-height: 0; width: 100%; align-content: end;
  padding: 20px; border-radius: 6px; overflow: hidden; isolation: isolate;
}
.tale:has(> .thumb) p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.tale:has(> .thumb) h3 { font-size: 1.4rem; }
.tale:has(> .thumb) .thumb {
  position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; margin: 0;
  object-fit: cover; object-position: center 30%; border: 0; border-radius: 0; filter: none;
  transition: transform 0.7s ease;
}
.tale:has(> .thumb)::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 5, 16, 0) 34%, rgba(5, 5, 16, 0.55) 62%, rgba(5, 5, 16, 0.95) 100%);
}
.tale:has(> .thumb)::after { z-index: 2; border-color: rgba(255, 255, 255, 0.12); }
.tale:has(> .thumb) > :not(.thumb) { position: relative; z-index: 2; }
.tale:has(> .thumb) .num { grid-row: 1 / span 4; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); background: rgba(5, 5, 16, 0.75); }
.tale:has(> .thumb) h3 { text-shadow: 0 1px 3px #000, 0 0 16px rgba(0, 0, 0, 0.9); }
.tale:has(> .thumb) p, .tale:has(> .thumb) .era, .tale:has(> .thumb) .reads { text-shadow: 0 1px 2px #000, 0 0 12px rgba(0, 0, 0, 0.9); }
.tale:has(> .thumb):hover .thumb, .tale:has(> .thumb):focus-visible .thumb { transform: scale(1.05); }
.tales:has(> li:only-child) { grid-template-columns: minmax(290px, 560px); }

/* ---- ornamental rules ------------------------------------------------------- */
.rule { display: flex; align-items: center; justify-content: center; gap: 14px; max-width: 560px; margin: 0 auto; color: var(--gold-dim); }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dim)); }
.rule::after { background: linear-gradient(90deg, var(--gold-dim), transparent); }
.rule svg { height: 22px; width: auto; flex: none; }

/* ---- books on the home page --------------------------------------------------- */
.books { max-width: 1120px; margin: -30px auto 0; padding: 0 22px 20px; display: grid; gap: 54px; position: relative; z-index: 2; }
.book {
  position: relative;
  padding: 44px 34px 38px;
  border: 1px solid var(--line); border-radius: 6px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(var(--glow), 0.16), rgba(var(--glow), 0) 34%),
    linear-gradient(180deg, var(--panel), var(--bg-2) 70%);
  box-shadow: inset 0 0 0 5px var(--bg), inset 0 0 0 6px rgba(var(--glow), 0.25), 0 30px 70px rgba(0, 0, 0, 0.5);
}
.book.world-storm {
  background:
    linear-gradient(180deg, rgba(47, 99, 184, 0.22), rgba(13, 23, 48, 0.1) 40%, rgba(13, 23, 48, 0.55)),
    url(/assets/art/stone.svg) 0 0 / 120px 80px repeat,
    var(--sw-panel);
  box-shadow: inset 0 0 0 5px var(--sw-night), inset 0 0 0 6px var(--sw-gold-dim), 0 30px 70px rgba(0, 0, 0, 0.55);
}
.book::before, .book::after {
  content: ""; position: absolute; width: 26px; height: 26px; pointer-events: none;
  border-color: var(--gold); border-style: solid; border-width: 0; opacity: 0.8;
}
.book::before { top: 10px; left: 10px; border-top-width: 1px; border-left-width: 1px; }
.book::after { bottom: 10px; right: 10px; border-bottom-width: 1px; border-right-width: 1px; }

.book-head { text-align: center; max-width: 660px; margin: 0 auto 30px; }
.book-head .sigil { width: 84px; height: 84px; margin: 0 auto 6px; filter: drop-shadow(0 0 18px rgba(var(--glow), 0.55)); }
.world-storm .book-head .sigil { width: 76px; height: 84px; }
.book-label { margin: 0; font-size: 0.72rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--accent); }
.book h2 {
  margin: 6px 0 2px;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.8rem, 4.4vw, 2.6rem); line-height: 1.1; letter-spacing: 0.08em;
  color: var(--gold); text-shadow: 0 0 26px rgba(var(--glow), 0.45);
}
.world-storm h2 { text-transform: uppercase; letter-spacing: 0.14em; font-size: clamp(1.35rem, 3.6vw, 2rem); }
.book-sub { margin: 0 0 12px; font-style: italic; color: var(--text-2); font-size: 1.08rem; }
.book .intro { margin: 0; color: var(--text-2); }
.book .rule { margin-top: 22px; }

/* ---- chapter cards ---------------------------------------------------------- */
.tales {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px;
}
.tales li { display: grid; }
.tales:has(> li:only-child) { grid-template-columns: minmax(290px, 460px); justify-content: center; }
.tale {
  --pad: 22px;
  position: relative;
  display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 2px 18px; align-content: start;
  padding: var(--pad) var(--pad) 20px;
  border: 1px solid var(--line); border-radius: 4px;
  background: linear-gradient(165deg, var(--panel-2), var(--panel) 55%, var(--bg-2));
  color: var(--text);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.tale::after {
  content: ""; position: absolute; inset: 5px; pointer-events: none; border-radius: 2px;
  border: 1px solid rgba(var(--glow), 0.22);
}
.world-storm .tale { background: linear-gradient(165deg, rgba(27, 47, 92, 0.95), rgba(19, 34, 69, 0.96) 55%, rgba(10, 18, 38, 0.98)), url(/assets/art/stone.svg) 0 0 / 120px 80px repeat; }
.tale:hover, .tale:focus-visible {
  transform: translateY(-3px); border-color: var(--gold); color: var(--text);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55), 0 0 36px rgba(var(--glow), 0.35);
}
.tale .thumb {
  grid-column: 1 / -1; min-width: 0;
  width: calc(100% + 2 * var(--pad)); height: auto;
  margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) 16px;
  border-bottom: 1px solid var(--line); border-radius: 3px 3px 0 0;
  filter: saturate(0.9);
}
.tale .num {
  grid-row: 2 / span 4; align-self: start;
  display: grid; place-items: center; width: 56px; height: 56px;
  border-radius: 50%; border: 1px solid var(--gold-dim);
  font-family: var(--font-display); font-size: 1.45rem; color: var(--gold);
  background: radial-gradient(circle at 50% 35%, var(--panel-2), var(--bg) 90%);
  box-shadow: 0 0 18px rgba(var(--glow), 0.35);
}
.world-storm .tale .num { border-radius: 12% 12% 50% 50% / 12% 12% 62% 62%; font-size: 1.1rem; }
.tale .era { font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); }
.tale h3 { margin: 2px 0 4px; font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; line-height: 1.18; color: var(--text); }
.world-storm .tale h3 { text-transform: uppercase; letter-spacing: 0.06em; font-size: 1.02rem; line-height: 1.35; }
.tale p { margin: 0; font-style: italic; font-size: 0.98rem; line-height: 1.5; color: var(--text-2); }
.tale .reads { margin-top: 10px; font-size: 0.72rem; letter-spacing: 0.1em; color: var(--muted); }
.mature { font-weight: 400; color: #e49a90; letter-spacing: 0.14em; text-transform: uppercase; }

/* ---- ink-sketch plates ----------------------------------------------------------- */
.plate {
  margin: 0 0 26px; padding: 12px;
  border: 1px solid var(--line); border-radius: 4px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: inset 0 0 0 5px var(--bg), inset 0 0 0 6px rgba(var(--glow), 0.3), 0 22px 50px rgba(0, 0, 0, 0.5);
}
.plate img { display: block; width: 100%; height: auto; border: 1px solid rgba(0, 0, 0, 0.45); }
.plate figcaption {
  margin: 12px 0 2px; text-align: center;
  font-size: 0.7rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted);
}
.plate-wide { position: relative; z-index: 2; max-width: 980px; margin: -48px auto 54px; padding: 14px; }

/* ---- story page ------------------------------------------------------------- */
.story { position: relative; z-index: 2; max-width: 760px; margin: -36px auto 0; padding: 0 20px 20px; }
.notice {
  display: inline-block; margin-top: 18px; padding: 6px 16px;
  border: 1px solid var(--blood); border-radius: 3px; background: rgba(201, 102, 90, 0.1);
  color: #e8a79d; font-size: 0.78rem; letter-spacing: 0.08em;
}
.prose {
  padding: 44px 46px;
  border: 1px solid var(--line); border-radius: 4px;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  box-shadow: inset 0 0 0 5px var(--bg), inset 0 0 0 6px rgba(var(--glow), 0.3), 0 26px 60px rgba(0, 0, 0, 0.55);
  font-size: 1.08rem; line-height: 1.78;
}
.world-storm .prose {
  background: linear-gradient(180deg, rgba(19, 34, 69, 0.97), rgba(13, 23, 48, 0.985)), url(/assets/art/stone.svg) 0 0 / 120px 80px repeat;
  box-shadow: inset 0 0 0 5px var(--sw-night), inset 0 0 0 6px var(--sw-gold-dim), 0 26px 60px rgba(0, 0, 0, 0.6);
}
.prose p { margin: 0 0 1.1em; }
.prose p:last-child { margin-bottom: 0; }
.prose em { color: var(--text-2); }
.prose .scene { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 1.9em 0; color: var(--gold-dim); }
.prose .scene::before, .prose .scene::after { content: ""; width: 64px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dim)); }
.prose .scene::after { background: linear-gradient(90deg, var(--gold-dim), transparent); }
.prose .scene svg { height: 26px; width: auto; }
.prose > p:first-of-type::first-letter, .prose .scene + p::first-letter {
  float: left;
  font-family: var(--font-display); font-weight: 500;
  font-size: 4.4em; line-height: 0.78; padding: 0.1em 0.12em 0 0;
  color: var(--gold); text-shadow: 0 0 20px rgba(var(--glow), 0.55);
}
.world-storm .prose > p:first-of-type::first-letter, .world-storm .prose .scene + p::first-letter { font-size: 3.6em; line-height: 0.9; }

.pager { display: flex; justify-content: space-between; gap: 14px; margin: 26px 0 0; }
.pager a {
  flex: 1; padding: 14px 18px;
  border: 1px solid var(--line); border-radius: 4px;
  background: rgba(var(--glow), 0.1); color: var(--text); font-family: var(--font-display); font-size: 1.1rem;
}
.world-storm .pager a { font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.08em; }
.pager a:hover, .pager a:focus-visible { border-color: var(--gold); background: rgba(var(--glow), 0.2); }
.pager small { display: block; margin-bottom: 2px; font-family: var(--font-body); font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); }
.pager .next { text-align: right; }
.pager .gap { flex: 1; }

.chapters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 30px 0 0; }
.chapters .lbl { width: 100%; margin-bottom: 4px; text-align: center; font-size: 0.66rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); }
.chapters a, .chapters b {
  display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 10px;
  border-radius: 50%; border: 1px solid var(--line);
  font-family: var(--font-display); font-weight: 500; font-size: 0.98rem; color: var(--muted);
}
.world-storm .chapters a, .world-storm .chapters b { font-size: 0.78rem; }
.chapters a:hover, .chapters a:focus-visible { color: var(--gold); border-color: var(--gold); }
.chapters b { color: #0a0a18; background: var(--gold); border-color: var(--gold); box-shadow: 0 0 18px rgba(var(--glow), 0.5); }

.home-link { margin: 26px 0 0; text-align: center; font-size: 0.76rem; letter-spacing: 0.26em; text-transform: uppercase; }

/* ---- submission form, readers' tales and the review page ----------------------------- */
.panel {
  padding: 34px 40px;
  border: 1px solid var(--line); border-radius: 4px;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55);
}
.panel + .panel, .panel + .prose { margin-top: 18px; }
.panel .intro { text-align: left; max-width: none; margin-bottom: 18px; }
.tale-form label { display: block; margin: 0 0 16px; font-size: 0.9rem; letter-spacing: 0.04em; color: var(--text-2); }
.tale-form input[type="text"], .tale-form input:not([type]), .tale-form select, .tale-form textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 3px;
  background: rgba(4, 4, 14, 0.55); color: var(--text);
  font: inherit; font-size: 1rem; line-height: 1.5;
}
.tale-form textarea { min-height: 320px; resize: vertical; }
.tale-form input:focus, .tale-form select:focus, .tale-form textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.tale-form .check { display: flex; gap: 10px; align-items: flex-start; }
.tale-form .check input { margin-top: 5px; accent-color: var(--gold); }
.tale-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tale-form .actions, .cta { margin: 22px 0 0; text-align: center; }
.tale-form button, .cta a, .decide button {
  display: inline-block; padding: 12px 26px; cursor: pointer;
  border: 1px solid var(--gold); border-radius: 999px;
  background: rgba(var(--glow), 0.25); color: var(--gold);
  font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.1em; text-transform: uppercase;
}
.tale-form button:hover, .cta a:hover, .decide button:hover { background: var(--gold); color: #0a0a18; }
.decide button.quiet { border-color: var(--line); color: var(--muted); background: transparent; }
.decide button.quiet:hover { border-color: var(--blood); color: #fff; background: var(--blood); }
.invite .book-head { margin-bottom: 0; }
.review-item h3 { margin: 4px 0; font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; }
.review-item h3 a { color: var(--text); }
.review-item .byline { margin: 0 0 10px; color: var(--text-2); font-style: italic; }
.review-item .preview { margin: 0 0 16px; color: var(--text-2); white-space: pre-line; font-size: 0.98rem; }
.review-item .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.review-item .readfull { margin-left: auto; font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; }
.decide { margin: 0; }

/* ---- lost page ---------------------------------------------------------------- */
.lost { max-width: 620px; margin: 0 auto; padding: 10px 22px 40px; text-align: center; color: var(--text-2); }

/* ---- footer ------------------------------------------------------------------- */
footer {
  max-width: 760px; margin: 40px auto 0; padding: 26px 20px 60px;
  text-align: center; color: var(--muted); font-size: 0.8rem; line-height: 1.6;
}
footer .rule { margin-bottom: 18px; }
footer .node { color: var(--accent); font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; }
footer p { margin: 6px auto; max-width: 620px; }

/* ---- smaller screens ------------------------------------------------------------- */
@media (max-width: 760px) {
  body { font-size: 18px; }
  .hero .scene { background-size: auto 58%; }
  .hero-home .scene { background-size: auto 46%; }
  .hero-inner { padding: 36px 18px 54px; }
  .hero-home .hero-inner { padding: 44px 18px 80px; }
  .hero .sigil { width: 96px; height: 96px; }
  .topbar { padding: 14px 16px 0; }
  .topbar nav a { margin-left: 14px; }
  .books { padding: 0 14px 20px; gap: 40px; }
  .book { padding: 34px 18px 28px; }
  .tales { grid-template-columns: 1fr; }
  .tale { --pad: 16px; grid-template-columns: 48px minmax(0, 1fr); gap: 2px 14px; padding: var(--pad) var(--pad) 18px; }
  .plate { padding: 8px; }
  .plate-wide { margin: -30px 14px 40px; }
  .hero.has-art { min-height: 480px; }
  .hero.has-art .hero-inner { padding-top: 170px; }
  .hero-home.has-art { min-height: 560px; }
  .hero-home.has-art .hero-inner { padding-top: 220px; }
  .tale:has(> .thumb) { aspect-ratio: 4 / 3; padding: 16px; }
  .book .band { height: 260px; }
  .tale .num { width: 46px; height: 46px; font-size: 1.2rem; }
  .story { padding: 0 14px 20px; }
  .prose { padding: 30px 20px; }
  .pager { flex-direction: column; }
  .pager .next { text-align: left; }
}
@media (max-width: 460px) {
  .topbar nav { display: none; }
  .hero h1 { letter-spacing: 0.06em; }
}
