@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

/* ─── DESIGN TOKENS ─── */
:root {
  /* Surfaces */
  --void:        #07070A;
  --surface:     #0E0D14;
  --lift:        #171525;
  --stone:       #2A2535;

  /* Brand Accents */
  --ember:       #C8963E;
  --ember-dim:   rgba(200,150,62,0.22);
  --ember-glow:  rgba(200,150,62,0.07);
  --ember-mid:   rgba(200,150,62,0.5);

  /* Wooden pixel-button palette (nav — per nav-inspiration) */
  --wood-light:  #b07a44;
  --wood:        #8f5d2c;
  --wood-dark:   #5f3a1b;
  --wood-edge:   #3a2410;
  --wood-text:   #f4dca5;
  --crimson:     #9B2020;
  --crimson-dim: rgba(155,32,32,0.25);
  --ice:         #4A9EBF;
  --ice-dim:     rgba(74,158,191,0.2);

  /* Text */
  --text:        rgba(255,255,255,0.90);
  --muted:       rgba(255,255,255,0.42);
  --dim:         rgba(255,255,255,0.18);

  /* Borders */
  --border:      rgba(255,255,255,0.06);
  --border-hi:   rgba(255,255,255,0.14);

  /* Cards */
  --card-bg:     rgba(255,255,255,0.025);

  /* Fonts */
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font:         -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --mono:         "Courier New", Courier, monospace;
}

/* ─── BASE ─── */
html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  background: var(--void);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ─── CURSOR GLOW ─── */
#cursor-glow {
  position: fixed;
  width: 480px; height: 480px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle at center, rgba(200,150,62,0.05) 0%, transparent 65%);
  transform: translate(-50%, -50%);
  transition: opacity 0.4s;
}

/* ─── NAVIGATION ─── */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: 116px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 48px;
  gap: 44px;
  background: transparent;
  z-index: 200;
  transition: background 0.5s ease, backdrop-filter 0.5s ease;
}
/* Solid black bar: on the homepage it appears once you scroll past the hero
   animation (.scrolled); on every other page it's present from load (.is-solid). */
nav.scrolled, nav.is-solid {
  background: rgba(8,8,11,0.96);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 0.5px solid var(--border);
}

.nav-logo {
  flex: 0 0 auto;
  display: flex; align-items: center;
  text-decoration: none; z-index: 1;
}
.nav-logo img { height: 104px; width: auto; display: block; }

/* All links pushed to right */
/* ─── WOODEN PIXEL BUTTONS (nav + every CTA, per nav-inspiration) ─── */
.btn,
.nav-side a,
.nav-cta,
.nav-mobile-links a,
.nav-mobile-links .nav-mobile-cta {
  font-family: 'Press Start 2P', var(--mono);
  font-weight: 400; text-transform: uppercase; text-decoration: none;
  color: var(--wood-text); text-shadow: 1px 1px 0 var(--wood-edge);
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.05) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, var(--wood-light) 0%, var(--wood) 44%, var(--wood-dark) 56%, var(--wood) 100%);
  border: 2px solid var(--wood-edge);
  border-radius: 3px;
  image-rendering: pixelated;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow:
    inset 0 2px 0 rgba(255,226,170,0.40),
    inset 0 -4px 0 rgba(0,0,0,0.28),
    0 4px 0 var(--wood-edge),
    0 6px 7px rgba(0,0,0,0.45);
  transition: transform 0.07s steps(2), box-shadow 0.07s steps(2), filter 0.2s;
}
.btn:hover,
.nav-side a:hover, .nav-cta:hover,
.nav-mobile-links a:hover, .nav-mobile-links .nav-mobile-cta:hover {
  color: #fff; filter: brightness(1.08);
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 0 rgba(255,226,170,0.45),
    inset 0 -4px 0 rgba(0,0,0,0.30),
    0 2px 0 var(--wood-edge),
    0 4px 5px rgba(0,0,0,0.45);
}
.btn:active,
.nav-side a:active, .nav-cta:active,
.nav-mobile-links a:active, .nav-mobile-links .nav-mobile-cta:active {
  transform: translateY(4px);
  box-shadow:
    inset 0 2px 0 rgba(255,226,170,0.30),
    inset 0 -2px 0 rgba(0,0,0,0.30);
}
.nav-side a.active { filter: brightness(1.12); color: #fff; }

/* Sizing per context — two links flank the centered logo, CTA pinned right */
.nav-side { display: flex; align-items: center; gap: 24px; }
.nav-side.nav-left  { flex: 1; justify-content: flex-end; }
.nav-side.nav-right { flex: 1; justify-content: flex-start; }
.nav-side a { font-size: 8px; line-height: 1; letter-spacing: 0; padding: 9px 12px; }
.nav-cta {
  position: absolute; right: 48px; top: 43px;
  flex-shrink: 0; font-size: 8px; line-height: 1; letter-spacing: 0;
  padding: 9px 14px; white-space: nowrap;
}

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer;
  padding: 4px; margin-left: auto; flex-shrink: 0;
}
.nav-hamburger span {
  display: block; width: 22px; height: 1.5px;
  background: var(--text); transition: all 0.3s;
}
.nav-hamburger span {
  display: block; width: 22px; height: 1.5px;
  background: var(--text); transition: all 0.3s;
}

