/* ==========================================================================
   Final Fantasy SNES Fan Page — css/style.css
   Fantasy RPG aesthetic: deep purple-blue background, magic purple accent,
   ancient gold secondary. Lora 700 headings, Georgia body.
   Advanced CSS: CSS masonry for gallery, layered radial gradients for
   crystal/esper glow, CSS Grid template areas for flagship, drop-shadow()
   for crystal shard decorative elements.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Lora:wght@700&display=swap');

[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */
@keyframes crystal-pulse {
  0%, 100% { opacity: 0.4; filter: drop-shadow(0 0 4px rgba(153, 102, 204, 0.4)); }
  50%       { opacity: 0.9; filter: drop-shadow(0 0 12px rgba(153, 102, 204, 0.8)); }
}

@keyframes atb-fill {
  from { width: 0%; }
  to   { width: 100%; }
}

@keyframes gold-shimmer {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; text-shadow: 0 0 16px rgba(212, 175, 55, 0.6); }
}

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

@keyframes esper-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(153,102,204,0.2), inset 0 0 12px rgba(153,102,204,0.05); }
  50%       { box-shadow: 0 0 24px rgba(153,102,204,0.4), inset 0 0 24px rgba(153,102,204,0.1); }
}

@keyframes fade-out {
  0%   { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}

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

/* --------------------------------------------------------------------------
   Custom Properties
   -------------------------------------------------------------------------- */
:root {
  --bg:            #080318;
  --bg-card:       #0d0525;
  --bg-overlay:    rgba(8, 3, 24, 0.82);
  --bg-alt:        #100628;
  --text:          #e2d9f3;
  --text-muted:    #8b7aaa;
  --accent:        #9966cc;
  --accent-dim:    #7744aa;
  --accent-glow:   rgba(153, 102, 204, 0.35);
  --accent-glow-s: rgba(153, 102, 204, 0.15);
  --secondary:     #d4af37;
  --secondary-dim: #a8892a;
  --secondary-glow:rgba(212, 175, 55, 0.35);
  --border:        rgba(153, 102, 204, 0.2);
  --border-bright: rgba(153, 102, 204, 0.5);
  --gold-border:   rgba(212, 175, 55, 0.3);

  --font-heading:  'Lora', Georgia, 'Times New Roman', serif;
  --font-body:     Georgia, 'Times New Roman', serif;

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

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

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

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(100, 40, 180, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(60, 20, 120, 0.2) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(30, 10, 80, 0.15) 0%, transparent 60%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.8;
  overflow-x: hidden;
  padding-top: var(--nav-height);
}

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

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

a:hover, a:focus {
  color: var(--secondary);
  text-shadow: 0 0 8px var(--secondary-glow);
  outline: none;
}

ul, ol { list-style: none; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

strong { color: var(--secondary); font-weight: 700; }
em     { color: var(--accent); font-style: italic; }

/* --------------------------------------------------------------------------
   Skip link
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -99px;
  left: 1rem;
  z-index: 1000;
  background: var(--accent);
  color: var(--bg);
  padding: 0.4rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  border-radius: var(--radius);
}

.skip-link:focus { top: 0.5rem; }

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
#site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--nav-height);
  background: rgba(8, 3, 24, 0.88);
  backdrop-filter: blur(14px) brightness(0.7) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) brightness(0.7) saturate(1.5);
  border-bottom: 1px solid var(--border);
}

#site-nav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), var(--secondary), var(--accent), transparent);
  opacity: 0.5;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--secondary);
  text-shadow: 0 0 10px var(--secondary-glow);
  letter-spacing: 0.04em;
  transition: text-shadow 0.3s;
  white-space: nowrap;
}

.nav-brand:hover {
  text-shadow: 0 0 20px var(--secondary-glow), 0 0 40px rgba(212,175,55,0.2);
  color: var(--secondary);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0.3rem 0.65rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.nav-link:hover,
.nav-link--active {
  color: var(--accent);
  border-color: var(--border);
  background: rgba(153, 102, 204, 0.07);
  text-shadow: none;
}

.nav-link--active {
  color: var(--secondary);
  border-color: var(--gold-border);
  animation: gold-shimmer 3s ease-in-out infinite;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}

.burger {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--accent);
  transition: transform 0.25s, opacity 0.25s;
}

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

  .nav-menu {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(8, 3, 24, 0.97);
    padding: 1.5rem;
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border);
    overflow-y: auto;
  }

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

  .nav-item { width: 100%; }

  .nav-link {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    font-size: 1rem;
  }
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.site-section {
  padding: 5rem 0;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  color: var(--secondary);
  text-shadow: 0 0 24px var(--secondary-glow), 0 0 48px rgba(212,175,55,0.15);
}

h2 {
  font-size: clamp(1.4rem, 3.5vw, 2.1rem);
  color: var(--accent);
  position: relative;
}

h2::before {
  content: '';
  display: block;
  position: absolute;
  left: -1.2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--accent);
  opacity: 0.6;
}

h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); color: var(--secondary); }
h4 { font-size: 1rem; color: var(--accent); letter-spacing: 0.04em; }

h2::after {
  content: '';
  display: block;
  width: 3rem;
  height: 2px;
  background: linear-gradient(to right, var(--accent), var(--secondary), transparent);
  margin-top: 0.5rem;
}

p + p { margin-top: 0.8em; }

/* --------------------------------------------------------------------------
   Section header with radial glow
   -------------------------------------------------------------------------- */
.section-header {
  margin-bottom: 2.5rem;
  position: relative;
  padding-left: 1.5rem;
}

.section-header::before {
  content: '';
  position: absolute;
  inset: -2rem -4rem;
  background: radial-gradient(ellipse at 0% 50%, rgba(153,102,204,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--secondary);
  border-left: 3px solid var(--secondary);
  padding-left: 0.6rem;
  margin-bottom: 0.6rem;
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   Crystal shard dividers
   -------------------------------------------------------------------------- */
.crystal-divider {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 3rem 0;
}

.crystal-divider::before,
.crystal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border));
}

.crystal-divider::after {
  background: linear-gradient(to left, transparent, var(--border));
}

.crystal-shard {
  width: 12px;
  height: 20px;
  clip-path: polygon(50% 0%, 100% 40%, 80% 100%, 20% 100%, 0% 40%);
  background: var(--accent);
  filter: drop-shadow(0 0 6px rgba(153,102,204,0.7));
  animation: crystal-pulse 3s ease-in-out infinite;
}

.crystal-shard--gold {
  background: var(--secondary);
  filter: drop-shadow(0 0 6px rgba(212,175,55,0.7));
  animation-delay: 1.5s;
}

/* --------------------------------------------------------------------------
   ATB Gauge decoration
   -------------------------------------------------------------------------- */
.atb-gauge {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.5rem 0;
}

.atb-gauge-label {
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--secondary);
  white-space: nowrap;
  opacity: 0.7;
}

.atb-gauge-track {
  flex: 1;
  height: 6px;
  background: rgba(153,102,204,0.15);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.atb-gauge-fill {
  height: 100%;
  background: linear-gradient(to right, var(--accent), var(--secondary));
  border-radius: 3px;
  box-shadow: 0 0 8px var(--accent-glow);
  animation: atb-fill 2.5s ease-in-out forwards;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
#hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  margin-top: calc(-1 * var(--nav-height));
  padding-top: var(--nav-height);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(0.25) saturate(1.3);
  z-index: 0;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(153,102,204,0.25) 0%, transparent 50%),
    linear-gradient(to bottom, rgba(8,3,24,0.2) 0%, rgba(8,3,24,0.95) 100%);
}

.hero-content {
  position: relative;
  z-index: 3;
  padding: 2rem 0;
  max-width: 700px;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 1rem;
  opacity: 0.9;
}

.hero-title {
  color: var(--secondary);
  text-shadow: 0 0 30px rgba(212,175,55,0.5), 0 0 60px rgba(212,175,55,0.2);
  margin-bottom: 1.2rem;
  letter-spacing: 0.06em;
}

.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 2.5rem;
  max-width: 540px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  padding: 0.75rem 1.8rem;
  border: 1px solid;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 700;
}

