/* The launch page. See index.html. */

:root {
  color-scheme: dark; /* must match the app's, or the browser paints the iframe opaque */
  --ink: #eceef6;
  --ink-2: rgb(236 238 246 / 0.7);
  --ink-3: rgb(236 238 246 / 0.45);
  --line: rgb(255 255 255 / 0.12);
  --sans: "Geist Variable", system-ui, sans-serif;
  --mono: "JetBrains Mono Variable", ui-monospace, monospace;
  --c1: #14b8a6;
  --c2: #7c3aed;
  --c3: #db2777;
  --c4: #2563eb;
  --base: #04050c;
  --hue: 0deg;
  --nav-h: 84px; /* the nav's bottom edge plus a gap: what content keeps clear of */
}

* {
  box-sizing: border-box;
}
html {
  background: var(--base);
}
body {
  margin: 0;
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
code {
  font: 0.92em var(--mono);
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: rgb(255 255 255 / 0.08);
}

/* ---- the wallpaper -------------------------------------------------------- */

/* Four slow-drifting blobs of colour, tinted by each step as it's read. */
#wall {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--base);
  filter: hue-rotate(var(--hue)) saturate(1.15);
  transition: filter 1.4s ease;
}
#wall i {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  opacity: 0.75;
  animation: drift 38s ease-in-out infinite alternate;
}
#wall i:nth-child(1) {
  background: radial-gradient(circle, var(--c1) 0, transparent 62%);
  left: -18vmax;
  top: -24vmax;
}
#wall i:nth-child(2) {
  background: radial-gradient(circle, var(--c2) 0, transparent 62%);
  right: -20vmax;
  top: -10vmax;
  animation-duration: 46s;
  animation-delay: -12s;
}
#wall i:nth-child(3) {
  background: radial-gradient(circle, var(--c3) 0, transparent 60%);
  left: 18vmax;
  bottom: -40vmax;
  animation-duration: 52s;
  animation-delay: -20s;
}
#wall i:nth-child(4) {
  background: radial-gradient(circle, var(--c4) 0, transparent 60%);
  right: -10vmax;
  bottom: -30vmax;
  animation-duration: 41s;
  animation-delay: -6s;
  opacity: 0.55;
}
@keyframes drift {
  to {
    transform: translate(12vmax, 9vmax) scale(1.15);
  }
}

/* ---- the nav -------------------------------------------------------------- */

nav.top {
  position: fixed;
  z-index: 20;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1180px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 10px 12px 10px 18px;
  border-radius: 14px;
  background: rgb(10 12 22 / 0.35);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgb(255 255 255 / 0.08);
  font-size: 14px;
}
nav.top .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
nav.top .alpha {
  font: 11px var(--mono);
  color: var(--ink-3);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 99px;
}
nav.top .spacer {
  flex: 1;
}
nav.top a:not(.brand) {
  color: var(--ink-2);
}
nav.top a:hover {
  color: var(--ink);
}
nav.top .download {
  color: #0a0b12 !important;
  background: var(--ink);
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 550;
}

/* ---- the story ------------------------------------------------------------ */

/* Steps on the left, the app pinned on the right. Everything clears the nav:
   a step's content is centred in the height below it, and the window fills
   that height. Type shrinks with short screens as well as narrow ones. */
.story {
  display: grid;
  grid-template-columns: minmax(340px, 0.7fr) 1.3fr;
  gap: 40px;
  padding: 0 32px 0 clamp(24px, 4vw, 64px);
}
.step {
  min-height: 100svh;
  padding: var(--nav-h) 0 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0.4;
  transition: opacity 0.5s ease;
}
.step.active {
  opacity: 1;
}
h1 {
  margin: 0;
  font-size: clamp(32px, min(5.4vw, 8.5vh), 76px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 620;
}
h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #9ff3e6 0%, #c4b5fd 45%, #f9a8d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h2 {
  margin: 0;
  font-size: clamp(26px, min(3.2vw, 6vh), 46px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 600;
}
.step p {
  font-size: clamp(15px, 2.6vh, 18px);
  color: var(--ink-2);
  max-width: 34em;
  margin: clamp(10px, 2.4vh, 20px) 0 0;
}
.kicker {
  font: 12px var(--mono);
  color: var(--ink-3);
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}
.scroll-cue {
  margin-top: clamp(16px, 5vh, 48px);
  font: 12px var(--mono);
  color: var(--ink-3);
}
.step .live-note {
  font-size: 15px;
  margin-top: 24px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgb(14 16 28 / 0.35);
}
.live-note .below {
  display: none;
}

.ctas {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 32px;
}
.ctas a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 550;
  font-size: 15px;
}
.ctas .primary {
  background: var(--ink);
  color: #0a0b12;
}
.ctas .secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgb(255 255 255 / 0.04);
}
.step .fine {
  font: 12.5px var(--mono);
  color: var(--ink-3);
  margin-top: 16px;
}

/* ---- the window ----------------------------------------------------------- */

.pinned {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  align-items: center;
  padding: var(--nav-h) 0 16px;
}

/* The app's window. The page blurs what's behind it, as the compositor would;
   the app inside paints its veil and panels over that. */
.glass-window {
  width: 100%;
  height: min(860px, calc(100svh - var(--nav-h) - 16px));
  border-radius: 12px;
  overflow: hidden;
  background: rgb(255 255 255 / 0.015);
  backdrop-filter: blur(30px) saturate(170%);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.13),
    0 0 0 1px rgb(0 0 0 / 0.35),
    0 50px 120px -30px rgb(0 0 0 / 0.75);
}
.glass-window iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color-scheme: dark;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.glass-window.live iframe {
  opacity: 1;
}

/* ---- narrow screens ------------------------------------------------------- */

/* Too narrow for two columns: the window sits under the intro at its own
   height, and the steps follow as plain sections. */
@media (max-width: 900px) {
  .story {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 16px;
  }
  .steps {
    display: contents;
  }
  .step {
    min-height: 0;
    padding: 56px 0 0;
    opacity: 1;
    order: 2;
  }
  .step.intro {
    order: 0;
    padding: calc(var(--nav-h) + 24px) 0 32px;
  }
  .step:last-child {
    padding-bottom: 96px;
  }
  .scroll-cue,
  .live-note .beside {
    display: none;
  }
  .live-note .below {
    display: inline;
  }
  .pinned {
    order: 1;
    position: static;
    height: auto;
    padding: 0;
  }
  .glass-window {
    height: min(720px, 80svh);
  }
  h1 {
    font-size: clamp(34px, 9vw, 56px);
  }
  h2 {
    font-size: clamp(26px, 7vw, 40px);
  }
}
@media (max-width: 560px) {
  nav.top .alpha,
  nav.top .github {
    display: none;
  }
}
