/* ============================================================
   ORBIT — joinorbit.so
   Light editorial canvas. Wistful into warm. Four beats.
   Type: Archivo (boxy display) + Geist (clean body).
   Accent periwinkle/pink used only in small doses.
   ============================================================ */

:root {
  --canvas:    #080A12;   /* true near-black blue, from the app background */
  --canvas-2:  #0C0E17;   /* a touch lifted, for gentle rhythm */
  --ink:       #E9EBF4;   /* light text */
  --ink-2:     #9398B0;   /* muted */
  --ink-3:     #686C82;   /* dim */
  --rule:      rgba(255, 255, 255, 0.08);
  --rule-2:    rgba(255, 255, 255, 0.14);

  --accent:     #9AA0FF;  /* periwinkle — fills */
  --accent-ink: #AEB3FF;  /* periwinkle — text/glyphs on dark */
  --negative:   #FF8DA8;  /* pink — fills */
  --negative-ink: #FF9DB4;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Geist", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

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

* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; }
body {
  margin: 0; padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #14130F; }

/* ---------- Type primitives ---------- */
.display {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.9;
  text-wrap: balance;
}
.lede {
  font-family: var(--body);
  font-weight: 400;
  font-size: clamp(18px, 2.1vw, 25px);
  line-height: 1.42;
  letter-spacing: -0.015em;
  color: var(--ink-2);
  text-wrap: pretty;
}
.eyebrow {
  font-family: var(--body);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ============================================================
   HERO  — beat 1 — "Look up."
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  color: #FBFAF6;
}

/* media stack: animated CSS sky now, real <video> drops on top later */
.hero-media { position: absolute; inset: 0; z-index: -2; background: #070A18; }
.hero-video {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-video:not([src]) { display: none; }

/* --- placeholder sky: the fallback BEHIND the video (sunset → night) --- */
.hero-sky { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.sky-grad {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom,
      #070A18 0%,
      #0E1430 26%,
      #232a55 46%,
      #4a416f 62%,
      #8a5775 76%,
      #c2756e 88%,
      #e0a168 100%);
}
/* warm sun glow sitting low on the horizon */
.sky-glow {
  position: absolute; left: 50%; bottom: -14%;
  width: 130vw; height: 70vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center,
      rgba(255, 197, 138, 0.55) 0%,
      rgba(243, 160, 120, 0.30) 32%,
      rgba(180, 120, 130, 0.12) 55%,
      transparent 72%);
  filter: blur(4px);
  animation: glowBreathe 14s ease-in-out infinite;
}
@keyframes glowBreathe {
  0%, 100% { opacity: 0.85; transform: translateX(-50%) translateY(0); }
  50%      { opacity: 1;    transform: translateX(-50%) translateY(-2.2%); }
}
/* slow drifting soft clouds */
.sky-drift { position: absolute; inset: -10% -20%; opacity: 0.5; }
.sky-drift::before, .sky-drift::after {
  content: ""; position: absolute;
  border-radius: 50%;
  filter: blur(46px);
}
.sky-drift::before {
  width: 70vw; height: 26vh; left: -10vw; top: 44%;
  background: radial-gradient(ellipse, rgba(120,110,150,0.5), transparent 70%);
  animation: drift1 46s linear infinite;
}
.sky-drift::after {
  width: 60vw; height: 22vh; right: -12vw; top: 56%;
  background: radial-gradient(ellipse, rgba(180,130,140,0.42), transparent 70%);
  animation: drift2 58s linear infinite;
}
@keyframes drift1 { 0% { transform: translateX(-6vw); } 50% { transform: translateX(8vw); } 100% { transform: translateX(-6vw); } }
@keyframes drift2 { 0% { transform: translateX(6vw); } 50% { transform: translateX(-9vw); } 100% { transform: translateX(6vw); } }

/* starfield (dots injected by JS into .sky-stars) */
.sky-stars { position: absolute; inset: 0; }
.sky-stars .star {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: #FBFAF6;
  opacity: 0.85;
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.18; }
  50%      { opacity: 0.9; }
}

/* legibility scrims top + bottom; bottom fades fully into the page */
.hero-scrim {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(to bottom,
      rgba(8,10,18,0.55) 0%,
      rgba(8,10,18,0.10) 20%,
      transparent 46%,
      rgba(8,10,18,0.34) 72%,
      rgba(8,10,18,0.82) 90%,
      var(--canvas) 100%);
}

/* hero chrome */
.hero-topbar {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px clamp(20px, 4vw, 56px);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 46px; height: 46px; }
.brand-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: -0.04em;
  color: #FBFAF6;
}
.hero-topbar .brand-name { color: #FBFAF6; }
.brand-mark--light path { fill: #FBFAF6; }

/* hero content sits low so the eye travels up the sky */
.hero-body {
  position: relative; z-index: 3;
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  padding: 0 clamp(20px, 4vw, 52px) clamp(40px, 7vh, 80px);
}
.hero-headline {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(82px, 17vw, 268px);
  line-height: 0.86;
  letter-spacing: -0.055em;
  margin: 0 0 clamp(28px, 4vh, 48px);
  color: #FDFCF9;
  text-shadow: 0 2px 40px rgba(7, 10, 24, 0.35);
}

/* ============================================================
   CTA — device-conditional (shared by hero + close)
   default: waitlist shown / app hidden. body.is-ios flips it.
   ============================================================ */
.cta { display: inline-flex; flex-direction: column; align-items: center; gap: 14px; }
.cta-app { display: none; flex-direction: column; align-items: center; gap: 13px; }
.cta-wait { display: flex; flex-direction: column; align-items: center; gap: 13px; }
/* TEMP — app not live yet: App Store button hidden, waitlist shown to everyone
   (including iPhone). When the iOS app launches, un-comment the two rules below
   to restore the device-conditional CTA, and add the real App Store URL to the
   .btn-app links in index.html. See README "Launch TODO". */
/* body.is-ios .cta-app { display: flex; } */
/* body.is-ios .cta-wait { display: none; } */

/* restrained ghost button — text + small periwinkle arrow, sits into the page */
.btn-app, .btn-ghost {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--body); font-size: 15.5px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--rule-2);
  padding: 15px 26px; border-radius: 999px;
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s;
}
.arr { width: 15px; height: 15px; color: var(--accent); transition: transform 0.2s var(--ease); flex-shrink: 0; }
.btn-app:hover, .btn-ghost:hover { border-color: var(--accent); background: rgba(154, 160, 255, 0.07); }
.btn-app:hover .arr, .btn-ghost:hover .arr { transform: translateX(3px); }

.waitlist { display: flex; align-items: center; flex-wrap: wrap; }
.waitlist-field {
  display: flex; align-items: center;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  overflow: hidden;
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  transition: border-color 0.2s, background 0.2s;
}
.waitlist-field:focus-within { border-color: var(--accent); background: rgba(154, 160, 255, 0.05); }
.waitlist-field input {
  border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 15.5px; letter-spacing: -0.01em;
  padding: 15px 8px 15px 24px;
  width: clamp(170px, 38vw, 240px);
  color: var(--ink);
}
.waitlist-field input::placeholder { color: var(--ink-3); }
.waitlist-field button {
  border: 0; border-left: 1px solid var(--rule);
  background: transparent; color: var(--accent);
  padding: 15px 22px;
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background 0.2s;
}
.waitlist-field button .arr { width: 14px; height: 14px; }
.waitlist-field button:hover { background: rgba(154, 160, 255, 0.08); }
.waitlist-field button:hover .arr { transform: translateX(3px); }
.waitlist.done .waitlist-field { border-color: var(--accent); }
.waitlist-done {
  padding: 15px 26px; font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
  white-space: nowrap; color: var(--ink);
  animation: waitlistDone 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes waitlistDone {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .waitlist-done { animation: none; }
}
.waitlist.error .waitlist-field { border-color: var(--negative); }
.waitlist-error {
  flex-basis: 100%; margin-top: 8px;
  font-family: var(--body); font-size: 12.5px; letter-spacing: -0.005em;
  color: var(--negative);
}
.cta-note {
  font-family: var(--body); font-size: 12.5px; letter-spacing: -0.005em;
  color: var(--ink-3);
}

/* ============================================================
   BEAT 2 — "Your friends see everything."
   ============================================================ */
.beat {
  position: relative;
  padding: clamp(120px, 18vh, 220px) clamp(20px, 5vw, 64px);
  /* the scaled phone's layout box stays 348px wide; clip so very narrow
     (<348px) viewports never get a horizontal scrollbar */
  overflow-x: clip;
}
.beat:not(.beat--choice)::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(66% 52% at 74% 40%, rgba(154,160,255,0.07) 0%, transparent 62%);
}
.beat:not(.beat--choice) .beat-grid { position: relative; z-index: 1; }
.beat-grid {
  max-width: 1240px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(48px, 7vw, 110px);
  align-items: center;
}
.beat-grid.reverse .beat-copy { order: 2; }
.beat-grid.reverse .beat-stage { order: 1; }

.beat-copy { max-width: 100%; }
.beat-copy .eyebrow { display: block; margin-bottom: 26px; }
.beat-headline {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(46px, 6.4vw, 100px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin: 0 0 26px;
  text-wrap: balance;
}
.beat-line {
  max-width: 32ch;
  font-family: var(--body);
  font-weight: 400;
  font-size: clamp(18px, 2.1vw, 25px);
  line-height: 1.42;
  letter-spacing: -0.015em;
  color: var(--ink-2);
  margin: 0;
  text-wrap: pretty;
}
.beat-line .soft { color: var(--ink-3); }

.beat-stage {
  display: grid; place-items: center;
  position: relative;
}
/* soft halo lifts the dark phone off the near-black page */
.beat-stage::before {
  content: "";
  position: absolute;
  width: min(640px, 104%); aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle,
      rgba(154,160,255,0.16) 0%,
      rgba(154,160,255,0.06) 36%,
      transparent 66%);
  filter: blur(14px);
  z-index: 0;
}
.beat-stage .phone { position: relative; z-index: 1; }

/* ============================================================
   BEAT 3 — "The scroll was never your idea."
   a quieter field + a pink-leaning halo, blended (no hard edges)
   ============================================================ */
.beat--choice { position: relative; }
.beat--choice::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(80% 60% at 30% 50%, rgba(255,141,168,0.07) 0%, transparent 60%),
    linear-gradient(to bottom, transparent 0%, rgba(255,255,255,0.018) 50%, transparent 100%);
}
.beat--choice .beat-grid { position: relative; z-index: 1; }
.beat--choice .beat-stage::before {
  background: radial-gradient(circle,
      rgba(255,141,168,0.13) 0%,
      rgba(154,160,255,0.06) 40%,
      transparent 66%);
}

