/* ==========================================================================
   Chrono Trigger Fan Page — css/style.css
   Time-travel aesthetic: deep dark warm amber (#160e00) base, ff9900 accent,
   4fc3f7 secondary. Rokkitt 700 headings, Merriweather 400 body.
   Advanced CSS: 3D perspective on flagship hero; @property + @keyframes for
   time portal glow; filter: hue-rotate() cycling on era cards;
   clip-path circle() expanding on era card hover.
   ========================================================================== */

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

[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   Registered custom properties (CSS Houdini @property)
   -------------------------------------------------------------------------- */
@property --portal-spread {
  syntax: '<length>';
  inherits: false;
  initial-value: 6px;
}

@property --portal-spread-2 {
  syntax: '<length>';
  inherits: false;
  initial-value: 14px;
}

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */
@keyframes portal-pulse {
  0%, 100% {
    --portal-spread: 6px;
    --portal-spread-2: 14px;
  }
  50% {
    --portal-spread: 22px;
    --portal-spread-2: 40px;
  }
}

@keyframes gear-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

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

@keyframes amber-shimmer {
  0%, 100% { opacity: 0.65; }
  50%       { opacity: 1; text-shadow: 0 0 18px rgba(255, 153, 0, 0.6); }
}

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

@keyframes era-hue {
  0%   { filter: hue-rotate(0deg); }
  33%  { filter: hue-rotate(28deg); }
  66%  { filter: hue-rotate(-22deg); }
  100% { filter: hue-rotate(0deg); }
}

@keyframes time-stream-flow {
  from { background-position: 0 0; }
  to   { background-position: 200% 0; }
}

@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:            #160e00;
  --bg-card:       #1e1400;
  --bg-overlay:    rgba(22, 14, 0, 0.84);
  --bg-alt:        #1a1000;
  --text:          #f0e6cc;
  --text-muted:    #9e8860;
  --accent:        #ff9900;
  --accent-dim:    #cc7700;
  --accent-glow:   rgba(255, 153, 0, 0.35);
  --accent-glow-s: rgba(255, 153, 0, 0.12);
  --secondary:     #4fc3f7;
  --secondary-dim: #0288d1;
  --secondary-glow:rgba(79, 195, 247, 0.35);
  --border:        rgba(255, 153, 0, 0.18);
  --border-bright: rgba(255, 153, 0, 0.45);
  --blue-border:   rgba(79, 195, 247, 0.25);

  --font-heading:  'Rokkitt', Georgia, 'Times New Roman', serif;
  --font-body:     'Merriweather', Georgia, 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(180, 100, 0, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(0, 80, 140, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(80, 40, 0, 0.1) 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(--accent); font-weight: 700; }
em     { color: var(--secondary); 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(22, 14, 0, 0.90);
  backdrop-filter: blur(14px) brightness(0.6) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) brightness(0.6) saturate(1.4);
  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.45;
}

.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(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
  letter-spacing: 0.04em;
  transition: text-shadow 0.3s;
  white-space: nowrap;
}

.nav-brand:hover {
  text-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(255,153,0,0.2);
  color: var(--accent);
}

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

.nav-link {
  font-family: var(--font-body);
  font-size: 0.78rem;
  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(255, 153, 0, 0.06);
  text-shadow: none;
}

.nav-link--active {
  color: var(--secondary);
  border-color: var(--blue-border);
  animation: amber-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(22, 14, 0, 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(--accent);
  text-shadow: 0 0 24px var(--accent-glow), 0 0 48px rgba(255,153,0,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.55;
}

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
   -------------------------------------------------------------------------- */
.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(255,153,0,0.09) 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;
}

/* --------------------------------------------------------------------------
   Clock gear dividers
   -------------------------------------------------------------------------- */
.gear-divider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 3rem 0;
}

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

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

.gear-icon {
  font-size: 1.1rem;
  color: var(--accent);
  opacity: 0.45;
  animation: gear-spin 10s linear infinite;
  display: inline-block;
  line-height: 1;
}

.gear-icon--blue {
  color: var(--secondary);
  animation-delay: -3s;
  animation-direction: reverse;
}

/* --------------------------------------------------------------------------
   Time Gauge decoration (like in-game time gauge)
   -------------------------------------------------------------------------- */
.time-gauge {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.5rem 0;
}

.time-gauge-label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--secondary);
  white-space: nowrap;
  opacity: 0.75;
}

