/* ============================================================
   Stark's Dungeon — Showcase stylesheet
   Bolder dark fantasy: obsidian + ember amber + arcane accent
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* surfaces */
  --obsidian: #0c0a09;
  --stone-950: #0f0d0c;
  --stone-900: #1c1917;
  --stone-800: #292524;
  --stone-700: #44403c;

  /* accents */
  --ember: #f59e0b;
  --ember-bright: #fbbf24;
  --ember-deep: #b45309;
  --arcane: #7c6df2;
  --arcane-soft: #a99bff;

  /* text */
  --parchment: #e7dcc4;
  --ink: #d6d3d1;
  --ink-muted: #a8a29e;
  --ink-faint: #78716c;

  /* glow + lines */
  --line: rgba(231, 220, 196, 0.12);
  --line-strong: rgba(245, 158, 11, 0.35);
  --glow-ember: 0 0 24px rgba(245, 158, 11, 0.35);

  /* type */
  --font-display: "Cinzel Decorative", serif;
  --font-head: "Cinzel", serif;
  --font-body: "Inter", system-ui, sans-serif;

  /* layout */
  --maxw: 1140px;
  --radius: 10px;
  --nav-h: 68px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--obsidian);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* layered ambient background — radial ember light + faint noise */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(245, 158, 11, 0.10), transparent 60%),
    radial-gradient(900px 700px at 110% 20%, rgba(124, 109, 242, 0.08), transparent 60%),
    var(--obsidian);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.04;
  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.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.15; color: var(--parchment); letter-spacing: 0.02em; }

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

/* eyebrow / kicker */
.kicker {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.72rem;
  color: var(--ember);
  margin: 0 0 12px;
}

/* a thin decorative gold rule with a center diamond */
.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 auto 8px;
  color: var(--ember-deep);
}
.rule::before,
.rule::after {
  content: "";
  height: 1px;
  width: 64px;
  background: linear-gradient(90deg, transparent, var(--line-strong));
}
.rule::after { background: linear-gradient(90deg, var(--line-strong), transparent); }
.rule span { color: var(--ember); transform: rotate(45deg); font-size: 0.6rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
  padding: 13px 26px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn-primary {
  background: linear-gradient(180deg, var(--ember-bright), var(--ember-deep));
  color: #1a1206;
  box-shadow: var(--glow-ember);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 34px rgba(245, 158, 11, 0.55); }
.btn-ghost {
  background: transparent;
  color: var(--parchment);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: rgba(245, 158, 11, 0.08); border-color: var(--ember); color: var(--ember-bright); }

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(10px);
  background: rgba(12, 10, 9, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--parchment);
  letter-spacing: 0.04em;
}
.brand b { color: var(--ember); }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a {
  font-family: var(--font-head);
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 8px 12px;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a:hover { color: var(--ember-bright); }
.nav-links a.active { color: var(--ember); }
.nav-links a.cta {
  color: #1a1206;
  background: linear-gradient(180deg, var(--ember-bright), var(--ember-deep));
  font-weight: 600;
}
.nav-links a.cta:hover { color: #1a1206; box-shadow: var(--glow-ember); }

/* mobile nav toggle */
.nav-toggle { display: none; background: none; border: 0; color: var(--parchment); cursor: pointer; padding: 8px; }
.nav-toggle svg { width: 26px; height: 26px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: calc(92vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
#ember-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; padding: 64px 24px; max-width: 820px; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 5rem);
  margin: 8px 0 0;
  text-shadow: 0 0 40px rgba(245, 158, 11, 0.25);
}
.hero h1 .glow { color: var(--ember); }
.hero .tagline {
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  color: var(--ink-muted);
  max-width: 560px;
  margin: 22px auto 0;
}
.hero-actions { margin-top: 36px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.scroll-cue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink-faint);
  font-family: var(--font-head);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  z-index: 1;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ---------- Generic section ---------- */
.section { padding: 96px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 56px; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 16px; }
.section-head p { color: var(--ink-muted); font-size: 1.05rem; margin: 0; }

/* ---------- Feature cards ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}
.feature-card {
  position: relative;
  background: linear-gradient(180deg, rgba(41, 37, 36, 0.55), rgba(28, 25, 23, 0.55));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.feature-card::after {
  /* corner flourish */
  content: "";
  position: absolute;
  top: 10px; right: 10px;
  width: 18px; height: 18px;
  border-top: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  opacity: 0.6;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4), inset 0 0 30px rgba(245, 158, 11, 0.05);
}
.feature-card .glyph {
  font-size: 1.7rem;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--line-strong);
  margin-bottom: 18px;
}
.feature-card h3 { font-size: 1.2rem; margin: 0 0 8px; color: var(--ember-bright); }
.feature-card p { margin: 0; color: var(--ink-muted); font-size: 0.95rem; }

