:root {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-deep: #070b16;
  --surface: #11182a;
  --surface-2: #161f33;
  --surface-soft: rgba(255, 255, 255, 0.035);
  --text: #f5f1e8;
  --muted: #a9b1c4;
  --faint: #737d95;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);
  --mint: #7cf0c5;
  --mint-soft: rgba(124, 240, 197, 0.12);
  --violet: #a98cff;
  --coral: #ff8f7b;
  --code-bg: #080d1a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --max: 1180px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f1e8;
  --bg-deep: #ebe5d9;
  --surface: #fffdf8;
  --surface-2: #eee8dc;
  --surface-soft: rgba(11, 16, 32, 0.035);
  --text: #111727;
  --muted: #596174;
  --faint: #7b8290;
  --line: rgba(11, 16, 32, 0.12);
  --line-strong: rgba(11, 16, 32, 0.22);
  --mint: #087f62;
  --mint-soft: rgba(8, 127, 98, 0.1);
  --violet: #6545c6;
  --coral: #c64f3d;
  --code-bg: #111827;
  --shadow: 0 24px 80px rgba(35, 27, 18, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.6; }
button, input { font: inherit; }
a { color: inherit; }
code, pre { font-family: var(--mono); }
code { font-size: 0.93em; }
pre { margin: 0; overflow: auto; line-height: 1.65; tab-size: 2; }
pre code { font-size: 0.86rem; }

.skip-link { position: fixed; left: 12px; top: -50px; z-index: 100; padding: 10px 14px; background: var(--mint); color: #07120f; border-radius: 6px; text-decoration: none; font-weight: 700; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.topbar { position: sticky; top: 0; z-index: 50; height: 70px; display: flex; align-items: center; gap: 28px; padding: 0 max(24px, calc((100vw - var(--max)) / 2)); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 760; letter-spacing: -0.02em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; color: var(--bg); background: var(--mint); border-radius: 8px; font-family: var(--mono); font-size: 0.72rem; font-weight: 800; }
.topnav { display: flex; align-items: center; gap: 25px; margin: 0 auto; }
.topnav a, .mobile-nav a, footer nav a { color: var(--muted); text-decoration: none; font-size: 0.88rem; transition: color 160ms ease; }
.topnav a:hover, .topnav a.is-active, .mobile-nav a:hover, footer nav a:hover { color: var(--text); }
.top-actions { display: flex; align-items: center; gap: 9px; }
.icon-button, .menu-button { color: var(--text); border: 1px solid var(--line); background: transparent; cursor: pointer; }
.icon-button { width: 38px; height: 38px; border-radius: 8px; }
.menu-button { display: none; width: 40px; height: 38px; padding: 9px; border-radius: 8px; }
.menu-button > span:not(.sr-only) { display: block; height: 1px; margin: 4px 0; background: currentColor; }
.mobile-nav { display: none; position: fixed; z-index: 45; inset: 70px 0 auto; padding: 18px 24px 24px; border-bottom: 1px solid var(--line); background: var(--bg); box-shadow: var(--shadow); }
.mobile-nav.is-open { display: grid; gap: 16px; }
.text-link { color: var(--mint); text-decoration: none; font-weight: 650; }
.language-link { font-size: 0.8rem; letter-spacing: 0.08em; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 19px; border: 1px solid transparent; border-radius: 9px; text-decoration: none; font-weight: 720; font-size: 0.9rem; transition: transform 160ms ease, border-color 160ms ease, background 160ms ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: #07120f; background: var(--mint); }
.button-ghost { color: var(--text); border-color: var(--line-strong); background: var(--surface-soft); }
.button-ghost:hover { border-color: var(--mint); }
.button-compact { min-height: 38px; padding: 0 13px; font-size: 0.8rem; }

.hero { position: relative; display: grid; grid-template-columns: minmax(0, 0.93fr) minmax(520px, 1.07fr); gap: 72px; align-items: center; min-height: calc(100vh - 70px); max-width: var(--max); margin: 0 auto; padding: 90px 0 100px; }
.hero::before { content: ""; position: absolute; inset: 5% 45% 35% -20%; pointer-events: none; background: radial-gradient(circle, rgba(124, 240, 197, 0.12), transparent 65%); filter: blur(24px); }
.hero-copy { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px var(--mint-soft); }
h1 { max-width: 760px; margin: 22px 0 25px; font-size: clamp(3.2rem, 6vw, 5.8rem); line-height: 0.96; letter-spacing: -0.065em; }
h1 span, .closing h2 span { color: var(--mint); }
.hero-lead { max-width: 620px; margin: 0; color: var(--muted); font-size: 1.08rem; }
.hero-lead strong { color: var(--text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 54px; padding-top: 24px; border-top: 1px solid var(--line); }
.hero-facts strong, .hero-facts span { display: block; }
.hero-facts strong { font-size: 0.88rem; }
.hero-facts span { margin-top: 4px; color: var(--faint); font-size: 0.74rem; line-height: 1.45; }

.hero-code, .panel { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.hero-code { transform: perspective(1200px) rotateY(-2deg) rotateX(1deg); }
.window-bar { display: flex; align-items: center; min-height: 48px; padding: 0 15px; border-bottom: 1px solid var(--line); color: var(--faint); font-family: var(--mono); font-size: 0.72rem; }
.window-dots { display: flex; gap: 6px; margin-right: 13px; }
.window-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.window-dots span:first-child { background: var(--coral); }
.window-dots span:nth-child(2) { background: #e8c65b; }
.window-dots span:nth-child(3) { background: var(--mint); }
.copy-button { margin-left: auto; padding: 5px 9px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; background: transparent; cursor: pointer; font-family: var(--sans); font-size: 0.69rem; font-weight: 650; transition: color 160ms ease, border-color 160ms ease; }
.copy-button:hover { color: var(--mint); border-color: var(--mint); }
.copy-button.is-copied { color: #07120f; border-color: var(--mint); background: var(--mint); }
.hero-code > pre { padding: 27px 24px 30px; background: var(--code-bg); }
.code-result { display: grid; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--line); background: var(--mint-soft); }
.code-result code { color: var(--text); font-size: 0.76rem; white-space: nowrap; overflow: auto; }
.result-label { color: var(--mint); font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; }
.tok-punc { color: #75809a; }
.tok-key { color: #c8b9ff; }
.tok-string { color: #f3c790; }
.tok-expr { color: #7cf0c5; }
.tok-keyword { color: #c8b9ff; }
.tok-type { color: #83cfff; }
.tok-bool, .tok-number { color: #ff9a86; }
.tok-comment { color: #65718d; }

.section { max-width: var(--max); margin: 0 auto; padding: 112px 0; }
.surface-section { max-width: none; padding-left: max(24px, calc((100vw - var(--max)) / 2)); padding-right: max(24px, calc((100vw - var(--max)) / 2)); background: var(--surface-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: 1fr minmax(280px, 460px); gap: 50px; align-items: end; margin-bottom: 48px; }
.section-heading > div { display: flex; align-items: baseline; gap: 18px; }
.section-index { color: var(--mint); font-family: var(--mono); font-size: 0.72rem; }
.section h2, .closing h2 { margin: 0; font-size: clamp(2.25rem, 4vw, 3.8rem); line-height: 1.02; letter-spacing: -0.05em; }
.section-heading > p { margin: 0; color: var(--muted); font-size: 0.96rem; }

.install-layout { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 28px; align-items: stretch; }
.install-panel { min-height: 280px; }
.tabs { display: flex; padding: 7px; border-bottom: 1px solid var(--line); }
.tab { padding: 8px 15px; color: var(--muted); border: 0; border-radius: 6px; background: transparent; cursor: pointer; font-size: 0.8rem; font-weight: 700; }
.tab.is-active { color: #07120f; background: var(--mint); }
.tab-panel { position: relative; display: none; min-height: 218px; background: var(--code-bg); }
.tab-panel.is-active { display: block; }
.tab-panel pre { padding: 30px; }
.floating-copy { position: absolute; right: 14px; top: 14px; }
.steps { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.steps li { display: grid; grid-template-columns: 32px 1fr; gap: 15px; align-items: start; padding: 20px; background: var(--surface); }
.step-number { display: grid; place-items: center; width: 28px; height: 28px; color: var(--mint); border: 1px solid var(--line-strong); border-radius: 50%; font-family: var(--mono); font-size: 0.68rem; }
.steps strong { font-size: 0.9rem; }
.steps p { margin: 4px 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.5; }
.code-panel { background: var(--code-bg); }
.wide-code { margin-top: 28px; }
.code-panel pre { padding: 28px; }

.syntax-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.syntax-card { min-height: 220px; padding: 28px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.syntax-card > code { display: inline-block; padding: 6px 9px; color: var(--mint); border: 1px solid color-mix(in srgb, var(--mint) 35%, transparent); border-radius: 6px; background: var(--mint-soft); }
.syntax-card h3, .function-card h3, .guidance-grid h3, .custom-steps h3 { margin: 30px 0 8px; font-size: 1rem; }
.syntax-card p, .function-card p, .guidance-grid p, .custom-steps p { margin: 0; color: var(--muted); font-size: 0.84rem; }
.callout { display: grid; grid-template-columns: 42px 1fr; gap: 18px; margin-top: 28px; padding: 24px; border: 1px solid color-mix(in srgb, var(--violet) 38%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--violet) 8%, transparent); }
.callout-icon { display: grid; place-items: center; width: 38px; height: 38px; color: var(--violet); border: 1px solid var(--violet); border-radius: 50%; font-family: var(--mono); }
.callout p { margin: 4px 0 0; color: var(--muted); font-size: 0.86rem; }

.example-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.example-chip, .filter-button { padding: 8px 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer; font-size: 0.78rem; }
.example-chip.is-active, .filter-button.is-active { color: #07120f; border-color: var(--mint); background: var(--mint); }
.example-stage { display: grid; grid-template-columns: 1fr 76px 1fr; background: var(--code-bg); }
.example-column { min-width: 0; }
.example-column pre { min-height: 390px; padding: 25px; font-size: 0.8rem; }
.transform-arrow { display: grid; align-content: center; justify-items: center; gap: 5px; color: var(--mint); border-left: 1px solid var(--line); border-right: 1px solid var(--line); font-size: 1.4rem; }
.transform-arrow span { color: var(--faint); font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; }

.function-toolbar { display: grid; grid-template-columns: minmax(240px, 0.72fr) 1.28fr; gap: 22px; align-items: center; margin-bottom: 28px; }
.search-box { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.search-box span { color: var(--mint); font-size: 1.2rem; }
.search-box input { width: 100%; color: var(--text); border: 0; outline: 0; background: transparent; font-size: 0.83rem; }
.search-box input::placeholder { color: var(--faint); }
.filter-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.function-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.function-card { min-height: 180px; padding: 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.function-card[hidden] { display: none; }
.function-card > span { color: var(--mint); font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; }
.function-card h3 { margin-top: 22px; font-family: var(--mono); font-size: 0.83rem; }
.empty-state { padding: 40px; color: var(--muted); text-align: center; border: 1px solid var(--line); }

.custom-layout { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 28px; align-items: start; }
.custom-steps { display: grid; gap: 14px; }
.custom-steps article { position: relative; overflow: hidden; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.custom-steps article > span { color: var(--mint); font-family: var(--mono); font-size: 0.65rem; }
.custom-steps h3 { margin: 12px 0; }
.custom-steps pre { margin: 15px -22px -22px; padding: 20px; border-top: 1px solid var(--line); background: var(--code-bg); font-size: 0.68rem; }
.custom-steps .copy-button { position: absolute; right: 13px; top: 13px; }
.custom-steps .tip-card { border-color: color-mix(in srgb, var(--violet) 40%, transparent); background: color-mix(in srgb, var(--violet) 8%, var(--surface)); }
.tip-card > span { color: var(--violet) !important; }

.guidance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; padding: 1px; background: var(--line); }
.guidance-grid article { min-height: 250px; padding: 29px; background: var(--bg); }
.guidance-number { color: var(--mint); font-family: var(--mono); font-size: 0.68rem; }
.guidance-grid h3 { margin-top: 58px; font-size: 1.08rem; }

.pipeline { display: grid; grid-template-columns: repeat(4, 1fr 32px) 1fr; align-items: center; }
.pipeline div { min-height: 175px; padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pipeline span, .pipeline strong { display: block; }
.pipeline span { color: var(--mint); font-family: var(--mono); font-size: 0.65rem; }
.pipeline strong { margin-top: 31px; }
.pipeline p { margin: 5px 0 0; color: var(--muted); font-size: 0.76rem; }
.pipeline i { color: var(--faint); text-align: center; font-style: normal; }
.api-note { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 30px; align-items: center; margin-top: 28px; padding: 28px; border: 1px solid var(--line); border-radius: 12px; }
.api-note h3 { margin: 10px 0 0; font-size: 1rem; }
.api-note p { margin: 0; color: var(--muted); font-size: 0.84rem; }
.badge { display: inline-block; padding: 4px 8px; color: var(--mint); border: 1px solid color-mix(in srgb, var(--mint) 38%, transparent); border-radius: 99px; font-family: var(--mono); font-size: 0.62rem; }

.closing { display: grid; justify-items: center; padding: 130px 24px; text-align: center; background: radial-gradient(circle at center, var(--mint-soft), transparent 55%); }
.closing h2 { margin-top: 22px; }
.closing .hero-actions { justify-content: center; }
footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; max-width: var(--max); margin: 0 auto; padding: 34px 0; border-top: 1px solid var(--line); }
footer p { color: var(--faint); font-size: 0.75rem; }
footer nav { display: flex; justify-content: flex-end; gap: 20px; }

@media (max-width: 1228px) {
  .hero, .section, footer { margin-left: 24px; margin-right: 24px; }
  .surface-section { margin-left: 0; margin-right: 0; }
  .hero { grid-template-columns: 1fr 1fr; gap: 36px; }
  .function-grid { grid-template-columns: repeat(3, 1fr); }
  .pipeline { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .pipeline i { display: none; }
  .pipeline div:last-child { grid-column: span 2; }
}

@media (max-width: 900px) {
  .topnav, .top-actions .button-compact { display: none; }
  .top-actions { margin-left: auto; }
  .menu-button { display: block; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 70px; }
  .hero-code { transform: none; }
  .hero-facts { max-width: 600px; }
  .section-heading { grid-template-columns: 1fr; gap: 18px; }
  .install-layout, .custom-layout { grid-template-columns: 1fr; }
  .syntax-grid { grid-template-columns: repeat(2, 1fr); }
  .example-stage { grid-template-columns: 1fr; }
  .transform-arrow { min-height: 58px; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(90deg); }
  .example-column pre { min-height: 300px; }
  .function-toolbar { grid-template-columns: 1fr; }
  .filter-row { justify-content: flex-start; }
  .function-grid, .guidance-grid { grid-template-columns: repeat(2, 1fr); }
  .api-note { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr; text-align: center; }
  footer .brand, footer nav { justify-content: center; }
}

@media (max-width: 600px) {
  .topbar { padding: 0 16px; }
  .hero, .section, footer { margin-left: 16px; margin-right: 16px; }
  .surface-section { margin-left: 0; margin-right: 0; padding-left: 16px; padding-right: 16px; }
  .hero { padding-top: 54px; padding-bottom: 70px; }
  h1 { font-size: clamp(2.8rem, 15vw, 4.3rem); }
  .hero-facts { grid-template-columns: 1fr; }
  .section { padding-top: 82px; padding-bottom: 82px; }
  .section-heading > div { align-items: flex-start; }
  .syntax-grid, .function-grid, .guidance-grid { grid-template-columns: 1fr; }
  .syntax-card { min-height: auto; }
  .guidance-grid article { min-height: 210px; }
  .hero-code > pre, .code-panel pre, .example-column pre { padding: 20px; }
  .code-result code { white-space: normal; }
  .pipeline { grid-template-columns: 1fr; }
  .pipeline div:last-child { grid-column: auto; }
  .closing { padding: 100px 18px; }
}

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