/* ==========================================================================
   Zelda SNES Fan Page — css/style.css
   Deep dark forest green · Triforce gold · Hyrule green secondary.
   Almendra 700 headings · PT Serif 400 body.
   Advanced CSS: :has() dungeon card group hover; counter() dungeon list
   and timeline entries; layered box-shadows on headings and Triforce symbol;
   CSS Grid named areas on flagship page.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Almendra:wght@700&family=PT+Serif:ital,wght@0,400;1,400&display=swap');

[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */
@keyframes glow-pulse {
  0%, 100% {
    text-shadow:
      0 0 8px rgba(255,215,0,0.7),
      0 0 16px rgba(255,215,0,0.4),
      0 0 32px rgba(255,215,0,0.2);
  }
  50% {
    text-shadow:
      0 0 12px rgba(255,215,0,0.9),
      0 0 24px rgba(255,215,0,0.6),
      0 0 48px rgba(255,215,0,0.3);
  }
}

@keyframes fairy-sparkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8) rotate(0deg); }
  50%       { opacity: 0.8; transform: scale(1.2) rotate(180deg); }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes triforce-appear {
  0%   { opacity: 0; transform: scale(0.5) rotate(-10deg); }
  60%  { opacity: 1; transform: scale(1.1) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

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

/* --------------------------------------------------------------------------
   Custom Properties
   -------------------------------------------------------------------------- */
:root {
  --bg:            #0a1400;
  --bg-card:       #0d1a00;
  --bg-alt:        #070f00;
  --bg-dark-world: #1a0a2e;
  --text:          #e8f0d8;
  --text-muted:    #7a9a6a;
  --accent:        #ffd700;
  --accent-dim:    #c8a800;
  --accent-glow:   rgba(255, 215, 0, 0.25);
  --secondary:     #3a7d44;
  --secondary-dim: #2a5c32;
  --border:        #1a3a10;
  --border-accent: #ffd700;
  --danger:        #c0392b;

  --font-heading:  'Almendra', 'Georgia', serif;
  --font-body:     'PT Serif', 'Georgia', serif;

  --nav-height:    64px;
  --container-max: 1200px;
  --radius:        4px;
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.75;
  overflow-x: hidden;
  padding-top: var(--nav-height);
  /* Dungeon map grid motif */
  background-image:
    linear-gradient(rgba(58,125,68,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58,125,68,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover { color: #ffe666; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--accent);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  text-shadow:
    0 0 10px rgba(255,215,0,0.8),
    0 0 20px rgba(255,215,0,0.5),
    0 0 40px rgba(255,215,0,0.3),
    0 0 80px rgba(255,215,0,0.1);
}

h2 { font-size: clamp(1.4rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.5em; }
li { margin-bottom: 0.35em; }

blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  margin: 24px 0;
  background: rgba(255,215,0,0.04);
  font-style: italic;
  color: var(--text);
}

blockquote cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

.placeholder {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-radius: var(--radius);
  min-height: 140px;
  font-family: var(--font-body);
  text-align: center;
  padding: 16px;
}

.site-section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}

.site-section:last-child { border-bottom: none; }

/* --------------------------------------------------------------------------
   Skip Link
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 8px 16px;
  z-index: 9999;
  font-weight: 700;
  font-family: var(--font-heading);
}

.skip-link:focus { top: 0; }

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
#site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(7, 15, 0, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,215,0,0.15);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.nav-brand {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.05em;
  text-shadow:
    0 0 8px rgba(255,215,0,0.7),
    0 0 16px rgba(255,215,0,0.3);
  flex-shrink: 0;
}

.nav-brand:hover { color: #ffe666; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-accent);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius);
  flex-direction: column;
  gap: 4px;
}

.burger {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--accent);
  transition: all 0.2s;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 4px;
  padding: 0;
  margin: 0;
}

.nav-link {
  display: block;
  padding: 6px 12px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
  letter-spacing: 0.03em;
}

.nav-link:hover {
  color: var(--accent);
  background: rgba(255,215,0,0.06);
}

.nav-link--active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-menu {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(7,15,0,0.98);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    gap: 0;
  }

  .nav-menu--open { display: flex; }

  .nav-link {
    padding: 12px 16px;
    font-size: 1rem;
  }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
#hero {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.35) saturate(0.8);
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 30%,
    rgba(10,20,0,0.6) 70%,
    var(--bg) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 40px 20px;
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
}

/* Fairy sprite pseudo-elements */
.hero-content::before {
  content: '\2726';
  position: absolute;
  color: var(--accent);
  opacity: 0;
  font-size: 0.7rem;
  top: 20%;
  left: 3%;
  animation: fairy-sparkle 2.4s ease-in-out infinite;
  pointer-events: none;
}

.hero-content::after {
  content: '\2726';
  position: absolute;
  color: var(--secondary);
  opacity: 0;
  font-size: 0.5rem;
  top: 55%;
  right: 5%;
  animation: fairy-sparkle 3s ease-in-out infinite 1.1s;
  pointer-events: none;
}

.hero-eyebrow {
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
  font-family: var(--font-body);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 7vw, 5rem);
  color: var(--accent);
  line-height: 1;
  margin-bottom: 20px;
  text-shadow:
    0 0 10px rgba(255,215,0,0.9),
    0 0 20px rgba(255,215,0,0.6),
    0 0 40px rgba(255,215,0,0.4),
    0 0 80px rgba(255,215,0,0.2);
}

.hero-tagline {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--text);
  max-width: 600px;
  margin-bottom: 32px;
  line-height: 1.6;
  font-style: italic;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
}

.hero-stat .num {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 0 8px rgba(255,215,0,0.5);
}

.hero-stat .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Section Headers
   -------------------------------------------------------------------------- */
.section-header {
  margin-bottom: 40px;
}

.section-label {
  display: inline-block;
  font-size: 0.72rem;
  font-family: var(--font-heading);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--secondary);
  border: 1px solid var(--secondary);
  padding: 3px 8px;
  border-radius: 2px;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  color: var(--accent);
  margin-bottom: 16px;
  text-shadow:
    0 0 8px rgba(255,215,0,0.5),
    0 0 16px rgba(255,215,0,0.2);
}

.section-intro {
  max-width: 700px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   Triforce Symbol
   -------------------------------------------------------------------------- */
.triforce-symbol {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.75;
  color: var(--accent);
  text-shadow:
    0 0 10px rgba(255,215,0,0.9),
    0 0 20px rgba(255,215,0,0.6),
    0 0 40px rgba(255,215,0,0.3);
  font-size: 1.6rem;
  user-select: none;
  box-shadow:
    0 0 16px rgba(255,215,0,0.2),
    0 0 32px rgba(255,215,0,0.1);
  border-radius: 50%;
  padding: 4px;
}

.triforce-symbol .tri-row { display: flex; }

/* --------------------------------------------------------------------------
   Trivia Callout
   -------------------------------------------------------------------------- */
.trivia {
  background: rgba(58,125,68,0.08);
  border: 1px solid rgba(58,125,68,0.3);
  border-left: 4px solid var(--secondary);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 32px 0;
  font-size: 0.92rem;
  color: var(--text);
  position: relative;
}

.trivia::before {
  content: '\2726';
  position: absolute;
  top: 12px;
  right: 16px;
  color: var(--secondary);
  opacity: 0.5;
  font-size: 0.8rem;
}

.trivia strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   Developer Quote
   -------------------------------------------------------------------------- */
.dev-quote {
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  margin: 32px 0;
  background: rgba(255,215,0,0.04);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  font-size: 1rem;
  color: var(--text);
  box-shadow: -2px 0 12px rgba(255,215,0,0.08);
}

.dev-quote cite {
  display: block;
  margin-top: 10px;
  font-style: normal;
  font-size: 0.8rem;
  color: var(--accent-dim);
  font-family: var(--font-heading);
}

/* --------------------------------------------------------------------------
   Screenshot Strip
   -------------------------------------------------------------------------- */
.screenshot-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 32px 0;
}

.screenshot-strip figure {
  margin: 0;
}

.screenshot-strip figure img,
.screenshot-strip figure .placeholder {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  aspect-ratio: 4/3;
  object-fit: cover;
}

.screenshot-strip figure .placeholder {
  aspect-ratio: 4/3;
}

.screenshot-strip figcaption {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Video Grid
   -------------------------------------------------------------------------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin: 32px 0;
}

.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.video-card:hover {
  border-color: rgba(255,215,0,0.3);
  box-shadow: 0 0 16px rgba(255,215,0,0.08);
}

.video-label {
  font-size: 0.72rem;
  font-family: var(--font-heading);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--secondary);
  padding: 10px 12px 0;
}

