/* AiOverload site — light bento system, matching the project dashboard.
   Tokens inherited from web/style.css in the engine repo:
   bg #f4f5f7, cards #fff, ink #0f172a, accent orange-700 #c2410c. */

:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --accent: #c2410c;
  --accent-strong: #9a3412;
  --accent-tint: #fff4ed;
  --accent-bar: #ea580c;
  --border: #e2e8f0;
  --code-bg: #0f172a;
  --code-fg: #e2e8f0;
  --ok: #15803d;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --header-h: 64px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- accessibility ---------- */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 245, 247, .9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}

.brand-name { font-family: var(--font-mono); font-size: 17px; letter-spacing: -.02em; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}

.site-nav a:hover {
  background: var(--accent-tint);
  color: var(--accent-strong);
}

.site-nav .nav-cta {
  margin-left: 8px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13.5px;
}
.site-nav .nav-cta:hover { background: var(--accent-strong); color: #fff; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

/* ---------- hero ---------- */

.hero {
  padding: 88px 0 64px;
  background:
    radial-gradient(600px 320px at 85% -10%, var(--accent-tint), transparent 70%),
    var(--bg);
}

.hero .container { max-width: 880px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 16px;
}

.hero h1 {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  line-height: 1.15;
  letter-spacing: -.03em;
  margin: 0 0 24px;
  text-wrap: balance;
}

.hero p {
  font-size: clamp(1.02rem, 1.6vw, 1.15rem);
  color: var(--ink-soft);
  max-width: 46em;
  margin: 0 0 16px;
}

.hero p strong { color: var(--ink); }

/* markdown-rendered links in body copy */
.section-body a, .hero-body a, .column a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.section-body a:hover, .hero-body a:hover, .column a:hover { color: var(--accent); }

/* CTA links written as consecutive markdown links */
.hero-body > p:last-of-type a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  margin: 20px 12px 0 0;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, transform .15s ease;
}
.hero-body > p:last-of-type a:first-child {
  background: var(--accent);
  color: #fff;
}
.hero-body > p:last-of-type a:first-child:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}
.hero-body > p:last-of-type a:not(:first-child) {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border);
}
.hero-body > p:last-of-type a:not(:first-child):hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* hero terminal follows the hero body */
.hero + .term-wrapper,
.hero .term { margin-top: 8px; }

/* ---------- terminal ---------- */

.term {
  max-width: 880px;
  margin: 40px auto 0;
  background: var(--code-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: #1e293b;
}

.term-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #475569;
}
.term-dot:first-child { background: #f87171; }
.term-dot:nth-child(2) { background: #fbbf24; }
.term-dot:nth-child(3) { background: #34d399; }

.term-title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.term-body {
  margin: 0;
  padding: 20px 22px 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--code-fg);
  tab-size: 2;
}

.term-body code { font-family: inherit; }

/* ---------- sections ---------- */

.section { padding: 88px 0; }

.section + .section { border-top: 1px solid var(--border); }

.section-title {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -.02em;
  line-height: 1.25;
  margin: 0 0 32px;
  max-width: 22em;
  text-wrap: balance;
}

.section-body > p {
  max-width: 46em;
  color: var(--ink-soft);
  margin: 0 0 16px;
}
.section-body > p strong { color: var(--ink); }

/* ---------- tables ---------- */

.section-body table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 32px 0;
  font-size: 15px;
  display: block;
  overflow-x: auto;
}

.section-body thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.section-body tbody td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--ink-soft);
}
.section-body tbody tr:last-child td { border-bottom: 0; }
.section-body tbody td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; }
.section-body tbody td code { font-size: 13.5px; }

