/* Valkara — shared theme: tokens, reset, base, and cross-page components. */

:root {
  /* Color tokens (Landing Spec v2) */
  --gold-primary:   #C9A84C;
  --gold-bright:    #F0C040;
  --gold-dim:       #7A5F2A;
  --dark-base:      #0D0B07;
  --dark-surface:   #141208;
  --dark-elevated:  #1E1A10;
  --ash:            #3A3320;
  --text-primary:   #F2E8CC;
  --text-secondary: #A89060;
  --text-muted:     #5C4E30;
  --check-gold:     #C9A84C;
  --check-no:       #3A3320;
  --phase-v2:       #8B6914;
  --danger:         #8B2020;

  /* Type scale */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 36px;
  --text-4xl: 48px;
  --text-hero: 64px;

  --font-display: 'Cinzel', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-wordmark: 'Cinzel Decorative', 'Cinzel', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--dark-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--gold-primary); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--gold-bright); }

img { max-width: 100%; display: block; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.05em; margin: 0; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }

.section { padding: 96px 0; }

.eyebrow {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--gold-dim);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.section-title { font-size: var(--text-3xl); color: var(--text-primary); margin-bottom: 48px; }

/* ── Forge-glow CTA button ─────────────────────────────────────── */
.cta-primary {
  display: inline-block;
  background: transparent;
  border: 1.5px solid var(--gold-primary);
  color: var(--gold-primary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 14px 40px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 12px rgba(201,168,76,0.15), inset 0 0 12px rgba(201,168,76,0.05);
}
.cta-primary:hover {
  background: rgba(201,168,76,0.08);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  box-shadow: 0 0 24px rgba(201,168,76,0.35), inset 0 0 20px rgba(201,168,76,0.12);
}
.cta-primary.large { font-size: 16px; padding: 18px 52px; }

.forge-glow { box-shadow: 0 0 24px rgba(201,168,76,0.2); }

/* ── Navbar ────────────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .3s ease, border-color .3s ease;
}
.navbar.scrolled { background: var(--dark-surface); border-bottom: 1px solid var(--ash); }
.wordmark {
  font-family: var(--font-wordmark);
  font-weight: 700;
  color: var(--gold-primary);
  font-size: var(--text-xl);
  letter-spacing: 0.08em;
}
.nav-right { display: flex; align-items: center; gap: 20px; }
/* Wrapper for the session-dependent buttons. auth.js replaces this element's
   innerHTML on every session check, so anything that must survive (the Guides
   link) lives beside it in .nav-right, never inside it. */
.nav-actions { display: flex; align-items: center; gap: 20px; }
/* Quiet nav item — borderless, so it doesn't compete with the CTA buttons. */
.nav-link {
  font-family: var(--font-display);
  font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-secondary); transition: color .25s ease;
}
.nav-link:hover { color: var(--gold-primary); }
.nav-btn {
  font-family: var(--font-display);
  font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid var(--gold-dim); color: var(--gold-primary);
  background: transparent; padding: 10px 22px; cursor: pointer;
  transition: all .25s ease;
}
.nav-btn:hover { border-color: var(--gold-bright); color: var(--gold-bright); box-shadow: 0 0 16px rgba(201,168,76,0.25); }

/* ── Footer ────────────────────────────────────────────────────── */
.footer { background: var(--dark-surface); border-top: 1px solid var(--ash); padding: 64px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 40px; align-items: start; }
.footer-badges { display: flex; flex-direction: column; gap: 12px; }
.store-badge {
  display: flex; align-items: center; justify-content: center;
  height: 52px; width: 180px;
  border: 1px solid var(--ash); background: var(--dark-elevated);
  color: var(--text-muted); font-size: var(--text-sm); letter-spacing: 0.05em;
  opacity: 0.6; cursor: not-allowed;
}
a.store-badge.active {
  border-color: var(--gold); color: var(--gold);
  opacity: 1; cursor: pointer; text-decoration: none;
}
a.store-badge.active:hover {
  border-color: var(--gold-bright); color: var(--gold-bright);
  box-shadow: 0 0 16px rgba(201,168,76,0.25);
}
.store-badge svg { width: 20px; height: 20px; margin-right: 10px; flex-shrink: 0; }
.footer-caption { color: var(--text-muted); font-size: var(--text-xs); margin-top: 8px; }
.footer-center { text-align: center; }
.footer-center .wordmark { font-size: var(--text-2xl); }
.footer-links { display: flex; flex-direction: column; gap: 10px; text-align: right; }
.footer-links a { color: var(--text-secondary); font-size: var(--text-sm); }
.footer-links a:hover { color: var(--gold-primary); }
.footer-copy { color: var(--text-muted); font-size: var(--text-xs); margin-top: 12px; }