.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Lite-YouTube facade: poster image + play button, replaced with iframe on click */
.video-facade {
  position: absolute;
  inset: 0;
  display: block;
  background: #000;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
}

.video-facade img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, filter 0.2s ease;
}

.video-facade:hover img,
.video-facade:focus-visible img {
  transform: scale(1.03);
  filter: brightness(0.85);
}

.video-facade__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 48px;
  margin: -24px 0 0 -34px;
  background: rgba(0,0,0,0.7);
  border-radius: 12px;
  transition: background 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.video-facade__play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  margin: -10px 0 0 -7px;
  border-style: solid;
  border-width: 10px 0 10px 17px;
  border-color: transparent transparent transparent #fff;
}

.video-facade:hover .video-facade__play,
.video-facade:focus-visible .video-facade__play {
  background: rgba(204, 0, 0, 0.9);
  transform: scale(1.05);
}

.video-facade:focus-visible {
  outline: 2px solid var(--accent, #ffd700);
  outline-offset: -2px;
}

.video-card__meta {
  padding: 12px;
}

.video-card__title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 4px;
}

.video-card__desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Card Grid (generic)
   -------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: rgba(255,215,0,0.2);
  box-shadow: 0 0 12px rgba(255,215,0,0.06);
}

/* --------------------------------------------------------------------------
   Platform Badges & Filter
   -------------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 0.72rem;
  font-family: var(--font-heading);
  letter-spacing: 0.06em;
  font-weight: 700;
}

.badge--nes   { background: rgba(205,130,0,0.2); color: #e8a800; border: 1px solid rgba(205,130,0,0.3); }
.badge--snes  { background: rgba(58,125,68,0.2); color: #6abf78; border: 1px solid rgba(58,125,68,0.3); }
.badge--gb    { background: rgba(100,150,200,0.15); color: #88c0e8; border: 1px solid rgba(100,150,200,0.25); }

/* --------------------------------------------------------------------------
   Games Grid
   -------------------------------------------------------------------------- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin: 32px 0;
}

article.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

article.game-card:hover {
  border-color: rgba(255,215,0,0.3);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4), 0 0 16px rgba(255,215,0,0.06);
  transform: translateY(-2px);
}

.card-img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.card-body {
  padding: 16px;
}

.card-year {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.platform-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.card-features {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.card-features-title {
  font-size: 0.72rem;
  font-family: var(--font-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 8px;
}

.card-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.card-features li {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.card-features li::before {
  content: '\25B8\0020';
  color: var(--accent);
  font-size: 0.7rem;
}

/* --------------------------------------------------------------------------
   People
   -------------------------------------------------------------------------- */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px;
  margin: 32px 0;
}