.time-gauge-track {
  flex: 1;
  height: 6px;
  background: rgba(255,153,0,0.1);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

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

/* --------------------------------------------------------------------------
   Hero — time portal glow uses @property animation
   -------------------------------------------------------------------------- */
#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 30%;
  background-repeat: no-repeat;
  filter: brightness(0.22) saturate(1.2);
  z-index: 0;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(255,153,0,0.2) 0%, transparent 50%),
    linear-gradient(to bottom, rgba(22,14,0,0.1) 0%, rgba(22,14,0,0.95) 100%);
}

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

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

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

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

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

/* Time portal ring — uses @property animation for smooth glow interpolation */
.portal-ring {
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 3px solid rgba(255,153,0,0.3);
  animation: portal-pulse 4s ease-in-out infinite;
  box-shadow:
    0 0 var(--portal-spread) var(--accent),
    inset 0 0 var(--portal-spread-2) rgba(255,153,0,0.15);
  z-index: 2;
  pointer-events: none;
}

.portal-ring::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px solid rgba(79,195,247,0.25);
  animation: portal-pulse 4s ease-in-out infinite reverse;
}

.portal-ring::after {
  content: '';
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  border: 1px dashed rgba(255,153,0,0.15);
}

@media (max-width: 900px) {
  .portal-ring { display: none; }
}

/* --------------------------------------------------------------------------
   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(--blue-border);
}

.btn-secondary:hover {
  background: rgba(79,195,247,0.07);
  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.7) 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;
}

/* --------------------------------------------------------------------------
   Era cards — hue-rotate animation + clip-path reveal on hover
   -------------------------------------------------------------------------- */
.eras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.era-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
  animation: era-hue 12s ease-in-out infinite;
}

.era-card:nth-child(1) { animation-delay: 0s; }
.era-card:nth-child(2) { animation-delay: -2s; }
.era-card:nth-child(3) { animation-delay: -4s; }
.era-card:nth-child(4) { animation-delay: -6s; }
.era-card:nth-child(5) { animation-delay: -8s; }
.era-card:nth-child(6) { animation-delay: -10s; }

.era-card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 0 24px rgba(255,153,0,0.12);
  animation-play-state: paused;
}

/* Image container with clip-path portal reveal on hover */
.era-card-img-wrap {
  position: relative;
  height: 180px;
  overflow: hidden;
  clip-path: circle(48% at 50% 50%);
  transition: clip-path 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.era-card:hover .era-card-img-wrap {
  clip-path: circle(100% at 50% 50%);
}

.era-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.75) saturate(0.8);
  transition: filter 0.4s;
}

.era-card:hover .era-card-img-wrap img {
  filter: brightness(0.95) saturate(1);
}

.era-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,153,0,0.04);
  border-bottom: 1px dashed rgba(255,153,0,0.2);
}

.era-card-placeholder span {
  font-size: 2.5rem;
  opacity: 0.35;
}

.era-card-body {
  padding: 1.2rem;
}

.era-card-year {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 0.4rem;
  opacity: 0.9;
}

.era-card-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.era-card-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.8rem;
}

.era-card-music {
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
  font-style: italic;
}

.era-card-music strong {
  color: var(--secondary);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.2rem;
  font-style: normal;
}

/* --------------------------------------------------------------------------
   Trivia callouts — styled as in-game dialogue boxes
   -------------------------------------------------------------------------- */
.trivia {
  background: rgba(255,153,0,0.04);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 1.2rem 1.5rem;
  margin: 2rem 0;
  position: relative;
}

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

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

.trivia p::before,
.trivia li::before {
  content: '⧖';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
  top: 0.25em;
  font-style: normal;
}

.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(79,195,247,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.2;
  font-family: Georgia, serif;
  line-height: 1;
}

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

blockquote.dev-quote cite {
  display: block;
  margin-top: 0.8rem;
  font-size: 0.78rem;
  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(255,153,0,0.06) 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(--accent);
  text-shadow: 0 0 14px var(--accent-glow);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-size: 0.7rem;
  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;
}

/* YouTube facade — lightweight click-to-play poster.
   Renders a poster thumbnail with a play button overlay; clicking the
   thumbnail navigates to YouTube. This avoids the empty-black-box bug
   that occurred when the previous embed video IDs became unavailable. */
.yt-facade {
  position: absolute;
  inset: 0;
  display: block;
  text-decoration: none;
  background: #000;
  overflow: hidden;
}

.yt-facade img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, filter 0.3s ease;
  filter: brightness(0.92);
}

