/* yawast.com — one stylesheet, no build step. Light and dark themes are
   custom properties; data-theme on <html> overrides the system preference. */

:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;

  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 16px;
  --max: 1180px;
  --doc-max: 760px;
  --header-h: 64px;

  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-softer: #eef0f3;
  --surface: #ffffff;
  --border: #e3e6ea;
  --border-strong: #cfd4da;
  --text: #15181d;
  --text-soft: #3d444d;
  --muted: #646d78;
  --accent: #b23a30;        /* the yawast red */
  --accent-strong: #962e25;
  --accent-soft: #fbeceb;
  --accent-text: #ffffff;
  --link: #a3352c;
  --focus: #d4574c;
  --code-bg: #f3f4f6;
  --code-text: #1f2328;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -12px rgba(16, 24, 40, .18);
  --shadow-l: 0 2px 4px rgba(16, 24, 40, .04), 0 24px 60px -20px rgba(16, 24, 40, .28);
  --hero-glow: radial-gradient(60% 50% at 70% 0%, rgba(178, 58, 48, .10), transparent 70%);
  --grid-line: rgba(16, 24, 40, .045);

  /* Terminals are dark in both themes. */
  --term-bg: #0d1117;
  --term-chrome: #161b22;
  --term-border: #2a313c;
  --term-text: #d6dde6;
  --term-muted: #7d8794;
  --term-prompt: #e8736a;
  --term-cmd: #f2f5f8;

  --sev-critical: #e5484d;
  --sev-high: #f76b15;
  --sev-medium: #f5b84a;
  --sev-low: #59a7f5;
  --sev-info: #8b95a1;
  --ok: #3fb27f;
}

/* Dark: the system preference, unless the visitor picked light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0c10;
    --bg-soft: #10141a;
    --bg-softer: #161b22;
    --surface: #11151b;
    --border: #232a33;
    --border-strong: #303844;
    --text: #e8ebef;
    --text-soft: #c2c9d2;
    --muted: #8b95a1;
    --accent: #e8665c;
    --accent-strong: #f07b71;
    --accent-soft: rgba(232, 102, 92, .12);
    --accent-text: #160807;
    --link: #f08378;
    --focus: #f08378;
    --code-bg: #151a21;
    --code-text: #e1e6ec;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-l: 0 2px 4px rgba(0, 0, 0, .3), 0 30px 80px -30px rgba(0, 0, 0, .8);
    --hero-glow: radial-gradient(60% 50% at 70% 0%, rgba(232, 102, 92, .16), transparent 70%);
    --grid-line: rgba(255, 255, 255, .035);
    --term-bg: #07090c;
    --term-chrome: #0f1318;
    --term-border: #252c36;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0c10;
  --bg-soft: #10141a;
  --bg-softer: #161b22;
  --surface: #11151b;
  --border: #232a33;
  --border-strong: #303844;
  --text: #e8ebef;
  --text-soft: #c2c9d2;
  --muted: #8b95a1;
  --accent: #e8665c;
  --accent-strong: #f07b71;
  --accent-soft: rgba(232, 102, 92, .12);
  --accent-text: #160807;
  --link: #f08378;
  --focus: #f08378;
  --code-bg: #151a21;
  --code-text: #e1e6ec;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --shadow-l: 0 2px 4px rgba(0, 0, 0, .3), 0 30px 80px -30px rgba(0, 0, 0, .8);
  --hero-glow: radial-gradient(60% 50% at 70% 0%, rgba(232, 102, 92, .16), transparent 70%);
  --grid-line: rgba(255, 255, 255, .035);
  --term-bg: #07090c;
  --term-chrome: #0f1318;
  --term-border: #252c36;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; color: var(--text); margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4vw, 2.6rem); font-weight: 750; }
h2 { font-size: 1.6rem; font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 650; }
p { margin: 0 0 1em; }

code, kbd, pre { font-family: var(--font-mono); font-size: .9em; }
:not(pre) > code {
  background: var(--code-bg);
  color: var(--code-text);
  padding: .12em .38em;
  border-radius: 5px;
  border: 1px solid var(--border);
  font-size: .86em;
  white-space: break-spaces;
}
kbd {
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: .05em .4em;
  font-size: .8em;
  background: var(--bg-soft);
}

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--accent); color: var(--accent-text); padding: 8px 14px; border-radius: var(--radius-s);
}
.skip-link:focus { left: 12px; }

.container { width: min(100% - 40px, var(--max)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: 28px; }

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; color: var(--text);
  font: 700 1.2rem/1 var(--font-mono); letter-spacing: -0.03em;
}
.brand:hover { color: var(--text); }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand .caret { color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site-nav a {
  color: var(--text-soft); text-decoration: none; font-size: .93rem; font-weight: 500;
  padding: 7px 11px; border-radius: var(--radius-s);
}
.site-nav a:hover { color: var(--text); background: var(--bg-soft); }
.site-nav a[aria-current="page"] { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-button {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: var(--radius-s);
  border: 1px solid transparent; background: transparent; color: var(--text-soft);
  cursor: pointer; text-decoration: none;
}
.icon-button:hover { background: var(--bg-soft); color: var(--text); border-color: var(--border); }
.icon-button svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.menu-toggle { display: none; }
@media (max-width: 860px) {
  .site-header .container { gap: 12px; }
  .menu-toggle { display: inline-grid; margin-left: auto; }
  .site-nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: 10px 20px 18px;
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 11px 6px; font-size: 1rem; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius);
  font: 600 .95rem/1 var(--font-sans); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s, transform .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-text); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { color: var(--text); border-color: var(--muted); }

/* ---------- Copyable command ---------- */

