/* Palette mirrors the launcher's own default (violet) theme */
:root {
  --bg: #07060f;
  --glass: rgba(18, 15, 36, 0.62);
  --glass-strong: rgba(22, 18, 44, 0.88);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f2f0ff;
  --muted: #a39fc4;
  --accent: #8b7bff;
  --accent-2: #b8acff;
  --accent-glow: rgba(139, 123, 255, 0.45);
  --sky-mid: #151036;
  --sky-low: #2b1d5c;
  --moon-glow: #c9bfff;
  --ridge-1: #1d1640;
  --ridge-2: #140f2e;
  --radius: 18px;
  /* Critically damped feel: fast start, no overshoot */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 100%/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Night sky ---------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, var(--bg) 0%, var(--sky-mid) 55%, var(--sky-low) 100%);
  overflow: hidden;
}
.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 42%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 47% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 33%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 8%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 88% 46%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 60%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 36% 66%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 54%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 94% 22%, #fff 50%, transparent 51%);
  opacity: 0.55;
  animation: twinkle 7s ease-in-out infinite alternate;
}
.stars-far {
  background-size: 50% 50%;
  opacity: 0.3;
  animation-duration: 11s;
  animation-delay: -4s;
}
@keyframes twinkle { from { opacity: 0.25; } to { opacity: 0.65; } }
.stars, .moon, .blocks, .ridges { will-change: transform; }

/* Floating amethyst blocks: real 3D cubes, slowly tumbling */
.blocks { position: absolute; inset: 0; perspective: 900px; }
.block {
  --s: 46px;
  position: absolute;
  width: var(--s);
  height: var(--s);
  transform-style: preserve-3d;
  animation: tumble 22s linear infinite, bob 6s ease-in-out infinite alternate;
}
.block i {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 55%),
    repeating-conic-gradient(from 0deg, #7a68ff 0 25%, #6a57f0 0 50%) 0 0 / 50% 50%;
  border: 1px solid rgba(200, 190, 255, 0.35);
  box-shadow: inset 0 0 18px rgba(30, 20, 80, 0.55);
  image-rendering: pixelated;
}
.block i:nth-child(1) { transform: translateZ(calc(var(--s) / 2)); }
.block i:nth-child(2) { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.6); }
.block i:nth-child(3) { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.8); }
.block i:nth-child(4) { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.7); }
.block i:nth-child(5) { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); filter: brightness(1.15); }
.block i:nth-child(6) { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.5); }
.b1 { top: 22vh; left: 9vw; animation-delay: 0s, 0s; }
.b2 { --s: 28px; top: 58vh; left: 84vw; animation-duration: 30s, 7s; animation-direction: reverse, alternate; }
.b3 { --s: 20px; top: 12vh; left: 62vw; animation-duration: 26s, 5s; }
/* opacity lives on the container: opacity < 1 on a cube would flatten its 3D faces */
.blocks { opacity: 0; transition: opacity 1.2s ease 0.6s; }
.loaded .blocks { opacity: 0.85; }
@keyframes tumble {
  from { transform: rotateX(-20deg) rotateY(0deg) rotateZ(8deg); }
  to   { transform: rotateX(-20deg) rotateY(360deg) rotateZ(8deg); }
}
/* bob is applied to the face container via translate so it composes with tumble */
@keyframes bob { from { translate: 0 -10px; } to { translate: 0 10px; } }

.moon {
  position: absolute;
  top: 9vh;
  right: 12vw;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--moon-glow);
  box-shadow: 0 0 60px 20px var(--accent-glow);
  opacity: 0.85;
}
.ridges { position: absolute; bottom: 0; width: 100%; height: 34vh; }
.ridge-1 { fill: var(--ridge-1); }
.ridge-2 { fill: var(--ridge-2); }

/* ---------- Frosted glass material ---------- */
.glass {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03) 45%, rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),   /* light catching the top edge */
    inset 0 -1px 0 rgba(255, 255, 255, 0.03),
    0 20px 50px -24px rgba(0, 0, 0, 0.7);
}

