/* ============================================================
   LifeTavern — styles.css
   Palette (brand system — do not drift):
     deep twilight   #241D38  page background
     twilight purple #3B3358  panels / cards
     cloud violet    #6B5A8E  borders / decor (too dark for small text on
                              the page bg — use --violet-text for copy)
     moonlight       #EDE7D6  primary text
     gold ink        #B8873C  ornament, dividers, small-caps labels
     portal green    #6FD84A  CTAs + door/leaf motif ONLY
     crit green      #A6FF5E  hover/active on green elements ONLY
   ============================================================ */

:root {
  --bg:          #241D38;
  --panel:       #3B3358;
  --violet:      #6B5A8E;
  /* Lightened tint of cloud violet for body-size secondary text:
     #6B5A8E on #241D38 is only ~2.8:1 — fails WCAG AA. #A99BCB is ~6.3:1. */
  --violet-text: #A99BCB;
  --moonlight:   #EDE7D6;
  --gold:        #B8873C;
  --gold-soft:   rgba(184, 135, 60, 0.35);
  --portal:      #6FD84A;
  --crit:        #A6FF5E;
  --portal-glow: rgba(111, 216, 74, 0.35);

  --font-display: "Cinzel Decorative", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body:    "EB Garamond", Garamond, "Palatino Linotype", Georgia, serif;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
img, svg, video { display: block; max-width: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background-color: var(--bg);
  /* Candlelit vignette: a warm ember glow high center, cool depth below.
     Pure CSS — no image payload. */
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(184, 135, 60, 0.12), transparent 60%),
    radial-gradient(ellipse 70% 50% at 50% 110%, rgba(107, 90, 142, 0.14), transparent 65%);
  background-attachment: fixed;
  color: var(--moonlight);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Subtle aged-ink grain over everything (SVG turbulence data URI, ~300B). */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1000;
  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='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.15rem;
  color: var(--moonlight);
  margin-bottom: 0.6rem;
}

p { text-wrap: pretty; }

a { color: var(--moonlight); }

/* Gold small-caps label above each section heading */
.kicker {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: var(--gold);
  margin-bottom: 0.9rem;
}

.section-sub {
  color: var(--violet-text);
  max-width: 34em;
  margin-bottom: 2rem;
}

/* ── Utilities ─────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

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

.svg-defs { position: absolute; }

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 2000;
  background: var(--panel);
  color: var(--moonlight);
  padding: 0.6em 1.2em;
  border: 1px solid var(--gold);
  border-radius: 4px;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; }

/* Visible gold focus everywhere */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.9em 2em;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease,
              border-color 0.2s ease, color 0.2s ease;
}

/* Portal green = "act". Green appears only here and on the door/leaf motif. */
.btn-primary {
  background: var(--portal);
  color: var(--bg);
  box-shadow: 0 0 22px var(--portal-glow), inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.btn-primary:hover,
.btn-primary:active {
  background: var(--crit);
  box-shadow: 0 0 34px var(--portal-glow), 0 0 8px var(--portal-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--moonlight);
  border-color: var(--violet);
}
.btn-ghost:hover,
.btn-ghost:active {
  border-color: var(--gold);
  color: var(--gold);
}

/* ── Leaf glyph & dividers ─────────────────────────────────── */
.leaf {
  color: var(--portal);
  filter: drop-shadow(0 0 6px var(--portal-glow))
          drop-shadow(0 0 14px var(--portal-glow));
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  max-width: 520px;
  margin: 4.5rem auto;
  padding-inline: 1.25rem;
}
.divider .rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft));
}
.divider .rule:last-child {
  background: linear-gradient(90deg, var(--gold-soft), transparent);
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  min-height: 92vh;
  display: flex;
  align-items: center;
  text-align: center;
  padding-block: 5rem 3rem;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.hero-icon {
  width: 112px;
  height: 112px;
  border-radius: 24px;
  /* The doorway motif carries the green — echo its glow softly. */
  box-shadow: 0 0 40px var(--portal-glow), 0 0 90px rgba(111, 216, 74, 0.15);
  margin-bottom: 2rem;
}

.wordmark {
  font-size: clamp(2.5rem, 9vw, 4.5rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
}

.hook {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 3.5vw, 1.6rem);
  letter-spacing: 0.05em;
  color: var(--gold);
  margin-bottom: 1.25rem;
}

.subhead {
  color: var(--violet-text);
  max-width: 36em;
  margin-bottom: 2.5rem;
}

.stat-abbrs {
  color: var(--moonlight);
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* ── Sections shared ───────────────────────────────────────── */
section { padding-block: 1rem; }

/* ── Cards / How it works ──────────────────────────────────── */
.card {
  background: linear-gradient(160deg, var(--panel), #332B4E 70%);
  border: 1px solid rgba(184, 135, 60, 0.25);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(237, 231, 214, 0.06),
              0 12px 30px rgba(0, 0, 0, 0.25);
}

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  margin-block: 2rem 2.5rem;
}

.step { padding: 2rem 1.75rem; }

.step-numeral {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.step p { color: var(--violet-text); font-size: 1.05rem; }

/* Ornamental class row */
.class-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.5rem 0.9rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--gold);
}
.class-row .sep {
  color: var(--violet);
  font-size: 0.7rem;
  letter-spacing: 0;
}

/* ── The die ───────────────────────────────────────────────── */
.die-media {
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  overflow: hidden;
  max-width: 960px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.35);
}
.die-video {
  width: 100%;
  height: auto;
  background: #1B1530;
}

