/* ==========================================================================
   Hirokazu Tanaka Fan Page — css/style.css
   Identity: "The sound of loneliness — music that inhabits empty worlds"
   Deep purple-void-black, acid lime, Syne 800 headings, Inter body
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@800&family=Inter:wght@400;600&display=swap');

[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   Custom Properties
   -------------------------------------------------------------------------- */
:root {
  --bg:            #1a0a2a;
  --bg-card:       #221235;
  --bg-alt:        #130820;
  --text:          #e8e0f0;
  --text-muted:    #7a6a9a;
  --accent:        #a0ff50;
  --accent-dim:    rgba(160, 255, 80, 0.12);
  --accent-glow:   rgba(160, 255, 80, 0.6);
  --border:        #2d1a44;
  --font-display:  'Syne', sans-serif;
  --font-body:     'Inter', sans-serif;

  /* Game Boy LCD palette for music section */
  --gb-bg:         #0f380f;
  --gb-dark:       #306230;
  --gb-mid:        #8bac0f;
  --gb-light:      #9bbc0f;
  --gb-screen:     rgba(15, 56, 15, 0.85);

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

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

@keyframes scanline-drift {
  from { background-position: 0 0; }
  to   { background-position: 0 100px; }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  92%       { opacity: 1; }
  93%       { opacity: 0.4; }
  94%       { opacity: 1; }
  96%       { opacity: 0.7; }
  97%       { opacity: 1; }
}

@keyframes zebesian-fade {
  0%   { opacity: 0; transform: scale(0.85); }
  15%  { opacity: 1; transform: scale(1.0); }
  80%  { opacity: 1; transform: scale(1.0); }
  100% { opacity: 0; transform: scale(1.05); }
}

/* --------------------------------------------------------------------------
   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-weight: 400;
  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, filter 0.2s;
}

a:hover,
a:focus {
  color: #c8ffaa;
  filter: drop-shadow(0 0 4px rgba(160, 255, 80, 0.5));
  outline: none;
}

ul, ol { list-style: none; }

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

/* --------------------------------------------------------------------------
   Accent glow utility
   -------------------------------------------------------------------------- */
.accent-glow {
  filter: drop-shadow(0 0 8px rgba(160, 255, 80, 0.6));
}

/* --------------------------------------------------------------------------
   Placeholder (for missing images)
   -------------------------------------------------------------------------- */
.placeholder {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-body);
  text-align: center;
  padding: 1rem;
  min-height: 120px;
}

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

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

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

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
#site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(26, 10, 42, 0.96);
  backdrop-filter: blur(8px);
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  visibility: hidden;
}

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

.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(160, 255, 80, 0.6));
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.4rem 0.7rem;
  border-radius: 3px;
  transition: color 0.2s, filter 0.2s;
}

.nav-links a:hover,
.nav-links a:focus,
.nav-links a.active {
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(160, 255, 80, 0.6));
}

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

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

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

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.35;
  filter: url(#alien-distortion);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(26, 10, 42, 0.3) 0%,
    rgba(26, 10, 42, 0.6) 60%,
    rgba(26, 10, 42, 0.95) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 4rem 0;
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(160, 255, 80, 0.6));
  margin-bottom: 0.75rem;
}

.hero-title {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.0;
}

.hero-subtitle {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--accent);
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 8px rgba(160, 255, 80, 0.6));
}

.hero-rule {
  width: 60px;
  height: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(160, 255, 80, 0.7);
  margin-bottom: 1.5rem;
}

.hero-tagline {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 2rem;
  line-height: 1.7;
}

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

.stat-block .num {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(160, 255, 80, 0.6));
  line-height: 1;
}

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

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

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: filter 0.2s, transform 0.15s;
  border: none;
  text-decoration: none;
}

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

.btn-primary {
  background: var(--accent);
  color: #0a0510;
  filter: drop-shadow(0 0 8px rgba(160, 255, 80, 0.5));
}

.btn-primary:hover {
  filter: drop-shadow(0 0 14px rgba(160, 255, 80, 0.85));
  color: #0a0510;
}

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

.btn-secondary:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

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

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

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

/* --------------------------------------------------------------------------
   Skip link
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -40px;
  left: 1rem;
  background: var(--accent);
  color: #0a0510;
  padding: 0.4rem 0.8rem;
  z-index: 9999;
  border-radius: 0 0 3px 3px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* --------------------------------------------------------------------------
   Trivia asides
   -------------------------------------------------------------------------- */
aside.trivia {
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 2rem 0;
  border-radius: 0 4px 4px 0;
  font-size: 0.95rem;
}

