/* ============================================================================
   DNDHubTH — "Adventurer's Call" design system  (v2)
   ----------------------------------------------------------------------------
   DNA borrowed from the savageland landing: ink/bone/gold/vermilion palette,
   Cinzel display + Thai serif body, film-grain + vignette atmosphere,
   scene-based scrollytelling landing with CSS scroll-driven animations.

   Structure of this file (keep this order when editing):
     1. Tokens (dark default + [data-theme="light"])
     2. Base / typography / atmosphere overlays
     3. App components (nav, cards, buttons, badges, forms, tables,
        calendar, reviews, QR) — ALL class names preserved from v1
     4. Landing scenes (.scene, .hero-*, .reveal, parallax layers)
     5. Motion (scroll-driven @supports + .in-view fallback + reduced-motion)
     6. Responsive
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Noto+Serif+Thai:wght@300;400;500;600;700&display=swap');

/* ---------- 1. Tokens ---------- */
:root {
  --ink: #08070b;
  --ink-2: #0e0c12;
  --surface: #14111a;
  --surface-raised: #1a1622;
  --line: rgba(230, 220, 195, 0.14);
  --line-strong: rgba(230, 220, 195, 0.30);

  --bone: #e6dcc3;
  --bone-dim: #9a8f74;

  --gold: #c9a227;
  --gold-soft: #e3c76a;
  --vermilion: #d4482a;
  --vermilion-deep: #a33017;
  --arcane: #4e8d6e;

  /* semantic */
  --bg-color: var(--ink);
  --surface-color: var(--surface);
  --border-color: var(--line);
  --border-gold: var(--gold);
  --text-color: var(--bone);
  --text-muted: var(--bone-dim);
  --accent-gold: var(--gold);
  --accent-gold-bright: var(--gold-soft);
  --accent-crimson: var(--vermilion);
  --success-color: #6fae8b;
  --danger-color: #e06a50;
  --warning-color: #d9a441;

  --btn-primary-bg: linear-gradient(180deg, var(--vermilion), var(--vermilion-deep));
  --btn-primary-text: #f7efe0;
  --btn-secondary-bg: transparent;
  --btn-secondary-text: var(--bone);

  --card-bg: linear-gradient(165deg, var(--surface) 0%, var(--ink-2) 100%);
  --card-shadow: 0 14px 44px rgba(0, 0, 0, 0.5);

  --ring: 0 0 0 3px rgba(201, 162, 39, 0.35);
  --font-display: 'Cinzel', 'Noto Serif Thai', serif;
  --font-body: 'Noto Serif Thai', Georgia, serif;

  /* landing scene bgs (scene transitions interpolate between these) */
  --scene-hero: #08070b;
  --scene-tables: #0d0b12;
  --scene-gm: #180a08;
  --scene-dm: #0b100d;
  --scene-cta: #08070b;
}

[data-theme="light"] {
  --ink: #efe8d8;
  --ink-2: #e7ddc6;
  --surface: #f7f1e2;
  --surface-raised: #fffaef;
  --line: rgba(43, 32, 19, 0.16);
  --line-strong: rgba(43, 32, 19, 0.35);

  --bone: #2b2013;
  --bone-dim: #6d5c42;

  --gold: #8a6a14;
  --gold-soft: #6e5410;
  --vermilion: #b23a1e;
  --vermilion-deep: #8c2a12;

  --bg-color: var(--ink);
  --surface-color: var(--surface);
  --text-color: var(--bone);
  --text-muted: var(--bone-dim);
  --success-color: #2f6b4d;
  --danger-color: #a02c24;

  --card-bg: linear-gradient(165deg, var(--surface-raised) 0%, var(--surface) 100%);
  --card-shadow: 0 10px 30px rgba(75, 55, 20, 0.16);
  --ring: 0 0 0 3px rgba(178, 58, 30, 0.3);

  --scene-hero: #efe8d8;
  --scene-tables: #eee4cf;
  --scene-gm: #f2e3d8;
  --scene-dm: #e9ecdf;
  --scene-cta: #efe8d8;
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--gold) var(--bg-color);
  background: var(--bg-color);
}

body {
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--text-color);
  background: var(--bg-color);
  min-height: 100vh;
  overflow-x: hidden;
}