.cmd {
  display: inline-flex; align-items: center; gap: 12px; max-width: 100%;
  background: var(--term-bg); color: var(--term-cmd);
  border: 1px solid var(--term-border); border-radius: var(--radius);
  padding: 6px 6px 6px 16px; font: .92rem/1.4 var(--font-mono);
  box-shadow: var(--shadow);
}
.cmd code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; white-space: nowrap; overflow-x: auto; }
.cmd .prompt { color: var(--term-prompt); user-select: none; }
.copy {
  flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px;
  border-radius: 7px; border: 1px solid var(--term-border); background: var(--term-chrome);
  color: var(--term-muted); cursor: pointer;
}
.copy:hover { color: var(--term-cmd); }
.copy svg { width: 15px; height: 15px; }
.copy .icon-check { display: none; color: var(--ok); }
.copy.copied .icon-check { display: block; }
.copy.copied .icon-copy { display: none; }

/* ---------- Hero ---------- */

.hero {
  position: relative; overflow: hidden;
  padding: 72px 0 40px;
  background: var(--hero-glow);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, #000 30%, transparent 75%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; }
.hero-copy { max-width: 820px; margin-inline: auto; text-align: center; }
.hero-copy .lede { margin-inline: auto; }
.hero-copy .hero-actions { justify-content: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font: 600 .8rem/1 var(--font-mono); letter-spacing: .02em;
  color: var(--text-soft); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 7px 12px 7px 8px;
  text-decoration: none; margin-bottom: 22px;
}
.eyebrow:hover { color: var(--text); border-color: var(--border-strong); }
.eyebrow .pill { background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 4px 8px; }
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.1rem); line-height: 1.04; letter-spacing: -0.035em;
  font-weight: 800; margin-bottom: 20px;
}
.hero h1 .accent { color: var(--accent); }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--text-soft); max-width: 640px; margin-bottom: 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.hero-note { font-size: .86rem; color: var(--muted); }
.hero-note a { color: inherit; }

/* ---------- Terminal ---------- */