.btn-primary:hover {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  color: var(--bg);
  box-shadow: 0 0 20px var(--accent-glow);
  text-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--secondary);
  border-color: var(--gold-border);
}

.btn-secondary:hover {
  background: rgba(212,175,55,0.08);
  box-shadow: 0 0 14px var(--secondary-glow);
  color: var(--secondary);
  text-shadow: none;
}

/* --------------------------------------------------------------------------
   Screenshot strip
   -------------------------------------------------------------------------- */
.screenshot-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3px;
  background: var(--border);
}

.screenshot-strip img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  filter: saturate(0.75) brightness(0.8);
  transition: filter 0.3s, transform 0.3s;
}

.screenshot-strip img:hover {
  filter: saturate(1.1) brightness(1);
  transform: scale(1.02);
  z-index: 1;
}

/* --------------------------------------------------------------------------
   Crystal panel cards
   -------------------------------------------------------------------------- */
.crystal-panel {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow: hidden;
  animation: esper-glow 4s ease-in-out infinite;
}

.crystal-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--accent), var(--secondary), transparent);
  opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Trivia callouts
   -------------------------------------------------------------------------- */
.trivia {
  background: rgba(153,102,204,0.06);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 1.2rem 1.5rem;
  margin: 2rem 0;
  position: relative;
}

