:root {
  --bg: #f8f7f4;
  --bg-raise: #ffffff;
  --bg-sunk: #f0eee9;
  --ink: #16171b;
  --muted: #5a5d66;
  --line: #e4e2dc;
  --line-strong: #8f8c84;
  --accent: #4338ca;
  --accent-soft: #eceafd;
  --accent-ink: #ffffff;
  --focus: #1d4ed8;
  --ok: #17734a;
  --ok-bg: #e6f4ec;
  --warn: #8a5300;
  --warn-bg: #fbf0dc;
  --bad: #b42318;
  --bad-bg: #fdeceb;
  --info: #2f5c8f;
  --info-bg: #e8f0f9;
  --tag-local: #17734a;
  --tag-saved: #2f5c8f;
  --tag-key: #8a5300;
  --tag-server: #b4381f;
  --tag-demo: #6b45b8;
  --glow: rgba(67, 56, 202, 0.07);
  --glow-2: rgba(23, 115, 74, 0.05);
  --swash: #a5a0f0;
  --band: #f0eee8;
  --cut: #b42318;
  --cut-bg: #fdeceb;
  --shadow-sm: 0 1px 2px rgba(22, 23, 27, 0.04), 0 1px 1px rgba(22, 23, 27, 0.03);
  --shadow-md: 0 1px 2px rgba(22, 23, 27, 0.04), 0 8px 24px -12px rgba(22, 23, 27, 0.14);
  --shadow-lg: 0 2px 4px rgba(22, 23, 27, 0.04), 0 24px 48px -20px rgba(22, 23, 27, 0.22);
  color-scheme: light;
  --serif: "Fraunces", "Iowan Old Style", Palatino, serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
  --measure: 68rem;
}

/* Dark theme: chosen with the toggle (stored), never forced by default. */
:root[data-theme="dark"] {
  --bg: #141518;
  --bg-raise: #1c1d21;
  --bg-sunk: #101114;
  --ink: #edece9;
  --muted: #a7a8ae;
  --line: #2c2d33;
  --line-strong: #6a6c75;
  --accent: #a5b4fc;
  --accent-soft: #23264a;
  --accent-ink: #14151a;
  --focus: #93c5fd;
  --ok: #6fd4a0;
  --ok-bg: #15291f;
  --warn: #f0c06a;
  --warn-bg: #2e2412;
  --bad: #ff9b8f;
  --bad-bg: #35191a;
  --info: #9cc0ec;
  --info-bg: #172234;
  --tag-local: #6fd4a0;
  --tag-saved: #9cc0ec;
  --tag-key: #f0c06a;
  --tag-server: #ff9f80;
  --tag-demo: #c9b8f5;
  --glow: rgba(165, 180, 252, 0.07);
  --glow-2: rgba(111, 212, 160, 0.04);
  --swash: #5b63c9;
  --band: #18191d;
  --cut: #ff9b8f;
  --cut-bg: #35191a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px -20px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 85% -12%, var(--glow), transparent 60%),
    radial-gradient(900px 420px at -10% 8%, var(--glow-2), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-underline-offset: 0.18em; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}
[id] { scroll-margin-top: 1.5rem; }
main:focus { outline: none; }
code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--bg);
  padding: 0.05em 0.3em;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--bg);
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  font-weight: 600;
}
.skip:focus { top: 0.5rem; z-index: 5; }

