/**
 * PixelBoop Landing Page Styles
 * Dark theme, CSS Grid pixel rendering, responsive design
 */

/* =============================================================================
   CSS CUSTOM PROPERTIES
   ============================================================================= */

:root {
  /* Colors */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111;
  --bg-tertiary: #1a1a1a;
  --text-primary: #e0e0e0;
  --text-secondary: #888;
  --text-muted: #666;
  --accent-green: #9acd32;
  --accent-teal: #4ecdc4;
  --accent-red: #ff6b6b;

  /* Grid */
  --pixel-size: 12px;
  --grid-gap: 1px;
  --grid-cols: 44;
  --grid-rows: 24;

  /* Spacing */
  --section-padding: 4rem 1.5rem;
  --content-max-width: 1200px;

  /* Typography */
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Monaco, "Andale Mono", monospace;
}

/* =============================================================================
   RESET & BASE
   ============================================================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font-system);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =============================================================================
   ACCESSIBILITY
   ============================================================================= */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus indicators */
:focus {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
}

/* =============================================================================
   HEADER
   ============================================================================= */

#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bg-tertiary);
}

.nav-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-cta {
  background: linear-gradient(90deg, #ff6b6b, #ffc800, #9acd32, #4ecdc4, #ff6b6b);
  background-size: 200% auto;
  color: var(--bg-primary) !important;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  transition: transform 0.1s !important;
  animation: gradient-shift 4s ease infinite;
}

.nav-cta:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

@media (max-width: 600px) {
  .nav-links a:not(.nav-cta) {
    display: none;
  }

  .nav-container {
    padding: 0.5rem 1rem;
  }
}

/* =============================================================================
   HERO SECTION
   ============================================================================= */

#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem 2rem;
  text-align: center;
}

.hero-content {
  max-width: 100%;
  width: 100%;
}

.hero-app-store {
  display: inline-block;
  margin: 1.5rem 0;
  transition: transform 0.15s;
}

.hero-app-store:hover {
  transform: scale(1.05);
}

.hero-app-store img {
  height: 44px;
  width: auto;
}

.ascii-logo {
  font-family: var(--font-mono);
  font-size: clamp(4px, 1.2vw, 10px);
  line-height: 1.1;
  color: var(--text-primary);
  white-space: pre;
  overflow-x: auto;
  margin: 0 auto 2rem;
  display: block;
  text-align: center;
}

@media (max-width: 600px) {
  .ascii-logo {
    font-size: 3px;
    letter-spacing: -0.5px;
  }
}

.tagline {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.tagline em {
  font-style: normal;
  font-weight: 600;
  background: linear-gradient(90deg, #ff6b6b, #ffc800, #9acd32, #4ecdc4);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

.hero-grid {
  max-width: calc(var(--pixel-size) * 44 + var(--grid-gap) * 43 + 4px);
  margin: 0 auto 2rem;
  background-color: var(--bg-primary);
  gap: 0;
}

.hero-grid .pixel {
  background-color: var(--bg-primary);
}

.scroll-hint {
  color: var(--text-muted);
  font-size: 0.875rem;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint,
  .tagline em,
  .nav-cta,
  .play-btn {
    animation: none;
  }
}

/* =============================================================================
   PIXEL GRID
   ============================================================================= */

.pixel-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), var(--pixel-size));
  gap: var(--grid-gap);
  background-color: var(--bg-secondary);
  padding: 2px;
  border-radius: 4px;
  margin: 0 auto;
  width: fit-content;
}

.pixel {
  width: var(--pixel-size);
  height: var(--pixel-size);
  background-color: var(--bg-tertiary);
  border-radius: 1px;
  transition: background-color 0.05s ease;
}

.pixel.playing {
  animation: pulse 0.15s ease-out;
  filter: brightness(1.3);
}

@keyframes pulse {
  0% { transform: scale(1); filter: brightness(1.3); }
  50% { transform: scale(1.1); filter: brightness(1.5); }
  100% { transform: scale(1); filter: brightness(1.3); }
}

@media (prefers-reduced-motion: reduce) {
  .pixel {
    transition: none;
  }
  .pixel.playing {
    animation: none;
    filter: brightness(1.5);
  }
}

/* =============================================================================
   WHAT IT IS SECTION
   ============================================================================= */