.yt-facade:hover img,
.yt-facade:focus-visible img {
  transform: scale(1.04);
  filter: brightness(1);
}

.yt-facade::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 48px;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(135deg, rgba(255,0,0,0.95) 0%, rgba(200,0,0,0.95) 100%);
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5);
  pointer-events: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.yt-facade::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  margin-left: -8px;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #fff;
  z-index: 2;
  pointer-events: none;
}

.yt-facade:hover::after,
.yt-facade:focus-visible::after {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 6px 22px rgba(0,0,0,0.6);
}

.yt-facade:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.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;
}

/* --------------------------------------------------------------------------
   Character gallery cards (flagship)
   -------------------------------------------------------------------------- */
.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.character-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.character-card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 0 16px rgba(255,153,0,0.08);
}

.character-name {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

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

/* --------------------------------------------------------------------------
   Endings list (flagship)
   -------------------------------------------------------------------------- */
.endings-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.8rem;
  counter-reset: ending;
}

.ending-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem 0.8rem 2.8rem;
  position: relative;
  font-size: 0.88rem;
  transition: border-color 0.2s;
  counter-increment: ending;
}

.ending-item::before {
  content: counter(ending, decimal-leading-zero);
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  color: var(--secondary);
  opacity: 0.7;
  letter-spacing: 0.05em;
}

.ending-item:hover { border-color: var(--border-bright); }

.ending-name {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 0.2rem;
}

.ending-condition {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Flagship hero — 3D perspective transforms
   -------------------------------------------------------------------------- */
.flagship-hero-3d {
  perspective: 900px;
  cursor: default;
  margin-bottom: 2rem;
}

.flagship-hero-inner {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.25s ease;
  will-change: transform;
}

.flagship-hero-inner img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.7) saturate(0.85);
  display: block;
}

.flagship-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(22,14,0,0.9) 0%, rgba(22,14,0,0.3) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
}

.flagship-hero-overlay h2 {
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
}

.flagship-hero-overlay h2::before { display: none; }
.flagship-hero-overlay h2::after  { display: none; }

.flagship-hero-overlay p {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.95rem;
  max-width: 600px;
}

/* --------------------------------------------------------------------------
   Person sections
   -------------------------------------------------------------------------- */
.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.82) saturate(0.65);
  transition: filter 0.3s;
  border-radius: var(--radius);
}

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

.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.9rem;
  color: var(--text);
  margin-bottom: 0.8em;
  line-height: 1.85;
}

.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(--secondary);
  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(--accent);
  font-size: 0.55rem;
  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.8) saturate(0.7);
  transition: filter 0.4s, transform 0.4s;
}

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

.gallery-caption {
  padding: 0.5rem 0.7rem;
  background: rgba(22,14,0,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; } }

/* --------------------------------------------------------------------------
   Filter bar
   -------------------------------------------------------------------------- */
.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(255,153,0,0.07);
}

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

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

.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.82) saturate(0.75);
  transition: filter 0.3s;
  border-radius: var(--radius);
}

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

/* --------------------------------------------------------------------------
   Era colour theme chips
   -------------------------------------------------------------------------- */
.era-theme-chip {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: middle;
}

/* --------------------------------------------------------------------------
   Placeholder images
   -------------------------------------------------------------------------- */
.placeholder {
  width: 100%;
  height: 180px;
  background: rgba(255,153,0,0.04);
  border: 1px dashed rgba(255,153,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.82rem;
  font-family: var(--font-body);
}

/* --------------------------------------------------------------------------
   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(22, 14, 0, 0.88);
}

.easter-egg-message {
  text-align: center;
  padding: 2rem 3rem;
  border: 2px solid var(--accent);
  background: rgba(22,14,0,0.97);
  box-shadow: 0 0 40px rgba(255,153,0,0.4), inset 0 0 40px rgba(255,153,0,0.04);
  border-radius: var(--radius);
  max-width: 500px;
}

.easter-egg-message h3 {
  color: var(--accent);
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
  text-shadow: 0 0 20px var(--accent-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;
}

/* --------------------------------------------------------------------------
   Responsive tweaks
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .embed-grid     { grid-template-columns: 1fr; }
  .hero-cta       { flex-direction: column; }
  .stats-grid     { grid-template-columns: 1fr 1fr; }
  .eras-grid      { grid-template-columns: 1fr; }
  .endings-list   { grid-template-columns: 1fr; }
  .character-grid { grid-template-columns: repeat(2, 1fr); }
}