.terminal {
  background: var(--term-bg); color: var(--term-text);
  border: 1px solid var(--term-border); border-radius: var(--radius-l);
  box-shadow: var(--shadow-l); overflow: hidden;
  font: 13.5px/1.6 var(--font-mono);
}
.terminal-chrome {
  display: flex; align-items: center; gap: 14px;
  background: var(--term-chrome); border-bottom: 1px solid var(--term-border);
  padding: 0 14px; min-height: 46px;
}
.lights { display: flex; gap: 7px; flex: none; }
.lights span { width: 11px; height: 11px; border-radius: 50%; background: #3b424d; }
.lights span:nth-child(1) { background: #ec6a5e; }
.lights span:nth-child(2) { background: #f4bf4f; }
.lights span:nth-child(3) { background: #61c554; }
.term-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.term-tabs::-webkit-scrollbar { display: none; }
.term-tab {
  font: 500 12.5px/1 var(--font-mono); color: var(--term-muted); background: none;
  border: 0; border-radius: 7px; padding: 8px 11px; cursor: pointer; white-space: nowrap;
}
.term-tab:hover { color: var(--term-text); background: rgba(255, 255, 255, .04); }
.term-tab[aria-selected="true"] { color: var(--term-cmd); background: rgba(255, 255, 255, .07); }
.term-replay {
  margin-left: auto; flex: none; background: none; border: 0; color: var(--term-muted); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; font: 12px var(--font-mono); padding: 6px 8px; border-radius: 6px;
}
.term-replay:hover { color: var(--term-cmd); background: rgba(255, 255, 255, .05); }
.term-replay svg { width: 14px; height: 14px; }
.term-body {
  padding: 18px 20px 22px; height: 470px; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: #2b323c transparent;
}
.term-body .line { white-space: pre-wrap; word-break: break-word; min-height: 1.6em; }
.term-body .prompt { color: var(--term-prompt); user-select: none; }
.term-body .cmdtext { color: var(--term-cmd); }
.term-body .cursor {
  display: inline-block; width: .6em; height: 1.15em; vertical-align: text-bottom;
  background: var(--term-cmd); margin-left: 1px; animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.t-muted { color: var(--term-muted); }
.t-dim { color: #5c6673; }
.t-key { color: #8d98a6; }
.t-head { color: var(--term-cmd); font-weight: 600; }
.t-rule { color: #7d8794; }
.t-ok { color: var(--ok); }
.t-str { color: #a5d6a7; }
.t-num { color: #f5b84a; }
.t-accent { color: var(--term-prompt); }
.sev { font-weight: 700; }
.sev-critical { color: var(--sev-critical); }
.sev-high { color: var(--sev-high); }
.sev-medium { color: var(--sev-medium); }
.sev-low { color: var(--sev-low); }
.sev-info { color: var(--sev-info); }
.t-comment { color: #5c6673; font-style: italic; }
.spinner::after { content: "⠋"; animation: spin .8s steps(8) infinite; display: inline-block; }
@keyframes spin {
  0% { content: "⠋"; } 12% { content: "⠙"; } 25% { content: "⠹"; } 37% { content: "⠸"; }
  50% { content: "⠼"; } 62% { content: "⠴"; } 75% { content: "⠦"; } 87% { content: "⠧"; }
}

/* Agent chat (MCP demo) inside the terminal. */
.chat-user, .chat-agent, .chat-tool { margin: 4px 0 12px; white-space: pre-wrap; }
.chat-user { color: var(--term-cmd); }
.chat-user::before { content: "you  "; color: var(--term-prompt); font-weight: 700; }
.chat-agent { color: var(--term-text); }
.chat-agent::before { content: "agent  "; color: #b392f0; font-weight: 700; }
.chat-tool { border-left: 2px solid #3a2f55; padding: 2px 0 2px 12px; color: var(--term-muted); }

/* ---------- Sections ---------- */

.section { padding: 88px 0; }
.section-alt { background: var(--bg-soft); border-block: 1px solid var(--border); }
.section-head { max-width: 720px; margin-bottom: 44px; }
.section-head.center { margin-inline: auto; text-align: center; }
.kicker {
  display: block; font: 600 .78rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .12em;
  color: var(--accent); margin-bottom: 14px;
}
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); letter-spacing: -0.03em; font-weight: 780; }
.section-head p { color: var(--text-soft); font-size: 1.08rem; margin: 0; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-l); overflow: hidden; margin-top: 56px; }
.stat { background: var(--surface); padding: 22px 24px; }
.stat strong { display: block; font: 750 2rem/1.1 var(--font-sans); letter-spacing: -0.03em; }
.stat span { color: var(--muted); font-size: .9rem; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .cards { grid-template-columns: minmax(0, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l);
  padding: 24px; transition: border-color .15s, transform .15s, box-shadow .15s;
  display: flex; flex-direction: column;
}
a.card { text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.card h3 { margin: 14px 0 8px; font-size: 1.08rem; }
.card p { color: var(--text-soft); font-size: .95rem; margin: 0 0 12px; }
.card ul { margin: auto 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.card li {
  font: 500 .75rem/1 var(--font-mono); color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 8px; background: var(--bg-soft);
}
.card-icon {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.card-icon svg { width: 21px; height: 21px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 56px; align-items: center; }
.split.reverse > :first-child { order: 2; }
@media (max-width: 960px) { .split, .split.reverse { grid-template-columns: minmax(0, 1fr); gap: 32px; } .split.reverse > :first-child { order: 0; } }

.checklist { list-style: none; padding: 0; margin: 22px 0 28px; display: grid; gap: 14px; }
.checklist li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; color: var(--text-soft); }
.checklist li strong { color: var(--text); }
.checklist svg { width: 20px; height: 20px; color: var(--accent); margin-top: 3px; }

/* Code panels (CI example). */
.panel {
  background: var(--term-bg); border: 1px solid var(--term-border); border-radius: var(--radius-l);
  overflow: hidden; box-shadow: var(--shadow-l);
}
.panel-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--term-chrome);
  border-bottom: 1px solid var(--term-border); color: var(--term-muted); font: 12.5px var(--font-mono);
}
.panel-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.panel pre { margin: 0; padding: 18px 20px; overflow-x: auto; color: var(--term-text); font-size: 13px; line-height: 1.65; background: none; border: 0; }
.panel + .panel { margin-top: 18px; }

/* Levels. */
.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 860px) { .levels { grid-template-columns: minmax(0, 1fr); } }
.level { border: 1px solid var(--border); border-radius: var(--radius-l); padding: 22px; background: var(--surface); }
.level header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.level code { font-size: .95rem; }
.level .meter { display: flex; gap: 4px; }
.level .meter i { width: 18px; height: 6px; border-radius: 3px; background: var(--border); }
.level .meter i.on { background: var(--accent); }
.level p { color: var(--text-soft); font-size: .94rem; margin: 0; }

/* Install tabs. */
.install { max-width: 760px; margin: 0 auto; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 10px 14px; font: 600 .93rem var(--font-sans); color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel[hidden] { display: none; }
.tab-panel p { color: var(--text-soft); }

.cta {
  text-align: center; padding: 64px 24px; border-radius: 24px;
  background: var(--hero-glow), var(--surface); border: 1px solid var(--border);
}
.cta h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); letter-spacing: -0.03em; }
.cta p { color: var(--text-soft); max-width: 560px; margin: 0 auto 26px; }
.cta .hero-actions { justify-content: center; }

/* ---------- Docs ---------- */

.doc-layout {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px;
  padding-top: 40px; padding-bottom: 96px;
}
@media (max-width: 960px) { .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; } }
.doc-nav { position: sticky; top: calc(var(--header-h) + 28px); align-self: start; max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; font-size: .93rem; }
.doc-nav h4 { font: 600 .74rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 22px 0 8px; }
.doc-nav h4:first-child { margin-top: 0; }
.doc-nav ul { list-style: none; margin: 0; padding: 0; }
.doc-nav a { display: block; padding: 6px 10px; border-radius: var(--radius-s); color: var(--text-soft); text-decoration: none; border-left: 2px solid transparent; }
.doc-nav a:hover { color: var(--text); background: var(--bg-soft); }
.doc-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
@media (max-width: 960px) {
  .doc-nav { position: static; max-height: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 14px; }
  .doc-nav details > summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
}
@media (min-width: 961px) { .doc-nav details > summary { display: none; } }

.prose { max-width: var(--doc-max); min-width: 0; }
.prose > h1 { margin-bottom: .3em; }
.prose .doc-lede { font-size: 1.15rem; color: var(--text-soft); margin-bottom: 2em; }
.prose h2 { margin-top: 2.2em; padding-top: .2em; font-size: 1.5rem; }
.prose h3 { margin-top: 1.8em; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--text-soft); }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--muted); }
.prose blockquote {
  margin: 1.5em 0; padding: 14px 18px; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 var(--radius) var(--radius) 0; color: var(--text-soft);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .92rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { font-weight: 650; color: var(--text); border-bottom-color: var(--border-strong); white-space: nowrap; }
.prose td { color: var(--text-soft); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }
.prose img { border-radius: var(--radius); border: 1px solid var(--border); }
.prose h2 .anchor, .prose h3 .anchor { opacity: 0; margin-left: 8px; color: var(--muted); text-decoration: none; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }

/* Code blocks. */
.prose div.highlighter-rouge, .prose figure.highlight { position: relative; margin: 1.4em 0; }
.prose pre {
  background: var(--term-bg); color: var(--term-text);
  border: 1px solid var(--term-border); border-radius: var(--radius);
  padding: 16px 18px; overflow-x: auto; font-size: 13.5px; line-height: 1.65; margin: 0;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; white-space: pre; }
.code-copy {
  position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity .15s;
}
.prose div.highlighter-rouge:hover .code-copy, .code-copy:focus { opacity: 1; }

/* Rouge tokens (terminal palette, both themes). */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cp { color: #6a7480; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt, .highlight .kc { color: #ff8f85; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx { color: #a5d6a7; }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .il { color: #f5b84a; }
.highlight .na, .highlight .nt, .highlight .py { color: #8ec7ff; }
.highlight .nb, .highlight .bp, .highlight .nf, .highlight .fm { color: #d2a8ff; }
.highlight .nv, .highlight .vi, .highlight .vg { color: #ffb86b; }
.highlight .o, .highlight .p { color: #a9b4c0; }
.highlight .err { color: inherit; background: none; }
.highlight .gp { color: var(--term-prompt); }

/* Callouts. */
.note {
  border: 1px solid var(--border); background: var(--bg-soft); border-radius: var(--radius);
  padding: 14px 16px; margin: 1.5em 0; font-size: .95rem; color: var(--text-soft);
}
.note strong:first-child { color: var(--text); }

/* Reference tables (checks, rules). */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 1.6em 0 1em; }
.filter-bar input[type="search"] {
  flex: 1 1 260px; min-width: 0; padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: .95rem;
}
.filter-bar select {
  padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: .93rem;
}
.filter-count { color: var(--muted); font-size: .88rem; }
.ref-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ref-item {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface);
}
.ref-item[hidden] { display: none; }
.ref-item header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 4px; }
.ref-item .ref-id { font: 600 .9rem var(--font-mono); color: var(--text); }
.ref-item .ref-name { color: var(--text); font-weight: 600; }
.ref-item p { margin: 0; font-size: .93rem; color: var(--text-soft); }
.ref-item details { margin-top: 8px; font-size: .9rem; }
.ref-item details summary { cursor: pointer; color: var(--muted); }
.ref-item details p { margin-top: 6px; }
.badges { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.badge {
  font: 600 .72rem/1 var(--font-mono); padding: 5px 7px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); background: var(--bg-soft); white-space: nowrap;
}
.badge.sev-critical, .badge.sev-high, .badge.sev-medium, .badge.sev-low, .badge.sev-info { border-color: currentColor; background: transparent; }
:root:not([data-theme="dark"]) .badge.sev-medium { color: #a8700a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.sev-medium { color: var(--sev-medium); } }
.badge.optin { color: var(--accent); border-color: var(--accent); background: transparent; }

/* ---------- Blog ---------- */

.post-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.post-list a {
  display: block; text-decoration: none; border: 1px solid var(--border); border-radius: var(--radius-l);
  padding: 22px 24px; background: var(--surface); color: inherit; transition: border-color .15s, box-shadow .15s;
}
.post-list a:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.post-list h3 { margin: 6px 0; color: var(--text); }
.post-list p { margin: 0; color: var(--text-soft); font-size: .96rem; }
.post-meta { font: 500 .8rem var(--font-mono); color: var(--muted); }
.post-header { margin-bottom: 2em; }
.post-header h1 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -0.03em; }
.archive-note { font-size: .9rem; color: var(--muted); border-top: 1px solid var(--border); margin-top: 3em; padding-top: 1.2em; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--border); padding: 48px 0 40px; background: var(--bg-soft); font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-grid > :first-child { grid-column: 1 / -1; } }
.site-footer h4 { font: 600 .75rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 6px 0 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--text-soft); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer p { color: var(--muted); max-width: 320px; margin-top: 12px; }
.footer-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition: none !important; scroll-behavior: auto !important; }
  .term-body .cursor { animation: none; }
}

.prose td:first-child code { white-space: nowrap; }
.prose .ref-list, .prose .post-list { padding-left: 0; }
.prose .doc-lede p { margin: 0; }

/* Small screens: let long commands scroll inside their box instead of
   widening the page, and tighten the terminal. */
.cmd code { min-width: 0; }
.eyebrow { max-width: 100%; }
@media (max-width: 600px) {
  .hero { padding-top: 48px; }
  .terminal { font-size: 12px; border-radius: var(--radius); }
  .term-body { height: 400px; padding: 14px; }
  .term-replay span { display: none; }
  .section { padding: 64px 0; }
  .cmd { font-size: .82rem; }
}