/* Operator / legal bar */
.footer-legal {
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  flex-wrap: wrap; margin-top: 44px; padding-top: 28px;
  border-top: 1px solid var(--ash);
}
.fl-brand { display: flex; align-items: center; gap: 22px; }
.fl-logo {
  height: 50px; width: auto;
  filter: drop-shadow(0 0 16px rgba(201,168,76,0.18));
}
.fl-op { color: var(--text-muted); font-size: var(--text-xs); line-height: 1.7; margin: 0; max-width: 340px; }
.fl-op strong { color: var(--text-secondary); font-weight: 500; }
.fl-ids { display: flex; gap: 26px; flex-wrap: wrap; margin: 0; }
.fl-ids > div { display: flex; flex-direction: column; gap: 4px; }
.fl-ids dt {
  font-family: var(--font-display); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-muted); margin: 0;
}
.fl-ids dd { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text-secondary); margin: 0; }

/* ── Modal (registration / login) ──────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 24px;
  background: rgba(13,11,7,0.92); backdrop-filter: blur(8px);
}
.modal-overlay.open { display: flex; }
.modal-card {
  position: relative;
  background: var(--dark-elevated);
  border: 1px solid var(--gold-dim);
  box-shadow: 0 0 40px rgba(201,168,76,0.2);
  max-width: 480px; width: 100%;
  padding: 48px; border-radius: 0;
}
.modal-card h2 { font-size: var(--text-2xl); color: var(--gold-primary); margin-bottom: 8px; }
.modal-card .modal-sub { color: var(--text-secondary); font-size: var(--text-sm); margin-bottom: 28px; }
.modal-close {
  position: absolute; top: 16px; right: 20px;
  background: none; border: none; color: var(--text-muted);
  font-size: 24px; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--gold-primary); }

.field {
  width: 100%; background: var(--dark-base); border: 1px solid var(--ash);
  color: var(--text-primary); font-family: var(--font-body); font-size: var(--text-base);
  padding: 14px 16px; margin-bottom: 14px; border-radius: 0; outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field::placeholder { color: var(--text-muted); }
.field:focus { border-color: var(--gold-dim); box-shadow: inset 0 0 12px rgba(201,168,76,0.06); }

.modal-card .cta-primary { width: 100%; margin-top: 8px; text-align: center; }
.modal-switch { text-align: center; margin-top: 20px; font-size: var(--text-sm); color: var(--text-secondary); }
.modal-fineprint { text-align: center; margin-top: 18px; font-size: var(--text-xs); color: var(--text-muted); line-height: 1.5; }
.form-error { color: var(--danger); font-size: var(--text-sm); min-height: 20px; margin: 4px 0 8px; }
.form-success { text-align: center; }
.form-success .rune { font-size: 40px; color: var(--gold-primary); }
.form-success h2 { margin-top: 12px; }
.form-success p { color: var(--text-secondary); font-size: var(--text-sm); }

.ref-banner {
  background: rgba(201,168,76,0.06); border: 1px solid var(--gold-dim);
  color: var(--text-secondary); font-size: var(--text-sm);
  padding: 12px 16px; margin-bottom: 20px; text-align: center;
}

/* Utility */
.hidden { display: none !important; }
.center { text-align: center; }
.gold { color: var(--gold-primary); }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-links { text-align: center; align-items: center; }
  .footer-badges { align-items: center; }
  .footer-legal { flex-direction: column; text-align: center; gap: 28px; }
  .fl-brand { flex-direction: column; }
  .fl-op { max-width: none; }
  .fl-ids { justify-content: center; }
}

@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .section-title { font-size: var(--text-2xl); }
  .modal-card { padding: 32px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
