/* Sharp Runtime — shared static-site design system */
:root {
  color-scheme: dark;
  --bg: #081019;
  --surface: #0e1925;
  --surface-2: #142333;
  --surface-3: #1a2d40;
  --nav: rgba(8, 16, 25, 0.94);
  --text: #edf6ff;
  --text-2: #adc0d2;
  --muted: #7f97ac;
  --border: #263c50;
  --border-strong: #36546e;
  --accent: #46c2d2;
  --accent-strong: #6ddbe7;
  --accent-soft: rgba(70, 194, 210, 0.12);
  --warm: #f0a959;
  --warm-soft: rgba(240, 169, 89, 0.12);
  --ok: #72d69b;
  --ok-soft: rgba(114, 214, 155, 0.12);
  --warn: #f4c66d;
  --warn-soft: rgba(244, 198, 109, 0.12);
  --danger: #ff8b8b;
  --danger-soft: rgba(255, 139, 139, 0.12);
  --code-bg: #060c12;
  --code-text: #d8ecf7;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
  --radius-sm: 6px;
  --radius: 11px;
  --radius-lg: 18px;
  --max: 1200px;
  --docs-max: 1480px;
  --reading: 820px;
  --nav-h: 68px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f8fbfd;
  --surface: #ffffff;
  --surface-2: #eef5f8;
  --surface-3: #e4eff3;
  --nav: rgba(248, 251, 253, 0.94);
  --text: #152534;
  --text-2: #40586c;
  --muted: #60788b;
  --border: #cedde5;
  --border-strong: #adc5d0;
  --accent: #087f92;
  --accent-strong: #006e80;
  --accent-soft: rgba(8, 127, 146, 0.09);
  --warm: #9b5c0c;
  --warm-soft: rgba(155, 92, 12, 0.09);
  --ok: #197343;
  --ok-soft: rgba(25, 115, 67, 0.09);
  --warn: #765500;
  --warn-soft: rgba(142, 102, 0, 0.1);
  --danger: #b53a3a;
  --danger-soft: rgba(181, 58, 58, 0.09);
  --code-bg: #101b25;
  --code-text: #e6f4fb;
  --shadow: 0 16px 40px rgba(38, 67, 83, 0.12);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f8fbfd; --surface: #fff; --surface-2: #eef5f8; --surface-3: #e4eff3;
    --nav: rgba(248, 251, 253, 0.94); --text: #152534; --text-2: #40586c;
    --muted: #60788b; --border: #cedde5; --border-strong: #adc5d0;
    --accent: #087f92; --accent-strong: #006e80; --accent-soft: rgba(8,127,146,.09);
    --warm: #9b5c0c; --warm-soft: rgba(155,92,12,.09); --ok: #197343;
    --ok-soft: rgba(25,115,67,.09); --warn: #765500; --warn-soft: rgba(142,102,0,.1);
    --danger: #b53a3a; --danger-soft: rgba(181,58,58,.09);
    --code-bg: #101b25; --code-text: #e6f4fb; --shadow: 0 16px 40px rgba(38,67,83,.12);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 24px); }
body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
}
body.menu-open { overflow: hidden; }
a { color: var(--accent-strong); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }
button, input { font: inherit; }
button { color: inherit; }
::selection { background: var(--accent); color: #041014; }
:focus-visible { outline: 3px solid var(--warm); outline-offset: 3px; border-radius: 3px; }

.skip-link {
  position: fixed; z-index: 1000; top: .6rem; left: .6rem; transform: translateY(-180%);
  padding: .55rem .85rem; border-radius: var(--radius-sm); background: var(--warm); color: #111;
  font-weight: 750; text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

.site-nav {
  position: sticky; z-index: 100; top: 0; min-height: var(--nav-h);
  border-bottom: 1px solid var(--border); background: var(--nav);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.nav-inner {
  width: min(calc(100% - 2rem), var(--max)); min-height: var(--nav-h); margin: 0 auto;
  display: flex; align-items: center; gap: 1.35rem;
}
.brand { display: inline-flex; align-items: center; gap: .68rem; color: var(--text); font-weight: 820; text-decoration: none; white-space: nowrap; }
.brand:hover { color: var(--text); text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--accent);
  border-radius: 9px; color: var(--accent-strong); background: var(--accent-soft);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .78rem; font-weight: 850;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.brand-word { letter-spacing: -.025em; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: .15rem; }
.nav-link {
  display: inline-flex; align-items: center; min-height: 40px; padding: .45rem .7rem;
  border-radius: var(--radius-sm); color: var(--text-2); font-size: .91rem; font-weight: 650; text-decoration: none;
}
.nav-link:hover, .nav-link[aria-current="page"] { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link--github { border: 1px solid var(--border); margin-left: .3rem; }
.nav-actions { display: flex; gap: .4rem; align-items: center; }
.icon-button, .nav-toggle, .docs-toggle {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface); cursor: pointer;
}
.icon-button:hover, .nav-toggle:hover, .docs-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }
.theme-toggle svg { width: 19px; height: 19px; fill: currentColor; }
:root .theme-icon-light { display: none; }
:root .theme-icon-dark { display: block; }
:root[data-theme="light"] .theme-icon-light { display: block; }
:root[data-theme="light"] .theme-icon-dark { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-icon-light { display: block; }
  :root:not([data-theme="dark"]) .theme-icon-dark { display: none; }
}
.nav-toggle { display: none; position: relative; }
.nav-toggle span { position: absolute; width: 18px; height: 2px; border-radius: 1px; background: currentColor; transition: transform .18s ease, opacity .18s ease; }
.nav-toggle span:nth-child(1) { transform: translateY(-5px); }
.nav-toggle span:nth-child(3) { transform: translateY(5px); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg); }

main { min-height: 60vh; }
.container { width: min(calc(100% - 2rem), var(--max)); margin-inline: auto; }
.section { padding: clamp(3.25rem, 7vw, 6rem) 0; }
.section--tight { padding: clamp(2.3rem, 5vw, 4rem) 0; }
.section--tint { border-block: 1px solid var(--border); background: var(--surface); }
.eyebrow { color: var(--accent-strong); font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, h4 { color: var(--text); line-height: 1.2; letter-spacing: -.032em; }
h1 { margin: 0 0 1rem; font-size: clamp(2.35rem, 7vw, 5rem); }
h2 { margin: 2.8rem 0 1rem; font-size: clamp(1.65rem, 4vw, 2.45rem); }
h3 { margin: 2rem 0 .6rem; font-size: 1.27rem; }
h4 { margin: 1.4rem 0 .45rem; font-size: 1rem; }
p { margin: 0 0 1.1rem; color: var(--text-2); }
ul, ol { margin: 0 0 1.25rem; padding-left: 1.35rem; color: var(--text-2); }
li + li { margin-top: .35rem; }
strong { color: var(--text); }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto 45%; height: 650px; pointer-events: none;
  background: radial-gradient(circle, rgba(70,194,210,.12), transparent 63%);
}
.hero-grid { position: relative; min-height: 620px; padding: clamp(4rem, 9vw, 7rem) 0; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(330px, .92fr); align-items: center; gap: clamp(2.5rem, 6vw, 5.5rem); }
.hero h1 { max-width: 790px; }
.hero h1 span { color: var(--accent-strong); }
.hero-lead { max-width: 720px; color: var(--text-2); font-size: clamp(1.05rem, 2vw, 1.26rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.8rem 0 1.4rem; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; padding: .68rem 1.05rem; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font-weight: 760; text-decoration: none; }
.button:hover { border-color: var(--accent); color: var(--text); background: var(--accent-soft); text-decoration: none; }
.button--primary { border-color: var(--accent); background: var(--accent); color: #041014; }
.button--primary:hover { background: var(--accent-strong); color: #041014; }
.hero-note { color: var(--muted); font-size: .9rem; }
.terminal { overflow: hidden; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--code-bg); box-shadow: var(--shadow); }
.terminal-bar { display: flex; align-items: center; gap: .4rem; min-height: 42px; padding: 0 .9rem; border-bottom: 1px solid #243746; color: #8fa7b9; font-size: .76rem; }
.terminal-dot { width: 8px; height: 8px; border-radius: 50%; background: #446071; }
.terminal-title { margin-left: .45rem; }
.terminal pre { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.code-comment { color: #7792a5; }
.code-key { color: #69d7e5; }
.code-value { color: #f0bd76; }

.stat-strip { border-bottom: 1px solid var(--border); background: var(--surface); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { min-height: 116px; padding: 1.3rem 1.5rem; border-left: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; }
.stat:last-child { border-right: 1px solid var(--border); }
.stat-value { color: var(--text); font-size: 1.5rem; font-weight: 820; letter-spacing: -.025em; }
.stat-label { color: var(--muted); font-size: .82rem; }

.section-heading { max-width: 760px; margin-bottom: 2rem; }
.section-heading h2 { margin: .35rem 0 .7rem; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.card { min-width: 0; padding: 1.35rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
a.card { display: block; color: inherit; text-decoration: none; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
a.card:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--surface-2); }
.card h3 { margin: 0 0 .5rem; }
.card p { margin: 0; font-size: .94rem; }
.card-kicker { display: block; margin-bottom: .65rem; color: var(--accent-strong); font: 750 .72rem/1.3 ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }
.feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1.7rem; padding: 0; list-style: none; }
.feature-list li { position: relative; padding-left: 1.45rem; }
.feature-list li::before { content: ""; position: absolute; top: .69em; left: 0; width: 7px; height: 7px; border: 2px solid var(--accent); border-radius: 50%; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.status-list { display: grid; gap: .75rem; }
.status-row { display: grid; grid-template-columns: 132px 1fr; gap: 1rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.badge { display: inline-flex; width: fit-content; align-items: center; padding: .16rem .48rem; border: 1px solid currentColor; border-radius: 99px; font-size: .72rem; font-weight: 780; letter-spacing: .02em; }
.badge--verified { color: var(--ok); background: var(--ok-soft); }
.badge--build { color: var(--accent-strong); background: var(--accent-soft); }
.badge--partial { color: var(--warn); background: var(--warn-soft); }
.badge--limited { color: var(--danger); background: var(--danger-soft); }
.badge--kind { color: var(--muted); background: var(--surface-2); }

.docs-shell { width: min(calc(100% - 2rem), var(--max)); margin: 0 auto; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.docs-shell--with-toc { width: min(calc(100% - 2rem), var(--docs-max)); grid-template-columns: 230px minmax(0, var(--reading)) 210px; gap: clamp(1.5rem, 3vw, 3rem); justify-content: center; }
.docs-sidebar { position: sticky; top: calc(var(--nav-h) + 1rem); max-height: calc(100vh - var(--nav-h) - 2rem); overflow: auto; padding: 1.2rem 0 1.5rem; scrollbar-width: thin; }
.docs-sidebar-title { margin: 0 0 .8rem; color: var(--muted); font-size: .71rem; font-weight: 820; letter-spacing: .13em; text-transform: uppercase; }
.docs-nav { display: grid; gap: .15rem; }
.docs-nav-group { margin: 1rem 0 .3rem; color: var(--muted); font-size: .72rem; font-weight: 780; letter-spacing: .08em; text-transform: uppercase; }
.docs-nav a { display: block; padding: .42rem .6rem; border-radius: var(--radius-sm); color: var(--text-2); font-size: .88rem; line-height: 1.35; text-decoration: none; }
.docs-nav a:hover, .docs-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--text); }
.docs-nav a[aria-current="page"] { box-shadow: inset 3px 0 var(--accent); }
.docs-toggle { display: none; width: auto; min-height: 40px; margin-bottom: 1rem; padding: 0 .8rem; }
.docs-content { min-width: 0; max-width: var(--reading); padding: clamp(2.5rem, 6vw, 5rem) 0 6rem; }
.breadcrumbs { margin: 0 0 1.2rem; color: var(--muted); font-size: .82rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span { padding: 0 .42rem; }
.docs-content h1 { font-size: clamp(2.15rem, 5vw, 3.45rem); }
.lead { color: var(--text-2); font-size: 1.13rem; }
.page-meta { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1.35rem 0 2rem; }
.page-meta span { padding: .22rem .55rem; border: 1px solid var(--border); border-radius: 99px; color: var(--muted); font-size: .75rem; }
.docs-content h2 { padding-top: .6rem; border-top: 1px solid var(--border); }
.docs-content h2:first-of-type { border-top: 0; }
.in-page-toc { position: sticky; top: calc(var(--nav-h) + 1.2rem); max-height: calc(100vh - var(--nav-h) - 2.4rem); overflow: auto; padding: 1rem 0; scrollbar-width: thin; }
.in-page-toc-title { margin-bottom: .65rem; color: var(--muted); font-size: .7rem; font-weight: 820; letter-spacing: .12em; text-transform: uppercase; }
.in-page-toc nav { display: grid; gap: .1rem; border-left: 1px solid var(--border); }
.in-page-toc a { display: block; padding: .28rem .6rem; color: var(--muted); font-size: .78rem; line-height: 1.35; overflow-wrap: anywhere; text-decoration: none; }
.in-page-toc a:hover { color: var(--accent-strong); }
.in-page-toc .toc-level-3 { padding-left: 1.15rem; font-size: .74rem; }
.heading-anchor { margin-left: .45rem; color: var(--muted); font-size: .65em; opacity: 0; text-decoration: none; }
h2:hover .heading-anchor, h3:hover .heading-anchor, .heading-anchor:focus { opacity: 1; }
.architecture-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: .75rem; align-items: center; margin: 1.5rem 0 2rem; }
.architecture-flow > div { min-width: 0; min-height: 104px; padding: .9rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; justify-content: center; }
.architecture-flow strong { overflow-wrap: anywhere; }
.architecture-flow span { margin-top: .25rem; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.architecture-flow > b { color: var(--accent-strong); font-size: 1.2rem; }
.architecture-flow--stack { grid-template-columns: 1fr; }
.architecture-flow--stack > div { min-height: 0; text-align: center; }
.code-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.4rem 0 1.8rem; }
.code-compare > div { min-width: 0; }
.code-compare pre { height: calc(100% - 1.8rem); margin: .45rem 0 0; }
.code-compare-title { color: var(--muted); font: 800 .7rem/1.3 ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; }
.api-group { margin: .6rem 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.api-group summary { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem .85rem; cursor: pointer; color: var(--text); }
.api-group summary span { flex: 0 0 auto; color: var(--muted); font-size: .75rem; }
.api-group--support { border-style: dashed; background: color-mix(in srgb, var(--surface) 72%, transparent); }
.api-group--support summary { color: var(--muted); }
.api-header-list { columns: 2; column-gap: 1.5rem; padding: 0 1.1rem 1rem 2.2rem; }
.api-header-list li { break-inside: avoid; overflow-wrap: anywhere; }
.api-header-list code { font-size: .76rem; }
.api-component-table td:first-child, .api-namespace-table td:first-child { min-width: 170px; }
.api-component-table td:last-child { min-width: 320px; }
.api-namespace-table td:last-child { min-width: 280px; }

code { padding: .13em .36em; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); color: var(--accent-strong); font: .88em/1.5 ui-monospace, "SFMono-Regular", Consolas, monospace; overflow-wrap: anywhere; }
pre { position: relative; max-width: 100%; margin: 1.35rem 0 1.7rem; padding: 1.2rem 1.25rem; overflow: auto; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--code-bg); color: var(--code-text); box-shadow: 0 10px 28px rgba(0,0,0,.12); tab-size: 4; }
pre code { padding: 0; border: 0; background: none; color: inherit; font-size: .86rem; line-height: 1.72; overflow-wrap: normal; }
.copy-button { position: absolute; top: .55rem; right: .55rem; padding: .25rem .55rem; border: 1px solid #365063; border-radius: 6px; background: #142433; color: #c4d9e6; font-size: .72rem; cursor: pointer; opacity: .9; }
.copy-button:hover { border-color: #6ddbe7; }
.code-language { display: block; margin: -.45rem 4rem .8rem 0; color: #7590a3; font: 700 .67rem/1.2 ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }
.tok-comment { color: #7590a3; font-style: italic; }
.tok-string { color: #efbd78; }
.tok-number { color: #b7a4ff; }
.tok-keyword { color: #71dbe7; font-weight: 650; }
.tok-preprocessor { color: #ff93b7; }

.callout { margin: 1.35rem 0; padding: 1rem 1.1rem; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); background: var(--accent-soft); }
.callout p:last-child { margin-bottom: 0; }
.callout-title { margin-bottom: .3rem; color: var(--text); font-weight: 800; }
.callout--warning { border-left-color: var(--warn); background: var(--warn-soft); }
.callout--danger { border-left-color: var(--danger); background: var(--danger-soft); }
.callout--success { border-left-color: var(--ok); background: var(--ok-soft); }
.table-wrap { width: 100%; margin: 1.3rem 0 1.8rem; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: .72rem .8rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: var(--surface-2); color: var(--text); font-size: .75rem; letter-spacing: .035em; text-transform: uppercase; }
td { color: var(--text-2); }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.component-table td:first-child { min-width: 190px; font-weight: 720; }
.component-table td:nth-child(4) { min-width: 260px; }
.component-anchor { color: inherit; text-decoration: none; }
.component-anchor:hover { color: var(--accent-strong); }
.dependency-list { display: flex; flex-wrap: wrap; gap: .25rem; }
.dependency-list code { font-size: .75rem; }
dl.reference-list { display: grid; grid-template-columns: minmax(150px, .32fr) 1fr; margin: 1.3rem 0; border-top: 1px solid var(--border); }
dl.reference-list dt, dl.reference-list dd { margin: 0; padding: .8rem .6rem; border-bottom: 1px solid var(--border); }
dl.reference-list dt { color: var(--text); font-weight: 750; }
dl.reference-list dd { color: var(--text-2); }

.page-index { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin: 1.5rem 0; }
.page-index a { display: block; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-weight: 720; text-decoration: none; }
.page-index a:hover { border-color: var(--accent); background: var(--accent-soft); }
.page-index small { display: block; margin-top: .25rem; color: var(--muted); font-weight: 450; }
.next-links { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.next-links a { padding: .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); text-decoration: none; }
.next-links a:last-child { text-align: right; }
.next-label { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; }

.search-hero { max-width: 760px; margin: 0 auto; padding: clamp(3.5rem, 8vw, 6.5rem) 0 2rem; text-align: center; }
.search-form { display: flex; gap: .55rem; margin: 1.5rem auto; }
.search-input { width: 100%; min-height: 50px; padding: .7rem .9rem; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); color: var(--text); }
.search-input:focus { border-color: var(--accent); }
.search-shortcut { display: inline-block; padding: .05rem .38rem; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-2); color: var(--muted); font: .78rem ui-monospace, monospace; }
.search-results { display: grid; gap: .7rem; max-width: 820px; margin: 0 auto 5rem; }
.search-count { margin: 0 0 .4rem; color: var(--muted); }
.search-result { display: block; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: inherit; text-decoration: none; }
.search-result:hover { border-color: var(--accent); background: var(--accent-soft); }
.search-result h2 { margin: 0 0 .25rem; border: 0; font-size: 1.05rem; }
.search-result p { margin: 0; font-size: .9rem; }
.search-result-meta { display: block; margin-top: .35rem; color: var(--muted); font-size: .75rem; }
mark { border-radius: 2px; background: var(--warm-soft); color: var(--warm); }

.page-404 { min-height: 70vh; display: grid; place-items: center; padding: 4rem 1rem; text-align: center; }
.page-404-inner { max-width: 650px; }
.error-code { color: var(--accent-strong); font: 850 clamp(4.5rem, 18vw, 9rem)/.9 ui-monospace, monospace; letter-spacing: -.08em; }
.page-404 h1 { margin: 1rem 0 .7rem; font-size: clamp(2rem, 5vw, 3.4rem); }
.quick-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: 1.6rem; }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-grid { padding: 3rem 0; display: grid; grid-template-columns: 1.7fr repeat(3, 1fr); gap: 2.5rem; }
.footer-brand p { max-width: 380px; font-size: .9rem; }
.footer-title { margin: 0 0 .8rem; color: var(--text); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.footer-links { display: grid; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.footer-links a { color: var(--text-2); font-size: .88rem; text-decoration: none; }
.footer-links a:hover { color: var(--accent-strong); }
.footer-bottom { padding: 1rem 0 1.5rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .79rem; }

@media (max-width: 1300px) {
  .docs-shell--with-toc { width: min(calc(100% - 2rem), var(--max)); grid-template-columns: 250px minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); }
  .in-page-toc { display: none; }
}

@media (max-width: 1040px) {
  .nav-link { padding-inline: .5rem; }
  .hero-grid { grid-template-columns: 1fr; min-height: auto; }
  .hero-copy { max-width: 800px; }
  .terminal { max-width: 760px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 840px) {
  .nav-inner { flex-wrap: wrap; gap: .6rem; padding-block: .55rem; }
  .nav-toggle { display: inline-grid; margin-left: auto; }
  .nav-actions { order: 2; }
  .nav-links { display: none; order: 3; width: 100%; margin: .2rem 0 0; padding: .45rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
  .nav-links.open { display: grid; grid-template-columns: repeat(2, 1fr); }
  .nav-link { width: 100%; }
  .nav-link--github { margin-left: 0; }
  .docs-shell { display: block; }
  .docs-sidebar { position: static; max-height: none; padding: 1.2rem 0 0; }
  .docs-toggle { display: inline-flex; }
  .docs-sidebar-title, .docs-nav { display: none; }
  .docs-sidebar.open .docs-sidebar-title, .docs-sidebar.open .docs-nav { display: grid; }
  .docs-sidebar.open .docs-sidebar-title { display: block; }
  .docs-content { padding-top: 1.5rem; }
  .architecture-flow { grid-template-columns: 1fr; }
  .architecture-flow > b { transform: rotate(90deg); justify-self: center; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 1px solid var(--border); }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .footer-grid { grid-template-columns: 1.5fr repeat(2, 1fr); }
  .footer-grid > :last-child { grid-column: 2; }
}

@media (max-width: 620px) {
  .container, .docs-shell, .nav-inner { width: min(calc(100% - 1.25rem), var(--max)); }
  .nav-links.open { grid-template-columns: 1fr; max-height: calc(100vh - 90px); overflow: auto; }
  .brand-word { font-size: .94rem; }
  .hero-grid { padding-block: 3.5rem; grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: clamp(2.35rem, 14vw, 3.7rem); }
  .hero-actions, .search-form { flex-direction: column; }
  .button { width: 100%; }
  .cards, .page-index, .split, .feature-list, .next-links, .code-compare { grid-template-columns: 1fr; }
  .next-links a:last-child { text-align: left; }
  .status-row { grid-template-columns: 1fr; gap: .45rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem 1rem; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-grid > :last-child { grid-column: auto; }
  th, td { padding: .62rem .65rem; }
  .docs-content h1 { overflow-wrap: anywhere; }
  .api-header-list { columns: 1; }
}

@media (max-width: 380px) {
  .brand-word { display: none; }
  .stats { grid-template-columns: 1fr; }
  .stat, .stat:nth-child(2), .stat:last-child { border: 0; border-bottom: 1px solid var(--border); }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; }
  a.card:hover { transform: none; }
}

@media print {
  .site-nav, .docs-sidebar, .site-footer, .copy-button, .next-links { display: none !important; }
  body { background: #fff; color: #111; }
  .docs-shell { display: block; width: 100%; }
  .docs-content { max-width: none; padding: 0; }
  a { color: #111; text-decoration: underline; }
}
