/* ==========================================================================
   Kaiko Fan Page — css/style.css
   Manga ink panel identity: deep navy, Zen Old Mincho headings, sakura pink accent
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Zen+Old+Mincho:wght@700&family=Inter:wght@400;600&display=swap');

[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   Custom Properties
   -------------------------------------------------------------------------- */
:root {
  --bg:            #0f0f2e;
  --bg-card:       #141435;
  --bg-alt:        #12122e;
  --text:          #e0dff5;
  --text-muted:    #8888aa;
  --accent:        #e8608a;
  --accent-dim:    rgba(232, 96, 138, 0.15);
  --border:        #252545;
  --border-accent: rgba(232, 96, 138, 0.4);

  --font-display: 'Zen Old Mincho', 'Times New Roman', serif;
  --font-body:    'Inter', system-ui, sans-serif;

  --nav-height:    60px;
  --container-max: 1200px;

  --card-radius:   4px;
  --card-shadow:   0 2px 12px rgba(232, 96, 138, 0.12);
}

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */
@keyframes reveal-fade {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes hero-pulse {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

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

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  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, opacity 0.2s;
}

a:hover,
a:focus {
  opacity: 0.8;
  outline: none;
}

ul, ol { list-style: none; }

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 6vw, 4rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.8rem); }
h4 { font-size: clamp(1rem, 2vw, 1.4rem); }

p { margin-bottom: 1rem; }

strong { color: var(--accent); }

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

.site-section {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}

.site-section:nth-of-type(odd)  { background: var(--bg); }
.site-section:nth-of-type(even) { background: var(--bg-alt); }

/* --------------------------------------------------------------------------
   Skip Link
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 0.5rem 1rem;
  font-family: var(--font-display);
  font-size: 1rem;
  z-index: 9999;
  transition: top 0.2s;
}

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

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
#site-nav {
  visibility: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(15, 15, 46, 0.97);
  border-bottom: 1px solid var(--border-accent);
  z-index: 1000;
  display: flex;
  align-items: center;
  backdrop-filter: blur(8px);
}

#site-nav .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 0.5rem;
  margin-left: auto;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.2rem 0.4rem;
  transition: color 0.2s;
  letter-spacing: 0.03em;
}

.nav-links a:hover,
.nav-links a:focus,
.nav-links a.active {
  color: var(--accent);
  opacity: 1;
}

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

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--accent);
  transition: transform 0.2s;
}

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

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
    flex-direction: column;
    gap: 0;
    margin-left: 0;
  }

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

  .nav-links a { padding: 0.4rem 0; font-size: 0.9rem; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
#hero {
  position: relative;
  min-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
}

#starfield-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  opacity: 0.25;
  filter: sepia(0.4) brightness(0.7);
}

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

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

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 12vw, 8rem);
  color: var(--text);
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 40px rgba(232, 96, 138, 0.3);
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 2.5vw, 1.2rem);
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}

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

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

.hero-stat .num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--accent);
  line-height: 1;
}

.hero-stat .label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
}

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

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--card-radius);
  transition: opacity 0.2s, transform 0.15s;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
}

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

/* --------------------------------------------------------------------------
   Section Headers
   -------------------------------------------------------------------------- */
.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 0.5rem;
}

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

.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

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

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  display: block;
  color: var(--text);
  text-decoration: none;
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(232, 96, 138, 0.2);
}

.game-card__body {
  padding: 1.25rem;
}

