/* ============================================================
   KindaSorta — marketing & legal site
   Visual language mirrors the in-game "Celestial" theme:
   near-black indigo void, magenta-violet nebula accents,
   a green gooey-blob alien companion. Colors are taken
   straight from the app's CelestialTheme / AlienScene.
   ============================================================ */

:root {
  /* Void backdrop (from Celestial.voidDeep/Mid/High) */
  --void-deep: #050514;
  --void-mid:  #0a081c;
  --void-high: #0f0a29;

  /* Nebula accents */
  --nebula-core:   #9e4df2; /* magenta-violet, primary action */
  --nebula-hot:    #f799f2; /* hot pink highlight */
  --nebula-cyan:   #4dccf2; /* cool secondary */
  --nebula-ember:  #fa7366; /* warning / destructive */
  --nebula-aurora: #73f2b3; /* success / win */

  /* Alien greens */
  --alien-body:  #73e08c;
  --alien-aura:  #8cd973;

  /* Text on void */
  --text-primary:   #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.86);
  --text-muted:     rgba(255, 255, 255, 0.55);

  /* Surfaces */
  --panel-fill:   rgba(255, 255, 255, 0.06);
  --panel-stroke: rgba(255, 255, 255, 0.14);
  --panel-shadow: rgba(0, 0, 0, 0.55);

  --maxw: 1080px;
  --radius: 20px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text-primary);
  line-height: 1.6;
  background-color: var(--void-deep);
  /* Layered nebula glow over the deep void, like the in-game
     CelestialBackground gradient + nebula shader. */
  background-image:
    radial-gradient(1200px 800px at 78% -8%, rgba(158, 77, 242, 0.28), transparent 60%),
    radial-gradient(900px 700px at 12% 8%, rgba(77, 204, 242, 0.16), transparent 55%),
    radial-gradient(1000px 900px at 50% 110%, rgba(247, 153, 242, 0.14), transparent 60%),
    linear-gradient(180deg, var(--void-high) 0%, var(--void-mid) 45%, var(--void-deep) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Starfield — two tiled layers for depth, brighter than before, gently
   animated (slow parallax drift + offset twinkle). Oversized via inset:-50%
   so the transform drift never reveals an unpainted edge. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 0;
  background-repeat: repeat;
  will-change: transform, opacity;
}
/* Near layer: dense, small, bright pinpricks with a few warm/cool glints. */
body::before {
  background-image:
    radial-gradient(1.4px 1.4px at 20% 30%, rgba(255,255,255,0.95), transparent 60%),
    radial-gradient(1.3px 1.3px at 70% 20%, rgba(255,255,255,0.85), transparent 60%),
    radial-gradient(1.3px 1.3px at 40% 70%, rgba(199,230,255,0.85), transparent 60%),
    radial-gradient(1.7px 1.7px at 85% 60%, rgba(255,255,255,0.95), transparent 60%),
    radial-gradient(1.3px 1.3px at 55% 45%, rgba(255,255,255,0.8), transparent 60%),
    radial-gradient(2px 2px at 10% 85%, rgba(255,247,242,0.95), transparent 60%),
    radial-gradient(1.3px 1.3px at 90% 90%, rgba(255,255,255,0.85), transparent 60%),
    radial-gradient(1.3px 1.3px at 33% 12%, rgba(255,255,255,0.8), transparent 60%),
    radial-gradient(1.3px 1.3px at 62% 78%, rgba(214,255,236,0.85), transparent 60%);
  background-size: 240px 240px;
  opacity: 0.9;
  animation: star-drift-a 90s linear infinite alternate,
             star-twinkle-a 5s ease-in-out infinite;
}
/* Far layer: sparser, larger, slower, drifting the other way for parallax. */
body::after {
  background-image:
    radial-gradient(2px 2px at 15% 25%, rgba(255,255,255,0.9), transparent 60%),
    radial-gradient(2.4px 2.4px at 75% 65%, rgba(180,210,255,0.85), transparent 60%),
    radial-gradient(2px 2px at 50% 50%, rgba(255,255,255,0.85), transparent 60%),
    radial-gradient(2.3px 2.3px at 88% 18%, rgba(255,230,250,0.85), transparent 60%),
    radial-gradient(2px 2px at 30% 82%, rgba(255,255,255,0.8), transparent 60%);
  background-size: 420px 420px;
  opacity: 0.75;
  animation: star-drift-b 140s linear infinite alternate,
             star-twinkle-b 7s ease-in-out infinite;
}
@keyframes star-drift-a {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-1.5%, 2.5%, 0); }
}
@keyframes star-drift-b {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(2%, -2%, 0); }
}
@keyframes star-twinkle-a {
  0%, 100% { opacity: 0.9; }
  50%      { opacity: 0.55; }
}
@keyframes star-twinkle-b {
  0%, 100% { opacity: 0.75; }
  50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
}

