/* Dungeon Train landing page. Self-contained; the palette and buttons match mods/mods.css and
   items/items.css on purpose so the whole /dungeontrain/ site reads as one. The faces are self-hosted
   (fonts/, SIL Open Font License — see the OFL-*.txt beside them). */

@font-face {
  font-family: "Big Shoulders Display"; font-weight: 900; font-style: normal; font-display: swap;
  src: url("fonts/big-shoulders-display-900.woff2") format("woff2");
}
@font-face {
  font-family: "Karla"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("fonts/karla-500.woff2") format("woff2");
}
@font-face {
  font-family: "Silkscreen"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("fonts/silkscreen-400.woff2") format("woff2");
}

:root {
  --bg: #151816;
  --panel: #1d211e;
  --panel-2: #252a26;
  --line: #3a413b;
  --ink: #e4e8e1;
  --muted: #99a397;
  --accent: #8cc45e;
  --on-accent: #0f1a0b;
  --story: #dfe5dc;
  --radius: 10px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --tell: "Karla", var(--sans);
  --pixel: "Silkscreen", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans);
}

/* ---- Backdrop (backdrop.js): two photo layers that crossfade slowly, under a shade ---- */
.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: var(--bg); }
.backdrop img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 55%;
  opacity: 0; transition: opacity 3s ease; filter: brightness(0.66) saturate(0.95);
}
.backdrop img.on { opacity: 1; }
/* Keeps the words legible: darkest behind the title and line, lighter towards the edges. */
.backdrop::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(8, 10, 9, 0.62), rgba(8, 10, 9, 0.25) 80%);
}
@media (prefers-reduced-motion: reduce) { .backdrop img { transition: none; } }
/* Live Feed (livebg.js): a streamer's view over the photos and under the shade, only once it plays. */
.backdrop video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.6s ease; filter: brightness(0.66) saturate(0.95);
}
.backdrop video.on { opacity: 1; }
/* "● live footage" under the nav logo, with the video (livebg.js toggles .on alongside it). */
.live-tag {
  position: absolute; top: 48px; left: 24px; z-index: 21; display: flex; align-items: center; gap: 8px; margin: 0;
  color: var(--ink); font: 11px/1 var(--pixel); letter-spacing: 0.06em; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  opacity: 0; transition: opacity 1.6s ease; pointer-events: none;
}
.live-tag.on { opacity: 1; }
/* .live-dot itself is in nav.css, shared with the nav's Live link. */
@media (max-width: 760px) { .live-tag { top: 42px; left: 16px; } }

.hero, .foot { position: relative; z-index: 1; }
a { color: var(--accent); }
.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ---- Hero: kicker, title, the story line, buttons ---- */
.hero {
  flex: 1; max-width: none; display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 22px; text-align: center; padding: 60px clamp(24px, 10vw, 160px) 40px;
}
.kicker {
  margin: 0 0 -6px; color: var(--accent); font: 12px/1 var(--pixel); letter-spacing: 0.08em; text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}
h1 {
  margin: 0; font: 900 clamp(60px, 10vw, 160px)/0.9 var(--display); text-transform: uppercase; letter-spacing: 0.005em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.55), 0 1px 2px rgba(0, 0, 0, 0.5);
}
/* The story line (tagline.js) is the centrepiece: always one row — tagline.js sets one font size that
   fits the widest line in this box — so the buttons below never move. .fading is the 300 ms swap. The
   full width and will-change keep the box and its layer fixed — otherwise Safari repaints only the new,
   shorter line's box after a fade and leaves the old line's ends on screen. */
.lede-wrap { position: relative; width: 100%; max-width: 820px; margin: 10px 0 14px; }
.lede {
  width: 100%; margin: 0; white-space: nowrap; will-change: opacity; transition: opacity 0.3s;
  font: 500 24px/1.25 var(--tell); min-height: 1.25em; color: var(--story);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.7), 0 1px 3px rgba(0, 0, 0, 0.6);
}
.lede.fading { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .lede { transition: none; } }
/* Speed + read-aloud controls (tagline.js) sit under the line and show while the pointer is near it
   or a control has focus; touch screens (no hover) reveal them on a touch instead. They are absolutely
   placed, so showing them never moves the buttons below. */
.lede-controls {
  position: absolute; left: 0; right: 0; top: 100%; display: flex; justify-content: center; gap: 4px; margin-top: 6px;
  opacity: 0; transition: opacity 0.2s;
}
.lede-controls[hidden] { display: none; }
.lede-controls:has(:focus-visible) { opacity: 1; } /* keyboard focus — a tapped button's focus doesn't count */
@media (hover: hover) { .lede-wrap:hover .lede-controls { opacity: 1; } } /* phones keep a sticky :hover after a tap */
/* Touch screens have no hover: the controls stay hidden — and untappable, so a stray tap can't change
   the speed — until the line is touched (tagline.js sets .touched, cleared after a pause). */
@media (hover: none) {
  .lede-controls { pointer-events: none; }
  .lede-wrap.touched .lede-controls { opacity: 1; }
  .lede-wrap.armed .lede-controls { pointer-events: auto; }
}
.lede-controls button {
  padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); cursor: pointer;
  background: rgba(21, 24, 22, 0.7); color: var(--muted); font: 13px/1.4 var(--sans);
}
.lede-controls button:hover { border-color: var(--accent); color: var(--ink); }
.lede-controls button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

.cta { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 18px; border-radius: 8px; border: 1px solid var(--line); white-space: nowrap;
  background: rgba(21, 24, 22, 0.7); color: var(--ink); font: inherit; text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }

.foot { padding: 30px 20px 50px; color: var(--muted); font-size: 14px; text-align: center; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 0; }
.foot nav a { padding: 0 10px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); }
.foot nav a + a { border-left: 1px solid var(--line); }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 600px) {
  .hero { padding: 48px 24px 32px; gap: 18px; }
  .cta { gap: 6px; }
  .btn { padding: 8px 12px; font-size: 14px; }
}