.trivia::before {
  content: 'LORE';
  position: absolute;
  top: 0.4rem;
  right: 0.8rem;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.5;
  font-family: var(--font-heading);
}

.trivia p,
.trivia li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.6rem;
  font-size: 0.92rem;
  color: var(--text);
  font-style: italic;
}

.trivia p::before,
.trivia li::before {
  content: '◆';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.6rem;
  top: 0.35em;
}

.trivia li:last-child,
.trivia p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Dev quotes
   -------------------------------------------------------------------------- */
blockquote.dev-quote {
  border-left: 4px solid var(--secondary);
  padding: 1.2rem 1.8rem;
  margin: 2.5rem 0;
  background: rgba(212,175,55,0.04);
  position: relative;
}

blockquote.dev-quote::before {
  content: '\201C';
  position: absolute;
  top: -0.8rem;
  left: 0.8rem;
  font-size: 4rem;
  color: var(--secondary);
  opacity: 0.25;
  font-family: Georgia, serif;
  line-height: 1;
}

blockquote.dev-quote p {
  font-style: italic;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.8;
}

blockquote.dev-quote cite {
  display: block;
  margin-top: 0.8rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--secondary);
  font-style: normal;
}

/* --------------------------------------------------------------------------
   Stats grid
   -------------------------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.stat-cell {
  background: var(--bg-card);
  padding: 1.8rem 1rem;
  text-align: center;
  position: relative;
}

.stat-cell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(153,102,204,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.stat-value {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--secondary);
  text-shadow: 0 0 14px var(--secondary-glow);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   YouTube embeds
   -------------------------------------------------------------------------- */
.embed-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.embed-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Lite YouTube facade — clickable poster that defers iframe load until play. */
a.embed-container.lite-youtube,
.embed-container.lite-youtube {
  display: block;
  background-color: #000;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  text-decoration: none;
}
.lite-youtube__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 0;
}
.lite-youtube__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 68px;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: rgba(20, 20, 20, 0.78);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.18s, transform 0.18s;
  z-index: 2;
}
.lite-youtube__play:hover,
.lite-youtube__play:focus-visible {
  background: var(--accent, #9966cc);
  transform: scale(1.06);
  outline: none;
}
.lite-youtube__play-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-left: 4px;
}
.lite-youtube--activated {
  cursor: default;
  background-image: none !important;
}

.embed-group {
  margin-bottom: 3.5rem;
}

.embed-group-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
  margin-bottom: 1.5rem;
}

.embed-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  padding-left: 0.25rem;
  font-style: italic;
}

.embed-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  padding-left: 0.25rem;
}

.embed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* --------------------------------------------------------------------------
   Game cards
   -------------------------------------------------------------------------- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

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

article.game-card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 0 20px rgba(153,102,204,0.1);
}

.card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  filter: brightness(0.88);
  transition: filter 0.3s;
}

article.game-card:hover .card-img {
  filter: brightness(1);
}

.placeholder {
  width: 100%;
  height: 220px;
  background: rgba(153,102,204,0.05);
  border: 1px dashed rgba(153,102,204,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
}

.card-body {
  padding: 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--secondary);
}

.card-year {
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.platform-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

.badge {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 2px;
}

.badge--nes   { border-color: rgba(212,175,55,0.4); color: var(--secondary); }
.badge--snes  { border-color: var(--border-bright); color: var(--accent); }

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 0.3rem;
  flex: 1;
}

.card-innovation {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

.card-innovation strong {
  color: var(--accent);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.2rem;
}

/* --------------------------------------------------------------------------
   Platform filter buttons
   -------------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

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

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(153, 102, 204, 0.08);
}

/* --------------------------------------------------------------------------
   People section
   -------------------------------------------------------------------------- */
.person-section {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.5rem;
  margin-bottom: 4rem;
  align-items: start;
}

.person-portrait {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--border);
  filter: brightness(0.85) saturate(0.7);
  transition: filter 0.3s;
  border-radius: var(--radius);
}

.person-section:hover .person-portrait {
  filter: brightness(0.95) saturate(0.9);
}

.person-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  background: rgba(153,102,204,0.04);
  border: 1px dashed rgba(153,102,204,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
  border-radius: var(--radius);
}

.person-info h2 {
  margin-bottom: 0.3rem;
}

.person-info h2::before { display: none; }