/* ---------- Vertical glass dock (desktop) ---------- */
.dock {
  position: fixed;
  left: 20px;
  top: 50%;
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.45rem;
  border-radius: 999px;
  translate: 0 -50%;
}
.dock a {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--muted);
  transition: background-color 200ms ease, color 200ms ease, transform 300ms var(--ease-out);
}
.dock a:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.dock a:active { transform: scale(0.9); transition-duration: 90ms; }
.dock a.active { color: var(--bg); }
.dock a:hover.active { background: none; }
.dock a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.dock svg { position: relative; z-index: 1; }
/* Highlight puck that slides between dock items */
.dock-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 4px 14px -4px rgba(255, 255, 255, 0.45);
  transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease;
  opacity: 0;
  pointer-events: none;
}
.dock-indicator.ready { opacity: 1; }
.dock svg { width: 18px; height: 18px; fill: currentColor; }
/* Tooltip label that materializes beside the icon */
.dock a span {
  position: absolute;
  left: calc(100% + 10px);
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  translate: -6px 0;
  filter: blur(4px);
  transition: opacity 200ms ease, translate 300ms var(--ease-out), filter 250ms ease;
}
.dock a:hover span, .dock a:focus-visible span { opacity: 1; translate: 0 0; filter: none; }
/* Smaller screens: the dock becomes a floating bar along the bottom */
@media (max-width: 1240px) {
  .dock { left: 50%; top: auto; bottom: 16px; flex-direction: row; translate: -50% 0; }
  .dock a span { display: none; }
  .footer { padding-bottom: 6rem; }
}

/* ---------- Buttons: feedback on press, not on release ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0 1.5rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 300ms var(--ease-out), background-color 200ms ease, box-shadow 300ms var(--ease-out);
}
.btn:active { transform: scale(0.96); transition-duration: 90ms; }
.btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.btn-primary {
  background: var(--accent);
  box-shadow: 0 8px 28px -8px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover { background: #9a8cff; box-shadow: 0 12px 36px -8px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-ghost { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border-strong); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

/* ---------- Hero ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 0 6rem;
}
.hero-icon {
  border-radius: 26px;
  box-shadow: 0 20px 60px -10px var(--accent-glow);
  margin-bottom: 1.75rem;
}
.hero-icon-wrap { margin-bottom: 1.75rem; }
.hero-icon-wrap .hero-icon { margin: 0; display: block; }

/* Live status pill with a pulsing dot */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1rem;
  padding: 0.35rem 0.85rem 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-strong);
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
}
.dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #4ade80;
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

/* Hero intro: logo pops in, then copy rises in a stagger */
.intro { opacity: 0; transform: translateY(18px); filter: blur(6px); }
.loaded .intro {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out), filter 700ms var(--ease-out);
  transition-delay: calc(var(--i) * 90ms + 150ms);
}
.hero-icon-wrap.intro { transform: scale(0.6) rotate(-8deg); }
.loaded .hero-icon-wrap.intro {
  transform: none;
  transition-timing-function: cubic-bezier(0.34, 1.4, 0.64, 1); /* one soft overshoot for the logo only */
  transition-delay: 100ms;
}
.loaded .hero-icon { animation: float 5s ease-in-out 1.2s infinite alternate; }
@keyframes float { from { transform: translateY(0); } to { transform: translateY(-8px); } }

/* Light sweep across the main download button */
.btn-shine { position: relative; overflow: hidden; isolation: isolate; }
.btn-shine::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: shine 4.5s ease-in-out 2s infinite;
}
@keyframes shine { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
h1 {
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 4.75rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 700;
  max-width: 14ch;
}
.accent {
  background: linear-gradient(120deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  margin: 1.25rem 0 2.25rem;
  max-width: 34rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.5;
}
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.fineprint { margin: 1rem 0 0; color: var(--muted); font-size: 0.85rem; }

/* ---------- Glass stat tiles ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  width: 100%;
  max-width: 880px;
  margin-top: 3.5rem;
}
.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1rem 1.1rem 0.9rem;
  border-radius: 22px;
  text-align: left;
  overflow: hidden;
  transition: transform 450ms var(--ease-out), box-shadow 450ms var(--ease-out);
}
.stat:hover { transform: translateY(-5px); }
.stat-label { color: var(--muted); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.02em; }
.stat strong { margin-top: 0.2rem; font-size: 1.75rem; line-height: 1.1; letter-spacing: -0.03em; }
.stat-sub { color: var(--muted); font-size: 0.75rem; }
.spark { width: 100%; height: 26px; margin-top: 0.6rem; overflow: visible; }
.spark path {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 2px 6px var(--accent-glow));
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
}
/* sparklines draw themselves once the tiles have materialized */
.loaded .spark path { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s var(--ease-out) 1.1s; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Sections ---------- */
.section { padding: 5rem 0; }
h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-align: center;
}
.section-lede { margin: 0 auto 2.5rem; max-width: 36rem; text-align: center; color: var(--muted); }
#features h2 { margin-bottom: 2.5rem; }
h3 { margin: 0 0 0.4rem; font-size: 1.05rem; line-height: 1.3; letter-spacing: -0.01em; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.card {
  position: relative;
  overflow: hidden;
  transition: transform 450ms var(--ease-out), border-color 300ms ease, box-shadow 450ms var(--ease-out);
  padding: 1.5rem;
  border-radius: 24px;
}
/* Spotlight that follows the pointer, plus a gentle lift */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(139, 123, 255, 0.22), transparent 65%);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(184, 172, 255, 0.3);
  box-shadow: 0 18px 40px -18px var(--accent-glow);
}
.card-icon { transition: transform 450ms cubic-bezier(0.34, 1.4, 0.64, 1); }
.card:hover .card-icon { transform: scale(1.15) rotate(-6deg); }
.card > * { position: relative; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; letter-spacing: 0.005em; }
.card-icon { font-size: 1.6rem; margin-bottom: 0.75rem; }

.mods {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.25rem;
  border-radius: 24px;
}
.mods li { display: flex; flex-direction: column; padding: 0.85rem 1rem; border-radius: 12px; }
.mods li:hover { background: rgba(255, 255, 255, 0.04); }
.mods strong { font-weight: 600; }
.mods span { color: var(--muted); font-size: 0.9rem; }

.steps { list-style: none; margin: 2.5rem auto 0; padding: 0; max-width: 40rem; display: grid; gap: 1rem; }
.steps li {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: 24px;
}
.steps p { margin: 0; color: var(--muted); }
.step-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  font-weight: 700;
}
code {
  font: 0.85em ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  padding: 0.1em 0.4em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  word-break: break-all;
}
.final-cta { display: flex; justify-content: center; margin-top: 2.5rem; }