.nav-mobile-overlay {
  display: none; position: fixed; inset: 0;
  background: var(--void); z-index: 300;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 36px;
  transform: translateY(-100%);
  transition: transform 0.42s cubic-bezier(0.16,1,0.3,1);
}
.nav-mobile-overlay.open { transform: translateY(0); }
.nav-mobile-close {
  position: absolute; top: 24px; right: 24px;
  background: none; border: none; cursor: pointer;
  font-size: 28px; color: var(--muted);
  transition: color 0.2s; line-height: 1;
}
.nav-mobile-close:hover { color: var(--text); }
.nav-mobile-links { list-style: none; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.nav-mobile-links a,
.nav-mobile-links .nav-mobile-cta {
  font-size: 13px; line-height: 1; letter-spacing: 0;
  padding: 16px 22px; min-width: 240px;
}
.nav-mobile-links .nav-mobile-cta { margin-top: 6px; }

/* ─── HERO (wheel-lock scrub) ─── */
/* One viewport tall — the wheel/touch handlers scrub the video in place and
   only release the page once the animation completes, so there is no dead
   dark scroll gap underneath the hero. */
.hero-scroll-wrapper { height: 100svh; position: relative; overflow: hidden; }
.hero-sticky {
  position: absolute; inset: 0; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
}
.hero-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(7,7,10,0.25) 0%,
    rgba(7,7,10,0.40) 50%,
    rgba(7,7,10,0.80) 100%);
}
.hero-content {
  position: relative; z-index: 10;
  text-align: center; padding: 0 24px;
  margin-bottom: 16vh;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  transition: opacity 0.05s, transform 0.05s;
}
.hero-logo {
  height: clamp(180px, 27vw, 380px); width: auto; max-width: 92vw; display: block;
  margin-bottom: 8px;
  filter: drop-shadow(0 8px 28px rgba(0,0,0,0.55));
}
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 10px; font-weight: 400; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--ember);
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(64px, 12vw, 160px);
  font-weight: 300; letter-spacing: -2px; line-height: 0.92;
  color: #fff;
}
.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 300; font-style: italic;
  color: var(--muted); max-width: 480px;
}
.hero-progress-bar {
  position: absolute; bottom: 0; left: 0; height: 1px;
  width: 0%; background: linear-gradient(90deg, transparent, var(--ember), transparent);
  z-index: 10; transition: width 0.06s linear;
}

/* ─── INTERIOR PAGE HERO ─── */
.page-hero {
  padding: 200px 48px 96px;
  text-align: center;
  border-bottom: 0.5px solid var(--border);
}
/* World page — attached realm map as the full-bleed header */
.page-hero.page-hero-world {
  border-bottom: none;
  min-height: 82vh;
  padding: 200px 48px 96px;
  background: #07070A url('assets/world-header.png') center/cover no-repeat;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  position: relative; overflow: hidden;
}
/* Slight, even dark overlay over the realm map so the centered title stays legible */
.page-hero.page-hero-world::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: rgba(7,7,10,0.45);
}
.page-hero.page-hero-world > * { position: relative; z-index: 1; }

/* Characters page — committed character-background art as the header */
.page-hero.page-hero-characters {
  border-bottom: none;
  min-height: 78vh;
  padding: 150px 24px 64px;
  background: #07070A url('assets/character-header.png') center top / cover no-repeat;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  position: relative;
}
.page-hero.page-hero-characters::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(7,7,10,0.45) 0%, rgba(7,7,10,0.25) 45%, rgba(7,7,10,0.65) 100%);
}
.page-hero.page-hero-characters > * { position: relative; z-index: 1; }
.page-hero-eyebrow {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--ember);
  display: block; margin-bottom: 20px;
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(52px, 8vw, 110px);
  font-weight: 300; letter-spacing: -2px; line-height: 0.94;
  color: #fff;
}
.page-hero-sub {
  font-family: var(--font-display);
  font-size: clamp(16px, 2vw, 20px);
  font-style: italic; color: var(--muted);
  max-width: 560px; margin: 24px auto 0;
}