.site-header, .hero, .paths, .section, .site-footer {
  width: min(var(--measure), calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 1rem 0 0.5rem;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 1.15rem;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav { display: flex; flex-wrap: wrap; gap: 0 0.25rem; }
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.6rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
}
.nav a:hover { color: var(--accent); text-decoration: underline; }
.hint { color: var(--muted); font-size: 0.85em; }

.hero { padding: 4rem 0 2rem; }
.hero-text { max-width: 64rem; }
h1 {
  font-family: var(--serif);
  font-weight: 460;
  font-size: clamp(2.2rem, 5vw, 3.9rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 1.1rem;
  max-width: 18ch;
}
.lede { max-width: 42rem; margin: 0; font-size: 1.15rem; color: var(--muted); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.paths { padding: 1rem 0 0.5rem; }
.path-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.path-list a {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  height: 100%;
  padding: 1rem 1.1rem 1.1rem;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  text-decoration: none;
}
.path-list strong {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 1.15rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.path-list strong::after { content: "↓"; color: var(--accent); }
.path-list span { color: var(--muted); font-size: 0.975rem; }
.path-list a:hover { border-color: var(--accent); }
.path-list a:hover strong { color: var(--accent); }

.section { padding: 3.5rem 0 0.5rem; }
.section-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}
.section-head h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 460;
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
}
.section-head p { margin: 0; color: var(--muted); max-width: 46rem; }

.explainer {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0 1.1rem;
  margin-bottom: 1rem;
}
.explainer summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.8rem 0;
  min-height: 44px;
}
.explainer dl { margin: 0 0 1rem; display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.25rem; }
.explainer dt { font-weight: 600; }
.explainer dd { margin: 0; color: var(--muted); max-width: 60ch; }

.legend { margin: 1.5rem 0 0.5rem; }
.legend ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.975rem;
}
.legend .tag { margin-right: 0.4rem; }

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 0.1rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  white-space: nowrap;
}
.tag-local { color: var(--tag-local); }
.tag-saved { color: var(--tag-saved); }
.tag-key { color: var(--tag-key); }
.tag-server { color: var(--tag-server); }
.tag-demo { color: var(--tag-demo); }
.tag-local::before { content: "● "; }
.tag-saved::before { content: "◆ "; }
.tag-key::before { content: "▲ "; }
.tag-server::before { content: "■ "; }
.tag-demo::before { content: "○ "; }

.group-title {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  margin: 2rem 0 0.75rem;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 0.75rem;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 1rem 1.1rem 1.05rem;
}
.card:hover, .card:focus-within { border-color: var(--accent); }
.card h4 {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.35rem;
}
.card h4 a { text-decoration: none; }
/* Whole card is clickable; the heading link stays the single accessible target. */
.card h4 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card h4 a:focus-visible { outline: none; }
.card:has(h4 a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.card:hover h4 a { color: var(--accent); text-decoration: underline; }
.card p { margin: 0; color: var(--muted); font-size: 0.99rem; }
.card .tags { margin-top: auto; padding-top: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows-2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2rem; }
.rows a {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  height: 100%;
  padding: 1rem 0.2rem 1.1rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.meta {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--accent);
}
.row-title {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.row-text { color: var(--muted); max-width: 62ch; }
.rows a:hover .row-title { color: var(--accent); text-decoration: underline; }

.contact { display: grid; grid-template-columns: 3fr 2fr; gap: 2rem; align-items: start; }
.contact .group-title:first-child { margin-top: 0; }
.contact p { color: var(--muted); max-width: 60ch; }
.checks { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.6rem; color: var(--muted); }
.checks strong { color: var(--ink); }
.contact-card {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 1.1rem 1.2rem 0.6rem;
}
.contact-links { list-style: none; margin: 0; padding: 0; }
.contact-links a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  font-weight: 600;
  border-top: 1px solid var(--line);
}
.contact-links li:first-child a { border-top: 0; }
.contact-links a:hover { color: var(--accent); }

.site-footer {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 1.5rem;
  margin-top: 4rem;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.975rem;
}
.site-footer p { margin: 0 0 0.6rem; max-width: 60ch; }
.site-footer a { color: var(--ink); }
.site-footer nav { display: flex; flex-direction: column; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 40px; }

/* ---------- Hero details ---------- */
.availability {
  display: inline-flex; align-items: center; gap: 0.55rem;
  margin: 0 0 1rem; padding: 0.3rem 0.8rem 0.3rem 0.6rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-raise);
  font-size: 0.92rem; color: var(--muted);
}
.pulse { position: relative; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--tag-local); }
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--tag-local); animation: ping 2.4s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: 0.7; } 80%, 100% { transform: scale(2.6); opacity: 0; } }