.footer { padding: 2.5rem 16px 3rem; text-align: center; color: var(--muted); font-size: 0.8rem; }
.footer p { max-width: 40rem; margin: 0 auto 0.5rem; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.25rem; margin-bottom: 1rem; }
a { color: var(--accent-2); }
a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 4px; }
.footer a { color: var(--text); font-size: 0.85rem; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* Section you just jumped to: its heading slides in to confirm where you landed */
.arrive > h2 { animation: arrive 700ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes arrive { from { translate: 0 28px; opacity: 0.2; } to { translate: 0 0; opacity: 1; } }

/* ---------- Legal pages ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: 3rem 16px 1rem; }
.back { display: inline-block; margin-bottom: 1.25rem; color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.back:hover { color: var(--text); }
.legal-doc { padding: clamp(1.5rem, 4vw, 3rem); border-radius: 28px; }
.legal-doc h1 { max-width: none; font-size: clamp(2rem, 5vw, 2.75rem); }
.legal-doc h2 { text-align: left; font-size: 1.25rem; letter-spacing: -0.015em; margin: 2rem 0 0.5rem; }
.legal-doc p, .legal-doc li { color: #d6d2f0; line-height: 1.65; }
.legal-doc ul { padding-left: 1.2rem; }
.legal-doc li { margin-bottom: 0.5rem; }
.updated { color: var(--muted) !important; font-size: 0.85rem; margin-top: 0.5rem; }
mark.todo { background: #fbbf24; color: #1a1300; padding: 0 0.3em; border-radius: 4px; font-weight: 600; }

/* ---------- Scroll reveal (JS adds .reveal, then .in) ---------- */
/* uses `translate` so it never fights the hover `transform` */
/* panels materialize: rise, un-blur and settle from slightly smaller */
.reveal { opacity: 0; translate: 0 16px; scale: 0.98; filter: blur(8px); }
.reveal.in {
  opacity: 1;
  translate: 0 0;
  scale: 1;
  filter: none;
  transition: opacity 600ms var(--ease-out), translate 700ms var(--ease-out), scale 700ms var(--ease-out), filter 600ms var(--ease-out);
  transition-delay: calc(var(--stagger, 0) * 70ms);
}
/* once revealed, hover transitions take over without the stagger delay */
.card.reveal.in.settled { transition: transform 450ms var(--ease-out), border-color 300ms ease, box-shadow 450ms var(--ease-out); }

.mods li { transition: background-color 200ms ease, transform 300ms var(--ease-out); }
.mods li:hover { transform: translateX(4px); }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .moon { width: 48px; height: 48px; right: 8vw; }
  .steps li { padding: 1rem; }
}

/* ---------- Accessibility preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .btn:active { transform: none; transition: background-color 150ms ease; }
  .reveal { translate: none; scale: none; filter: none; }
  .spark path { stroke-dashoffset: 0; }
  .loaded .spark path, .dock-indicator { transition: none; }
  .arrive > h2 { animation: none; }
  .stat:hover { transform: none; }
  .reveal.in { transition: opacity 200ms ease; }
  .stars, .block, .dot::after, .btn-shine::before, .loaded .hero-icon { animation: none; }
  .intro, .hero-icon-wrap.intro { transform: none; filter: none; }
  .loaded .intro { transition: opacity 300ms ease; transition-delay: 0ms; }
  .card:hover, .card:hover .card-icon, .mods li:hover { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--glass-strong); }
}
@media (prefers-contrast: more) {
  :root { --muted: #d4d0f0; --border: rgba(255, 255, 255, 0.35); }
}
