/* Behavioral Science Skills: stylesheet.
   Light and dark themes; the page follows the system setting until the reader picks one.
   Geist for text, Geist Mono for skill names and commands. No framework.

   One accent: TAF gold, for actions. The seven stage hues are muted: they color stage
   icons, map column markers, and a light tint on map cards.
   Background: a quiet paper texture in light, fine graphite grain in dark (SVG noise
   tiles in assets/). The home hero adds a faded photo.
   Shape: buttons and chips are pills; cards and panels 16px; inputs, code rows,
   nodes, and inner rows 10px. */

:root {
  color-scheme: light;
  --bg: #f4f4f2;
  --surface: #ffffff;
  --surface-2: #fafaf9;
  --surface-3: #ebebe8;
  --fg: #121212;
  --fg-2: #454545;
  --fg-3: #636363;
  --border: rgb(0 0 0 / 0.08);
  --border-2: rgb(0 0 0 / 0.15);
  --border-3: rgb(0 0 0 / 0.3);
  --accent: #F1B505;
  --accent-hover: #ECAA00;
  --accent-text: #7F5D00;
  --accent-fg: #121212;
  --accent-soft: rgb(241 181 5 / 0.18);
  --accent-ring: rgb(176 128 0 / 0.45);
  --edge: rgb(0 0 0 / 0.22);
  --edge-hot: #a07700;
  --ok: #15703a;
  --warn: #8f4705;
  --bad: #b01c1c;
  --shadow: 0 12px 32px -14px rgb(40 36 20 / 0.28);
  --st-define: #3d6c93;
  --st-diagnose: #67578f;
  --st-design: #94486a;
  --st-measure: #2c7169;
  --st-test: #9a5524;
  --st-analyze: #4b5b95;
  --st-implement: #49733a;
  --st-other: #636363;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --max: 1200px;
  --gutter: 24px;
  --r-card: 16px;
  --r-row: 10px;
  --header-h: 64px;
  --t-fast: 150ms cubic-bezier(0.2, 0, 0, 1);
  --t: 260ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0c0c;
  --surface: #151515;
  --surface-2: #1c1c1c;
  --surface-3: #262626;
  --fg: #ededed;
  --fg-2: #b3b3b3;
  --fg-3: #8c8c8c;
  --border: rgb(255 255 255 / 0.09);
  --border-2: rgb(255 255 255 / 0.16);
  --border-3: rgb(255 255 255 / 0.32);
  --accent-hover: #FBD654;
  --accent-text: #F1B505;
  --accent-soft: rgb(241 181 5 / 0.13);
  --accent-ring: rgb(241 181 5 / 0.45);
  --edge: rgb(255 255 255 / 0.2);
  --edge-hot: #F1B505;
  --ok: #7cc79a;
  --warn: #e3ac70;
  --bad: #f0a3a3;
  --shadow: 0 14px 36px -12px rgb(0 0 0 / 0.7);
  --st-define: #8fb2cf;
  --st-diagnose: #b0a3d3;
  --st-design: #cf9ab0;
  --st-measure: #86bfb6;
  --st-test: #d8a47f;
  --st-analyze: #9eabd6;
  --st-implement: #9cc28b;
  --st-other: #9a9a9a;
}

/* Stage color hook: any element with data-stage gets --stage. */
[data-stage="define"] { --stage: var(--st-define); }
[data-stage="diagnose"] { --stage: var(--st-diagnose); }
[data-stage="design"] { --stage: var(--st-design); }
[data-stage="measure"] { --stage: var(--st-measure); }
[data-stage="test"] { --stage: var(--st-test); }
[data-stage="analyze"] { --stage: var(--st-analyze); }
[data-stage="implement"] { --stage: var(--st-implement); }
[data-stage="other"], [data-stage="meta"], [data-stage=""] { --stage: var(--st-other); }
.stage-ic { color: var(--stage, var(--fg-3)); flex-shrink: 0; }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg) url("/assets/paper-light.svg") 0 0 / 560px 560px;
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
:root[data-theme="dark"] body { background-image: url("/assets/grain-dark.svg"); background-size: 320px 320px; }
img, svg { max-width: 100%; height: auto; }
svg[viewBox="0 0 256 256"] { width: 1em; height: 1em; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--border-3); text-underline-offset: 3px; transition: text-decoration-color var(--t-fast), color var(--t-fast); }
a:hover { text-decoration-color: var(--fg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 4.5vw, 3.25rem); letter-spacing: -0.04em; }
h2 { font-size: 1.5rem; margin: 2rem 0 0.6rem; letter-spacing: -0.03em; }
h3 { font-size: 1.15rem; margin: 1.2rem 0 0.4rem; }
p { margin: 0.6em 0; text-wrap: pretty; }
code, pre, kbd { font-family: var(--mono); font-size: 0.86em; }
code { background: var(--surface-3); padding: 0.1em 0.4em; border-radius: 6px; }
pre { background: var(--surface-2); border: 1px solid var(--border); padding: 0.85em 1em; border-radius: var(--r-row); overflow-x: auto; margin: 0.8em 0; line-height: 1.55; }
pre code { background: none; padding: 0; }
table { border-collapse: collapse; width: 100%; margin: 0.8em 0; font-size: 0.92em; display: block; overflow-x: auto; }
th, td { border-bottom: 1px solid var(--border); padding: 0.55em 0.75em; text-align: left; vertical-align: top; }
th { font-weight: 600; }
blockquote { margin: 0.8em 0; padding: 0.1em 1em; border-left: 1px solid var(--border-3); color: var(--fg-2); }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5em 0; }
dl { margin: 0; }
.muted { color: var(--fg-2); }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.lede { font-size: 1.1875rem; color: var(--fg-2); max-width: 60ch; line-height: 1.55; }
.prose { max-width: 70ch; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.3em 0; }
.prose li::marker { color: var(--fg-3); }
.spacer { flex: 1; }

.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-fg); padding: 0.5em 1em; z-index: 100; border-radius: 0 0 var(--r-row) 0; }
.skip:focus { left: 0; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; gap: 0.2rem; height: var(--header-h); position: relative; }
.home-tab, .site-nav a { position: relative; color: var(--fg-2); text-decoration: none; font-size: 0.9375rem; font-weight: 500; padding: 0.45rem 0.8rem; border-radius: 999px; white-space: nowrap; transition: color var(--t-fast), background var(--t-fast); }
.home-tab { color: var(--fg); font-weight: 600; }
.home-tab:hover, .site-nav a:hover { color: var(--fg); background: var(--surface-3); }
.home-tab[aria-current="page"], .site-nav a[aria-current="page"] { color: var(--fg); background: var(--surface-3); }
.site-nav { display: flex; gap: 0.15rem; }
.nav-count { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; margin-left: 0.4rem; padding: 0 0.35rem; border-radius: 999px; background: var(--accent); color: var(--accent-fg); font-size: 0.75rem; font-weight: 600; line-height: 1; vertical-align: 0.08em; }
.nav-count[hidden] { display: none; }
.logos { display: flex; align-items: center; gap: 0.6rem; }
.logo-taf, .logo-il { display: flex; align-items: center; color: var(--fg); }
.logo-taf svg { height: 17px; width: auto; display: block; }
.logo-il svg { height: 25px; width: auto; display: block; }
.logo-x { color: var(--fg-3); font-size: 0.8rem; line-height: 1; }
.header-actions { display: flex; gap: 0.4rem; align-items: center; margin-left: auto; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--fg-2); cursor: pointer; transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast), transform var(--t-fast); text-decoration: none; }
.icon-btn:hover { color: var(--fg); border-color: var(--border-2); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .ic-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-moon { display: block; }
.menu-btn { display: none; }
@media (max-width: 980px) {
  .menu-btn { display: inline-flex; }
  .site-nav { display: none; position: absolute; top: var(--header-h); left: calc(-1 * var(--gutter)); right: calc(-1 * var(--gutter)); flex-direction: column; gap: 0.1rem; background: var(--bg); border-bottom: 1px solid var(--border); padding: 0.6rem var(--gutter) 1rem; margin: 0; }
  .site-nav.open { display: flex; }
  .site-nav a { font-size: 1rem; padding: 0.6rem 0.8rem; border-radius: var(--r-row); }
}
@media (max-width: 480px) {
  .header-actions a.icon-btn { display: none; }
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 6rem; padding: 3rem 0 3rem; color: var(--fg-2); font-size: 0.9375rem; }
.footer-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 2.5rem; align-items: start; }
.footer-brand { display: flex; flex-direction: column; gap: 0.9rem; max-width: 42ch; }
.footer-brand p { margin: 0; }
.footer-brand .logo-taf svg { height: 15px; }
.footer-brand .logo-il svg { height: 22px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; justify-content: flex-end; }
.footer-links a { color: var(--fg-2); text-decoration: none; }
.footer-links a:hover { color: var(--fg); }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 2rem; flex-wrap: wrap; font-size: 0.875rem; color: var(--fg-3); }
.footer-bottom a { color: var(--fg-2); }
.footer-bottom a:hover { color: var(--fg); }
.footer-orgs { display: inline-flex; gap: 1.5rem; }
@media (max-width: 820px) {
  .footer-top { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
}

/* ---------- buttons ---------- */
.btn, .btn-secondary, .btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 44px; font: inherit; font-size: 0.9375rem; font-weight: 500; letter-spacing: -0.01em; padding: 0 1.25rem; border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast); }
.btn:active, .btn-secondary:active, .btn-ghost:active { transform: scale(0.98); }
.btn { background: var(--accent); color: var(--accent-fg); }
.btn:hover { background: var(--accent-hover); color: var(--accent-fg); }
.btn-secondary { background: var(--surface); color: var(--fg); border-color: var(--border-2); }
.btn-secondary:hover { border-color: var(--border-3); }
.btn-ghost { background: transparent; color: var(--fg-2); padding: 0 0.8rem; }
.btn-ghost:hover { color: var(--fg); }
.btn svg, .btn-secondary svg, .btn-ghost svg { width: 17px; height: 17px; }
.btn-sm { min-height: 36px; padding: 0 0.95rem; font-size: 0.875rem; }
.link-btn { font: inherit; background: none; border: 0; color: var(--fg); text-decoration: underline; text-decoration-color: var(--border-3); text-underline-offset: 3px; padding: 0; cursor: pointer; }

