/*
 * Vela — marketing site.
 *
 * Minimal on purpose: one typeface, one accent, hairlines, a lot of air. The
 * colour comes from the library itself and the feeling from motion — loose
 * screenshots gathering into an ordered wall as you scroll.
 *
 * Two themes, switched by [data-theme] on <html> (set before first paint by
 * the inline script in the head). The app window is dark in both, as the
 * product is. The brand gradient appears only in the logo and the primary
 * button.
 */

/* Geist, served from this site. It used to come from Google Fonts, which
   hands every visitor's IP address to Google; the files are the same ones,
   under the SIL Open Font License (fonts/LICENSE.txt). */
@font-face { font-family: "Geist"; src: url("fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --ground: #f4f5f7;
  --paper: #ffffff;
  --ink: #0b1020;
  --ink-2: #535a70;
  --ink-3: rgb(11 16 32 / 0.16);
  --line: rgb(11 16 32 / 0.12);
  --signal: #3d6bff;
  --mark-1: rgb(61 107 255 / 0.2);
  --mark-2: rgb(139 124 255 / 0.3);
  --app-ring: rgb(11 16 32 / 0.9);
  --app-shadow: 0 40px 80px -40px rgb(11 16 32 / 0.5);
  --float-shadow: rgb(11 16 32 / 0.34);

  --blue: #3d6bff;
  --violet: #8b7cff;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --gutter: 28px;
  --header-h: 64px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ground: #060708;
  --paper: #0c0d0f;
  --ink: #edeef0;
  --ink-2: #8e919b;
  --ink-3: rgb(255 255 255 / 0.16);
  --line: rgb(255 255 255 / 0.1);
  --signal: #7393ff;
  --mark-1: rgb(115 147 255 / 0.3);
  --mark-2: rgb(139 124 255 / 0.4);
  --app-ring: rgb(255 255 255 / 0.1);
  --app-shadow: 0 40px 80px -40px rgb(0 0 0 / 0.9);
  --float-shadow: rgb(0 0 0 / 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--mark-2); }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 8px 12px; background: var(--ink); color: var(--ground); border-radius: 6px; }
.skip:focus { left: 8px; }

/* The theme switch: the new theme opens as a circle from the button. */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }

/* ── Layout and type ────────────────────────────────────────────────── */

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
.wrap--wide { max-width: 1400px; }

.label { font-family: var(--mono); font-size: 11px; line-height: 1.4; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }

.h2 { font-size: clamp(38px, 6vw, 84px); line-height: 0.98; letter-spacing: -0.045em; font-weight: 500; max-width: 12em; text-wrap: balance; }
.h3 { font-size: clamp(30px, 3.7vw, 52px); line-height: 1.02; letter-spacing: -0.04em; font-weight: 500; text-wrap: balance; }
.lede { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.5; color: var(--ink-2); max-width: 30em; text-wrap: pretty; }

