/* UI Vault — site styles (v3, editorial) */
:root {
  --bg: #f4f2ee;
  --bg-2: #fbfaf8;
  --surface: #fbfaf8;
  --surface-2: #ece9e3;
  --line: #1a19171a;
  --line-2: #1a19172e;
  --text: #1a1917;
  --muted: #5f5b54;
  --dim: #8f8a82;
  --accent: #ff4f00;
  --radius: 6px;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --display: var(--font);
  color-scheme: light;
}
:root[data-theme="dark"]:not([data-uv-theme]) {
  --bg: #121211;
  --bg-2: #181817;
  --surface: #181817;
  --surface-2: #232321;
  --line: #ffffff14;
  --line-2: #ffffff26;
  --text: #ecebe8;
  --muted: #a19d95;
  --dim: #6f6b64;
  --accent: #ff6a26;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overscroll-behavior-y: none; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
::selection { background: var(--accent); color: #fff; }
code { font-family: var(--mono); font-size: .88em; }
.muted { color: var(--muted); }

/* paper texture: very faint, static */
.bg-grain { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ── Top bar ── */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 24px; padding: 0 clamp(16px, 4vw, 40px); height: 60px; background: var(--bg); border-bottom: 1px solid var(--line-2); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 16px var(--font); letter-spacing: -.01em; }
.topnav { display: flex; gap: 2px; margin-left: auto; }
.topnav a { text-decoration: none; color: var(--muted); font: 500 13.5px var(--font); padding: 6px 10px; border-radius: 4px; transition: color .15s, background .15s; }
.topnav a:hover { color: var(--text); background: var(--surface-2); }
.topnav__app { color: var(--text) !important; }
.topbar__actions { display: flex; gap: 8px; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 4px; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; transition: background .15s; }
.icon-btn:hover { background: var(--surface-2); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }

/* ── Hero ── */
.hero { max-width: 1200px; margin: 0 auto; padding: clamp(56px, 9vw, 112px) clamp(16px, 4vw, 40px) 48px; }
.hero__kicker { display: flex; flex-wrap: wrap; margin: 0 0 28px; font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.hero__kicker span { padding: 4px 10px; border: 1px solid var(--line-2); margin: 0 -1px -1px 0; }
.hero__kicker span:first-child { background: var(--text); color: var(--bg); border-color: var(--text); }
.hero__kicker #demoCountBadge { color: var(--accent); }
.hero h1 { max-width: 15ch; margin: 0 0 28px; font: 400 clamp(52px, 9vw, 120px)/.95 var(--serif); letter-spacing: -.025em; }
.hero h1 em, .section h2 em { color: var(--muted); }
.hero__sub { max-width: 560px; margin: 0 0 36px; color: var(--muted); font-size: 18px; line-height: 1.55; }
.grad-text { color: var(--accent); }

.search { position: relative; display: flex; align-items: center; gap: 12px; max-width: 640px; padding: 0 12px 0 16px; height: 52px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-2); color: var(--dim); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--text); box-shadow: 0 0 0 3px var(--line); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: 16px var(--font); }
.search input::-webkit-search-cancel-button { display: none; }
kbd { font: 500 11px var(--mono); padding: 2px 6px; border-radius: 3px; color: var(--muted); border: 1px solid var(--line-2); background: var(--bg); }
.hero__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 3px; cursor: pointer; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: 500 12px var(--mono); transition: color .15s, border-color .15s, background .15s; }
.chip:hover { color: var(--text); border-color: var(--text); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 64px 0 0; border-top: 1px solid var(--text); }
.stats div { padding: 14px 16px 0 0; }
.stats div + div { padding-left: 16px; border-left: 1px solid var(--line-2); }
.stats dt { color: var(--muted); font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.stats dd { margin: 6px 0 0; font: 400 48px/1 var(--serif); font-variant-numeric: tabular-nums; }

/* ── Hero specimen ── */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 340px; column-gap: 64px; }
.hero > * { grid-column: 1; }
.hero > .spec { grid-column: 2; grid-row: 1 / span 6; align-self: start; margin-top: 4px; }
.hero > .stats { grid-column: 1 / -1; }
.spec { border: 1px solid var(--text); border-radius: var(--radius); background: var(--surface); font-size: 13px; }
.spec > * + * { border-top: 1px solid var(--line-2); }
.spec__head { display: flex; justify-content: space-between; padding: 8px 14px; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--text); }
.spec__type { display: flex; align-items: center; gap: 18px; padding: 18px 14px; }
.spec__type b { font: 400 88px/.8 var(--serif); letter-spacing: -.03em; }
.spec__type p { margin: 0; color: var(--muted); } .spec__type p:first-child { font: 400 22px var(--serif); color: var(--text); }
.spec__sw { display: grid; grid-template-columns: repeat(4, 1fr); }
.spec__sw div { display: grid; gap: 2px; padding: 12px 10px; }
.spec__sw div + div { border-left: 1px solid var(--line-2); }
.spec__sw i { display: block; height: 34px; border-radius: 3px; background: var(--c); border: 1px solid var(--line-2); margin-bottom: 6px; }
.spec__sw span { font-weight: 500; } .spec__sw code { font-size: 10px; color: var(--dim); }
.spec__ui { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px; }
.spec__list { list-style: none; margin: 0; padding: 4px 14px; }
.spec__list li { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; }
.spec__list li + li { border-top: 1px dashed var(--line-2); }
.spec__list b { font: 400 24px var(--serif); font-variant-numeric: tabular-nums; }
.spec__foot { display: block; padding: 10px 14px; font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .04em; text-decoration: none; transition: background .15s, color .15s; }
.spec__foot:hover { background: var(--text); color: var(--bg); }
@media (max-width: 1060px) { .hero { grid-template-columns: 1fr; } .hero > .spec { grid-column: 1; grid-row: auto; order: 9; margin: 40px 0 0; max-width: 420px; } .hero > .stats { order: 10; } }
.pg-tools { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.search--sm { height: 40px; max-width: 320px; flex: 1; }
.search--sm input { font-size: 14px; }
.pg-count { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* ── Sections ── */
.section { max-width: 1200px; margin: 0 auto; padding: 96px clamp(16px, 4vw, 40px) 16px; }
.section__head { display: grid; grid-template-columns: 200px 1fr; gap: 8px 32px; margin-bottom: 32px; padding-top: 16px; border-top: 1px solid var(--text); }
.section__head .eyebrow { grid-row: span 2; }
.eyebrow { margin: 0; font: 500 12px var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.section h2 { margin: 0; font: 400 clamp(36px, 5vw, 60px)/1 var(--serif); letter-spacing: -.02em; }
.section__sub { margin: 10px 0 0; max-width: 620px; color: var(--muted); font-size: 16px; }
.section__sub code { color: var(--text); }

/* ── Library promo ── */
.api-promo { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.api-promo > div { padding-top: 16px; border-top: 1px solid var(--text); }
.api-promo h2 { margin: 12px 0 0; }
.api-promo__cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.api-promo__code { margin: 0; padding: 24px; border-radius: var(--radius); background: #1a1917; color: #d9d6cf; font: 13px/1.75 var(--mono); overflow: auto; }
.api-promo__code .c { color: #8f8a82; }

/* ── Category tabs ── */
.cat-tabs { position: relative; display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line-2); }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tabs button { position: relative; z-index: 1; flex: none; display: flex; align-items: baseline; gap: 6px; padding: 10px 14px 12px; border: 0; background: none; cursor: pointer; color: var(--muted); font: 500 14px var(--font); white-space: nowrap; transition: color .15s; }
.cat-tabs button:hover, .cat-tabs button[aria-selected="true"] { color: var(--text); }
.cat-tabs button .ic { display: none; }
.cat-tabs button .n { font: 500 11px var(--mono); color: var(--dim); }
.cat-tabs__ind { position: absolute; bottom: 0; left: 0; height: 2px; width: 0; background: var(--accent); transition: transform .35s cubic-bezier(.6, 0, .2, 1), width .35s cubic-bezier(.6, 0, .2, 1); }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 20px; }
.toolbar p { margin: 0; font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.toolbar__right { display: flex; align-items: center; gap: 14px; }
select, .field input:not([type=color]):not([type=range]) { height: 36px; padding: 0 10px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 500 14px var(--font); outline: none; }
select:focus, .field input:focus { border-color: var(--text); }
.mini-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; user-select: none; }
.mini-switch input { position: absolute; opacity: 0; }
.mini-switch i { position: relative; width: 30px; height: 18px; border-radius: 99px; background: var(--line-2); transition: background .2s; }
.mini-switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); transition: transform .2s; }
.mini-switch input:checked + i { background: var(--text); }
.mini-switch input:checked + i::after { transform: translateX(12px); }
.mini-switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Resource index (ruled grid) ── */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); border-top: 1px solid var(--line-2); border-left: 1px solid var(--line-2); }
.res { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 16px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); transition: background .15s; animation: rise .35s ease both; }
.res:hover { background: var(--surface); }
.res::before { content: ""; position: absolute; left: 0; top: 0; width: 2px; height: 0; background: var(--accent); transition: height .25s; }
.res:hover::before { height: 100%; }
@keyframes rise { from { opacity: 0; } }
.res__top { display: flex; align-items: flex-start; gap: 12px; }
.res__logo { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 4px; font: 500 13px var(--mono); color: var(--text) !important; background: var(--surface-2) !important; border: 1px solid var(--line); }
.res__name { font: 600 15px/1.25 var(--font); margin: 0; letter-spacing: -.01em; }
.res__host { font: 12px var(--mono); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 180px; }
.res__fav { margin-left: auto; width: 28px; height: 28px; border-radius: 4px; border: 0; cursor: pointer; background: none; color: var(--dim); font-size: 15px; position: relative; z-index: 2; transition: color .15s, background .15s; }
.res__fav:hover { background: var(--surface-2); color: var(--text); }
.res__fav[aria-pressed="true"] { color: var(--accent); }
.res__fav.pop { animation: pop .3s ease; }
@keyframes pop { 50% { transform: scale(1.3); } }
.res__desc { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; flex: 1; }
.res__meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.tag { font: 500 11px var(--mono); color: var(--dim); }
.tag::before { content: "#"; opacity: .6; }
.tag--lic, .tag--free { padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 3px; color: var(--text); }
.tag--lic::before, .tag--free::before { content: none; }
.tag--free { border-style: dashed; }
.res__link { position: absolute; inset: 0; z-index: 1; }
.res__link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; padding: 0 1px; }
.empty { text-align: center; padding: 60px 0; color: var(--muted); }