a { color: var(--nebula-cyan); text-decoration: none; }
a:hover { color: var(--nebula-hot); }

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Top nav ---------- */
.nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.2px;
  color: var(--text-primary);
}
.brand svg { width: 34px; height: 38px; }
.brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: block;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { color: var(--text-secondary); font-size: 0.95rem; }
.nav-links a:hover { color: var(--text-primary); }
@media (max-width: 640px) {
  .nav-links { display: none; }
}

/* ---------- Buttons (NebulaButtonStyle analog) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  color: #fff;
  background-image: linear-gradient(135deg, var(--nebula-core), var(--nebula-hot));
  box-shadow: 0 8px 30px rgba(158, 77, 242, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(247, 153, 242, 0.55);
  color: #fff;
}
.btn-secondary {
  background-image: none;
  background-color: var(--panel-fill);
  border: 1px solid var(--panel-stroke);
  box-shadow: none;
}
.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding: 56px 0 72px;
}
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.07;
  margin: 0 0 18px;
  letter-spacing: -0.5px;
}
.hero h1 .grad {
  /* Wide, repeating gradient so the highlight can travel across the words. */
  background-image: linear-gradient(
    100deg,
    var(--alien-body) 0%,
    var(--nebula-aurora) 20%,
    var(--nebula-cyan) 40%,
    var(--nebula-hot) 60%,
    var(--alien-aura) 80%,
    var(--alien-body) 100%
  );
  background-size: 250% 100%;
  background-position: 0% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  /* Always-on shimmer (fallback for browsers without scroll timelines). */
  animation: alien-shimmer 7s linear infinite;
  will-change: background-position, filter;
}
@keyframes alien-shimmer {
  to { background-position: 250% 0; }
}

/* Scroll-driven: scrolling sweeps the shine across the words and pulses a
   green alien glow. Falls back to the looping shimmer above where unsupported. */
@supports (animation-timeline: scroll()) {
  .hero h1 .grad {
    animation: alien-sweep linear both, alien-glow linear both;
    animation-timeline: scroll(root block), scroll(root block);
    animation-range: 0 80vh;
  }
}
@keyframes alien-sweep {
  from { background-position: 0% 0; }
  to   { background-position: 250% 0; }
}
@keyframes alien-glow {
  0%   { filter: drop-shadow(0 0 0 rgba(115, 224, 140, 0)); }
  50%  { filter: drop-shadow(0 0 18px rgba(115, 224, 140, 0.6)); }
  100% { filter: drop-shadow(0 0 4px rgba(115, 224, 140, 0.15)); }
}

@media (prefers-reduced-motion: reduce) {
  .hero h1 .grad {
    animation: none;
    background-position: 0 0;
    filter: none;
  }
}
.hero p.lede {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin: 0 0 28px;
  max-width: 30em;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--nebula-aurora);
  background: rgba(115, 242, 179, 0.1);
  border: 1px solid rgba(115, 242, 179, 0.25);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding: 32px 0 48px; }
  .hero p.lede { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .eyebrow { margin-inline: auto; }
}