/* ---------- Bestiary grid (world page) ---------- */
.bestiary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.beast {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--stone-900);
  aspect-ratio: 3 / 4;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.beast img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.92) brightness(0.86);
  transition: transform 0.5s ease, filter 0.3s ease;
}
.beast:hover { transform: translateY(-6px); border-color: var(--line-strong); box-shadow: 0 18px 50px rgba(0,0,0,0.5); }
.beast:hover img { transform: scale(1.06); filter: saturate(1.05) brightness(1); }
.beast .plate {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 30px 16px 14px;
  background: linear-gradient(180deg, transparent, rgba(12,10,9,0.92));
}
.beast .plate h3 {
  font-family: var(--font-head);
  font-size: 0.98rem;
  margin: 0;
  color: var(--parchment);
  letter-spacing: 0.04em;
}
.beast .plate span { font-size: 0.72rem; color: var(--ember); text-transform: uppercase; letter-spacing: 0.18em; }

/* ---------- Realm gallery (world page) — landscape variant of bestiary ---------- */
.bestiary.realm { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.bestiary.realm .beast { aspect-ratio: 4 / 3; }
.bestiary.realm .beast img { object-position: center 45%; }

/* ---------- Alternating feature rows (how-it-works) ---------- */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  margin-bottom: 110px;
}
.feature-row:last-child { margin-bottom: 0; }
.feature-row.flip .row-media { order: 2; }
.row-copy .step {
  font-family: var(--font-head);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ember-deep);
}
.row-copy h3 { font-size: 1.7rem; margin: 10px 0 14px; }
.row-copy p { color: var(--ink-muted); font-size: 1.02rem; margin: 0 0 18px; }
.row-copy ul { margin: 0; padding: 0; list-style: none; }
.row-copy li { padding: 6px 0 6px 26px; position: relative; color: var(--ink); }
.row-copy li::before { content: "◆"; position: absolute; left: 0; color: var(--ember); font-size: 0.7rem; top: 9px; }

.row-media {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--stone-900);
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}
.row-media img { width: 100%; display: block; }
.row-media.frame { padding: 0; }

/* a "browser chrome" bar above screenshots */
.chrome {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: var(--stone-800);
  border-bottom: 1px solid var(--line);
}
.chrome i { width: 10px; height: 10px; border-radius: 50%; background: var(--stone-700); display: block; }
.chrome i:first-child { background: #c0563a; }

/* voice-narration waveform illustration (CSS-only) */
.waveform {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  height: 280px;
  background: radial-gradient(circle at 50% 50%, rgba(245,158,11,0.10), transparent 70%), var(--stone-900);
}
.waveform b {
  width: 6px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--ember-bright), var(--ember-deep));
  animation: pulse-bar 1.4s ease-in-out infinite;
}
@keyframes pulse-bar { 0%, 100% { height: 16px; opacity: 0.5; } 50% { height: 120px; opacity: 1; } }

