/* =====================================================================
   Neon Landing — the game's dark/neon identity, ported from the app.
   Title font: Bitcount Grid Single. Per-letter colours are the game's 7
   routing "pad" colours (App/PadColors.swift) cycled by letter index.
   Each letter drifts on a slow sine wave (BeatTitle.swift:
   offsetY = sin(t*1.8 + i*0.5) * amp) and carries a glow in its own colour.
   ===================================================================== */

@font-face {
  font-family: "Bitcount Grid Single";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/bitcount-grid-single-latin.woff2") format("woff2");
}

:root {
  /* the game's 7 pad colours (App/PadColors.swift) */
  --pad-0: #0A84FF; /* blue   */
  --pad-1: #34C759; /* green  */
  --pad-2: #9B5DE5; /* violet */
  --pad-3: #30B0C7; /* teal   */
  --pad-4: #FF9F0A; /* amber  */
  --pad-5: #FF3B30; /* red    */
  --pad-6: #FF40D9; /* pink   */

  /* the game's dark field + ink (UI/Theme.swift, dark appearance) */
  --neon-bg:   #101418;
  --neon-bg-2: #0B0E12;
  --neon-ink:  #E8EDEF;
  --neon-muted:#8B97A1;
}

/* ---------- the animated neon title ---------- */
.neon-title {
  font-family: "Bitcount Grid Single", "Courier New", monospace;
  font-weight: 400;
  line-height: 1.05;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1em;
  /* wave amplitude, expressed relative to the type size */
  --amp: 0.13em;
}
.neon-row {
  display: flex;
  justify-content: center;
  letter-spacing: 0.04em;
}
.neon-letter {
  display: inline-block;
  color: var(--nc);
  /* per-letter glow in the letter's own colour — tight + dim so the dot-grid
     glyphs stay crisp against the dark field (a big bloom washes them out) */
  text-shadow:
    0 0 0.05em color-mix(in oklab, var(--nc) 78%, transparent),
    0 0 0.30em color-mix(in oklab, var(--nc) 46%, transparent),
    0 0 0.55em color-mix(in oklab, var(--nc) 30%, transparent);
  /* slow sine wave, phase-shifted per letter (i * 0.5 rad at 1.8 rad/s) */
  animation: neon-wave 3.49s linear infinite;
  animation-delay: calc(var(--i) * -0.278s);
  will-change: transform;
}
/* pad-colour map, cycled by letter index mod 7 */
.neon-letter[data-c="0"] { --nc: var(--pad-0); }
.neon-letter[data-c="1"] { --nc: var(--pad-1); }
.neon-letter[data-c="2"] { --nc: var(--pad-2); }
.neon-letter[data-c="3"] { --nc: var(--pad-3); }
.neon-letter[data-c="4"] { --nc: var(--pad-4); }
.neon-letter[data-c="5"] { --nc: var(--pad-5); }
.neon-letter[data-c="6"] { --nc: var(--pad-6); }
/* the monospace "I" sits in a full-width cell with big side gaps — pull its
   neighbours in so LANDING reads DIN, not D I N */
.neon-letter--narrow { margin-inline: -0.13em; }

/* true-ish sine sampled at eighths so the drift matches the game's sin() */
@keyframes neon-wave {
  0%    { transform: translateY(calc(var(--amp) *  0)); }
  12.5% { transform: translateY(calc(var(--amp) *  0.707)); }
  25%   { transform: translateY(calc(var(--amp) *  1)); }
  37.5% { transform: translateY(calc(var(--amp) *  0.707)); }
  50%   { transform: translateY(calc(var(--amp) *  0)); }
  62.5% { transform: translateY(calc(var(--amp) * -0.707)); }
  75%   { transform: translateY(calc(var(--amp) * -1)); }
  87.5% { transform: translateY(calc(var(--amp) * -0.707)); }
  100%  { transform: translateY(calc(var(--amp) *  0)); }
}

@media (prefers-reduced-motion: reduce) {
  .neon-letter,
  .neon-hero .neon-eyebrow,
  .neon-hero .neon-appicon,
  .neon-hero .neon-tagline,
  .neon-hero .neon-cta { animation: none; }
}

/* ---------- dark sections (so the neon pops) ---------- */
.neon-section {
  position: relative;
  color: var(--neon-ink);
  background-color: var(--neon-bg);
  /* the game's faint dot-grid playfield */
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.05) 1.1px, transparent 1.2px);
  background-size: 22px 22px;
  background-position: center;
  overflow: hidden;
}
.neon-section::before {
  /* soft centre glow to lift the title off the field */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 45% at 50% 32%, rgba(120, 140, 200, 0.14), transparent 70%);
  pointer-events: none;
}
.neon-section > * { position: relative; z-index: 1; }

/* =====================================================================
   Neon Landing — dedicated page layout (dark throughout)
   ===================================================================== */