/* ---------- code rows with copy ---------- */
.code-row { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--r-row); background: var(--surface-2); margin: 0.5rem 0; overflow: hidden; }
.code-row pre { flex: 1; margin: 0; padding: 0.75rem 1rem; background: none; border: 0; border-radius: 0; font-size: 0.875rem; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.code-row .code-label { display: none; }
.code-row.labeled { flex-wrap: wrap; }
.code-row.labeled .code-label { display: block; width: 100%; font-size: 0.8125rem; font-weight: 500; color: var(--fg-3); padding: 0.55rem 1rem 0; }
.code-row.wrap-code pre { white-space: pre-wrap; overflow-wrap: anywhere; }
/* Templates and prompts wrap inside their box; script source keeps its lines and scrolls. */
.skill-section pre, .file-body pre:not(.code-file), .case pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.copy { border: 0; border-left: 1px solid var(--border); background: transparent; color: var(--fg-2); padding: 0 0.95rem; cursor: pointer; font: inherit; font-size: 0.8125rem; font-weight: 500; display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; transition: color var(--t-fast), background var(--t-fast); }
.copy:hover { color: var(--fg); background: var(--surface-3); }
.copy svg { width: 15px; height: 15px; }
.copy .ic-check { display: none; }
.copy[data-copied] { color: var(--ok); }
.copy[data-copied] .ic-copy { display: none; }
.copy[data-copied] .ic-check { display: block; }

/* ---------- tabs ---------- */
.tabs { border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); overflow: hidden; }
.tablist { display: flex; gap: 0.25rem; padding: 0.4rem; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { font: inherit; font-size: 0.875rem; font-weight: 500; padding: 0.45rem 0.9rem; background: none; border: 0; border-radius: 999px; color: var(--fg-2); cursor: pointer; white-space: nowrap; transition: color var(--t-fast), background var(--t-fast); }
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { color: var(--fg); background: var(--surface-3); }
.tabpanel { padding: 1rem 1.1rem 1.1rem; }
.tabpanel[hidden] { display: none; }
.tabpanel p { margin: 0.4rem 0; font-size: 0.9375rem; color: var(--fg-2); }
.tabpanel p:first-child { margin-top: 0; }

/* ---------- badges, pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8125rem; font-weight: 500; padding: 0.15rem 0.65rem; border-radius: 999px; border: 1px solid var(--border-2); color: var(--fg-2); line-height: 1.5; vertical-align: middle; }
.pill-version { font-family: var(--mono); font-size: 0.78rem; }
.pill-draft { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.pill-published { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.pill-deprecated { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.pill-meta { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.badges { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; margin: 0.75rem 0; }
.banner { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.9375rem; padding: 0.7rem 1rem; border-radius: var(--r-row); border: 1px solid; margin: 0.9rem 0; }
.banner-draft { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); background: color-mix(in srgb, var(--warn) 6%, transparent); }
.banner-deprecated { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); background: color-mix(in srgb, var(--bad) 6%, transparent); }
.tag { display: inline-block; font-family: var(--mono); font-size: 0.8125rem; background: var(--surface-3); border-radius: 999px; padding: 0.1em 0.6em; margin: 0.15em 0.25em 0.15em 0; text-decoration: none; color: var(--fg-2); }
.tag:hover { color: var(--fg); }

/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; padding: clamp(3rem, 7vw, 5.5rem) 0 1rem; }
/* The faded photo runs full width, from under the header to below the hero. */
.hero-bg { position: absolute; z-index: -1; top: calc(-1 * var(--header-h)); bottom: -7rem; left: 50%; width: 100vw; transform: translateX(-50%); pointer-events: none;
  background: url("/assets/hero-dhow.jpg") 58% 32% / cover no-repeat; opacity: 0.2;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 95%); mask-image: linear-gradient(to bottom, #000 30%, transparent 95%); }
/* Dark: the photo as a monochrome night scene, vignetted into the page. */
:root[data-theme="dark"] .hero-bg { opacity: 0.2; filter: grayscale(1) brightness(0.85) contrast(1.1);
  -webkit-mask-image: linear-gradient(to bottom, #000 25%, transparent 92%), radial-gradient(ellipse 70% 95% at 55% 30%, #000 35%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 25%, transparent 92%), radial-gradient(ellipse 70% 95% at 55% 30%, #000 35%, transparent 100%);
  -webkit-mask-composite: source-in; mask-composite: intersect; }
.hero h1 { font-size: clamp(2.75rem, 6vw, 4.5rem); font-weight: 600; letter-spacing: -0.045em; line-height: 1.02; margin: 1.25rem 0 1.1rem; max-width: 13ch; }
.hero .lede { max-width: 42ch; }
.hero-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.8rem; align-items: center; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 3.5rem; align-items: center; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; } }
.hero-logos .logos { gap: 0.9rem; }
.hero-logos .logo-taf svg { height: 23px; }
.hero-logos .logo-il svg { height: 33px; }
.hero-logos .logo-x { font-size: 0.95rem; }
@media (max-width: 480px) { .hero-logos .logo-taf svg { height: 18px; } .hero-logos .logo-il svg { height: 27px; } }

/* Hero demo: an example conversation, shown as a plain transcript panel. */
.demo { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-card); background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); overflow: hidden; min-width: 0; }
.demo-bar { display: flex; align-items: center; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
.demo-tabs { display: inline-flex; gap: 0.2rem; }
.demo-tab { font: inherit; font-size: 0.875rem; font-weight: 500; padding: 0.35rem 0.85rem; border: 0; border-radius: 999px; background: transparent; color: var(--fg-2); cursor: pointer; white-space: nowrap; transition: color var(--t-fast), background var(--t-fast); }
.demo-tab:hover { color: var(--fg); }
.demo-tab[aria-selected="true"] { background: var(--surface-3); color: var(--fg); }
.demo-tab-short { display: none; }
@media (max-width: 560px) { .demo-tab { padding: 0.35rem 0.65rem; } .demo-tab-long { display: none; } .demo-tab-short { display: inline; } }
.demo-screen[hidden] { display: none; }
.demo-body { height: 440px; overflow-y: auto; padding: 1.1rem 1.2rem 1.3rem; font-size: 0.9375rem; line-height: 1.55; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
.demo-body:focus-visible { outline-offset: -2px; }
.demo-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 1rem; border-top: 1px solid var(--border); font-size: 0.8125rem; color: var(--fg-3); }
.demo-foot-actions { display: inline-flex; gap: 1rem; align-items: center; flex-shrink: 0; }
.demo-foot a { color: var(--fg-2); text-decoration: none; display: inline-flex; gap: 0.35rem; align-items: center; font-weight: 500; }
.demo-foot a:hover { color: var(--fg); }
.demo-foot a[hidden], .demo-replay[hidden] { display: none; }
.demo-foot svg { width: 14px; height: 14px; }
.demo-replay { font: inherit; font-size: 0.8125rem; font-weight: 500; display: inline-flex; gap: 0.35rem; align-items: center; border: 1px solid var(--border-2); background: transparent; color: var(--fg-2); border-radius: 999px; padding: 0.2rem 0.7rem; cursor: pointer; }
.demo-replay:hover { color: var(--fg); border-color: var(--border-3); }
@media (max-width: 960px) { .demo-body { height: 420px; } }
@media (max-width: 560px) { .demo-foot > span:first-child { display: none; } .demo-foot { justify-content: flex-end; } }

/* transcript pieces */
.t-user { margin: 0 0 0.9rem; padding: 0.6rem 0.8rem; border-radius: var(--r-row); background: var(--surface-3); font-size: 0.9rem; line-height: 1.5; color: var(--fg); }
.t-file { display: flex; width: max-content; max-width: 100%; align-items: center; gap: 0.35rem; margin-top: 0.45rem; padding: 0.1rem 0.55rem; border: 1px solid var(--border-2); border-radius: 999px; font-size: 0.8125rem; color: var(--fg-2); }
.t-file svg { width: 13px; height: 13px; }
.t-tool { margin: 0 0 0.75rem; font-family: var(--mono); font-size: 0.8125rem; color: var(--fg-2); }
.t-b { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 0.55rem; vertical-align: 0.08em; }
.t-tool b { font-weight: 500; }
.t-skill { font-family: var(--mono); font-size: 0.9em; color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--border-2); }
a.t-skill:hover { border-color: var(--fg); }
.t-tool .t-skill { font-size: 1em; }
.t-sub { display: block; padding-left: 1.1rem; color: var(--fg-3); }
.t-ai { margin: 0 0 0.9rem; color: var(--fg); }
.t-ai p { margin: 0 0 0.45rem; }
.t-ai p:last-child { margin-bottom: 0; }
.t-ai b { font-weight: 600; }
.t-ai i { font-style: normal; font-family: var(--mono); font-size: 0.88em; color: var(--fg-2); }
.t-ask { margin-top: 0.6rem !important; padding: 0.6rem 0.8rem; border-radius: var(--r-row); background: var(--accent-soft); font-weight: 600; }
.t-ask small { display: block; margin-top: 0.15rem; font-weight: 400; color: var(--fg-2); font-size: 0.875rem; }
.t-block { margin: 0 0 0.9rem; border: 1px solid var(--border); border-radius: var(--r-row); background: var(--surface-2); overflow: hidden; font-size: 0.875rem; }
.t-cap { padding: 0.45rem 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.8125rem; font-weight: 600; color: var(--fg-2); }
table.t-grid { display: table; width: 100%; margin: 0; border-collapse: collapse; font-size: 0.8125rem; table-layout: fixed; }
.t-grid th, .t-grid td { border: 0; border-bottom: 1px solid var(--border); padding: 0.5rem 0.6rem; vertical-align: top; line-height: 1.45; background: none; }
.t-grid tr:last-child th, .t-grid tr:last-child td { border-bottom: 0; }
.t-grid thead th { font-weight: 600; color: var(--fg); }
.t-grid thead th:first-child { width: 24%; }
.t-grid th small { display: block; font-weight: 400; color: var(--fg-3); }
.t-grid tbody th { font-weight: 600; color: var(--fg-2); }
.t-grid td i { font-style: normal; font-family: var(--mono); color: var(--fg-3); }
.t-on, .t-off { display: inline-block; margin-right: 0.35rem; padding: 0 0.35rem; border-radius: 4px; font-family: var(--mono); font-size: 0.75rem; font-weight: 500; vertical-align: 0.05em; }
.t-on { color: var(--fg); background: var(--surface-3); }
.t-off { color: var(--fg-2); box-shadow: inset 0 0 0 1px var(--border-2); }
.t-m { display: block; }
.t-m + .t-m { margin-top: 0.35rem; }
.t-dim { color: var(--fg-3); }
.t-list { margin: 0; padding: 0.55rem 0.8rem 0.6rem 2rem; }
.t-list li { margin: 0.25rem 0; color: var(--fg-2); }
.t-list li::marker { color: var(--fg-3); }
.t-list b { color: var(--fg); font-weight: 600; }
.t-note { margin: 0 0 0.9rem !important; padding: 0.5rem 0.75rem; border-radius: var(--r-row); font-size: 0.875rem; font-weight: 600; }
.t-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 9%, transparent); }
.t-decide { color: var(--accent-text); background: var(--accent-soft); }
.t-gap { margin: 0.2rem 0 0.9rem !important; display: flex; align-items: center; gap: 0.75rem; font-size: 0.8125rem; color: var(--fg-3); }
.t-gap::before, .t-gap::after { content: ""; flex: 1; border-top: 1px solid var(--border-2); }
.t-hyp { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.6rem; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); }
.t-hyp:last-child, .t-res:last-child { border-bottom: 0; }
.t-hyp small { display: block; color: var(--fg-3); font-size: 0.8125rem; margin-top: 0.1rem; }
.t-tag { align-self: start; justify-self: start; padding: 0.05rem 0.45rem; border-radius: 4px; font-family: var(--mono); font-size: 0.75rem; white-space: nowrap; color: var(--fg-2); background: var(--surface-3); }
.t-res { display: grid; grid-template-columns: minmax(0, 1fr) auto 6.5rem; gap: 0.6rem; align-items: baseline; padding: 0.45rem 0.75rem; border-bottom: 1px solid var(--border); }
.t-res b { font-weight: 600; font-size: 0.8125rem; }
.t-res small { color: var(--fg-3); font-family: var(--mono); font-size: 0.75rem; text-align: right; }
.t-res.is-yes b { color: var(--ok); }
.t-res.is-no b, .t-res.is-no span { color: var(--fg-3); }
@media (max-width: 480px) { .t-hyp { grid-template-columns: 1fr; gap: 0.25rem; } .t-res { grid-template-columns: minmax(0, 1fr) auto; } .t-res small { display: none; } }