.person-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}

.person-card:hover {
  border-color: rgba(255,215,0,0.2);
}

.person-portrait {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.person-info {
  padding: 20px;
}

.person-role {
  font-size: 0.72rem;
  font-family: var(--font-heading);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 6px;
}

.person-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 12px;
  text-shadow: 0 0 8px rgba(255,215,0,0.3);
}

.person-bio {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-height: 200px;
  overflow: hidden;
  position: relative;
  transition: max-height 0.4s ease;
}

.person-bio.expanded {
  max-height: 1000px;
}

.person-bio::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: linear-gradient(transparent, var(--bg-card));
  pointer-events: none;
  transition: opacity 0.3s;
}

.person-bio.expanded::after {
  opacity: 0;
}

.person-expand {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 8px 0;
  display: block;
  margin-top: 4px;
}

.person-quotes {
  padding: 0 20px 20px;
}

.person-quote {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  margin-bottom: 10px;
  background: rgba(255,215,0,0.03);
}

.person-notable {
  padding: 0 20px 20px;
}

.person-notable-title {
  font-size: 0.72rem;
  font-family: var(--font-heading);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 8px;
}

.person-notable ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.person-notable li {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 3px 0;
}

.person-notable li::before {
  content: '\25B8\0020';
  color: var(--accent);
  font-size: 0.7rem;
}