.swash {
  color: var(--accent);
  background-image: linear-gradient(var(--swash), var(--swash));
  background-repeat: no-repeat; background-position: 0 90%; background-size: 100% 0.07em;
  padding: 0 0.04em;
}
html.js .swash { background-size: 0% 0.07em; transition: background-size 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s; }
html.js.loaded .swash { background-size: 100% 0.07em; }

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }
.button {
  display: inline-flex; align-items: center; min-height: 44px;
  text-decoration: none; background: var(--ink); color: var(--bg-raise);
  padding: 0.55rem 1.1rem; border-radius: 999px; font-weight: 600;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.button:hover { background: var(--accent); color: var(--accent-ink); transform: translateY(-2px); box-shadow: 0 6px 18px -8px var(--accent); }
.button-quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.button-quiet:hover { background: var(--bg-raise); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.previously { margin: 1.4rem 0 0; color: var(--muted); font-size: 0.95rem; }
.previously span { font-family: var(--mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-right: 0.5rem; }

/* ---------- Self-editing headline ---------- */
.self-edit {
  font-size: clamp(2.5rem, 6vw, 4.9rem);
  max-width: 21ch;
  transition: min-height 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* Both versions share one grid cell, so the box is as tall as the wordy version until it shrinks. */
.h1-stack { display: grid; }
.h1-stack > span { grid-area: 1 / 1; }
.h1-wordy { display: none; }
.self-edit.wordy .h1-wordy,
.self-edit.tight .h1-wordy { display: block; }
.self-edit.tight .h1-wordy { opacity: 0; transition: opacity 0.5s ease; }
.self-edit.wordy .h1-tight { opacity: 0; transition: none; }
.h1-tight { transition: opacity 0.5s ease 0.25s; }
.h1-wordy .f { transition: background-size 0.35s ease calc(var(--i) * 70ms), color 0.35s ease; background-image: linear-gradient(var(--cut), var(--cut)); background-repeat: no-repeat; background-position: 0 58%; background-size: 0% 0.07em; }
.self-edit.strike .h1-wordy .f { background-size: 100% 0.07em; color: var(--cut); }

.edit-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem;
  margin: -0.2rem 0 1.4rem; color: var(--muted); font-size: 0.95rem;
}
.tok {
  font-family: var(--mono); font-size: 0.85rem; padding: 0.15rem 0.6rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); white-space: nowrap;
}
.tok-old { text-decoration: line-through; }
.replay {
  font: inherit; font-size: 0.88rem; cursor: pointer; min-height: 36px;
  padding: 0.2rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--bg-raise); color: var(--ink);
}
.replay:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Screenshots on tool and project cards ---------- */
.card .shot {
  margin: -1rem -1.1rem 0.9rem;
  aspect-ratio: 16 / 10; overflow: hidden;
  border-bottom: 1px solid var(--line);
  border-radius: 0.9rem 0.9rem 0 0;
  background: var(--bg-sunk);
}
.card .shot img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: top left;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.card:hover .shot img, .card:focus-within .shot img { transform: scale(1.04); }
.shot-dark { display: none !important; }
:root[data-theme="dark"] .shot-light { display: none !important; }
:root[data-theme="dark"] .shot-dark { display: block !important; }

.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.proj-grid li { display: flex; }
.proj-grid a {
  width: 100%; padding: 0 0 1.1rem; overflow: hidden;
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: 0.9rem;
  box-shadow: var(--shadow-sm);
}
.proj-grid a:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.proj-grid a > :not(img) { padding-inline: 1.1rem; }
.proj-grid a > .meta:first-child { margin-top: 1.1rem; }
.proj-shot {
  display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover;
  border-bottom: 1px solid var(--line); margin-bottom: 0.85rem; background: var(--bg-sunk);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.proj-grid a:hover .proj-shot { transform: scale(1.03); }

/* ---------- Agent console (dark terminal in both themes) ---------- */
.console-figure { margin: 0; }
.console {
  --c-bg: #0f1014;
  --c-ink: #e7e7ec;
  --c-muted: #8f919c;
  position: relative;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(165, 180, 252, 0.14), transparent 55%),
    linear-gradient(180deg, #16171c, var(--c-bg));
  color: var(--c-ink);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.9rem;
}
.console-bar {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}
.dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; }
.dot-r { background: #ff5f57; } .dot-y { background: #febc2e; } .dot-g { background: #28c840; }
.console-title { margin-left: 0.5rem; color: var(--c-muted); font-size: 0.8rem; letter-spacing: 0.04em; }
.console-body { list-style: none; margin: 0; padding: 1rem 1.1rem 1.2rem; min-height: 17.5rem; }
.l {
  display: grid; grid-template-columns: 1.2rem 3.6rem minmax(0, 1fr) auto; gap: 0.5rem;
  align-items: baseline; padding: 0.22rem 0; white-space: nowrap;
}
.l .t { overflow: hidden; text-overflow: ellipsis; }
.l .m { color: var(--c-muted); font-size: 0.8rem; }
.l .k { color: var(--c-muted); }
.l-cmd { display: block; color: #fff; margin-bottom: 0.45rem; }
.l-cmd .p { color: #a5b4fc; margin-right: 0.35rem; }
.l-sum { display: block; color: var(--c-muted); margin-top: 0.55rem; padding-top: 0.6rem; border-top: 1px dashed rgba(255, 255, 255, 0.12); }
.i-plan { color: #a5b4fc; } .i-build { color: #9cc0ec; } .i-bad { color: #ff9b8f; }
.i-retry { color: #f0c06a; } .i-ok { color: #6fd4a0; } .i-ship { color: #c9b8f5; }
.l.bad .t { color: #ffb4aa; }
.l.ok .t { color: #b6f0cf; }
.caret {
  display: inline-block; width: 0.55em; height: 1.05em; margin-left: 2px;
  vertical-align: text-bottom; background: #a5b4fc; animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
html.js.motion .l.enter { animation: line-in 0.28s ease-out both; }
@keyframes line-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.console-figure figcaption {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem;
  margin-top: 0.8rem; color: var(--muted); font-size: 0.95rem;
}
.console-controls { display: inline-flex; gap: 0.4rem; }
.console-controls button {
  font: inherit; font-size: 0.88rem; cursor: pointer; min-height: 36px;
  padding: 0.25rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--bg-raise); color: var(--ink);
}
.console-controls button:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 560px) {
  .console { font-size: 0.84rem; }
  .console-body { padding: 0.9rem 0.85rem 1rem; min-height: 0; }
  .l { grid-template-columns: 1rem 3.1rem minmax(0, 1fr); white-space: normal; }
  .l .m { display: none; }
}

/* ---------- Hero with the agent simulator beside the headline ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 1.5rem 3rem; align-items: center;
}
.hero .self-edit { font-size: clamp(2.4rem, 4.4vw, 4.1rem); }
html.sim-off .hero { grid-template-columns: minmax(0, 1fr); }
html.sim-off .hero .self-edit { font-size: clamp(2.5rem, 6vw, 4.9rem); }
html.sim-off #simulator { display: none; }
#simulator { transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1); }
#simulator.sim-enter, #simulator.sim-leave { opacity: 0; transform: translateY(12px) scale(0.98); }
.sim-row { margin: 0.9rem 0 0; }
.sim-toggle {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; padding: 0;
  background: none; border: 0; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--accent);
}
.sim-toggle-label { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
.sim-toggle:hover .sim-toggle-label { text-decoration-thickness: 2px; }
.sim-caret { display: inline-block; transition: transform 0.25s ease; }
.sim-toggle[aria-expanded="true"] .sim-caret { transform: rotate(90deg); }
@media (max-width: 900px) {
  .hero, html.sim-off .hero { grid-template-columns: minmax(0, 1fr); }
  .hero .self-edit { font-size: clamp(2.4rem, 8vw, 3.6rem); }
}

/* ---------- Section bands: clear separation between homepage sections ---------- */
.section {
  width: auto; max-width: none; margin: 0;
  padding: 4.75rem max(1rem, calc((100% - var(--measure)) / 2)) 4.25rem;
  border-top: 1px solid var(--line);
}
.band-alt { background: var(--band); }
.section-head { border-bottom: 0; padding-bottom: 0; margin-bottom: 1.9rem; }
.section-head h2 { font-size: clamp(2rem, 3.6vw, 2.75rem); margin-bottom: 0.45rem; }
.sec-num {
  display: inline-block; margin-right: 0.8rem; padding: 0.15rem 0.55rem;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 500; letter-spacing: 0.06em;
  color: var(--accent); border: 1px solid currentColor; border-radius: 999px;
  vertical-align: middle; transform: translateY(-0.25em);
}
.paths { padding-bottom: 4rem; }
.site-footer { margin-top: 0; border-top: 1px solid var(--line); }

/* ---------- Featured sites grid (replaces the moving ribbon) ---------- */
.site-bento {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
}
.site-tile-lg { grid-row: span 2; }
.site-tile a {
  display: flex; flex-direction: column; height: 100%;
  text-decoration: none; color: inherit;
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: 1rem;
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.site-tile a:hover, .site-tile a:focus-visible {
  transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--card-accent);
}
.tile-art { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-sunk); position: relative; }
.tile-art::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--card-accent);
}
.site-tile-lg .tile-art { aspect-ratio: auto; flex: 1 1 auto; min-height: 14rem; }
.tile-art img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.site-tile a:hover .tile-art img { transform: scale(1.05); }
.tile-body { display: grid; gap: 0.25rem; padding: 0.85rem 1rem 1rem; }
.tile-kind {
  display: flex; align-items: center; gap: 0.45rem;
  font-family: var(--mono); font-size: 0.78rem; color: var(--muted);
}
.tile-kind::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--card-accent); flex: none; }
.tile-name { font-family: var(--serif); font-weight: 560; font-size: 1.2rem; letter-spacing: -0.01em; }
.site-tile-lg .tile-name { font-size: clamp(1.5rem, 2.4vw, 1.9rem); }
.tile-desc { color: var(--muted); max-width: 52ch; }
.site-tile-lg .tile-body { padding: 1.1rem 1.25rem 1.3rem; }

.site-more { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 1.6rem; }
.site-more-label { margin: 0; font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.site-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; flex: 1 1 32rem; }
.site-chips a {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 36px; padding: 0.2rem 0.8rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--bg-raise);
  font-size: 0.92rem; text-decoration: none; color: var(--ink);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.site-chips a::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--card-accent); }
