/* ========== MESHOPTIMISER SITE ==========
   The look of the app's own site (apps/meshoptimiser/*.html, written by
   tools/build-app-site.js). It stands apart from the portfolio and takes
   its tokens from the app itself: one near-black, floating surfaces a tone
   up, one accent, Inter at regular and medium weight, text never pure
   white. No gradients, glows or glass. Script: site.js. */

:root {
  --bg: #101010;
  --surface: #161616;
  --surface-2: #1d1d1f;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --tx: #e6e6e8;
  --tx-2: #a3a3a8;
  --tx-3: #6e6e72;
  --accent: #0d99ff;
  --accent-hover: #3aadff;
  --new: #5fd3a0;
  --fix: #f58a9c;
  --perf: #f1b561;
  --polish: #c79bf7;
  --refactor: #86b3f8;
  --r: 10px;
  --r-s: 6px;
  --gutter: clamp(20px, 4.4vw, 56px);
  --max: 1240px;
  --bar-h: 60px;
  --band: clamp(72px, 9vw, 136px);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 24px); scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--tx);
  font: 400 16px/1.6 var(--font);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, strong, b { font-weight: 500; }
dt { font-weight: 400; }
i, em { font-style: normal; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); }

.wrap { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 40; padding: 8px 14px; border-radius: var(--r-s); background: var(--surface-2); text-decoration: none; }
.skip:focus { top: 12px; }

/* ---- the bar: the app's name, its pages, and the way to get it ---- */
.bar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.bar-in { display: flex; align-items: center; gap: 28px; height: var(--bar-h); max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; }
.brand img { width: 26px; height: 26px; border-radius: 6px; }
.brand i {
  margin-left: 2px;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: color-mix(in srgb, var(--accent) 80%, var(--tx));
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a { padding: 7px 12px; border-radius: var(--r-s); color: var(--tx-2); font-size: 14px; text-decoration: none; transition: color 0.15s ease, background-color 0.15s ease; }
.nav a:hover { color: var(--tx); background: var(--surface-2); }
.nav a[aria-current] { color: var(--tx); }
.bar-menu { display: none; }

/* ---- buttons and links ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--r-s);
  background: var(--surface-2);
  color: var(--tx);
  font: 500 14px/1 var(--font);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}
.btn:hover { background: #28282b; }
.btn.is-primary { background: var(--accent); color: #fff; }
.btn.is-primary:hover { background: var(--accent-hover); }
.btn.is-large { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 8px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.more { color: var(--tx-2); font-size: 14px; text-decoration: none; white-space: nowrap; transition: color 0.15s ease; }
.more::after { content: ' →'; }
.more:hover { color: var(--tx); }
.actions .more { margin-left: 8px; }

/* ---- type ---- */
.kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--tx-3); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.kicker b { color: var(--line-strong); font-weight: 400; }
h1 { font-size: clamp(40px, 6.6vw, 88px); line-height: 1.0; letter-spacing: -0.04em; text-wrap: balance; }
h2 { font-size: clamp(26px, 3.2vw, 42px); line-height: 1.1; letter-spacing: -0.03em; text-wrap: balance; }
h3 { font-size: 17px; line-height: 1.35; letter-spacing: -0.01em; }
.lead { max-width: 62ch; color: var(--tx-2); font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55; text-wrap: pretty; }
p { text-wrap: pretty; }
code, kbd { font-family: var(--mono); font-size: 0.86em; font-weight: 400; }
code { padding: 2px 6px; border-radius: 4px; background: var(--surface-2); color: var(--tx); }

/* ---- home: the opening ---- */
.hero { padding-top: clamp(64px, 9vw, 128px); }
.hero h1 { max-width: 13ch; margin-top: 22px; }
.hero .lead { margin-top: clamp(22px, 2.6vw, 34px); }
.hero .actions { margin-top: clamp(28px, 3vw, 40px); }
.hero-shot { margin-top: clamp(48px, 6vw, 88px); }
.hero-shot img { width: 100%; border-radius: clamp(8px, 1vw, 14px); box-shadow: var(--shadow); background: var(--surface); }
.hero-shot figcaption { display: none; }