/* workflow rail in the demo */
.wf-rail { display: flex; align-items: center; margin: 0; padding: 0.6rem 1rem; list-style: none; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.wf-rail li { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8125rem; font-weight: 500; color: var(--fg-3); white-space: nowrap; transition: color var(--t); }
.wf-rail li:not(:last-child) { flex: 1; }
.wf-rail li:not(:last-child)::after { content: ""; flex: 1; min-width: 10px; height: 1px; margin: 0 0.4rem; background: var(--border-2); transition: background var(--t); }
.wf-dot { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border-2); font-family: var(--mono); font-size: 0.72rem; transition: background var(--t), border-color var(--t), color var(--t); }
.wf-rail li.is-active { color: var(--fg); }
.wf-rail li.is-active .wf-dot { border-color: var(--accent); color: var(--accent-fg); background: var(--accent); }
.wf-rail li.is-done { color: var(--fg-2); }
.wf-rail li.is-done .wf-dot { border-color: var(--fg-3); background: var(--fg-3); color: var(--bg); }
.wf-rail li.is-done::after { background: var(--fg-3); }
@media (max-width: 480px) { .wf-lab { display: none; } .wf-rail li.is-active .wf-lab { display: inline; } }

/* animation states, only once app.js has taken over */
.demo.is-anim [data-step].is-pending { display: none; }
.demo.is-anim .w { opacity: 0; transition: opacity 0.25s ease; }
.demo.is-anim .w.on { opacity: 1; }
.demo.is-anim [data-row] { opacity: 0; transform: translateY(4px); transition: opacity 0.3s ease, transform 0.3s ease; }
.demo.is-anim [data-row].on { opacity: 1; transform: none; }
.demo.is-anim .t-tool:not(.is-done) .t-sub { visibility: hidden; }
.demo.is-anim .t-tool:not(.is-done) .t-b { background: var(--accent); }
.demo.is-anim .t-user:not(.is-sent) .t-file { display: none; }
.demo.is-anim .t-user:not(.is-sent) .t-text::after { content: ""; display: inline-block; width: 0.5em; height: 1.05em; margin-left: 1px; vertical-align: -0.18em; background: var(--fg); animation: blink 1s steps(1) infinite; }
.demo.is-anim [data-step="note"]:not(.is-pending), .demo.is-anim [data-step="tool"]:not(.is-pending) { animation: rise 0.35s ease both; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- home sections ---------- */
.section { margin: 6rem 0 0; }
.section-head { margin-bottom: 1.75rem; max-width: 62ch; }
.section-head h2 { margin: 0; font-size: clamp(1.75rem, 3.2vw, 2.5rem); letter-spacing: -0.035em; line-height: 1.08; }
.section-head p { margin: 0.75rem 0 0; color: var(--fg-2); }
.section-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin: 1.5rem 0 0; }

/* The seven stages as a flow chart */
.flow-track { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.flow-step { position: relative; display: flex; justify-content: center; }
.flow-node { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0.25rem; border-radius: var(--r-card); color: var(--fg); text-decoration: none; outline-offset: 4px; }
.flow-ring { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border-2); transition: border-color var(--t), background var(--t), transform var(--t-fast); }
.flow-ring svg { width: 26px; height: 26px; }
.flow-node:active .flow-ring { transform: scale(0.97); }
.flow-text { display: flex; flex-direction: column; align-items: center; }
.flow-l { margin-top: 0.75rem; font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }
.flow-n { margin-top: 0.05rem; font-size: 0.875rem; color: var(--fg-3); }
.flow-d { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.flow-step.is-active .flow-ring, .flow-node:hover .flow-ring { border-color: var(--stage); background: color-mix(in srgb, var(--stage) 9%, var(--surface)); }
.flow-link { position: absolute; z-index: 0; top: calc(0.25rem + 32px); left: calc(50% + 40px); right: calc(-50% + 40px); height: 1px; background: var(--border-2); }
.flow-link::before { content: ""; position: absolute; inset: 0; background: var(--fg-3); transform: scaleX(0); transform-origin: left; transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.flow-step.is-done .flow-link::before { transform: scaleX(1); }
.flow.is-js .flow-step { opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: calc(var(--i) * 70ms); }
.flow.is-js.in-view .flow-step { opacity: 1; transform: none; }

.flow-panels { margin-top: 1.75rem; }
.flow-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1.5rem 2.5rem; padding: 1.6rem 1.75rem; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); animation: panel-in 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
.flow-panel[hidden] { display: none; }
.flow-panel h3 { margin: 0; font-size: 1.5rem; letter-spacing: -0.03em; }
.flow-panel-d { margin: 0.6rem 0 1rem; color: var(--fg-2); max-width: 44ch; }
.flow-panel-more { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.9375rem; font-weight: 500; color: var(--fg); text-decoration: none; }
.flow-panel-more svg { width: 16px; height: 16px; transition: transform var(--t); }
.flow-panel-more:hover svg { transform: translateX(3px); }
.flow-panel-skills { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0; padding: 0; list-style: none; align-content: start; }
.flow-panel-skills a { display: block; height: 100%; padding: 0.7rem 0.85rem; border: 1px solid var(--border); border-radius: var(--r-row); background: var(--surface-2); color: var(--fg); text-decoration: none; transition: border-color var(--t-fast); }
.flow-panel-skills a:hover { border-color: var(--border-3); }
.flow-panel-skills b { display: block; font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.flow-panel-skills code { display: block; margin-top: 0.25rem; padding: 0; background: none; font-size: 0.8125rem; color: var(--fg-3); overflow-wrap: anywhere; }
.flow-foot { margin: 1.1rem 0 0; font-size: 0.9375rem; color: var(--fg-2); }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 1080px) { .flow-panel { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .flow-track { grid-template-columns: 1fr; }
  .flow-step { justify-content: flex-start; padding-bottom: 1.1rem; }
  .flow-node { flex-direction: row; align-items: flex-start; gap: 1rem; padding: 0; text-align: left; }
  .flow-ring { flex-shrink: 0; width: 52px; height: 52px; }
  .flow-ring svg { width: 22px; height: 22px; }
  .flow-text { align-items: flex-start; padding-top: 0.1rem; }
  .flow-l { margin-top: 0; }
  .flow-d { position: static; width: auto; height: auto; overflow: visible; clip: auto; margin-top: 0.25rem; font-size: 0.9375rem; color: var(--fg-2); }
  .flow-link { top: 60px; bottom: 2px; left: 26px; right: auto; width: 1px; height: auto; }
  .flow-link::before { transform: scaleY(0); transform-origin: top; }
  .flow-step.is-done .flow-link::before { transform: scaleY(1); }
  .flow-panels { display: none; }
}

/* Map teaser: one real chain, drawn like the map */
.teaser-chain { display: flex; align-items: stretch; margin: 0; padding: 0; list-style: none; }
.teaser-chain > li:not(.teaser-link) { flex: 1 1 0; min-width: 0; }
.teaser-node { display: flex; flex-direction: column; gap: 0.3rem; height: 100%; padding: 0.95rem 1rem; border: 1px solid var(--border); border-radius: var(--r-row); background: var(--surface); color: var(--fg); text-decoration: none; transition: border-color var(--t-fast); }
.teaser-node:hover { border-color: var(--border-3); }
.teaser-node svg { width: 20px; height: 20px; margin-bottom: 0.2rem; }
.teaser-node b { font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.teaser-pass { margin-top: auto; padding-top: 0.6rem; font-size: 0.8125rem; line-height: 1.35; color: var(--fg-3); }
.teaser-link { position: relative; flex: 0 0 34px; }
.teaser-link::before { content: ""; position: absolute; left: 4px; right: 6px; top: 50%; height: 1px; background: var(--edge-hot); }
.teaser-link::after { content: ""; position: absolute; right: 5px; top: 50%; width: 7px; height: 7px; border-top: 1px solid var(--edge-hot); border-right: 1px solid var(--edge-hot); transform: translateY(-50%) rotate(45deg); }
@media (max-width: 900px) {
  .teaser-chain { flex-direction: column; }
  .teaser-chain > li:not(.teaser-link) { flex: none; }
  .teaser-link { flex: 0 0 28px; }
  .teaser-link::before { left: 1.4rem; right: auto; top: 3px; bottom: 5px; width: 1px; height: auto; }
  .teaser-link::after { left: calc(1.4rem - 3px); right: auto; top: auto; bottom: 5px; transform: rotate(135deg); }
}

/* Workflow tiles */
.wf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.wf-tile { display: flex; flex-direction: column; gap: 0.4rem; height: 100%; padding: 1.25rem 1.4rem; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); color: var(--fg); text-decoration: none; transition: border-color var(--t-fast), transform var(--t-fast); }
.wf-tile:hover { border-color: var(--border-3); }
.wf-tile:active { transform: scale(0.99); }
.wf-tile b { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
.wf-tile .wf-tile-lead { color: var(--fg-2); font-size: 0.9375rem; }
.wf-tile .wfg-compact { margin-top: auto; padding-top: 1.1rem; }
@media (max-width: 720px) { .wf-grid { grid-template-columns: 1fr; } }

/* Install band */
.install-band { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 2rem 3rem; align-items: center; padding: 2rem; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); }
.install-band h2 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -0.035em; }
.install-band p { color: var(--fg-2); margin: 0.6rem 0 0; }
@media (max-width: 860px) { .install-band { grid-template-columns: minmax(0, 1fr); padding: 1.4rem; } }

/* ---------- page heads ---------- */
.page-head { padding: 3rem 0 0.5rem; }
.page-head h1 { margin: 0 0 0.7rem; }
.page-head .lede { margin: 0; }
.page-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; }

/* ---------- catalog ---------- */
.stage-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 2rem 0 0; }
.stage-chip { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 38px; padding: 0 0.95rem 0 0.8rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--fg-2); font: inherit; font-size: 0.9375rem; font-weight: 500; cursor: pointer; transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast), transform var(--t-fast); }
.stage-chip svg { width: 17px; height: 17px; }
.stage-chip span { font-family: var(--mono); font-size: 0.8125rem; color: var(--fg-3); }
.stage-chip:hover { color: var(--fg); border-color: var(--border-2); }
.stage-chip:active { transform: scale(0.98); }
.stage-chip[aria-pressed="true"] { color: var(--bg); border-color: var(--fg); background: var(--fg); }
.stage-chip[aria-pressed="true"] span, .stage-chip[aria-pressed="true"] svg { color: inherit; opacity: 0.8; }
.stage-chip.chip-all { padding-left: 0.95rem; }
.stage-desc { min-height: 1.6em; color: var(--fg-2); font-size: 0.9375rem; margin: 0.8rem 0 1.25rem; }
.stage-desc b { color: var(--fg); font-weight: 600; }

.toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.5rem; }
.search { flex: 1 1 280px; position: relative; display: block; }
.search input { width: 100%; font: inherit; font-size: 1rem; min-height: 44px; padding: 0.6rem 2.6rem 0.6rem 2.6rem; background: var(--surface); border: 1px solid var(--border-2); color: var(--fg); border-radius: var(--r-row); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.search input::placeholder { color: var(--fg-3); }
.search input:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-ring); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search > svg { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--fg-3); pointer-events: none; }
.search kbd { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); font-size: 0.78rem; border: 1px solid var(--border-2); border-radius: 5px; padding: 0.05rem 0.45rem; color: var(--fg-3); pointer-events: none; }
.more-filters { position: relative; }
.more-filters summary { list-style: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border: 1px solid var(--border-2); border-radius: 999px; background: var(--surface); color: var(--fg-2); font-size: 0.9375rem; font-weight: 500; cursor: pointer; user-select: none; }
.more-filters summary::-webkit-details-marker { display: none; }
.more-filters summary::after { content: ""; width: 7px; height: 7px; margin-left: 0.6rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform var(--t-fast); }
.more-filters[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.more-filters summary:hover, .more-filters[open] summary { color: var(--fg); border-color: var(--border-3); }
.more-filters-body { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; display: grid; gap: 0.5rem; width: 260px; padding: 0.75rem; border: 1px solid var(--border-2); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); }
.more-filters-body .select { width: 100%; }
.select { font: inherit; font-size: 0.9375rem; padding: 0.55rem 2rem 0.55rem 0.85rem; background-color: var(--surface); background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23777' stroke-width='1.5'/></svg>"); background-repeat: no-repeat; background-position: right 0.75rem center; border: 1px solid var(--border-2); border-radius: var(--r-row); color: var(--fg); appearance: none; -webkit-appearance: none; cursor: pointer; max-width: 100%; }
.select:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-ring); }
.filter-count { color: var(--fg-3); font-size: 0.875rem; font-family: var(--mono); margin-left: auto; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.75rem; }
/* One group per stage. Its heading sticks under the site header while you scroll
   through the group, and the next group's heading pushes it out. */
.group { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; gap: 0.75rem; }
.group + .group { margin-top: 2rem; }
.group-head { grid-column: 1 / -1; position: sticky; top: var(--header-h); z-index: 5; display: flex; align-items: baseline; gap: 0.35rem 1.5rem; flex-wrap: wrap; padding: 0.8rem 0 0.7rem; }
/* Once stuck (app.js sets is-stuck), the heading gets a full-width band like the header's. */
.group-head::before { content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: calc(50% - 50vw); right: calc(50% - 50vw); border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 80%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); opacity: 0; transition: opacity var(--t-fast); }
.group-head.is-stuck::before { opacity: 1; }
.group-head h2 { display: inline-flex; align-items: baseline; gap: 0.55rem; margin: 0; font-size: 1.5rem; letter-spacing: -0.03em; }
.group-head h2 svg { width: 22px; height: 22px; align-self: center; }
.group-head h2 .group-n { font-family: var(--mono); font-size: 0.9rem; font-weight: 400; color: var(--fg-3); }
.group-head p { margin: 0; color: var(--fg-2); font-size: 0.9375rem; }
.grid.is-filtered .group { display: contents; }
.grid.is-filtered .group-head { display: none; }
.card { position: relative; display: flex; flex-direction: column; padding: 1.2rem 1.3rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); min-width: 0; transition: border-color var(--t-fast); }
.card:hover { border-color: var(--border-3); }
.card[hidden] { display: none; }
.card h3 { margin: 0; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-name { font-family: var(--mono); font-size: 0.8125rem; color: var(--fg-3); margin: 0.2rem 0 0; overflow-wrap: anywhere; }
.card-desc { margin: 0.6rem 0 0; font-size: 0.9375rem; line-height: 1.5; color: var(--fg-2); flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; align-items: center; gap: 0.6rem; margin-top: 1rem; }
.card-stage { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.875rem; color: var(--fg-3); }
.card-stage svg { width: 17px; height: 17px; }
.no-results { border: 1px dashed var(--border-2); border-radius: var(--r-card); padding: 2rem; text-align: center; color: var(--fg-2); }

/* Add-to-workflow buttons */
.add-btn { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 0.35rem; min-height: 34px; padding: 0 0.85rem 0 0.7rem; border: 1px solid var(--border-2); border-radius: 999px; background: var(--surface); color: var(--fg-2); font: inherit; font-size: 0.875rem; font-weight: 500; cursor: pointer; white-space: nowrap; transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast), transform var(--t-fast); }
.add-btn svg { width: 15px; height: 15px; }
.add-btn:hover { color: var(--fg); border-color: var(--border-3); }
.add-btn:active { transform: scale(0.97); }
.add-btn[aria-pressed="true"] { color: var(--accent-fg); background: var(--accent); border-color: var(--accent); }
.add-btn-lg { width: 100%; justify-content: center; min-height: 44px; font-size: 0.9375rem; }
.icon-only { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--fg-2); cursor: pointer; transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast); }
.icon-only:hover { color: var(--fg); border-color: var(--border-3); }
.icon-only:disabled { opacity: 0.35; cursor: default; }
.icon-only svg { width: 15px; height: 15px; }
.icon-only[aria-pressed="true"] { color: var(--accent-fg); background: var(--accent); border-color: var(--accent); }

/* ---------- skill map ---------- */
.map-head { padding-bottom: 1.25rem; }
.map-head .lede { max-width: 68ch; }
.map-tools { display: flex; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap; margin-top: 1.5rem; }
.map-search { flex: 0 1 340px; }
.map-hint { margin: 0; color: var(--fg-3); font-size: 0.9375rem; }
.map-wrap { position: relative; width: min(calc(100vw - 2 * var(--gutter)), 1560px); margin-left: calc((100% - min(calc(100vw - 2 * var(--gutter)), 1560px)) / 2); }
.map { position: relative; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); overflow-x: auto; }
.map-loading { padding: 1.5rem; color: var(--fg-2); margin: 0; }
.map-inner { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(136px, 1fr); gap: 1.5rem; padding: 1.25rem 1.25rem 1.5rem; min-width: 1290px; }
body.panel-open .map-inner { padding-right: 420px; }
.map-col { position: relative; z-index: 2; }
.map-col-head { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.75rem; padding-bottom: 0.6rem; border-bottom: 2px solid var(--stage); font-size: 0.9375rem; font-weight: 600; color: var(--fg); }
.map-col-head svg { width: 18px; height: 18px; color: var(--stage); }
.map-col-head span { margin-left: auto; font-family: var(--mono); font-size: 0.8125rem; font-weight: 400; color: var(--fg-3); }
.map-node { position: relative; z-index: 2; display: block; width: 100%; margin: 0 0 0.45rem; padding: 0.5rem 0.65rem 0.55rem; border: 1px solid color-mix(in srgb, var(--stage) 24%, var(--border-2)); border-radius: var(--r-row); background: color-mix(in srgb, var(--stage) 7%, var(--surface)); color: var(--fg); font: inherit; text-align: left; cursor: pointer; transition: opacity var(--t-fast), border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast); }
:root[data-theme="dark"] .map-node { background: color-mix(in srgb, var(--stage) 11%, var(--surface)); border-color: color-mix(in srgb, var(--stage) 26%, var(--border-2)); }
.map-node b { display: block; font-size: 0.875rem; font-weight: 500; line-height: 1.3; }
.map-node code { display: block; margin-top: 0.2rem; padding: 0; background: none; font-size: 0.72rem; line-height: 1.35; color: var(--fg-3); overflow-wrap: anywhere; }
.map-node:hover { border-color: color-mix(in srgb, var(--stage) 55%, var(--border-3)); }
.map-node .wf-badge { position: absolute; top: -7px; right: -7px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 0.3rem; border-radius: 999px; background: var(--accent); color: var(--accent-fg); font-size: 0.75rem; font-weight: 600; line-height: 1; }
.map.is-focus .map-node { opacity: 0.28; }
.map.is-focus .map-node.is-on { opacity: 1; border-color: color-mix(in srgb, var(--stage) 55%, var(--border-3)); }
.map.is-focus .map-node.is-sel { opacity: 1; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-ring); }
.map.is-search:not(.is-focus) .map-node:not(.is-match) { opacity: 0.25; }
.map.is-search:not(.is-focus) .map-node.is-match { border-color: var(--accent-text); }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: visible; }
.map-svg path.edge { fill: none; stroke: var(--edge); stroke-width: 1.25; transition: stroke var(--t-fast), opacity var(--t-fast); }
.map-svg path.edge.is-hot { stroke: var(--edge-hot); stroke-width: 1.75; }
.map.is-focus .map-svg path.edge:not(.is-hot) { opacity: 0.08; }
.map-svg .arrow path { fill: var(--edge); }
.map-svg .arrow-hot path { fill: var(--edge-hot); }
.map-narrow { display: none; font-size: 0.9375rem; }
@media (max-width: 800px) { .map-narrow { display: block; } body.panel-open .map-inner { padding-right: 1.25rem; } }

.map-panel { position: fixed; z-index: 45; top: calc(var(--header-h) + 12px); right: 12px; bottom: 12px; width: 400px; overflow-y: auto; padding: 1.25rem 1.35rem 1.5rem; border: 1px solid var(--border-2); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); overscroll-behavior: contain; }
.map-panel[hidden] { display: none; }
.mp-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.9rem; }
.mp-stage { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.875rem; color: var(--fg-2); }
.mp-stage svg { width: 17px; height: 17px; }
.mp-close { font: inherit; font-size: 0.875rem; font-weight: 500; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.75rem; border: 1px solid var(--border-2); border-radius: 999px; background: transparent; color: var(--fg-2); cursor: pointer; }
.mp-close:hover { color: var(--fg); border-color: var(--border-3); }
.mp-close svg { width: 14px; height: 14px; }
.map-panel h2 { margin: 0; font-size: 1.375rem; letter-spacing: -0.03em; }
.mp-name { margin: 0.25rem 0 0; font-family: var(--mono); font-size: 0.8125rem; color: var(--fg-3); }
.mp-what { margin: 0.75rem 0 1rem; color: var(--fg-2); font-size: 0.9375rem; }
.mp-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.mp-actions .btn-secondary, .mp-actions .add-btn { min-height: 38px; }
.mp-sec { margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--border); }
.mp-sec h3 { margin: 0 0 0.6rem; font-size: 1rem; }
.mp-group + .mp-group { margin-top: 0.85rem; }
.mp-io { margin: 0 0 0.35rem; font-size: 0.8125rem; color: var(--fg-3); }
.mp-io b { font-weight: 500; color: var(--fg-2); }
.mp-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.35rem; }
.mp-row { display: flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.35rem 0.3rem 0.65rem; border: 1px solid var(--border); border-radius: var(--r-row); background: var(--surface-2); }
.mp-go { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.45rem; padding: 0.2rem 0; border: 0; background: none; color: var(--fg); font: inherit; font-size: 0.9rem; text-align: left; cursor: pointer; }
.mp-go svg { width: 16px; height: 16px; }
.mp-go span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-go:hover span { text-decoration: underline; text-decoration-color: var(--border-3); text-underline-offset: 3px; }
.mp-row a.icon-only { text-decoration: none; }
.mp-none, .mp-supply { margin: 0; font-size: 0.9375rem; color: var(--fg-2); }
@media (max-width: 800px) {
  .map-panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 62vh; border-radius: var(--r-card) var(--r-card) 0 0; }
}

