:root, [data-theme="dark"] {
  --bg: #0A0A0A; --surface: #111111; --surface-2: #161616; --border: #262626; --text: #EDEDED; --muted: #8A8A8A;
  --accent: #FF5A5F; --ok: #3FB950; --redir: #58A6FF; --warn: #E3B341; --hi: rgba(255,255,255,.04);
  --code-key: #9CDCFE; --code-str: #E3B341; --code-num: #3FB950; --code-lit: #FF5A5F;
  --sale-bg: #111111; --sale-fg: #EDEDED; --sale-accent: #FF5A5F;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #FAFAF9; --surface: #FFFFFF; --surface-2: #F5F5F4; --border: #E7E5E4; --text: #1C1917; --muted: #78716C;
  --accent: #E5484D; --ok: #1A7F37; --redir: #0969DA; --warn: #9A6700; --hi: rgba(0,0,0,.02);
  --code-key: #0550AE; --code-str: #9A6700; --code-num: #1A7F37; --code-lit: #CF222E;
  --sale-bg: #FFFFFF; --sale-fg: #1C1917; --sale-accent: #E5484D;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --bg: #FAFAF9; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 "Geist", system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
code, kbd, pre, select, .url input { font-family: "Geist Mono", ui-monospace, monospace; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dim { color: var(--muted); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }

/* Nav */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav-in { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; letter-spacing: -.01em; }
.mark { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 16px; box-shadow: inset 0 1px 0 var(--hi); }
.mark.sm { display: inline-grid; width: 22px; height: 22px; font-size: 12px; border-radius: 6px; vertical-align: -5px; margin-right: 4px; }
.links { display: flex; gap: 22px; font-size: 14px; color: var(--muted); }
.links a { text-decoration: none; }
.links a:hover { color: var(--text); }
@media (max-width: 820px) { .links { display: none; } }
.nav-actions { margin-left: auto; display: flex; gap: 8px; }
.kbd-btn, .icon-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--muted); cursor: pointer; font: 500 13px "Geist", sans-serif; }
.kbd-btn:hover, .icon-btn:hover { color: var(--text); }
kbd { font-size: 11px; padding: 1px 5px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-2); color: var(--muted); }
.icon-btn { width: 34px; justify-content: center; padding: 0; }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
[data-theme="dark"] .icon-btn .moon, [data-theme="light"] .icon-btn .sun { display: none; }
@media (max-width: 420px) { .kbd-btn kbd { display: none; } }