/* ─── TYPOGRAPHY ─── */
h2 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 300; letter-spacing: -1.5px; line-height: 1.0;
  color: #fff;
}
h3 {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 400; letter-spacing: -0.5px;
  color: #fff;
}
p {
  font-size: 16px; line-height: 1.75;
  color: var(--muted);
}
.eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 10px; font-weight: 400; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--ember);
  margin-bottom: 16px;
}
.eyebrow-crimson { color: var(--crimson); }
.eyebrow-ice     { color: var(--ice); }
.eyebrow-dim     { color: var(--dim); }

/* ─── SECTION LAYOUT ─── */
section { padding: 112px 48px; }
.section-inner { max-width: 1080px; margin: 0 auto; }
.section-header { margin-bottom: 64px; }
.section-header p { max-width: 520px; margin-top: 16px; }

/* ─── GRID LAYOUTS ─── */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ─── CARDS ─── */
.card {
  background: var(--card-bg);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  padding: 40px 32px;
  display: flex; flex-direction: column;
  align-items: center; text-align: center; gap: 16px;
  transition: border-color 0.3s, background 0.3s;
}
.card:hover {
  border-color: var(--border-hi);
  background: rgba(255,255,255,0.04);
}
.card-icon {
  font-family: var(--font-display);
  font-size: 36px; line-height: 1;
  color: var(--ember);
  margin-bottom: 4px;
}
.card h3 {
  font-size: 20px; font-weight: 600; letter-spacing: -0.3px;
}
.card p { font-size: 14px; line-height: 1.7; }
.card-ember { border-color: var(--ember-dim); }
.card-ember:hover { border-color: var(--ember-mid); }
.card-crimson { border-color: var(--crimson-dim); }
.card-ice { border-color: var(--ice-dim); }

/* ─── CHARACTER CARD ─── */
.char-card {
  background: var(--card-bg);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.3s;
}
.char-card:hover { border-color: var(--border-hi); }
.char-card-header {
  padding: 32px 28px 24px;
  border-bottom: 0.5px solid var(--border);
}
.char-name {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 400; letter-spacing: -0.5px;
  color: #fff; margin-bottom: 4px;
}
.char-role {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ember);
}
.char-card-body { padding: 24px 28px; }
.char-card-body p { font-size: 14px; line-height: 1.75; }

/* Alignment chip (used in every char-card header) */
.char-alignment {
  display: inline-block; margin-top: 14px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em;
  text-transform: uppercase; padding: 5px 11px; border-radius: 2px;
  border: 0.5px solid var(--border); color: var(--muted);
}
.align-fire    { color: var(--ember); border-color: var(--ember-dim); background: var(--ember-dim); }
.align-ice     { color: var(--ice);   border-color: var(--ice-dim);   background: var(--ice-dim); }
.align-neutral { color: var(--muted); }
.align-unknown { color: rgba(255,255,255,0.65); border-style: dashed; }

/* ─── PRINCIPAL CAST — feature rows, portrait aligned with the name ─── */
.cast-list { display: flex; flex-direction: column; gap: 28px; margin-bottom: 88px; }
.cast-row {
  display: grid; grid-template-columns: 360px 1fr;
  background: var(--card-bg); border: 0.5px solid var(--border);
  border-radius: 16px; overflow: hidden; transition: border-color 0.3s;
}
.cast-row:hover { border-color: var(--border-hi); }
.cast-portrait {
  position: relative; min-height: 380px; overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(200,150,62,0.22), transparent 65%),
    linear-gradient(160deg, #17121c 0%, var(--surface) 100%);
}
.cast-portrait.is-ice {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(74,158,191,0.22), transparent 65%),
    linear-gradient(160deg, #101720 0%, var(--surface) 100%);
}
.cast-portrait.is-void {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(86,150,80,0.22), transparent 65%),
    linear-gradient(160deg, #0d140d 0%, var(--surface) 100%);
}
.cast-portrait-fallback { display: none; }
.cast-portrait img {
  position: absolute; inset: 0; z-index: 2;
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
  transition: transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
.cast-row:hover .cast-portrait img { transform: scale(1.03); }
.cast-body { padding: 40px 44px; display: flex; flex-direction: column; justify-content: center; }
.cast-rank {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
}
.cast-name {
  font-family: var(--font-display); font-size: clamp(30px, 4vw, 44px);
  font-weight: 400; letter-spacing: -0.5px; color: #fff; line-height: 1.02; margin-bottom: 8px;
}
.cast-title {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ember);
}
.cast-desc { font-size: 14.5px; line-height: 1.75; color: var(--muted); margin-top: 12px; max-width: 640px; }
@media (max-width: 680px) {
  .cast-row { grid-template-columns: 1fr; }
  .cast-portrait { min-height: 420px; }
  .cast-body { padding: 28px 24px; }
}

