/* Tokens from the app's brand sheet (docs/BRAND.md in the app's repository). Dark is the
   default, as in the app; a visitor who asks for light gets the same roles in light (the
   mark's file follows the same preference by itself). */
:root {
  --bg: #1B1E22;
  --panel: #22262B;
  --border: #383E45;
  --text: #E9EDF0;
  --text-2: #A9B2BA;
  --muted: #77818A;
  --accent: #A8BEC9;
  --accent-strong: #B1C6D2;
  --arrive: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #F4F6F7;
    --panel: #FEFEFE;
    --border: #D9DFE3;
    --text: #2B2F34;
    --text-2: #52565D;
    --muted: #8A939B;
    --accent: #5C8296;
    --accent-strong: #43687C;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.55 Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
h1, h2, p { margin: 0; }

.wrap {
  width: 100%;
  max-width: 1168px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ------------------------------------------------------------------ top bar */
.top {
  position: fixed;
  z-index: 10;
  inset: 0 0 auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1168px;
  margin: 0 auto;
  padding: 16px 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand img { display: block; }
.toplink {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(8px);
  color: var(--text-2);
  font-size: 15px;
  text-decoration: none;
  transition: color 160ms, border-color 160ms;
}
.toplink:hover { color: var(--text); border-color: var(--muted); }

/* ------------------------------------------------------------------ the scene */
.scene { height: 440vh; }
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
/* The air the trail moves through: faint rows on the mark's rhythm. */
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 30% 45%, rgba(168, 190, 201, 0.10), transparent 70%),
    repeating-linear-gradient(to bottom, transparent 0 37px, rgba(168, 190, 201, 0.035) 37px 38px);
  pointer-events: none;
}

.hero {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 40px;
  padding-top: 64px;
}
.mark-box {
  justify-self: center;
  width: min(100%, 62vh, 440px);
  aspect-ratio: 1;
  will-change: transform, opacity;
}
/* The mark's file holds the K and its trail; here the trail is cut away, row by row, because
   on this page the trail is alive (the reels). */
.k {
  display: block;
  width: 100%;
  height: 100%;
  clip-path: polygon(27.9% 0, 100% 0, 100% 100%, 39.72% 100%, 39.72% 72.34%, 35.22% 72.34%, 35.22% 63.36%, 39.72% 63.36%, 39.72% 54.61%, 30.5% 54.61%, 30.5% 45.63%, 23.4% 45.63%, 23.4% 36.64%, 33.57% 36.64%, 33.57% 27.66%, 27.9% 27.66%);
  animation: arrive 700ms var(--arrive) both;
}
.pitch { will-change: transform, opacity; }
h1 {
  margin-bottom: 20px;
  font-size: clamp(34px, 5.2vw, 64px);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.lede {
  max-width: 54ch;
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--text-2);
  text-wrap: pretty;
}
.cue {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.02em;
}
.cue-bar {
  width: 44px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--accent));
  animation: streak 1.6s var(--arrive) infinite;
}

/* The reels: the mark's trail, each a small screen. Placed by the script. */
.reels { position: absolute; inset: 0; pointer-events: none; }
.reel {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  background: var(--accent);
  will-change: transform, width, height;
  contain: strict;
}
.reel canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* In the mark a reel is still a piece of the trail: mist, with its film showing through. */
.reel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #A8BEC9;
  opacity: var(--veil, 0);
}
.reel b {
  position: absolute;
  left: 10px;
  bottom: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(27, 30, 34, 0.72);
  color: var(--text);
  font: 500 11px/1.6 "JetBrains Mono", ui-monospace, Consolas, monospace;
  letter-spacing: 0.04em;
}
.playhead {
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  border-radius: 1px;
  background: var(--accent-strong);
  box-shadow: 0 0 0 1px rgba(27, 30, 34, 0.6);
  opacity: 0;
  pointer-events: none;
}

.caps { position: absolute; inset: auto 0 0 0; height: 0; }
.cap {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 40px;
  max-width: 640px;
  opacity: 0;
  will-change: transform, opacity;
}
.cap h2 {
  margin-bottom: 10px;
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.cap p { color: var(--text-2); font-size: clamp(15px, 1.5vw, 18px); text-wrap: pretty; }

/* ------------------------------------------------------------------ after the scene */
.points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  padding-top: 96px;
  padding-bottom: 96px;
  border-top: 1px solid var(--border);
}
.points h2 { margin-bottom: 8px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.points p { font-size: 16px; color: var(--text-2); }

.download {
  padding-top: 88px;
  padding-bottom: 120px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.download h2 {
  margin-bottom: 24px;
  font-size: clamp(40px, 7vw, 84px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.035em;
}
.state {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px 12px 18px;
  border: 1px dashed var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text-2);
  font-size: 16px;
}
/* A draft: a hollow dot, as in the app. */
.dot { width: 10px; height: 10px; flex: none; border: 1.5px solid var(--muted); border-radius: 50%; }
.fine { margin-top: 16px; color: var(--muted); font-size: 14px; }

footer {
  padding-top: 20px;
  padding-bottom: 28px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

/* Arrive fast from the left, stop clean. */
.rise { opacity: 0; transform: translateX(-12px); transition: opacity 420ms var(--arrive), transform 420ms var(--arrive); }
.rise.in { opacity: 1; transform: none; }
.points .rise:nth-child(2) { transition-delay: 60ms; }
.points .rise:nth-child(3) { transition-delay: 120ms; }

@keyframes arrive {
  from { opacity: 0; transform: translateX(-120%); }
  to { opacity: 1; transform: none; }
}
@keyframes streak {
  0% { transform: translateX(-16px); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateX(16px); opacity: 0; }
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; align-content: center; gap: 8px; padding-top: 72px; }
  .mark-box { justify-self: start; width: min(56vw, 34vh, 260px); margin-left: -4%; }
  .points { grid-template-columns: 1fr; gap: 28px; padding-top: 64px; padding-bottom: 64px; }
  .cap { bottom: 28px; }
}

.frozen .k, .frozen .cue-bar { animation: none; }
.frozen .rise { transition: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .k, .cue-bar { animation: none; }
  .rise { opacity: 1; transform: none; transition: none; }
}
