:root {
  --bg: #0d0c0b;
  --bg-alt: #121110;
  --surface: #171513;
  --surface-2: #1e1b18;
  --border: #2b2723;
  --text: #ece8e3;
  --muted: #a09890;
  --accent: #ff7a2f;
  --accent-ink: #1a0f08;
  --accent-soft: rgba(255, 122, 47, 0.12);
  --code-bg: #131110;
  --code-text: #e6e0d9;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --t-comment: #7a7168; --t-string: #a8d08d; --t-keyword: #ff8f5a; --t-type: #f0c674;
  --t-fn: #7fb7e6; --t-macro: #d6a0e6; --t-number: #e8a87c; --t-attr: #9aa5b1;
  --t-literal: #e8a87c; --t-lifetime: #d6a0e6; --t-flag: #e0b46b;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #fcfbf9; --bg-alt: #f6f3ef; --surface: #ffffff; --surface-2: #f1ede8; --border: #e6e0d8;
    --text: #1d1a17; --muted: #6a625a; --accent: #d9480f; --accent-ink: #ffffff; --accent-soft: rgba(217, 72, 15, 0.09);
    --code-bg: #f5f2ed; --code-text: #2b2723; --shadow: 0 20px 40px -24px rgba(60, 40, 20, 0.35);
    --t-comment: #8a8178; --t-string: #3f7d2a; --t-keyword: #c2410c; --t-type: #8a5a00;
    --t-fn: #1d5fa8; --t-macro: #8e3fa6; --t-number: #b45309; --t-attr: #5f6b78;
    --t-literal: #b45309; --t-lifetime: #8e3fa6; --t-flag: #8a5a00;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #fcfbf9; --bg-alt: #f6f3ef; --surface: #ffffff; --surface-2: #f1ede8; --border: #e6e0d8;
  --text: #1d1a17; --muted: #6a625a; --accent: #d9480f; --accent-ink: #ffffff; --accent-soft: rgba(217, 72, 15, 0.09);
  --code-bg: #f5f2ed; --code-text: #2b2723; --shadow: 0 20px 40px -24px rgba(60, 40, 20, 0.35);
  --t-comment: #8a8178; --t-string: #3f7d2a; --t-keyword: #c2410c; --t-type: #8a5a00;
  --t-fn: #1d5fa8; --t-macro: #8e3fa6; --t-number: #b45309; --t-attr: #5f6b78;
  --t-literal: #b45309; --t-lifetime: #8e3fa6; --t-flag: #8a5a00;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img, svg { max-width: 100%; }
code, pre { font-family: var(--mono); }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--border); }
.bar { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -0.03em; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a, .theme { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 15px; font-weight: 500; transition: color .15s, background .15s; }
.nav a:hover, .theme:hover { color: var(--text); background: var(--surface-2); }
.icon-link { display: inline-flex; padding: 8px !important; }
.theme { background: none; border: 0; cursor: pointer; display: inline-flex; padding: 8px; font: inherit; }
.i-moon { display: none; }
:root[data-theme="light"] .i-sun { display: none; }
:root[data-theme="light"] .i-moon { display: inline-flex; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .i-sun { display: none; }
  :root:not([data-theme="dark"]) .i-moon { display: inline-flex; }
}

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; font-weight: 600; font-size: 15px; transition: transform .15s, border-color .15s, background .15s; }
.btn:hover { border-color: var(--muted); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px -10px var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.cta.center { justify-content: center; }

/* hero */
.hero { position: relative; padding: 84px 0 64px; overflow: clip; }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto auto; width: 70%; height: 90%; background: radial-gradient(closest-side, var(--accent-soft), transparent 70%); pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 20px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero h1 { font-size: clamp(38px, 5.4vw, 64px); font-weight: 800; letter-spacing: -0.045em; }
.hero h1 em { font-style: normal; background: linear-gradient(100deg, #ffb347, #ff5a1f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: 19px; color: var(--muted); max-width: 52ch; margin: 22px 0 28px; }
.install { display: inline-flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 8px 8px 18px; max-width: 100%; }
.install code { font-size: 15px; white-space: nowrap; overflow-x: auto; }
.prompt { color: var(--accent); margin-right: 8px; user-select: none; }
.hero-demo { display: grid; gap: 14px; min-width: 0; }

/* code */
.code { margin: 0; background: var(--code-bg); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; min-width: 0; }
.code figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--border); font: 600 12px/1 var(--mono); color: var(--muted); letter-spacing: .02em; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: 13.5px; line-height: 1.65; color: var(--code-text); tab-size: 4; }
.code code { font: inherit; }
.window { box-shadow: var(--shadow); }
.dots { display: inline-flex; gap: 6px; margin-right: auto; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.window figcaption span:nth-child(2) { position: absolute; left: 50%; transform: translateX(-50%); }
.window figcaption { position: relative; }
.term pre { color: var(--muted); }
.copy { font: 600 12px/1 var(--sans); color: var(--muted); background: transparent; border: 1px solid var(--border); border-radius: 7px; padding: 6px 10px; cursor: pointer; transition: color .15s, border-color .15s; }
.copy:hover { color: var(--text); border-color: var(--muted); }
.copy.ok { color: var(--accent); border-color: var(--accent); }
.t-comment { color: var(--t-comment); font-style: italic; } .t-string { color: var(--t-string); } .t-keyword { color: var(--t-keyword); }
.t-type { color: var(--t-type); } .t-fn { color: var(--t-fn); } .t-macro { color: var(--t-macro); } .t-number { color: var(--t-number); }
.t-attr { color: var(--t-attr); } .t-literal { color: var(--t-literal); } .t-lifetime { color: var(--t-lifetime); } .t-flag { color: var(--t-flag); }

/* stats */
.stats { border-block: 1px solid var(--border); background: var(--bg-alt); padding: 36px 0 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stats-grid div { display: grid; gap: 4px; }
.stats-grid strong { font-size: clamp(28px, 4vw, 42px); letter-spacing: -0.04em; line-height: 1; }
.stats-grid span { color: var(--muted); font-size: 14px; }
.stats-note { color: var(--muted); font-size: 13px; margin-top: 22px; margin-bottom: 0; }
.stats-note a, .fine a { color: var(--text); }

/* sections */
.section { padding: 96px 0; }
.section.alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-title { font-size: clamp(28px, 3.6vw, 42px); font-weight: 800; letter-spacing: -0.04em; }
.section-lede { color: var(--muted); font-size: 18px; max-width: 60ch; margin: 14px 0 0; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 48px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 26px; }
.feature svg { color: var(--accent); margin-bottom: 14px; }
.feature h3 { font-size: 19px; margin-bottom: 8px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }
.feature code, .prose :not(pre) > code, .recipe-card code { font-size: .88em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }

.taste { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; }
.ticks { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 28px; color: var(--muted); }
.ticks li::before { content: ""; position: absolute; left: 0; top: .55em; width: 14px; height: 8px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg) translateY(-30%); }
.tablist { display: flex; gap: 4px; margin-bottom: 12px; overflow-x: auto; }
.tablist button { font: 600 14px var(--sans); color: var(--muted); background: none; border: 1px solid transparent; padding: 8px 14px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.tablist button[aria-selected="true"] { color: var(--text); background: var(--surface); border-color: var(--border); }
.tablist button:hover { color: var(--text); }
.more { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; }
.more:hover { text-decoration: underline; }

/* cookbook finder */
.finder { margin-top: 36px; display: grid; gap: 16px; }
.search { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; color: var(--muted); max-width: 560px; }
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: 16px var(--sans); padding: 14px 0; }
.search kbd { font: 12px var(--mono); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 600 14px var(--sans); color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; cursor: pointer; transition: color .15s, border-color .15s; }
.chip span { opacity: .6; margin-left: 4px; font-weight: 500; }
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.recipe-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.recipe-card { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.recipe-card[hidden] { display: none; }
.recipe-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.recipe-group { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.recipe-card h3 { font-size: 20px; }
.recipe-card p { margin: 0; color: var(--muted); font-size: 14.5px; flex: 1; }
.recipe-go { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; margin-top: 6px; }
.recipe-card:hover .recipe-go svg { transform: translateX(3px); }
.recipe-go svg { transition: transform .15s; }
.empty { color: var(--muted); margin-top: 28px; }

/* table */
.table-wrap { overflow-x: auto; margin: 22px 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); }
.prose td, .prose th { white-space: normal; }
tr.us td { font-weight: 700; background: var(--accent-soft); }
.bench { margin-top: 40px; }
.fine { color: var(--muted); font-size: 14px; }

/* final */
.final { text-align: center; }
.final h2 { font-size: clamp(28px, 3.6vw, 42px); font-weight: 800; letter-spacing: -0.04em; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 40px auto 0; max-width: 900px; text-align: left; }
.step { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.step > span { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.step div { display: grid; gap: 6px; min-width: 0; }
.step code { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

/* footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 56px 0 40px; }
.foot { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.foot p { color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.foot h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
.foot a:not(.brand) { display: block; text-decoration: none; color: var(--text); font-size: 15px; padding: 4px 0; }
.foot a:not(.brand):hover { color: var(--accent); }

/* recipe pages */
.doc { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; padding-top: 40px; padding-bottom: 80px; }
.side { position: sticky; top: 86px; align-self: start; max-height: calc(100vh - 104px); overflow-y: auto; padding-right: 8px; font-size: 14.5px; }
.side summary { cursor: pointer; font-weight: 700; margin-bottom: 14px; display: none; }
.side-group { margin-bottom: 22px; }
.side-group h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 6px; }
.side-group a { display: block; text-decoration: none; color: var(--muted); padding: 5px 10px; margin-left: -10px; border-radius: 8px; }
.side-group a:hover { color: var(--text); background: var(--surface-2); }
.side-group a[aria-current] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.prose { min-width: 0; max-width: 760px; }
.crumbs { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.crumbs a { text-decoration: none; color: var(--accent); font-weight: 600; }
.crumbs span { margin: 0 6px; opacity: .5; }
.prose h1 { font-size: clamp(32px, 4.4vw, 46px); font-weight: 800; letter-spacing: -0.045em; }
.summary { font-size: 19px; color: var(--muted); margin: 14px 0 30px; }
.prose h2 { font-size: 26px; margin: 44px 0 14px; letter-spacing: -0.03em; }
.prose h3 { font-size: 20px; margin: 32px 0 10px; }
.anchor { margin-left: 8px; opacity: 0; text-decoration: none; color: var(--muted); font-weight: 400; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
.prose p { margin: 0 0 16px; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 18px; }
.prose li { margin: 6px 0; padding-left: 4px; }
.prose li::marker { color: var(--muted); }
.prose .code { margin: 20px 0; }
.callout { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 20px 0; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--border); }
.pager a { display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); text-decoration: none; color: var(--text); font-weight: 600; transition: border-color .15s; }
.pager a:hover { border-color: var(--accent); }
.pager a span { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.pager .next { text-align: right; grid-column: 2; }

.nf { padding: 120px 0; }
.nf h1 { font-size: clamp(40px, 6vw, 72px); font-weight: 800; }

@media (max-width: 1000px) {
  .hero-grid, .taste { grid-template-columns: 1fr; gap: 40px; }
  .features, .recipe-grid { grid-template-columns: repeat(2, 1fr); }
  .foot { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .doc { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; }
  .side { position: static; max-height: none; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--surface); }
  .side summary { display: block; margin: 0; }
  .side-details[open] summary { margin-bottom: 14px; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .hero { padding-top: 48px; }
  .nav a:not(.icon-link) { display: none; }
  .nav a[href="/#cookbook"] { display: inline-flex; }
  .features, .recipe-grid, .steps { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 64px 0; }
  .window figcaption span:nth-child(2) { display: none; }
  .install code { font-size: 13px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
