:root {
  --bg: #050b21;
  --bg-edge: #03081a;
  --surface-1: #0a1130;
  --surface-2: #0e1638;
  --surface-3: #141d44;
  --gold: #e6d18a;
  --periwinkle: #a3add9;
  --crimson: #b52a32;
  --body: #e8e6dc;
  --muted: #bdbaa8;
  --outline: #5e5b4c;
}

* { box-sizing: border-box; }

html {
  background: var(--bg-edge);
}
html, body {
  margin: 0;
  padding: 0;
  color: var(--body);
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  background: transparent;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.space-perspective {
  position: fixed;
  inset: 0;
  z-index: -2;
  perspective: 1400px;
  perspective-origin: 50% 50%;
  pointer-events: none;
  overflow: hidden;
}
.planet-perspective {
  position: fixed;
  inset: 0;
  z-index: 0;
  perspective: 1400px;
  perspective-origin: 50% 50%;
  pointer-events: none;
  overflow: hidden;
}

.space-stage {
  position: absolute;
  top: 50%;
  left: 50%;
  /* Cover both axes after scale(0.8): 125vw / 125vh is the minimum unscaled
     size to fill the viewport; 150vw is the parallax margin. Lock to the
     bg image aspect ratio (2400×1792) on whichever axis is constraining. */
  width: max(150vw, calc(125vh * 2400 / 1792));
  height: max(calc(150vw * 1792 / 2400), 125vh);
  margin-left: calc(max(150vw, 125vh * 2400 / 1792) / -2);
  margin-top: calc(max(150vw * 1792 / 2400, 125vh) / -2);
  will-change: transform;
  transform: scale(0.8);
  transform-origin: center center;
}

.space-bg {
  position: absolute;
  inset: 0;
  background-image: url('./space-bg.webp');
  background-size: cover;
  background-position: center;
  filter: brightness(0.78) saturate(1.05);
}

.space-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%,
      rgba(3, 8, 26, 0.55) 0%,
      rgba(3, 8, 26, 0.25) 18%,
      rgba(3, 8, 26, 0) 38%);
  pointer-events: none;
}

.planet {
  --shadow-offset: 0px;
  position: absolute;
  left: 85%;
  top: 45%;
  width: 40%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(-15deg);
  border-radius: 50%;
  background-color: #050303;
  background-image: url('./crescent.webp');
  background-size: 112% 112%;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(0, 0, 0, 0.65);
  z-index: 1;
  overflow: hidden;
}
/* Eclipsing dark disk — moved via transform only so it never repaints.
   Shadow box is 160% of planet; gradient stops at 37.5% and 50% of itself
   = 60% and 80% of planet (matches original radial-gradient stops).
   translateX(7.5%) of shadow = 12% of planet, matching original 62% center. */
.planet-shadow {
  --shadow-offset: 7.5%;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 160%;
  height: 160%;
  transform: translate(-50%, -50%) translateX(var(--shadow-offset));
  background: radial-gradient(circle,
    #050303 0%,
    #050303 37.5%,
    rgba(5, 3, 3, 0) 50%);
  pointer-events: none;
  will-change: transform;
}

/* Zodiac strip — vertical column of signs sliding down through the planet.
   PNGs have a black background; mix-blend-mode: screen drops it.
   A vertical mask brightens the middle and fades the edges. */
.zodiac-strip {
  position: absolute;
  top: 0;
  left: 50%;
  width: 28%;
  height: 100%;
  transform: translateX(-50%) rotate(15deg);
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.08) 28%,
    rgba(0, 0, 0, 1) 50%,
    rgba(0, 0, 0, 0.08) 72%,
    transparent 100%);
  mask-image: linear-gradient(to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.08) 28%,
    rgba(0, 0, 0, 1) 50%,
    rgba(0, 0, 0, 0.08) 72%,
    transparent 100%);
}
.zodiac-track {
  display: flex;
  flex-direction: column;
  animation: zodiacScroll 48s linear infinite;
  will-change: transform;
}
.zodiac {
  width: 100%;
  aspect-ratio: 1;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
  mix-blend-mode: screen;
}
@keyframes zodiacScroll {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .zodiac-track { animation: none; }
}

