@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-var.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --brand: #3730A3;
  --brand-deep: #1E1B4B;
  --tint: #A5B4FC;
  --signal: #0F766E;
  --node: #5EEAD4;
  --on-brand: #FFFFFF;
  --ink: #111827;
  --ink-muted: #4B5563;
  --surface: #FFFFFF;
  --surface-alt: #F5F6FB;
  --line: #E2E4F0;
  --flag-bg: #EEF0FF;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --wrap: 1120px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #4F46E5;
    --signal: #5EEAD4;
    --ink: #F3F4FB;
    --ink-muted: #A3A8C3;
    --surface: #0E0D1F;
    --surface-alt: #17163A;
    --line: #2A2857;
    --flag-bg: #24215A;
  }
  .logo-light { display: none; }
  .logo-dark { display: block; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
}
mark { background: none; color: inherit; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--tint); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--on-brand); padding: 8px 14px; border-radius: var(--radius-sm); z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 72px; }
.brand-link { display: block; text-decoration: none; }
.brand-link img { height: 32px; width: auto; }
.logo-dark { display: none; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { text-decoration: none; font-size: 15px; font-weight: 600; color: var(--ink-muted); }
.nav a:hover { color: var(--ink); }
@media (max-width: 760px) { .nav .nav-link { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: var(--radius-md);
  font-weight: 700; font-size: 15px; text-decoration: none; border: 2px solid transparent;
}
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-deep); }
.btn-quiet { border-color: var(--line); color: var(--ink); }
.btn-quiet:hover { border-color: var(--ink-muted); }
.btn-light { background: var(--on-brand); color: var(--brand-deep); }
.btn-light:hover { background: var(--tint); }

/* Hero */
.hero { padding: 72px 0 88px; }
.hero .wrap { display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center; }
h1 { font-size: clamp(36px, 5.2vw, 56px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 800; margin: 0 0 20px; }
h1 .quiet { color: var(--ink-muted); }
.lede { font-size: 19px; color: var(--ink-muted); max-width: 34em; margin: 0 0 32px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.fine { margin-top: 16px; font-size: 14px; color: var(--ink-muted); }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; gap: 40px; } .hero { padding: 48px 0 64px; } }

/* Transformation panel */
.flow { display: grid; grid-template-columns: 1fr; gap: 0; }
.sheet {
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  padding: 20px 22px;
}
.sheet-notes { background: var(--surface-alt); transform: rotate(-1.2deg); margin: 0 28px 0 0; }
.sheet-spec { margin: -14px 0 0 28px; position: relative; box-shadow: 0 18px 40px -24px rgba(17,24,39,.35); }
.sheet-label { font-size: 13px; font-weight: 700; color: var(--ink-muted); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.sheet-label .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--node); }
.notes { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--ink-muted); }
.notes s { text-decoration-thickness: 1px; }
.spec { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14.5px; }
.spec dt { color: var(--ink-muted); }
.spec dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.flags { margin: 14px 0 0; padding: 12px 14px; list-style: none; background: var(--flag-bg); border-radius: var(--radius-md); font-size: 14px; }
.flags li { display: flex; gap: 10px; align-items: baseline; }
.flags li + li { margin-top: 4px; }
.flags b { color: var(--brand); font-weight: 800; }
@media (prefers-color-scheme: dark) { .flags b { color: var(--tint); } .sheet-spec { box-shadow: none; } }
@media (max-width: 480px) { .sheet-notes, .sheet-spec { margin-left: 0; margin-right: 0; transform: none; } .sheet-spec { margin-top: 12px; } }

/* Sections */
.section { padding: 88px 0; border-top: 1px solid var(--line); }
.section-alt { background: var(--surface-alt); }
h2 { font-size: clamp(28px, 3.4vw, 38px); line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; margin: 0 0 16px; max-width: 22em; }
.intro { color: var(--ink-muted); max-width: 40em; margin: 0 0 48px; font-size: 18px; }
h3 { font-size: 18px; line-height: 1.35; font-weight: 700; margin: 0 0 6px; }

