/* ==========================================================================
   Thalamus Ltd Fan Page — css/style.css
   Retro C64-era design with CRT glow, pixel fonts, and dark palette.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Share+Tech+Mono&display=swap');

/* --------------------------------------------------------------------------
   Custom Properties
   -------------------------------------------------------------------------- */
:root {
  /* Colour palette inspired by Thalamus loading screen art */
  --bg-primary:    #0a0a12;
  --bg-secondary:  #10101e;
  --bg-card:       #14142a;
  --bg-card-alt:   #1a1a30;
  --border-dim:    #2a2a4a;

  --text-primary:  #e8e8f0;
  --text-secondary:#9090b0;
  --text-dim:      #606080;

  --accent-cyan:   #00e5ff;
  --accent-red:    #ff3355;
  --accent-yellow: #f5d020;
  --accent-green:  #39ff14;
  --accent-purple: #bf5fff;

  /* Font stacks */
  --font-pixel: 'Press Start 2P', 'Courier New', monospace;
  --font-mono:  'Share Tech Mono', 'Courier New', monospace;

  /* CRT glow effects */
  --glow-cyan:   0 0 6px rgba(0,229,255,0.9), 0 0 18px rgba(0,229,255,0.5), 0 0 36px rgba(0,229,255,0.2);
  --glow-red:    0 0 6px rgba(255,51,85,0.9),  0 0 18px rgba(255,51,85,0.5),  0 0 36px rgba(255,51,85,0.2);
  --glow-yellow: 0 0 6px rgba(245,208,32,0.9), 0 0 18px rgba(245,208,32,0.5);
  --glow-green:  0 0 6px rgba(57,255,20,0.8),  0 0 18px rgba(57,255,20,0.4);

  /* Layout */
  --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-primary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1.7;
  overflow-x: hidden;
}

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

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

a:hover,
a:focus {
  color: var(--accent-yellow);
  text-shadow: var(--glow-yellow);
  outline: none;
}

ul, ol {
  list-style: none;
}

/* --------------------------------------------------------------------------
   Typography scale
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-pixel);
  line-height: 1.4;
  letter-spacing: 0.02em;
}

h1 { font-size: clamp(1.2rem, 4vw, 2.4rem); }
h2 { font-size: clamp(0.9rem, 2.5vw, 1.4rem); }
h3 { font-size: clamp(0.7rem, 1.8vw, 1rem); }
h4 { font-size: clamp(0.6rem, 1.4vw, 0.8rem); }
h5 { font-size: 0.6rem; }

p {
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   Container
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
#site-nav {
  visibility: hidden; /* revealed by JS after content injection */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(10,10,18,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--accent-red);
  box-shadow: 0 2px 20px rgba(255,51,85,0.25);
  display: flex;
  align-items: center;
}

#site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-links a {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
  background: rgba(0,229,255,0.06);
}

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

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--accent-cyan);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + 2rem) 1.25rem 4rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,51,85,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(0,229,255,0.08) 0%, transparent 50%),
    var(--bg-primary);
}

/* CRT scanline overlay */
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* CRT flicker animation */
@keyframes crt-flicker {
  0%, 95%, 100% { opacity: 1; }
  96%           { opacity: 0.96; }
  97%           { opacity: 0.99; }
  98%           { opacity: 0.94; }
}

#hero .hero-content {
  position: relative;
  z-index: 2;
  animation: crt-flicker 8s infinite;
}

.hero-eyebrow {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--accent-yellow);
  text-shadow: var(--glow-yellow);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-title {
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
  margin-bottom: 1.25rem;
}