.person-role {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.person-bio p {
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 0.8em;
  line-height: 1.8;
}

.person-works {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.person-works h4 {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
  opacity: 0.8;
}

.person-works li {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.15rem 0;
  padding-left: 1rem;
  position: relative;
}

.person-works li::before {
  content: '◆';
  position: absolute;
  left: 0;
  color: var(--secondary);
  font-size: 0.45rem;
  top: 0.45em;
}

@media (max-width: 700px) {
  .person-section {
    grid-template-columns: 1fr;
  }
  .person-portrait {
    max-width: 200px;
  }
}

/* --------------------------------------------------------------------------
   Gallery — CSS masonry layout
   -------------------------------------------------------------------------- */
.gallery-masonry {
  columns: 3;
  column-gap: 0.75rem;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 0.75rem;
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  filter: brightness(0.82) saturate(0.7);
  transition: filter 0.4s, transform 0.4s;
}

.gallery-item:hover img {
  filter: brightness(1) saturate(1.1);
  transform: scale(1.03);
}

.gallery-caption {
  padding: 0.5rem 0.7rem;
  background: rgba(8,3,24,0.9);
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

@media (max-width: 900px) {
  .gallery-masonry { columns: 2; }
}

@media (max-width: 500px) {
  .gallery-masonry { columns: 1; }
}

/* --------------------------------------------------------------------------
   Flagship — CSS Grid template areas
   -------------------------------------------------------------------------- */
.flagship-layout {
  display: grid;
  grid-template-areas:
    "hero-zone   hero-zone"
    "cast-zone   cast-zone"
    "opera-zone  kefka-zone"
    "ruin-zone   ruin-zone";
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.flagship-hero-zone   { grid-area: hero-zone; }
.flagship-cast-zone   { grid-area: cast-zone; }
.flagship-opera-zone  { grid-area: opera-zone; }
.flagship-kefka-zone  { grid-area: kefka-zone; }
.flagship-ruin-zone   { grid-area: ruin-zone; }

@media (max-width: 768px) {
  .flagship-layout {
    grid-template-areas:
      "hero-zone"
      "cast-zone"
      "opera-zone"
      "kefka-zone"
      "ruin-zone";
    grid-template-columns: 1fr;
  }
}

/* Ensemble cast — CSS masonry */
.cast-masonry {
  columns: 3;
  column-gap: 0.75rem;
}

.cast-card {
  break-inside: avoid;
  margin-bottom: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.8rem;
  border-radius: var(--radius);
  transition: border-color 0.2s;
}

.cast-card:hover {
  border-color: var(--border-bright);
}

.cast-name {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  color: var(--secondary);
  margin-bottom: 0.25rem;
}

.cast-role {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

@media (max-width: 900px) {
  .cast-masonry { columns: 2; }
}

@media (max-width: 500px) {
  .cast-masonry { columns: 1; }
}

/* --------------------------------------------------------------------------
   History page
   -------------------------------------------------------------------------- */
.prose {
  max-width: 740px;
}

.prose p { margin-bottom: 0.9em; color: var(--text); font-size: 0.95rem; line-height: 1.85; }

.section-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 768px) {
  .section-two-col { grid-template-columns: 1fr; }
}

.history-img {
  width: 100%;
  max-width: 380px;
  height: auto;
  border: 1px solid var(--border);
  margin: 1.5rem 0;
  filter: brightness(0.85) saturate(0.75);
  transition: filter 0.3s;
  border-radius: var(--radius);
}

.history-img:hover { filter: brightness(0.95) saturate(0.95); }

/* --------------------------------------------------------------------------
   Scroll reveal
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* --------------------------------------------------------------------------
   Easter egg overlay
   -------------------------------------------------------------------------- */
.easter-egg-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 3, 24, 0.85);
}

.easter-egg-message {
  text-align: center;
  padding: 2rem 3rem;
  border: 2px solid var(--accent);
  background: rgba(8,3,24,0.95);
  box-shadow: 0 0 40px rgba(153,102,204,0.5), inset 0 0 40px rgba(153,102,204,0.05);
  border-radius: var(--radius);
  max-width: 500px;
}

.easter-egg-message h3 {
  color: var(--secondary);
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
  text-shadow: 0 0 20px var(--secondary-glow);
}

.easter-egg-message p {
  color: var(--text);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.7;
}

.easter-egg-overlay.active {
  opacity: 1;
  animation: fade-out 3.5s ease forwards;
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.mt-sm { margin-top: 1rem; }
.mt-md { margin-top: 2rem; }
.mt-lg { margin-top: 3.5rem; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 4rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

footer a { color: var(--text-muted); }
footer a:hover { color: var(--accent); text-shadow: none; }

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   Videos page
   -------------------------------------------------------------------------- */
.videos-hero {
  position: relative;
  overflow: hidden;
  max-height: 280px;
  margin-bottom: 2.5rem;
}

.videos-hero img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  filter: brightness(0.4) saturate(0.8);
}

.videos-hero-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Responsive tweaks
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .games-grid   { grid-template-columns: 1fr; }
  .embed-grid   { grid-template-columns: 1fr; }
  .hero-cta     { flex-direction: column; }
  .stats-grid   { grid-template-columns: 1fr 1fr; }
}
