/* TerraVision marketing site
   One design, two colour sets. Dark is the default; the toggle
   writes data-theme on <html>. Components read only the tokens below. */

@property --sweep { syntax: '<angle>'; inherits: false; initial-value: -26deg; }

:root {
  --fg-rgb: 236, 234, 255; --bg-rgb: 10, 10, 20; --accent-rgb: 143, 132, 242; --warm-rgb: 255, 122, 69;
  --shadow-rgb: 0, 0, 0; --shadow-k: .5;
  --bg: #0a0a14; --bg-2: #0f0f1d; --surface: #14142a; --surface-2: #1a1a33; --sunken: #0c0c18; --plate: #111124;
  --text: #f2f1ff; --text-2: rgba(236, 234, 255, .72); --text-3: rgba(236, 234, 255, .52);
  --line: rgba(236, 234, 255, .08); --line-hi: rgba(236, 234, 255, .15); --line-strong: rgba(236, 234, 255, .32);
  --accent: #8f84f2; --accent-2: #bdb4f8; --accent-text: #b3aaff; --accent-soft: rgba(143, 132, 242, .12); --on-accent: #0a0a14;
  --warm: #ff7a45; --ok: #3ddc97; --warn: #ffc65c; --bad: #ff6b7a;
  --aws: #ff9900; --azure: #3ea0ff; --gcp: #34c759;
  --btn-bg: #f2f1ff; --btn-fg: #0a0a14; --btn-hover: #ffffff;
  --code-bg: #0b0b17; --code-text: #e6e4ff; --code-dim: #6f6c95;
  --tok-key: #b3aaff; --tok-str: #8ee0b7; --tok-num: #ffb38a; --tok-kw: #ff8fb1; --tok-com: #6f6c95; --tok-fn: #7fc8ff;
  --diagram-bg: #ffffff;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-title: 'Space Grotesk', 'Inter', -apple-system, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --nav-h: 64px;
  --wrap: 1200px;
  color-scheme: dark;
}

/* Light set: dark is the default; the toggle opts into light */
:root[data-theme="light"] {
  --fg-rgb: 18, 18, 38; --bg-rgb: 247, 246, 252; --accent-rgb: 88, 76, 230; --shadow-rgb: 28, 24, 72; --shadow-k: .14;
  --bg: #f7f6fc; --bg-2: #efedf9; --surface: #ffffff; --surface-2: #f3f1fb; --sunken: #ebe9f5; --plate: #fbfaff;
  --text: #121226; --text-2: rgba(18, 18, 38, .7); --text-3: rgba(18, 18, 38, .55);
  --line: rgba(18, 18, 38, .08); --line-hi: rgba(18, 18, 38, .15); --line-strong: rgba(18, 18, 38, .35);
  --accent: #584ce6; --accent-2: #3a36a0; --accent-text: #4a3fd6; --accent-soft: rgba(88, 76, 230, .09); --on-accent: #fff;
  --warm: #e2560e; --ok: #0f9d63; --warn: #b77900; --bad: #d92d4a;
  --aws: #d97a00; --azure: #0067c0; --gcp: #188038;
  --btn-bg: #121226; --btn-fg: #ffffff; --btn-hover: #000000;
  --code-bg: #15152b; --code-text: #e6e4ff; --code-dim: #7d7aa6;
  color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
code, pre, kbd { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(var(--accent-rgb), .35); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }

/* Faint blueprint grid behind everything */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(var(--fg-rgb), .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--fg-rgb), .035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(var(--bg-rgb), .72); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s var(--ease-out);
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: 1.5rem; width: min(100% - 32px, 1320px); margin-inline: auto; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-title); font-weight: 600; font-size: 1.125rem; letter-spacing: -.02em; }
.brand img { width: 30px; height: 30px; }
.nav-links { display: flex; gap: .25rem; margin-left: 1rem; }
.nav-links a { padding: .45rem .7rem; border-radius: 8px; font-size: .875rem; color: var(--text-2); transition: color .2s, background .2s; }
.nav-links a:hover { color: var(--text); background: rgba(var(--fg-rgb), .06); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--text-2); border: 1px solid var(--line); transition: color .2s, border-color .2s, background .2s; }
.icon-btn:hover { color: var(--text); border-color: var(--line-hi); background: rgba(var(--fg-rgb), .04); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }
.gh-btn { display: inline-flex; align-items: center; gap: .5rem; height: 38px; padding: 0 .8rem; border-radius: 10px; border: 1px solid var(--line); font-size: .8125rem; color: var(--text-2); transition: color .2s, border-color .2s; }
.gh-btn:hover { color: var(--text); border-color: var(--line-hi); }
.gh-btn svg { width: 16px; height: 16px; }
.gh-btn .stars { font-family: var(--font-mono); font-size: .75rem; color: var(--text); padding-left: .55rem; border-left: 1px solid var(--line); }
.nav-cta { display: inline-flex; align-items: center; height: 38px; padding: 0 1rem; border-radius: 10px; background: var(--btn-bg); color: var(--btn-fg); font-size: .8125rem; font-weight: 600; transition: background .2s, transform .2s var(--ease-out); }
.nav-cta:hover { background: var(--btn-hover); transform: translateY(-1px); }
.menu-btn { display: none; }