/* film grain over everything (savageland signature) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* vignette */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 59;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.5) 100%);
}
[data-theme="light"] body::before {
  background: radial-gradient(ellipse 120% 90% at 50% 45%, transparent 60%, rgba(75, 55, 20, 0.18) 100%);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-bottom: 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.18rem; }

a { color: var(--gold-soft); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--gold); }

/* keyboard focus everywhere — .btn already had this, nothing else did.
   box-shadow only: it follows each element's own border-radius, so pills stay pills. */
:focus-visible { outline: none; box-shadow: var(--ring); }
p { margin-bottom: 0.8rem; }

code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.85em;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.15em 0.45em;
  word-break: break-all;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem 1.4rem 6rem;
}

/* small gold editorial kicker — use above any heading */
.kicker {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 0.9rem;
}
.kicker::after {
  content: "";
  display: inline-block;
  vertical-align: middle;
  width: 3rem;
  height: 1px;
  margin-left: 0.8rem;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.title-gradient {
  background: linear-gradient(115deg, var(--gold-soft), var(--gold) 50%, var(--vermilion));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 3. App components ---------- */

/* nav — bar collapses into one <details> disclosure below 860px */
body > header {
  position: sticky;
  top: 0;
  /* above the vignette (59) and grain (60) so the bar and its dropdown stay
     crisp; both overlays are pointer-events: none, nothing else is stacked */
  z-index: 61;
  background: color-mix(in srgb, var(--bg-color) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.6rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  white-space: nowrap;
  color: var(--text-color);
}
.nav-logo img { height: 34px; width: auto; object-fit: contain; border-radius: 4px; }
.nav-logo i { font-style: normal; color: var(--gold); }

.nav-bar { display: flex; align-items: center; gap: 1.6rem; }
.nav-actions { display: flex; align-items: center; gap: 0.55rem; }

.nav-links { display: flex; align-items: center; gap: 1.6rem; list-style: none; }
.nav-links a {
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: var(--text-muted);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}
.nav-links a:hover { color: var(--text-color); border-bottom-color: var(--gold); }

.nav-cta {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: var(--text-muted);
}
a.nav-cta:hover { color: var(--text-color); }
a.nav-cta.btn { color: var(--btn-secondary-text); }
a.nav-cta.btn:hover { color: var(--gold-soft); }

.btn-theme-toggle {
  flex: none;
  background: transparent;
  color: var(--text-color);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  width: 2.3rem;
  height: 2.3rem;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.btn-theme-toggle:hover { border-color: var(--gold); transform: rotate(-15deg); }

/* the disclosure: account menu on desktop, whole nav on mobile */
.nav-menu { position: relative; }
.nav-menu > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.3rem;
  padding: 0 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
  color: var(--text-color);
  transition: border-color 0.2s ease;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary:hover,
.nav-menu[open] > summary { border-color: var(--gold); }
.nav-menu > summary:focus-visible { outline: none; box-shadow: var(--ring); }

.nav-avatar {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: linear-gradient(150deg, var(--gold-soft), var(--gold));
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}
.nav-chip-name {
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.nav-burger { font-size: 1.05rem; line-height: 1; padding: 0 0.15rem; }

.nav-panel {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  min-width: 15rem;
  max-width: min(20rem, calc(100vw - 2rem));
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
}
.nav-panel > a,
.nav-panel-links a {
  display: flex;
  align-items: center;
  min-height: 44px; /* touch target */
  padding: 0 0.7rem;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.nav-panel > a:hover,
.nav-panel-links a:hover {
  background: color-mix(in srgb, var(--gold) 14%, transparent);
  color: var(--text-color);
}
.nav-panel a.nav-panel-danger { color: var(--danger-color); }
.nav-panel a.nav-panel-danger:hover {
  background: color-mix(in srgb, var(--danger-color) 14%, transparent);
  color: var(--danger-color);
}
.nav-panel-id {
  padding: 0.5rem 0.7rem 0.6rem;
  margin-bottom: 0.3rem;
  border-bottom: 1px solid var(--line);
}
.nav-panel-id strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--text-color);
}
.nav-panel-id small { font-size: 0.75rem; letter-spacing: 0.06em; color: var(--text-muted); }

/* the panel copy of the bar links exists only below the breakpoint */
.nav-panel-links { display: none; list-style: none; }

/* cards — flat editorial plates */
.card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.5rem 1.6rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--line-strong); }
.card h3 a { color: var(--text-color); }
.card h3 a:hover { color: var(--gold-soft); }

.grid-2, .grid-3 { display: grid; gap: 1.5rem; align-items: start; }
.grid-2 { grid-template-columns: 1fr; }
@media (min-width: 860px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 600px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }
/* grid items default to min-width:auto, so a wide child (a .data-table) forces the
   column open instead of letting .table-responsive scroll. This is what made every
   card holding a table blow past the viewport on mobile. */
.grid-2 > *, .grid-3 > * { min-width: 0; }

/* QR Code Display Container */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  margin-top: 1rem;
}
.qr-image {
  width: 200px;
  height: 200px;
  margin: 1rem auto;
  padding: 8px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* buttons */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.65rem 1.5rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  box-shadow: 0 6px 22px rgba(212, 72, 42, 0.3);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 8px 30px rgba(212, 72, 42, 0.45); }

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border-color: var(--line-strong);
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold-soft); }