/* Mobile-only zodiac top bar — horizontal scroll, faded dark backdrop. */
.zodiac-bar {
  display: none;
}
@media (max-width: 700px) {
  .zodiac-bar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    z-index: 5;
    background: rgba(5, 3, 3, 0.62);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(163, 173, 217, 0.14);
    pointer-events: auto;
  }
  .zodiac-bar-strip {
    flex-shrink: 0;
    height: 56px;
    overflow: hidden;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to right,
      transparent 0%,
      rgba(0, 0, 0, 0.25) 12%,
      rgba(0, 0, 0, 1) 32%,
      rgba(0, 0, 0, 1) 68%,
      rgba(0, 0, 0, 0.25) 88%,
      transparent 100%);
    mask-image: linear-gradient(to right,
      transparent 0%,
      rgba(0, 0, 0, 0.25) 12%,
      rgba(0, 0, 0, 1) 32%,
      rgba(0, 0, 0, 1) 68%,
      rgba(0, 0, 0, 0.25) 88%,
      transparent 100%);
  }
  .zodiac-bar-track {
    display: flex;
    align-items: center;
    height: 100%;
    animation: zodiacScrollH 48s linear infinite;
    will-change: transform;
  }
  .zodiac-bar-sign {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    margin: 0 18px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    mix-blend-mode: screen;
    opacity: 0.85;
  }
  .zodiac-bar-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    border-top: 1px solid rgba(163, 173, 217, 0.14);
  }
  .zodiac-bar-nav a {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1.1px;
    color: var(--gold);
    text-decoration: none;
  }
  /* Make room for the bar at the top of each page; offset anchor scroll so titles clear it. */
  body { padding-top: 100px; }
  body.page-home { padding-top: 56px; }
  body.page-home .zodiac-bar { height: 56px; }
  #privacy, #terms { scroll-margin-top: 112px; }
  .legal-nav { display: none !important; }
}
@keyframes zodiacScrollH {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .zodiac-bar-track { animation: none; }
}

.mono-caps {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1.2px;
}

h1, h2, h3 { font-family: 'Noto Serif', Georgia, serif; color: var(--gold); margin: 0; }
h1 { font-style: italic; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-weight: 600; }
h3 { font-weight: 500; }

a { color: var(--gold); text-decoration: none; transition: text-shadow 240ms ease-out, color 240ms ease-out; }
a:hover, a:focus-visible { text-shadow: 0 0 12px rgba(230, 209, 138, 0.55); }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

/* Starfield — oversized so the mouse-driven translate doesn't reveal edges. */
#starfield {
  position: fixed;
  top: -60px;
  left: -60px;
  width: calc(100vw + 120px);
  height: calc(100vh + 120px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.85;
  will-change: transform;
}

/* Nebula corner glows */
.nebula {
  position: fixed;
  width: 80vmax;
  height: 80vmax;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.14;
}
.nebula-tl { top: -40vmax; left: -40vmax; background: radial-gradient(circle, var(--periwinkle) 0%, rgba(163, 173, 217, 0.35) 25%, transparent 70%); }
.nebula-br { bottom: -40vmax; right: -40vmax; background: radial-gradient(circle, var(--gold) 0%, rgba(230, 209, 138, 0.35) 25%, transparent 70%); }

main, header, footer, nav { position: relative; z-index: 1; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: box-shadow 240ms ease-out, background 240ms ease-out, color 240ms ease-out, transform 240ms ease-out;
  color: var(--gold);
  background: transparent;
  white-space: nowrap;
}
.btn:hover, .btn:focus-visible {
  box-shadow: 0 0 24px rgba(230, 209, 138, 0.35);
}
.btn-primary {
  background: var(--gold);
  color: #0a0f24;
}
.btn-primary:hover, .btn-primary:focus-visible {
  box-shadow: 0 0 28px rgba(230, 209, 138, 0.6);
}

/* Crimson H1 underline */
.h1-underline {
  display: inline-block;
  position: relative;
}
.h1-underline::after {
  content: "";
  position: absolute;
  left: 0;
  right: 30%;
  bottom: -10px;
  height: 2px;
  background: var(--crimson);
  border-radius: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -10000px;
  top: 8px;
  background: var(--gold);
  color: #0a0f24;
  padding: 8px 12px;
  border-radius: 4px;
  z-index: 100;
}
.skip-link:focus { left: 16px; }

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 600ms ease-out, transform 600ms ease-out;
}
.reveal:not(.in) { will-change: opacity, transform; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* Legal page styles */
.legal-nav {
  position: sticky;
  top: 0;
  background: rgba(5, 3, 3, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(163, 173, 217, 0.18);
  z-index: 10;
  padding: 14px 24px;
  display: flex;
  justify-content: center;
  gap: 28px;
}
.legal-nav a { font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: 1.2px; color: var(--gold); }

.legal-article { max-width: 720px; margin: 0 auto; padding: 56px 24px 32px; }
.legal-article + .legal-article { border-top: 1px solid rgba(163, 173, 217, 0.18); }
.legal-article h1 { font-size: 40px; line-height: 1.15; }
.legal-article h2 {
  font-size: 24px;
  margin: 40px 0 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gold);
}
.legal-article h3 { font-size: 18px; margin: 24px 0 6px; color: var(--body); }
.legal-article p { color: var(--body); margin: 12px 0; }
.legal-article ul { padding-left: 22px; }
.legal-article li { margin: 6px 0; }
.last-updated { color: var(--muted); margin-top: 12px; }

/* Footer */
.site-footer {
  padding: 24px 32px;
  color: var(--muted);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--gold); }
