@font-face {
  font-family: "Inter";
  src: url("assets/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --frost: #f2f5fb;
  --paper: #ffffff;
  --ink: #0b1533;
  --ink-soft: #4a5577;
  --blue: #2f6fe4;
  --coral: #ff5b3a;
  --mint: #16c79a;
  --line: rgb(11 21 51 / 10%);
  --phone-h: min(78vh, 640px);
  --phone-w: calc(var(--phone-h) * 0.46);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01";
  color: var(--ink);
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgb(47 111 228 / 14%), transparent 60%),
    radial-gradient(50rem 30rem at -10% 30%, rgb(255 91 58 / 8%), transparent 60%),
    var(--frost);
  line-height: 1.55;
  overflow-x: hidden;
  position: relative;
}

a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
b { font-weight: 650; }
code {
  font-family: ui-monospace, monospace;
  font-size: .9em;
  background: rgb(47 111 228 / 10%);
  padding: .1em .35em;
  border-radius: 6px;
}

/* The thread that runs down the page. */
.thread {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}
.thread-line {
  fill: none;
  stroke: var(--coral);
  stroke-width: 3;
  stroke-linecap: round;
}
.thread-needle {
  fill: var(--paper);
  stroke: var(--coral);
  stroke-width: 3;
}

main, header, footer { position: relative; z-index: 1; }
main { overflow-x: clip; }

.top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 22px clamp(20px, 5vw, 64px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -.02em;
  text-decoration: none;
}
.top nav { display: flex; gap: clamp(14px, 3vw, 32px); font-weight: 550; }
.top nav a { text-decoration: none; color: var(--ink-soft); white-space: nowrap; }
.top nav a:hover { color: var(--ink); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 24px;
  min-height: calc(100vh - 90px);
  padding: 0 clamp(20px, 5vw, 64px) 60px;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-weight: 600;
  color: var(--ink-soft);
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 5px rgb(22 199 154 / 18%);
}
h1 {
  margin: 0;
  font-size: clamp(3.2rem, 8.4vw, 7.6rem);
  line-height: .92;
  font-weight: 850;
  letter-spacing: -.055em;
  word-spacing: .1em;
}
h1 .line { display: block; overflow: hidden; padding-bottom: .06em; }
h1 .line > span {
  display: inline-block;
  transform: translateY(110%);
  animation: rise .9s var(--ease) forwards;
}
h1 .line:nth-child(2) > span { animation-delay: .1s; }
h1 .line:nth-child(3) > span { animation-delay: .2s; }
h1 .line:nth-child(4) > span { animation-delay: .3s; }
h1 em {
  font-style: normal;
  font-weight: 200;
  color: var(--coral);
  letter-spacing: -.03em;
}
@keyframes rise { to { transform: none; } }

.lede {
  max-width: 36rem;
  margin: 28px 0 0;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--ink-soft);
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 34px; }
.ghost, .solid {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 650;
  text-decoration: none;
}
.ghost {
  border: 1.5px solid var(--line);
  background: rgb(255 255 255 / 60%);
  transition: border-color .2s, transform .2s var(--ease);
}
.ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.solid {
  background: var(--blue);
  color: var(--paper);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.solid:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgb(47 111 228 / 35%); }
a:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 8px; }

/* The phone */
.phone {
  position: relative;
  width: var(--phone-w);
  height: var(--phone-h);
  padding: 10px;
  border-radius: calc(var(--phone-h) * .075);
  background: linear-gradient(145deg, #1d2748, #0b1533 60%);
  box-shadow:
    0 2px 0 1px rgb(255 255 255 / 6%) inset,
    0 40px 80px -20px rgb(11 21 51 / 45%),
    0 18px 30px -18px rgb(11 21 51 / 50%);
}
.screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--phone-h) * .06);
  background: var(--paper);
}
.screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.hero-stage {
  position: relative;
  display: grid;
  place-items: center;
  perspective: 1200px;
  min-height: var(--phone-h);
}
.hero-phone {
  z-index: 1;
  transform: rotateY(-14deg) rotateX(6deg) rotateZ(2deg);
  transition: transform .5s var(--ease);
  animation: arrive 1.1s var(--ease) both .15s;
}
@keyframes arrive {
  from { opacity: 0; translate: 0 60px; }
  to { opacity: 1; translate: 0 0; }
}
.float {
  position: absolute;
  border-radius: 18px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 30px 60px -25px rgb(11 21 51 / 40%);
  animation: arrive 1.1s var(--ease) both .4s;
}
.float-remote { width: min(30vw, 420px); right: -4%; top: 6%; rotate: 5deg; }
.float-term { width: calc(var(--phone-w) * .7); left: -4%; bottom: 4%; rotate: -7deg; aspect-ratio: 9 / 13; }
.float-term img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* Tour: the phone stays, the screens change */
.tour {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 40px clamp(20px, 5vw, 64px);
}
.tour-phone {
  position: sticky;
  top: calc(50vh - var(--phone-h) / 2);
  height: var(--phone-h);
  display: grid;
  place-items: center;
}
#tour-phone { transition: transform .9s var(--ease); }
#tour-phone.sideways { transform: rotate(-90deg) scale(.96); }
#tour-phone .screen img { opacity: 0; transition: opacity .5s; }
#tour-phone .screen img.on { opacity: 1; }
/* Upright again once the frame turns sideways. */
#tour-phone .screen img.landscape {
  inset: auto;
  left: 50%;
  top: 50%;
  width: calc(var(--phone-h) - 20px);
  max-width: none;
  height: calc(var(--phone-w) - 20px);
  translate: -50% -50%;
  rotate: 90deg;
  object-fit: cover;
  object-position: center;
}