/* Hero */
.hero { padding-top: clamp(40px, 8vw, 96px); padding-bottom: 40px; overflow-x: clip; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); border: 1px solid var(--border); background: var(--surface); padding: 5px 12px; border-radius: 999px; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.hero h1 { font-size: clamp(40px, 7.4vw, 84px); font-weight: 600; line-height: 1.02; letter-spacing: -.04em; margin: 22px 0 10px; }
.hero .hot { background: linear-gradient(90deg, var(--accent), #FF9F6B); -webkit-background-clip: text; background-clip: text; color: transparent; }
.aside { font-size: 15px; color: var(--muted); margin-bottom: 18px; }
.aside .ex { font-family: "Geist Mono", monospace; font-size: 13px; padding: 1px 6px; border: 1px solid var(--border); border-radius: 5px; }
.lede { font-size: clamp(16px, 1.6vw, 18px); color: var(--muted); max-width: 56ch; margin-bottom: 26px; }
.oneliner { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 6px 6px 6px 14px; box-shadow: inset 0 1px 0 var(--hi); }
.oneliner code { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.prompt { color: var(--accent); margin-right: 6px; }
.copy { height: 30px; padding: 0 12px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); color: var(--text); cursor: pointer; font: 500 13px "Geist", sans-serif; flex: none; }
.copy:hover { border-color: var(--muted); }
.copy.small { height: 28px; }

/* Console */
.console { position: relative; margin-top: 48px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: inset 0 1px 0 var(--hi), 0 40px 120px -40px rgba(0,0,0,.6); isolation: isolate; }
.glow { position: absolute; inset: -120px -40px auto; height: 320px; z-index: -1; pointer-events: none; background: radial-gradient(50% 60% at 50% 50%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); filter: blur(10px); }
@media (max-width: 720px) { .glow { opacity: .5; } }
.win-bar { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.win-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.win-bar p { margin-left: auto; font-size: 12px; color: var(--muted); }
.pills { display: flex; gap: 6px; padding: 12px 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.pills::-webkit-scrollbar { display: none; }
.pills button { flex: none; scroll-snap-align: start; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; font: 500 13px "Geist Mono", monospace; }
.pills button[aria-selected="true"] { color: var(--text); background: var(--surface-2); border-color: var(--muted); }
.req { display: flex; gap: 8px; padding: 12px 14px; flex-wrap: wrap; }
.req select { height: 40px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 500; }
.url { flex: 1; min-width: 220px; display: flex; align-items: center; height: 40px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); padding-left: 12px; overflow: hidden; }
.host { color: var(--muted); font: 13px "Geist Mono", monospace; flex: none; }
.url input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); font-size: 13px; padding: 0 10px 0 1px; outline: none; }
.url:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.send { height: 40px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--text); color: var(--bg); font: 600 14px "Geist", sans-serif; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.send kbd { background: transparent; border-color: color-mix(in srgb, var(--bg) 35%, transparent); color: color-mix(in srgb, var(--bg) 70%, transparent); }
@media (max-width: 560px) { .send { flex: 1; justify-content: center; } .send kbd { display: none; } .url { min-width: 100%; order: -1; } }
.body-field { display: block; padding: 0 14px 12px; }
.body-field textarea { width: 100%; resize: vertical; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font: 13px/1.5 "Geist Mono", monospace; padding: 10px 12px; }
.panes { display: grid; border-top: 1px solid var(--border); }
@media (min-width: 900px) { .panes { grid-template-columns: 1.2fr 1fr; } .pane + .pane { border-left: 1px solid var(--border); } }
@media (max-width: 899px) { .pane + .pane { border-top: 1px solid var(--border); } }
.pane { min-width: 0; position: relative; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 44px; padding: 0 10px 0 6px; border-bottom: 1px solid var(--border); }
.tabs { display: flex; gap: 2px; }
.tabs button { height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font: 500 13px "Geist", sans-serif; }
.tabs button[aria-selected="true"] { color: var(--text); background: var(--surface-2); }
.meta { display: flex; align-items: center; gap: 10px; font: 12px "Geist Mono", monospace; color: var(--muted); white-space: nowrap; overflow: hidden; }
.chip { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.chip.s2 { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.chip.s3 { color: var(--redir); border-color: color-mix(in srgb, var(--redir) 40%, transparent); background: color-mix(in srgb, var(--redir) 10%, transparent); }
.chip.s4 { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.chip.s5 { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.code { margin: 0; padding: 14px 16px; height: 340px; overflow: auto; font-size: 12.5px; line-height: 1.65; color: var(--text); white-space: pre; tab-size: 2; }
@media (max-width: 899px) { .code { height: auto; max-height: 320px; min-height: 160px; } }
.code .k { color: var(--code-key); } .code .s { color: var(--code-str); } .code .n { color: var(--code-num); } .code .l { color: var(--code-lit); } .code .c { color: var(--muted); }
.eq { position: absolute; top: 56px; right: 14px; display: none; gap: 3px; align-items: flex-end; height: 16px; }
.eq.on { display: flex; }
.eq i { width: 3px; background: var(--accent); border-radius: 2px; height: 30%; }
@media (prefers-reduced-motion: no-preference) {
  .eq i { animation: eq .8s ease-in-out infinite; }
  .eq i:nth-child(2) { animation-delay: -.2s; } .eq i:nth-child(3) { animation-delay: -.5s; } .eq i:nth-child(4) { animation-delay: -.1s; } .eq i:nth-child(5) { animation-delay: -.35s; }
}
@keyframes eq { 50% { height: 100%; } }

/* Sections */
.section { padding-top: 88px; scroll-margin-top: 60px; }
.section h2 { font-size: clamp(26px, 3.6vw, 36px); font-weight: 600; letter-spacing: -.03em; }
.sub { color: var(--muted); margin: 8px 0 28px; max-width: 64ch; }
.sub code, .card code { font-size: .9em; padding: 1px 5px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 18px; box-shadow: inset 0 1px 0 var(--hi); display: grid; gap: 8px; align-content: start; }
.card h3 { font-size: 15px; font-weight: 600; }
.card p { color: var(--muted); font-size: 14px; }
.ep { cursor: pointer; text-align: left; font: inherit; color: inherit; transition: border-color .15s, transform .15s; }
.ep:hover { border-color: var(--muted); }
.ep .path { font: 500 14px "Geist Mono", monospace; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.verb { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.ep .try { font-size: 13px; color: var(--accent); margin-top: 2px; }

.codes { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.code-btn { display: flex; gap: 12px; align-items: baseline; text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.code-btn:hover { border-color: var(--muted); }
.code-btn b { font: 600 15px "Geist Mono", monospace; flex: none; }
.code-btn.c2 b { color: var(--ok); } .code-btn.c3 b { color: var(--redir); } .code-btn.c4 b { color: var(--warn); } .code-btn.c5 b { color: var(--accent); } .code-btn.c1 b { color: var(--muted); }
.code-btn span { font-size: 14px; }
.code-btn small { display: block; color: var(--muted); font-size: 12px; }

.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 32px; padding-bottom: 40px; margin-top: 96px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }

/* Command palette */
.palette { width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 40px 100px rgba(0,0,0,.5); margin-top: 12vh; }
.palette::backdrop { background: rgba(0,0,0,.5); backdrop-filter: blur(2px); }
.palette input { width: 100%; height: 52px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); padding: 0 16px; font: 15px "Geist", sans-serif; outline: none; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.palette li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.palette li code { font-size: 13px; }
.palette li span { color: var(--muted); font-size: 13px; text-align: right; }
.palette li[aria-selected="true"] { background: var(--surface-2); }

.foot-link { color: inherit; text-underline-offset: 3px; }
.foot-link:hover { color: var(--accent, inherit); }