/* ─── LORE BLOCK ─── */
.lore-block {
  border-left: 1.5px solid var(--ember-dim);
  padding: 8px 0 8px 28px;
  margin: 32px 0;
}
.lore-block p {
  font-family: var(--font-display);
  font-size: 20px; font-style: italic;
  font-weight: 300; color: rgba(255,255,255,0.7);
  line-height: 1.65;
}

/* ─── TIMELINE ─── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: grid;
  grid-template-columns: 120px 1px 1fr;
  gap: 0 32px; padding: 0 0 48px;
}
.timeline-year {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.12em;
  color: var(--ember); padding-top: 4px;
  text-align: right;
}
.timeline-line {
  width: 1px; background: var(--border);
  position: relative;
}
.timeline-line::before {
  content: '';
  position: absolute; top: 8px; left: -3px;
  width: 7px; height: 7px;
  border-radius: 50%; background: var(--ember);
}
.timeline-content h3 { font-size: 20px; margin-bottom: 8px; }
.timeline-content p  { font-size: 14px; }

/* ─── REGION CARDS ─── */
.region-card {
  border: 0.5px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  background: var(--card-bg);
  transition: border-color 0.3s;
}
.region-card:hover { border-color: var(--border-hi); }
.region-name {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 400; letter-spacing: -0.3px;
  color: #fff; margin-bottom: 6px;
}
.region-tag {
  font-family: var(--mono);
  font-size: 9px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--dim);
  display: block; margin-bottom: 16px;
}
.region-card p { font-size: 14px; line-height: 1.72; }

/* ─── STAT BAR ─── */
.stat-row { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; }
.stat-item { display: flex; flex-direction: column; gap: 6px; }
.stat-label {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted);
  display: flex; justify-content: space-between;
}
.stat-label span { color: var(--ember); }
.stat-track {
  height: 2px; background: var(--border);
  overflow: hidden;
}
.stat-fill {
  height: 100%; background: linear-gradient(90deg, var(--crimson), var(--ember));
  transform-origin: left;
  transition: transform 1s cubic-bezier(0.16,1,0.3,1);
}

/* ─── BUTTONS ─── */
/* Wooden appearance comes from the shared button rule above; .btn only sets size */
.btn {
  gap: 10px;
  font-size: 11px; line-height: 1; letter-spacing: 0;
  padding: 16px 28px;
}
/* Variants share the wood; the primary (ember) reads a touch warmer/brighter */
.btn-ember { filter: brightness(1.06) saturate(1.12); }
.btn-ember:hover { filter: brightness(1.14) saturate(1.12); }

/* ─── DIVIDER ─── */
.divider {
  height: 0.5px; background: var(--border);
  margin: 0 48px;
}

/* ─── FADE-IN ANIMATIONS ─── */
.fade-in {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ─── FOOTER ─── */
footer {
  border-top: 0.5px solid var(--border);
  padding: 48px;
}
.footer-inner {
  max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.footer-back {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(255,255,255,0.95);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-back:hover { color: #fff; }
.footer-logo {
  display: flex; align-items: center; justify-content: center;
}
.footer-logo img {
  width: 48px; height: 48px; object-fit: contain;
  filter: brightness(0) invert(1); opacity: 0.95;
  transition: opacity 0.2s;
}
.footer-logo:hover img { opacity: 1; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  nav { padding: 0 24px; height: 72px; gap: 0; }
  .nav-logo img { height: 64px; }
  .nav-side { display: none; }
  .nav-cta { display: none; }
  .nav-hamburger { display: flex; position: absolute; right: 24px; }
  .nav-mobile-overlay { display: flex; }

  section { padding: 80px 24px; }
  .page-hero { padding: 140px 24px 72px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 64px 1px 1fr; gap: 0 20px; }
  .footer-inner { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 18px; }
  footer { padding: 40px 24px; }
  .divider { margin: 0 24px; }
}