/* ---------- Phone mockup with portrait video placeholder ---------- */
.phone {
  justify-self: center;
  width: min(300px, 80vw);
  /* Height follows the screen, which matches the gameplay video's aspect
     ratio (set on .phone-screen) so the frame hugs the footage with no
     letterboxing and no side cropping. */
  border-radius: 42px;
  padding: 12px;
  background: linear-gradient(160deg, #1a1733, #0b0a1c);
  border: 1px solid var(--panel-stroke);
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(158, 77, 242, 0.25),
    inset 0 0 0 2px rgba(255, 255, 255, 0.04);
  position: relative;
}
.phone-screen {
  width: 100%;
  /* Match the gameplay video (720×1450) so object-fit:cover fills exactly —
     no side cropping, no top/bottom bars. Update if the video is re-cropped. */
  aspect-ratio: 720 / 1450;
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(158,77,242,0.35), transparent 60%),
    linear-gradient(180deg, var(--void-high), var(--void-deep));
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Autoplaying portrait gameplay loop — fills the phone screen. */
.gameplay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: transparent;
}
/* The video placeholder, shown as fallback inside the <video> until a
   real gameplay.mp4 (portrait, e.g. 1080×2340) is dropped in. */
.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}
.video-placeholder .play {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--nebula-core), var(--nebula-hot));
  box-shadow: 0 0 40px rgba(247, 153, 242, 0.5);
}
.video-placeholder .play svg { width: 26px; height: 26px; fill: #fff; margin-left: 4px; }
.video-placeholder .label { font-size: 0.85rem; letter-spacing: 0.5px; }
.video-placeholder .dims { font-size: 0.72rem; opacity: 0.7; }

/* ---------- Section scaffolding ---------- */
section { padding: 56px 0; position: relative; z-index: 1; }
.section-head { text-align: center; max-width: 40em; margin: 0 auto 44px; }
.section-head h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  margin: 0 0 14px;
  letter-spacing: -0.3px;
}
.section-head p { color: var(--text-secondary); font-size: 1.1rem; margin: 0; }

/* ---------- Feature grid ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 820px) { .features { grid-template-columns: 1fr; } }
.card {
  background: var(--panel-fill);
  border: 1px solid var(--panel-stroke);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,0.28); }
.card .ic {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  font-size: 1.5rem;
  background: rgba(158, 77, 242, 0.16);
  border: 1px solid rgba(158, 77, 242, 0.3);
}
.card .ic svg { width: 30px; height: 32px; display: block; }
.card h3 { margin: 0 0 8px; font-size: 1.2rem; }
.card p { margin: 0; color: var(--text-secondary); font-size: 0.97rem; }

/* ---------- Alien companion band ---------- */
.companion {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 40px;
  align-items: center;
  background: var(--panel-fill);
  border: 1px solid var(--panel-stroke);
  border-radius: 28px;
  padding: 44px;
  overflow: hidden;
}
.companion .alien-stage {
  display: flex; align-items: center; justify-content: center;
}
.companion .alien-stage svg { width: min(240px, 60vw); height: auto; }
.companion h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 14px; }
.companion p { color: var(--text-secondary); margin: 0 0 14px; }
.reaction {
  margin: 22px 0 0;
  max-width: 280px;
}
.reaction img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  border: 1px solid var(--panel-stroke);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}
.reaction figcaption {
  margin-top: 10px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--nebula-ember);
}
@media (max-width: 820px) {
  .companion { grid-template-columns: 1fr; text-align: center; padding: 32px; }
  .reaction { margin-left: auto; margin-right: auto; }
}

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }
.step { text-align: center; padding: 12px; }
.step .num {
  width: 44px; height: 44px; margin: 0 auto 14px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  background: linear-gradient(135deg, var(--nebula-cyan), var(--nebula-core));
  box-shadow: 0 0 24px rgba(77, 204, 242, 0.4);
}
.step h4 { margin: 0 0 6px; font-size: 1.05rem; }
.step p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

/* ---------- Screens gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
@media (max-width: 820px) { .gallery { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .gallery { grid-template-columns: 1fr 1fr; gap: 14px; } }
.shot { margin: 0; text-align: center; }
.shot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 22px;
  border: 1px solid var(--hairline, rgba(255,255,255,0.08));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  background: var(--void-high);
}
.shot figcaption {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.88rem;
}
@media (max-width: 480px) { .shot figcaption { font-size: 0.8rem; } }

/* ---------- Final CTA ---------- */
.cta-band {
  text-align: center;
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(158,77,242,0.25), transparent 60%),
    var(--panel-fill);
  border: 1px solid var(--panel-stroke);
  border-radius: 28px;
  padding: 56px 28px;
}
.cta-band h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 14px; }
.cta-band p { color: var(--text-secondary); margin: 0 0 26px; font-size: 1.1rem; }