.footer-socials { display: flex; justify-content: center; gap: 18px; }
.footer-meta {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.footer-sep { color: var(--outline); }

@media (max-width: 700px) {
  .site-footer {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 14px;
    padding: 24px 16px;
  }
  .footer-left { display: none; }
  .footer-meta { justify-self: center; flex-wrap: wrap; justify-content: center; }
}

/* Landing */
.landing {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 140px 24px 60px;
}
.landing-inner { max-width: 560px; width: 100%; text-align: center; }
.wordmark { font-size: 72px; line-height: 1.1; font-style: italic; font-weight: 700; letter-spacing: -0.02em; color: var(--gold); }
.tagline { font-size: 16px; line-height: 26px; color: var(--body); margin: 14px auto 0; max-width: 460px; }
.device-pair {
  margin: 56px auto 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}
.device-pair .device { width: 200px; }
.device-left { transform: rotate(-7deg); }
.device-right { transform: rotate(7deg); }
.cta { display: flex; flex-direction: column; gap: 24px; max-width: 460px; margin: 0 auto; align-items: center; }
.cta-main {
  width: 100%;
  height: 56px;
  font-size: 13px;
  letter-spacing: 1.3px;
}
.cta-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  transition: filter 220ms ease-out;
}
.cta-social svg { width: 22px; height: 22px; fill: currentColor; }
.cta-social:hover, .cta-social:focus-visible {
  filter: drop-shadow(0 0 12px rgba(230, 209, 138, 0.85));
}

.device {
  position: relative;
  width: 200px;
  aspect-ratio: 1206 / 2622;
}
.device-glow {
  position: absolute;
  inset: -18%;
  background: radial-gradient(closest-side, rgba(230, 209, 138, 0.32), rgba(155, 162, 224, 0.18) 55%, transparent 75%);
  filter: blur(28px);
  pointer-events: none;
  z-index: -1;
}
.device-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 36px;
  padding: 8px;
  background: linear-gradient(150deg, rgba(230, 209, 138, 0.55), rgba(155, 162, 224, 0.35) 45%, rgba(255, 255, 255, 0.08) 100%);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}
.device-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(155, 162, 224, 0.22), transparent 60%),
    radial-gradient(80% 60% at 50% 100%, rgba(230, 209, 138, 0.18), transparent 70%),
    #05060c;
}
.device-shot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #05060c;
}

@media (max-width: 700px) {
  /* Swap to a portrait crop and stop scaling/tilting the stage on touch viewports. */
  .space-stage {
    position: absolute;
    inset: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    transform: none !important;
  }
  .space-bg {
    background-image: url('./space-bg.webp');
    background-position: left center;
    filter: brightness(0.45) saturate(1.05);
  }
  .planet { display: none; }

  .landing { padding: 100px 24px 48px; min-height: calc(100vh - 120px); }
  .landing-inner { max-width: 100%; }
  .device { width: 200px; }
  .wordmark { font-size: 56px; }
  .tagline { font-size: 15px; line-height: 24px; margin: 12px auto 0; max-width: 100%; }
  .device-pair { margin: 40px auto 36px; gap: 14px; }
  .device-pair .device { width: 140px; }

  .cta { max-width: 100%; }

  .legal-article { margin: 0 auto; padding: 40px 16px 24px; }
  .legal-article h1 { font-size: 30px; }
  .legal-article h2 { font-size: 21px; margin-top: 32px; }
  .legal-nav { gap: 18px; padding: 12px 16px; }
  .legal-nav a { font-size: 11px; letter-spacing: 1px; }

}

/* Route crossfade */
body.fade-out { opacity: 0; transition: opacity 200ms ease-out; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  body, body.fade-out { transition: none; opacity: 1; }
  #starfield { animation: none; }
  .space-stage { transform: scale(0.8) !important; }
}