/* ── Stats / character sheet ───────────────────────────────── */
.stats { position: relative; overflow: hidden; }

.watermark {
  position: absolute;
  right: -4rem;
  top: 50%;
  translate: 0 -50%;
  color: var(--violet);
  opacity: 0.07;
  filter: none;
  pointer-events: none;
}

.sheet {
  padding: 2rem 1.5rem;
  display: grid;
  gap: 1.4rem;
  max-width: 820px;
}

.stat dt {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.stat abbr {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--gold);
  text-decoration: none;
  min-width: 3.2ch;
}

.stat-name {
  font-weight: 600;
  letter-spacing: 0.04em;
}

.stat dd {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.25rem 1rem;
}

.stat-flavor {
  grid-column: 1 / -1;
  color: var(--violet-text);
  font-style: italic;
  font-size: 1rem;
}

.bar {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: rgba(36, 29, 56, 0.9);
  border: 1px solid rgba(107, 90, 142, 0.5);
  overflow: hidden;
}

/* Bars are gold ink — green is reserved for actions. */
.bar-fill {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #8a6428, var(--gold));
}
.w-50 { width: 50%; }
.w-55 { width: 55%; }
.w-60 { width: 60%; }
.w-65 { width: 65%; }
.w-70 { width: 70%; }
.w-80 { width: 80%; }

.stat-value {
  /* Body font here — Cinzel Decorative's digits read like roman numerals */
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--moonlight);
  font-size: 1.1rem;
  min-width: 2ch;
  text-align: right;
}

/* ── Waitlist ──────────────────────────────────────────────── */
.waitlist {
  text-align: center;
  padding-block: 2rem 3rem;
}
.waitlist .section-sub { margin-inline: auto; }

.waitlist-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 480px;
  margin-inline: auto;
}

.waitlist-form input[type="email"] {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--moonlight);
  background: #1D1730;
  border: 1px solid var(--violet);
  border-radius: 4px;
  padding: 0.85em 1em;
  width: 100%;
}
.waitlist-form input[type="email"]::placeholder { color: var(--violet-text); opacity: 0.7; }
.waitlist-form input[type="email"]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-color: var(--gold);
}

.waitlist-form .btn[disabled] {
  opacity: 0.6;
  cursor: wait;
  box-shadow: none;
}

/* Honeypot — hidden from humans, still present for bots. */
.hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  min-height: 1.5em;
  margin-top: 1rem;
  color: var(--violet-text);
}
.form-status.is-error { color: #E8A87C; }

.form-success {
  max-width: 480px;
  margin-inline: auto;
  padding: 2rem 1.5rem;
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  background: linear-gradient(160deg, var(--panel), #332B4E 70%);
}
.form-success-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}
.form-success-sub { color: var(--violet-text); }

.microcopy {
  margin-top: 1.25rem;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--violet-text);
}

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 4rem 1.25rem 3rem;
  border-top: 1px solid rgba(107, 90, 142, 0.3);
  margin-top: 4rem;
}

.footer-leaf { margin: 0 auto 1.5rem; }

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2rem;
  margin-bottom: 1.5rem;
}
.socials a {
  color: var(--moonlight);
  text-decoration-color: var(--violet);
  text-underline-offset: 4px;
}
.socials a:hover { color: var(--gold); text-decoration-color: var(--gold); }

.privacy-note {
  font-size: 0.95rem;
  color: var(--violet-text);
  max-width: 40em;
  margin-inline: auto;
  margin-bottom: 1rem;
}

.copyright {
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--violet-text);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .waitlist-form { flex-direction: row; }
  .waitlist-form input[type="email"] { flex: 1; }
  .waitlist-form .btn { white-space: nowrap; }
  .sheet { padding: 2.5rem 3rem; }
}

@media (min-width: 1440px) {
  .hero { min-height: 85vh; }
}

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