/* ── Playground ── */
.seg-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.seg-tabs button { padding: 5px 12px; border-radius: 3px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .04em; cursor: pointer; transition: all .15s; }
.seg-tabs button:hover { color: var(--text); border-color: var(--text); }
.seg-tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.demo { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-2); background: var(--surface); animation: rise .35s ease both; }
.demo__stage { display: grid; place-items: center; min-height: 220px; padding: 30px 24px; background: #141413; }
.demo__bar { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; border-top: 1px solid var(--line-2); }
.demo__bar h3 { margin: 0; flex: 1; font: 500 14px var(--font); }
.demo__bar small { font: 11px var(--mono); color: var(--dim); text-transform: uppercase; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 4px; font: 500 14px var(--font); text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn--primary { color: var(--bg); background: var(--text); }
.btn--primary:hover { background: var(--accent); color: #fff; }
.btn--ghost { color: var(--text); background: transparent; border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.btn--sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn--lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn--full { width: 100%; }

/* ── Post-FX ── */
.fx { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.fx__stage { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-2); background: #000; align-self: start; }
.fx__stage canvas { display: block; width: 100%; height: auto; aspect-ratio: 16/9; }
.fx__overlay { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.fx__overlay .chip { background: #000c; color: #fff; border-color: #ffffff40; }
.fx__nogl { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #aaa; }
.fx__panel { display: flex; flex-direction: column; gap: 16px; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface); }
.fx__presets { display: flex; flex-wrap: wrap; gap: 6px; }
.fx__presets .chip[aria-pressed="true"] { color: var(--bg); background: var(--text); border-color: var(--text); }
.fx__sliders { display: grid; gap: 12px; }
.slider { display: grid; gap: 6px; }
.slider span { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.slider output { font: 12px var(--mono); color: var(--text); }
input[type=range] { --v: 50%; -webkit-appearance: none; appearance: none; width: 100%; height: 2px; background: linear-gradient(90deg, var(--text) var(--v), var(--line-2) var(--v)); outline: none; cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--text); }
input[type=range]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--text); }

/* ── Logo forge ── */
.forge { display: grid; grid-template-columns: 380px 1fr; gap: 16px; }
.forge__controls { display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface); }
.field { display: grid; gap: 6px; flex: 1; }
.field > span { font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.field input:not([type=color]):not([type=range]) { width: 100%; }
.field input[type=color] { width: 100%; height: 36px; padding: 3px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; }
.field input[type=range] { margin-top: 16px; }
.field-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.mark-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.mark-pick button { aspect-ratio: 1; border-radius: 4px; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; display: grid; place-items: center; transition: background .15s; }
.mark-pick button:hover { background: var(--surface-2); }
.mark-pick button[aria-pressed="true"] { border-color: var(--text); background: var(--text); color: var(--bg); }
.forge__preview { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; gap: 16px; }
.forge__tile { display: grid; place-items: center; min-height: 220px; border-radius: var(--radius); border: 1px solid var(--line-2); padding: 20px; }
.forge__tile svg { max-width: 100%; height: auto; }
.forge__tile--dark { background: #141413; }
.forge__tile--light { background: #fbfaf8; }
.forge__icons { grid-column: 1 / -1; display: flex; align-items: end; justify-content: center; gap: 22px; padding: 20px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface); }
.forge__icons figure { margin: 0; display: grid; justify-items: center; gap: 6px; }
.forge__icons figcaption { font: 11px var(--mono); color: var(--dim); }

/* ── Flow teaser ── */
.showcase { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.showcase__text { padding-top: 16px; border-top: 1px solid var(--text); }
.showcase__text h2 { margin: 12px 0 0; }
.showcase .section__sub { margin-bottom: 24px; }
.showcase__preview { display: grid; place-items: center; min-height: 340px; border-radius: var(--radius); text-decoration: none; background: #141413; border: 1px solid var(--line-2); transition: transform .3s ease; }
.showcase__preview:hover { transform: translateY(-3px); }
.mock-ring { position: relative; width: 220px; height: 220px; display: grid; place-content: center; text-align: center; color: #ecebe8; }
.mock-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.mr-track { fill: none; stroke: #ffffff14; stroke-width: 3; }
.mr-fill { fill: none; stroke: #ff6a26; stroke-width: 3; stroke-dasharray: 327; stroke-dashoffset: 90; }
.mock-ring b { font: 400 56px var(--serif); font-variant-numeric: tabular-nums; }
.mock-ring small { color: #a19d95; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; }

/* ── Footer ── */
.footer { max-width: 1200px; margin: 96px auto 0; padding: 20px clamp(16px, 4vw, 40px) 48px; border-top: 1px solid var(--text); color: var(--muted); font-size: 13px; }
.footer p { margin: 4px 0; }

/* ── Code dialog ── */
.code-dlg { width: min(760px, calc(100vw - 32px)); max-height: 80vh; padding: 0; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); box-shadow: 0 24px 60px #0004; }
.code-dlg[open] { display: flex; flex-direction: column; animation: dlg .2s ease; }
.code-dlg::backdrop { background: #1a191766; }
@keyframes dlg { from { opacity: 0; transform: translateY(6px); } }
.code-dlg header { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--line-2); }
.code-dlg h3 { margin: 0; font: 400 22px var(--serif); flex: 1; }
.code-dlg__tabs { display: flex; gap: 2px; }
.code-dlg__tabs button { padding: 5px 10px; border-radius: 3px; border: 0; background: none; color: var(--muted); font: 500 12px var(--mono); cursor: pointer; }
.code-dlg__tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); }
.code-dlg pre { margin: 0; padding: 20px; overflow: auto; flex: 1; font: 13px/1.65 var(--mono); color: #d9d6cf; background: #1a1917; }
.code-dlg footer { padding: 10px 12px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; }

/* ── Toasts ── */
.toast-host { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 4px; background: var(--text); color: var(--bg); font: 500 13px var(--mono); animation: tin .25s ease; }
.toast.out { animation: tout .2s forwards; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
@keyframes tout { to { opacity: 0; } }

/* ── Responsive ── */
@media (max-width: 960px) {
  .topnav a { padding: 6px 7px; }
  .fx, .forge, .showcase, .api-promo { grid-template-columns: 1fr; }
  .section__head { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats div:nth-child(3) { border-left: 0; padding-left: 0; }
  .demo-grid { grid-template-columns: 1fr; }
  .forge__preview { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ── Motion (assets/js/anim.js adds .anim to <html>) ── */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; background: var(--accent); transform-origin: left; transform: scaleX(0); pointer-events: none; }
.anim .hero h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.anim .hero h1 .w > span { display: inline-block; transform: translateY(105%); animation: word-rise .9s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: calc(120ms + var(--i) * 70ms); }
@keyframes word-rise { to { transform: none; } }
.anim .rv { opacity: 0; transform: translateY(18px); transition: opacity .45s cubic-bezier(.2, .8, .2, 1), transform .5s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0ms); }
.anim .rv.in { opacity: 1; transform: none; }
.anim .section__head.rv { transform: none; clip-path: inset(0 0 100% 0); transition: clip-path .9s cubic-bezier(.7, 0, .2, 1), opacity .5s; }
.anim .section__head.rv.in { clip-path: inset(0 0 0 0); }
.anim .res.rv { transform: translateY(14px); }
.anim .demo.rv { transform: translateY(26px) scale(.98); }
.btn--primary { position: relative; overflow: hidden; }
.btn--primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, #ffffff40 50%, transparent 65%); transform: translateX(-120%); transition: transform .7s; }
.btn--primary:hover::after { transform: translateX(120%); }
.res__logo { transition: transform .35s cubic-bezier(.3, 1.4, .5, 1), background .2s; }
.res:hover .res__logo { transform: rotate(-6deg) scale(1.08); background: var(--accent) !important; color: #fff !important; }
.spec { will-change: translate; }

/* ── Waterfall background (lib/js/waterfall.js) ── */
body.has-wf { background: transparent; }
body.has-wf .uv-waterfall-veil { background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 30%, transparent) 0, color-mix(in srgb, var(--bg) 62%, transparent) 50vh, color-mix(in srgb, var(--bg) 80%, transparent) 100%); }
html[data-theme="light"]:not([data-uv-theme]) body.has-wf .uv-waterfall-veil { background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 50%, transparent) 0, color-mix(in srgb, var(--bg) 80%, transparent) 50vh, color-mix(in srgb, var(--bg) 90%, transparent) 100%); }
body.has-wf .topbar { background: var(--bg); }  /* no backdrop blur over the animated canvas: keeps scrolling smooth */
body.has-wf .res-grid, body.has-wf .stats { background: color-mix(in srgb, var(--bg) 55%, transparent); }

/* performance: don't render/animate off-screen repeated items */
.res, .demo { content-visibility: auto; contain-intrinsic-size: auto 190px; }
.demo { contain-intrinsic-size: auto 280px; }

/* ── See examples band (home) ─────────────────────────────── */
.ex-band__card { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: center; padding: 30px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface); color: inherit; text-decoration: none; transition: border-color .25s, box-shadow .25s; }
.ex-band__card:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 30px 60px -40px var(--accent); }
.ex-band__card h2 em { color: var(--accent); }
.ex-band__card .btn { margin-top: 18px; }
.ex-band__tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ex-band__tiles i { display: grid; place-items: end start; aspect-ratio: 4 / 3; padding: 10px; border-radius: 10px; background: var(--b); color: #fff; font: 600 13px/1 var(--mono, monospace); font-style: normal; letter-spacing: .1em; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.ex-band__card:hover .ex-band__tiles i { transform: translateY(-4px); } .ex-band__card:hover .ex-band__tiles i:nth-child(even) { transform: translateY(4px); }
@media (max-width: 800px) { .ex-band__card { grid-template-columns: 1fr; } }