/* ============================================================
   BEAT 4 — the quiet close. A clear final CTA, not a full beat.
   Shorter than the others; logo + CTA on a single soft glow.
   ============================================================ */
.close {
  position: relative;
  padding: clamp(96px, 15vh, 180px) clamp(20px, 5vw, 64px);
  text-align: center;
}
.close::before {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: min(960px, 116%); height: min(520px, 150%);
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center,
      rgba(154,160,255,0.11) 0%,
      rgba(154,160,255,0.05) 28%,
      rgba(255,141,168,0.03) 44%,
      transparent 62%);
  pointer-events: none;
}
.close-inner { position: relative; z-index: 1; max-width: 920px; margin: 0 auto; }
.close-logo {
  width: clamp(108px, 13vw, 168px);
  height: auto;
  display: block;
  margin: 0 auto clamp(34px, 5vh, 56px);
  opacity: 0.97;
}
.close .cta { gap: 16px; }

/* ============================================================
   FOOTER — quiet
   ============================================================ */
.footer {
  padding: clamp(72px, 12vh, 130px) clamp(20px, 5vw, 64px) 48px;
  background: transparent;
}
.footer-inner {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 40px; flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: 15px; }
.footer-brand .brand-mark { width: 42px; height: 42px; }
.footer-brand .brand-name { color: var(--ink); font-size: 29px; font-weight: 800; letter-spacing: -0.04em; }
.footer-links { display: flex; gap: clamp(20px, 3vw, 40px); flex-wrap: wrap; }
.footer-links a {
  font-family: var(--body); font-size: 14.5px; letter-spacing: -0.01em;
  color: var(--ink-2);
  transition: color 0.16s;
}
.footer-links a:hover { color: var(--ink); }
.footer-bottom {
  max-width: 1240px; margin: 36px auto 0;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  font-family: var(--body); font-size: 12px; letter-spacing: 0.02em;
  color: var(--ink-3);
}