.btn-danger {
  background: transparent;
  color: var(--danger-color);
  border-color: var(--danger-color);
}
.btn-danger:hover { background: rgba(212, 72, 42, 0.12); }

.btn-sm { font-size: 0.78rem; padding: 0.4rem 1rem; }

/* badges */
.badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.24rem 0.7rem;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-muted);
}
.badge-gold { border-color: var(--gold); color: var(--gold-soft); }
.badge-live {
  border-color: var(--vermilion);
  color: var(--vermilion);
  animation: sigil-pulse 2s ease-in-out infinite;
}
.badge-prepping { border-color: var(--warning-color); color: var(--warning-color); }

@keyframes sigil-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 72, 42, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(212, 72, 42, 0); }
}

/* forms */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.form-control {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-color);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control::placeholder { color: var(--text-muted); opacity: 0.65; }
.form-control:focus { outline: none; border-color: var(--gold); box-shadow: var(--ring); }
select.form-control option { background: var(--surface-color); }

/* alerts */
.alert { border-radius: 6px; border: 1px solid; border-left-width: 4px; padding: 0.8rem 1rem; margin-bottom: 1rem; }
.alert-danger { background: rgba(212, 72, 42, 0.1); border-color: var(--danger-color); color: var(--danger-color); }
.alert-success { background: rgba(111, 174, 139, 0.1); border-color: var(--success-color); color: var(--success-color); }

/* tables */
/* gold thumb makes it visible that the table scrolls sideways on narrow screens */
.table-responsive { overflow-x: auto; max-width: 100%; scrollbar-width: thin; scrollbar-color: var(--gold) transparent; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data-table th {
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  color: var(--gold);
  border-bottom: 1px solid var(--gold);
  padding: 0.6rem 0.75rem;
  white-space: nowrap;
}
.data-table td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
.data-table tbody tr:hover { background: rgba(230, 220, 195, 0.03); }

/* meta rows */
.meta-info { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0.75rem 0 1rem; }
.meta-item { font-size: 0.92rem; color: var(--text-muted); }
.meta-item strong { color: var(--text-color); font-weight: 600; }

/* calendar — minimal chart */
.calendar-wrapper {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  padding: 1.3rem 1.4rem 1.5rem;
  margin-bottom: 2rem;
}
.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.calendar-header h2, .calendar-header h3 { margin-bottom: 0; }

.calendar-table { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: center; }
.calendar-table th {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line-strong);
}
.calendar-table td { border: 1px solid var(--line); height: 3.6rem; padding: 0; vertical-align: top; }

.calendar-day-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  width: 100%;
  height: 100%;
  padding: 0.35rem 0;
  color: var(--text-muted);
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.calendar-day-link:hover { background: rgba(201, 162, 39, 0.07); color: var(--text-color); }
.calendar-day-num { font-size: 0.95rem; line-height: 1; font-variant-numeric: tabular-nums; }

.calendar-badge {
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  color: #f7efe0;
  background: var(--vermilion);
  border-radius: 999px;
  min-width: 1.1rem;
  padding: 0.2rem 0.35rem;
}

td.calendar-selected .calendar-day-link,
.calendar-day-link[aria-current="date"] {
  box-shadow: inset 0 0 0 1px var(--vermilion);
  color: var(--text-color);
}