.hero-tagline {
  font-family: var(--font-pixel);
  font-size: clamp(0.45rem, 1.2vw, 0.65rem);
  color: var(--accent-red);
  text-shadow: var(--glow-red);
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.hero-stat {
  text-align: center;
}

.hero-stat .num {
  font-family: var(--font-pixel);
  font-size: clamp(1rem, 3vw, 1.8rem);
  color: var(--accent-yellow);
  text-shadow: var(--glow-yellow);
  display: block;
}

.hero-stat .label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

.btn {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid currentColor;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.05em;
}

.btn-primary {
  color: var(--bg-primary);
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
}

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

.btn-secondary:hover {
  background: rgba(255,51,85,0.1);
  text-shadow: var(--glow-red);
  box-shadow: var(--glow-red);
}

/* --------------------------------------------------------------------------
   Section shared styles
   -------------------------------------------------------------------------- */
.site-section {
  padding: 5rem 0;
  border-top: 1px solid var(--border-dim);
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-label {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--accent-yellow);
  text-shadow: var(--glow-yellow);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.section-title {
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 60ch;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   History Section
   -------------------------------------------------------------------------- */
.history-chapter {
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-left: 3px solid var(--accent-red);
  border-radius: var(--radius);
}

.history-chapter h3 {
  color: var(--accent-yellow);
  text-shadow: var(--glow-yellow);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-dim);
}

.history-chapter p {
  color: var(--text-primary);
}

.history-chapter p + p {
  margin-top: -0.25rem;
}

.person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.person-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-dim);
  border-top: 2px solid var(--accent-cyan);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.person-card h4 {
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
  margin-bottom: 0.4rem;
}

.person-card .role {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--accent-yellow);
  margin-bottom: 0.75rem;
  display: block;
}

.person-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.cite {
  font-size: 0.75rem;
  color: var(--text-dim);
  vertical-align: super;
}

.footnotes {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.footnotes h4 {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-size: 0.5rem;
}

.footnotes ol {
  list-style: decimal;
  padding-left: 1.5rem;
}

.footnotes ol li {
  margin-bottom: 0.4rem;
}

/* --------------------------------------------------------------------------
   Games Section
   -------------------------------------------------------------------------- */
.games-subsection {
  margin-bottom: 4rem;
}

.games-subsection-title {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--accent-red);
  text-shadow: var(--glow-red);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--accent-red);
}

.game-entry {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  margin-bottom: 2rem;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.game-entry:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0,229,255,0.08);
}

.game-header {
  background: var(--bg-card-alt);
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.game-title {
  color: var(--accent-yellow);
  text-shadow: var(--glow-yellow);
}

.game-meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.tag {
  font-family: var(--font-pixel);
  font-size: 0.42rem;
  padding: 0.3rem 0.6rem;
  border-radius: 2px;
  white-space: nowrap;
}

.tag-year {
  background: rgba(255,51,85,0.2);
  color: var(--accent-red);
  border: 1px solid rgba(255,51,85,0.4);
}

.tag-platform {
  background: rgba(0,229,255,0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0,229,255,0.3);
}

.tag-dev {
  background: rgba(245,208,32,0.1);
  color: var(--accent-yellow);
  border: 1px solid rgba(245,208,32,0.3);
}

.game-body {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .game-body {
    grid-template-columns: 1fr 1fr;
  }
  .game-description {
    grid-column: 1 / -1;
  }
}

.game-description {
  color: var(--text-primary);
  font-size: 0.925rem;
  line-height: 1.8;
}

.game-description p {
  margin-bottom: 0.75rem;
}

.key-facts {
  background: var(--bg-secondary);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.key-facts-title {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
  margin-bottom: 0.75rem;
}

.key-facts dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1rem;
}

.key-facts dt {
  color: var(--text-dim);
  font-size: 0.8rem;
  white-space: nowrap;
}

.key-facts dd {
  color: var(--text-primary);
  font-size: 0.8rem;
}

.reception-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border-dim);
  border-left: 3px solid var(--accent-green);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.reception-title {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--accent-green);
  text-shadow: var(--glow-green);
  margin-bottom: 0.75rem;
}

.reception-block p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.image-note {
  grid-column: 1 / -1;
  background: rgba(245,208,32,0.05);
  border: 1px dashed rgba(245,208,32,0.3);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.image-note::before {
  content: '📷 ';
  font-style: normal;
}

/* Secondary game entries (Amiga / Digital) — more compact */
.secondary-entry {
  background: var(--bg-secondary);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.secondary-entry h4 {
  color: var(--accent-purple);
  margin-bottom: 0.5rem;
}

.secondary-entry .game-meta {
  margin-bottom: 0.75rem;
}

.secondary-entry .game-meta {
  margin-bottom: 0.75rem;
}

.secondary-entry p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Media Section
   -------------------------------------------------------------------------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr));
  gap: 2rem;
}

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

.video-entry:hover {
  border-color: var(--accent-cyan);
}

.video-entry-header {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border-dim);
}

.video-entry-header h3 {
  color: var(--accent-yellow);
  margin-bottom: 0.25rem;
}