/* App Store badge placeholder */
.appstore-badge {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 22px;
  border-radius: 14px;
  background: #000;
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
}
.appstore-badge:hover { color: #fff; border-color: rgba(255,255,255,0.5); }
.appstore-badge .sub { font-size: 0.7rem; opacity: 0.8; line-height: 1; }
.appstore-badge .big { font-size: 1.2rem; font-weight: 600; line-height: 1.1; }
.appstore-badge svg { width: 26px; height: 26px; fill: #fff; }

/* ---------- Footer ---------- */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--panel-stroke);
  margin-top: 40px;
  padding: 40px 0;
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}
footer .foot-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
footer .foot-brand svg { width: 26px; height: 29px; }
footer .foot-links { display: flex; gap: 22px; flex-wrap: wrap; }
footer .foot-links a { color: var(--text-secondary); font-size: 0.92rem; }
footer .copy { color: var(--text-muted); font-size: 0.85rem; width: 100%; }

/* ============================================================
   Legal pages (privacy / terms)
   ============================================================ */
.legal {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}
.legal .doc {
  background: var(--panel-fill);
  border: 1px solid var(--panel-stroke);
  border-radius: var(--radius);
  padding: clamp(28px, 5vw, 56px);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.legal h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 0 0 6px;
  letter-spacing: -0.4px;
}
.legal .updated { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 32px; }
.legal h2 {
  font-size: 1.3rem;
  margin: 36px 0 12px;
  padding-top: 8px;
  color: var(--text-primary);
}
.legal h3 { font-size: 1.05rem; margin: 22px 0 8px; color: var(--text-secondary); }
.legal p, .legal li { color: var(--text-secondary); }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 8px; }
.legal strong { color: var(--text-primary); }
.legal .toc {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--panel-stroke);
  border-radius: 14px;
  padding: 18px 22px;
  margin: 0 0 32px;
}
.legal .toc h2 { margin: 0 0 10px; font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.legal .toc ol { margin: 0; padding-left: 20px; }
.legal .toc li { margin-bottom: 4px; }
.legal .back { display: inline-block; margin-bottom: 20px; font-size: 0.92rem; }
.legal .callout {
  background: rgba(115, 242, 179, 0.08);
  border: 1px solid rgba(115, 242, 179, 0.25);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 20px 0;
}
.legal .callout p { margin: 0; color: var(--text-secondary); }

/* ============================================================
   Support page (FAQ + contact)
   ============================================================ */
.faq {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-stroke);
  border-radius: 14px;
  margin: 0 0 14px;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 20px;
  font-weight: 600;
  color: var(--text-primary);
  position: relative;
  padding-right: 44px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--nebula-aurora);
  transition: transform 0.15s ease;
}
.faq[open] summary::after { content: "–"; }
.faq summary:hover { background: rgba(255, 255, 255, 0.04); }
.faq .faq-body { padding: 0 20px 16px; }
.faq .faq-body p:first-child { margin-top: 0; }
.faq ol { padding-left: 22px; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0 22px;
}
@media (max-width: 640px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  padding: 18px;
  border-radius: 14px;
  background: var(--panel-fill);
  border: 1px solid var(--panel-stroke);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.contact-card:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.3); }
.contact-card.selected { border-color: var(--nebula-aurora); box-shadow: 0 0 24px rgba(115, 242, 179, 0.2); }
.contact-card .contact-emoji { font-size: 1.5rem; }
.contact-card .contact-title { font-weight: 600; }
.contact-card .contact-sub { font-size: 0.85rem; color: var(--text-muted); }

.captcha {
  background: rgba(158, 77, 242, 0.1);
  border: 1px solid rgba(158, 77, 242, 0.35);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 0 0 22px;
}
.captcha .captcha-title { margin: 0; font-weight: 600; color: var(--text-primary); }
.captcha-feedback { margin: 12px 0 0; color: var(--nebula-ember); font-weight: 600; min-height: 1em; }
.captcha-feedback:empty { display: none; }

.contact-reveal {
  background: rgba(115, 242, 179, 0.08);
  border: 1px solid rgba(115, 242, 179, 0.25);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 0 0 10px;
  text-align: center;
}
.contact-reveal p { margin: 0 0 12px; color: var(--text-secondary); }