/* ---------- workflow tray ---------- */
.wf-tray { position: fixed; z-index: 48; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(760px, calc(100vw - 24px)); border: 1px solid var(--border-2); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); }
.wf-tray[hidden] { display: none; }
body.panel-open .wf-tray { left: calc(50% - 212px); width: min(640px, calc(100vw - 450px)); }
.wt-bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.65rem 0.6rem 1rem; }
.wt-title { flex-shrink: 0; font-size: 0.9375rem; font-weight: 600; }
.wt-title span { color: var(--fg-3); font-weight: 400; }
.wt-chips { flex: 1; min-width: 0; display: flex; gap: 0.35rem; overflow-x: auto; scrollbar-width: none; margin: 0; padding: 0; list-style: none; }
.wt-chips li { flex-shrink: 0; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.6rem 0.15rem 0.25rem; border-radius: 999px; background: var(--surface-3); font-size: 0.8125rem; color: var(--fg-2); white-space: nowrap; }
.wt-chips li b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); font-size: 0.72rem; font-weight: 600; color: var(--fg); }
.wt-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.wt-list { margin: 0; padding: 0.25rem 0.65rem 0.65rem; list-style: none; max-height: min(50vh, 420px); overflow-y: auto; border-top: 1px solid var(--border); }
.wt-list[hidden] { display: none; }
.wt-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.55rem 0.65rem 0.65rem 1rem; border-top: 1px solid var(--border); font-size: 0.875rem; color: var(--fg-3); }
.wt-foot[hidden] { display: none; }
body.has-tray { padding-bottom: 92px; }
@media (max-width: 800px) { body.panel-open .wf-tray { display: none; } }
@media (max-width: 560px) { .wt-chips { display: none; } .wt-bar { justify-content: space-between; } }

/* reorderable step rows, shared by the tray and the builder */
.step-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.4rem 0.45rem 0.5rem; border-radius: var(--r-row); }
.step-row + .step-row { border-top: 1px solid var(--border); border-radius: 0; }
.step-row.is-drag { opacity: 0.45; }
.step-row.is-over { box-shadow: inset 0 2px 0 var(--accent); }
.drag-handle { display: inline-grid; place-items: center; width: 22px; height: 30px; color: var(--fg-3); cursor: grab; touch-action: none; }
.drag-handle svg { width: 16px; height: 16px; }
.step-n { display: inline-grid; place-items: center; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); font-size: 0.8125rem; font-weight: 600; }
.step-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9375rem; }
.step-ctl { display: flex; gap: 0.25rem; flex-shrink: 0; }
.step-ctl .icon-only { width: 30px; height: 30px; }

/* ---------- workflow builder ---------- */
.builder { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; margin-top: 1.5rem; }
.builder-empty { grid-column: 1 / -1; padding: 2.5rem; border: 1px dashed var(--border-2); border-radius: var(--r-card); text-align: center; color: var(--fg-2); }
.builder-empty p { margin: 0 0 1rem; }
.builder-tools { display: flex; align-items: flex-end; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.builder-tools label { display: flex; flex-direction: column; gap: 0.3rem; flex: 1 1 220px; font-size: 0.875rem; font-weight: 500; color: var(--fg-2); }
.builder-tools input { font: inherit; font-size: 1rem; min-height: 44px; padding: 0.55rem 0.85rem; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-row); color: var(--fg); }
.builder-tools input:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-ring); }
.builder-help { margin: -0.6rem 0 1.25rem; font-size: 0.875rem; color: var(--fg-3); }
.b-steps { margin: 0; padding: 0; list-style: none; }
.b-step { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.25rem 0.9rem; align-items: start; padding: 1rem 1rem 1rem 0.75rem; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); }
.b-step.is-drag { opacity: 0.45; }
.b-step.is-over { box-shadow: 0 -3px 0 var(--accent); }
.b-step .b-num { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.b-step .step-n { width: 30px; height: 30px; font-size: 0.875rem; background: var(--fg); color: var(--bg); }
.b-meta { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8125rem; color: var(--fg-3); }
.b-meta svg { width: 16px; height: 16px; }
.b-step h3 { margin: 0.15rem 0 0; font-size: 1.125rem; letter-spacing: -0.015em; }
.b-step h3 a { text-decoration: none; }
.b-step h3 a:hover { text-decoration: underline; text-decoration-color: var(--border-3); }
.b-step code { display: block; margin-top: 0.15rem; padding: 0; background: none; font-size: 0.8125rem; color: var(--fg-3); }
.b-step p { margin: 0.5rem 0 0; font-size: 0.9375rem; color: var(--fg-2); }
.b-step .step-ctl { flex-direction: column; }
.b-link { position: relative; margin: 0; padding: 0.65rem 0 0.65rem 2.6rem; font-size: 0.875rem; color: var(--fg-2); }
.b-link::before { content: ""; position: absolute; left: calc(0.75rem + 15px); top: 0; bottom: 0; width: 1px; background: var(--edge-hot); }
.b-link.is-gap { color: var(--fg-3); }
.b-link.is-gap::before { background: none; border-left: 1px dashed var(--border-3); }
.b-link b { font-weight: 500; color: var(--fg); }
.builder-side { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 1rem; }
.b-box { padding: 1.25rem 1.35rem; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); }
.b-box h2 { margin: 0 0 0.4rem; font-size: 1.125rem; letter-spacing: -0.02em; }
.b-box > p { margin: 0.35rem 0 0.6rem; font-size: 0.9375rem; color: var(--fg-2); }
.b-box h3 { margin: 1rem 0 0.25rem; font-size: 0.9375rem; }
.b-downloads { margin: 0.4rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.3rem; font-size: 0.9rem; }
.b-downloads a { display: inline-flex; align-items: center; gap: 0.4rem; text-decoration: none; }
.b-downloads a:hover code { color: var(--fg); }
.b-downloads svg { width: 15px; height: 15px; color: var(--fg-3); }
.b-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.b-row-center { justify-content: center; }
@media (max-width: 960px) { .builder { grid-template-columns: minmax(0, 1fr); } .builder-side { position: static; } }

/* ---------- skill page ---------- */
.breadcrumb { font-size: 0.875rem; color: var(--fg-3); margin: 2rem 0 0; display: flex; gap: 0.45rem; align-items: center; font-family: var(--mono); }
.page-head .breadcrumb { margin: 0 0 1rem; }
.breadcrumb a { color: var(--fg-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--fg); }
.skill-head { padding: 1rem 0 2rem; border-bottom: 1px solid var(--border); }
.skill-head h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.04em; line-height: 1.06; margin: 0.25rem 0 0.6rem; max-width: 24ch; }
.skill-name-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; font-family: var(--mono); font-size: 0.875rem; color: var(--fg-2); margin: 0; }
.skill-what { font-size: 1.1875rem; color: var(--fg-2); max-width: 62ch; margin: 1rem 0 0; line-height: 1.55; }
.skill-adds { font-size: 1rem; color: var(--fg-2); max-width: 62ch; margin: 0.75rem 0 0; line-height: 1.55; }
.skill-adds b { color: var(--fg); font-weight: 600; }
.skill-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3.5rem; margin-top: 2rem; align-items: start; }
.skill-main { min-width: 0; }
.skill-side { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 1rem; font-size: 0.9375rem; }
.side-box { border: 1px solid var(--border); border-radius: var(--r-card); padding: 1rem 1.1rem; background: var(--surface); }
.side-box h2 { font-size: 0.9375rem; color: var(--fg); margin: 0 0 0.6rem; font-weight: 600; letter-spacing: -0.01em; }
.side-box .side-sub { margin-top: 1.1rem; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc a { display: block; padding: 0.3rem 0 0.3rem 0.8rem; border-left: 1px solid var(--border-2); color: var(--fg-2); text-decoration: none; font-size: 0.875rem; transition: color var(--t-fast), border-color var(--t-fast); }
.toc a:hover { color: var(--fg); }
.toc a.is-active { color: var(--fg); border-left-color: var(--fg); }
dl.meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.45rem 1rem; margin: 0; }
dl.meta dt { color: var(--fg-3); font-size: 0.875rem; }
dl.meta dd { margin: 0; overflow-wrap: anywhere; font-size: 0.9rem; }
dl.meta dd a { text-decoration: none; color: var(--fg); border-bottom: 1px solid var(--border-2); }
dl.meta dd a:hover { border-color: var(--fg); }
.callout { border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--border); padding: 1rem 1.2rem; margin: 0 0 1.5rem; }
.callout-title { margin: 0 0 0.3rem; font-size: 0.9375rem; color: var(--fg); font-weight: 600; letter-spacing: -0.01em; }
.callout p { margin: 0.2rem 0; color: var(--fg-2); font-size: 0.9375rem; }
.chain { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 1rem; align-items: center; margin: 1.5rem 0; padding: 1.1rem 1.2rem; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); }
.chain-col h3 { margin: 0 0 0.5rem; font-size: 0.9375rem; color: var(--fg); font-weight: 600; }
.chain-mid { display: flex; align-items: center; gap: 0.5rem; justify-content: center; }
.chain-self { font-family: var(--mono); font-size: 0.8125rem; padding: 0.55rem 0.85rem; border: 1px solid var(--border-3); border-radius: var(--r-row); text-align: center; overflow-wrap: anywhere; }
.chain-arrow { color: var(--fg-3); text-align: center; font-size: 1.1rem; }
.chain-foot { grid-column: 1 / -1; margin: 0.25rem 0 0; font-size: 0.9375rem; }
.chain-foot a { display: inline-flex; align-items: center; gap: 0.4rem; }
.chain-foot svg { width: 17px; height: 17px; }
.io-chip { display: block; font-family: var(--mono); font-size: 0.8125rem; padding: 0.45rem 0.65rem; border: 1px solid var(--border); border-radius: var(--r-row); background: var(--surface-2); margin: 0.35rem 0; color: var(--fg); }
.io-chip small { display: block; font-family: var(--font); color: var(--fg-3); font-size: 0.8125rem; margin-top: 0.15rem; }
.io-chip small a { color: var(--fg-2); text-decoration: none; border-bottom: 1px solid var(--border-2); }
.io-chip small a:hover { color: var(--fg); border-color: var(--fg); }
.io-none { color: var(--fg-3); font-size: 0.875rem; }
.skill-section { margin: 2.5rem 0; }
.skill-section > h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.03em; margin: 0 0 0.9rem; }
.skill-section ul, .skill-section ol { padding-left: 1.4em; }
.skill-section li { margin: 0.3em 0; }
.skill-section li::marker { color: var(--fg-3); }
.skill-section h3 { font-size: 1.1rem; margin: 1.4em 0 0.35em; }
.cite pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.disclosure-line { font-size: 0.9375rem; border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 2rem; color: var(--fg-2); }
.validator-notes { font-size: 0.875rem; margin-top: 0.8rem; color: var(--fg-2); }
.validator-notes summary { cursor: pointer; }
.validator-notes ul { padding-left: 1.2em; }