/* ---------- Original "campaign shelf" mockup (replaces copyrighted library screenshot) ---------- */
.shelf {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 20px;
  background: radial-gradient(circle at 50% -10%, rgba(245,158,11,0.06), transparent 60%), var(--stone-900);
}
.shelf-card {
  display: flex;
  flex-direction: column;
  background: var(--obsidian);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.shelf-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.shelf-card .banner {
  position: relative;
  height: 84px;
  display: flex;
  align-items: flex-end;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: var(--stone-800);
}
.shelf-card .banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  filter: saturate(0.95) brightness(0.92);
}
.shelf-card .banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 10, 9, 0.05) 30%, rgba(12, 10, 9, 0.82));
}
.shelf-card:hover .banner img { transform: scale(1.04); transition: transform 0.4s ease; }
.shelf-card .tag {
  position: relative;
  z-index: 1;
  font-family: var(--font-head);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--parchment);
  background: rgba(12, 10, 9, 0.66);
  border: 1px solid rgba(231, 220, 196, 0.22);
  border-radius: 5px;
  padding: 3px 9px;
}
.shelf-card .body { display: flex; flex-direction: column; gap: 7px; padding: 13px 14px 15px; flex: 1; }
.shelf-card h4 { font-family: var(--font-head); font-size: 1rem; color: var(--parchment); margin: 0; }
.shelf-card p { font-size: 0.8rem; color: var(--ink-muted); margin: 0; line-height: 1.45; flex: 1; }
.shelf-card .lvl {
  align-self: flex-start;
  font-size: 0.68rem;
  color: var(--ember-bright);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 2px 9px;
}
@media (max-width: 480px) { .shelf { grid-template-columns: 1fr; } }

/* ---------- CTA band ---------- */
.cta-band {
  text-align: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: radial-gradient(800px 300px at 50% 50%, rgba(245,158,11,0.10), transparent 70%);
  padding: 88px 0;
}
.cta-band h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 14px; }
.cta-band p { color: var(--ink-muted); max-width: 520px; margin: 0 auto 28px; }

/* ---------- Beta signup form ---------- */
.signup {
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
  background: linear-gradient(180deg, rgba(41,37,36,0.6), rgba(28,25,23,0.6));
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 32px;
  box-shadow: inset 0 0 40px rgba(245,158,11,0.05);
}
.signup .field { margin-bottom: 18px; }
.signup label {
  display: block;
  font-family: var(--font-head);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 8px;
}
.signup input,
.signup textarea {
  width: 100%;
  background: var(--obsidian);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 0.98rem;
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.signup input:focus,
.signup textarea:focus {
  outline: none;
  border-color: var(--ember);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}
.signup textarea { resize: vertical; min-height: 84px; }
.signup .btn { width: 100%; justify-content: center; margin-top: 6px; }
.form-note { font-size: 0.82rem; color: var(--ink-faint); text-align: center; margin: 14px 0 0; }

/* form status messages */
.form-status { margin-top: 16px; text-align: center; font-size: 0.95rem; min-height: 1.2em; }
.form-status.ok { color: var(--ember-bright); }
.form-status.err { color: #f08a6a; }
.signup.is-loading .btn { opacity: 0.6; pointer-events: none; }
.signup.is-done .field,
.signup.is-done .form-note { display: none; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 44px 0;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.82rem;
}
.footer .brand { font-size: 1rem; margin-bottom: 10px; display: inline-block; }
.footer-links { display: flex; gap: 20px; justify-content: center; margin: 14px 0 18px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-muted); font-family: var(--font-head); font-size: 0.8rem; letter-spacing: 0.08em; }
.footer-links a:hover { color: var(--ember); }

/* ---------- Scroll-reveal (GSAP adds .revealed; fallback shows all) ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.revealed { opacity: 1; transform: none; }

/* ---------- Page intro strip (world / how) ---------- */
.page-hero {
  text-align: center;
  padding: 88px 24px 56px;
  position: relative;
}
.page-hero h1 { font-family: var(--font-display); font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 6px 0 18px; }
.page-hero p { color: var(--ink-muted); max-width: 640px; margin: 0 auto; font-size: 1.08rem; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(12,10,9,0.97);
    border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; }
  .feature-row { grid-template-columns: 1fr; gap: 28px; margin-bottom: 72px; }
  .feature-row.flip .row-media { order: 0; }
  .section { padding: 72px 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #ember-canvas { display: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue, .waveform b, .btn:hover, .beast:hover, .feature-card:hover { animation: none; transition: none; transform: none; }
}