/* a picture that opens full size */
.zoom { display: block; border-radius: inherit; cursor: zoom-in; }
figcaption { margin-top: 12px; color: var(--tx-3); font-size: 13px; line-height: 1.5; }

/* ---- bands: the page's sections, a hairline between them ---- */
.band { margin-top: var(--band); padding-top: var(--band); border-top: 1px solid var(--line); }
.band.is-first { margin-top: clamp(48px, 6vw, 88px); }
.band-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px 32px; margin-bottom: clamp(32px, 4vw, 56px); }
.band-head .kicker { grid-column: 1 / -1; }
.band-head h2 { max-width: 22ch; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 88px); align-items: start; }
.split-head { display: grid; gap: 14px; justify-items: start; position: sticky; top: calc(var(--bar-h) + 32px); }
.split-body { display: grid; gap: 18px; color: var(--tx-2); font-size: 17px; }

/* headline figures */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 3vw, 48px); }
.figures dt { font-weight: 500; font-size: clamp(24px, 2.6vw, 36px); line-height: 1.1; letter-spacing: -0.03em; }
.figures dd { margin-top: 12px; color: var(--tx-2); font-size: 15px; line-height: 1.5; }

/* what the pipeline collapses */
.collapse { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.collapse caption { padding-bottom: 12px; color: var(--tx-3); font-size: 12px; letter-spacing: 0.1em; text-align: left; text-transform: uppercase; }
.collapse th, .collapse td { padding: 13px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; font-weight: 400; }
.collapse th { width: 38%; color: var(--tx); }
.collapse td:nth-child(2) { width: 2.4em; color: var(--tx-3); }
.collapse .is-total th, .collapse .is-total td { border-top-color: var(--line-strong); color: var(--tx); font-weight: 500; }
.collapse .is-total td:last-child { color: var(--accent); }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 48px); list-style: none; }
.steps li { padding-top: 20px; border-top: 1px solid var(--line-strong); }
.steps i { color: var(--tx-3); font: 400 12px/1 var(--mono); }
.steps h3 { margin-top: 18px; font-size: 20px; }
.steps p { margin-top: 10px; color: var(--tx-2); font-size: 15px; }
.steps.is-stacked { grid-template-columns: minmax(0, 1fr); gap: 0; }
.steps.is-stacked li { display: grid; grid-template-columns: 3em minmax(0, 1fr); column-gap: 8px; padding: 18px 0; border-top-color: var(--line); }
.steps.is-stacked h3 { margin-top: 0; font-size: 16px; }
.steps.is-stacked p { grid-column: 2; margin-top: 4px; }

/* clips: short loops of a tool at work */
.clips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 22px); }
.clip video { width: 100%; aspect-ratio: 592 / 370; object-fit: cover; border-radius: var(--r); background: var(--surface); }
.clip.is-tap video { cursor: pointer; }
.clip figcaption { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; margin-top: 14px; }
.clip figcaption i { color: var(--tx-3); font: 400 12px/1.7 var(--mono); }
.clip figcaption strong { color: var(--tx); font-size: 15px; }
.clip figcaption span { grid-column: 2; }