#what-it-is {
  padding: var(--section-padding);
  text-align: center;
}

.section-tagline {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 600;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.feature-bullets {
  list-style: none;
  max-width: 400px;
  margin: 0 auto;
}

.feature-bullets li {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  color: var(--text-secondary);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--bg-tertiary);
}

.feature-bullets li:last-child {
  border-bottom: none;
}

/* =============================================================================
   DEMO SECTION
   ============================================================================= */

#demo {
  padding: var(--section-padding);
  background-color: var(--bg-secondary);
}

.demo-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.demo-info {
  margin: 1.5rem 0;
}

.demo-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.demo-description {
  font-size: 1rem;
  color: var(--text-secondary);
}

.demo-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.demo-btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--text-muted);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.demo-btn:hover {
  background: var(--bg-primary);
  border-color: var(--text-secondary);
}

.slide-indicators {
  display: flex;
  gap: 0.5rem;
}

.slide-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
  transition: background-color 0.2s;
}

.slide-indicator.active {
  background-color: var(--accent-green);
}

.play-btn {
  background: linear-gradient(90deg, #ff6b6b, #ffc800, #9acd32, #4ecdc4, #ff6b6b);
  background-size: 200% auto;
  color: var(--bg-primary);
  border: none;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.1s;
  animation: gradient-shift 4s ease infinite;
}

.play-btn:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.play-btn:active {
  transform: scale(0.98);
}

.keyboard-hint {
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.keyboard-hint kbd {
  background: var(--bg-tertiary);
  border: 1px solid var(--text-muted);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

/* =============================================================================
   WHAT YOU GET SECTION
   ============================================================================= */

#what-you-get {
  padding: var(--section-padding);
  text-align: center;
}

.features-content {
  max-width: 500px;
  margin: 0 auto;
}

.feature-statement {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2rem;
  line-height: 1.4;
}

.feature-detail {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.feature-counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--bg-tertiary);
}

.count-item {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* =============================================================================
   CTA SECTION
   ============================================================================= */

#cta {
  padding: var(--section-padding);
  background-color: var(--bg-secondary);
  text-align: center;
}

.cta-content {
  max-width: 400px;
  margin: 0 auto;
}

.app-store-link {
  display: inline-block;
  transition: transform 0.15s;
}

.app-store-link:hover {
  transform: scale(1.02);
}

.app-store-badge {
  height: 50px;
  width: auto;
}

.platform-note {
  margin-top: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--bg-tertiary);
  margin: 2rem 0;
}

.android-note {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.email-form {
  display: flex;
  gap: 0.5rem;
  max-width: 320px;
  margin: 0 auto;
}

.email-input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--text-muted);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border-radius: 4px;
}

.email-input::placeholder {
  color: var(--text-muted);
}

.email-input:focus {
  border-color: var(--accent-teal);
}

.email-btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--text-muted);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s;
}

.email-btn:hover {
  background: var(--bg-primary);
  border-color: var(--text-secondary);
}

.email-message {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  min-height: 1.25rem;
}

.email-message.success {
  color: var(--accent-green);
}

.email-message.error {
  color: var(--accent-red);
}

/* =============================================================================
   FOOTER
   ============================================================================= */

#footer {
  padding: 3rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--bg-tertiary);
}

.footer-content {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.footer-logo {
  margin-bottom: 0.5rem;
  opacity: 0.6;
}

.footer-byline {
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.footer-copyright {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* =============================================================================
   RESPONSIVE BREAKPOINTS
   ============================================================================= */

/* Mobile (default) */
@media (max-width: 767px) {
  :root {
    --pixel-size: 8px;
    --section-padding: 3rem 1rem;
  }

  .demo-controls {
    flex-wrap: wrap;
  }

  .email-form {
    flex-direction: column;
  }

  .footer-links {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --pixel-size: 12px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  :root {
    --pixel-size: 16px;
  }

  body {
    font-size: 18px;
  }
}

/* Large Desktop */
@media (min-width: 1440px) {
  :root {
    --pixel-size: 18px;
  }
}

/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */

.error-message {
  color: var(--accent-red);
  padding: 2rem;
  text-align: center;
  background: var(--bg-tertiary);
  border-radius: 4px;
  margin: 1rem;
}
