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

    :root {
      --cyan: #00E5CC;
      --cyan-dim: #00b8a3;
      --cyan-glow: rgba(0, 229, 204, 0.35);
      --cyan-subtle: rgba(0, 229, 204, 0.08);
      --green-lush: #34D399;
      --green-deep: #10B981;
      --space-dark: #070B14;
      --space-mid: #0C1322;
      --space-light: #131B2E;
      --text-primary: #F0F4F8;
      --text-secondary: #94A3B8;
      --text-muted: #64748B;
      --surface: rgba(255, 255, 255, 0.04);
      --surface-hover: rgba(255, 255, 255, 0.08);
      --border: rgba(255, 255, 255, 0.06);
      --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
      --font-heading: 'Space Grotesk', 'Inter', sans-serif;
    }

    html {
      scroll-behavior: smooth;
      -webkit-text-size-adjust: 100%;
    }

    body {
      font-family: var(--font-body);
      background: var(--space-dark);
      color: var(--text-primary);
      line-height: 1.6;
      overflow-x: hidden;
      -webkit-font-smoothing: antialiased;
    }

    /* ============================================
       NAVIGATION
       ============================================ */
    .nav {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 100;
      padding: 1rem 1.5rem;
      transition: background 0.3s, backdrop-filter 0.3s;
    }

    .nav.scrolled {
      background: rgba(7, 11, 20, 0.85);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border-bottom: 1px solid var(--border);
    }

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

    .nav-logo {
      font-family: var(--font-heading);
      font-size: 1.25rem;
      font-weight: 700;
      color: var(--cyan);
      text-decoration: none;
      letter-spacing: -0.02em;
    }

    .nav-links {
      display: flex;
      gap: 2rem;
      list-style: none;
    }

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

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

    @media (max-width: 640px) {
      .nav-links { display: none; }
    }

    /* ============================================
       STAR CANVAS (background)
       ============================================ */
    #stars-canvas {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 0;
      pointer-events: none;
    }

    /* ============================================
       HERO SECTION
       ============================================ */
    .hero {
      position: relative;
      z-index: 1;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 6rem 1.5rem 4rem;
      text-align: center;
    }

    .hero-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.4rem 1rem;
      border-radius: 100px;
      background: var(--cyan-subtle);
      border: 1px solid rgba(0, 229, 204, 0.15);
      font-size: 0.8rem;
      font-weight: 500;
      color: var(--cyan);
      margin-bottom: 2rem;
      animation: fadeInDown 0.8s ease-out;
    }

    .hero-badge .dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--cyan);
      animation: pulse-dot 2s infinite;
    }

    .hero-title {
      font-family: var(--font-heading);
      font-size: clamp(3rem, 10vw, 6rem);
      font-weight: 700;
      letter-spacing: -0.03em;
      line-height: 1.05;
      margin-bottom: 0.25rem;
      animation: fadeInUp 0.8s ease-out;
      background: linear-gradient(135deg, #fff 40%, var(--cyan));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .hero-subtitle {
      font-family: var(--font-heading);
      font-size: clamp(1rem, 3vw, 1.5rem);
      font-weight: 500;
      color: var(--cyan);
      letter-spacing: 0.15em;
      text-transform: uppercase;
      margin-bottom: 1.25rem;
      animation: fadeInUp 0.8s ease-out 0.1s both;
    }

    .hero-tagline {
      font-size: clamp(1rem, 2.5vw, 1.25rem);
      color: var(--text-secondary);
      max-width: 500px;
      margin-bottom: 2.5rem;
      animation: fadeInUp 0.8s ease-out 0.2s both;
    }

    /* ============================================
       BEFORE / AFTER SLIDER
       ============================================ */
    .ba-container {
      position: relative;
      width: min(500px, 90vw);
      aspect-ratio: 1 / 1;
      margin: 0 auto 3rem;
      border-radius: 20px;
      overflow: hidden;
      border: 1px solid var(--border);
      box-shadow: 0 0 80px rgba(0, 229, 204, 0.1), 0 20px 60px rgba(0, 0, 0, 0.4);
      animation: fadeInUp 1s ease-out 0.3s both;
      cursor: ew-resize;
      touch-action: none;
    }

    .ba-layer {
      position: absolute;
      inset: 0;
      display: grid;
      grid-template-columns: repeat(8, 1fr);
      grid-template-rows: repeat(8, 1fr);
      gap: 3px;
      padding: 3px;
    }

    .ba-layer.ba-before { z-index: 1; }
    .ba-layer.ba-after  { z-index: 2; clip-path: inset(0 0 0 50%); }

    .ba-tile {
      border-radius: 4px;
      transition: none;
      position: relative;
    }

    .ba-before .ba-tile {
      background: linear-gradient(135deg, #3a3f4a, #4a4f5a);
      box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
    }

    .ba-before .ba-tile.toxin {
      background: linear-gradient(135deg, #5a3040, #6a3848);
      box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
    }

    .ba-before .ba-tile.toxin::after {
      content: '☠';
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.7rem;
      opacity: 0.4;
    }

    .ba-after .ba-tile {
      background: linear-gradient(135deg, #22c980, #34d399);
      box-shadow: inset 0 1px 2px rgba(0,0,0,0.15), 0 0 8px rgba(52, 211, 153, 0.2);
    }

    .ba-after .ba-tile.tree {
      background: linear-gradient(135deg, #15a366, #22c980);
    }

    .ba-after .ba-tile.tree::after {
      content: '🌿';
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.7rem;
    }

    .ba-after .ba-tile.flower::after {
      content: '🌸';
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.65rem;
    }

    .ba-after .ba-tile.water {
      background: linear-gradient(135deg, #22b8cf, #38d9f0);
    }

    .ba-after .ba-tile.water::after {
      content: '💧';
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.6rem;
    }

    .ba-divider {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 50%;
      width: 3px;
      background: var(--cyan);
      z-index: 10;
      transform: translateX(-50%);
      box-shadow: 0 0 15px var(--cyan-glow);
    }

    .ba-handle {
      position: absolute;
      top: 50%;
      left: 50%;
      width: 44px;
      height: 44px;
      border-radius: 50%;
      background: var(--space-dark);
      border: 2px solid var(--cyan);
      z-index: 11;
      transform: translate(-50%, -50%);
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 0 20px var(--cyan-glow);
    }

    .ba-handle svg {
      width: 20px;
      height: 20px;
      fill: var(--cyan);
    }

    .ba-label {
      position: absolute;
      bottom: 12px;
      z-index: 12;
      font-size: 0.7rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      padding: 4px 10px;
      border-radius: 100px;
      pointer-events: none;
    }

    .ba-label.left {
      left: 12px;
      background: rgba(90, 95, 105, 0.8);
      color: #ccc;
    }

    .ba-label.right {
      right: 12px;
      background: rgba(16, 185, 129, 0.8);
      color: #fff;
    }

    /* CTA Button */
    .cta-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.9rem 2rem;
      font-family: var(--font-heading);
      font-size: 1rem;
      font-weight: 600;
      color: var(--space-dark);
      background: var(--cyan);
      border: none;
      border-radius: 100px;
      cursor: pointer;
      text-decoration: none;
      transition: transform 0.2s, box-shadow 0.2s;
      box-shadow: 0 0 30px var(--cyan-glow);
      animation: fadeInUp 0.8s ease-out 0.4s both;
    }

    .cta-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 0 50px var(--cyan-glow), 0 8px 30px rgba(0, 229, 204, 0.2);
    }

    .cta-btn:active { transform: translateY(0); }

    .hero-platforms {
      margin-top: 1rem;
      font-size: 0.8rem;
      color: var(--text-muted);
      animation: fadeInUp 0.8s ease-out 0.5s both;
    }

    /* ============================================
       SECTION SHARED STYLES
       ============================================ */
    section {
      position: relative;
      z-index: 1;
      padding: 6rem 1.5rem;
    }

    .section-inner {
      max-width: 1100px;
      margin: 0 auto;
    }

    .section-label {
      font-family: var(--font-heading);
      font-size: 0.75rem;
      font-weight: 600;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: var(--cyan);
      margin-bottom: 0.75rem;
    }

    .section-title {
      font-family: var(--font-heading);
      font-size: clamp(1.75rem, 5vw, 2.75rem);
      font-weight: 700;
      letter-spacing: -0.02em;
      line-height: 1.15;
      margin-bottom: 1rem;
    }

    .section-desc {
      font-size: 1.05rem;
      color: var(--text-secondary);
      max-width: 560px;
      margin-bottom: 3rem;
    }

    /* ============================================
       HOW IT WORKS
       ============================================ */
    .steps-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 2rem;
    }

    .step-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 2rem;
      text-align: center;
      transition: transform 0.3s, border-color 0.3s;
    }

    .step-card:hover {
      transform: translateY(-4px);
      border-color: rgba(0, 229, 204, 0.2);
    }

    .step-icon {
      width: 72px;
      height: 72px;
      border-radius: 20px;
      margin: 0 auto 1.25rem;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.5rem;
      background: var(--cyan-subtle);
      border: 1px solid rgba(0, 229, 204, 0.12);
    }

    .step-number {
      font-family: var(--font-heading);
      font-size: 0.7rem;
      font-weight: 600;
      color: var(--cyan-dim);
      letter-spacing: 0.15em;
      text-transform: uppercase;
      margin-bottom: 0.5rem;
    }

    .step-title {
      font-family: var(--font-heading);
      font-size: 1.2rem;
      font-weight: 600;
      margin-bottom: 0.5rem;
    }

    .step-desc {
      font-size: 0.9rem;
      color: var(--text-secondary);
      line-height: 1.5;
    }

    .step-arrow {
      display: none;
      align-items: center;
      justify-content: center;
      color: var(--cyan-dim);
      font-size: 1.5rem;
    }

    @media (min-width: 800px) {
      .steps-grid {
        grid-template-columns: 1fr auto 1fr auto 1fr;
        align-items: center;
      }
      .step-arrow { display: flex; }
    }

    /* ============================================
       LORE / NARRATIVE
       ============================================ */
    .lore-section {
      background: var(--space-dark);
      border-top: 1px solid var(--border);
      border-bottom: 1px solid var(--border);
      position: relative;
      overflow: hidden;
    }

    .lore-layout {
      display: flex;
      flex-direction: column;
      gap: 3rem;
      align-items: center;
    }

    @media (min-width: 800px) {
      .lore-layout {
        flex-direction: row;
        justify-content: space-between;
      }
      .lore-text {
        flex: 1;
        max-width: 50%;
      }
      .lore-visual {
        flex: 1;
        display: flex;
        justify-content: center;
      }
    }

    .lore-stats {
      display: flex;
      gap: 2rem;
      margin-top: 2rem;
      padding-top: 1.5rem;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .lore-stat-item {
      display: flex;
      flex-direction: column;
    }

    .lore-stat-value {
      font-family: var(--font-heading);
      font-size: 2rem;
      font-weight: 700;
      color: var(--cyan);
      line-height: 1;
      margin-bottom: 0.25rem;
    }

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

    /* Planet Scanner Animation */
    .planet-scanner {
      position: relative;
      width: 250px;
      height: 250px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .scanner-ring {
      position: absolute;
      width: 100%;
      height: 100%;
      border-radius: 50%;
      border: 1px solid rgba(0, 229, 204, 0.3);
      box-shadow: 0 0 30px rgba(0, 229, 204, 0.1) inset;
      animation: scanSpin 10s linear infinite;
    }

    .scanner-ring.alt {
      width: 120%;
      height: 120%;
      border: 1px dashed rgba(0, 229, 204, 0.15);
      animation: scanSpin 15s linear infinite reverse;
    }

    .planet-core {
      position: absolute;
      width: 60%;
      height: 60%;
      border-radius: 50%;
      background: radial-gradient(circle at 30% 30%, #3a3f4a, #1a1c23);
      box-shadow: inset -10px -10px 30px rgba(0,0,0,0.8), 0 0 20px rgba(0,0,0,0.5);
      overflow: hidden;
    }

    .planet-grid {
      position: absolute;
      width: 60%;
      height: 60%;
      border-radius: 50%;
      background: 
        linear-gradient(rgba(0, 229, 204, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 204, 0.1) 1px, transparent 1px);
      background-size: 15px 15px;
      opacity: 0.5;
      clip-path: circle(50% at 50% 50%);
    }

    .scanner-line {
      position: absolute;
      width: 140%;
      height: 2px;
      background: var(--cyan);
      box-shadow: 0 0 10px var(--cyan-glow), 0 0 20px var(--cyan);
      animation: scanSweep 3s ease-in-out infinite alternate;
      z-index: 2;
    }

    @keyframes scanSpin {
      100% { transform: rotate(360deg); }
    }

    @keyframes scanSweep {
      0% { transform: translateY(-100px); opacity: 0; }
      10% { opacity: 1; }
      90% { opacity: 1; }
      100% { transform: translateY(100px); opacity: 0; }
    }

    /* ============================================
       FEATURES
       ============================================ */
    .features-section { background: var(--space-mid); }

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

    .feature-card {
      padding: 1.75rem;
      border-radius: 16px;
      background: var(--surface);
      border: 1px solid var(--border);
      transition: transform 0.3s, border-color 0.3s;
    }

    .feature-card:hover {
      transform: translateY(-3px);
      border-color: rgba(0, 229, 204, 0.15);
    }

    .feature-emoji {
      font-size: 1.75rem;
      margin-bottom: 1rem;
      display: block;
    }

    .feature-title {
      font-family: var(--font-heading);
      font-size: 1.05rem;
      font-weight: 600;
      margin-bottom: 0.4rem;
    }

    .feature-desc {
      font-size: 0.875rem;
      color: var(--text-secondary);
      line-height: 1.5;
    }

    /* ============================================
       SCREENSHOTS
       ============================================ */
    .screenshots-scroll {
      display: flex;
      gap: 1.25rem;
      overflow-x: auto;
      scroll-snap-type: x mandatory;
      -webkit-overflow-scrolling: touch;
      padding-bottom: 1rem;
      scrollbar-width: none;
    }

    .screenshots-scroll::-webkit-scrollbar { display: none; }

    .screenshot-slot {
      flex: 0 0 auto;
      width: 220px;
      aspect-ratio: 9 / 19.5;
      border-radius: 20px;
      background: var(--surface);
      border: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      scroll-snap-align: center;
      overflow: hidden;
      transition: transform 0.3s;
    }

    .screenshot-slot:hover { transform: scale(1.03); }

    .screenshot-slot img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .screenshot-placeholder {
      text-align: center;
      color: var(--text-muted);
      font-size: 0.8rem;
      padding: 1rem;
    }

    .screenshot-placeholder svg {
      width: 36px;
      height: 36px;
      margin-bottom: 0.5rem;
      opacity: 0.3;
    }

    /* ============================================
       TESTFLIGHT SIGNUP
       ============================================ */
    .signup-section {
      background: var(--space-mid);
    }

    .signup-box {
      max-width: 540px;
      margin: 0 auto;
      text-align: center;
      padding: 3rem 2rem;
      border-radius: 24px;
      background: linear-gradient(135deg, var(--surface), rgba(0, 229, 204, 0.03));
      border: 1px solid rgba(0, 229, 204, 0.1);
      box-shadow: 0 0 60px rgba(0, 229, 204, 0.05);
    }

    .signup-title {
      font-family: var(--font-heading);
      font-size: 1.75rem;
      font-weight: 700;
      margin-bottom: 0.5rem;
    }

    .signup-desc {
      color: var(--text-secondary);
      font-size: 0.95rem;
      margin-bottom: 2rem;
    }

    .signup-form {
      display: flex;
      gap: 0.75rem;
      max-width: 420px;
      margin: 0 auto;
    }

    .signup-form input[type="email"] {
      flex: 1;
      padding: 0.8rem 1.2rem;
      border-radius: 100px;
      border: 1px solid var(--border);
      background: rgba(255, 255, 255, 0.05);
      color: var(--text-primary);
      font-size: 0.95rem;
      font-family: var(--font-body);
      outline: none;
      transition: border-color 0.2s;
    }

    .signup-form input[type="email"]:focus {
      border-color: var(--cyan);
    }

    .signup-form input[type="email"]::placeholder {
      color: var(--text-muted);
    }

    .signup-form button {
      padding: 0.8rem 1.5rem;
      border-radius: 100px;
      border: none;
      background: var(--cyan);
      color: var(--space-dark);
      font-family: var(--font-heading);
      font-size: 0.9rem;
      font-weight: 600;
      cursor: pointer;
      transition: transform 0.2s, box-shadow 0.2s;
      white-space: nowrap;
    }

    .signup-form button:hover {
      transform: translateY(-1px);
      box-shadow: 0 0 25px var(--cyan-glow);
    }

    .signup-note {
      font-size: 0.75rem;
      color: var(--text-muted);
      margin-top: 1rem;
    }

    .signup-success {
      display: none;
      color: var(--green-lush);
      font-weight: 500;
      padding: 1rem;
    }

    @media (max-width: 480px) {
      .signup-form {
        flex-direction: column;
      }
    }

    /* ============================================
       FOOTER
       ============================================ */
    footer {
      position: relative;
      z-index: 1;
      padding: 3rem 1.5rem;
      border-top: 1px solid var(--border);
      text-align: center;
    }

    .footer-inner {
      max-width: 1100px;
      margin: 0 auto;
    }

    .footer-logo {
      font-family: var(--font-heading);
      font-weight: 700;
      font-size: 1.1rem;
      color: var(--cyan);
      margin-bottom: 1rem;
    }

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

    .footer-links a {
      color: var(--text-muted);
      text-decoration: none;
      font-size: 0.85rem;
      transition: color 0.2s;
    }

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

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

    /* ============================================
       ANIMATIONS
       ============================================ */
    @keyframes fadeInUp {
      from { opacity: 0; transform: translateY(24px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    @keyframes fadeInDown {
      from { opacity: 0; transform: translateY(-16px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    @keyframes pulse-dot {
      0%, 100% { opacity: 1; }
      50%      { opacity: 0.4; }
    }

    /* Scroll-triggered fade-in */
    .reveal {
      opacity: 0;
      transform: translateY(30px);
      transition: opacity 0.7s ease-out, transform 0.7s ease-out;
    }

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


/* ============================================
   INTERACTIVE UX & LIGHTBOX
   ============================================ */
.ba-tooltip {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--cyan);
  color: var(--space-dark);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: 100px;
  z-index: 20;
  pointer-events: none;
  opacity: 1;
  box-shadow: 0 0 20px rgba(0,229,204,0.4);
  transition: opacity 0.4s ease-out;
  animation: bounce 2s infinite;
}
.ba-container.interacted .ba-tooltip {
  opacity: 0;
}
@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -6px); }
}

.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 20, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-out;
}
.lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 3rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  z-index: 1001;
  transition: color 0.2s;
  padding: 10px;
}
.lightbox-close:hover {
  color: var(--cyan);
}
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}
.lightbox-content img {
  width: 100%;
  height: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(0,0,0,0.6);
}