/* a closer look: a picture and what it shows, side by side */
.spots { display: grid; gap: clamp(48px, 7vw, 112px); }
.spot { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(24px, 4.4vw, 72px); align-items: center; }
.spot.is-flipped > .zoom { order: 2; }
.spot.is-flipped { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
.spot img { width: 100%; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.spot i { color: var(--tx-3); font: 400 12px/1 var(--mono); }
.spot h3 { margin-top: 16px; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.15; letter-spacing: -0.025em; text-wrap: balance; }
.spot p { margin-top: 14px; color: var(--tx-2); font-size: 16px; }

/* the strip of screenshots: paged, it always rests with one picture in the
   middle (site.js settles a mouse drag the same way and frees the strip,
   .is-free, while it has it) */
.strip {
  display: flex;
  gap: clamp(12px, 1.6vw, 22px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 8px max(var(--gutter), (100% - var(--max)) / 2) 0;
  scroll-padding-inline: max(var(--gutter), (100% - var(--max)) / 2);
}
.strip::-webkit-scrollbar { display: none; }
.strip.is-free { scroll-snap-type: none; }
.strip figure { flex: none; width: min(72%, 900px); scroll-snap-align: center; scroll-snap-stop: always; }
.strip img { width: 100%; border-radius: var(--r); background: var(--surface); }
.strip .zoom { cursor: inherit; }
@media (hover: hover) and (pointer: fine) {
  .strip { cursor: grab; user-select: none; -webkit-user-select: none; }
  .strip.is-held { cursor: grabbing; }
}
.dots { display: flex; justify-content: center; gap: 8px; margin-top: 26px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); transition: background-color 0.25s ease; }
.dots i.is-active { background: var(--tx); }

/* tagged changes (the latest release, the changelog) */
.changes, .log-body ul { display: grid; gap: 12px; margin-top: 8px; list-style: none; }
.changes li, .log-body li { display: grid; grid-template-columns: 5.2em minmax(0, 1fr); gap: 12px; font-size: 15px; color: var(--tx-2); }
.changes b, .log-body b { font: 500 11px/2.1 var(--font); letter-spacing: 0.08em; text-transform: uppercase; }
b.is-new { color: var(--new); }
b.is-fix { color: var(--fix); }
b.is-perf { color: var(--perf); }
b.is-polish { color: var(--polish); }
b.is-refactor { color: var(--refactor); }

/* ---- inner pages: the opening ---- */
.page-head { padding-top: clamp(56px, 8vw, 112px); }
.page-head h1 { max-width: 20ch; margin-top: 20px; font-size: clamp(34px, 5vw, 64px); line-height: 1.04; letter-spacing: -0.035em; }
.page-head h1 span { color: var(--tx-3); }
.page-head .lead { margin-top: 22px; }
.page-head .actions { margin-top: 32px; }
.page-head + .wrap { margin-top: clamp(40px, 5vw, 72px); }

/* features: a list per group */
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 3vw, 48px); list-style: none; }
.features li { display: grid; gap: 6px; align-content: start; padding: 18px 0 20px; border-top: 1px solid var(--line); }
.features strong { font-size: 15px; }
.features span { color: var(--tx-2); font-size: 15px; line-height: 1.5; }

/* screenshots: all of them */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 3.4vw, 48px) clamp(14px, 2vw, 28px); }
.gallery img { width: 100%; border-radius: var(--r); background: var(--surface); transition: opacity 0.15s ease; }
.gallery .zoom:hover img { opacity: 0.86; }

/* ---- docs: a knowledge base. The home lists every article by group, with
   a search; an article has the index of all of them beside it ---- */