.contents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; margin: 0; }
.contents > div { padding: 22px 0; border-top: 1px solid var(--line); }
.contents dt { font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.contents dd { margin: 0; color: var(--ink-muted); }
@media (max-width: 760px) { .contents { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 32px; } }
.prose p { margin: 0 0 16px; color: var(--ink-muted); }
.prose p strong { color: var(--ink); }
.status { display: inline-block; font-size: 13px; font-weight: 700; color: var(--signal); border: 1px solid currentColor; border-radius: 999px; padding: 2px 12px; margin-bottom: 16px; }

pre.code {
  margin: 0; background: var(--brand-deep); color: #E7E9FB; border-radius: var(--radius-lg);
  padding: 22px 24px; overflow-x: auto; font-family: var(--mono); font-size: 14px; line-height: 1.7;
}
pre.code .c { color: var(--tint); }
pre.code .f { color: var(--node); }
.code-caption { font-size: 14px; color: var(--ink-muted); margin: 10px 0 0; }

.promises { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.promises li { padding: 18px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 24px 1fr; gap: 14px; }
.promises li:last-child { border-bottom: 1px solid var(--line); }
.tick { width: 22px; height: 22px; margin-top: 2px; }
.promises strong { display: block; }
.promises span { color: var(--ink-muted); }

/* Early access band */
.cta { background: var(--brand-deep); color: var(--on-brand); padding: 88px 0; }
.cta h2 { color: var(--on-brand); }
.cta p { color: var(--tint); max-width: 36em; margin: 0 0 32px; font-size: 18px; }
.cta .mail { color: var(--on-brand); font-weight: 600; }

/* Footer */
.site-footer { padding: 40px 0 48px; font-size: 14px; color: var(--ink-muted); }
.site-footer .wrap { display: grid; gap: 16px; }
.foot-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
.foot-links { display: flex; flex-wrap: wrap; gap: 20px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.legal { margin: 0; max-width: 60em; }

/* Plain document pages */
.doc { padding: 64px 0 88px; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: 40px; }
.doc h2 { font-size: 24px; margin-top: 40px; }
.doc p, .doc li { color: var(--ink-muted); }
.cta .fine { color: var(--tint); }
.nav a.btn-primary { color: var(--on-brand); }
.nav a.btn-primary:hover { color: var(--on-brand); }
.btn { white-space: nowrap; }
@media (max-width: 480px) { .site-header .btn { padding: 0 12px; font-size: 14px; } .brand-link img { height: 28px; } }
@media (prefers-color-scheme: dark) { .logo-light { display: none; } .logo-dark { display: block; } }

/* Hero: an analyst marking up the notes, the spec filling in as they go */
.notes mark {
  color: inherit; padding: 0 2px; margin: 0 -2px; border-radius: 3px;
  background: linear-gradient(rgba(94,234,212,.38), rgba(94,234,212,.38)) no-repeat 0 88% / 100% 58%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.notes mark.gap {
  background-image: linear-gradient(rgba(165,180,252,.45), rgba(165,180,252,.45));
  text-decoration: underline wavy rgba(99,102,241,.7) 1px; text-underline-offset: 4px;
}
@media (prefers-color-scheme: dark) {
  .notes mark { background-image: linear-gradient(rgba(94,234,212,.22), rgba(94,234,212,.22)); color: var(--ink); }
  .notes mark.gap { background-image: linear-gradient(rgba(165,180,252,.25), rgba(165,180,252,.25)); text-decoration-color: rgba(165,180,252,.8); }
}

@media (prefers-reduced-motion: no-preference) {
  .sheet-notes { animation: settle 1.1s cubic-bezier(.2,.7,.2,1) both; }
  .sheet-spec { animation: rise .9s .25s cubic-bezier(.2,.7,.2,1) both; }
  .notes mark { background-size: 0% 58%; animation: ink .6s cubic-bezier(.4,.1,.3,1) forwards; }
  .notes mark.gap { text-decoration-color: transparent; animation: ink .6s cubic-bezier(.4,.1,.3,1) forwards, wave .4s ease-out forwards; }
  .row { opacity: 0; animation: fill .5s ease-out forwards; }
  .sheet-label .dot { animation: breathe 3.6s ease-in-out 4.4s infinite; }

  .notes mark.d1 { animation-delay: .9s; }   .r1  { animation-delay: 1.25s; }
  .notes mark.d2 { animation-delay: 1.45s; } .r2  { animation-delay: 1.8s; } .r2b { animation-delay: 1.95s; }
  .notes mark.d3 { animation-delay: 2.0s; }  .r3  { animation-delay: 2.35s; }
  .notes mark.d4 { animation-delay: 2.5s; }
  .notes mark.d5 { animation-delay: 2.75s; } .r5  { animation-delay: 3.1s; }
  .notes mark.gap.d6 { animation-delay: 3.35s, 3.75s; } .r6 { animation-delay: 3.7s; }
  .notes mark.gap.d7 { animation-delay: 3.85s, 4.25s; } .r7 { animation-delay: 4.2s; }
  .flags li.row { animation-duration: .45s; }
}

@keyframes settle { from { opacity: 0; transform: rotate(-3.4deg) translate(-6px, 10px); } to { opacity: 1; transform: rotate(-1.2deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ink { to { background-size: 100% 58%; } }
@keyframes wave { to { text-decoration-color: rgba(99,102,241,.7); } }
@keyframes fill { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(94,234,212,.0); } 50% { box-shadow: 0 0 0 5px rgba(94,234,212,.22); } }

/* ===== Hero v3: the story stage ===== */
.hero { padding: 64px 0 72px; }
.hero .wrap { display: block; }
.hero-copy { max-width: 780px; margin-bottom: 48px; }
.hero h1 { font-size: clamp(36px, 5vw, 60px); }
.stage-note { margin-top: 20px; }

.stage {
  display: grid; grid-template-columns: minmax(0, 1fr) 200px minmax(0, 1fr);
  height: 440px; align-items: center;
}
.stage-notes { transform: rotate(-1.2deg); padding: 22px 24px; background: var(--surface-alt); }
.stage-notes .notes { font-size: 15px; }
.sheet-label .meta { font-weight: 500; color: var(--ink-muted); opacity: .8; }

.engine { position: relative; height: 440px; }
.engine-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.track { fill: none; stroke: var(--line); stroke-width: 2; vector-effect: non-scaling-stroke; }
.flow { fill: none; stroke: var(--brand); stroke-width: 2; stroke-dasharray: 4 12; vector-effect: non-scaling-stroke; opacity: .9; }
.particle { fill: var(--node); }
.mk-bg { fill: var(--brand); }
.mk-line { stroke: #FFFFFF; stroke-width: 6; stroke-linecap: round; }
.mk-node { fill: var(--node); transform-box: fill-box; transform-origin: center; }
.session-chip {
  position: absolute; left: 50%; top: 296px; transform: translateX(-50%);
  font-size: 12px; line-height: 1.35; font-weight: 700; text-align: center; text-decoration: none;
  color: var(--signal); border: 1px solid currentColor; border-radius: 999px; padding: 6px 12px; background: var(--surface);
  white-space: nowrap;
}
.session-chip:hover { background: var(--surface-alt); }

.outputs { display: grid; grid-template-rows: repeat(3, 1fr); gap: 16px; height: 440px; }
.out {
  display: flex; flex-direction: column; gap: 4px; justify-content: center;
  padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); text-decoration: none; color: var(--ink);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.out:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 14px 30px -22px rgba(55,48,163,.6); }
.out-title { font-weight: 800; font-size: 16px; display: flex; justify-content: space-between; align-items: center; }
.arrow { color: var(--brand); transition: transform .2s ease; }
.out:hover .arrow { transform: translateX(3px); }
.out-line { font-size: 13.5px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.out-line span { color: var(--ink); font-weight: 600; margin-right: 6px; }
.out-code { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--ink); background: var(--surface-alt); border-radius: var(--radius-sm); padding: 6px 10px; margin: 2px 0; white-space: nowrap; overflow: hidden; }
.out-code i { font-style: normal; color: var(--ink-muted); }
.chip { align-self: flex-start; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--signal); background: transparent; border: 1px solid currentColor; border-radius: 999px; padding: 1px 10px; }
.chip-gap { color: var(--brand); background: var(--flag-bg); border-color: transparent; }
@media (prefers-color-scheme: dark) {
  .flow { stroke: var(--tint); }
  .arrow, .chip-gap { color: var(--tint); }
  .out:hover { border-color: var(--tint); box-shadow: none; }
}

/* Motion: continuous flow, a living mark, outputs landing in turn */
@media (prefers-reduced-motion: no-preference) {
  .flow { animation: flow 1.1s linear infinite; }
  .mk-line { stroke-dasharray: 32; animation: write 5s ease-in-out infinite; }
  .mk-line.l2 { animation-delay: .25s; }
  .mk-line.l3 { animation-delay: .5s; }
  .mk-node { animation: pop 5s ease-in-out infinite .75s; }
  .stage-notes { animation: settle 1s cubic-bezier(.2,.7,.2,1) both; }
  .out { opacity: 0; animation: land .7s cubic-bezier(.2,.7,.2,1) forwards; }
  .o1 { animation-delay: 1.2s; } .o2 { animation-delay: 1.5s; } .o3 { animation-delay: 1.8s; }
  .notes mark.d1 { animation-delay: .5s; }
  .notes mark.d2 { animation-delay: .8s; }
  .notes mark.d3 { animation-delay: 1.1s; }
  .notes mark.d4 { animation-delay: 1.35s; }
  .notes mark.d5 { animation-delay: 1.55s; }
  .notes mark.gap.d6 { animation-delay: 1.8s, 2.2s; }
  .notes mark.gap.d7 { animation-delay: 2.1s, 2.5s; }
}
@media (prefers-reduced-motion: reduce) { .particle { display: none; } }

@keyframes flow { to { stroke-dashoffset: -16; } }
@keyframes write { 0% { stroke-dashoffset: 32; } 18%, 82% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -32; } }
@keyframes pop { 0%, 12% { transform: scale(0); } 22% { transform: scale(1.25); } 30%, 82% { transform: scale(1); } 95%, 100% { transform: scale(0); } }
@keyframes land { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }

/* Tablet and phone: the story runs top to bottom */
@media (max-width: 980px) {
  .stage { grid-template-columns: minmax(0, 1fr); height: auto; gap: 0; }
  .stage-notes { transform: none; }
  .engine { height: 150px; }
  .engine-svg { display: none; }
  .engine::before {
    content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-1px);
    background: repeating-linear-gradient(to bottom, var(--brand) 0 4px, transparent 4px 16px);
  }
  .engine::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; transform: translate(-50%, -50%);
    background: url("/favicon.svg") center / contain no-repeat;
  }
  .session-chip { top: auto; bottom: 8px; left: calc(50% + 48px); transform: none; }
  .outputs { height: auto; grid-template-rows: none; }
  .out { min-height: 120px; }
  @media (prefers-reduced-motion: no-preference) { .engine::before { animation: drip 1.1s linear infinite; } }
}
@keyframes drip { from { background-position: 0 0; } to { background-position: 0 16px; } }
.outputs, .out { min-width: 0; }
.split > *, .contents > div { min-width: 0; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 981px) {
  .hero { padding-top: 48px; }
  .hero-copy { margin-bottom: 36px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px 48px; max-width: none; align-items: end; }
  .hero-copy h1 { grid-column: 1 / -1; font-size: clamp(36px, 4.4vw, 54px); margin-bottom: 0; }
  .hero-copy .lede { margin: 0; font-size: 18px; }
  .hero-copy .actions { justify-content: flex-end; }
}