/* Skill page tabs, one per part of the skill folder. Without JS the tab bar is
   hidden and every panel shows, one after another. With JS, html.js hides the
   other panels before first paint and app.js takes over (is-ready). */
html:has(.skill-tabs) { scroll-padding-top: calc(var(--header-h) + 76px); }
.ptabs-bar { display: none; position: sticky; top: var(--header-h); z-index: 20; margin-top: 1rem; }
.ptabs-bar::before { content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: calc(50% - 50vw); right: calc(50% - 50vw); border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 85%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
html.js .ptabs-bar { display: block; }
html.js .skill-page .skill-head { padding-bottom: 0.75rem; border-bottom: 0; }
.ptabs { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; padding: 0.55rem 0; }
.ptabs::-webkit-scrollbar { display: none; }
.ptab { display: inline-flex; align-items: center; gap: 0.45rem; font: inherit; font-size: 0.9375rem; font-weight: 500; padding: 0.5rem 0.95rem; background: none; border: 0; border-radius: 999px; color: var(--fg-2); cursor: pointer; white-space: nowrap; transition: color var(--t-fast), background var(--t-fast); }
.ptab:hover { color: var(--fg); }
.ptab[aria-selected="true"] { color: var(--fg); background: var(--surface-3); }
.ptab-count { font-size: 0.8125rem; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.ptab[aria-selected="true"] .ptab-count { color: var(--fg-2); }
html.js .skill-tabs:not(.is-ready) .ptab-panel:not([data-default]) { display: none; }
.ptab-panel[hidden] { display: none; }
html:not(.js) .ptab-panel + .ptab-panel { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--border); }
html.js .skill-tabs .skill-side { top: calc(var(--header-h) + 76px); }
.tab-intro { margin: 0 0 2rem; padding: 0 0 1.25rem; border-bottom: 1px solid var(--border); }
.tab-title { margin: 0 0 0.5rem; font-size: 1.5rem; letter-spacing: -0.03em; }
html.js .tab-title { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.tab-intro p { margin: 0; color: var(--fg-2); max-width: 66ch; }
.tab-intro .tab-source { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 1rem; margin-top: 0.7rem; font-size: 0.875rem; }
.tab-source a { color: var(--fg-2); }
.tab-source a:hover { color: var(--fg); }

.case { margin: 0 0 1rem; padding: 1.1rem 1.25rem 1.2rem; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); }
.case h3 { margin: 0 0 0.8rem; font-size: 1.0625rem; letter-spacing: -0.015em; }
.case-label { margin: 1rem 0 0.35rem; font-size: 0.875rem; font-weight: 600; color: var(--fg); }
.case h3 + .case-label { margin-top: 0; }
.case-prompt { margin: 0; padding: 0.7rem 1rem; border: 0; border-radius: var(--r-row); background: var(--surface-2); color: var(--fg); }
.case-prompt p, .case-expected p { margin: 0.45rem 0; }
.case-prompt p:first-child, .case-expected p:first-child { margin-top: 0; }
.case-prompt p:last-child, .case-expected p:last-child { margin-bottom: 0; }
.case-expected { color: var(--fg-2); }
.case-list { margin: 0.3rem 0; padding-left: 1.3em; color: var(--fg-2); }

.file-index { list-style: none; margin: 0 0 2.5rem; padding: 0; display: grid; gap: 0.5rem; }
.file-index li { padding: 0.75rem 0.95rem; border: 1px solid var(--border); border-radius: var(--r-row); background: var(--surface); }
.file-index a { display: block; text-decoration: none; }
.file-index a:hover b { text-decoration: underline; text-decoration-color: var(--border-3); text-underline-offset: 3px; }
.file-index b { display: block; font-weight: 600; }
.file-index code { display: block; margin-top: 0.15rem; padding: 0; background: none; color: var(--fg-3); font-size: 0.8125rem; }
.file-index span { display: block; margin-top: 0.25rem; color: var(--fg-2); font-size: 0.9375rem; }
.file-doc { margin: 0 0 3rem; }
.file-doc + .file-doc { padding-top: 2.5rem; border-top: 1px solid var(--border); }
.file-head h3 { margin: 0 0 0.45rem; font-size: 1.375rem; letter-spacing: -0.025em; line-height: 1.25; }
.file-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 1rem; margin: 0; font-size: 0.875rem; color: var(--fg-3); }
.file-meta code { padding: 0; background: none; color: var(--fg-2); }
.file-meta a { color: var(--fg-2); }
.file-meta a:hover { color: var(--fg); }
.file-purpose { margin: 0.7rem 0 0; color: var(--fg-2); max-width: 66ch; }
.file-body { margin-top: 1.25rem; }
.file-body h4 { margin: 1.7em 0 0.45em; font-size: 1.1875rem; letter-spacing: -0.02em; }
.file-body h5 { margin: 1.4em 0 0.35em; font-size: 1rem; }
.file-body h6 { margin: 1.2em 0 0.3em; font-size: 0.9375rem; }
.file-body ul, .file-body ol { padding-left: 1.4em; }
.file-body li { margin: 0.3em 0; }
.file-body li::marker { color: var(--fg-3); }
.code-file { max-height: 36rem; margin-top: 1.25rem; font-size: 0.8125rem; }
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); font-size: 0.9375rem; }
.file-list a { text-decoration: none; overflow-wrap: anywhere; }
.file-list span { color: var(--fg-3); font-size: 0.875rem; white-space: nowrap; }
#version-history > h3 { margin: 2rem 0 0.4rem; font-size: 1.125rem; letter-spacing: -0.015em; }
#version-history > .tab-intro + h3 { margin-top: 0; }

/* Review this skill: the action row and side panel (feedback.js). The panel sits
   above the workflow tray; under 800px it becomes a bottom sheet. */
.skill-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.75rem; margin: 1.5rem 0 0; }
html:not(.js) .skill-actions, html:not(.js) .skill-actions-note { display: none; }
.skill-actions .btn svg, .skill-actions .btn-secondary svg { width: 18px; height: 18px; }
.skill-actions-note { margin: 0.75rem 0 0; color: var(--fg-2); font-size: 0.9375rem; }
.rating-summary { display: inline-flex; align-items: center; gap: 0.45rem; margin-left: 0.4rem; color: var(--fg-2); font-size: 0.9375rem; text-decoration: none; }
.rating-summary b { color: var(--fg); font-weight: 600; }
.rating-summary:hover span { color: var(--fg); }
.stars { display: inline-flex; gap: 1px; color: var(--accent); }
.stars svg { width: 16px; height: 16px; }
.skill-actions-note a { color: var(--fg); }
.fb-panel { position: fixed; z-index: 55; top: calc(var(--header-h) + 12px); right: 12px; bottom: 12px; width: 440px; max-width: calc(100vw - 24px); display: flex; flex-direction: column; border: 1px solid var(--border-2); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); }
.fb-panel[hidden] { display: none; }
.fb-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1rem 0.8rem 1.25rem; border-bottom: 1px solid var(--border); }
.fb-title { margin: 0; font-size: 1.25rem; letter-spacing: -0.025em; }
.fb-title:focus { outline: none; }
.fb-close svg { width: 18px; height: 18px; }
.fb-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 1.1rem 1.25rem 1.5rem; font-size: 0.9375rem; }
.fb-body > p { margin: 0 0 0.85rem; }
.fb-target code { font-size: 0.875rem; }
.fb-fine { color: var(--fg-3); font-size: 0.875rem; }
.fb-error { padding: 0.6rem 0.8rem; border: 1px solid color-mix(in srgb, var(--bad) 45%, transparent); border-radius: var(--r-row); background: color-mix(in srgb, var(--bad) 9%, transparent); color: var(--fg); }
.fb-google { min-height: 48px; margin: 1.1rem 0; }
.fb-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.fb-form { display: grid; gap: 1.15rem; }
.fb-form > p { margin: 0; }
.fb-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.fb-field legend, .fb-field > label { display: block; margin-bottom: 0.4rem; padding: 0; font-size: 0.9375rem; font-weight: 600; }
.fb-opt { font-size: 0.875rem; font-weight: 400; color: var(--fg-3); }
.fb-hint { margin: -0.1rem 0 0.5rem; color: var(--fg-3); font-size: 0.875rem; }
.fb-field > .fb-radio { display: flex; align-items: center; gap: 0.55rem; margin: 0; padding: 0.3rem 0; font-weight: 400; cursor: pointer; }
.fb-radio input { margin: 0; accent-color: var(--accent); }
.fb-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.fb-chip { position: relative; cursor: pointer; }
.fb-chip input { position: absolute; opacity: 0; pointer-events: none; }
.fb-chip span { display: inline-block; padding: 0.3rem 0.75rem; border: 1px solid var(--border-2); border-radius: 999px; color: var(--fg-2); font-size: 0.875rem; transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast); }
.fb-chip:hover span { color: var(--fg); }
.fb-chip input:checked + span { color: var(--fg); border-color: var(--fg); background: var(--surface-3); }
.fb-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.fb-form textarea, .fb-form input[type="text"] { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--border-2); border-radius: var(--r-row); background: var(--bg); color: var(--fg); font: inherit; font-size: 0.9375rem; }
.fb-form textarea { resize: vertical; line-height: 1.5; }
.fb-form textarea:focus, .fb-form input[type="text"]:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-ring); }
.fb-form .btn { justify-self: start; }
.fb-fallback { padding-top: 1rem; border-top: 1px solid var(--border); }
.fb-fallback p { margin: 0 0 0.75rem; }
@media (max-width: 800px) {
  .fb-panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-width: none; max-height: calc(100dvh - var(--header-h)); border-radius: var(--r-card) var(--r-card) 0 0; }
}