/* ---------- feature grid (bento) ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 40px 0 8px;
  counter-reset: feature;
}

.feature {
  counter-increment: feature;
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px 22px;
  box-shadow: var(--shadow);
  transition: border-color .2s ease, transform .2s ease;
}

.feature:hover {
  border-color: #fdba74;
  transform: translateY(-2px);
}

.feature-index {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
}
.feature-index::before { content: counter(feature, decimal-leading-zero); }

.feature-title {
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 10px 0 8px;
}

.feature-body { font-size: 14.5px; color: var(--ink-soft); }
.feature-body p { margin: 0; }
.feature-body code { font-size: 13px; background: var(--bg); padding: 1px 5px; border-radius: 4px; }

/* honesty section: cards speak softer */
.honesty .feature { background: var(--accent-tint); border-color: #fed7bb; }
.honesty .feature:hover { border-color: var(--accent-bar); }

/* ---------- workflows ---------- */

.workflows {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 32px 0;
}

.workflow {
  background: var(--code-bg);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.workflow-name {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 600;
  color: #fdba74;
}

.workflow-prompt { color: #34d399; margin-right: 6px; }

.workflow-desc {
  margin: 0;
  font-size: 14px;
  color: #cbd5e1;
}

/* ---------- blockquote ---------- */

.section-body blockquote {
  margin: 40px 0 0;
  padding: 20px 24px;
  background: var(--card);
  border-left: 4px solid var(--accent-bar);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow);
  font-size: 16.5px;
  font-weight: 500;
  color: var(--ink);
}
.section-body blockquote p { margin: 0; color: inherit; }

/* ---------- columns (roadmap / licensing) ---------- */

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 40px;
}

.column {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.column h3 {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 15.5px;
  letter-spacing: -.01em;
}

.column p { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* ---------- visual flow (why now) ---------- */

.flow { margin: 40px 0 16px; }

.flow-steps {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 26px;
  counter-reset: flowstep;
}

.flow-step {
  counter-increment: flowstep;
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  box-shadow: var(--shadow);
}

.flow-step::before {
  content: counter(flowstep, decimal-leading-zero);
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}

.flow-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -25px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--accent);
}

.flow-step h3 {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: -.01em;
}

.flow-step p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.flow-step.flow-gate { background: var(--ink); border-color: var(--ink); }
.flow-step.flow-gate h3 { color: #fdba74; }
.flow-step.flow-gate p { color: #cbd5e1; }

.flow-outcomes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
}

.flow-outcome {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 999px;
  white-space: nowrap;
}

.flow-outcome.go { background: #dcfce7; color: #166534; }
.flow-outcome.hold { background: #fef3c7; color: #92400e; }
.flow-outcome.block { background: #fee2e2; color: #991b1b; }

.flow-loop {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--muted);
}

.flow-log {
  background: var(--ink);
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 15px 18px;
  border-radius: var(--radius);
  text-align: center;
}

.flow-log strong { color: #fdba74; }
.flow-log code { font-family: inherit; color: #fdba74; }

/* ---------- section variants ---------- */

.section--tint {
  background: var(--accent-tint);
  border-top: 1px solid #fed7bb;
  border-bottom: 1px solid #fed7bb;
}
.section--tint + .section { border-top: 0; }
.section--tint .eyebrow { color: var(--accent-strong); }
.section--tint .section-body > p { color: var(--ink-soft); }

.section--dark {
  background: var(--ink);
  color: #e2e8f0;
  border-top: 0;
}
.section--dark .eyebrow { color: #fdba74; }
.section--dark .section-title { color: #fff; }
.section--dark .section-body > p { color: #cbd5e1; }
.section--dark .section-body a { color: #fdba74; }
.section--dark .column {
  background: #1e293b;
  border-color: #334155;
}
.section--dark .column h3 { color: #fdba74; }
.section--dark .column p { color: #cbd5e1; }

.columns--trio { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .columns--trio { grid-template-columns: 1fr; } }

.section--dark .decision-panel {
  background: #1e293b;
  border: 1px solid #334155;
  border-left: 3px solid var(--accent-bar);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-top: 16px;
}
.section--dark .decision-panel h3 {
  font-family: var(--font-mono);
  font-size: 15px;
  color: #fdba74;
  margin: 0 0 10px;
}
.section--dark .decision-panel p {
  margin: 0;
  max-width: none;
  color: #cbd5e1;
  font-size: 15px;
}
.section--dark .decision-panel code { font-size: 13.5px; }
.section--dark .decision-panel + p { margin-top: 20px; }

/* ---------- ideas (editorial list, no cards) ---------- */

.ideas {
  counter-reset: idea;
  margin: 40px 0 8px;
}

.idea {
  counter-increment: idea;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 28px;
  padding: 30px 0;
  border-top: 1px solid rgba(154, 52, 18, .18);
}
.idea:last-child { border-bottom: 1px solid rgba(154, 52, 18, .18); }

.idea-index { font-family: var(--font-mono); }
.idea-index::before {
  content: counter(idea, decimal-leading-zero);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--accent);
}

.idea-text h3 {
  margin: 2px 0 10px;
  font-family: var(--font-mono);
  font-size: 17.5px;
  letter-spacing: -.01em;
}

.idea-text p {
  margin: 0;
  max-width: 46em;
  color: var(--ink-soft);
}
.idea-text code { font-size: 13.5px; background: rgba(255,255,255,.7); padding: 1px 5px; border-radius: 4px; }

/* ---------- terminal ---------- */

.term {
  max-width: 880px;
  margin: 40px auto 0;
  background: var(--code-bg);
  border: 1px solid #1e293b;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
  overflow: hidden;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  background: #16202f;
  border-bottom: 1px solid #243349;
}

.term-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #334155;
}
.term-dot:first-child { background: #f87171; }
.term-dot:nth-child(2) { background: #fbbf24; }
.term-dot:nth-child(3) { background: #34d399; }

.term-title {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #7d8ea8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.term-body {
  margin: 0;
  padding: 22px 24px 26px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--code-fg);
  tab-size: 2;
}

.term-body code { font-family: inherit; }

.t-c { color: #64748b; font-style: italic; }
.t-p { color: #34d399; }
.t-h { color: #fbbf24; }
.t-g { color: #4ade80; }
.t-n { color: #60a5fa; }

/* ---------- footer ---------- */

.site-footer {
  background: var(--ink);
  color: #cbd5e1;
  padding: 64px 0 48px;
  margin-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}

.site-footer .brand-name { color: #fff; }

.footer-note {
  font-size: 14px;
  color: #94a3b8;
  max-width: 32em;
  margin: 14px 0 0;
}

.footer-heading {
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  margin: 0 0 14px;
  font-weight: 600;
}

.footer-col a {
  display: block;
  min-height: 32px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14.5px;
  transition: color .2s ease;
}
.footer-col a:hover { color: #fdba74; }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid .footer-col:first-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px 16px;
    box-shadow: var(--shadow);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { min-height: 48px; }
  .site-nav .nav-cta { margin: 8px 0 0; justify-content: center; }

  .hero { padding: 56px 0 48px; }
  .section { padding: 64px 0; }

  .features, .workflows, .columns { grid-template-columns: 1fr; }

  .idea { grid-template-columns: 1fr; gap: 6px; padding: 24px 0; }
  .idea-index::before { font-size: 22px; }

  .flow-steps { grid-template-columns: 1fr; gap: 30px; }
  .flow-step:not(:last-child)::after {
    content: "↓";
    right: auto;
    left: 50%;
    top: auto;
    bottom: -28px;
    transform: translateX(-50%);
  }
  .flow-outcome { white-space: normal; }

  .hero-body > p:last-of-type a { display: flex; margin: 12px 0 0; justify-content: center; }

  .term-body { font-size: 12.5px; padding: 16px; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- multi-page additions ---------- */

/* subpage header */
.page-head {
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--border);
}
.page-head h1 {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.18;
  letter-spacing: -.03em;
  margin: 0 0 20px;
  max-width: 22em;
  text-wrap: balance;
}
.page-head p {
  font-size: clamp(1.02rem, 1.6vw, 1.15rem);
  color: var(--ink-soft);
  max-width: 46em;
  margin: 0;
}

/* active nav state */
.site-nav a[aria-current="page"] {
  background: var(--accent-tint);
  color: var(--accent-strong);
}

/* "read more on the next page" links */
.section-more {
  margin: 28px 0 0;
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 600;
}

/* logo mark: transparent PNG — give it a light tile in the dark footer */
.site-footer .brand-mark {
  background: #f4f5f7;
  border-radius: 6px;
}
.brand-mark { flex: none; }

/* dark CTA band */
.cta-band { text-align: center; }
.cta-band h2 {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  letter-spacing: -.02em;
  color: #fff;
  margin: 0 0 16px;
  text-wrap: balance;
}
.cta-band .section-body > p {
  margin-left: auto;
  margin-right: auto;
  max-width: 40em;
}
.cta-band .section-body > p:last-of-type a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  margin: 20px 12px 0 0;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, transform .15s ease;
}
.cta-band .section-body > p:last-of-type a:first-child {
  background: var(--accent);
  color: #fff;
}
.cta-band .section-body > p:last-of-type a:first-child:hover {
  background: var(--accent-bar);
  transform: translateY(-1px);
}
.cta-band .section-body > p:last-of-type a:not(:first-child) {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
}
.cta-band .section-body > p:last-of-type a:not(:first-child):hover {
  border-color: var(--accent-bar);
  color: #fdba74;
}

@media (max-width: 720px) {
  .page-head { padding: 48px 0 32px; }
  .cta-band .section-body > p:last-of-type a {
    display: flex;
    margin: 12px 0 0;
    justify-content: center;
  }
}

/* goldmark can emit whitespace-only paragraphs between block shortcodes */
main > p:empty { display: none; }

/* 4-up feature grid (no orphan card on the last row) */
.features--quad { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 720px) { .features--quad { grid-template-columns: 1fr; } }

/* ---------- technical diagrams ---------- */

.diagram {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px 14px;
  margin: 32px 0 8px;
  overflow-x: auto;
}
.diagram svg { display: block; width: 100%; height: auto; min-width: 660px; }

.diagram-caption {
  margin: 12px 4px 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}
.diagram-caption strong { color: var(--ink); font-weight: 600; }

/* SVG diagram vocabulary */
.d-box    { fill: #ffffff; stroke: #cbd5e1; stroke-width: 1.5; }
.d-dark   { fill: #0f172a; stroke: #0f172a; }
.d-accent { fill: #fff4ed; stroke: #ea580c; stroke-width: 1.5; }
.d-tint   { fill: #f4f5f7; stroke: #e2e8f0; stroke-width: 1.5; }
.d-title  { font: 600 13px "JetBrains Mono", monospace; fill: #0f172a; }
.d-dark .d-title, text.d-title-light { fill: #f8fafc; }
.d-sub    { font: 500 11px "JetBrains Mono", monospace; fill: #64748b; }
.d-dark .d-sub { fill: #94a3b8; }
.d-note   { font: 500 11px "JetBrains Mono", monospace; fill: #9a3412; }
.d-arrow  { stroke: #64748b; stroke-width: 1.6; fill: none; }
.d-arrow-accent { stroke: #c2410c; stroke-width: 1.8; fill: none; }
.d-flow   { font: 600 10.5px "JetBrains Mono", monospace; fill: #475569; }

/* ---------- diagram animations ---------- */

/* traveling dots are SMIL (animateMotion); hidden under reduced motion */
@media (prefers-reduced-motion: reduce) {
  .anim-dot { display: none; }
}

/* staggered highlight for the define-flow steps */
@keyframes d-step-pulse {
  0%, 100% { opacity: 1; }
  10%      { opacity: 0.45; }
  22%      { opacity: 1; }
}
.d-step { animation: d-step-pulse 6s infinite; }
@media (prefers-reduced-motion: reduce) {
  .d-step { animation: none; }
}

/* ---------- anime.js touches ---------- */

/* terminal typing: lines become block spans; hidden until JS reveals them
   (JS-only — without JS the server-rendered <br> markup shows as-is) */
.t-line { display: block; }
.t-caret {
  display: inline-block;
  width: 8px;
  height: 15px;
  margin-left: 2px;
  vertical-align: -2px;
  background: #34d399;
  animation: caret-blink 1.1s steps(1) infinite;
}
@keyframes caret-blink {
  0%, 55%  { opacity: 1; }
  56%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .t-caret { animation: none; }
}

/* ---------- worked examples under diagrams ---------- */

.examples {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0 8px;
}
.example {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-bar);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.example-title {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-strong);
}
.example-body { font-size: 13.5px; color: var(--ink-soft); }
.example-body p { margin: 0 0 6px; }
.example-body p:last-child { margin: 0; }
.example-body code { font-size: 12.5px; background: var(--bg); padding: 1px 5px; border-radius: 4px; }
@media (max-width: 960px) { .examples { grid-template-columns: 1fr; } }

/* ---------- diagrams on smartphones ---------- */

/* below 720px the SVG schematic is unreadable — swap it for a stacked,
   native step list (works without JS) */
.diagram-mobile { display: none; }

@media (max-width: 720px) {
  .diagram { overflow: visible; padding: 20px 18px 12px; }
  .diagram svg { display: none; }
  .diagram-mobile {
    display: block;
    margin: 4px 2px 6px;
    padding: 0;
    list-style: none;
    counter-reset: dmstep;
  }
  .diagram-mobile li {
    counter-increment: dmstep;
    position: relative;
    padding: 9px 0 9px 40px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-soft);
    border-left: 2px solid var(--border);
    margin-left: 13px;
  }
  .diagram-mobile li:last-child { border-left-color: transparent; }
  .diagram-mobile li::before {
    content: counter(dmstep, decimal-leading-zero);
    position: absolute;
    left: -14px;
    top: 8px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-strong);
  }
  .diagram-mobile strong { color: var(--ink); font-weight: 600; }
  .diagram-mobile code { font-size: 12.5px; background: var(--bg); padding: 1px 4px; border-radius: 4px; }
}

/* ---------- prose lists + dark-section legibility ---------- */

.section-body ul {
  margin: 16px 0;
  padding-left: 22px;
}
.section-body li { margin: 8px 0; }

.section--dark .section-body li { color: #cbd5e1; }
.section--dark .section-body ul li::marker { color: #fdba74; }
.section--dark .section-body strong { color: #ffffff; }
.section--dark .section-body code { color: #fdba74; }

/* wide variant inside quad grids (full-width closing card) */
.features--quad .feature--wide { grid-column: 1 / -1; }

.page-head p a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.page-head p a:hover { color: var(--accent); }

/* ---------- analytics consent banner ---------- */

.consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, .12);
}

.consent-text { margin: 0; font-size: 13.5px; color: var(--ink-soft); }
.consent-text a { color: var(--accent-strong); }

.consent-actions { display: flex; gap: 8px; flex-shrink: 0; }

.consent-btn {
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  background: var(--ink);
  color: #fff;
}
.consent-btn:hover { background: var(--accent-strong); }

.consent-btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid #cbd5e1;
}
.consent-btn--ghost:hover { background: var(--accent-tint); color: var(--accent-strong); }

@media (max-width: 560px) {
  .consent { flex-direction: column; align-items: stretch; }
  .consent-actions { justify-content: stretch; }
  .consent-btn { flex: 1; }
}

/* ---------- operator console mock (static preview) ---------- */

.cmock {
  margin: 28px 0 8px;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .25);
  font-family: var(--font-mono);
}

.cmock-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: #1e293b;
  border-bottom: 1px solid #0f172a;
}

.cmock-title { margin-left: 8px; font-size: 12.5px; color: #cbd5e1; }

.cmock-body { display: flex; min-height: 240px; }

.cmock-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 170px;
  flex-shrink: 0;
  padding: 14px 10px;
  background: #162033;
  border-right: 1px solid #1e293b;
  font-size: 12.5px;
  color: #94a3b8;
}

.cmock-nav span { padding: 6px 10px; border-radius: 6px; }
.cmock-nav .is-active { background: #24334d; color: #f8fafc; }
.cmock-nav em {
  font-style: normal;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 8px;
  background: #c2410c;
  color: #fff;
  font-size: 11px;
}

.cmock-main { flex: 1; padding: 16px 18px; min-width: 0; }

.cmock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  color: #e2e8f0;
}

.cmock-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #64748b;
  padding: 6px 10px 10px;
  border-bottom: 1px solid #24334d;
  font-weight: 500;
}

.cmock-table td {
  padding: 10px;
  border-bottom: 1px solid #1c2940;
  vertical-align: middle;
}

.cmock-table tr.is-selected td { background: #1b2942; }

.cmock-table code { color: #fdba74; font-size: 12px; }

.cmock-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  background: #3b2f16;
  color: #fbbf24;
  border: 1px solid #6b4d10;
  white-space: nowrap;
}

.cmock-actions { color: #64748b; font-size: 11.5px; white-space: nowrap; }

.cmock-detail {
  margin-top: 14px;
  padding: 12px 14px;
  background: #162033;
  border: 1px solid #24334d;
  border-radius: 8px;
}

.cmock-reason { margin: 0 0 6px; color: #f8fafc; font-size: 12.5px; }
.cmock-note { margin: 0; color: #94a3b8; font-size: 12px; line-height: 1.55; }
.cmock-note code { color: #fdba74; }

@media (max-width: 640px) {
  .cmock-nav { display: none; }
  .cmock-actions { display: none; }
}

/* the console table lives inside .section-body — undo the prose-table skin */
.cmock-main .cmock-table {
  display: table;
  background: transparent;
  border: 0;
  box-shadow: none;
  margin: 0;
  overflow: visible;
  color: #e2e8f0;
}
