/* ═══════════════════════════════════════════════════════════
   Funcade Labs — funcadelabs.com
   Palette pulled from the game itself: #05060f ground,
   #1de5ff walls, #ff2fb9 glow, #fff2b8 player.
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #05060f;
  --bg-raised: #0a0c1a;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);

  --text: #f2f4fb;
  --text-muted: #a2acc4;
  --text-dim: #6c778f;

  --accent: #1de5ff;
  --accent-soft: rgba(29, 229, 255, 0.14);
  --accent-line: rgba(29, 229, 255, 0.34);
  --magenta: #ff2fb9;
  --cream: #fff2b8;

  --shell: 1180px;
  --radius: 16px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

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

html {
  scroll-behavior: smooth;
  /* Sticky header clearance for anchor jumps */
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

img,
svg,
iframe {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #04121a;
  font-weight: 600;
  transition: top 0.2s;
}

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

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 20px;
}

/* ─────────────────────────── Buttons ─────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.25s,
    color 0.2s;
}

.btn:hover {
  text-decoration: none;
}

.btn--sm {
  padding: 9px 18px;
  font-size: 14px;
}

.btn--lg {
  /* Thumb-friendly: comfortably above the 44px tap target floor */
  padding: 17px 34px;
  font-size: 16px;
}

.btn--primary {
  background: var(--accent);
  color: #04121a;
  box-shadow: 0 0 0 rgba(29, 229, 255, 0);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 34px -10px rgba(29, 229, 255, 0.6);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--accent-line);
  background: rgba(29, 229, 255, 0.06);
  transform: translateY(-2px);
}

.btn-arrow {
  width: 15px;
  height: 15px;
  transition: transform 0.18s var(--ease);
}

.btn--primary:hover .btn-arrow {
  transform: translate(2px, -2px);
}

/* ─────────────────────────── Header ─────────────────────────── */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding: 14px 0;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s, padding 0.3s;
}

.site-header.is-stuck {
  padding: 9px 0;
  background: rgba(5, 6, 15, 0.78);
  border-bottom-color: var(--line);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 22px;
  height: 22px;
  flex: none;
  fill: var(--accent);
}

.brand-chevron {
  fill: var(--cream);
}

.brand-chevron--dim {
  opacity: 0.4;
}

.brand-text {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.brand-text-dim {
  color: var(--text-dim);
  margin-left: 4px;
}

.site-nav {
  display: none;
  gap: 30px;
  font-size: 14px;
  font-weight: 500;
}

.site-nav a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

@media (min-width: 800px) {
  .site-nav {
    display: flex;
  }
}

/* ──────────────────────────── Hero ──────────────────────────── */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding: 120px 0 96px;
  overflow: hidden;
}

.hero-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Soft magenta bloom, echoing the game's glow */
.hero-glow {
  position: absolute;
  z-index: 0;
  left: 50%;
  bottom: -34%;
  width: min(940px, 130vw);
  aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(
    circle,
    rgba(29, 229, 255, 0.13) 0%,
    rgba(255, 47, 185, 0.07) 38%,
    transparent 68%
  );
  animation: bloom 11s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes bloom {
  from {
    opacity: 0.75;
    transform: translateX(-50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1.06);
  }
}

/* The two walls you leap between */
.hero-walls {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-walls span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--accent-line) 22%,
    var(--accent-line) 72%,
    transparent
  );
  opacity: 0.5;
}

.hero-walls span:first-child {
  left: 5vw;
}

.hero-walls span:last-child {
  right: 5vw;
}