/* The Reviews tab */
.reviews-block > h3 { margin: 0 0 1rem; font-size: 1.25rem; letter-spacing: -0.02em; }
.review-list { display: grid; gap: 0.75rem; }
.review-card { padding: 1rem 1.2rem 1.1rem; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); }
.review-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.75rem; }
.review-head span, .review-head time { color: var(--fg-3); font-size: 0.875rem; }
.review-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0.6rem 0; }
.review-state { padding: 0.15rem 0.65rem; border: 1px solid var(--border-2); border-radius: 999px; font-size: 0.8125rem; font-weight: 600; line-height: 1.5; }
.state-answered { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.state-open { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.state-declined, .state-closed { color: var(--fg-3); }
.review-parts { margin: 0 0 0.5rem; color: var(--fg-3); font-size: 0.875rem; }
.review-excerpt { margin: 0; color: var(--fg-2); white-space: pre-line; }
.review-answer { margin: 0.75rem 0 0; padding: 0.6rem 0.8rem; border-radius: var(--r-row); background: var(--surface-2); font-size: 0.9375rem; }
.review-link { margin: 0.75rem 0 0; font-size: 0.9375rem; }
.reviews-foot { margin: 1rem 0 0; font-size: 0.9375rem; }
.reviews-block + .reviews-block { margin-top: 3rem; }

/* Ratings: overview, comments, and the star input in the panel */
.rating-overview { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem 2rem; margin: 0 0 1.25rem; padding: 1.1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); }
.rating-big { display: grid; justify-items: start; gap: 0.25rem; }
.rating-big b { font-size: 2.25rem; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.rating-big span:last-child { color: var(--fg-3); font-size: 0.875rem; }
.rating-bars { display: grid; gap: 0.3rem; max-width: 320px; }
.rating-bar { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) 1.5rem; align-items: center; gap: 0.6rem; color: var(--fg-2); font-size: 0.8125rem; }
.rating-bar .bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.rating-bar .bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.rating-bar .bar-n { text-align: right; font-variant-numeric: tabular-nums; }
.rating-overview .btn-secondary svg { width: 18px; height: 18px; }
.rating-card { margin: 0 0 0.75rem; padding: 0.9rem 1.2rem 1rem; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); }
.rating-card.is-hidden { opacity: 0.6; border-style: dashed; }
.rating-card .review-head { align-items: center; }
.review-head .stars { color: var(--accent); }
.rating-card .review-excerpt { margin-top: 0.5rem; }
.rating-badge { padding: 0.05rem 0.55rem; border: 1px solid var(--border-2); border-radius: 999px; font-size: 0.8125rem; }
.rating-admin { display: flex; gap: 1rem; margin: 0.6rem 0 0; font-size: 0.875rem; }
.star-input { display: flex; align-items: center; gap: 0.15rem; }
.star-input label { display: inline-flex; padding: 0.2rem; border-radius: 8px; color: var(--border-3); cursor: pointer; transition: color var(--t-fast), transform var(--t-fast); }
.star-input label.on { color: var(--accent); }
.star-input label:hover { transform: scale(1.1); }
.star-input label:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.star-input svg { width: 30px; height: 30px; }
.star-word { margin-left: 0.6rem; color: var(--fg-2); font-size: 0.9375rem; }
.fb-note { padding: 0.6rem 0.8rem; border-radius: var(--r-row); background: var(--surface-2); color: var(--fg-2); }
@media (max-width: 700px) {
  .rating-overview { grid-template-columns: 1fr; }
  .rating-summary { margin-left: 0; }
}
@media (max-width: 900px) {
  .skill-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .skill-side { position: static; }
  .chain { grid-template-columns: 1fr; }
  .chain-mid { flex-direction: column; }
  .chain-arrow { transform: rotate(90deg); }
}

/* ---------- workflows ---------- */
.wf-list { list-style: none; padding: 0; margin: 2rem 0; display: grid; gap: 0.75rem; }
.wf-item { border: 1px solid var(--border); border-radius: var(--r-card); padding: 1.35rem 1.5rem; background: var(--surface); }
.wf-item h2 { margin: 0 0 0.35rem; font-size: 1.25rem; letter-spacing: -0.02em; }
.wf-item h2 a { text-decoration: none; }
.wf-item h2 a:hover { text-decoration: underline; text-decoration-color: var(--border-3); }
.wf-item > p { margin: 0.25rem 0 0.9rem; color: var(--fg-2); }
.wf-build { border-style: dashed; background: transparent; }

/* Workflow graph: steps as rings in layer columns, parallel steps stacked, lines
   drawn by app.js. Shared by the Workflows list, workflow pages, and home tiles. */
.wfg { position: relative; margin-top: 1.5rem; }
.wfg-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), auto); gap: 1.6rem 0.6rem; margin: 0; padding: 0; list-style: none; }
.wfg-node { position: relative; z-index: 1; grid-column: var(--c); grid-row: var(--r) / span var(--span); align-self: start; display: flex; justify-content: center; transition: opacity var(--t); }
.wfg-node[data-span] { align-self: center; }
.wfg-hit { display: flex; flex-direction: column; align-items: center; gap: 0.55rem; text-align: center; color: var(--fg); text-decoration: none; border-radius: var(--r-row); outline-offset: 4px; cursor: pointer; }
.wfg-ring { display: grid; place-items: center; flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border-2); transition: border-color var(--t), background var(--t), transform var(--t-fast); }
.wfg-ring svg { width: 21px; height: 21px; }
.wfg-node[data-optional] .wfg-ring { border-style: dashed; border-color: var(--border-3); }
.wfg-t { max-width: 13ch; padding: 0 0.2rem; border-radius: 4px; background: var(--surface); font-size: 0.8125rem; font-weight: 500; line-height: 1.3; }
.wfg-node.is-active .wfg-ring, .wfg-node.is-hot .wfg-ring, .wfg-hit:hover .wfg-ring { border-color: var(--stage); background: color-mix(in srgb, var(--stage) 10%, var(--surface)); }
.wfg-hit:active .wfg-ring { transform: scale(0.96); }
.wfg.is-js .wfg-node:not(.is-done) { opacity: 0.3; }
.wfg.is-focus .wfg-node:not(.is-near) { opacity: 0.4; }
.wfg-svg { position: absolute; top: 0; left: 0; z-index: 0; max-width: none; pointer-events: none; overflow: visible; }
.wfg-svg path { fill: none; stroke: var(--border-3); stroke-width: 1.25; transition: stroke-dashoffset 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), stroke var(--t-fast), opacity var(--t); }
.wfg-svg path.is-pending { opacity: 0; }
.wfg-svg path.is-opt { stroke-dasharray: 3 4; }
.wfg-svg path.is-hot { stroke: var(--edge-hot); stroke-width: 1.75; }
.wfg.is-focus .wfg-svg path:not(.is-hot) { opacity: 0.2; }
.wfg-svg .wfg-arrow path { fill: var(--border-3); }
.wfg-svg .wfg-arrow-hot path { fill: var(--edge-hot); }
.wfg-cap { min-height: 4.9rem; margin-top: 1.4rem; padding-top: 0.9rem; border-top: 1px solid var(--border); font-size: 0.9375rem; color: var(--fg-2); }
.wfg-hint { margin: 0; color: var(--fg-3); }
.wfg-cap-t { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.2rem 0.6rem; margin: 0 0 0.35rem; color: var(--fg); font-weight: 600; }
.wfg-cap-t span { font-family: var(--mono); font-size: 0.8125rem; font-weight: 400; color: var(--fg-3); }
.wfg-cap-t .wfg-opt { font-family: var(--font); padding: 0 0.5rem; border: 1px dashed var(--border-3); border-radius: 999px; }
.wfg-cap dl { display: grid; gap: 0.2rem; margin: 0; }
.wfg-cap dl div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.75rem; }
.wfg-cap dt { color: var(--fg-3); font-size: 0.875rem; }
.wfg-cap dd { margin: 0; }
/* compact: rings only, inside the home tiles */
.wfg-compact { display: grid; grid-template-columns: repeat(var(--cols), 26px); grid-template-rows: repeat(var(--rows), 26px); justify-content: space-between; row-gap: 10px; max-width: calc(var(--cols) * 50px); margin-top: 0; }
.wfg-compact .wfg-node { align-self: start; }
.wfg-compact .wfg-node[data-span] { align-self: center; }
.wfg-compact .wfg-ring { width: 26px; height: 26px; }
.wfg-compact .wfg-ring svg { width: 13px; height: 13px; }
.wfg-compact .wfg-node.is-active .wfg-ring { border-color: var(--stage); background: color-mix(in srgb, var(--stage) 10%, var(--surface)); }
@media (max-width: 720px) {
  .wfg-grid { grid-template-columns: repeat(var(--rows), minmax(0, 1fr)); grid-template-rows: none; gap: 1.1rem 0.75rem; }
  .wfg-grid .wfg-node { grid-column: var(--r) / span var(--span); grid-row: var(--c); justify-content: flex-start; }
  .wfg-grid .wfg-node[data-span] { align-self: start; justify-self: center; }
  .wfg-hit { flex-direction: row; gap: 0.75rem; text-align: left; }
  .wfg-t { max-width: none; }
  .wfg-cap dl div { grid-template-columns: 1fr; gap: 0; }
}
.wf-overview { margin: 2rem 0; padding: 1.4rem 1.5rem; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); }
.wf-overview h2 { margin: 0 0 0.9rem; font-size: 1.125rem; }
.wf-overview h3 { margin: 1.5rem 0 0.2rem; font-size: 1rem; }
.wf-overview .muted { margin: 0.2rem 0 0.4rem; font-size: 0.9375rem; }
.wf-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1.1rem; }

/* ---------- generic pages ---------- */
.steps { display: grid; gap: 0.75rem; margin: 2rem 0; }
.step { border: 1px solid var(--border); border-radius: var(--r-card); padding: 1.35rem 1.5rem; background: var(--surface); }
.step h2 { font-size: 1.25rem; margin: 0 0 0.5rem; display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; letter-spacing: -0.02em; }
.step p { color: var(--fg-2); margin: 0.45rem 0; }
.step ol, .step ul { color: var(--fg-2); padding-left: 1.3em; margin: 0.45rem 0; }
.step li { margin: 0.3em 0; }
.step strong, .step b { color: var(--fg); }
.note { border: 1px solid var(--border); border-radius: var(--r-card); padding: 1.1rem 1.3rem; background: var(--surface); color: var(--fg-2); margin: 1.5rem 0; }
.note strong { color: var(--fg); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.75rem; margin: 1.5rem 0; }
.panel { border: 1px solid var(--border); border-radius: var(--r-card); padding: 1.25rem 1.4rem; background: var(--surface); }
.panel h2, .panel h3 { margin: 0 0 0.5rem; font-size: 1.125rem; }
.panel p, .panel li { color: var(--fg-2); font-size: 0.9375rem; }
.panel ul { padding-left: 1.2em; margin: 0.4rem 0; }
.panel strong { color: var(--fg); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-row); overflow: hidden; margin: 1.25rem 0; font-size: 0.9375rem; }
.compare > div { background: var(--surface-2); padding: 0.9rem 1rem; }
.compare h3 { margin: 0 0 0.5rem; font-size: 0.9375rem; }
.compare .yes h3 { color: var(--ok); }
.compare .no h3 { color: var(--bad); }
.compare ul { margin: 0; padding-left: 1.2em; color: var(--fg-2); }
.tree { font-family: var(--mono); font-size: 0.8125rem; line-height: 1.6; color: var(--fg-2); margin: 0; overflow-x: auto; }
.tree b { color: var(--fg); font-weight: 500; }
.tree .c { color: var(--fg-3); }

/* About page */
.section.about-first { margin-top: 2.5rem; }
.page-about .prose p { margin: 0 0 0.9rem; }
/* Who it is for: four personas, each a flat character drawn for this site
   (site/src/assets/personas/) in a gold circle, with a name and one line on who
   they are. The characters rise into their circles once when the row scrolls into
   view (app.js sets .is-js, then .in-view); pointing at or tapping one adds .play:
   it bounces, blinks, and moves its prop. */