/* ============================================================
   Scroll reveal (soft, barely-there) — applied by JS
   ============================================================ */
.reveal { opacity: 0; transform: translateY(20px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sky-glow, .sky-drift::before, .sky-drift::after, .sky-stars .star { animation: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 940px) {
  .beat-grid { grid-template-columns: 1fr; gap: 56px; justify-items: center; text-align: center; }
  .beat-grid.reverse .beat-copy { order: 1; }
  .beat-grid.reverse .beat-stage { order: 2; }
  .beat-copy { max-width: 34ch; }
  .beat-copy .eyebrow { margin-bottom: 18px; }
}
@media (max-width: 560px) {
  .hero-topbar { padding: 18px 18px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-name { font-size: 25px; }
  .hero-headline { font-size: clamp(74px, 23vw, 130px); }

  /* hero content to the lower-middle, not jammed to the bottom edge */
  .hero-body {
    justify-content: center;
    padding-top: clamp(40px, 14vh, 130px);
    padding-bottom: clamp(48px, 10vh, 90px);
  }

  /* waitlist: one tidy full-width pill, input flexes, button stays compact */
  .cta { width: 100%; }
  .waitlist { width: 100%; }
  .waitlist-field { width: 100%; max-width: 380px; }
  .waitlist-field input { flex: 1 1 auto; width: auto; min-width: 0; padding-left: 20px; }
  .waitlist-field button { padding: 14px 18px; flex: 0 0 auto; }
  .waitlist-done { flex: 1; text-align: center; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
}