.kb { display: grid; gap: clamp(56px, 7vw, 104px); }
.kb-search { position: sticky; top: calc(var(--bar-h) + 12px); z-index: 5; max-width: 560px; }
.kb-search input {
  width: 100%;
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--tx);
  font: 400 16px/1 var(--font);
  box-shadow: 0 0 0 1px var(--line), 0 12px 32px rgba(0, 0, 0, 0.4);
  outline: none;
}
.kb-search input::placeholder { color: var(--tx-3); }
.kb-search input:focus-visible { box-shadow: 0 0 0 1px var(--accent), 0 12px 32px rgba(0, 0, 0, 0.4); }
.kb-none { margin-top: 20px; color: var(--tx-2); }
.kb-none a, .kb-body a, .kb-article .kicker a:hover { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.kb-group { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(20px, 4vw, 72px); align-items: start; scroll-margin-top: calc(var(--bar-h) + 84px); }
.kb-group[hidden] { display: none; }
.kb-group-head { position: sticky; top: calc(var(--bar-h) + 84px); display: grid; gap: 10px; }
.kb-group-head h2 { font-size: clamp(24px, 2.6vw, 34px); }
.kb-group-head p { max-width: 32ch; color: var(--tx-2); font-size: 15px; }
.kb-list { display: grid; list-style: none; counter-reset: kb; }
.kb-list li { counter-increment: kb; border-top: 1px solid var(--line); }
.kb-list li[hidden] { display: none; }
.kb-list a { display: grid; grid-template-columns: 2.6em minmax(0, 1fr); gap: 2px 8px; padding: 16px 0 18px; text-decoration: none; }
.kb-list a::before { content: counter(kb, decimal-leading-zero); grid-row: 1 / 3; color: var(--tx-3); font: 400 12px/2 var(--mono); }
.kb-list strong { font-size: 16px; transition: color 0.15s ease; }
.kb-list span { grid-column: 2; color: var(--tx-2); font-size: 14.5px; line-height: 1.5; }
.kb-list a:hover strong { color: var(--accent-hover); }

.kb-page { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: clamp(32px, 6vw, 104px); align-items: start; padding-top: clamp(40px, 5vw, 72px); }
.kb-nav { position: sticky; top: calc(var(--bar-h) + 28px); display: grid; gap: 1px; max-height: calc(100vh - var(--bar-h) - 56px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding-bottom: 24px; }
.kb-nav::-webkit-scrollbar { display: none; }
.kb-nav h2 { margin: 20px 0 6px; color: var(--tx-3); font-size: 11px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; }
.kb-nav a { padding: 4px 0; color: var(--tx-2); font-size: 13.5px; line-height: 1.4; text-decoration: none; transition: color 0.15s ease; }
.kb-nav a:hover { color: var(--tx); }
.kb-nav a[aria-current] { color: var(--accent); }
.kb-nav-home::before { content: '← '; }
.kb-article { min-width: 0; max-width: 760px; }
.kb-article .kicker a { text-decoration: none; }
.kb-article h1 { margin-top: 18px; font-size: clamp(32px, 4.2vw, 52px); line-height: 1.06; letter-spacing: -0.035em; }
.kb-article .lead { margin-top: 20px; }
.kb-body { display: grid; gap: 18px; margin-top: clamp(32px, 4vw, 52px); padding-top: clamp(28px, 3vw, 40px); border-top: 1px solid var(--line); font-size: 16.5px; line-height: 1.65; }
.kb-body > * { min-width: 0; }
.kb-body p, .kb-body li { color: var(--tx-2); }
.kb-body h2 { margin-top: clamp(20px, 2.6vw, 36px); font-size: clamp(21px, 2vw, 26px); letter-spacing: -0.02em; scroll-margin-top: calc(var(--bar-h) + 24px); }
.kb-body h2:first-child { margin-top: 0; }
.kb-body a:hover { text-decoration-color: currentColor; }
.ui { color: var(--tx); }
.kb-steps { display: grid; gap: 0; list-style: none; counter-reset: step; }
.kb-steps li { counter-increment: step; position: relative; padding: 13px 0 13px 46px; border-top: 1px solid var(--line); }
.kb-steps li:last-child { border-bottom: 1px solid var(--line); }
.kb-steps li::before { content: counter(step); position: absolute; left: 0; top: 13px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); color: var(--tx); font: 400 12px/1 var(--mono); }
.kb-points { display: grid; gap: 8px; padding-left: 1.15em; }
.kb-points li::marker { color: var(--tx-3); }
.kb-note { padding: 16px 20px; border-radius: var(--r); background: var(--surface); box-shadow: inset 2px 0 0 var(--accent); }
.kb-note p { color: var(--tx); font-size: 15.5px; }
.kb-code { display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 18px; border-radius: var(--r); background: var(--surface); }
.kb-code code { flex: 1; min-width: 0; padding: 0; background: none; overflow-x: auto; white-space: nowrap; scrollbar-width: none; font-size: 13.5px; }
.kb-keys > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; }
.kb-keys dt { display: flex; flex: none; gap: 4px; order: 2; }
.kb-keys dd { color: var(--tx-2); }
.kb-figure img { width: 100%; border-radius: var(--r); background: var(--surface); }
.kb-see { margin-top: clamp(16px, 2vw, 28px); }
.kb-see h2 { margin: 0 0 8px; color: var(--tx-3); font-size: 12px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; }
.kb-see ul { display: grid; gap: 6px; list-style: none; }
.kb-see li::before { content: '→ '; color: var(--tx-3); }
.kb-turn { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: clamp(48px, 6vw, 80px); }
.kb-turn a { display: grid; gap: 6px; padding: 18px 20px; border-radius: var(--r); background: var(--surface); text-decoration: none; transition: background-color 0.15s ease; }
.kb-turn a:hover { background: var(--surface-2); }
.kb-turn a.is-after { text-align: right; }
.kb-turn span { color: var(--tx-3); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.kb-turn strong { font-size: 16px; }
.log-more a, .foot-end a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.foot-end a:hover { text-decoration-color: currentColor; }

.table > div { display: grid; grid-template-columns: minmax(110px, 0.34fr) minmax(0, 1fr); gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); font-size: 15px; }
.table dt { color: var(--tx); }
.table dd { color: var(--tx-2); }