/* ---------- Buttons & command chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 48px; padding: 0 1.35rem; border-radius: 12px; font-weight: 600; font-size: .9375rem; transition: transform .25s var(--ease-out), background .2s, border-color .2s, box-shadow .25s; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); box-shadow: 0 10px 30px -12px rgba(var(--accent-rgb), .7); }
.btn-primary:hover { background: var(--btn-hover); transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--line-hi); color: var(--text); background: rgba(var(--fg-rgb), .02); }
.btn-ghost:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.btn-ghost .play { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.btn-ghost .play svg { width: 10px; height: 10px; margin-left: 2px; }

.cmd-chip {
  display: flex; align-items: center; gap: .75rem; min-height: 50px; padding: .35rem .4rem .35rem 1rem; max-width: 100%;
  border: 1px solid var(--line-hi); border-radius: 12px; background: rgba(var(--bg-rgb), .7);
  font-family: var(--font-mono); font-size: .8125rem; color: var(--text); text-align: left;
}
.cmd-chip .prompt { color: var(--accent-text); user-select: none; flex: none; }
.cmd-chip code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.cmd-chip code::-webkit-scrollbar { display: none; }

.copy-btn {
  flex: none; display: inline-flex; align-items: center; gap: .4rem; min-height: 36px; padding: 0 .7rem; border-radius: 8px;
  background: rgba(var(--fg-rgb), .07); color: var(--text-2); font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .04em; text-transform: uppercase;
  transition: color .18s var(--ease-out), background .18s var(--ease-out);
}
.copy-btn:hover { color: var(--text); background: rgba(var(--fg-rgb), .13); }
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn .i-check { display: none; }
.copy-btn.is-copied { color: var(--ok); }
.copy-btn.is-copied .i-copy { display: none; }
.copy-btn.is-copied .i-check { display: block; animation: pop .35s var(--ease-out); }
@keyframes pop { from { transform: scale(.4); } }

/* ---------- Hero ---------- */
.hero { position: relative; padding: calc(var(--nav-h) + 3.5rem) 0 0; text-align: center; isolation: isolate; }
.hero-glow {
  position: absolute; inset: 0 0 auto; height: 900px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 320px at 50% 8%, rgba(var(--accent-rgb), .22), transparent 70%),
    radial-gradient(420px 260px at 78% 30%, rgba(var(--warm-rgb), .10), transparent 70%),
    radial-gradient(420px 260px at 20% 34%, rgba(62, 160, 255, .08), transparent 70%);
}
.pill {
  display: inline-flex; align-items: center; gap: .6rem; padding: .3rem .85rem .3rem .35rem; border-radius: 999px;
  border: 1px solid var(--line-hi); background: rgba(var(--fg-rgb), .03); font-size: .8125rem; color: var(--text-2);
  animation: siteRise .8s var(--ease-out) .05s both; transition: border-color .2s;
}
.pill:hover { border-color: var(--line-strong); }
.pill b { font-family: var(--font-mono); font-weight: 500; font-size: .6875rem; padding: .2rem .55rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); letter-spacing: .02em; }
.pill svg { width: 14px; height: 14px; }
.hero h1 {
  margin: 1.4rem auto 0; max-width: 19ch; font-family: var(--font-title); font-weight: 600;
  font-size: clamp(2.5rem, 6.4vw, 4.9rem); line-height: .98; letter-spacing: -.045em; text-wrap: balance;
}
.hero h1 .l1, .hero h1 .l2 { display: block; animation: siteTitle 1s var(--ease-out) both; }
.hero h1 .l1 { animation-delay: .1s; }
.hero h1 .l2 { animation-delay: .22s; }
.hero h1 em, .section-heading em, .cta h2 em {
  font-family: var(--font-display); font-style: italic; font-weight: 400; letter-spacing: -.03em;
  background: linear-gradient(100deg, var(--accent-2) 0%, var(--accent) 45%, var(--warm) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em;
}
.hero-copy { max-width: 640px; margin: 1.4rem auto 0; font-size: clamp(1rem, 1.6vw, 1.175rem); color: var(--text-2); text-wrap: pretty; animation: siteRise .9s var(--ease-out) .32s both; }
.hero-copy strong { color: var(--text); font-weight: 600; }
.hero-copy code { white-space: nowrap; font-size: .85em; padding: .1em .4em; border-radius: 5px; background: rgba(var(--fg-rgb), .07); color: var(--text); }
.hero-install { margin: 1.75rem auto 0; width: min(100%, 600px); animation: siteRise .9s var(--ease-out) .42s both; }
.seg { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: .6rem; border-radius: 10px; background: rgba(var(--fg-rgb), .05); border: 1px solid var(--line); position: relative; }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { position: relative; z-index: 1; white-space: nowrap; flex: none; padding: .3rem .75rem; border-radius: 7px; font-size: .75rem; color: var(--text-3); transition: color .2s; }
.seg button[aria-selected="true"] { color: var(--text); }
.seg .seg-thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; border-radius: 7px; background: var(--surface-2); box-shadow: 0 1px 0 rgba(var(--fg-rgb), .06) inset, 0 2px 8px rgba(var(--shadow-rgb), .2); transition: left .35s var(--ease-out), width .35s var(--ease-out); }
.hero-install .cmd-chip code { transition: opacity .2s; }
.hero-ctas { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.4rem; animation: siteRise .9s var(--ease-out) .5s both; }
.agents { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem 1.25rem; font-size: .8125rem; color: var(--text-3); animation: siteRise .9s var(--ease-out) .6s both; }
.agents span:first-child { font-family: var(--font-mono); font-size: .6875rem; text-transform: uppercase; letter-spacing: .12em; }
.agents b { font-weight: 500; color: var(--text-2); }

@keyframes siteRise { from { opacity: 0; translate: 0 18px; filter: blur(6px); } }
@keyframes siteTitle { from { opacity: 0; translate: 0 .35em; filter: blur(10px); } }

