/* ============================================
   PIXEL-95 — MAIN.CSS
   Core styles, variables, animations
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  /* Core Arcade Palette */
  --pixel-black: #0A0A0F;
  --pixel-dark: #12121A;
  --pixel-void: #1A1A2E;

  /* Neon Primaries */
  --neon-yellow: #FFE600;
  --neon-pink: #FF2D78;
  --neon-cyan: #00F5FF;
  --neon-purple: #B14FFF;
  --neon-green: #39FF14;

  /* Text */
  --text-primary: #FFFFFF;
  --text-secondary: #B0B0CC;
  --text-muted: #5A5A7A;

  /* Glow values */
  --glow-yellow: 0 0 10px #FFE600, 0 0 20px #FFE600, 0 0 40px #FFE60066;
  --glow-pink:   0 0 10px #FF2D78, 0 0 20px #FF2D78, 0 0 40px #FF2D7866;
  --glow-cyan:   0 0 10px #00F5FF, 0 0 20px #00F5FF, 0 0 40px #00F5FF66;

  /* Pixel border */
  --pixel-border: 2px solid var(--neon-yellow);

  /* Spacing */
  --section-pad: 120px 0;
  --container: min(1280px, 92vw);

  /* Typography */
  --font-pixel: 'Press Start 2P', monospace;
  --font-body: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  font-family: var(--font-body);
  background: var(--pixel-black);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; }

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

button, input, textarea, select {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

button { cursor: none !important; }

/* ---- SKIP LINK ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--neon-yellow);
  color: var(--pixel-black);
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 12px 24px;
  z-index: 100000;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 8px;
}

/* ---- CUSTOM CURSOR ---- */
@media (prefers-reduced-motion: no-preference) {
  * { cursor: none !important; }
}

.cursor-outer {
  position: fixed;
  width: 40px;
  height: 40px;
  border: 2px solid var(--neon-yellow);
  pointer-events: none;
  z-index: 99998;
  transition: width 0.2s, height 0.2s, background 0.2s, transform 0.2s;
  transform: translate(-50%, -50%);
}

.cursor-inner {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--neon-yellow);
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
}

.cursor-outer.hover-interactive {
  width: 60px;
  height: 60px;
  background: rgba(255, 230, 0, 0.15);
}

.cursor-outer.hover-interactive .cursor-inner,
.cursor-inner.hide {
  opacity: 0;
}

.cursor-outer.hover-btn {
  width: 60px;
  height: 60px;
  border-color: transparent;
  background: none;
}

.cursor-outer.hover-btn::before,
.cursor-outer.hover-btn::after {
  content: '';
  position: absolute;
  background: var(--neon-yellow);
}

.cursor-outer.hover-btn::before {
  width: 2px;
  height: 100%;
  left: 50%;
  transform: translateX(-50%);
}

.cursor-outer.hover-btn::after {
  width: 100%;
  height: 2px;
  top: 50%;
  transform: translateY(-50%);
}

.cursor-trail {
  position: fixed;
  width: 40px;
  height: 40px;
  border: 1px solid var(--neon-yellow);
  pointer-events: none;
  z-index: 99997;
  transform: translate(-50%, -50%);
  opacity: 0;
}

/* ---- CONTAINER ---- */
.container {
  width: var(--container);
  margin: 0 auto;
}

/* ---- NAVIGATION ---- */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10000;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 230, 0, 0.2);
  transition: background 0.3s, border-color 0.3s;
  padding: 0 4%;
}

.main-nav.scrolled {
  background: rgba(10, 10, 15, 0.98);
  border-bottom-color: rgba(255, 230, 0, 0.8);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: 1280px;
  margin: 0 auto;
}

.nav-logo {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--neon-yellow);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.nav-logo .blink-cursor {
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  position: relative;
  transition: color 0.2s;
  letter-spacing: 0.02em;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--neon-yellow);
  transition: width 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--neon-yellow);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-cta {
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--neon-pink);
  border: 2px solid var(--neon-pink);
  padding: 10px 20px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.nav-cta:hover {
  background: var(--neon-pink);
  color: var(--pixel-black);
}

/* Hamburger */
.nav-hamburger {
  display: none;
  font-family: var(--font-pixel);
  font-size: 20px;
  color: var(--neon-yellow);
  background: none;
  border: none;
  padding: 8px;
}