.commands { display: grid; gap: 8px; margin-top: 4px; }
.commands > div { display: grid; grid-template-columns: minmax(110px, 0.22fr) minmax(0, 1fr); align-items: center; gap: 16px; padding: 8px 8px 8px 18px; border-radius: var(--r); background: var(--surface); }
.commands dt { color: var(--tx-2); font-size: 14px; font-weight: 400; }
.commands dd { display: flex; align-items: center; gap: 12px; min-width: 0; }
.commands code { flex: 1; min-width: 0; padding: 0; background: none; overflow-x: auto; white-space: nowrap; scrollbar-width: none; font-size: 13.5px; }
.steps + .commands { margin-top: clamp(32px, 4vw, 56px); }
.copy { flex: none; height: 30px; padding: 0 12px; border: 0; border-radius: var(--r-s); background: var(--surface-2); color: var(--tx-2); font: 400 13px/1 var(--font); cursor: pointer; transition: color 0.15s ease, background-color 0.15s ease; }
.copy:hover { color: var(--tx); background: #28282b; }
.copy.is-done { color: var(--new); }

kbd { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 5px; background: var(--surface-2); color: var(--tx); font-size: 12px; white-space: pre; }

/* changelog */
.log { display: grid; list-style: none; }
.log > li { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: clamp(20px, 4vw, 72px); padding: clamp(28px, 3.4vw, 44px) 0; border-top: 1px solid var(--line); }
.log-head { display: flex; flex-wrap: wrap; align-items: center; align-content: start; gap: 10px; position: sticky; top: calc(var(--bar-h) + 24px); align-self: start; }
.log-head strong { font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -0.02em; }
.log-head em { padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: color-mix(in srgb, var(--accent) 80%, var(--tx)); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.log-head span { flex-basis: 100%; color: var(--tx-3); font-size: 14px; }
.log-body { display: grid; gap: 18px; max-width: 760px; }
.log-body > p { font-size: 17px; color: var(--tx); }
.log-more { margin-top: 32px; }

/* ---- the way to get it, at the foot of every page ---- */
.get-in { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 32px; }
.get h2 { font-size: clamp(30px, 4.4vw, 60px); letter-spacing: -0.035em; line-height: 1.02; }
.get p { max-width: 52ch; margin-top: 18px; color: var(--tx-2); font-size: 17px; }

/* ---- footer ---- */
.foot { margin-top: var(--band); border-top: 1px solid var(--line); background: #0c0c0c; }
.foot-in { display: grid; grid-template-columns: minmax(0, 2.2fr) repeat(3, minmax(0, 1fr)); gap: 40px clamp(24px, 4vw, 64px); padding-block: clamp(48px, 6vw, 80px) 40px; }
.foot-brand p { max-width: 30ch; margin-top: 14px; color: var(--tx-3); font-size: 14px; }
.foot nav { display: grid; gap: 9px; align-content: start; }
.foot nav h2 { margin-bottom: 6px; color: var(--tx-3); font-size: 12px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; }
.foot nav a { color: var(--tx-2); font-size: 14px; text-decoration: none; transition: color 0.15s ease; }
.foot nav a:hover { color: var(--tx); }
.foot-end { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 22px 28px; border-top: 1px solid var(--line); color: var(--tx-3); font-size: 13px; }

/* ---- lightbox (site.js) ---- */
.lb { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: rgba(8, 8, 8, 0.96); opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0.2s; }
.lb.is-open { opacity: 1; visibility: visible; }
.lb-stage { display: grid; place-items: center; min-height: 0; padding: clamp(16px, 4vw, 56px) clamp(16px, 6vw, 96px) 0; }
.lb-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 8px; }
.lb-foot { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 18px var(--gutter) 24px; color: var(--tx-2); font-size: 14px; text-align: center; }
.lb-foot span { color: var(--tx-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb button { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--tx); font: 400 20px/1 var(--font); cursor: pointer; transition: background-color 0.15s ease; }
.lb button:hover { background: #2c2c2f; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; translate: 0 -50%; }
.lb-next { right: 16px; top: 50%; translate: 0 -50%; }
.lb-lock { overflow: hidden; }

/* ---- narrower windows ---- */
@media (max-width: 1000px) {
  .clips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .log > li { grid-template-columns: minmax(0, 1fr); }
  .split-head, .log-head { position: static; }
  .spot, .spot.is-flipped { grid-template-columns: minmax(0, 1fr); }
  .spot.is-flipped > .zoom { order: 0; }
  .kb-group, .kb-page { grid-template-columns: minmax(0, 1fr); }
  .kb-group-head { position: static; }
  .kb-nav { display: none; }
  .foot-in { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .bar-in { gap: 12px; }
  .bar-get { margin-left: auto; }
  .bar-menu { display: grid; place-content: center; gap: 6px; width: 36px; height: 36px; border: 0; border-radius: var(--r-s); background: var(--surface-2); cursor: pointer; }
  .bar-menu span { display: block; width: 16px; height: 1.5px; background: var(--tx); transition: translate 0.2s ease, rotate 0.2s ease; }
  .bar-menu[aria-expanded='true'] span:first-child { translate: 0 3.75px; rotate: 45deg; }
  .bar-menu[aria-expanded='true'] span:last-child { translate: 0 -3.75px; rotate: -45deg; }
  .nav { position: absolute; left: 0; right: 0; top: var(--bar-h); display: none; flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 8px var(--gutter) 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .nav.is-open { display: flex; }
  .nav a { padding: 13px 0; border-radius: 0; border-top: 1px solid var(--line); font-size: 16px; }
  .nav a:first-child { border-top: 0; }
  .nav a:hover { background: none; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .features, .gallery, .kb-turn { grid-template-columns: minmax(0, 1fr); }
  .kb-turn a.is-after { text-align: left; }
  .band-head { grid-template-columns: minmax(0, 1fr); }
  .strip figure { width: 86%; }
  .commands > div { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px 8px 8px 16px; }
  .collapse th { width: 44%; }
  .lb-prev, .lb-next { display: none; }
  .foot-in { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
  .clips { grid-template-columns: minmax(0, 1fr); }
  .figures { grid-template-columns: minmax(0, 1fr); }
  .brand i { display: none; }
  .actions .btn.is-large { flex: 1 1 auto; }
  .actions .more { flex-basis: 100%; margin: 4px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