.steps { list-style: none; margin: 0; padding: 0; }
.step-shot { display: none; }
.step {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 34rem;
  opacity: .25;
  transition: opacity .5s;
}
.step.on { opacity: 1; }
.step h2, .network h2, .finale h2 {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 4.4vw, 3.8rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.045em;
}
.step p, .network p, .pair p, .finale p {
  margin: 0;
  font-size: 1.15rem;
  color: var(--ink-soft);
}

/* Network */
.network {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  padding: 120px clamp(20px, 5vw, 64px);
}
.network-copy { max-width: 34rem; }
.facts { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 6px; }
.facts li { display: flex; align-items: baseline; gap: 16px; font-size: 1.15rem; color: var(--ink-soft); }
.facts strong {
  min-width: 2ch;
  font-size: 2.6rem;
  font-weight: 200;
  color: var(--coral);
  line-height: 1.1;
}
.mesh { width: 100%; max-width: 560px; justify-self: center; overflow: visible; }
.mesh .links path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.5;
  stroke-dasharray: 2 12;
  stroke-linecap: round;
  animation: flow 1.6s linear infinite;
  animation-play-state: paused;
}
.mesh .links path.faint { stroke: rgb(47 111 228 / 35%); animation-duration: 3s; }
.mesh.live .links path { animation-play-state: running; }
@keyframes flow { to { stroke-dashoffset: -28; } }
.mesh .nodes rect { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.mesh .nodes .base { fill: var(--ink); }
.mesh .nodes .stand { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.mesh .nodes .ui { fill: none; stroke: rgb(47 111 228 / 45%); stroke-width: 4; stroke-linecap: round; }
.mesh .nodes .led { fill: var(--mint); }
.mesh .nodes .me rect { fill: var(--ink); stroke: none; }
.mesh text { font: 600 14px "Inter", sans-serif; fill: var(--ink-soft); text-anchor: middle; }
.mesh text.side { text-anchor: start; }

/* Pair */
.pair {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: clamp(32px, 6vw, 90px);
  overflow: hidden;
  margin: 0 clamp(20px, 5vw, 64px);
  padding: clamp(48px, 8vw, 110px) clamp(24px, 6vw, 90px);
  border-radius: 40px;
  background: var(--blue);
  color: var(--paper);
}
.pair .big {
  margin: 0 0 22px;
  font-size: clamp(2.6rem, 6.6vw, 6rem);
  font-weight: 850;
  line-height: .95;
  letter-spacing: -.055em;
  color: var(--paper);
}
.qr {
  position: relative;
  width: clamp(160px, 20vw, 280px);
  rotate: -6deg;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgb(11 21 51 / 45%);
}
.qr svg { display: block; width: 100%; }
.qr-bg { fill: var(--paper); }
.qr-dots { fill: var(--ink); }
.scan {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--coral);
  box-shadow: 0 0 18px 4px rgb(255 91 58 / 55%);
  animation: scan 2.4s ease-in-out infinite alternate;
  animation-play-state: paused;
}
.qr.live .scan { animation-play-state: running; }
@keyframes scan { to { translate: 0 calc(clamp(160px, 20vw, 280px) - 3px); } }
.pair p:not(.big) { max-width: 40rem; color: rgb(255 255 255 / 85%); }

/* Finale */
.finale {
  padding: 160px clamp(20px, 5vw, 64px) 100px;
  text-align: center;
}
.finale h2 { font-size: clamp(3rem, 9vw, 8rem); letter-spacing: -.06em; }
.finale p { max-width: 34rem; margin: 0 auto; }
.finale .actions { justify-content: center; }
.finale .apk-note { margin-top: 18px; color: var(--ink-soft); }

footer {
  padding: 40px clamp(20px, 5vw, 64px) 50px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}
footer p { margin: 0; }
.fine { font-size: .85rem; }

@media (max-width: 900px) {
  :root { --phone-h: min(70vh, 560px); }
  .hero, .network, .pair { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 30px; gap: 60px; }
  .float-remote { width: 52vw; right: -6%; }
  .tour { grid-template-columns: 1fr; gap: 0; }
  .tour-phone { display: none; }
  .step { min-height: auto; padding: 48px 0; opacity: 1; }
  .step-shot {
    display: block;
    width: min(280px, 76vw);
    height: auto;
    margin: 0 auto 32px;
    border: 8px solid var(--ink);
    border-radius: 32px;
    box-shadow: 0 30px 60px -25px rgb(11 21 51 / 45%);
  }
  .step-shot.wide { width: 100%; border-radius: 20px; }
  .top nav a:first-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  h1 .line > span { transform: none; }
  .hero-phone { transform: none; }
}