.site-chips a:hover, .site-chips a:focus-visible { border-color: var(--card-accent); transform: translateY(-1px); }
.site-more .button span { display: inline-block; margin-left: 0.3rem; transition: transform 0.2s ease; }
.site-more .button:hover span { transform: translateX(4px); }

@media (max-width: 900px) {
  .site-bento { grid-template-columns: 1fr 1fr; }
  .site-tile-lg { grid-column: 1 / -1; grid-row: auto; }
  .site-tile-lg .tile-art { aspect-ratio: 16 / 9; min-height: 0; }
  .section { padding-top: 3.5rem; padding-bottom: 3.25rem; }
}
@media (max-width: 560px) {
  .site-bento { grid-template-columns: 1fr; }
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: inline-grid; place-items: center; width: 44px; height: 44px; margin-left: 0.25rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--bg-raise); color: var(--ink);
  cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover { border-color: var(--accent); transform: rotate(-12deg); }
.theme-toggle svg { width: 20px; height: 20px; grid-area: 1 / 1; }
.icon-moon { fill: currentColor; }
.icon-sun { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.icon-sun circle { fill: currentColor; stroke: none; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.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;
}

/* ---------- Live demo ---------- */
@property --pct { syntax: "<number>"; inherits: false; initial-value: 0; }
.demo-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: -0.6rem 0 1rem; }
.demo-examples-label { font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); margin-right: 0.2rem; }
.demo-examples button, .demo-tabs button {
  font: inherit; font-size: 0.92rem; cursor: pointer; min-height: 40px; padding: 0.3rem 0.85rem;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--bg-raise); color: var(--ink);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.demo-examples button:hover, .demo-tabs button:hover { border-color: var(--accent); transform: translateY(-1px); }