/* Mobile overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--pixel-black);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.mobile-nav-overlay.open {
  display: flex;
}

.mobile-nav-overlay a {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--text-primary);
  padding: 16px 32px;
  min-height: 48px;
  display: flex;
  align-items: center;
}

.mobile-nav-overlay a .prefix {
  color: var(--neon-yellow);
  margin-right: 12px;
}

.mobile-nav-close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--neon-yellow);
  background: none;
  border: none;
  padding: 8px;
}

/* ---- SECTION STYLES ---- */
section {
  padding: var(--section-pad);
  position: relative;
}

.section-label {
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--font-pixel);
  font-size: clamp(20px, 3.5vw, 36px);
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.4;
}

.section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-yellow), transparent);
  margin: 16px 0 48px;
  border: none;
}

.section-subtitle {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 600px;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 16px 32px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-primary {
  background: var(--neon-yellow);
  color: var(--pixel-black);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: var(--glow-yellow);
}

.btn-outline-cyan {
  background: transparent;
  border: 2px solid var(--neon-cyan);
  color: var(--neon-cyan);
}

.btn-outline-cyan:hover {
  background: rgba(0, 245, 255, 0.1);
  transform: translateY(-2px);
}

.btn-pink {
  background: var(--neon-pink);
  color: var(--pixel-black);
}

.btn-pink:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-pink);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--neon-yellow);
  color: var(--neon-yellow);
}

.btn-outline:hover {
  background: rgba(255, 230, 0, 0.1);
  transform: translateY(-2px);
}

/* ---- CARDS ---- */
.card {
  background: var(--pixel-dark);
  border: 2px solid var(--text-muted);
  clip-path: polygon(0 16px, 16px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px));
  padding: 32px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-8px);
}

.card.accent-yellow { border-color: var(--neon-yellow); }
.card.accent-pink   { border-color: var(--neon-pink);   }
.card.accent-cyan   { border-color: var(--neon-cyan);   }
.card.accent-purple { border-color: var(--neon-purple);  }
.card.accent-green  { border-color: var(--neon-green);  }

/* ---- DIFFICULTY BAR ---- */
.difficulty-bar {
  display: flex;
  gap: 3px;
  align-items: center;
  margin: 8px 0;
}

.difficulty-bar .block {
  width: 12px;
  height: 12px;
  background: currentColor;
}

.difficulty-bar .block.empty {
  opacity: 0.2;
}

/* ---- HIGGSFIELD PLACEHOLDERS ---- */
.higgsfield-placeholder {
  background: linear-gradient(135deg, var(--pixel-dark) 0%, var(--pixel-void) 100%);
  border: 1px dashed rgba(255, 230, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 300px;
}

.higgsfield-placeholder::after {
  content: attr(data-prompt);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem;
  max-width: 80%;
  line-height: 1.6;
}

/* ---- FOOTER ---- */
.site-footer {
  background: var(--pixel-black);
  border-top: 1px solid var(--neon-yellow);
  box-shadow: 0 -1px 20px rgba(255, 230, 0, 0.1);
  padding: 64px 0 32px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 4%;
  text-align: center;
}

.footer-logo {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--neon-yellow);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.footer-tagline {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.footer-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-yellow), transparent);
  margin: 24px 0;
  border: none;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.footer-nav a {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.footer-nav a:hover { color: var(--neon-yellow); }

.footer-social {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
}

.footer-social a {
  color: var(--text-secondary);
  transition: color 0.2s;
  font-size: 18px;
}

.footer-social a:hover { color: var(--neon-yellow); }

.footer-copy {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  line-height: 2;
}

.footer-production {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 24px;
}

.footer-konami-hint {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  animation: blink 2s step-end infinite;
}

/* ---- GLITCH ANIMATION ---- */
@keyframes glitch {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); filter: hue-rotate(90deg); }
  40% { transform: translate(2px, -2px); }
  60% { transform: translate(-2px, -2px); filter: hue-rotate(-90deg); }
  80% { transform: translate(2px, 2px); }
}

/* ---- SCROLL REVEAL ---- */
/* GSAP controls opacity/transform for .reveal elements */
/* Fallback for no-JS or reduced motion */
.reveal.revealed {
  opacity: 1 !important;
  transform: none !important;
}

/* ---- FOCUS STYLES ---- */
*:focus-visible {
  outline: 2px solid var(--neon-yellow);
  outline-offset: 4px;
}

/* ---- REDUCED MOTION ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    cursor: auto !important;
  }
  .cursor-outer, .cursor-inner, .cursor-trail { display: none !important; }
  .reveal { opacity: 1; transform: none; }
}