.video-entry-header p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  background: #000;
}

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

/* --------------------------------------------------------------------------
   Links Section
   -------------------------------------------------------------------------- */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 1rem;
}

.link-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
  color: inherit;
}

.link-card:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-card-alt);
  color: inherit;
  text-shadow: none;
}

.link-icon {
  font-family: var(--font-pixel);
  font-size: 1.2rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 0.1rem;
}

.link-card-content h3 {
  font-size: 0.6rem;
  color: var(--accent-cyan);
  margin-bottom: 0.35rem;
}

.link-card-content p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-dim);
  padding: 2.5rem 0;
  text-align: center;
}

.site-footer p {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.site-footer a {
  color: var(--text-secondary);
}

.site-footer a:hover {
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
}

/* --------------------------------------------------------------------------
   Responsive — Mobile (≤ 640px)
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-dim);
    padding: 1rem 1.25rem;
    z-index: 99;
  }

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

  .nav-links a {
    font-size: 0.6rem;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border-dim);
  }

  .nav-toggle {
    display: flex;
  }

  .hero-stats {
    gap: 1.25rem;
  }

  .history-chapter {
    padding: 1.25rem;
  }

  .game-header {
    padding: 1rem 1.25rem;
  }

  .game-body {
    padding: 1.25rem;
  }
}

/* --------------------------------------------------------------------------
   Responsive — Tablet (768px)
   -------------------------------------------------------------------------- */
@media (min-width: 641px) and (max-width: 1024px) {
  .nav-links a {
    font-size: 0.45rem;
    padding: 0.35rem 0.5rem;
  }
}

/* --------------------------------------------------------------------------
   Responsive — Wide (1280px+)
   -------------------------------------------------------------------------- */
@media (min-width: 1280px) {
  .person-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --------------------------------------------------------------------------
   Gallery page
   -------------------------------------------------------------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
}

.game-screenshot {
  width: 100%;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--bg-secondary);
}

.game-screenshot:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0,229,255,0.2);
}

.screenshot-caption {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  padding: 0.3rem 0;
}

.screenshot-figure {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.screenshot-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  background: var(--bg-card);
  border: 1px dashed var(--border-dim);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 0.8rem;
  text-align: center;
  padding: 1rem;
  margin-bottom: 0;
}

.gallery-page-header {
  padding-top: calc(var(--nav-height) + 2rem);
  padding-bottom: 0;
}

/* --------------------------------------------------------------------------
   Music player page
   -------------------------------------------------------------------------- */
.player-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
}

.player-controls button {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.player-controls button:hover,
.player-controls button:focus {
  background: rgba(0,229,255,0.1);
  box-shadow: var(--glow-cyan);
  outline: none;
}

.now-playing {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-dim);
  border-left: 3px solid var(--accent-green);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}

.now-playing .track-title {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--accent-green);
  text-shadow: var(--glow-green);
  margin-bottom: 0.25rem;
}

.now-playing .track-composer {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.track-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.track-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border-dim);
  cursor: pointer;
  transition: background 0.15s;
}

.track-list li:last-child {
  border-bottom: none;
}

.track-list li:hover {
  background: var(--bg-card-alt);
}

.track-list li.playing {
  background: rgba(57,255,20,0.05);
  border-left: 3px solid var(--accent-green);
  padding-left: calc(1rem - 3px);
}

.track-list .track-name {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.track-list .track-game {
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  color: var(--accent-cyan);
  white-space: nowrap;
}

.track-list .track-composer-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   General content page styles (used by catalogue, flagship, reviews, etc.)
   -------------------------------------------------------------------------- */
.page-section {
  padding: 3rem 0;
  border-top: 1px solid var(--border-dim);
}

.page-section:first-child {
  border-top: none;
  padding-top: 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--accent-cyan);
}

.card-title {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--accent-yellow);
  text-shadow: var(--glow-yellow);
  margin-bottom: 0.75rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1rem;
}

/* --------------------------------------------------------------------------
   Page hero (interior page header — not the index hero)
   -------------------------------------------------------------------------- */
.page-hero {
  position: relative;
  padding: calc(var(--nav-height) + 3rem) 1.25rem 3rem;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0,229,255,0.07) 0%, transparent 60%),
    var(--bg-primary);
  border-bottom: 1px solid var(--border-dim);
}

