/* ==========================================================================
   CODEZY site — "terminal brutalism".
   Direction (ui-ux-pro-max --variance 8 · Brutalism, bent toward the brand):
   sharp corners everywhere (--r: 0), visible 1.5–2px borders, hard offset
   shadows that press on interaction, rule + index section headers, mono
   annotations (// …), blueprint grid backdrop.
   LOCKED: accent #3d9bff everywhere (brand); radius system = 0 for every
   box (circles only for window dots / status dots); one font pair
   (Geist + Geist Mono, self-hosted).
   ========================================================================== */

/* ---- fonts (self-hosted, font-display: swap) ---- */
@font-face { font-family: 'Geist'; src: url('fonts/geist-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('fonts/geist-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('fonts/geist-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('fonts/geist-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('fonts/geist-800.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('fonts/geistmono-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('fonts/geistmono-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('fonts/geistmono-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

/* ---- tokens ---- */
:root {
  --sans: 'Geist', system-ui, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', 'Cascadia Code', Consolas, monospace;

  --accent: #3d9bff;
  --accent-fill: #3d9bff; /* button / block fill */
  --accent-ink: #3d9bff;  /* accent as text */
  --on-accent: #06101d;   /* text on accent fills */
  --ok: #3ecf8e;
  --err: #ff5c7a;

  --bg: #101018;
  --bg-2: #16161f;
  --bg-3: #1c1c27;
  --panel: #17171f;
  --line: rgba(255, 255, 255, 0.14);   /* visible borders — brutalism */
  --line-2: rgba(255, 255, 255, 0.32);
  --text: #ececf5;
  --text-2: #a7adbe;
  --text-3: #7d8497;
  --accent-soft: rgba(61, 155, 255, 0.13);
  --ok-soft: rgba(62, 207, 142, 0.12);
  --err-soft: rgba(255, 92, 122, 0.12);
  --add-fg: #7ce6b6;
  --del-fg: #ffb0bf;
  --hard: rgba(61, 155, 255, 0.22);        /* offset shadow: windows, cards */
  color-scheme: dark;
}

[data-theme='light'] {
  --bg: #f7f7fa;
  --bg-2: #ffffff;
  --bg-3: #eef0f5;
  --panel: #ffffff;
  --line: rgba(20, 20, 40, 0.2);
  --line-2: rgba(20, 20, 40, 0.45);
  --text: #17171f;
  --text-2: #4d5464;
  --text-3: #6b7284;
  --accent-fill: #2b8ef0;
  --accent-ink: #0a63d3;
  --accent-soft: rgba(43, 142, 240, 0.1);
  --ok-soft: rgba(20, 160, 100, 0.1);
  --err-soft: rgba(220, 50, 85, 0.09);
  --add-fg: #0d7a4c;
  --del-fg: #b4233f;
  --hard: rgba(23, 23, 40, 0.16);
  color-scheme: light;
}

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-fill); color: var(--on-accent); }
img, svg, video { display: block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
code, kbd, pre { font-family: var(--mono); }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; }
p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
section { scroll-margin-top: 84px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip {
  position: fixed; top: 10px; left: 10px; z-index: 99;
  padding: 9px 16px; border: 2px solid var(--text);
  background: var(--accent-fill); color: var(--on-accent); font-weight: 600;
  transform: translateY(-250%);
}
.skip:focus { transform: none; }

/* ---- buttons (hard-offset sticker shadows) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px;
  border: 2px solid var(--line-2);
  background: var(--bg-2); color: var(--text);
  font-weight: 600; font-size: 15px; line-height: 1.2; white-space: nowrap;
  box-shadow: 4px 4px 0 var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--text); }
.btn:active { transform: translate(0, 0); box-shadow: 1px 1px 0 var(--text); }
.btn.primary {
  background: var(--accent-fill); color: var(--on-accent);
  border-color: var(--text);
}
.btn.ghost:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.sm { padding: 8px 14px; font-size: 13px; box-shadow: 3px 3px 0 var(--text); }
.btn.sm:hover { box-shadow: 5px 5px 0 var(--text); }

kbd {
  display: inline-block; min-width: 1.5em; padding: 1px 6px;
  border: 1.5px solid var(--line-2);
  background: var(--bg-3); color: var(--text-2);
  font-size: 11.5px; text-align: center; line-height: 1.5;
}
.chip {
  display: inline-block; padding: 2px 9px;
  border: 1.5px solid var(--line); background: var(--bg-3); color: var(--text-3);
  font-family: var(--mono); font-size: 11px; line-height: 1.6; white-space: nowrap;
}
.chip.on { border-color: rgba(61, 155, 255, 0.55); color: var(--accent-ink); background: var(--accent-soft); }
.ok-chip { border-color: rgba(62, 207, 142, 0.5); color: var(--ok); background: var(--ok-soft); }
code {
  padding: 1px 6px;
  background: var(--bg-3); border: 1.5px solid var(--line);
  font-size: 0.92em;
}

/* ---- nav ---- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg); /* fallback where color-mix is unsupported */
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1.5px solid var(--line);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  height: 66px; display: flex; align-items: center; gap: 26px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-sq {
  display: grid; place-items: center; width: 34px; height: 34px;
  background: var(--accent-fill); flex: none;
}
.brand-sq .mark { width: 20px; height: 20px; color: #fff; }
.brand-name { font-weight: 800; letter-spacing: 0.05em; font-size: 15.5px; }
.nav-links { display: flex; gap: 20px; margin-left: auto; }
.nav-links a {
  color: var(--text-2); font-size: 14.5px; font-weight: 500;
  padding: 4px 0; border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--text); text-decoration: none; border-bottom-color: var(--line-2); }
.nav-links a[aria-current='true'] { color: var(--text); border-bottom-color: var(--accent-fill); }
.nav-actions { display: flex; align-items: center; gap: 13px; margin-left: auto; }
.nav-links + .nav-actions { margin-left: 0; }
.nav-repo { color: var(--text-2); font-size: 14.5px; font-weight: 500; }
.nav-repo:hover { color: var(--text); text-decoration: none; }
.theme-toggle {
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 1.5px solid var(--line-2); color: var(--text-2);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent-fill); background: var(--accent-soft); }
.theme-toggle svg { width: 16px; height: 16px; }
[data-theme='light'] .i-sun { display: none; }
[data-theme='dark'] .i-moon, :root:not([data-theme]) .i-moon { display: none; }

/* ---- hero ---- */
.hero {
  position: relative;
  max-width: 1200px; margin: 0 auto;
  padding: clamp(3rem, 7vh, 5.5rem) 24px clamp(3rem, 6vh, 4.5rem);
  overflow: hidden;
}
.hero::before {
  /* faint engineering-grid backdrop — the terminal/canvas motif */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(52rem 30rem at 78% 18%, var(--accent-soft), transparent 65%),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: auto, 46px 46px, 46px 46px;
  mask-image: radial-gradient(90rem 60rem at 60% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(90rem 60rem at 60% 0%, #000 30%, transparent 78%);
  opacity: 0.6;
}
.hero-grid {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem); align-items: center;
}
.kicker {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.03em;
  color: var(--accent-ink); margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.05rem, 4.2vw, 2.9rem);
  font-weight: 800; line-height: 1.06; letter-spacing: -0.035em;
}
.hero h1 .l { display: block; }
.hl {
  background: var(--accent-fill); color: var(--on-accent);
  padding: 0 0.08em;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.lede {
  margin-top: 20px; max-width: 46ch;
  font-size: clamp(1rem, 1.3vw, 1.12rem); color: var(--text-2);
}
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

/* ---- app-window preview ---- */
.win {
  border: 1.5px solid var(--line-2);
  background: var(--panel);
  box-shadow: 8px 8px 0 var(--hard);
  overflow: hidden;
}
.win-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px; border-bottom: 1.5px solid var(--line);
  background: var(--bg-2);
}
.win-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--line-2); flex: none; }
.win-dot:nth-child(1) { background: #ff5f57; opacity: 0.85; }
.win-dot:nth-child(2) { background: #febc2e; opacity: 0.85; }
.win-dot:nth-child(3) { background: #28c840; opacity: 0.85; }
.win-title {
  margin-left: 8px; font-family: var(--mono); font-size: 11.5px;
  color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.win-badge {
  margin-left: auto; padding: 2px 10px;
  background: var(--accent-soft); border: 1px solid rgba(61, 155, 255, 0.5);
  color: var(--accent-ink); font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em;
}
.win-body { padding: 18px; display: grid; gap: 13px; }

.chatline { display: flex; gap: 10px; align-items: flex-start; }
.who {
  flex: none; width: 24px; height: 24px;
  display: grid; place-items: center;
  background: var(--bg-3); color: var(--text-3);
  font-family: var(--mono); font-size: 10.5px;
}
.who.ai { background: var(--accent-soft); color: var(--accent-ink); border: 1.5px solid rgba(61, 155, 255, 0.45); }
.bubble {
  margin: 0; padding: 9px 14px;
  background: var(--bg-3); border: 1.5px solid var(--line);
  font-size: 14px; line-height: 1.55; max-width: 44ch;
}
.chatline:not(:first-child) .bubble { background: var(--accent-soft); border-color: rgba(61, 155, 255, 0.35); }
.bubble code { font-size: 12.5px; }

.traceline {
  border: 1.5px solid var(--line);
  background: var(--bg-2); overflow: hidden; margin-left: 34px;
}
.t-head {
  padding: 7px 13px; border-bottom: 1.5px solid var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--text-3);
}
.t-list { list-style: none; margin: 0; padding: 6px 0; }
.t-list li {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 13px; font-family: var(--mono); font-size: 12px; color: var(--text-2);
}
.t-list .tick { color: var(--ok); font-size: 12px; }
.t-list .t-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-list .t-name code { font-size: 11px; background: transparent; border: 0; padding: 0; color: var(--text-3); }
.t-list .chip { margin-left: auto; }

.ask {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-left: 34px; padding: 10px 13px;
  border: 2px dashed rgba(61, 155, 255, 0.55);
  background: var(--accent-soft);
}
.ask-tag { font-family: var(--mono); font-size: 10.5px; color: var(--accent-ink); letter-spacing: 0.05em; }
.ask-cmd { background: var(--bg-2); font-size: 12.5px; }
.ask-btns { display: flex; gap: 8px; margin-left: auto; }
.mini {
  padding: 4px 13px;
  border: 1.5px solid var(--line-2); color: var(--text-2);
  font-size: 12px; line-height: 1.5;
}
.mini.primary { background: var(--accent-fill); border-color: transparent; color: var(--on-accent); font-weight: 600; }

.caret {
  display: none; width: 7px; height: 1em; margin-left: 2px;
  vertical-align: -0.15em; background: var(--accent-fill);
  animation: blink 0.9s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* hero entrance timeline (only when .anim — no-JS/reduced motion shows all) */
.anim .step { opacity: 0; animation: stepIn 0.55s ease forwards; animation-delay: calc(var(--s, 0) * 1s); }
@keyframes stepIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.anim .caret.typing { display: inline-block; }

/* ---- status bar (facts) ---- */
.facts { border-block: 1.5px solid var(--line); background: var(--bg-2); }
.facts-row {
  max-width: 1152px; margin: 0 auto; padding: 0 24px;
  display: flex; flex-wrap: wrap; list-style: none;
}
.facts-row li {
  font-family: var(--mono); font-size: 12.5px; color: var(--text-3);
  padding: 13px 20px; border-right: 1px solid var(--line);
}
.facts-row li:first-child { border-left: 1px solid var(--line); color: var(--accent-ink); font-weight: 500; }

/* ---- sections ---- */
.section { padding: clamp(4rem, 9vh, 6.5rem) 24px 0; }
.section > * { max-width: 1152px; margin-inline: auto; }
.section.band {
  background: var(--bg-2);
  border-block: 1.5px solid var(--line);
  /* split the usual section gap so the band edge never hugs its neighbours:
     content → border 43px, border → next rule 43px (= the standard 86px rhythm) */
  margin-top: clamp(2rem, 4.5vh, 3.25rem);
  padding-top: clamp(2rem, 4.5vh, 3.25rem);
  padding-bottom: clamp(2rem, 4.5vh, 3.25rem);
}
.sec-head { margin-bottom: clamp(2rem, 4vh, 3rem); }
.sec-rule {
  display: flex; align-items: baseline; gap: 18px;
  border-top: 2.5px solid var(--text); padding-top: 15px;
}
.sec-index {
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  color: var(--accent-ink); letter-spacing: 0.1em; flex: none;
}
.sec-rule h2 { font-size: clamp(1.7rem, 3.4vw, 2.7rem); font-weight: 800; }
.sec-note {
  margin-left: auto; font-family: var(--mono); font-size: 12px;
  color: var(--text-3); white-space: nowrap;
}
.sec-lede { margin-top: 14px; color: var(--text-2); font-size: 1.05rem; max-width: 62ch; }
.sec-lede code { font-size: 0.9em; }

/* ---- bento ---- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.cell {
  grid-column: span 2; position: relative;
  display: flex; flex-direction: column; gap: 14px;
  padding: 24px; border: 1.5px solid var(--line);
  background: var(--bg-2);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
/* registration corner ticks on hover */
.cell::before, .cell::after {
  content: ''; position: absolute; width: 12px; height: 12px;
  opacity: 0; transition: opacity 0.15s ease; pointer-events: none;
}
.cell::before { top: 5px; left: 5px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.cell::after { bottom: 5px; right: 5px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.cell:hover {
  border-color: var(--line-2);
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 var(--hard);
}
.cell:hover::before, .cell:hover::after { opacity: 1; }
.cell h3 { font-size: 1.08rem; font-weight: 700; letter-spacing: -0.015em; }
.cell p { color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
.cell p code { font-size: 12.5px; }
.cell-cowork { grid-column: span 4; background:
  radial-gradient(30rem 18rem at 90% -10%, var(--accent-soft), transparent 70%), var(--bg-2); }
.cell-diff { grid-column: span 2; }
.cell-palette {
  grid-column: span 6; flex-direction: row; align-items: center; gap: 28px;
  background: linear-gradient(100deg, var(--accent-soft), transparent 55%), var(--bg-2);
}
.palette-text h3 { margin-bottom: 6px; }

/* mini: file tree */
.mini-tree {
  padding: 12px 14px;
  background: var(--bg); border: 1.5px solid var(--line);
  font-family: var(--mono); font-size: 12.5px; color: var(--text-2);
}
.tr-folder { padding: 3px 0; color: var(--text-3); }
.tr-folder::before { content: '▸ '; color: var(--accent-ink); }
.tr-meta { color: var(--text-3); font-size: 10.5px; margin-left: 8px; }
.tr-file { padding: 3px 0 3px 18px; }
.tr-file.active { color: var(--text); }
.tr-badge {
  margin-left: 8px; padding: 0 6px;
  background: var(--err-soft); color: var(--err); font-size: 10.5px;
}
.ai-cursor {
  margin-left: 8px; padding: 0 7px;
  background: var(--accent-fill); color: var(--on-accent);
  font-size: 9.5px; letter-spacing: 0.08em; font-weight: 600;
}

/* mini: diff */
.mini-diff {
  border: 1.5px solid var(--line);
  background: var(--bg); overflow: hidden;
  font-family: var(--mono); font-size: 12px;
}
.d-line { padding: 4px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-line.del { background: var(--err-soft); color: var(--del-fg); }
.d-line.add { background: var(--ok-soft); color: var(--add-fg); }
.d-g { display: inline-block; width: 14px; opacity: 0.8; }
.d-bar {
  display: flex; gap: 14px; padding: 8px 12px;
  border-top: 1.5px solid var(--line); color: var(--text-3); font-size: 11.5px;
}
.d-bar span:first-child { color: var(--accent-ink); }
.d-undo { margin-left: auto; }
.mini-diff.lg { font-size: 12.5px; }
.mini-diff.lg .d-bar span { color: var(--text-3); }
.mini-diff.lg .d-pri {
  color: var(--on-accent); background: var(--accent-fill);
  padding: 2px 12px; font-weight: 600;
}

/* mini: history */
.mini-hist {
  border: 1.5px solid var(--line);
  background: var(--bg); overflow: hidden;
  font-family: var(--mono); font-size: 12px;
}
.h-row { display: flex; gap: 12px; padding: 8px 13px; color: var(--text-2); }
.h-row + .h-row { border-top: 1.5px solid var(--line); }
.h-time { color: var(--text-3); }
.h-act { margin-left: auto; color: var(--accent-ink); }

/* mini: chips / keys */
.mini-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-chips .chip { font-size: 11.5px; }
.mini-keys { display: grid; gap: 10px; flex: none; }
.key {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px; color: var(--text-2); white-space: nowrap;
}

/* ---- modes ---- */
.modes { border: 2px solid var(--line-2); background: var(--bg-2); overflow: hidden; }
.tablist {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 14px; border-bottom: 1.5px solid var(--line); background: var(--bg);
}
.tab {
  padding: 9px 22px;
  font-family: var(--mono); font-size: 13px; color: var(--text-2);
  border: 1.5px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tab:hover { color: var(--text); border-color: var(--line-2); }
.tab[aria-selected='true'] {
  background: var(--accent-fill); color: var(--on-accent);
  font-weight: 700; border-color: var(--text);
}
.effort { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.effort b { color: var(--text-2); font-weight: 500; }
.tabpanel {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 30px; padding: clamp(1.5rem, 3.5vw, 2.5rem); align-items: center;
}
.tabpanel[hidden] { display: none; } /* author display would beat the UA rule */
.tabpanel:focus-visible { outline-offset: -3px; }
.tab-copy h3 { font-size: 1.35rem; font-weight: 800; margin-bottom: 12px; }
.tab-copy p { color: var(--text-2); max-width: 46ch; }
.mini-suggest, .mini-applied {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 18px; border: 1.5px solid var(--line);
  background: var(--bg); font-family: var(--mono); font-size: 13px;
}
.ms-tag {
  padding: 2px 10px;
  background: var(--accent-soft); border: 1px solid rgba(61, 155, 255, 0.5);
  color: var(--accent-ink); font-size: 10.5px;
}
.ms-note { color: var(--text-3); font-size: 11.5px; margin-left: auto; }
.mini-applied .ok-dot {
  width: 26px; height: 26px; display: grid; place-items: center;
  background: var(--ok-soft); border: 1.5px solid rgba(62, 207, 142, 0.5);
  color: var(--ok); flex: none;
}
.mini-applied div { display: grid; }
.mini-applied strong { font-size: 13px; font-weight: 600; }
.mini-applied span { color: var(--text-3); font-size: 11.5px; }
.mini-applied code { font-size: 11px; }

/* ---- duo ---- */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.duo-panel { display: grid; gap: 12px; }
.duo-app { display: grid; grid-template-columns: 132px 1fr; min-height: 190px; }
.da-side {
  display: grid; gap: 8px; align-content: start;
  padding: 14px 12px; border-right: 1.5px solid var(--line); background: var(--bg-2);
}
.da-row {
  padding: 6px 10px;
  font-family: var(--mono); font-size: 11.5px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.da-row.on { background: var(--accent-soft); color: var(--accent-ink); border-left: 2px solid var(--accent-fill); }
.da-chat { display: grid; gap: 10px; align-content: start; padding: 16px; }
.da-msg { height: 34px; background: var(--accent-soft); border: 1.5px solid rgba(61, 155, 255, 0.3); width: 78%; }
.da-msg.user { background: var(--bg-3); border-color: var(--line); width: 56%; justify-self: end; }
.da-msg.short { width: 44%; }
.term-body {
  padding: 16px 18px; min-height: 190px;
  font-family: var(--mono); font-size: 13px; line-height: 1.75;
  background: var(--bg);
}
.term-body p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-prompt { color: var(--accent-ink); margin-right: 8px; }
.t-dim { color: var(--text-3); }
.t-ok { color: var(--ok); }
.duo-cap {
  font-family: var(--mono); font-size: 12px; color: var(--text-3);
  text-align: center;
}

/* ---- 04 · in motion (real footage) ---- */
.shots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.film, .shot {
  margin: 0; background: var(--bg);
  border: 1.5px solid var(--line);
  display: flex; flex-direction: column;
}
.film { grid-column: 1 / -1; box-shadow: 8px 8px 0 var(--hard); }
.shot { grid-column: span 2; transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease; }
/* five gifs: row of 3, then a balanced row of 2 — no orphan slot */
.shot:nth-child(5), .shot:nth-child(6) { grid-column: span 3; }
.shot:hover {
  border-color: var(--line-2);
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 var(--hard);
}
.shot-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-bottom: 1.5px solid var(--line); background: var(--bg-2);
}
.shot-badge {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--accent-ink); border: 1px solid rgba(61, 155, 255, 0.55);
  padding: 3px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shot-note { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.film video {
  width: 100%; aspect-ratio: 16 / 9;
  background: #000; border-bottom: 1.5px solid var(--line);
}
.shot img { width: 100%; height: auto; aspect-ratio: 880 / 550; }
.film figcaption, .shot figcaption {
  display: flex; flex-direction: column; gap: 3px;
  padding: 13px 15px; border-top: 1.5px solid var(--line); margin-top: auto;
}
.film figcaption strong, .shot figcaption strong { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.film figcaption span, .shot figcaption span { font-size: 13px; color: var(--text-2); line-height: 1.5; }

/* ---- 05 · engines (marquee) ---- */
.mq-wrap {
  display: flex; border: 1.5px solid var(--line-2); background: var(--bg-2);
}
.mq-label {
  flex: none; display: flex; align-items: center; padding: 0 18px;
  border-right: 1.5px solid var(--line-2);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em;
  color: var(--accent-ink);
}
.marquee {
  flex: 1; min-width: 0; overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.marquee-track {
  display: flex; gap: 12px; width: max-content;
  padding: 13px 0;
  animation: slide 36s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(calc(-50% - 6px)); } }
.pill {
  padding: 8px 18px;
  border: 1.5px solid var(--line); background: var(--bg);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text-2); white-space: nowrap;
}
.pill:first-child { border-color: rgba(61, 155, 255, 0.55); color: var(--accent-ink); }

/* ---- 06 · install ---- */
.install { padding-bottom: clamp(4rem, 9vh, 6.5rem); }
.install-grid {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
.term-card {
  border: 2px solid var(--line-2);
  background: var(--bg-2);
  box-shadow: 8px 8px 0 var(--hard); overflow: hidden;
}
.term-head {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px; border-bottom: 1.5px solid var(--line); background: var(--bg);
}
.term-title { margin-left: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.term-lines { padding: 10px 0; }
.t-line { display: flex; align-items: center; gap: 12px; padding: 8px 18px; }
.t-line + .t-line { border-top: 1px dashed var(--line); }
.t-line code { background: transparent; border: 0; padding: 0; font-size: 13.5px; }
.copy {
  margin-left: auto; padding: 5px 14px;
  border: 1.5px solid var(--line-2); color: var(--text-3);
  font-family: var(--mono); font-size: 11px;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.copy:hover { color: var(--text); border-color: var(--accent-fill); background: var(--accent-soft); }
.copy.done { color: var(--ok); border-color: rgba(62, 207, 142, 0.55); background: var(--ok-soft); }
.install-lede { color: var(--text-2); max-width: 52ch; }
.install-copy .cta-row { margin-top: 26px; }

/* ---- footer ---- */
.footer { border-top: 2px solid var(--line-2); background: var(--bg-2); }
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 40px 24px 34px;
  display: grid; gap: 26px;
}
.footer-brand { display: flex; align-items: center; gap: 13px; }
.footer-brand .brand-sq { width: 40px; height: 40px; }
.footer-brand .brand-sq .mark { width: 24px; height: 24px; }
.footer-brand div { display: grid; }
.footer-brand strong { letter-spacing: 0.05em; font-size: 15px; font-weight: 800; }
.footer-brand span { color: var(--text-3); font-size: 13px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a { color: var(--text-2); font-size: 14px; }
.footer-links a:hover { color: var(--text); }
.footer-fine { color: var(--text-3); font-size: 12.5px; font-family: var(--mono); }

/* ---- reveal (only when .anim) ---- */
.anim .reveal { opacity: 0; transform: translateY(18px); }
.anim .reveal.in {
  opacity: 1; transform: none;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--i, 0) * 80ms);
}

/* ---- responsive ---- */
@media (max-width: 1080px) {
  .cell { grid-column: span 3; }
  .cell-cowork, .cell-diff, .cell-memory, .cell-palette { grid-column: span 6; }
  .shot { grid-column: span 3; }
  .shot:last-child { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-actions { margin-left: auto; }
  .hero-grid { grid-template-columns: 1fr; }
  .duo { grid-template-columns: 1fr; }
  .install-grid { grid-template-columns: 1fr; }
  .tabpanel { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 760px) {
  .section { padding-inline: 18px; }
  .hero, .nav-inner, .footer-inner { padding-inline: 18px; }
  .cell, .cell-cowork, .cell-diff, .cell-memory, .cell-palette { grid-column: span 6; }
  .cell-palette { flex-direction: column; align-items: flex-start; }
  .shot, .shot:nth-child(5), .shot:nth-child(6), .shot:last-child { grid-column: 1 / -1; }
  .effort { display: none; }
  .nav-repo { display: none; }
  .nav-actions .btn { padding: 7px 12px; font-size: 12.5px; box-shadow: 2px 2px 0 var(--text); }
  .nav-actions .btn:hover { box-shadow: 4px 4px 0 var(--text); }
  .facts-row { display: grid; grid-template-columns: 1fr 1fr; padding: 0 18px; }
  .facts-row li { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 14px; }
  .facts-row li:first-child { border-left: 0; }
  .facts-row li:nth-child(2n) { border-right: 0; }
  .facts-row li:nth-last-child(-n+2) { border-bottom: 0; }
  .sec-note { display: none; }
  .mq-label { padding: 0 12px; letter-spacing: 0.12em; }
}
@media (max-width: 520px) {
  .mq-label { display: none; }
}

/* ---- reduced motion: everything settles instantly ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .marquee-track { animation: none; transform: none; }
  .marquee { overflow-x: auto; }
  .caret { display: none !important; }
}