.game-card__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.game-card__year {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   Tags / Badges
   -------------------------------------------------------------------------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  border-radius: 2px;
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tag--amiga   { background: rgba(232, 96, 138, 0.18); color: var(--accent); border: 1px solid rgba(232, 96, 138, 0.3); }
.tag--c64     { background: rgba(100, 120, 220, 0.18); color: #7890ee; border: 1px solid rgba(100, 120, 220, 0.3); }
.tag--atari   { background: rgba(80, 180, 140, 0.18); color: #60c898; border: 1px solid rgba(80, 180, 140, 0.3); }
.tag--pc      { background: rgba(200, 160, 60, 0.18); color: #d4aa44; border: 1px solid rgba(200, 160, 60, 0.3); }
.tag--genre   { background: rgba(160, 100, 220, 0.15); color: #b87ee8; border: 1px solid rgba(160, 100, 220, 0.25); }
.tag--unreleased { background: rgba(180, 80, 80, 0.18); color: #e08080; border: 1px solid rgba(180, 80, 80, 0.3); }
.tag--budget  { background: rgba(140, 140, 60, 0.18); color: #c0c050; border: 1px solid rgba(140, 140, 60, 0.3); }

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

.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  border-radius: var(--card-radius);
  font-family: var(--font-body);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

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

.platform-hidden { display: none; }

/* --------------------------------------------------------------------------
   History / Long-form Text
   -------------------------------------------------------------------------- */
.history-body {
  max-width: 780px;
  margin: 0 auto;
}

.history-chapter {
  margin-bottom: 2.5rem;
}

.history-chapter h3 {
  color: var(--accent);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

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

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

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

.person-card__name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.person-card__role {
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

/* --------------------------------------------------------------------------
   Music / Resources
   -------------------------------------------------------------------------- */
.resource-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 780px;
  margin: 0 auto;
}

.resource-item {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--card-radius);
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
}

.resource-item h3 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.resource-item p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.resource-item a {
  font-size: 0.85rem;
  word-break: break-all;
}

/* --------------------------------------------------------------------------
   Flagship / Deep Dive
   -------------------------------------------------------------------------- */
.flagship-section {
  max-width: 780px;
  margin: 0 auto 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

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

.flagship-section h2 {
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.flagship-section h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

/* --------------------------------------------------------------------------
   Catalogue Table
   -------------------------------------------------------------------------- */
.catalogue-grid {
  display: grid;
  gap: 1rem;
}

.catalogue-entry {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--card-radius);
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  align-items: start;
}

.catalogue-entry__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  grid-column: 1;
}

.catalogue-entry__meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  grid-column: 1;
}

.catalogue-entry__tags {
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: flex-end;
}

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

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

/* --------------------------------------------------------------------------
   Easter Egg Modal
   -------------------------------------------------------------------------- */
.easter-egg-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 46, 0.9);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.easter-egg-modal {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--card-radius);
  padding: 2.5rem;
  max-width: 480px;
  text-align: center;
  box-shadow: 0 0 40px rgba(232, 96, 138, 0.3);
}

.easter-egg-modal h2 {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 2rem;
  margin-bottom: 1rem;
}

.easter-egg-close {
  margin-top: 1.5rem;
  background: transparent;
  border: 1px solid var(--border-accent);
  color: var(--text-muted);
  padding: 0.4rem 1rem;
  border-radius: var(--card-radius);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  transition: border-color 0.2s, color 0.2s;
}

.easter-egg-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.site-footer__brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.site-footer__text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.25rem;
}

/* --------------------------------------------------------------------------
   Utility
   -------------------------------------------------------------------------- */
.mt-sm  { margin-top: 0.5rem; }
.mt-md  { margin-top: 1rem; }
.mt-lg  { margin-top: 2rem; }
.mb-sm  { margin-bottom: 0.5rem; }

.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Gallery / Game Card Images
   -------------------------------------------------------------------------- */
.game-card__img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border);
}

.game-card__img--contain {
  object-fit: contain;
  background: var(--bg-alt);
  padding: 0.5rem;
}

/* --------------------------------------------------------------------------
   Video Embeds
   -------------------------------------------------------------------------- */
.videos-section {
  margin-bottom: 3rem;
}

.videos-section-heading {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

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

.video-card h3 {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.video-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--card-radius);
  background: #000;
}

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

.video-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .hero-stats { gap: 1.5rem; }
  .catalogue-entry { grid-template-columns: 1fr; }
  .catalogue-entry__tags { grid-column: 1; grid-row: auto; align-items: flex-start; }
}

/* --------------------------------------------------------------------------
   Game cover images & lightbox
   -------------------------------------------------------------------------- */
.game-cover { margin: 0 0 0.75rem; max-width: 180px; }
.game-screenshot {
  width: 100%; display: block; object-fit: contain;
  border: 1px solid var(--border-dim, #333);
  border-radius: var(--radius, 4px);
  background: var(--bg-secondary, #111);
  cursor: zoom-in; transition: border-color 0.2s;
}
.game-screenshot:hover { border-color: var(--accent-cyan, #00e5ff); }
.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.93);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; cursor: zoom-out; padding: 1rem;
}
.lightbox-overlay[hidden] { display: none; }
.lightbox-overlay img {
  max-width: 95vw; max-height: 90vh; object-fit: contain;
  border: 1px solid var(--border-dim, #333); border-radius: var(--radius, 4px); cursor: zoom-out;
}
.lightbox-close {
  position: fixed; top: 1rem; right: 1.5rem; background: none; border: none;
  color: var(--accent-cyan, #00e5ff); font-size: 2.5rem; line-height: 1;
  cursor: pointer; z-index: 10000; padding: 0.25rem 0.5rem;
}
.lightbox-close:hover { color: var(--accent-yellow, #ffd700); }