/* --------------------------------------------------------------------------
   Timeline (history page)
   -------------------------------------------------------------------------- */
.timeline {
  counter-reset: era-num;
  margin: 32px 0;
}

.timeline-era {
  counter-increment: era-num;
  position: relative;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}

.timeline-era:last-child { border-bottom: none; }

.timeline-era::before {
  content: counter(era-num);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--accent);
  background: var(--bg);
  margin-bottom: 16px;
  box-shadow: 0 0 8px rgba(255,215,0,0.3);
}

.timeline-era-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.era-year {
  font-size: 0.72rem;
  font-family: var(--font-heading);
  color: var(--secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.era-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 16px;
  text-shadow: 0 0 8px rgba(255,215,0,0.3);
}

.era-image {
  float: right;
  margin: 0 0 20px 24px;
  max-width: 200px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

@media (max-width: 480px) {
  .era-image {
    float: none;
    margin: 16px 0;
    max-width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Flagship Layout — CSS Grid Named Areas
   -------------------------------------------------------------------------- */
.flagship-layout {
  display: grid;
  grid-template-areas:
    "hero"
    "lore"
    "media"
    "dungeon-grid"
    "trivia";
  gap: 40px;
  margin: 40px 0;
}

@media (min-width: 900px) {
  .flagship-layout {
    grid-template-columns: 2fr 1fr;
    grid-template-areas:
      "hero      hero"
      "lore      media"
      "dungeon-grid  dungeon-grid"
      "trivia    trivia";
  }
}

.fl-hero         { grid-area: hero; }
.fl-lore         { grid-area: lore; }
.fl-media        { grid-area: media; }
.fl-dungeon-grid { grid-area: dungeon-grid; }
.fl-trivia       { grid-area: trivia; }

/* --------------------------------------------------------------------------
   Dungeon Grid — :has() hover + counter()
   -------------------------------------------------------------------------- */
.dungeon-section-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 20px;
  text-shadow: 0 0 8px rgba(255,215,0,0.3);
}

.dungeon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

/* :has() — entire grid dims when any card is hovered */
.dungeon-grid:has(.dungeon-card:hover) .dungeon-card {
  opacity: 0.5;
  transform: scale(0.98);
}

.dungeon-grid:has(.dungeon-card:hover) .dungeon-card:hover {
  opacity: 1;
  transform: scale(1);
  border-color: var(--accent);
  box-shadow:
    0 0 16px rgba(255,215,0,0.25),
    0 0 32px rgba(255,215,0,0.1),
    0 4px 12px rgba(0,0,0,0.4);
}

.dungeon-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  transition: all 0.2s ease;
}

.dungeon-card-world {
  font-size: 0.65rem;
  font-family: var(--font-heading);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.dungeon-card-world--light { color: var(--accent); }
.dungeon-card-world--dark  { color: #b87fff; }

.dungeon-card-name {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 6px;
}

.dungeon-card-boss {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dungeon-card-boss strong {
  color: var(--secondary);
}

/* --------------------------------------------------------------------------
   Dungeon List — counter()
   -------------------------------------------------------------------------- */
.dungeon-list {
  counter-reset: dungeon-num;
  list-style: none;
  padding: 0;
  margin: 24px 0;
}

.dungeon-item {
  counter-increment: dungeon-num;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.dungeon-item:last-child { border-bottom: none; }

.dungeon-item::before {
  content: counter(dungeon-num, decimal-leading-zero);
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 0 8px rgba(255,215,0,0.4);
}

.dungeon-item-body {}

.dungeon-item-name {
  font-family: var(--font-heading);
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.dungeon-item-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   World Sections (Light vs Dark)
   -------------------------------------------------------------------------- */
.world-section {
  padding: 32px;
  border-radius: var(--radius);
  margin: 24px 0;
}

.world-section--light {
  background: rgba(255,215,0,0.04);
  border: 1px solid rgba(255,215,0,0.15);
}

.world-section--dark {
  background: rgba(88,0,88,0.1);
  border: 1px solid rgba(180,100,255,0.2);
}

.world-section--dark h3 {
  color: #b87fff;
  text-shadow: 0 0 8px rgba(184,127,255,0.4);
}

.world-section--dark .section-label {
  color: #b87fff;
  border-color: #b87fff;
}

/* --------------------------------------------------------------------------
   Gallery
   -------------------------------------------------------------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 32px 0;
}

.gallery-item {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover {
  border-color: rgba(255,215,0,0.4);
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 12px rgba(255,215,0,0.1);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  padding: 24px 10px 8px;
  font-size: 0.72rem;
  color: #ccc;
  opacity: 0;
  transition: opacity 0.2s;
}

.gallery-item:hover .gallery-item-caption {
  opacity: 1;
}

/* Portrait items */
.gallery-item--portrait img {
  object-position: top center;
}

/* --------------------------------------------------------------------------
   Flagship card teaser
   -------------------------------------------------------------------------- */
.flagship-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: var(--radius);
  padding: 28px 32px;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 16px rgba(255,215,0,0.05);
}

.flagship-card:hover {
  border-color: var(--accent);
  box-shadow:
    0 0 20px rgba(255,215,0,0.12),
    0 0 40px rgba(255,215,0,0.06);
}

.flagship-card__eyebrow {
  font-size: 0.7rem;
  font-family: var(--font-heading);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 8px;
}

.flagship-card__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 10px;
  text-shadow: 0 0 8px rgba(255,215,0,0.3);
}

.flagship-card__desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.6;
}

.flagship-card__cta {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 8px 16px;
  border-radius: var(--radius);
  white-space: nowrap;
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   Reveal animation
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Easter Egg Overlay
   -------------------------------------------------------------------------- */
.easter-egg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,15,0,0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  animation: slide-up 0.4s ease;
  cursor: pointer;
}

.easter-egg-triforce {
  font-size: 5rem;
  color: var(--accent);
  text-shadow:
    0 0 20px rgba(255,215,0,1),
    0 0 40px rgba(255,215,0,0.8),
    0 0 80px rgba(255,215,0,0.5),
    0 0 160px rgba(255,215,0,0.2);
  animation: triforce-appear 0.6s ease forwards, glow-pulse 2s ease-in-out infinite 0.6s;
  line-height: 0.75;
}

.easter-egg-text {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
}

.easter-egg-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */
.lb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lb-inner {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
}

.lb-inner img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  border: 1px solid var(--border);
}

.lb-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: var(--radius);
}

.lb-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  margin-top: 64px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  #hero { min-height: 360px; }
  .hero-title { font-size: clamp(2rem, 8vw, 3rem); }
  .hero-stats { gap: 20px; }
  .flagship-card { flex-direction: column; }
  .flagship-card__cta { display: none; }
  .dungeon-grid { grid-template-columns: 1fr 1fr; }
  .video-grid { grid-template-columns: 1fr; }
}
