:root {
  --bg: #08070d;
  --ink: #f2f0fa;
  --muted: #a19db8;
  --line: rgb(255 255 255 / 9%);
  --card: rgb(255 255 255 / 4%);
  --violet: #7b6dff;
  --cyan: #3ee0d0;
  --amber: #ffc857;
  --pink: #ff5fa2;
  --board: #1f3b31;
  --radius: 22px;
}

@property --scan {
  syntax: '<percentage>';
  inherits: true;
  initial-value: 0%;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 Inter, system-ui, sans-serif;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 0 18px;
}

h1 {
  font-size: clamp(38px, 5vw, 68px);
  font-weight: 900;
}

h2 {
  font-size: clamp(30px, 4.2vw, 52px);
  font-weight: 800;
  text-align: center;
}

h3 {
  font-size: 24px;
}

/* ---------- ambient background ---------- */
.aurora {
  position: fixed;
  inset: -20vmax;
  z-index: -2;
  filter: blur(80px) saturate(140%);
  opacity: 0.55;
}

.aurora span {
  position: absolute;
  width: 50vmax;
  height: 50vmax;
  border-radius: 50%;
  animation: drift 26s ease-in-out infinite alternate;
}

.aurora span:nth-child(1) {
  background: radial-gradient(circle, var(--violet), transparent 65%);
  top: 0;
  left: 10%;
}

.aurora span:nth-child(2) {
  background: radial-gradient(circle, var(--cyan), transparent 65%);
  top: 30%;
  right: 0;
  animation-duration: 32s;
  opacity: 0.6;
}

.aurora span:nth-child(3) {
  background: radial-gradient(circle, var(--pink), transparent 65%);
  bottom: 0;
  left: 30%;
  animation-duration: 38s;
  opacity: 0.45;
}