/* Headings split into words by JS rise out of a mask, one after another. */
.word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.word > span { display: inline-block; transform: translateY(105%); transition: transform 900ms var(--ease); transition-delay: calc(var(--i, 0) * 55ms); }
.is-in .word > span { transform: none; }

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 800ms ease, transform 900ms var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ── Buttons ────────────────────────────────────────────────────────── */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding-inline: 15px; border-radius: 8px; font-size: 14px; font-weight: 500; white-space: nowrap; transition: filter 160ms ease, color 160ms ease, transform 160ms ease; }
.btn--lg { height: 52px; padding-inline: 24px; font-size: 16px; border-radius: 10px; }
.btn--primary { background-image: linear-gradient(180deg, var(--violet) 0%, var(--blue) 100%); color: #fff; box-shadow: inset 0 1px 0 0 rgb(255 255 255 / 0.22); }
.btn--primary:hover { filter: brightness(1.1); }
.btn--primary:active { transform: scale(0.98); }
.btn--text { padding-inline: 12px; color: var(--ink-2); }
.btn--text:hover { color: var(--ink); }
.btn__arrow { display: inline-block; transition: transform 240ms var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn:hover .btn__arrow--down { transform: translateY(4px); }

/* ── Header ─────────────────────────────────────────────────────────── */

/* At the top of the page the bar is part of the page: no surface, full
   width. Once the page scrolls it lifts off into a floating pill of frosted
   glass. The header keeps its height either way (10 + 54 = 64), so nothing
   below it moves when it changes. Blur is the marketing site's alone; the
   app itself stays flat. */
.site-header { position: sticky; top: 0; z-index: 50; padding-top: 0; pointer-events: none; transition: padding-top 450ms var(--ease); }
.site-header__row {
  display: flex; align-items: center; gap: 36px;
  height: var(--header-h);
  border-radius: 999px;
  pointer-events: auto;
  transition: max-width 550ms var(--ease), height 450ms var(--ease), padding 450ms var(--ease), background-color 300ms ease, box-shadow 300ms ease;
}
.site-header.is-stuck { padding-top: 10px; }
.site-header.is-stuck .site-header__row {
  width: calc(100% - 24px);
  max-width: 820px;
  height: 54px;
  padding-inline: 22px 8px;
  background-color: color-mix(in srgb, var(--paper) 64%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: inset 0 0 0 1px var(--line), 0 14px 34px -18px var(--float-shadow);
}
.site-header .btn, .site-header .theme-toggle { transition: border-radius 450ms var(--ease), filter 160ms ease, color 160ms ease, background-color 160ms ease, transform 160ms ease; }
.site-header.is-stuck .btn { border-radius: 999px; }
.brand { display: inline-flex; }
.brand__mark { width: 78px; height: 26px; color: var(--ink); }
.site-nav { display: flex; gap: 28px; font-size: 14px; color: var(--ink-2); }
.site-nav a { position: relative; transition: color 160ms ease; }
.site-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 300ms var(--ease); }
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { transform: scaleX(1); }
.site-header__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.theme-toggle { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--ink-2); transition: color 160ms ease, background-color 160ms ease; }
.theme-toggle:hover { color: var(--ink); background: var(--line); }
.theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.theme-toggle__sun, .theme-toggle__moon { transform-box: view-box; transform-origin: center; transition: transform 600ms var(--ease), opacity 300ms ease; }
.theme-toggle__moon { opacity: 0; transform: rotate(-70deg) scale(0.4); }
[data-theme="dark"] .theme-toggle__sun { opacity: 0; transform: rotate(70deg) scale(0.4); }
[data-theme="dark"] .theme-toggle__moon { opacity: 1; transform: none; }

/* ── Hero ───────────────────────────────────────────────────────────── */

.hero { padding-top: clamp(64px, 10vh, 116px); overflow-x: clip; }
.hero__copy { position: relative; z-index: 2; display: grid; justify-items: center; text-align: center; }


.hero__title { font-size: clamp(40px, 6.1vw, 94px); line-height: 0.98; letter-spacing: -0.055em; font-weight: 500; text-wrap: balance; }
.hero__title .line { display: block; }
.hero__title .line--dim { color: var(--ink-2); }
.hero__title .word > span { animation: word-up 1100ms var(--ease) both; animation-delay: calc(80ms + var(--i, 0) * 70ms); transform: none; }
@keyframes word-up { from { transform: translateY(105%); } to { transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.hero__lede { margin-top: 34px; max-width: 31em; animation: rise 900ms var(--ease) 520ms both; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.hero__cta { margin-top: 38px; animation: rise 900ms var(--ease) 640ms both; }

.hero__stage { position: relative; z-index: 1; margin-top: clamp(64px, 10vh, 104px); }

/* On a wide screen the copy owns the first screen and sits in the middle of
   it (a touch above, where the eye reads as centred); the library window
   starts just past the fold, and the loose cards spread over the full height. */
@media (min-width: 960px) {
  .hero { padding-top: 0; }
  .hero__copy { min-height: min(100svh - var(--header-h), 980px); align-content: center; padding-bottom: 7vh; }
  .hero__stage { margin-top: 0; }
}
.demo-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-top: 16px; min-height: 3em; }
.demo-foot__hint { flex: none; }
.demo-caption { font-family: var(--mono); font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.demo-caption b { font-weight: 500; color: var(--ink); }
.demo-caption .op { color: var(--signal); }

/* ── The app, drawn in its own tokens ───────────────────────────────── */

.app, .dialog, .canvas {
  --a-ground: #060708;
  --a-900: #0c0d0f;
  --a-card: #101112;
  --a-100: #edeef0;
  --a-300: #b4b6be;
  --a-400: #8e919b;
  --a-line: rgb(255 255 255 / 0.08);
  color: var(--a-100);
  font-size: 13px;
  line-height: 1.35;
  border-radius: 14px;
}

.app { position: relative; display: flex; flex-direction: column; height: 680px; container-type: inline-size; }
.app > * { position: relative; }
/* The window itself: a separate element so it can fade in on its own layer
   while the cards land, without anything inside being restyled. */
.app > .app__frame { position: absolute; inset: 0; border-radius: inherit; background: var(--a-ground); box-shadow: 0 0 0 1px var(--app-ring), var(--app-shadow); }
.app__header { flex: none; display: flex; align-items: center; gap: 10px; height: 52px; padding-inline: 12px; border-bottom: 1px solid var(--a-line); }
.app__logo { position: absolute; left: 50%; top: 50%; width: 60px; height: 20px; transform: translate(-50%, -50%); color: var(--a-100); pointer-events: none; }
.app__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.app__body { flex: 1; min-height: 0; display: flex; }
.app__grid { flex: 1; min-width: 0; overflow-y: auto; padding: 12px; border-radius: 0 0 14px 0; }
.app * { scrollbar-width: none; }
.app *::-webkit-scrollbar { display: none; }
.app :focus-visible, .dialog :focus-visible { outline-color: #7393ff; }

/* While the cards are loose, script writes one transform per card per frame
   (see `assembly` in main.js). Everything here is static, so nothing is
   repainted while they move: each card and each fading surface is its own
   layer, and the shadow never changes. */
.app.is-assembling .app__frame, .app.is-assembling .app__header, .app.is-assembling .rail { will-change: opacity; }
.app.is-assembling .app__body, .app.is-assembling .app__grid { overflow: visible; }
/* Let cards leave upwards and sideways, never past the window's bottom edge. */
.app.is-assembling .app__grid { clip-path: inset(-300vh -100vw 0 -100vw); }
.app.is-assembling .card {
  box-shadow: 0 22px 40px -18px var(--float-shadow);
  outline: 1px solid rgb(255 255 255 / 0.08);
  outline-offset: -1px;
  pointer-events: none;
  will-change: transform;
  transition: none;
}

.app-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--a-400); }

.seg { display: inline-flex; flex: none; padding: 2px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--a-line); }
.seg__btn { height: 26px; padding-inline: 10px; border-radius: 4px; font-size: 13px; color: var(--a-400); transition: color 120ms ease, background-color 120ms ease; }
.seg__btn:hover { color: var(--a-100); }
.seg__btn.is-on { background: rgb(255 255 255 / 0.075); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.09); color: var(--a-100); }

.app-search { flex: 0 1 270px; min-width: 120px; display: flex; align-items: center; gap: 8px; height: 30px; padding-inline: 9px; border-radius: 6px; background: rgb(255 255 255 / 0.03); border: 1px solid rgb(255 255 255 / 0.09); color: var(--a-400); transition: border-color 150ms ease; }
.app-search:focus-within { border-color: rgb(255 255 255 / 0.32); }
.app-search svg { width: 14px; height: 14px; flex: none; }
.app-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--a-100); font: inherit; }
.app-search input::placeholder { color: var(--a-400); }
.app-search input::-webkit-search-cancel-button { display: none; }
kbd { font-family: var(--mono); font-size: 11px; line-height: 1; padding: 3px 5px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--a-line); color: var(--a-400); }

