:root {
  color-scheme: light;
  --bg: #e7e6e0;
  --surface: #f3f2ed;
  --surface-strong: #faf9f5;
  --ink: #171916;
  --muted: #62655f;
  --line: #c7c8c0;
  --line-strong: #989b93;
  --accent: #e4562f;
  --accent-dark: #a93218;
  --dark: #1c211f;
  --dark-soft: #292f2c;
  --code: #121614;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(25, 29, 26, .08);
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
img, svg { max-width: 100%; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid rgba(228, 86, 47, .45); outline-offset: 3px; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(152, 155, 147, .6);
  background: rgba(231, 230, 224, .92);
  backdrop-filter: blur(18px);
}
.nav-shell { max-width: var(--max); height: 72px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--ink); color: var(--bg); font: 800 18px/1 ui-monospace, monospace; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 3px; }
.nav-links a { padding: 9px 12px; border-radius: 9px; color: #424640; text-decoration: none; font-size: 14px; font-weight: 650; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); background: rgba(255,255,255,.58); }
.nav-links .nav-cta { margin-left: 8px; padding-inline: 15px; color: #fff; background: var(--ink); }
.nav-links .nav-cta:hover { color: #fff; background: var(--accent); }
.nav-toggle { display: none; margin-left: auto; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 8px 11px; }

.container { width: min(calc(100% - 48px), var(--max)); margin: 0 auto; }
.page-main { min-height: 70vh; }
.eyebrow { margin: 0 0 16px; color: var(--accent-dark); font-size: 12px; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; }
.kicker { display: inline-flex; gap: 8px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.35); color: var(--muted); font-size: 12px; font-weight: 700; }
.kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3aa66b; box-shadow: 0 0 0 4px rgba(58,166,107,.13); }
h1, h2, h3 { text-wrap: balance; }
h1 { margin: 20px 0 24px; font-size: clamp(48px, 7.2vw, 96px); line-height: .98; letter-spacing: -.06em; }
h2 { margin: 0 0 16px; font-size: clamp(30px, 4vw, 50px); line-height: 1.08; letter-spacing: -.045em; }
h3 { margin: 0 0 10px; font-size: 20px; line-height: 1.25; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
.lead { max-width: 720px; color: var(--muted); font-size: clamp(18px, 2vw, 23px); line-height: 1.55; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 34px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; padding: 10px 18px; border: 1px solid var(--ink); border-radius: 10px; background: var(--ink); color: #fff; text-decoration: none; font-weight: 750; }
.button:hover { border-color: var(--accent); background: var(--accent); }
.button.secondary { background: transparent; color: var(--ink); }
.button.secondary:hover { color: #fff; }
.text-link { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 4px; font-weight: 750; }

.hero { position: relative; overflow: hidden; padding: 96px 0 78px; border-bottom: 1px solid var(--line); }
.hero::after { content: ""; position: absolute; width: 460px; height: 460px; right: -110px; top: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(228,86,47,.3), rgba(228,86,47,0) 68%); pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); gap: clamp(40px, 8vw, 110px); align-items: center; }
.hero h1 em { color: var(--accent); font-style: normal; }
.system-card { position: relative; padding: 18px; border: 1px solid var(--line-strong); border-radius: 24px; background: rgba(243,242,237,.74); box-shadow: var(--shadow); }
.system-card-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 16px; color: var(--muted); font: 700 12px/1.2 ui-monospace, monospace; }
.dot-row { display: flex; gap: 6px; }
.dot-row i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.rule-flow { display: grid; grid-template-columns: 1fr 34px 1fr; gap: 8px; align-items: center; padding: 20px; border-radius: 16px; background: var(--dark); color: #f5f3eb; }
.flow-node { min-height: 92px; padding: 14px; border: 1px solid #505852; border-radius: 12px; background: var(--dark-soft); }
.flow-node small { display: block; color: #9ba49e; font: 650 10px/1.2 ui-monospace, monospace; text-transform: uppercase; }
.flow-node b { display: block; margin-top: 12px; font-size: 15px; }
.flow-node.orange { border-color: #b54628; background: #5a291d; }
.flow-arrow { color: #99a19c; text-align: center; }
.signal-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin-top: 8px; overflow: hidden; border-radius: 14px; background: #3c423f; }
.signal-strip div { padding: 14px; background: var(--dark); }
.signal-strip span { display: block; color: #98a09b; font: 600 10px/1 ui-monospace, monospace; text-transform: uppercase; }
.signal-strip strong { display: block; margin-top: 8px; color: #f4f2eb; font-size: 14px; }

.section { padding: 86px 0; border-bottom: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: .8fr 1.2fr; gap: 8vw; align-items: end; margin-bottom: 38px; }
.section-head p { max-width: 630px; color: var(--muted); font-size: 18px; }
.card-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.card { min-height: 230px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(243,242,237,.75); }
.card:hover { border-color: var(--line-strong); background: var(--surface-strong); }
.card-index { display: block; margin-bottom: 42px; color: var(--accent-dark); font: 800 12px/1 ui-monospace, monospace; }
.card p { color: var(--muted); }
.card-link { display: inline-block; margin-top: 8px; font-weight: 750; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.dark-section { background: var(--dark); color: #f3f1ea; }
.dark-section .eyebrow { color: #ff7a55; }
.dark-section .section-head p, .dark-section .muted { color: #aeb5b0; }
.repo-list { border-top: 1px solid #48504b; }
.repo-link { display: grid; grid-template-columns: 160px 1fr auto; gap: 24px; align-items: center; padding: 24px 0; border-bottom: 1px solid #48504b; color: inherit; text-decoration: none; }
.repo-link small { color: #9aa39d; font-family: ui-monospace, monospace; }
.repo-link strong { font-size: 20px; }
.repo-link:hover strong { color: #ff7a55; }

.page-hero { padding: 68px 0 52px; border-bottom: 1px solid var(--line); }
.page-hero h1 { max-width: 900px; font-size: clamp(44px, 6vw, 78px); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13px; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs span::before { content: "/"; margin-right: 8px; color: var(--line-strong); }
.content-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 64px; padding: 56px 0 100px; align-items: start; }
.doc-nav { position: sticky; top: 96px; }
.doc-nav strong { display: block; margin-bottom: 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; }
.doc-nav a { display: block; padding: 8px 10px; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; font-size: 14px; }
.doc-nav a:hover, .doc-nav a[aria-current="page"] { border-color: var(--accent); color: var(--ink); background: rgba(255,255,255,.35); }
.doc-content { max-width: 860px; }
.doc-content > section { margin-bottom: 54px; scroll-margin-top: 96px; }
.doc-content h2 { font-size: clamp(28px, 4vw, 42px); }
.doc-content h3 { margin-top: 30px; }
.doc-content p, .doc-content li { color: #484d47; }
.doc-content ul, .doc-content ol { padding-left: 24px; }
.doc-content li { margin: 8px 0; }
.chapter-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
.chapter { padding: 24px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); text-decoration: none; }
.chapter small { color: var(--accent-dark); font: 800 11px/1 ui-monospace, monospace; }
.chapter strong { display: block; margin: 18px 0 7px; font-size: 19px; }
.chapter span { color: var(--muted); font-size: 14px; }
.chapter:hover { border-color: var(--accent); transform: translateY(-2px); }
.callout { margin: 26px 0; padding: 20px 22px; border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0; background: rgba(255,255,255,.46); }
.callout strong { display: block; margin-bottom: 5px; }
.code-block { position: relative; margin: 22px 0; overflow: auto; border: 1px solid #3b433e; border-radius: 14px; background: var(--code); color: #e9eee9; }
.code-label { padding: 10px 16px; border-bottom: 1px solid #343a36; color: #99a39d; font: 700 11px/1.2 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .08em; }
pre { margin: 0; padding: 20px; overflow: auto; font: 13px/1.7 "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
p code, li code, td code { padding: 2px 5px; border-radius: 5px; background: rgba(23,25,22,.08); color: #8f2f19; font-size: .9em; }
.table-wrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; background: rgba(255,255,255,.25); font-size: 14px; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: rgba(255,255,255,.5); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.search-input { flex: 1 1 280px; min-height: 44px; padding: 9px 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-strong); color: var(--ink); }
.filter-button { min-height: 44px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 750; }
.filter-button[aria-pressed="true"], .filter-button:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.plugin-list { display: grid; gap: 12px; }
.plugin-card { display: grid; grid-template-columns: 210px 1fr; gap: 24px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.plugin-card[hidden] { display: none; }
.plugin-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.plugin-id { font: 750 14px/1.3 ui-monospace, monospace; overflow-wrap: anywhere; }
.badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: #d8d9d2; color: #454943; font: 800 10px/1 ui-monospace, monospace; text-transform: uppercase; }
.badge.connector { background: #d6e5dc; color: #22593b; }
.badge.source { background: #d8e2ea; color: #254e67; }
.badge.processor { background: #eadfce; color: #6b4320; }
.badge.sink { background: #ead8d4; color: #742f23; }
.plugin-card p { margin-bottom: 12px; color: var(--muted); }
.io-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.io-box { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.34); font-size: 13px; }
.io-box b { display: block; margin-bottom: 4px; color: var(--ink); }
.empty-state { display: none; padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 14px; }
.empty-state.visible { display: block; }

.site-footer { background: #151917; color: #d9ddd9; }
.footer-main { display: grid; grid-template-columns: 1fr 1.4fr; gap: 70px; padding: 58px 0 44px; }
.footer-brand p { max-width: 370px; color: #929b95; }
.footer-links { display: grid; grid-template-columns: repeat(3,1fr); gap: 30px; }
.footer-links strong { display: block; margin-bottom: 12px; color: #f3f2ed; font-size: 13px; }
.footer-links a { display: block; margin: 7px 0; color: #9fa7a1; text-decoration: none; font-size: 14px; }
.footer-links a:hover { color: #fff; }
.compliance { border-top: 1px solid #353b37; }
.compliance .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-top: 19px; padding-bottom: 20px; color: #8f9791; font-size: 12px; }
.compliance a { color: #c6cbc7; text-decoration: none; }
.compliance a:hover { color: #fff; text-decoration: underline; }

@media (max-width: 920px) {
  .hero-grid, .section-head, .footer-main { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .content-layout { grid-template-columns: 1fr; gap: 30px; }
  .doc-nav { position: static; display: grid; grid-template-columns: repeat(2, 1fr); }
  .doc-nav strong { grid-column: 1 / -1; }
  .repo-link { grid-template-columns: 130px 1fr auto; }
}

@media (max-width: 760px) {
  .nav-shell { height: 64px; padding-inline: 18px; }
  .nav-toggle { display: inline-flex; }
  .nav-links { display: none; position: absolute; left: 14px; right: 14px; top: 70px; padding: 10px; flex-direction: column; align-items: stretch; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-strong); box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-links .nav-cta { margin: 4px 0 0; text-align: center; }
  .container { width: min(calc(100% - 34px), var(--max)); }
  .hero { padding: 68px 0 54px; }
  .hero-grid { gap: 42px; }
  h1 { font-size: clamp(44px, 15vw, 66px); }
  .section { padding: 64px 0; }
  .card-grid, .chapter-grid, .footer-links { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .card-index { margin-bottom: 26px; }
  .repo-link { grid-template-columns: 1fr auto; gap: 5px 12px; }
  .repo-link small { grid-column: 1 / -1; }
  .page-hero { padding: 52px 0 40px; }
  .page-hero h1 { font-size: 43px; }
  .content-layout { padding-top: 34px; }
  .doc-nav { display: block; }
  .plugin-card { grid-template-columns: 1fr; }
  .plugin-meta { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .io-grid { grid-template-columns: 1fr; }
  .footer-main { gap: 38px; }
  .compliance .container { display: block; }
  .compliance span { display: block; margin-bottom: 7px; }
}

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