/* Horizon: a planet-edge arc under the hero, with a light glint sweeping along it */
.horizon { position: relative; height: 140px; margin-top: .5rem; pointer-events: none; overflow: hidden; }
.horizon-arc {
  position: absolute; left: 50%; top: 40px; width: 170vw; height: 320px; transform: translateX(-50%); border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 -1px 0 0 rgba(var(--accent-rgb), .6), 0 -24px 80px -10px rgba(var(--accent-rgb), .45);
  animation: horizonRise 1.6s var(--ease-out) .3s both;
}
.horizon.is-paused .horizon-arc::after { animation-play-state: paused; }
.horizon-arc::after {
  content: ''; position: absolute; inset: -1px; border-radius: 50%;
  background: conic-gradient(from var(--sweep), transparent 0deg, rgba(255, 255, 255, .9) 3deg, transparent 6deg, transparent 360deg);
  mask: radial-gradient(closest-side, transparent 97.5%, #000 99%); -webkit-mask: radial-gradient(closest-side, transparent 97.5%, #000 99%);
  animation: glint 7s var(--ease-in-out) 1.6s infinite;
}
@keyframes horizonRise { from { translate: 0 60px; opacity: 0; } 40% { opacity: 1; } }
@keyframes glint { 0% { --sweep: -26deg; opacity: 0; } 10% { opacity: 1; } 60% { --sweep: 20deg; opacity: 1; } 68%, 100% { --sweep: 22deg; opacity: 0; } }

/* ---------- Windows (shared chrome) ---------- */
.window {
  position: relative; display: flex; flex-direction: column; border-radius: 16px; overflow: hidden;
  background: var(--plate); border: 1px solid rgba(var(--fg-rgb), .12);
  box-shadow: 0 0 0 1px rgba(var(--shadow-rgb), calc(.5 * var(--shadow-k))), 0 50px 120px -30px rgba(var(--shadow-rgb), calc(1.4 * var(--shadow-k))), 0 30px 80px -40px rgba(var(--accent-rgb), .35);
}
.window::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(180deg, rgba(255, 255, 255, .05), transparent 16%); }
.window-bar { display: flex; align-items: center; gap: .9rem; min-height: 46px; padding: 0 1rem; border-bottom: 1px solid var(--line); background: rgba(var(--fg-rgb), .025); }
.dots { display: inline-flex; gap: 7px; flex: none; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: rgba(var(--fg-rgb), .16); }
.dots i:nth-child(1) { background: #ff5f57; } .dots i:nth-child(2) { background: #febc2e; } .dots i:nth-child(3) { background: #28c840; }
.window-title { font-family: var(--font-mono); font-size: .75rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.window-bar .copy-btn { margin-left: auto; }

/* ---------- Stage: one window pinned while scrolling plays four examples ---------- */
.stage { position: relative; height: 420vh; height: 420svh; margin-top: -235px; --enter: 0; }
.stage-pin { position: sticky; top: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(var(--nav-h) + 12px) 24px 20px; perspective: 1400px; perspective-origin: 50% 0%; }
.stage-window {
  /* leave ~190px under the window for the scroll cue and the next section's heading to peek out */
  width: min(100%, 1320px); height: min(calc(100vh - var(--nav-h) - 12px - 190px), 820px); min-height: 480px; flex: none;
  /* Leans back like a laptop lid at first, and stands up flat by the time it pins */
  transform-origin: 50% 100%;
  transform: translateY(calc((1 - var(--enter)) * -60px)) rotateX(calc((1 - var(--enter)) * 30deg)) scale(calc(.9 + .1 * var(--enter)));
  animation: windowRise 1.5s var(--ease-out) .65s both;
  will-change: transform;
}
@keyframes windowRise { from { translate: 0 120px; opacity: 0; } }

.stage-window .window-bar { gap: 1rem; }
.app-name { display: inline-flex; align-items: center; gap: .45rem; font-size: .8125rem; font-weight: 600; color: var(--text-2); flex: none; }
.app-name .spark { width: 16px; height: 16px; color: var(--warm); }
.tabs-rail { display: flex; gap: .35rem; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.tabs-rail::-webkit-scrollbar { display: none; }
.spec-tab {
  position: relative; display: inline-flex; align-items: center; gap: .5rem; flex: none; height: 30px; padding: 0 .75rem; border-radius: 8px;
  font-size: .75rem; color: var(--text-3); border: 1px solid transparent; transition: color .25s, background .25s, border-color .25s; overflow: hidden;
}
.spec-tab .idx { font-family: var(--font-mono); font-size: .625rem; opacity: .7; }
.spec-tab .prov { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--accent)); }
.spec-tab:hover { color: var(--text); }
.spec-tab[aria-selected="true"] { color: var(--text); background: rgba(var(--fg-rgb), .06); border-color: var(--line-hi); }
.spec-tab .bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--accent); }
.spec-tab[aria-selected="true"] .bar { width: calc(var(--p, 0) * 100%); }