.page-hero .section-label {
  margin-bottom: 0.75rem;
}

.page-hero .section-title {
  margin-bottom: 1rem;
}

.page-hero .section-subtitle {
  font-size: 0.9rem;
  max-width: 65ch;
  margin: 0 auto;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Review page — context box
   -------------------------------------------------------------------------- */
.review-context-box {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-left: 3px solid var(--accent-cyan);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
}

.review-context-title {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
  margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   Review page — game cards
   -------------------------------------------------------------------------- */
.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  margin-bottom: 2rem;
  overflow: hidden;
  transition: border-color 0.2s;
}

.review-card:hover {
  border-color: var(--accent-cyan);
}

.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--bg-card-alt);
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-dim);
}

.review-title-group {
  flex: 1 1 auto;
}

.review-game-title {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  color: var(--accent-yellow);
  text-shadow: var(--glow-yellow);
  margin-bottom: 0.35rem;
}

.review-year {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.review-score-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.review-score {
  font-family: var(--font-pixel);
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
}

.review-score--gold {
  color: var(--accent-yellow);
  text-shadow: var(--glow-yellow);
  border-color: var(--accent-yellow);
  background: rgba(245,208,32,0.08);
}

.review-score--sizzler {
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
  border-color: var(--accent-cyan);
  background: rgba(0,229,255,0.06);
}

.review-score--standard {
  color: var(--text-primary);
  border-color: var(--border-dim);
  background: var(--bg-primary);
}

.review-badge {
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  text-transform: uppercase;
}

.review-badge--gold {
  color: var(--bg-primary);
  background: var(--accent-yellow);
}

.review-badge--sizzler {
  color: var(--bg-primary);
  background: var(--accent-cyan);
}

.review-badge--standard {
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
}

.review-badge--note {
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
}

.review-body {
  padding: 1.25rem 1.5rem;
}

.review-source {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-dim);
}

.review-quote {
  margin: 1rem 0;
  padding: 1rem 1.25rem;
  background: rgba(0,229,255,0.04);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.review-quote p {
  color: var(--text-primary);
  font-style: italic;
  margin-bottom: 0.4rem;
}

.review-quote footer {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Site footer
   -------------------------------------------------------------------------- */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border-dim);
  margin-top: 2rem;
}

.footer-copy {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0;
}

.page-hero .hero-content {
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   Developer Profile Sections
   -------------------------------------------------------------------------- */
.profile-section {
  border-bottom: 1px solid var(--border-dim);
}

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

.profile-body {
  max-width: 800px;
}

.profile-body p {
  color: var(--text-primary);
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.profile-quote {
  border-left: 3px solid var(--accent-cyan);
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.profile-quote p {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-primary);
  font-style: italic;
  margin-bottom: 0.75rem;
}

.profile-quote footer {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.profile-quote footer a {
  color: var(--accent-cyan);
}

.profile-quote footer a:hover {
  color: var(--accent-yellow);
}

.quote-note {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: normal;
}

.profile-sources {
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-dim);
  padding-top: 0.75rem;
  margin-top: 1.5rem;
}

.profile-sources a {
  color: var(--accent-cyan);
}

.profile-sources a:hover {
  color: var(--accent-yellow);
}

/* --------------------------------------------------------------------------
   Utility
   -------------------------------------------------------------------------- */
.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;
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.5rem 1rem;
  background: var(--accent-cyan);
  color: var(--bg-primary);
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  z-index: 200;
  border-radius: 0 0 var(--radius) 0;
}

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

/* --------------------------------------------------------------------------
   Page header (used by secondary pages: music, gallery, catalogue, etc.)
   -------------------------------------------------------------------------- */
.page-header {
  padding: calc(var(--nav-height) + 2.5rem) 0 2rem;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(0,229,255,0.08) 0%, transparent 60%),
              var(--bg-primary);
}

.page-title {
  font-family: var(--font-pixel);
  font-size: clamp(1rem, 3vw, 1.8rem);
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
  margin-bottom: 0.75rem;
}

.page-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  color: var(--text-secondary);
}

.section-heading {
  font-family: var(--font-pixel);
  font-size: clamp(0.7rem, 2vw, 1rem);
  color: var(--accent-yellow);
  text-shadow: var(--glow-yellow);
  margin-bottom: 1.25rem;
}