@keyframes drift {
  to {
    transform: translate(12vmax, -8vmax) scale(1.2);
  }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  backdrop-filter: blur(14px);
  background: rgb(8 7 13 / 55%);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.nav nav {
  display: flex;
  gap: 26px;
  color: var(--muted);
  font-size: 14px;
}

.nav nav a:hover {
  color: var(--ink);
}

/* ---------- buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--violet), #a35cff 50%, var(--pink));
  box-shadow:
    0 10px 30px -8px rgb(123 109 255 / 60%),
    inset 0 1px 0 rgb(255 255 255 / 25%);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 40px -8px rgb(123 109 255 / 75%),
    inset 0 1px 0 rgb(255 255 255 / 25%);
}

.btn-ghost {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn-small {
  padding: 9px 16px;
  font-size: 14px;
  border-radius: 11px;
}

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(48px, 9vh, 110px) clamp(16px, 4vw, 48px) 60px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 22px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

.scribble {
  position: relative;
  white-space: nowrap;
  background: linear-gradient(90deg, var(--cyan), var(--violet) 60%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.scribble::after {
  content: '';
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: -0.08em;
  height: 0.22em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 20' preserveAspectRatio='none'%3E%3Cpath d='M2 14 C 80 4, 160 4, 298 10' fill='none' stroke='%23ffc857' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat center / 100% 100%;
}

.lede {
  color: var(--muted);
  font-size: clamp(17px, 1.5vw, 20px);
  max-width: 560px;
}

.lede.center {
  margin: 0 auto 40px;
  text-align: center;
  max-width: 720px;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0 14px;
}

.fine {
  color: var(--muted);
  font-size: 13px;
  opacity: 0.8;
}

/* ---------- the board animation ---------- */
.board-stage {
  perspective: 1400px;
}

.board {
  position: relative;
  aspect-ratio: 600 / 380;
  border-radius: var(--radius);
  overflow: hidden;
  transform: rotateY(-9deg) rotateX(5deg);
  transform-style: preserve-3d;
  box-shadow:
    0 50px 100px -30px rgb(0 0 0 / 80%),
    0 0 0 1px var(--line),
    0 0 80px -20px rgb(123 109 255 / 50%);
  animation: scan 9s cubic-bezier(0.65, 0, 0.35, 1) infinite;
  transition: transform 0.6s ease;
}

.board-stage:hover .board {
  transform: rotateY(0) rotateX(0);
}

@keyframes scan {
  0%,
  12% {
    --scan: 0%;
  }
  45%,
  80% {
    --scan: 100%;
  }
  95%,
  100% {
    --scan: 0%;
  }
}

.layer {
  position: absolute;
  inset: 0;
}

.photo {
  background:
    radial-gradient(120% 90% at 30% 20%, #2c5244, transparent 70%),
    linear-gradient(160deg, #234237, var(--board));
}

.photo::after {
  /* smudges + vignette: it's a photo of a real board */
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(40% 30% at 70% 70%, rgb(255 255 255 / 6%), transparent),
    radial-gradient(120% 120% at 50% 50%, transparent 55%, rgb(0 0 0 / 55%));
}

.chalk {
  width: 100%;
  height: 100%;
}

.hand {
  font-family: Caveat, cursive;
  font-size: 34px;
  fill: #f3efe2;
  stroke: none;
}

.hand-xl {
  font-size: 46px;
  font-weight: 700;
}

.hand-sm {
  font-size: 27px;
}

.digital {
  background:
    radial-gradient(circle at 1px 1px, rgb(0 0 0 / 9%) 1px, transparent 0) 0 0 / 22px 22px,
    #fbfbfd;
  color: #1d1d1f;
  clip-path: inset(0 calc(100% - var(--scan)) 0 0);
  font-family: Inter, sans-serif;
}

.el {
  position: absolute;
  white-space: nowrap;
}

.el i {
  /* tldraw-style selection outline */
  position: absolute;
  inset: -5px -7px;
  border: 1.5px solid #4465e9;
  border-radius: 3px;
  opacity: 0;
  animation: select 9s infinite;
}

.el:nth-child(odd) i {
  animation-delay: 0.25s;
}

@keyframes select {
  0%,
  46% {
    opacity: 0;
  }
  52%,
  72% {
    opacity: 1;
  }
  80%,
  100% {
    opacity: 0;
  }
}

.t-xl {
  font-size: clamp(16px, 2.6vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.t-math {
  font-family: 'Times New Roman', serif;
  font-size: clamp(14px, 2.1vw, 25px);
}

.t-math em {
  font-style: italic;
}

.t-sm {
  font-size: clamp(11px, 1.4vw, 16px);
  font-weight: 600;
}

.blue {
  color: #4465e9;
}

.green {
  color: #099268;
}

.frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  font-size: 0.85em;
}

.frac span:first-child {
  border-bottom: 1.5px solid currentColor;
  padding: 0 4px;
}

.box {
  border: 2.5px solid #e03131;
  border-radius: 8px;
}

.arrow {
  height: 2.5px;
  background: #099268;
}

.arrow::after {
  content: '';
  position: absolute;
  right: -2px;
  top: -6px;
  border: 7px solid transparent;
  border-left: 12px solid #099268;
  border-right: 0;
}

.curve {
  inset: 0;
  width: 100%;
  height: 100%;
}

.curve path {
  fill: none;
  stroke: #ae3ec9;
  stroke-width: 3.5;
  stroke-linecap: round;
}

.cursor {
  position: absolute;
  display: flex;
  align-items: flex-start;
  gap: 2px;
  animation: cursor 9s ease-in-out infinite;
}

.cursor span {
  margin-top: 16px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--violet);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

@keyframes cursor {
  0%,
  45% {
    left: 20%;
    top: 30%;
  }
  60% {
    left: 18%;
    top: 46%;
  }
  75% {
    left: 66%;
    top: 58%;
  }
  100% {
    left: 20%;
    top: 30%;
  }
}

.scanline {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--scan);
  width: 3px;
  margin-left: -1.5px;
  background: linear-gradient(var(--cyan), var(--violet));
  box-shadow:
    0 0 24px 6px rgb(62 224 208 / 55%),
    0 0 80px 20px rgb(123 109 255 / 35%);
}

.board-caption {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.tag {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
}

.tag-live {
  color: var(--cyan);
}

.arrow-mini {
  color: var(--muted);
}

/* ---------- sections ---------- */
.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(70px, 12vh, 130px) clamp(16px, 4vw, 48px);
}

.grad {
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.card {
  position: relative;
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgb(255 255 255 / 6%), rgb(255 255 255 / 2%));
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgb(123 109 255 / 70%), transparent 40%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card p {
  color: var(--muted);
}

.card code {
  display: inline-block;
  margin-top: 6px;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgb(0 0 0 / 35%);
  color: var(--cyan);
  font: 12px 'JetBrains Mono', monospace;
}

.step-n {
  font: 600 13px 'JetBrains Mono', monospace;
  color: var(--amber);
  margin-bottom: 18px;
}

.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}

.split h2 {
  text-align: left;
}

.ticks {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  gap: 12px;
}

.ticks li::before {
  content: '✓';
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 12px;
  border-radius: 50%;
  background: rgb(62 224 208 / 15%);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

/* ---------- phone ---------- */
.phone {
  justify-self: center;
  width: min(360px, 100%);
  padding: 18px;
  border-radius: 38px;
  background: linear-gradient(160deg, #1a1a26, #101018);
  border: 1px solid var(--line);
  box-shadow:
    0 40px 80px -30px rgb(0 0 0 / 90%),
    0 0 60px -20px rgb(62 224 208 / 40%);
  transform: rotate(3deg);
}

.phone-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 8px 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.phone-top small {
  color: var(--muted);
}

.bubble {
  position: relative;
  padding: 14px 16px 22px;
  border-radius: 18px 18px 18px 4px;
  background: #222233;
  font-size: 14px;
  line-height: 1.5;
}

.bubble p {
  margin: 0 0 10px;
}

.bubble a {
  color: var(--cyan);
  font-weight: 600;
}

.bubble time {
  position: absolute;
  right: 12px;
  bottom: 6px;
  font-size: 11px;
  color: var(--muted);
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  color: var(--amber);
}

.typing {
  display: inline-flex;
  gap: 5px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #222233;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: bounce 1.2s infinite;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes bounce {
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
  0%,
  60%,
  100% {
    opacity: 0.4;
  }
}

/* ---------- autopilot ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 50px;
}

.stats div {
  padding: 22px;
  text-align: center;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
}

.stats b {
  display: block;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, #fff, #9c96c9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stats span {
  color: var(--muted);
  font-size: 14px;
}

.timeline {
  position: relative;
  list-style: none;
  margin: 0 auto;
  padding: 0 0 0 34px;
  max-width: 820px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--violet), var(--cyan), transparent);
}

.timeline li {
  position: relative;
  margin-bottom: 18px;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
}

.timeline li::before {
  content: '';
  position: absolute;
  left: -31px;
  top: 24px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--violet);
}

.timeline li.release::before {
  border-color: var(--amber);
  box-shadow: 0 0 14px var(--amber);
}

.timeline .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font: 12px 'JetBrains Mono', monospace;
  color: var(--muted);
}

.pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgb(123 109 255 / 18%);
  color: #c7c0ff;
}

.pill.merged {
  background: rgb(62 224 208 / 14%);
  color: var(--cyan);
}

.pill.rel {
  background: rgb(255 200 87 / 16%);
  color: var(--amber);
}

.timeline h4 {
  margin: 0 0 4px;
  font-size: 17px;
}

.timeline p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.muted {
  color: var(--muted);
}

.stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.stack span {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 14px;
}

.final {
  text-align: center;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 30px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

/* ---------- scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.8s ease,
    transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero,
  .split,
  .steps {
    grid-template-columns: 1fr;
  }

  .nav nav {
    display: none;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .board {
    transform: none;
  }

  .split h2 {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .board {
    --scan: 55%;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