.app-btn { display: inline-flex; align-items: center; height: 30px; padding-inline: 12px; border-radius: 6px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.app-btn--primary { background-image: linear-gradient(180deg, var(--violet), var(--blue)); color: #fff; box-shadow: inset 0 1px 0 0 rgb(255 255 255 / 0.2); transition: filter 150ms ease, opacity 150ms ease; }
.app-btn--primary:hover { filter: brightness(1.1); }
.app-btn--primary.is-disabled { filter: saturate(0.4); opacity: 0.6; }
.app-btn--primary.is-pressed { filter: brightness(1.25); }
.app-btn--ghost { color: #d6d7dc; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.12); }
.app-btn--ghost:hover { background: rgb(255 255 255 / 0.05); }
.app-btn[hidden] { display: none; }
.avatar { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #c2553b; color: #fff; font-size: 12px; font-weight: 600; }

.rail { flex: none; width: 216px; overflow-y: auto; padding: 8px; border-right: 1px solid var(--a-line); }
.rail__head { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 8px 6px; }
.rail__logic { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; color: var(--a-400); opacity: 0.8; }
.rail__divider { padding: 10px 8px 4px; font-size: 12px; color: var(--a-400); display: flex; align-items: center; gap: 8px; }
.rail__divider::after { content: ""; flex: 1; height: 1px; background: var(--a-line); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 30px; padding-inline: 8px; border-radius: 6px; color: var(--a-300); text-align: left; transition: background-color 120ms ease, color 120ms ease; }
.row:hover { background: rgb(255 255 255 / 0.04); color: var(--a-100); }
.row.is-on { background: rgb(255 255 255 / 0.075); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.09); color: var(--a-100); }
.row__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__count { flex: none; font-family: var(--mono); font-size: 11px; color: var(--a-400); }

.masonry { display: flex; align-items: flex-start; gap: 10px; }
.masonry__col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.card { position: relative; border-radius: 8px; overflow: hidden; background: var(--a-card); animation: card-in 420ms var(--ease) both; transition: translate 200ms var(--ease); }
.card:hover { translate: 0 -3px; }
.card svg { width: 100%; height: 100%; }
.card__meta { position: absolute; inset: auto 0 0 0; padding: 22px 10px 8px; background: linear-gradient(180deg, rgb(0 0 0 / 0), rgb(0 0 0 / 0.82)); font-size: 12px; color: #fff; opacity: 0; transition: opacity 160ms ease; display: flex; justify-content: space-between; gap: 8px; }
.card:hover .card__meta { opacity: 1; }
.card__meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__meta span:last-child { flex: none; color: rgb(255 255 255 / 0.7); }
.card__badge { position: absolute; top: 8px; right: 8px; padding: 3px 6px; border-radius: 4px; background: rgb(0 0 0 / 0.7); font-family: var(--mono); font-size: 10.5px; color: #fff; display: inline-flex; align-items: center; gap: 5px; }
.card__badge::before { content: ""; border: 4px solid transparent; border-left: 6px solid #fff; border-right: 0; }

.sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 10px; }
.site { position: relative; border-radius: 8px; overflow: hidden; background: var(--a-card); box-shadow: inset 0 0 0 1px var(--a-line); animation: card-in 420ms var(--ease) both; }
.site__preview { height: 116px; display: grid; place-items: center; background: #17181c; color: var(--a-400); font-family: var(--mono); font-size: 12px; }
.site__preview svg { width: 100%; height: 100%; }
.site__body { padding: 10px 12px 12px; }
.site__title { font-size: 13px; color: var(--a-100); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site__host { margin-top: 2px; font-family: var(--mono); font-size: 11px; color: var(--a-400); }
.site__edit { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; background: rgb(0 0 0 / 0.7); opacity: 0; transition: opacity 140ms ease; }
.site:hover .site__edit { opacity: 1; }
.site__edit svg { width: 13px; height: 13px; }

.app__empty { display: grid; place-items: center; align-content: center; gap: 12px; height: 100%; min-height: 200px; text-align: center; color: var(--a-400); }
.app__empty strong { display: block; color: var(--a-100); font-weight: 500; font-size: 15px; }

/* Opacity and scale only: the hero's scatter owns `transform`. */
@keyframes card-in { from { opacity: 0; scale: 0.94; } to { opacity: 1; scale: 1; } }

@container (max-width: 1020px) { .app__logo { display: none; } }
@container (max-width: 820px) { .seg--types { display: none; } .app-search kbd { display: none; } }
@container (max-width: 640px) {
  .app__body { flex-direction: column; }
  .rail { width: auto; display: flex; align-items: center; gap: 4px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--a-line); }
  .rail__head { padding: 0 6px 0 12px; flex: none; }
  .rail__logic, .rail__divider { display: none; }
  .row { width: auto; flex: none; }
  .app-btn--ghost, .avatar { display: none; }
  .app-search { flex: 1; }
}

/* ── Ticker ─────────────────────────────────────────────────────────── */

.ticker { margin-top: clamp(88px, 12vw, 160px); overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.ticker__track { display: flex; width: max-content; animation: ticker 46s linear infinite; }
.ticker__track span { display: inline-flex; align-items: center; font-size: clamp(30px, 5.2vw, 72px); line-height: 1.1; letter-spacing: -0.045em; font-weight: 500; color: var(--ink-3); white-space: nowrap; transition: color 300ms ease; }
.ticker__track span::after { content: ""; width: 0.14em; height: 0.14em; margin-inline: 0.5em; border-radius: 50%; background: currentColor; }
.ticker__track span:hover { color: var(--ink); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ── Story ──────────────────────────────────────────────────────────── */

.story { padding-block: clamp(120px, 17vw, 240px); }
.story__label { margin-bottom: 32px; }
.story__text { font-size: clamp(28px, 4.5vw, 64px); line-height: 1.12; letter-spacing: -0.04em; font-weight: 500; max-width: 19em; text-wrap: pretty; }
.story__text .sw { color: var(--ink-3); transition: color 500ms ease; }
.story__text .sw.is-lit { color: var(--ink); }

.step__try { display: inline-flex; align-items: center; gap: 8px; margin-top: 26px; padding-bottom: 3px; font-size: 15px; font-weight: 500; color: var(--ink); box-shadow: inset 0 -1px 0 0 var(--ink-3); transition: box-shadow 200ms ease; }
.step__try:hover { box-shadow: inset 0 -1px 0 0 var(--ink); }
.step__try span { transition: transform 240ms var(--ease); }
.step__try:hover span { transform: translateY(-3px); }

/* ── How it works ───────────────────────────────────────────────────── */

.how { padding-bottom: clamp(96px, 12vw, 180px); }
.how__intro .label { margin-bottom: 28px; }
.step { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 6vw, 96px); align-items: center; margin-top: clamp(104px, 13vw, 200px); }
.step--flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.step--flip .step__text { order: 2; }
.step__n { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; color: var(--signal); margin-bottom: 22px; }
.step__text .lede { margin-top: 24px; }

.ways { display: inline-flex; margin-top: 34px; padding: 3px; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--line); }
.way { height: 34px; padding-inline: 16px; border-radius: 99px; font-size: 14px; color: var(--ink-2); transition: color 160ms ease, background-color 200ms ease; }
.way:hover { color: var(--ink); }
.way.is-on { background: var(--ink); color: var(--ground); }

/* Capture dialog */
.dialog { background: var(--a-900); box-shadow: 0 0 0 1px var(--app-ring), var(--app-shadow); overflow: hidden; }
.dialog__top, .dialog__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; }
.dialog__top { border-bottom: 1px solid var(--a-line); }
.dialog__foot { border-top: 1px solid var(--a-line); }
.replay { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--a-400); }
.replay:hover { color: var(--a-100); }
.dialog__body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; padding: 18px; }
.cap-preview__art { aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--a-card); }
.cap-preview__art svg { width: 100%; height: 100%; animation: card-in 500ms var(--ease) both; }
.cap-progress { height: 2px; margin: 12px 0 8px; background: rgb(255 255 255 / 0.1); border-radius: 2px; overflow: hidden; }
.cap-progress span { display: block; height: 100%; width: 0; background: #7393ff; }
.cap-fields { display: grid; gap: 14px; align-content: start; }
.cap-field .app-label { margin-bottom: 6px; }
.cap-input { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 36px; padding: 5px 10px; border-radius: 6px; background: rgb(255 255 255 / 0.03); border: 1px solid rgb(255 255 255 / 0.09); font-size: 14px; }
.cap-input--chips { padding-left: 6px; }
.caret { width: 1px; height: 16px; margin-left: -4px; background: var(--a-100); animation: blink 1s steps(2) infinite; }
.dialog.is-done .caret { display: none; }
@keyframes blink { 50% { opacity: 0; } }
.chip { padding: 3px 8px; border-radius: 4px; background: rgb(255 255 255 / 0.08); font-size: 13px; animation: card-in 260ms var(--ease) both; }
.cap-result { font-size: 13px; color: var(--a-400); }
.cap-result.is-on { color: var(--a-100); }

/* Venn diagrams: the circles drift together as the step arrives. */
.venns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 3vw, 40px); }
.venn svg { width: 100%; max-width: 220px; overflow: visible; }
.venn circle { fill: none; stroke: var(--ink); stroke-width: 1.2; vector-effect: non-scaling-stroke; transition: transform 1400ms var(--ease) 200ms, fill 500ms ease 900ms, opacity 500ms ease 1000ms; }
.venn__overlap circle { fill: var(--ink); stroke: none; transition: opacity 500ms ease 1100ms; }
.venn .venn__fill { fill: var(--ink); }
.venn--or .venn__fill { stroke: var(--ground); }
.js .venns:not(.is-in) .venn__l { transform: translateX(-18px); }
.js .venns:not(.is-in) .venn__r { transform: translateX(18px); }
.js .venns:not(.is-in) .venn__overlap circle { opacity: 0; }
.js .venns:not(.is-in) .venn__fill { fill: transparent; stroke: var(--ink); }
.venn figcaption { margin-top: 26px; }
.venn__q { margin-top: 10px; font-size: clamp(17px, 1.6vw, 21px); font-weight: 500; letter-spacing: -0.02em; }
.venn__a { margin-top: 4px; font-size: 15px; color: var(--ink-2); }

/* Search */
.finder__field { display: flex; align-items: center; gap: 18px; padding-bottom: 22px; border-bottom: 1px solid var(--ink); min-height: 78px; }
.finder__field kbd { font-size: 14px; padding: 6px 9px; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
.finder__query { font-family: var(--mono); font-size: clamp(24px, 3.6vw, 46px); letter-spacing: -0.04em; line-height: 1.1; white-space: pre; }
.finder__caret { width: 2px; height: clamp(26px, 3.6vw, 46px); margin-left: -12px; background: var(--signal); animation: blink 1s steps(2) infinite; }
.finder__rows { transition: opacity 300ms ease; }
.finder__rows.is-swapping { opacity: 0; }
.finder__row { display: grid; grid-template-columns: 110px 1fr; align-items: baseline; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.finder__val { font-size: clamp(17px, 1.7vw, 22px); letter-spacing: -0.015em; }
.finder mark { color: inherit; background: transparent; padding: 0.06em 0.18em; margin-inline: -0.18em; border-radius: 4px; transition: background-color 400ms ease; }
.finder.w1 mark.m1 { background: var(--mark-1); }
.finder.w2 mark.m2 { background: var(--mark-2); }

/* The canvas: a window you move around in. The world inside is laid out in
   its own units and shown through one transform; --inv is 1 / zoom, so the
   cluster names can stay the same size on screen however far out you are. */
.step--wide { grid-template-columns: 1fr; gap: clamp(36px, 5vw, 64px); }
.step--wide .step__text { max-width: 620px; }
.canvas { background: #060708; box-shadow: 0 0 0 1px var(--app-ring), var(--app-shadow); overflow: hidden; }
.canvas__bar { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 10px 14px; border-bottom: 1px solid var(--a-line); }
.canvas__chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.canvas__chip { height: 30px; padding-inline: 12px; border-radius: 6px; font-size: 13px; color: var(--a-300); transition: background-color 120ms ease, color 120ms ease; }
.canvas__chip:hover { background: rgb(255 255 255 / 0.04); color: var(--a-100); }
.canvas__chip.is-on { background: rgb(255 255 255 / 0.075); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.09); color: var(--a-100); }
.canvas__tools { display: flex; gap: 6px; flex: none; }
.canvas__tools .app-btn { justify-content: center; min-width: 30px; padding-inline: 9px; cursor: pointer; }
.canvas__view { --inv: 1; position: relative; height: clamp(360px, 46vw, 560px); overflow: hidden; cursor: grab; touch-action: pan-y; user-select: none; }
.canvas__view.is-dragging { cursor: grabbing; }
.canvas__world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.canvas__view.is-gliding .canvas__world { transition: transform 620ms var(--ease); }
.cluster { position: absolute; animation: card-in 420ms var(--ease) both; }
.cluster__label { position: absolute; left: 0; top: 0; transform-origin: 0 0; transform: scale(var(--inv)); display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; font-size: 14px; font-weight: 500; color: var(--a-100); cursor: pointer; }
.cluster__label span { font-family: var(--mono); font-size: 11px; color: var(--a-400); }
.cluster__label:hover { color: #fff; }
.cv-item { position: absolute; margin: 0; }
.cv-img { border-radius: 6px; overflow: hidden; background: var(--a-card); }
.cv-img svg { width: 100%; height: 100%; }
.cv-item figcaption { margin-top: 5px; font-size: 9.5px; line-height: 1.25; color: var(--a-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity 200ms ease; }
.cv-item figcaption b { display: block; font-weight: 500; color: var(--a-100); }
/* Too far out to read them: the pictures and the names carry it alone. */
.canvas__view.is-far figcaption { opacity: 0; }
.canvas__hint { position: absolute; left: 14px; bottom: 12px; padding: 5px 8px; border-radius: 4px; background: rgb(6 7 8 / 0.8); pointer-events: none; }

/* ── More ───────────────────────────────────────────────────────────── */

.more { padding-block: clamp(96px, 12vw, 180px); border-top: 1px solid var(--line); }
.more .label { margin-bottom: 28px; }
.feats { margin-top: clamp(56px, 7vw, 104px); border-top: 1px solid var(--ink); }
.feat { position: relative; display: grid; grid-template-columns: 64px minmax(0, 6fr) minmax(0, 5fr); align-items: baseline; gap: 24px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.feat::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 600ms var(--ease); }
.feat:hover::after { transform: scaleX(1); }
.feat__n { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; color: var(--ink-2); }
.feat__t { font-size: clamp(22px, 2.7vw, 38px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 500; transition: transform 500ms var(--ease); }
.feat:hover .feat__t { transform: translateX(14px); }
.feat__d { font-size: 16px; color: var(--ink-2); max-width: 26em; }
.feats .feat:nth-child(2) { transition-delay: 60ms; }
.feats .feat:nth-child(3) { transition-delay: 120ms; }

/* ── Close: night ───────────────────────────────────────────────────── */

.close { position: relative; overflow: hidden; background: #04060c; color: #eef1f8; text-align: center; }
/* The glow sinks back into the night before the footer begins, so the two meet without an edge. */
.close::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: clamp(120px, 16vw, 220px); background: linear-gradient(180deg, rgb(4 6 12 / 0), #04060c); pointer-events: none; }
.close__inner { position: relative; display: grid; justify-items: center; padding-block: clamp(120px, 15vw, 200px) clamp(130px, 16vw, 210px); }
.close__label { color: #a3a9c2; margin-bottom: 30px; }
.close__title { font-size: clamp(42px, 7.6vw, 112px); line-height: 0.96; letter-spacing: -0.055em; font-weight: 500; max-width: 10em; margin-bottom: 48px; text-wrap: balance; }
.sky { position: absolute; inset: 0; }
.sky__haze { position: absolute; left: 50%; bottom: -34%; width: 120vw; height: 90%; margin-left: -60vw; background: linear-gradient(180deg, var(--violet), var(--blue)); opacity: 0.4; -webkit-mask-image: radial-gradient(closest-side, #000, transparent); mask-image: radial-gradient(closest-side, #000, transparent); animation: drift 40s ease-in-out infinite; }
.sky__stars { position: absolute; top: 0; left: 0; width: 1px; height: 1px; border-radius: 50%; }
.sky__stars--a { animation: twinkle 7s ease-in-out infinite; }
.sky__stars--b { animation: twinkle 5.3s ease-in-out -2s infinite; }
.sky__stars--c { animation: twinkle 3.7s ease-in-out -1s infinite; }
@keyframes drift { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-3vw, -2vh, 0) scale(1.08); } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }


/* ── Footer ─────────────────────────────────────────────────────────── */

/* The footer carries on from the closing sky: the same night in both
   themes, so the page ends in one piece instead of a strip of leftovers. */
/* Pulled up a pixel over the closing section: both are the same night, and a
   fractional height between them otherwise lets a hairline of page show. */
.site-footer { position: relative; margin-top: -1px; overflow: hidden; background: #04060c; color: #eef1f8; padding-top: clamp(56px, 7vw, 96px); }
.site-footer .label { color: #a3a9c2; }
.site-footer__top { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: clamp(40px, 8vw, 128px); align-items: start; }
.site-footer .brand__mark { width: 96px; height: 32px; color: #eef1f8; }
.site-footer__line { margin-top: 22px; max-width: 17em; font-size: clamp(18px, 1.7vw, 22px); line-height: 1.35; letter-spacing: -0.015em; color: #a3a9c2; }
.site-footer__col { display: grid; gap: 12px; justify-items: start; font-size: 15px; }
.site-footer__col .label { margin-bottom: 8px; }
.site-footer__col a { position: relative; color: #eef1f8; }
.site-footer__col a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 300ms var(--ease); }
.site-footer__col a:hover::after { transform: scaleX(1); }
.site-footer__base { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-top: clamp(56px, 7vw, 96px); padding-block: 22px; border-top: 1px solid rgb(238 241 248 / 0.12); }
.site-footer__legal { display: flex; gap: 22px; }
.site-footer__legal a { color: #a3a9c2; transition: color 160ms ease; }
.site-footer__legal a:hover { color: #eef1f8; }
/* The name once more, very large and nearly gone, sinking past the edge. */
.site-footer__giant { display: block; width: min(1400px, 100% - 2 * var(--gutter)); aspect-ratio: 1000 / 334; margin: clamp(8px, 2vw, 28px) auto -11%; color: #eef1f8; opacity: 0.07; pointer-events: none; }

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .site-nav { display: none; }
  .step, .step--flip { grid-template-columns: 1fr; gap: 44px; }
  .canvas__bar { flex-wrap: wrap; }
  .step--flip .step__text { order: 0; }
  .feat { grid-template-columns: 40px 1fr; row-gap: 10px; padding: 24px 0; }
  .feat__d { grid-column: 2; }
  .feat:hover .feat__t { transform: none; }
  .demo-foot__hint { display: none; }
}

@media (max-width: 640px) {
  :root { --gutter: 18px; }
  .app { height: 600px; }
  .dialog__body { grid-template-columns: 1fr; }
  .venns { grid-template-columns: 1fr; gap: 44px; }
  .venn { display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: center; }
  .venn figcaption { margin-top: 0; }
  .finder__row { grid-template-columns: 84px 1fr; }
  .cta-row { flex-direction: column; }
  .site-footer__top { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0ms !important; }
  .ticker__track { animation: none; }
}