body.neon-page {
  background: var(--neon-bg-2);
  color: var(--neon-ink);
}
/* header sits transparent over the dark hero; lighten the nav for contrast */
.neon-page .site-nav a { color: #AEB8C0; }
.neon-page .site-nav a:hover { color: #fff; }

/* hero */
.neon-hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: clamp(6rem, 14vh, 9rem) 1.25rem clamp(3rem, 8vh, 5rem);
}
.neon-hero__inner { max-width: 940px; }
.neon-appicon {
  display: block;
  width: clamp(104px, 22vw, 125px);
  height: auto;
  margin: 2rem auto 0.4rem;
  filter: drop-shadow(0 22px 46px rgba(0, 0, 0, 0.55));
}
.neon-teaser .neon-appicon { width: clamp(88px, 18vw, 128px); margin: 0 auto; }
.neon-hero .neon-title {
  font-size: clamp(3rem, 15vw, 8rem);
  margin: 0.35em 0 0.55em;
}
.neon-eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  color: var(--neon-muted);
  margin: 0;
}
.neon-tagline {
  max-width: 640px;
  margin: 0 auto 1.8rem;
  color: #C4CCD2;
  font-size: clamp(1.05rem, 2.4vw, 1.28rem);
  line-height: 1.6;
}
.neon-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: #cdd4da;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  margin-bottom: 1.8rem;
}
.neon-cta { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }

/* ---------- hero entrance (on load, neon-landing page only) ---------- */
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes hero-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.82); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes neon-letter-in {
  from { opacity: 0; filter: blur(12px); }
  to   { opacity: 1; filter: blur(0); }
}
.neon-hero .neon-eyebrow { animation: hero-rise 0.65s cubic-bezier(0.22, 0.61, 0.36, 1) 0.1s both; }
.neon-hero .neon-appicon { animation: hero-pop 0.75s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both; }
.neon-hero .neon-tagline { animation: hero-rise 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) 1.15s both; }
.neon-hero .neon-cta     { animation: hero-rise 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) 1.35s both; }
/* letters keep waving (transform) while they fade + un-blur in, staggered left-to-right */
.neon-hero .neon-letter {
  animation:
    neon-wave 3.49s linear infinite,
    neon-letter-in 0.5s ease-out both;
  animation-delay: calc(var(--i) * -0.278s), calc(0.55s + var(--i) * 0.045s);
}

/* screenshots */
.neon-shots { padding: clamp(2.5rem, 7vw, 5rem) 1.25rem; }
.neon-shots__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
  max-width: 1040px;
  margin: 0 auto;
  align-items: start;
}
.neon-phone {
  margin: 0;
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 34px 70px -34px rgba(0, 0, 0, 0.85);
}
.neon-phone img { display: block; width: 100%; height: auto; }
.neon-shots__note {
  text-align: center;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--neon-muted);
  margin: 1.6rem 0 0;
}

/* about + features */
.neon-about {
  padding: clamp(2rem, 6vw, 3.5rem) 1.5rem clamp(4rem, 10vw, 6rem);
}
.neon-about__inner { max-width: 760px; margin: 0 auto; }
.neon-about h2 {
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  font-weight: 700;
  margin: 0 0 1rem;
}
.neon-about p { color: #C4CCD2; font-size: 1.08rem; line-height: 1.7; margin: 0 0 1rem; }
.neon-features {
  list-style: none;
  padding: 0;
  margin: 1.8rem 0 0;
  display: grid;
  gap: 0.85rem;
}
.neon-features li { display: flex; align-items: center; gap: 0.85rem; color: #D2D9DE; font-size: 1.05rem; }
.neon-features .ndot {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--nc);
  box-shadow: 0 0 10px var(--nc), 0 0 20px color-mix(in oklab, var(--nc) 60%, transparent);
}
.neon-features li[data-c="0"] { --nc: var(--pad-0); }
.neon-features li[data-c="1"] { --nc: var(--pad-1); }
.neon-features li[data-c="2"] { --nc: var(--pad-2); }
.neon-features li[data-c="3"] { --nc: var(--pad-3); }
.neon-features li[data-c="4"] { --nc: var(--pad-4); }
.neon-features li[data-c="5"] { --nc: var(--pad-5); }

/* homepage teaser block (dark neon section dropped into the light page) */
.neon-teaser { text-align: center; padding: clamp(3rem, 8vw, 5.5rem) 1.25rem; }
.neon-teaser .neon-title { font-size: clamp(2.4rem, 10vw, 4.6rem); margin: 0.4em auto 0.6em; }
.neon-teaser__lead {
  max-width: 560px;
  margin: 0 auto 1.8rem;
  color: #C4CCD2;
  font-size: clamp(1.02rem, 2.2vw, 1.18rem);
  line-height: 1.6;
}
.neon-teaser .btn--primary { background: linear-gradient(135deg, var(--pad-0), var(--pad-2)); box-shadow: 0 12px 30px -10px rgba(10, 132, 255, 0.6); }

@media (max-width: 720px) {
  .neon-shots__grid { grid-template-columns: 1fr; max-width: 340px; }
}