.app-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(300px, 380px) 1fr; }
.chat { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: rgba(var(--fg-rgb), .012); }
.chat-scroll { flex: 1; min-height: 0; overflow: hidden; padding: 1.4rem 1.25rem 1rem; display: flex; flex-direction: column; gap: 1rem; }
.msg-user { align-self: flex-end; max-width: 92%; padding: .8rem 1rem; border-radius: 14px 14px 4px 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: .8125rem; line-height: 1.55; color: var(--text); }
.msg-user .typed { white-space: pre-wrap; }
.msg-user .caret { display: inline-block; width: 7px; height: 1.05em; margin-left: 1px; vertical-align: -2px; background: var(--accent); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.msg-ai { font-size: .8125rem; line-height: 1.6; color: var(--text-2); display: flex; flex-direction: column; gap: .7rem; }
.msg-ai p { margin: 0; }
.msg-ai strong { color: var(--text); font-weight: 600; }
.tool-call {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border-radius: 10px; border: 1px solid var(--line-hi); background: var(--sunken);
  font-family: var(--font-mono); font-size: .71875rem; color: var(--text-2);
}
.tool-call .t-ico { width: 22px; height: 22px; flex: none; border-radius: 6px; display: grid; place-items: center; background: var(--accent-soft); }
.tool-call .t-ico img { width: 16px; height: 16px; }
.tool-call .t-name b { color: var(--text); font-weight: 500; }
.tool-call .t-status { margin-left: auto; display: inline-flex; align-items: center; gap: .35rem; font-size: .65625rem; color: var(--text-3); }
.spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(var(--accent-rgb), .25); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tool-call .t-done { display: none; color: var(--ok); }
.tool-call.is-done .spinner { display: none; }
.tool-call.is-done .t-done { display: inline; }
.suggest { display: flex; flex-wrap: wrap; gap: .4rem; }
.suggest span { padding: .3rem .6rem; border-radius: 999px; border: 1px solid var(--line-hi); font-size: .6875rem; color: var(--text-2); }
.chat-input { margin: 0 1rem 1rem; display: flex; align-items: center; gap: .5rem; padding: .7rem .8rem; border-radius: 14px; border: 1px solid var(--line-hi); background: var(--surface); font-size: .8125rem; color: var(--text-3); }
.chat-input .send { margin-left: auto; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--warm); color: #fff; }
.chat-input .send svg { width: 14px; height: 14px; }

/* Steps reveal in order; JS toggles .is-on */
.beat { opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.beat.is-on { opacity: 1; transform: none; }

.artifact { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-2); }
.artifact-head { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.artifact-head .file { display: flex; flex-direction: column; min-width: 0; }
.artifact-head .file b { font-size: .8125rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artifact-head .file span { font-family: var(--font-mono); font-size: .65625rem; color: var(--text-3); }
.artifact-tools { margin-left: auto; display: flex; gap: .35rem; flex-wrap: nowrap; }
.artifact-tools span { display: inline-flex; align-items: center; gap: .35rem; height: 28px; padding: 0 .6rem; border-radius: 7px; border: 1px solid var(--line-hi); font-size: .6875rem; color: var(--text-2); white-space: nowrap; }
.artifact-tools svg { width: 12px; height: 12px; }
.canvas { position: relative; flex: 1; min-height: 0; margin: 14px; border-radius: 10px; overflow: hidden; background: var(--diagram-bg); box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
.canvas img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 10px;
  clip-path: inset(0 0 100% 0); filter: blur(8px) saturate(.6); transform: scale(1.02);
  transition: clip-path 1.1s var(--ease-out), filter 1.2s var(--ease-out), transform 6s var(--ease-out);
}
.canvas.is-drawn img { clip-path: inset(0 0 0 0); filter: none; transform: scale(1); }
.canvas .skeleton {
  position: absolute; inset: 0; display: grid; place-items: center; color: #8a87b0; font-family: var(--font-mono); font-size: .75rem;
  background: linear-gradient(100deg, #f4f3fb 30%, #e9e7f7 50%, #f4f3fb 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite;
  transition: opacity .5s;
}
.canvas.is-drawn .skeleton { opacity: 0; animation: none; }
.canvas .skeleton.is-idle { animation: none; }
@keyframes shimmer { to { background-position: -150% 0; } }
.canvas .zoom-hint { position: absolute; right: 10px; bottom: 10px; padding: .25rem .5rem; border-radius: 6px; background: rgba(18, 18, 38, .75); color: #fff; font-size: .65625rem; font-family: var(--font-mono); opacity: 0; transition: opacity .3s; }
.canvas.is-drawn:hover .zoom-hint { opacity: 1; }
.stage-next { margin-top: 18px; }
/* Scroll cue between the pinned window and the next heading */
.scroll-cue { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 16px; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); pointer-events: none; transition: opacity .4s var(--ease-out); }
.scroll-cue b { font-weight: 500; color: var(--accent-text); margin-left: .35rem; }
.scroll-cue svg { width: 26px; height: 26px; color: var(--accent); animation: cueBounce 1.6s var(--ease-in-out) infinite; }
@keyframes cueBounce { 0%, 100% { transform: translateY(-2px); opacity: .45; } 50% { transform: translateY(5px); opacity: 1; } }
.stage-next .section-head { margin-bottom: 0; }
#how { padding-top: 3.25rem; }
.stage-caption { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); font-family: var(--font-mono); font-size: .6875rem; color: var(--text-3); letter-spacing: .06em; white-space: nowrap; pointer-events: none; }
.stage-caption kbd { padding: .1rem .35rem; border-radius: 4px; border: 1px solid var(--line-hi); font-size: .625rem; }

/* ---------- Sections ---------- */
section.block { padding: clamp(5rem, 11vw, 9rem) 0 0; position: relative; }
.section-head { max-width: 780px; margin-bottom: 3.25rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.kicker { display: inline-flex; align-items: center; gap: .65rem; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); }
.kicker .num { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 .4rem; border-radius: 6px; border: 1px solid rgba(var(--accent-rgb), .4); font-size: .6875rem; letter-spacing: .02em; }
.section-heading { margin: 1rem 0 0; font-family: var(--font-title); font-size: clamp(2.1rem, 4.6vw, 3.75rem); font-weight: 600; line-height: 1.04; letter-spacing: -.04em; text-wrap: balance; }
.section-body { margin: 1.25rem 0 0; font-size: 1.0625rem; color: var(--text-2); max-width: 640px; text-wrap: pretty; }
.center .section-body { margin-inline: auto; }
.section-body code, .note code, .faq code, .card p code { font-size: .85em; padding: .1em .4em; border-radius: 5px; background: rgba(var(--fg-rgb), .07); color: var(--text); }

/* Scroll-driven arrival: transform only, so nothing is ever hidden and older browsers show the page as it is */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .arrive { animation: arrive linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
  }
}
@keyframes arrive { from { transform: translateY(56px) scale(.97); } }

/* Grid children may hold long code lines: let them shrink and scroll instead of widening the page */
.duo > *, .split > *, .graph-grid > *, .ci-grid > *, .step > *, .faq > * { min-width: 0; }

/* ---------- 01 Two directions ---------- */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.duo-card { display: flex; flex-direction: column; gap: 1.1rem; }
.duo-label { display: flex; align-items: center; gap: .6rem; font-family: var(--font-title); font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
.duo-label .arrow { color: var(--accent); }
.duo-card > p { margin: -.5rem 0 0; color: var(--text-2); font-size: .9375rem; }
.duo .window { height: 440px; margin-top: auto; } /* keeps both windows level when the intros differ in length */

.term { flex: 1; min-height: 0; padding: 1.1rem 1.2rem; background: var(--code-bg); color: var(--code-text); font-family: var(--font-mono); font-size: .78125rem; line-height: 1.75; overflow: hidden auto; scrollbar-width: none; }
.term .ln { display: block; white-space: pre; opacity: 0; }
.term .p { color: var(--accent-2); user-select: none; }
.term .dim { color: var(--code-dim); }
.term .ok { color: #3ddc97; }
.term .hl { color: #ffb38a; }
.term .wht { color: #fff; font-weight: 700; }
.term .cmd { display: inline-block; vertical-align: bottom; overflow: hidden; white-space: nowrap; clip-path: inset(0 100% 0 0); }
.is-run .term .ln { animation: lineIn .35s var(--ease-out) var(--d, 0s) both; }
.is-run .term .cmd { animation: typeIn var(--t, 1.2s) steps(var(--n, 40), end) var(--d, 0s) both; }
@keyframes lineIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes typeIn { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.term-out { display: flex; gap: .75rem; align-items: center; margin-top: .6rem; opacity: 0; }
.is-run .term-out { animation: lineIn .6s var(--ease-out) var(--d, 0s) both; }
.term-out img { width: 120px; height: 84px; object-fit: cover; object-position: top; border-radius: 6px; background: #fff; border: 1px solid rgba(255, 255, 255, .15); }
.term-out .files { display: flex; flex-wrap: wrap; gap: .35rem; }
.term-out .files span { padding: .1rem .45rem; border-radius: 5px; background: rgba(255, 255, 255, .07); font-size: .6875rem; }

.mini-chat { display: flex; flex-direction: column; gap: .8rem; padding: 1rem 1.1rem .6rem; border-bottom: 1px solid var(--line); }
.mini-chat .thumb { display: flex; gap: .7rem; align-items: center; font-size: .75rem; color: var(--text-3); }
.mini-chat .thumb img { width: 92px; height: 60px; object-fit: cover; object-position: top; border-radius: 6px; background: #fff; }
.mini-chat .msg-user { opacity: 0; }
.is-run .mini-chat .msg-user { animation: lineIn .5s var(--ease-out) .2s both; }
.code-pane { flex: 1; min-height: 0; padding: .9rem 1.1rem; background: var(--code-bg); color: var(--code-text); font-family: var(--font-mono); font-size: .75rem; line-height: 1.7; overflow: hidden; position: relative; }
.code-pane .ln { display: block; white-space: pre; opacity: 0; }
.is-run .code-pane .ln { animation: lineIn .3s var(--ease-out) var(--d, 0s) both; }
.code-pane::after { content: ''; position: absolute; inset: auto 0 0; height: 60px; background: linear-gradient(transparent, var(--code-bg)); }
.k { color: var(--tok-kw); } .s { color: var(--tok-str); } .n { color: var(--tok-num); } .c { color: var(--tok-com); } .f { color: var(--tok-fn); } .y { color: var(--tok-key); }

/* ---------- 02 Gallery ---------- */
.gallery-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.filters { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; gap: .35rem; padding: 4px; border-radius: 12px; border: 1px solid var(--line); background: rgba(var(--fg-rgb), .02); }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: .45rem; height: 34px; padding: 0 .85rem; border-radius: 8px; font-size: .8125rem; color: var(--text-2); transition: background .2s, color .2s; }
.filters button .prov { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.filters button .ct { font-family: var(--font-mono); font-size: .6875rem; color: var(--text-3); }
.filters button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 0 rgba(var(--fg-rgb), .06) inset; }
.gallery-meta { font-size: .8125rem; color: var(--text-3); }
.gallery-meta a { color: var(--accent-text); }
.grid-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.g-card {
  position: relative; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
  background: var(--surface); transition: transform .35s var(--ease-out), border-color .25s, box-shadow .35s;
  animation: cardIn .5s var(--ease-out) both;
}
.g-card:hover { transform: translateY(-4px); border-color: var(--line-hi); box-shadow: 0 30px 60px -30px rgba(var(--shadow-rgb), calc(1.2 * var(--shadow-k))); }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } }
.g-thumb { position: relative; display: block; aspect-ratio: 4 / 3; background: #fff; overflow: hidden; cursor: zoom-in; }
.g-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; transition: transform 1.2s var(--ease-out), object-position 3s var(--ease-out); }
.g-card:hover .g-thumb img { transform: scale(1.04); object-position: 50% 40%; }
.g-thumb::after { content: ''; position: absolute; inset: auto 0 0; height: 40%; background: linear-gradient(transparent, rgba(255, 255, 255, .9)); pointer-events: none; }
.badge { position: absolute; top: 10px; left: 10px; z-index: 1; display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .55rem; border-radius: 999px; font-family: var(--font-mono); font-size: .625rem; letter-spacing: .06em; text-transform: uppercase; background: rgba(18, 18, 38, .82); color: #fff; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.g-body { display: flex; flex-direction: column; gap: .55rem; padding: 1rem 1rem 1.05rem; flex: 1; }
.g-body h3 { margin: 0; font-family: var(--font-title); font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.g-body p { margin: 0; font-size: .8125rem; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.g-actions { display: flex; gap: .4rem; margin-top: auto; padding-top: .35rem; }
.g-actions a { display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; padding: 0 .7rem; border-radius: 8px; font-size: .6875rem; font-family: var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); border: 1px solid var(--line); transition: color .2s, border-color .2s; }
.g-actions a:hover { color: var(--text); border-color: var(--line-hi); }
.g-actions a svg { width: 12px; height: 12px; }
.more-row { display: flex; justify-content: center; margin-top: 2rem; }

/* ---------- 03 Prod without access ---------- */
.split { display: grid; grid-template-columns: 1fr 1.15fr; gap: 3.5rem; align-items: center; }
.ticks { list-style: none; margin: 1.75rem 0 0; padding: 0; display: grid; gap: .9rem; }
.ticks li { display: grid; grid-template-columns: 26px 1fr; gap: .7rem; font-size: .9375rem; color: var(--text-2); }
.ticks li b { color: var(--text); font-weight: 600; }
.ticks .ck { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-top: 2px; }
.ticks .ck svg { width: 13px; height: 13px; }
.env-switch { display: flex; gap: .3rem; margin-left: auto; }
.env-switch button { height: 26px; padding: 0 .6rem; border-radius: 6px; font-family: var(--font-mono); font-size: .6875rem; color: var(--text-3); border: 1px solid transparent; }
.env-switch button[aria-pressed="true"] { color: var(--text); border-color: var(--line-hi); background: rgba(var(--fg-rgb), .05); }
.env-window .term { min-height: 330px; }
.env-badge { display: inline-block; padding: 0 .45rem; border-radius: 4px; font-weight: 700; }
.env-badge.dev { background: rgba(61, 220, 151, .16); color: #3ddc97; }
.env-badge.staging { background: rgba(255, 198, 92, .16); color: #ffc65c; }
.env-badge.prod { background: rgba(255, 107, 122, .18); color: #ff6b7a; }

/* ---------- Code blocks ---------- */
.code-window .window-bar { padding-right: .5rem; }
.code-tabs { display: flex; gap: .2rem; overflow-x: auto; scrollbar-width: none; }
.code-tabs::-webkit-scrollbar { display: none; }
.code-tabs button { flex: none; height: 30px; padding: 0 .7rem; border-radius: 7px; font-family: var(--font-mono); font-size: .71875rem; color: var(--text-3); transition: color .2s, background .2s; }
.code-tabs button:hover { color: var(--text); }
.code-tabs button[aria-selected="true"] { color: var(--text); background: rgba(var(--fg-rgb), .07); }
pre.code { margin: 0; padding: 1.1rem 1.25rem; background: var(--code-bg); color: var(--code-text); font-size: .78125rem; line-height: 1.75; overflow-x: auto; tab-size: 2; }
pre.code[hidden] { display: none; }
.code-caption { display: flex; align-items: center; gap: .6rem; padding: .7rem 1.1rem; border-top: 1px solid var(--line); font-size: .78125rem; color: var(--text-3); background: rgba(var(--fg-rgb), .02); }
.code-caption code { color: var(--text-2); }

/* ---------- 04 Graph in, diagram out ---------- */
.graph-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1.5rem; align-items: stretch; }
.graph-out { display: flex; flex-direction: column; }
#graph-code pre.code { flex: 1; }
.graph-out .canvas { margin: 12px; min-height: 420px; }
.graph-out .canvas img { object-position: top center; }
.flow-arrow { display: none; }
.render-row { margin-top: 1.25rem; display: flex; flex-direction: column; gap: .6rem; }
.render-row .label { font-size: .8125rem; color: var(--text-3); }

/* ---------- 05 CI/CD ---------- */
.ci-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.pr { padding: 1.1rem 1.2rem 1.25rem; display: flex; flex-direction: column; gap: .85rem; }
.pr-title { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: .9375rem; }
.pr-title .state { padding: .2rem .6rem; border-radius: 999px; background: rgba(61, 220, 151, .15); color: var(--ok); font-size: .6875rem; font-family: var(--font-mono); }
.check { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 10px; font-size: .8125rem; color: var(--text-2); background: var(--surface); opacity: .35; transition: opacity .4s var(--ease-out), border-color .4s; }
.check .st { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--line-hi); }
.check .st svg { width: 11px; height: 11px; color: #fff; opacity: 0; }
.check .time { margin-left: auto; font-family: var(--font-mono); font-size: .6875rem; color: var(--text-3); }
.check.is-on { opacity: 1; }
.check.is-done { border-color: rgba(61, 220, 151, .35); }
.check.is-done .st { background: var(--ok); border-color: var(--ok); animation: gateLit .7s var(--ease-out); }
.check.is-done .st svg { opacity: 1; }
@keyframes gateLit { 40% { box-shadow: 0 0 0 7px rgba(61, 220, 151, .2); } }
.bot { display: grid; grid-template-columns: 34px 1fr; gap: .7rem; padding-top: .4rem; opacity: 0; transform: translateY(8px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.bot.is-on { opacity: 1; transform: none; }
.bot .av { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; }
.bot .av img { width: 22px; height: 22px; }
.bot .bubble { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.bot .bubble header { padding: .5rem .8rem; font-size: .75rem; color: var(--text-3); border-bottom: 1px solid var(--line); }
.bot .bubble header b { color: var(--text); }
.bot .bubble .diff { display: flex; gap: .6rem; padding: .7rem .8rem; font-family: var(--font-mono); font-size: .71875rem; }
.bot .bubble .diff .a { color: var(--ok); } .bot .bubble .diff .r { color: var(--bad); }
.bot .bubble img { width: 100%; height: 150px; object-fit: cover; object-position: top; background: #fff; border-top: 1px solid var(--line); }
.ci-others { margin-top: 1.25rem; font-size: .875rem; color: var(--text-3); }
.ci-others a { color: var(--accent-text); }

/* ---------- 06 Features ---------- */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.card { position: relative; padding: 1.6rem 1.4rem 1.7rem; background: var(--bg); transition: background .3s; overflow: hidden; }
.card:hover { background: var(--bg-2); }
.card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(260px 160px at var(--mx, 50%) var(--my, 0%), rgba(var(--accent-rgb), .14), transparent 70%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.card:hover::before { opacity: 1; }
.glyph { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 .55rem; border-radius: 10px; border: 1px solid var(--line-hi); background: rgba(var(--fg-rgb), .03); font-family: var(--font-mono); font-size: 1.05rem; font-weight: 500; color: var(--accent-text); }
.card h3 { margin: 1.1rem 0 .4rem; font-family: var(--font-title); font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; }
.card p { margin: 0; font-size: .875rem; color: var(--text-2); }
.card a.more { display: inline-flex; margin-top: .7rem; font-size: .8125rem; color: var(--accent-text); }
.card.wide { grid-column: span 2; }
.stats { display: flex; gap: 2rem; margin-top: 1.1rem; }
.stat b { display: block; font-family: var(--font-title); font-size: 2.1rem; font-weight: 600; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { display: flex; align-items: center; gap: .4rem; margin-top: .4rem; font-size: .75rem; color: var(--text-3); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .06em; }
.stat span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }

/* ---------- 07 Compare ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
table.compare { width: 100%; border-collapse: collapse; min-width: 820px; font-size: .875rem; }
.compare th, .compare td { padding: .95rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { font-family: var(--font-mono); font-size: .6875rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); background: rgba(var(--fg-rgb), .02); }
.compare thead th small { display: block; text-transform: none; letter-spacing: 0; font-size: .6875rem; margin-top: .2rem; opacity: .8; }
.compare tbody th { font-weight: 500; color: var(--text); width: 26%; }
.compare td { color: var(--text-2); }
.compare tr:last-child th, .compare tr:last-child td { border-bottom: 0; }
.compare .tv { background: var(--accent-soft); color: var(--text); }
.compare thead .tv { color: var(--accent-text); }
.m { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; margin-right: .35rem; vertical-align: -5px; font-size: .75rem; font-weight: 700; }
.m.y { background: rgba(61, 220, 151, .16); color: var(--ok); }
.m.p { background: rgba(255, 198, 92, .16); color: var(--warn); }
.m.n { background: rgba(255, 107, 122, .14); color: var(--bad); }

/* ---------- 08 Quick start ---------- */
.steps { display: grid; gap: 1.25rem; counter-reset: step; }
.step { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; padding: 1.75rem; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.step-h { display: flex; flex-direction: column; gap: .6rem; }
.step-h .n { font-family: var(--font-mono); font-size: .75rem; color: var(--accent-text); letter-spacing: .1em; }
.step-h h3 { margin: 0; font-family: var(--font-title); font-size: 1.375rem; font-weight: 600; letter-spacing: -.02em; }
.step-h p { margin: 0; font-size: .875rem; color: var(--text-2); }
.step .window { box-shadow: none; align-self: start; }
.note { margin: .9rem 0 0; font-size: .8125rem; color: var(--text-3); }
.note a, .step-h a { color: var(--accent-text); }
.dl-row { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; padding: 1.25rem; background: var(--code-bg); }
.dl-row p { margin: 0; color: var(--code-text); font-size: .8125rem; flex: 1; min-width: 220px; }
.prompts { display: grid; gap: .6rem; }
.prompt-chip { display: flex; align-items: center; gap: .9rem; padding: .55rem .55rem .55rem 1rem; border-radius: 12px; border: 1px solid var(--line-hi); background: var(--bg); font-size: .875rem; color: var(--text); }
.prompt-chip .q { flex: 1; min-width: 0; }
.prompt-chip .q small { display: block; font-family: var(--font-mono); font-size: .65625rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: .15rem; }

/* ---------- FAQ ---------- */
.faq { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1.5rem; }
.faq details { border-bottom: 1px solid var(--line); padding: .3rem 0 1rem; }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0 .2rem; font-family: var(--font-title); font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--font-mono); color: var(--accent-text); transition: transform .3s var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: .4rem 0 0; color: var(--text-2); font-size: .9375rem; }
.faq details a { color: var(--accent-text); }

/* ---------- CTA ---------- */
.cta { margin-top: clamp(5rem, 11vw, 9rem); padding: clamp(3.5rem, 7vw, 6rem) 1.5rem; text-align: center; position: relative; overflow: hidden; border-top: 1px solid var(--line); }
.cta::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(600px 300px at 50% 100%, rgba(var(--accent-rgb), .25), transparent 70%); }
.cta h2 .l1, .cta h2 .l2 { display: block; }
.cta h2 { margin: 0 auto; max-width: 24ch; font-family: var(--font-title); font-size: clamp(2.3rem, 5.6vw, 4.5rem); font-weight: 600; letter-spacing: -.045em; line-height: 1.02; text-wrap: balance; }
.cta-line { display: inline-flex; width: min(100%, 600px); align-items: center; gap: .6rem; max-width: 100%; margin: 2rem auto 0; padding: .8rem 1.1rem; border-radius: 12px; border: 1px solid var(--line-hi); background: var(--surface); font-family: var(--font-mono); font-size: .875rem; text-align: left; }
.cta-line .gt { color: var(--accent-text); flex: none; }
.cta-line .txt { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: clip; }
/* The swapping word: both words share one grid cell, the inactive one slides out and blurs */
.cta h2 .swap { display: inline-grid; vertical-align: bottom; text-align: center; }
.cta h2 .swap .w { grid-area: 1 / 1; transition: opacity .6s var(--ease-out), transform .6s var(--ease-out), filter .6s var(--ease-out); }
.cta h2 .w-review { color: var(--warm); }
.cta h2 .w-design { color: var(--accent-2); }
.cta h2[data-mode="review"] .w-design { opacity: 0; transform: translateY(.45em); filter: blur(8px); }
.cta h2[data-mode="design"] .w-review { opacity: 0; transform: translateY(-.45em); filter: blur(8px); }
.mode-tag { flex: none; margin-left: auto; padding: .15rem .55rem; border-radius: 999px; font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--warm); background: rgba(var(--warm-rgb), .12); transition: color .4s, background .4s; }
.mode-tag.is-design { color: var(--accent-text); background: var(--accent-soft); }
.cta-caret { flex: none; width: 8px; height: 1.15em; margin-left: -.3rem; background: var(--accent); animation: caret 1s steps(1) infinite; }
.cta .hero-ctas { animation: none; margin-top: 2rem; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; font-size: .8125rem; color: var(--text-3); }
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }
.foot .brand { color: var(--text); font-size: 1rem; }
.foot .brand img { width: 24px; height: 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-left: auto; }
.foot nav a:hover { color: var(--text); }
.foot-legal { width: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding-top: 1.25rem; margin-top: .5rem; border-top: 1px solid var(--line); font-size: .75rem; }

/* ---------- Modal & lightbox ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(6, 6, 14, .78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; visibility: hidden; transition: opacity .3s var(--ease-out), visibility .3s; }
.modal.is-open { opacity: 1; visibility: visible; }
.modal-inner { position: relative; width: min(100%, 1100px); max-height: 100%; transform: translateY(20px) scale(.98); transition: transform .45s var(--ease-out); }
.modal.is-open .modal-inner { transform: none; }
.modal-close { position: absolute; top: -48px; right: 0; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .1); }
.modal-close svg { width: 18px; height: 18px; }
.video-frame { aspect-ratio: 16 / 9; width: 100%; border-radius: 14px; overflow: hidden; background: #000; }
.video-frame iframe { width: 100%; height: 100%; border: 0; }
.lb { display: grid; grid-template-columns: 1fr 340px; max-height: calc(100vh - 120px); border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--line-hi); }
.lb-img { background: #fff; overflow: auto; min-height: 0; }
.lb-img img { width: 100%; height: auto; }
.lb-side { display: flex; flex-direction: column; gap: 1rem; padding: 1.4rem; overflow: auto; }
.lb-side h3 { margin: 0; font-family: var(--font-title); font-size: 1.25rem; letter-spacing: -.02em; }
.lb-side .lbl { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.lb-side blockquote { margin: 0; padding: .9rem 1rem; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: .8125rem; color: var(--text-2); line-height: 1.6; }
.lb-side .cmd-chip { font-size: .71875rem; }
.lb-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.lb-links a { font-size: .75rem; color: var(--accent-text); padding: .3rem .6rem; border-radius: 7px; border: 1px solid var(--line); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 120; transform: translate(-50%, 20px); padding: .6rem 1rem; border-radius: 10px; background: var(--btn-bg); color: var(--btn-fg); font-size: .8125rem; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--ease-out); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .grid-gallery { grid-template-columns: repeat(2, 1fr); }
  .step { grid-template-columns: 1fr; gap: 1.25rem; }
  .artifact-tools span:nth-child(n+3) { display: none; }
}
@media (max-width: 900px) {
  .nav-links, .gh-btn .label { display: none; }
  .stage { height: auto; margin-top: 0; }
  .stage-pin { position: relative; height: auto; padding: 12px 16px 0; perspective: none; }
  .stage-window { height: auto; transform: none !important; }
  .app-body { grid-template-columns: 1fr; }
  .chat { border-right: 0; border-bottom: 1px solid var(--line); }
  .chat-scroll { min-height: 270px; }
  .chat-input { display: none; }
  .canvas { height: 340px; flex: none; }
  .stage-caption { display: none; }
  .scroll-cue { display: none; }
  .stage-next { margin-top: 0; padding-top: clamp(4rem, 10vw, 6rem); }
  .app-name { display: none; }
  .tabs-rail { margin-left: 0; }
  .duo, .split, .graph-grid, .ci-grid, .faq { grid-template-columns: 1fr; }
  .split { gap: 2rem; }
  .lb { grid-template-columns: 1fr; max-height: calc(100vh - 100px); overflow: auto; }
  .lb-img { overflow: visible; }
}
@media (max-width: 640px) {
  .nav-cta { display: none; }
  .pill .pill-more { display: none; }
  .seg button { padding: .3rem .6rem; }
  .hero { padding-top: calc(var(--nav-h) + 3rem); }
  .grid-gallery, .features { grid-template-columns: 1fr; }
  .card.wide { grid-column: auto; }
  .duo .window { height: 400px; }
  .term, .code-pane, pre.code { font-size: .6875rem; }
  .artifact-tools { display: none; }
  .stats { gap: 1.25rem; }
  .stat b { font-size: 1.6rem; }
  .step { padding: 1.1rem; }
  .filters { width: 100%; overflow-x: auto; }
  .hero-ctas .btn { width: 100%; }
  .cta-line { font-size: .75rem; }
  .modal { padding: 12px; }
  .modal-close { top: -46px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .stage-window { transform: none !important; }
  .term .cmd { clip-path: none !important; }
}