.personas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; margin: 1.75rem 0 0.5rem; }
.persona { text-align: center; cursor: default; }
.persona h3 { margin: 0.9rem 0 0.3rem; }
.persona p { margin: 0 auto; max-width: 28ch; color: var(--fg-2); font-size: 0.9375rem; line-height: 1.6; }
.av { display: block; width: 112px; height: 112px; margin: 0 auto; border-radius: 50%; clip-path: circle(50%); background: #fbefc8; transition: background-color var(--t); }
.persona:hover .av { background: #f8e3a4; }
:root[data-theme="dark"] .av { background: #e8dbb0; }
:root[data-theme="dark"] .persona:hover .av { background: #f0dc9c; }
.av g[class] { transform-box: fill-box; transform-origin: 50% 50%; }
.av .av-fig { transform-origin: 50% 100%; }
.av .av-page { transform-origin: 0% 50%; }
.av .av-note { transform-origin: 50% 100%; }
.av .av-glass { transform-origin: 80% 90%; }
.av .av-cap { transform-origin: 50% 80%; }
.av .av-tassel { transform-origin: 50% 0%; }
.av-check path { stroke-dasharray: 1 1; }
.personas.is-js .av-fig { transform: translateY(45%); }
.personas.is-js .av-spark { opacity: 0; }
.personas.in-view .av-fig { transform: none; transition: transform 0.75s cubic-bezier(0.2, 0.9, 0.25, 1.12) calc(var(--i) * 130ms); }
.personas.in-view .av-spark { opacity: 1; transition: opacity 0.4s ease calc(var(--i) * 130ms + 500ms); }
.persona.play .av-fig { animation: av-bounce 0.7s ease-out; }
.persona.play .av-eyes { animation: av-blink 0.3s ease 0.3s; }
.persona.play .av-star { animation: av-twinkle 0.8s ease-in-out; }
.persona.play .av-star + .av-star { animation-delay: 0.15s; }
.persona.play .av-page { animation: av-flip 0.9s cubic-bezier(0.45, 0, 0.25, 1); }
.persona.play .av-note { animation: av-wiggle 0.8s ease-in-out; }
.persona.play .av-check path { animation: av-draw 0.45s ease 0.35s both; }
.persona.play .av-glass { animation: av-scan 1s ease-in-out; }
.persona.play .av-cap { animation: av-tip 0.6s ease-out; }
.persona.play .av-tassel { animation: av-swing 1.2s ease-out; }
@keyframes av-bounce { 25% { transform: scale(1.04, 0.95); } 50% { transform: scale(0.97, 1.05); } 75% { transform: scale(1.01, 0.99); } }
@keyframes av-blink { 50% { transform: scaleY(0.1); } }
@keyframes av-twinkle { 40% { transform: scale(1.35) rotate(25deg); } }
@keyframes av-flip { to { transform: scaleX(-1); } }
@keyframes av-wiggle { 20% { transform: rotate(-9deg); } 45% { transform: rotate(7deg); } 70% { transform: rotate(-4deg); } }
@keyframes av-draw { from { stroke-dashoffset: 1; } }
@keyframes av-scan { 30% { transform: translate(-5%, -3%) rotate(-8deg); } 65% { transform: translate(3%, 1%) rotate(5deg); } }
@keyframes av-tip { 35% { transform: rotate(-6deg); } }
@keyframes av-swing { 18% { transform: rotate(24deg); } 42% { transform: rotate(-15deg); } 66% { transform: rotate(8deg); } 86% { transform: rotate(-3deg); } }
@media (max-width: 900px) { .personas { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2rem; } }
@media (max-width: 420px) {
  .personas { gap: 1.5rem 1rem; }
  .av { width: 96px; height: 96px; }
  .persona p { font-size: 0.875rem; line-height: 1.5; }
}

/* Principles: the memorandum's four, word for word. Each card shows its heading and
   opens to the full text; all start closed. */
.principles { display: grid; gap: 0.5rem; margin: 1.5rem 0; }
.principle { padding: 0; }
.principle summary { display: flex; align-items: baseline; justify-content: space-between; gap: 1.5rem; padding: 1.1rem 1.4rem; list-style: none; cursor: pointer; border-radius: var(--r-card); }
.principle summary::-webkit-details-marker { display: none; }
.principle summary:focus-visible { outline-offset: -2px; }
.principle summary h3 { margin: 0; }
.principle-more { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.875rem; font-weight: 500; color: var(--fg-2); white-space: nowrap; }
.principle-more::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform var(--t-fast); }
.principle summary:hover .principle-more { color: var(--fg); }
.principle .less, .principle[open] .more { display: none; }
.principle[open] .less { display: inline; }
.principle[open] .principle-more::after { transform: translateY(1px) rotate(-135deg); }
.principle-body { max-width: 72ch; padding: 0 1.4rem 1.3rem; }
.principle-body p { margin: 0 0 0.7rem; font-size: 1rem; }
.principle-body .principle-practice { margin: 0.2rem 0 0; padding: 0.7rem 0.85rem; border-radius: var(--r-row); background: var(--surface-2); font-size: 0.9375rem; }
.principle-practice b { color: var(--fg); font-weight: 600; }

/* Roadmap: the broad stages in a row. A gold line runs through the finished stages
   to the current one and stops partway; later stages sit on a dashed line. When it
   scrolls into view (.is-js, then .in-view) the line draws stage by stage. Stacks
   vertically on narrow screens. */
.roadmap { list-style: none; padding: 0; margin: 2rem 0 1.25rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rm-step { position: relative; padding: 2.1rem 1.5rem 0 0; }
.rm-track { position: absolute; top: 0; left: 0; right: 0; height: 14px; }
.rm-track::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; border-top: 2px dashed var(--border-2); }
.rm-step:last-child .rm-track::before { -webkit-mask-image: linear-gradient(90deg, #000 20%, transparent 85%); mask-image: linear-gradient(90deg, #000 20%, transparent 85%); }
.rm-seg { position: absolute; left: 0; top: 6px; width: 100%; height: 2px; background: var(--edge-hot); transform-origin: left center; }
.rm-step.is-now .rm-seg { width: 45%; }
.rm-step.is-next .rm-seg { display: none; }
.rm-dot { position: absolute; left: 0; top: 0; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-3); background: var(--surface); }
.rm-step.is-done .rm-dot { background: var(--edge-hot); border-color: var(--edge-hot); }
.rm-step.is-now .rm-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.rm-dot::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; }
.rm-when { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.3rem; font-family: var(--mono); font-size: 0.8125rem; color: var(--fg-3); }
.rm-here { padding: 0.05rem 0.55rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-family: var(--font); font-size: 0.75rem; font-weight: 600; }
.rm-step h3 { margin: 0 0 0.35rem; font-size: 1.0625rem; }
.rm-step p:last-child { margin: 0; color: var(--fg-2); font-size: 0.9375rem; }
.roadmap.is-js .rm-seg { transform: scaleX(0); }
.roadmap.is-js .rm-dot { transform: scale(0); }
.roadmap.is-js .rm-step > :not(.rm-track) { opacity: 0; transform: translateY(8px); }
.roadmap.in-view .rm-seg { transform: none; transition: transform 0.5s linear calc(var(--i) * 0.5s + 0.2s); }
.roadmap.in-view .rm-dot { transform: none; transition: transform 0.4s cubic-bezier(0.3, 1.5, 0.5, 1) calc(var(--i) * 0.5s); }
.roadmap.in-view .rm-step > :not(.rm-track) { opacity: 1; transform: none; transition: opacity 0.5s ease calc(var(--i) * 0.5s + 0.1s), transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--i) * 0.5s + 0.1s); }
.roadmap.in-view .is-now .rm-dot::after { animation: rm-ping 1.4s ease-out calc(var(--i) * 0.5s + 0.4s) 2; }
@keyframes rm-ping { from { opacity: 0.7; transform: scale(1); } to { opacity: 0; transform: scale(2.6); } }
@media (max-width: 720px) {
  .roadmap { grid-template-columns: minmax(0, 1fr); }
  .rm-step { padding: 0 0 1.6rem 2.1rem; }
  .rm-step:last-child { padding-bottom: 0; }
  .rm-track { top: 0.3rem; bottom: -0.3rem; right: auto; width: 14px; height: auto; }
  .rm-track::before { left: 6px; right: auto; top: 0; bottom: 0; border-top: 0; border-left: 2px dashed var(--border-2); }
  .rm-step:last-child .rm-track::before { -webkit-mask-image: linear-gradient(180deg, #000 20%, transparent 85%); mask-image: linear-gradient(180deg, #000 20%, transparent 85%); }
  .rm-seg { left: 6px; top: 0; width: 2px; height: 100%; transform-origin: center top; }
  .rm-step.is-now .rm-seg { width: 2px; height: 45%; }
  .roadmap.is-js:not(.in-view) .rm-seg { transform: scaleY(0); }
}
.empty-state { border: 1px dashed var(--border-2); border-radius: var(--r-card); padding: 1.5rem; color: var(--fg-2); margin: 1.5rem 0; }
@media (max-width: 640px) { .compare { grid-template-columns: 1fr; } }

/* What's new timeline */
.news { list-style: none; padding: 0; margin: 2rem 0 0 0.3rem; border-left: 1px solid var(--border-2); }
.news-item { position: relative; padding: 0 0 1.75rem 1.5rem; }
.news-item::before { content: ""; position: absolute; left: -4px; top: 0.55rem; width: 7px; height: 7px; border-radius: 50%; background: var(--fg-3); box-shadow: 0 0 0 3px var(--bg); }
.news-date { font-family: var(--mono); font-size: 0.8125rem; color: var(--fg-3); }
.news-item h3 { margin: 0.15rem 0 0.3rem; font-size: 1.125rem; display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; }
.news-item h3 a { text-decoration: none; }
.news-item h3 code { font-size: 0.8rem; }
.news-body { color: var(--fg-2); font-size: 0.9375rem; }
.news-body p { margin: 0.3rem 0; }
.news-body h2, .news-body h3 { display: none; }
.news-body ul { padding-left: 1.2em; margin: 0.3rem 0; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 1.1rem; max-width: 640px; margin: 2rem 0; }
.form label { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 500; font-size: 0.9375rem; }
.form label .muted { font-weight: 400; font-size: 0.875rem; }
.form label.check { flex-direction: row; align-items: flex-start; gap: 0.6rem; font-weight: 400; color: var(--fg-2); }
.form input[type="checkbox"] { margin-top: 0.35em; accent-color: var(--accent); }
.form input, .form select, .form textarea { font: inherit; font-size: 1rem; color: var(--fg); background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-row); padding: 0.6rem 0.85rem; max-width: 100%; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-ring); }
.form textarea { resize: vertical; }
.form input[type="file"] { padding: 0.5rem; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--border-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle; margin-left: 0.5rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-ok { border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 7%, transparent); color: var(--fg); border-radius: var(--r-row); padding: 0.85rem 1rem; margin-top: 1rem; }
.result-err { border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); background: color-mix(in srgb, var(--bad) 7%, transparent); color: var(--fg); border-radius: var(--r-row); padding: 0.85rem 1rem; margin-top: 1rem; }
.result-report { margin-top: 0.6rem; max-height: 420px; overflow: auto; white-space: pre-wrap; }

/* ---------- motion ---------- */
.reveal { animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { animation: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  :root { --gutter: 18px; }
  .hero { padding-top: 2.5rem; }
  .section { margin-top: 4rem; }
}