@media (min-width: 800px) {
  .hero-walls span:first-child {
    left: 8vw;
  }
  .hero-walls span:last-child {
    right: 8vw;
  }
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 26px;
  padding: 7px 16px 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

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

.hero-title {
  font-size: clamp(4.2rem, 21vw, 12rem);
  letter-spacing: -0.045em;
  background: linear-gradient(180deg, #ffffff 26%, #9fb0cc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* -webkit-text-fill-color keeps Safari from painting over the gradient */
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  margin: 22px auto 0;
  max-width: 30ch;
  font-size: clamp(1.05rem, 3.6vw, 1.4rem);
  font-weight: 500;
  color: var(--text);
}

.hero-hook {
  margin: 12px auto 0;
  max-width: 34ch;
  font-size: clamp(0.95rem, 3.2vw, 1.06rem);
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 38px;
}

.hero-actions .btn {
  flex: 1 1 auto;
  min-width: 190px;
  max-width: 320px;
}

@media (min-width: 560px) {
  .hero-actions .btn {
    flex: 0 0 auto;
  }
}

/* Height/score motif */
.altimeter {
  display: none;
  position: absolute;
  right: max(24px, 2.2vw);
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  text-align: right;
  pointer-events: none;
}

.altimeter-value {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.altimeter-value em {
  font-style: normal;
  color: var(--text-dim);
  margin-left: 2px;
}

.altimeter-track {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.altimeter-track span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--line-strong);
}

.altimeter-track span:nth-child(odd) {
  width: 12px;
}

@media (min-width: 1080px) {
  .altimeter {
    display: block;
  }
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 30px;
  z-index: 1;
  transform: translateX(-50%);
  width: 34px;
  height: 46px;
  display: flex;
  justify-content: center;
}

.scroll-cue-line {
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--accent));
  opacity: 0.6;
  animation: cue 2.2s ease-in-out infinite;
  transform-origin: top;
}

@keyframes cue {
  0%,
  100% {
    transform: scaleY(0.35);
    opacity: 0.25;
  }
  50% {
    transform: scaleY(1);
    opacity: 0.7;
  }
}

/* ─────────────────────────── Sections ─────────────────────────── */

.section {
  position: relative;
  padding: 96px 0;
}

@media (min-width: 800px) {
  .section {
    padding: 140px 0;
  }
}

