/* =============================================
   IMAGINE SOFTWARE FAN SITE
   "Burning Newspaper" aesthetic
   Liverpool 1982-1984
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;600;700&family=Source+Sans+3:ital,wght@0,300;0,400;0,600;1,300;1,400&display=swap');

/* --- Custom Properties --- */
:root {
  --bg: #1a0500;
  --bg-mid: #230800;
  --bg-card: #1f0700;
  --accent: #ff4d00;
  --accent2: #ffd700;
  --accent-dim: rgba(255, 77, 0, 0.15);
  --text: #f0e8e0;
  --text-muted: #a09080;
  --text-dim: #7a6858;
  --border: rgba(255, 77, 0, 0.25);
  --border-gold: rgba(255, 215, 0, 0.3);
  --font-heading: 'Oswald', 'Impact', sans-serif;
  --font-body: 'Source Sans 3', 'Georgia', serif;
  --max-w: 1100px;
  --radius: 4px;
}

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

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 9999;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  min-height: 100vh;
}

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

h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); color: var(--accent2); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.7rem); color: var(--accent); }
h4 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent2); }

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

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

strong { color: var(--accent2); font-weight: 600; }
em { color: var(--text-muted); font-style: italic; }

cite { font-style: italic; color: var(--text-muted); font-size: 0.88em; }

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

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 52px;
}

.nav-brand {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent) !important;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.2rem;
  flex-wrap: wrap;
  overflow: hidden;
}

.nav-links a {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-dim);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
  padding-top: 52px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(255, 77, 0, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(255, 215, 0, 0.06) 0%, transparent 50%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 77, 0, 0.02) 2px,
      rgba(255, 77, 0, 0.02) 4px
    );
  pointer-events: none;
}

/* Animated burn vignette overlay */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(255, 60, 0, 0.4) 100%);
  mix-blend-mode: multiply;
  animation: burn-pulse 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes burn-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 3rem 1.5rem;
  max-width: 860px;
}

.hero-eyebrow {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  display: block;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow:
    0 0 40px rgba(255, 77, 0, 0.8),
    0 0 80px rgba(255, 77, 0, 0.4);
  margin-bottom: 1rem;
  line-height: 1;
}

.hero-tagline {
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  color: var(--text-muted);
  font-style: italic;
  max-width: 640px;
  margin: 0 auto 2.5rem;
  line-height: 1.5;
}

/* --- Stats Bar --- */
.stats-bar {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.stat {
  text-align: center;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  display: block;
}

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

/* --- Container / Layout --- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-body {
  padding-top: 52px;
}

/* --- Page Header --- */
.page-header {
  background: linear-gradient(180deg, #2a0800 0%, var(--bg) 100%);
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.page-header .eyebrow {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
  display: block;
}

.page-header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  text-transform: uppercase;
}

.page-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 1rem auto 0;
}

/* --- Sections --- */
section {
  padding: 4rem 0;
}

section + section {
  border-top: 1px solid var(--border);
}

.section-title {
  margin-bottom: 2rem;
}

.section-title h2 { margin-bottom: 0.4rem; }
.section-title p { color: var(--text-muted); margin: 0; }

/* --- Video Embeds --- */
.video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.video-intro {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  font-style: italic;
}

.video-feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
}

.video-feature h3 { margin-bottom: 0.5rem; }

/* --- Image Strip --- */
.image-strip {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-card);
}

.image-strip img {
  height: 180px;
  width: auto;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-shrink: 0;
}

/* --- Trivia Asides --- */
aside.trivia {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.06) 0%, rgba(255, 77, 0, 0.04) 100%);
  border-left: 3px solid var(--accent2);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem;
  color: var(--text);
}

aside.trivia p { margin: 0; }