.demo-examples button[aria-pressed="true"], .demo-tabs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg-raise); }
.demo-grid {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 1.25rem;
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: 1rem; padding: 1.2rem;
}
.demo-label { display: block; font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); margin: 0 0 0.4rem; font-weight: 500; }
.demo textarea {
  width: 100%; min-height: 10.5rem; resize: vertical; font: inherit; line-height: 1.55;
  color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 0.6rem; padding: 0.7rem 0.8rem;
}
.demo textarea:focus { border-color: var(--focus); }
.demo-score { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; align-items: start; margin-top: 1rem; }
.demo-ring {
  --pct: 0; --ring: var(--bad);
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--ring) calc(var(--pct) * 1%), var(--bg-sunk) 0);
  transition: --pct 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.demo-ring[data-band="ok"] { --ring: var(--tag-key); }
.demo-ring[data-band="good"] { --ring: var(--tag-local); }
.demo-ring span {
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-raise); font-family: var(--mono); font-weight: 600; font-size: 1.25rem;
}
.demo-score-text { margin: 0.2rem 0 0.5rem; font-weight: 600; }
.demo-fixes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; font-size: 0.93rem; color: var(--muted); }
.demo-fixes li { padding-left: 1.2rem; position: relative; }
.demo-fixes li::before { content: "!"; position: absolute; left: 0.2rem; font-weight: 700; color: var(--tag-key); }
.demo-fixes li.tip::before { content: "i"; color: var(--tag-saved); }
.demo-fixes strong { color: var(--ink); }
.demo-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }
.demo-out {
  white-space: pre-wrap; overflow-wrap: anywhere; min-height: 10.5rem; max-height: 22rem; overflow: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.75rem 0.85rem; margin: 0 0 0.9rem;
  font-size: 0.98rem; line-height: 1.55;
}
.demo-out.view-structured { font-family: var(--mono); font-size: 0.88rem; }
.demo-out.view-tight { font-weight: 600; }
.demo-out.view-cut { color: var(--muted); }
html.js.motion .demo-out { animation: rise 0.3s ease both; }
mark.cut {
  color: var(--cut); background: linear-gradient(var(--cut), var(--cut)) no-repeat 0 55% / 100% 2px, var(--cut-bg);
  border-radius: 3px; padding: 0 1px;
}
html.js mark.cut { background-size: 0% 2px, auto; transition: background-size 0.5s ease; }
html.js .demo.seen mark.cut { background-size: 100% 2px, auto; }
.demo-bars { display: grid; gap: 0.35rem; margin-bottom: 0.4rem; }
.bar { display: block; height: 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; transition: width 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.bar-before > span { background: var(--line-strong); }
.bar-after > span { background: var(--accent); }
.demo-meta { margin: 0; color: var(--muted); font-size: 0.95rem; }
.demo-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.demo-actions button.button { font: inherit; font-weight: 600; border: 0; cursor: pointer; }
.demo-actions .button span { display: inline-block; margin-left: 0.3rem; transition: transform 0.2s ease; }
.demo-actions .button:hover span { transform: translateX(3px); }

/* ---------- Tool filters ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 1.25rem 0 0; }
.filters-label { font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); margin-right: 0.2rem; }
.filters button {
  font: inherit; font-size: 0.92rem; cursor: pointer; min-height: 40px;
  padding: 0.3rem 0.85rem; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--bg-raise); color: var(--ink);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.filters button:hover { border-color: var(--accent); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg-raise); border-color: var(--ink); }
.filters-count { color: var(--muted); font-size: 0.92rem; margin-left: 0.3rem; }
.card[hidden], .group-title[hidden], .cards[hidden] { display: none; }

/* ---------- Card motion ---------- */
.card, .path-list a, .rows a { transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.card:hover, .card:focus-within, .path-list a:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.path-list strong::after { display: inline-block; margin-left: 0.25em; transition: transform 0.2s ease; }
.path-list a:hover strong::after { transform: translateY(3px); }
.rows a:hover { transform: translateX(4px); }

/* ---------- Pipeline diagram ---------- */
.pipeline { margin: 0 0 1.5rem; }
.pipeline svg { width: 100%; height: auto; display: block; }
.pipe-line { stroke: var(--line-strong); stroke-width: 2; fill: none; }
.pipe-loop { stroke: var(--accent); stroke-width: 2; fill: none; stroke-dasharray: 5 5; }
.arrow-head { fill: var(--line-strong); }
.pipe-note { font-family: var(--mono); font-size: 12px; fill: var(--muted); }
.pipe-node rect { fill: var(--bg-raise); stroke: var(--line-strong); stroke-width: 1.5; }
.pipe-node text { font-family: var(--sans); font-weight: 600; font-size: 15px; fill: var(--ink); }
.pipe-check rect { stroke: var(--accent); }
.pipe-ship rect { stroke: var(--tag-local); }
.pipe-dot { fill: var(--accent); }
.pipe-dot-retry { fill: var(--tag-key); }
.pipeline figcaption { color: var(--muted); font-size: 0.95rem; margin-top: 0.25rem; }

/* ---------- Scroll reveal (only with JS and motion allowed) ---------- */
html.js.motion .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
html.js.motion .reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
}
@media (max-width: 700px) {
  .demo-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .path-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .hero { padding-top: 2rem; }
  h1 { max-width: none; }
  .path-list, .rows-2, .contact, .site-footer { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .explainer dl { grid-template-columns: 1fr; gap: 0.15rem; }
  .explainer dd { margin-bottom: 0.6rem; }
  .nav { margin-left: -0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pipe-dot, .pulse::after, .caret { display: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (forced-colors: active) {
  .tag, .card, .path-list a, .contact-card, .explainer { border: 1px solid CanvasText; }
}

@media print {
  body { background: #fff; color: #000; }
  .skip, .nav, .paths { display: none; }
  .card, .path-list a { break-inside: avoid; }
}

/* ---------- Premium surface details ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  width: 100%; max-width: none;
  padding-inline: max(1rem, calc((100% - var(--measure)) / 2));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.card, .path-list a, .explainer, .contact-card, .demo-grid { box-shadow: var(--shadow-sm); }
.path-list a, .card, .contact-card, .demo-grid, .explainer { border-color: var(--line); }
[id] { scroll-margin-top: 5rem; }