.section-intro {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 72ch;
}

/* --------------------------------------------------------------------------
   Music player — additional button styles
   -------------------------------------------------------------------------- */
.player-btn {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: transparent;
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.player-btn:hover,
.player-btn:focus {
  background: rgba(0,229,255,0.1);
  box-shadow: var(--glow-cyan);
  outline: none;
}

.player-btn--primary {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.player-btn--primary:hover,
.player-btn--primary:focus {
  background: rgba(57,255,20,0.08);
  box-shadow: var(--glow-green);
}

.player-note {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0.75rem 0 0;
}

.now-playing-label {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--accent-green);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.now-playing-info {
  min-height: 2.5rem;
}

/* --------------------------------------------------------------------------
   Music track-group blocks
   -------------------------------------------------------------------------- */
.game-tracks-block {
  margin-bottom: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  overflow: hidden;
}

.game-tracks-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card-alt);
  border-bottom: 1px solid var(--border-dim);
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--accent-cyan);
  flex-wrap: wrap;
}

.catalogue-link {
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  color: var(--text-dim);
  border: 1px solid var(--border-dim);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
  flex-shrink: 0;
  transition: all 0.2s;
}

.catalogue-link:hover,
.catalogue-link:focus {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  text-shadow: none;
}

.hvsc-link {
  font-size: 0.75rem;
  color: var(--text-dim);
  word-break: break-all;
}

.hvsc-link:hover,
.hvsc-link:focus {
  color: var(--accent-cyan);
  text-shadow: none;
}

.track-list .track-composer-name {
  flex: 2;
}

.note-text {
  background: var(--bg-card-alt);
  border-left: 3px solid var(--accent-yellow);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

/* --------------------------------------------------------------------------
   Inner-page hero title/subtitle helpers (trivia, catalogue, gallery, etc.)
   -------------------------------------------------------------------------- */
.page-hero-title {
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
  margin: 0.5rem 0 1rem;
}

.page-hero-subtitle {
  color: var(--text-secondary);
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  max-width: 60ch;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Trivia page
   -------------------------------------------------------------------------- */
.trivia-toc {
  margin: 2.5rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-left: 3px solid var(--accent-cyan);
  border-radius: var(--radius);
}

.toc-heading {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
}

.toc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list a {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--accent-cyan);
}

.trivia-section {
  margin-bottom: 1rem;
}

.trivia-body {
  max-width: 80ch;
}

.trivia-subhead {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--accent-yellow);
  text-shadow: var(--glow-yellow);
  margin: 2rem 0 0.75rem;
}

.trivia-infobox {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-left: 3px solid var(--accent-purple);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.infobox-title {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--accent-purple);
  margin-bottom: 1rem;
}

.fact-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1rem;
  font-size: 0.875rem;
}

.fact-list dt {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-top: 0.15rem;
  white-space: nowrap;
}

.fact-list dd {
  color: var(--text-primary);
  margin: 0;
}

.trivia-footnotes {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-dim);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.trivia-footnotes ol {
  list-style: decimal;
  padding-left: 1.25rem;
}

.trivia-footnotes li {
  margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   Publisher timeline (trivia page)
   -------------------------------------------------------------------------- */
.timeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}

.timeline-list::before {
  content: '';
  position: absolute;
  left: 3.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-dim);
}

.timeline-entry {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 0 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-dim);
  position: relative;
}

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

.timeline-year {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--accent-red);
  text-shadow: var(--glow-red);
  text-align: right;
  padding-top: 0.2rem;
  position: relative;
  z-index: 1;
}

.timeline-year::after {
  content: '';
  position: absolute;
  right: -1.75rem;
  top: 0.4rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px rgba(0,229,255,0.6);
}

.timeline-content {
  padding-top: 0;
}

.timeline-event {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--accent-yellow);
  margin-bottom: 0.6rem;
}

#img-modal:not([hidden]) { display: flex; }

@media (max-width: 560px) {
  .timeline-list::before { left: 2.5rem; }
  .timeline-entry {
    grid-template-columns: 3.5rem 1fr;
    gap: 0 1rem;
  }
  .timeline-year::after { right: -1.25rem; }
  .fact-list { grid-template-columns: 1fr; }
  .fact-list dt { margin-top: 0.5rem; }
  .toc-list { flex-direction: column; }
}