/* --- Dev Quotes --- */
blockquote.dev-quote {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 1.5rem 1.5rem 1rem;
  margin: 2rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

blockquote.dev-quote::before {
  content: '"';
  font-family: var(--font-heading);
  font-size: 4rem;
  color: var(--accent);
  opacity: 0.3;
  position: absolute;
  top: -0.5rem;
  left: 0.8rem;
  line-height: 1;
}

blockquote.dev-quote p {
  font-size: 1.05rem;
  font-style: italic;
  margin-bottom: 0.8rem;
  padding-left: 0.5rem;
}

blockquote.dev-quote footer {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-left: 0.5rem;
}

blockquote.dev-quote footer cite {
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
}

/* --- Game Cards --- */
.games-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-btn {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

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

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

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* game-card hover removed — cards are not clickable */

.game-card-image {
  aspect-ratio: 1;
  overflow: hidden;
  background: #0d0200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.game-card-image .placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0d0200;
  color: var(--text-dim);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1rem;
  text-align: center;
  gap: 0.5rem;
}

.game-card-image .placeholder::before {
  content: 'IMAGE';
  font-size: 1.8rem;
  color: var(--border);
  display: block;
}

.game-card-body {
  padding: 1rem;
}

.game-card-meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.badge {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
}

.badge-year { background: rgba(255, 77, 0, 0.15); color: var(--accent); border: 1px solid rgba(255, 77, 0, 0.3); }
.badge-spectrum { background: rgba(0, 150, 255, 0.1); color: #5bc0ff; border: 1px solid rgba(0, 150, 255, 0.25); }
.badge-c64 { background: rgba(200, 100, 255, 0.1); color: #cc80ff; border: 1px solid rgba(200, 100, 255, 0.25); }
.badge-unreleased { background: rgba(255, 215, 0, 0.1); color: var(--accent2); border: 1px solid rgba(255, 215, 0, 0.3); }

.game-card h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.game-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* --- Newspaper Multi-Column --- */
.news-columns {
  column-count: 2;
  column-gap: 2.5rem;
  column-rule: 1px solid rgba(255, 77, 0, 0.3);
}

.news-columns p { break-inside: avoid-column; }
.news-columns h3 { break-after: avoid; column-span: none; }
.news-columns aside,
.news-columns blockquote { break-inside: avoid; }

@media (max-width: 680px) {
  .news-columns { column-count: 1; }
}

/* --- Inline section images --- */
.section-img {
  display: block;
  max-width: 360px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  margin: 1.5rem auto;
}
.section-img-wrap {
  margin: 2rem 0;
}
.section-img-wrap figcaption {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
  font-style: italic;
}

/* --- History Sections --- */
.history-section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

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

.history-section h2 {
  column-span: all;
  margin-bottom: 1.5rem;
}

/* --- People Cards --- */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.person-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.person-card h3 { color: var(--accent); margin-bottom: 0.3rem; }
.person-card .role { font-family: var(--font-heading); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent2); margin-bottom: 1rem; display: block; }
.person-card p { font-size: 0.92rem; color: var(--text-muted); line-height: 1.6; margin: 0; }

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

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

/* gallery-item hover removed — items are not clickable */

.gallery-item img {
  width: 100%;
  display: block;
  aspect-ratio: 1;
  object-fit: cover;
}

.gallery-caption {
  padding: 0.6rem 0.8rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* --- Resources --- */
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.resource-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.resource-card h4 { color: var(--accent); font-size: 0.9rem; margin: 0; }
.resource-card p { color: var(--text-muted); font-size: 0.88rem; margin: 0; }
.resource-card a { color: var(--text-muted); font-size: 0.82rem; word-break: break-all; transition: color 0.2s; }
.resource-card a:hover { color: var(--accent2); }

.resource-type {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* --- Videos Page --- */
.videos-category {
  margin-bottom: 3.5rem;
}

.videos-category h2 {
  margin-bottom: 0.5rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}

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

@media (max-width: 840px) {
  .videos-grid { grid-template-columns: 1fr; }
}

.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.video-card-body {
  padding: 1rem;
}

.video-card h3 { font-size: 0.95rem; color: var(--text); margin-bottom: 0.3rem; }
.video-card p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* --- Cross-links / Nav Links --- */
.page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.page-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.page-link:hover {
  background: rgba(255, 77, 0, 0.25);
  border-color: var(--accent);
  color: var(--accent2);
}

/* --- Editorial Prose --- */
.prose {
  max-width: 720px;
}

.prose p { line-height: 1.8; }

.lead {
  font-size: 1.15rem;
  font-weight: 300;
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

/* --- Two-column layout --- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

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

/* --- Flagship specific --- */
.flagship-section {
  padding: 3.5rem 0;
}

.flagship-section + .flagship-section {
  border-top: 1px solid var(--border);
}

/* --- Modal (Easter egg) --- */
.imagine-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.imagine-modal.open {
  display: flex;
}

.modal-inner {
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  max-width: 560px;
  width: 100%;
  padding: 2.5rem;
  position: relative;
  text-align: center;
  box-shadow: 0 0 60px rgba(255, 77, 0, 0.4);
}

.modal-inner h2 {
  font-size: 2.2rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.modal-inner p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.3rem;
  transition: color 0.2s;
}

.modal-close:hover { color: var(--accent); }

/* --- Lightbox --- */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox-overlay.open { display: flex; }

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
  cursor: default;
}

.lightbox-close {
  position: fixed;
  top: 1.2rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.3rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.lightbox-close:hover { opacity: 1; }

/* --- Footer --- */
footer {
  background: #0d0200;
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.8;
}

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

/* --- Utility --- */
.text-accent { color: var(--accent); }
.text-gold { color: var(--accent2); }
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* --- Hamburger Toggle --- */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-mid);
    border-top: 1px solid var(--border);
    padding: 0.5rem 0;
    z-index: 200;
  }
  .nav-links.nav-menu--open { display: flex; flex-direction: column; }
  .nav-links li { padding: 0; }
  .nav-links a { padding: 0.75rem 1.5rem; display: block; }
  .site-nav { position: relative; }
  .stats-bar { gap: 1.2rem; }
  .stat-number { font-size: 1.8rem; }
  section { padding: 2.5rem 0; }
  .page-header { padding: 3rem 1.5rem 2rem; }
}

@media (max-width: 480px) {
  .hero-content { padding: 2rem 1rem; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