/* reviews */
.reviews-section { margin-top: 2.5rem; }
.review-item {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}
.review-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.review-stars { color: var(--gold); letter-spacing: 0.15em; font-size: 1.05rem; }
.review-reply {
  margin: 0.75rem 0 0 1rem;
  padding: 0.65rem 0.9rem;
  border-left: 2px solid var(--vermilion);
  background: rgba(212, 72, 42, 0.06);
  border-radius: 0 6px 6px 0;
  font-size: 0.95rem;
}
.reply-form { margin-top: 0.75rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.reply-form .form-control { flex: 1; min-width: 220px; }

/* QR */
.qr-container {
  display: inline-block;
  background: #fffaf0;
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 0.75rem;
  margin: 0.5rem 0;
}
.qr-image { display: block; width: 180px; height: 180px; image-rendering: pixelated; }

/* ---------- 4. Landing scenes ---------- */
/* Landing markup contract (see src/pages/landing.tsx):
   <main class="landing">
     <section class="scene scene-hero"> hero layers + copy </section>
     <section class="scene scene-prologue"> reveal lines </section>
     <section class="scene scene-tables"> featured cards </section>
     <section class="scene scene-gm"> vermilion chapter </section>
     <section class="scene scene-dm"> 10% pitch </section>
     <section class="scene scene-cta"> final CTA </section>
   </main>
*/
.landing { overflow-x: clip; }

.scene {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 6rem 1.4rem;
}
.scene-inner { max-width: 880px; width: 100%; margin: 0 auto; position: relative; z-index: 2; }
.scene-inner.narrow { max-width: 680px; }

/* per-scene backdrop; long gradient tails blend scenes into each other */
.scene-hero     { background: linear-gradient(180deg, var(--scene-hero) 70%, var(--scene-tables)); }
.scene-prologue { background: var(--scene-tables); }
.scene-tables   { background: linear-gradient(180deg, var(--scene-tables) 60%, var(--scene-gm)); }
.scene-gm       { background: linear-gradient(180deg, var(--scene-gm) 60%, var(--scene-dm)); }
.scene-dm       { background: linear-gradient(180deg, var(--scene-dm) 60%, var(--scene-cta)); }
.scene-cta      { background: var(--scene-cta); min-height: 80svh; }

/* hero */
.scene-hero { text-align: center; overflow: clip; }

.hero-display {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8vw, 5.2rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0.02em;
  margin-bottom: 1.2rem;
}
.hero-sub {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 34em;
  margin: 0 auto 2.2rem;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* parallax layers: absolutely-positioned SVG strips inside .scene-hero.
   Each layer declares its own drift distance via --par. */
.hero-layer {
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  pointer-events: none;
  z-index: 1;
}
.hero-layer svg { display: block; width: 100%; height: auto; }
.layer-stars    { inset: 0; --par: -4vh; opacity: 0.7; }
.layer-mist     { bottom: 18%; --par: -14vh; opacity: 0.5; }
.layer-far      { bottom: 0; --par: -8vh; opacity: 0.55; }
.layer-near     { bottom: -2px; --par: -18vh; }
.layer-die      { top: 12%; right: 8%; left: auto; width: clamp(70px, 10vw, 130px); --par: 22vh; opacity: 0.9; }

.hero-scroll-hint {
  position: absolute;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  z-index: 2;
  animation: hint-bob 2.2s ease-in-out infinite;
}
@keyframes hint-bob {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.6; }
  50% { transform: translate(-50%, 8px); opacity: 1; }
}

/* prologue lines */
.prologue-line {
  font-size: clamp(1.15rem, 2.6vw, 1.7rem);
  line-height: 1.9;
  color: var(--text-muted);
  margin-bottom: 1.6rem;
  text-wrap: balance;
}
.prologue-line strong { color: var(--text-color); font-weight: 600; }
.prologue-line em { color: var(--gold-soft); font-style: normal; }

/* featured table cards drift in alternately (via .reveal-left / .reveal-right) */
.featured-list { display: grid; gap: 1.4rem; margin: 2rem 0; }
.featured-more { text-align: center; margin-top: 1rem; }

/* GM chapter accent */
.scene-gm .kicker { color: var(--vermilion); }
.scene-gm .kicker::after { background: linear-gradient(90deg, var(--vermilion), transparent); }

/* DM pitch — the huge 10% numeral */
.big-number {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(5rem, 18vw, 12rem);
  line-height: 1;
  background: linear-gradient(115deg, var(--gold-soft), var(--gold) 55%, var(--vermilion));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: block;
  margin: 0.5rem 0 1rem;
}
.dm-points { list-style: none; margin: 1.5rem 0; display: grid; gap: 0.8rem; }
.dm-points li { padding-left: 1.6rem; position: relative; color: var(--text-muted); }
.dm-points li::before { content: "◆"; position: absolute; left: 0; color: var(--gold); font-size: 0.7rem; top: 0.45em; }
.dm-points li strong { color: var(--text-color); }

/* final CTA */
.scene-cta { text-align: center; }
.cta-panel {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 3rem 2rem;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
}

/* ---------- 5. Motion ---------- */
/* Base state: .reveal* elements are hidden and slide into place either by
   (a) CSS scroll-driven animations where supported, or
   (b) .in-view class added by /static/landing.js (IntersectionObserver). */
.reveal, .reveal-left, .reveal-right { opacity: 0; }
.reveal { transform: translateY(28px); }
.reveal-left { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }

.reveal.in-view, .reveal-left.in-view, .reveal-right.in-view {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
/* stagger helper: set --d per element (landing.tsx does this inline) */
.reveal.in-view { transition-delay: var(--d, 0s); }

@supports (animation-timeline: view()) {
  /* native scroll-driven reveals — landing.js skips IO when supported */
  .reveal, .reveal-left, .reveal-right {
    opacity: 1;
    transform: none;
    animation: reveal-up 1ms linear both;
    animation-timeline: view();
    animation-range: entry 5% entry 45%;
    animation-delay: var(--d, 0s);
  }
  .reveal-left { animation-name: reveal-from-left; }
  .reveal-right { animation-name: reveal-from-right; }

  /* hero parallax: layers drift by --par as the hero scrolls out of view */
  .hero-layer {
    animation: par-drift 1ms linear both;
    animation-timeline: view();
    animation-range: exit 0% exit 100%;
  }

  @keyframes reveal-up         { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
  @keyframes reveal-from-left  { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
  @keyframes reveal-from-right { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
  @keyframes par-drift         { from { translate: 0 0; } to { translate: 0 var(--par, -10vh); } }
}

/* app pages: gentle load-in for direct children of main */
@media (prefers-reduced-motion: no-preference) {
  main.container > * { animation: rise-in 0.45s ease both; }
  main.container > *:nth-child(2) { animation-delay: 0.06s; }
  main.container > *:nth-child(3) { animation-delay: 0.12s; }
  main.container > *:nth-child(4) { animation-delay: 0.18s; }
  @keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-right, .hero-layer {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
  .hero-scroll-hint { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 6. Responsive ---------- */

/* nav breakpoint: above it the bar carries its own links and the disclosure is
   the account menu; below it everything moves into the disclosure panel.
   display:none (not visibility/opacity) so the hidden copy of the links leaves
   the a11y tree and the tab order as well. */
@media (min-width: 860px) {
  .nav-menu-guest { display: none; }
}

@media (max-width: 859px) {
  .nav-links,
  .nav-cta,
  .nav-chip-name { display: none; }
  .nav-panel-links { display: block; }
  .nav-panel-links + a { margin-top: 0.3rem; border-top: 1px solid var(--line); }
}

@media (max-width: 640px) {
  body { font-size: 0.98rem; }
  .container { padding: 1.4rem 1rem 4rem; }
  .nav-container { padding: 0.55rem 1rem; gap: 0.75rem; }
  .nav-logo { font-size: 1.08rem; letter-spacing: 0.06em; }
  .nav-logo img { height: 30px; }
  /* width:100% would squeeze a Thai title column down to two syllables per line
     rather than scroll. Force a readable width and let .table-responsive scroll. */
  .table-responsive .data-table { min-width: 36rem; }
  .table-responsive .data-table td:first-child { min-width: 11rem; }
  .scene { padding: 4.5rem 1rem; }
  .calendar-table td { height: 3rem; }
  .qr-image { width: 150px; height: 150px; }
  .layer-die { display: none; }
}