.section-label {
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.section-title {
  font-size: clamp(2rem, 6.4vw, 3.1rem);
}

.lede {
  margin-top: 22px;
  max-width: 54ch;
  font-size: clamp(1rem, 3.2vw, 1.09rem);
  color: var(--text-muted);
}

.br-md {
  display: none;
}

@media (min-width: 800px) {
  .br-md {
    display: inline;
  }
}

/* ────────────────────── Showcase ────────────────────── */

.showcase {
  border-top: 1px solid var(--line);
}

.showcase-grid {
  display: grid;
  gap: 62px;
  align-items: center;
}

@media (min-width: 940px) {
  .showcase-grid {
    grid-template-columns: 1fr minmax(300px, 380px);
    gap: 80px;
  }
}

.features {
  display: grid;
  gap: 22px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}

.feature {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.feature-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--accent-line);
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.feature h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.feature p {
  margin-top: 4px;
  font-size: 0.94rem;
  color: var(--text-muted);
}

.share-line {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-size: 0.96rem;
  color: var(--text-muted);
}

.share-line a {
  font-weight: 600;
}

/* Phone mockup */
.showcase-device {
  justify-self: center;
  width: 100%;
  max-width: 340px;
}

.phone {
  position: relative;
  padding: 11px;
  border: 1px solid var(--line-strong);
  border-radius: 42px;
  background: linear-gradient(160deg, #171b2b, #090b16 55%);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.95),
    0 0 60px -22px rgba(29, 229, 255, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.phone::before {
  /* Speaker notch */
  content: "";
  position: absolute;
  top: 22px;
  left: 50%;
  z-index: 3;
  width: 62px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(-50%);
  pointer-events: none;
}

.phone-screen {
  position: relative;
  aspect-ratio: 9 / 19;
  border-radius: 32px;
  overflow: hidden;
  background: var(--bg);
}

.phone-screen iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.phone-poster {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow: hidden;
  background: radial-gradient(
      circle at 50% 78%,
      rgba(255, 47, 185, 0.16),
      transparent 58%
    ),
    var(--bg);
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}

.phone-poster.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.poster-walls span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.85;
}

.poster-walls span:first-child {
  left: 18%;
}

.poster-walls span:last-child {
  right: 18%;
}

.poster-word {
  position: relative;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  color: var(--text);
}

.poster-play {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 14px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #04121a;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 34px -6px rgba(29, 229, 255, 0.7);
  transition: transform 0.18s var(--ease);
}

.poster-play:hover {
  transform: scale(1.045);
}

.poster-play svg {
  width: 17px;
  height: 17px;
}

.poster-hint {
  position: relative;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.device-caption {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

.device-caption a {
  color: var(--text-muted);
  border-bottom: 1px solid var(--line-strong);
}

.device-caption a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ─────────────────────────── About ─────────────────────────── */

.about {
  border-top: 1px solid var(--line);
}

/* Capping the children rather than the shell keeps the narrow measure
   aligned to the same left edge as the showcase copy above it. */
.about-inner > * {
  max-width: 760px;
}

.about-title {
  font-size: clamp(1.85rem, 5.6vw, 2.8rem);
}

.about-title em {
  font-style: normal;
  color: var(--accent);
}

.about-lede + .about-lede {
  margin-top: 16px;
}

/* ────────────────────────── Newsletter ────────────────────────── */

.newsletter {
  padding-top: 0;
}

.newsletter-card {
  max-width: 720px;
  padding: 46px 24px 48px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    var(--bg-raised);
  text-align: center;
}

@media (min-width: 700px) {
  .newsletter-card {
    padding: 58px 56px 60px;
  }
}

.newsletter-title {
  font-size: clamp(1.6rem, 5vw, 2.15rem);
}

.newsletter-sub {
  margin: 14px auto 0;
  max-width: 46ch;
  font-size: 0.97rem;
  color: var(--text-muted);
}

.signup {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 30px auto 0;
  max-width: 460px;
}

@media (min-width: 560px) {
  .signup {
    flex-direction: row;
  }
}

.signup-input {
  flex: 1;
  min-width: 0;
  padding: 16px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-family: inherit;
  font-size: 16px; /* 16px stops iOS from zooming on focus */
  transition: border-color 0.2s, background 0.2s;
}

.signup-input::placeholder {
  color: var(--text-dim);
}

.signup-input:focus {
  outline: none;
  border-color: var(--accent-line);
  background: rgba(29, 229, 255, 0.05);
}

.signup-input[aria-invalid="true"] {
  border-color: var(--magenta);
}

.signup-btn {
  padding: 16px 30px;
  font-size: 15px;
}

.form-note {
  min-height: 20px;
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--text-dim);
}

.form-note.is-ok {
  color: var(--accent);
}

.form-note.is-err {
  color: var(--magenta);
}

/* ─────────────────────────── Footer ─────────────────────────── */

.site-footer {
  padding: 40px 0 46px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

@media (min-width: 800px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.socials {
  display: flex;
  gap: 8px;
  order: -1;
}

@media (min-width: 800px) {
  .socials {
    order: 0;
  }
}

.socials a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}

.socials a:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

.socials svg {
  width: 17px;
  height: 17px;
}

.copyright {
  font-size: 13px;
  color: var(--text-dim);
}

/* ─────────────────────── Scroll reveal ─────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Stagger siblings within a block so they cascade in */
.reveal:nth-child(2) {
  transition-delay: 0.06s;
}
.reveal:nth-child(3) {
  transition-delay: 0.12s;
}
.reveal:nth-child(4) {
  transition-delay: 0.18s;
}
.reveal:nth-child(5) {
  transition-delay: 0.24s;
}
.reveal:nth-child(6) {
  transition-delay: 0.3s;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