aside.trivia::before {
  content: 'DID YOU KNOW';
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

/* --------------------------------------------------------------------------
   Blockquotes
   -------------------------------------------------------------------------- */
blockquote.dev-quote {
  border-left: 3px solid var(--text-muted);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  color: var(--text-muted);
  font-style: italic;
  font-size: 1.05rem;
}

blockquote.dev-quote cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-style: normal;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   History / body text
   -------------------------------------------------------------------------- */
.history-body p {
  margin-bottom: 1.2rem;
  color: var(--text);
}

.history-body p:last-child { margin-bottom: 0; }

.history-chapter {
  max-width: 72ch;
}

/* --------------------------------------------------------------------------
   Era sections (history.html)
   -------------------------------------------------------------------------- */
.era-section {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

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

.era-year {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 8px rgba(160, 255, 80, 0.6));
}

.era-title {
  font-size: clamp(1.3rem, 2.5vw, 1.9rem);
  margin-bottom: 1rem;
}

.era-images {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0;
}

.era-images img {
  border-radius: 4px;
  max-height: 200px;
  width: auto;
  border: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   Screenshot strip
   -------------------------------------------------------------------------- */
.screenshot-strip {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  margin: 2rem 0;
  padding-bottom: 0.5rem;
}

.screenshot-strip img {
  border-radius: 4px;
  height: 160px;
  width: auto;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   Video embed
   -------------------------------------------------------------------------- */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}

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

/* --------------------------------------------------------------------------
   Catalogue / games grid
   -------------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.9rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s;
}

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

.catalogue-table-wrap {
  overflow-x: auto;
}

.catalogue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.catalogue-table th {
  background: var(--bg-alt);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
}

.catalogue-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.catalogue-table tr:hover td {
  background: var(--bg-card);
}

.catalogue-table .thumb img {
  width: 56px;
  height: auto;
  border-radius: 2px;
  border: 1px solid var(--border);
}

.catalogue-table .thumb .placeholder {
  width: 56px;
  height: 56px;
  min-height: unset;
  font-size: 0.6rem;
}

.platform-tag {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(160,255,80,0.3);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   Music section — Game Boy scanline aesthetic
   -------------------------------------------------------------------------- */
.music-section {
  position: relative;
  background: var(--gb-screen);
  border: 2px solid var(--gb-dark);
  border-radius: 4px;
  padding: 1.5rem;
  margin: 2rem 0;
  overflow: hidden;
}

.music-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  pointer-events: none;
  animation: scanline-drift 8s linear infinite;
}

.music-section .track-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gb-light);
  margin-bottom: 0.5rem;
}

.music-section .track-desc {
  font-size: 0.85rem;
  color: var(--gb-mid);
  margin-bottom: 1rem;
}

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

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.game-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.game-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

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

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

.game-card__year {
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.6rem;
  letter-spacing: 0.05em;
}

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

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

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

.person-card__role {
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.person-card img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

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

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

.video-card .video-embed {
  border: none;
  border-radius: 0;
}

.video-card__body {
  padding: 0.9rem 1rem;
}

.video-card__title {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.video-card__desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

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

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

.resource-card__name {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.resource-card__desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.resource-card a {
  font-size: 0.8rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Inline image in content
   -------------------------------------------------------------------------- */
.content-image {
  margin: 1.5rem 0;
  border-radius: 4px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.content-image img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
}

.content-image figcaption {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

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

.sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  font-size: 0.9rem;
}

.sidebar h3 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

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

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

/* --------------------------------------------------------------------------
   Easter egg overlay
   -------------------------------------------------------------------------- */
#zebesian-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  align-items: center;
  justify-content: center;
  background: rgba(26, 10, 42, 0.85);
}

#zebesian-overlay.active {
  display: flex;
  animation: zebesian-fade 3s ease forwards;
}

.zebesian-inner {
  text-align: center;
  color: var(--accent);
  filter: drop-shadow(0 0 24px rgba(160, 255, 80, 0.8));
}

.zebesian-inner svg {
  width: 120px;
  height: 120px;
  margin-bottom: 1rem;
}

.zebesian-inner p {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  animation: flicker 0.5s linear 3;
}

/* --------------------------------------------------------------------------
   Utility
   -------------------------------------------------------------------------- */
.mt-sm { margin-top: 1rem; }
.mt-md { margin-top: 2rem; }
.mt-lg { margin-top: 3rem; }
.mb-sm { margin-bottom: 1rem; }
.mb-md { margin-bottom: 2rem; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }

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

.site-footer__inner {
  text-align: center;
}

.site-footer__brand {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 8px rgba(160, 255, 80, 0.6));
}

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

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

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(26, 10, 42, 0.98);
    flex-direction: column;
    padding: 1rem 1.5rem 1.5rem;
    gap: 0.1rem;
    border-bottom: 1px solid var(--border);
  }

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

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

  .nav-links li:last-child a {
    border-bottom: none;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .screenshot-strip {
    scroll-snap-type: x mandatory;
  }

  .screenshot-strip img {
    scroll-snap-align: start;
  }
}
