@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap");

:root, [data-theme=light] {
  color-scheme: light;
  --bg: #f3f6fa;
  --bg-elevated: #ffffff;
  --nav-bg: rgba(243, 246, 250, .88);
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f7;
  --line: #d7e0ea;
  --line-strong: #b8c7d8;
  --muted: #64748b;
  --text: #0f172a;
  --text-soft: #475569;
  --text-faint: #64748b;
  --blue: #1d4ed8;
  --accent: #2563eb;
  --accent-soft: #e8f0ff;
  --accent-border: #bfd3ff;
  --btn-dark: #0f172a;
  --shadow: rgba(15, 23, 42, .08);
  --shadow-strong: rgba(15, 23, 42, .14);
  --live-bg: #eff6ff;
  --live-text: #1d4ed8;
  --live-border: #bfdbfe;
  --red: #dc2626;
  --amber: #b45309;
  --code-bg: #0f1a2e;
  --code-line: #22304a;
  --code-text: #cbd5e1;
  --code-k: #93c5fd;
  --code-s: #86efac;
  --code-p: #7dd3fc;
  --code-n: #fbbf24;
  --code-c: #64748b;
  --code-t: #a5b4fc;
  --font-sans: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
}

[data-theme=dark] {
  color-scheme: dark;
  --bg: #0b1220;
  --bg-elevated: #121a2a;
  --nav-bg: rgba(11, 18, 32, .9);
  --surface: #151e30;
  --surface-2: #101826;
  --surface-3: #1c273b;
  --line: #2a364c;
  --line-strong: #3d4d68;
  --muted: #94a3b8;
  --text: #f1f5f9;
  --text-soft: #cbd5e1;
  --text-faint: #94a3b8;
  --blue: #60a5fa;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, .14);
  --accent-border: rgba(59, 130, 246, .3);
  --btn-dark: #334155;
  --shadow: rgba(0, 0, 0, .28);
  --shadow-strong: rgba(0, 0, 0, .4);
  --live-bg: rgba(59, 130, 246, .14);
  --live-text: #93c5fd;
  --live-border: rgba(59, 130, 246, .28);
  --code-bg: #0a101d;
  --code-line: #1c273b;
}

* { box-sizing: border-box }
html { scroll-behavior: smooth }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: radial-gradient(ellipse 70% 40% at 50% -10%, rgba(37, 99, 235, .12), transparent 55%), var(--bg);
  font-family: var(--font-sans);
  line-height: 1.5;
}
a, button { font: inherit }
a { color: inherit; text-decoration: none }
button, .button, .install-mini, .theme-toggle { cursor: pointer }
code {
  padding: 1px 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  font: 12px var(--font-mono);
}
.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 }

/* ---------- nav ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 20;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 clamp(12px, 1vw, 16px);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em }
.brand-mark {
  display: grid; width: 30px; height: 30px; place-items: center;
  color: #fff; background: var(--accent); border-radius: 8px;
  font: 700 14px/1 var(--font-mono);
}
.brand-name { font-size: 14px }
.nav-actions { display: flex; align-items: center; gap: 10px; font-size: 13px }
.nav-links, .nav-util { display: flex; align-items: center; gap: 10px; flex-shrink: 0 }
.nav-links > a { color: var(--muted); transition: color .2s ease; white-space: nowrap }
.nav-links > a:hover { color: var(--text) }
.nav-util { padding: 0 10px; border-left: 1px solid var(--line); border-right: 1px solid var(--line) }
.lang-switch {
  display: inline-flex; align-items: center;
  padding: 6px 10px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; font-weight: 600;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.lang-switch:hover { color: var(--text); background: var(--surface); border-color: var(--line-strong) }
.theme-toggle, .install-mini {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 12px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.theme-toggle { color: var(--text-soft); background: var(--surface); border: 1px solid var(--line) }
.theme-toggle:hover { border-color: var(--line-strong) }
.install-mini { color: #fff; background: var(--accent); border: 1px solid var(--accent); box-shadow: 0 4px 14px #2563eb38 }
.install-mini:hover { background: var(--blue); border-color: var(--blue) }
.theme-toggle:focus-visible, .install-mini:focus-visible, .button:focus-visible, .nav-actions a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---------- hero ---------- */
.hero-focus {
  max-width: 1080px; margin: 0 auto;
  padding: clamp(24px, 4vh, 40px) clamp(16px, 4vw, 48px) clamp(40px, 6vh, 64px);
  text-align: center;
}
.hero-focus h1 {
  margin: 0 auto;
  max-width: 20em;
  font-size: clamp(1.65rem, 0.55rem + 2vw, 2.5rem);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -.02em;
  overflow-wrap: break-word;
  word-break: normal;
}
.hero-what {
  width: min(40rem, 92%);
  max-width: 100%;
  margin: 22px auto 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  text-align: center;
  box-sizing: border-box;
}
.hero-what li {
  /* block, not flex: text + <strong> must wrap as one paragraph */
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text-soft); font-size: 15px; line-height: 1.6;
  box-shadow: 0 6px 18px var(--shadow);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.hero-what strong { color: var(--text) }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px;
  font-weight: 600;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-1px) }
.button.primary { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: 0 12px 28px #2563eb40 }
.button.primary:hover { background: var(--blue) }
.button.disabled { opacity: .55; cursor: not-allowed; color: var(--muted); border-style: dashed }
.proof {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 20px;
  margin: 28px 0 0; padding: 0; list-style: none;
  color: var(--text-faint); font: 12px/1.4 var(--font-mono);
}
.proof strong { color: var(--text); font-weight: 600 }

/* ---------- section heads ---------- */
.section-head {
  max-width: 720px; margin: 0 auto 28px; padding: 0;
  text-align: center;
}
.section-head h2, .faq-head h2, .install-head h2 { margin: 0; font-size: clamp(1.4rem, 2.5vw, 1.85rem); font-weight: 750; letter-spacing: -.03em }
.section-head p, .faq-head p, .install-head p {
  margin: 12px auto 0; max-width: 40em;
  color: var(--text-soft); font-size: 15px; line-height: 1.75;
}

/* ---------- demo ---------- */
.hero-demo { padding: 0 clamp(16px, 5vw, 72px) clamp(40px, 7vh, 72px) }
.hero-demo-wrap { max-width: 1080px; margin: 0 auto }
.demo-reel {
  margin: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 28px 70px var(--shadow-strong);
}
.demo-reel img {
  display: block; width: 100%; height: auto;
  vertical-align: top;
}
.demo-reel img[data-zoomable] { cursor: zoom-in }
.demo-reel figcaption {
  margin: 0; padding: 12px 16px 14px;
  color: var(--text-faint); font-size: 13px; line-height: 1.55;
  text-align: center;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.medium-zoom-overlay,
.medium-zoom-image--opened { z-index: 100 }

/* ---------- what's new / release pulse ---------- */
.pulse {
  max-width: 1080px; margin: 0 auto;
  padding: 0 clamp(16px, 5vw, 72px) clamp(40px, 7vh, 72px);
}
.pulse-head { margin: 0 auto 20px; text-align: center }
.pulse-live {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--live-text); font: 600 12px/1.2 var(--font-mono);
  letter-spacing: .04em; text-transform: uppercase;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .55);
}
.pulse-latest {
  padding: clamp(20px, 3vw, 28px);
  background: linear-gradient(135deg, var(--accent-soft), transparent 55%), var(--surface);
  border: 1px solid var(--accent-border); border-radius: 16px;
  box-shadow: 0 16px 40px var(--shadow); text-align: left;
}
.pulse-latest-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  margin-bottom: 10px; color: var(--text-faint); font: 12px/1.3 var(--font-mono);
}
.pulse-version {
  display: inline-flex; align-items: center; padding: 3px 10px;
  color: var(--live-text); background: var(--live-bg);
  border: 1px solid var(--live-border); border-radius: 999px; font-weight: 600;
}
.pulse-latest h3 {
  margin: 0; font-size: clamp(1.2rem, 2.4vw, 1.45rem);
  font-weight: 750; letter-spacing: -.02em;
}
.pulse-latest > p { margin: 10px 0 0; color: var(--text-soft); line-height: 1.65 }
.pulse-latest > p + p { margin-top: .45em }
.pulse-latest-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px }
.pulse-timeline { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none }
.pulse-item {
  display: grid; gap: 6px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.pulse-item:hover {
  border-color: var(--accent-border); box-shadow: 0 10px 24px var(--shadow);
  transform: translateY(-1px);
}
.pulse-item-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
}
.pulse-item-version { color: var(--blue); font: 600 12px/1.2 var(--font-mono) }
.pulse-item-title { color: var(--text); font-weight: 650; line-height: 1.35 }
.pulse-item-blurb { color: var(--text-soft); font-size: .92rem; line-height: 1.6 }
.pulse-item time { color: var(--text-faint); font: 12px/1.2 var(--font-mono); white-space: nowrap }

/* ---------- pain ---------- */
.pain-strip { padding: 0 clamp(16px, 5vw, 72px) clamp(40px, 7vh, 72px) }
.pain-strip .section-head { max-width: 900px }
.pain-lead {
  margin: 14px auto 0; max-width: 40em;
  color: var(--text-soft); font-size: 15px; line-height: 1.75; text-align: center;
}
.pain-lead p { margin: 0 0 .55em }
.pain-lead p:last-child { margin-bottom: 0 }
.compare-wrap { max-width: 900px; margin: 24px auto 0 }

/* ---------- architecture ---------- */
.arch-section { padding: 0 clamp(16px, 5vw, 72px) clamp(48px, 8vh, 88px) }
.arch-embed {
  max-width: 1080px; margin: 0 auto;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); box-shadow: 0 16px 40px var(--shadow);
  overflow: hidden;
}
.arch-frame {
  display: block; width: 100%;
  height: clamp(420px, 58vh, 640px);
  border: 0; background: transparent;
}
.arch-open {
  max-width: 1080px; margin: 12px auto 0;
  text-align: right; font-size: 13px;
}
.arch-open a { color: var(--blue) }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none }
.tag { padding: 4px 8px; color: var(--blue); background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 999px; font: 600 10px var(--font-mono) }

/* ---------- code cards ---------- */
.code {
  padding: 0; background: var(--code-bg);
  border: 1px solid var(--code-line); border-radius: 14px;
  box-shadow: 0 20px 50px var(--shadow-strong);
  overflow: hidden;
}
.code[data-file] { position: relative; padding-top: 38px }
.code[data-file]::before {
  content: attr(data-file);
  position: absolute; top: 0; left: 0; right: 0; height: 37px;
  padding: 0 16px; color: #94a3b8; background: #121d33;
  border-bottom: 1px solid var(--code-line);
  font: 11px/37px var(--font-mono);
}
.code pre { margin: 0; padding: 16px; overflow-x: auto }
.code pre + pre { border-top: 1px dashed var(--code-line) }
.code code { padding: 0; background: none; border: 0; color: var(--code-text); font: 12.5px/1.75 var(--font-mono) }
.code .k { color: var(--code-k) }
.code .s { color: var(--code-s) }
.code .p { color: var(--code-p) }
.code .n { color: var(--code-n) }
.code .c { color: var(--code-c) }
.code .t { color: var(--code-t) }
.code .d { color: var(--code-k) }

/* ---------- spotlight ---------- */
.spotlight-group {
  display: flex; flex-direction: column; gap: clamp(40px, 6vh, 72px);
  max-width: 1080px; margin: 0 auto;
  padding: 0 clamp(16px, 5vw, 72px) clamp(48px, 8vh, 88px);
}
.spotlight { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 4vw, 48px); align-items: center }
.spotlight.reverse { grid-template-columns: .9fr 1.1fr }
.spotlight.reverse .spotlight-media { order: 2 }
.spotlight.reverse .spotlight-copy { order: 1 }
.spotlight-copy h3 { margin: 14px 0 0; font-size: clamp(1.25rem, 2.2vw, 1.65rem); letter-spacing: -.03em }
.spotlight-copy p { margin: 12px 0 0; color: var(--text-soft); font-size: 15px; line-height: 1.7 }

/* ---------- quickstart ---------- */
.quickstart { padding: 0 clamp(16px, 5vw, 72px) clamp(48px, 8vh, 88px); border-top: 1px solid var(--line) }
.quickstart .section-head { padding-top: clamp(40px, 6vh, 72px); margin-bottom: 36px }
.qs-steps { display: flex; flex-direction: column; gap: 28px; max-width: 900px; margin: 0 auto; padding: 0; list-style: none }
.qs-step-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px }
.step-num { color: var(--blue); font: 600 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase }
.qs-step-head h3 { margin: 0; font-size: 18px; letter-spacing: -.02em }
.qs-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px }
.qs-note { margin: 12px 0 0; color: var(--text-soft); font-size: 14px; line-height: 1.65 }
.qs-links { display: grid; grid-template-columns: 1fr 1fr; gap: 14px }
.qs-link-card {
  display: block; padding: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 8px 24px var(--shadow);
  transition: border-color .2s ease, transform .2s ease;
}
.qs-link-card:hover { border-color: var(--accent-border); transform: translateY(-1px) }
.qs-link-card strong { display: block; margin-bottom: 6px; font-size: 15px }
.qs-link-card p { margin: 0; color: var(--text-soft); font-size: 13.5px; line-height: 1.6 }

/* ---------- compat table ---------- */
.compat { padding: 0 clamp(16px, 5vw, 72px) clamp(48px, 8vh, 88px); border-top: 1px solid var(--line) }
.compat .section-head { padding-top: clamp(40px, 6vh, 72px) }
.table-wrap { max-width: 900px; margin: 0 auto; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 28px var(--shadow) }
table { width: 100%; border-collapse: collapse; font-size: 14px }
th, td { padding: 13px 18px; text-align: left; border-bottom: 1px solid var(--line) }
th { color: var(--text-faint); font: 600 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; background: var(--surface-2) }
tbody tr:last-child td { border-bottom: 0 }
td { color: var(--text-soft) }
td:first-child { color: var(--text); font-weight: 600; white-space: nowrap }

/* ---------- faq ---------- */
.faq-section { padding: 0 clamp(16px, 5vw, 72px) clamp(48px, 8vh, 88px); border-top: 1px solid var(--line) }
.faq-head { max-width: 720px; margin: 0 auto 28px; padding-top: clamp(40px, 6vh, 64px); text-align: center }
.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px }
.faq-item { padding: 0 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 18px var(--shadow) }
.faq-item summary { padding: 16px 0; font-weight: 600; cursor: pointer; list-style: none }
.faq-item summary::-webkit-details-marker { display: none }
.faq-item summary::after { content: "+"; float: right; color: var(--muted); font: 500 18px/1 var(--font-mono) }
.faq-item[open] summary::after { content: "−" }
.faq-answer { padding: 0 0 16px; color: var(--text-soft); font-size: 14px; line-height: 1.7 }
.faq-answer p { margin: 0 }
.faq-answer ul { margin: 0; padding: 0 0 0 1.2em }
.faq-answer li { margin: 0 0 6px }
.faq-answer li:last-child { margin-bottom: 0 }
.faq-answer a, .faq-answer code { }
.faq-answer a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px }
.faq-foot { max-width: 720px; margin: 20px auto 0; color: var(--text-faint); font-size: 13px; text-align: center }
.faq-foot a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px }

/* ---------- install ---------- */
.install-section { padding: 0 clamp(16px, 5vw, 72px) clamp(48px, 8vh, 96px); border-top: 1px solid var(--line) }
.install-head { max-width: 720px; margin: 0 auto 28px; padding-top: clamp(40px, 6vh, 72px); text-align: center }
.install-paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 1080px; margin: 0 auto }
.install-path {
  display: flex; flex-direction: column; gap: 12px; padding: 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 28px var(--shadow); text-align: left;
}
.install-path.recommended { border-color: var(--accent-border); box-shadow: 0 14px 36px #2563eb1f }
.install-path h3 { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 18px; letter-spacing: -.02em }
.path-badge { padding: 3px 8px; color: var(--blue); background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 999px; font: 600 10px var(--font-mono) }
.install-path p { margin: 0; color: var(--text-soft); font-size: 14px; line-height: 1.65 }
.install-path .button { width: max-content; margin-top: auto; min-height: 44px }
.install-foot { max-width: 880px; margin: 20px auto 0; color: var(--text-faint); font-size: 13px; line-height: 1.65; text-align: center }
.install-foot a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px }

/* ---------- footer ---------- */
.site-footer { padding: 24px clamp(16px, 5vw, 72px) 40px; color: var(--text-faint); border-top: 1px solid var(--line); font-size: 13px; text-align: center }
.site-footer a { color: var(--blue) }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .install-paths, .qs-codes, .qs-links, .spotlight, .spotlight.reverse { grid-template-columns: 1fr }
  .spotlight.reverse .spotlight-media, .spotlight.reverse .spotlight-copy { order: unset }
  .arch-frame { height: clamp(360px, 70vh, 560px) }
  .nav-links { display: none }
  .hero-what { width: min(40rem, 100%) }
}
@media (max-width: 640px) {
  .site-nav { padding: 0 12px; gap: 8px }
  .brand-name { font-size: 13px }
  .nav-util { border-left: 0; border-right: 0; padding-left: 0; padding-right: 0 }
  .install-mini { display: none }
  .hero-focus { padding-left: 16px; padding-right: 16px }
  .hero-focus h1 { max-width: none; font-size: clamp(1.35rem, 6vw, 1.75rem) }
  .hero-what { width: 100% }
  .hero-what li { padding: 12px 14px; font-size: 14px }
  .pain-lead { max-width: none; padding: 0 4px; text-align: left }
  .table-wrap { border-radius: 12px }
  th, td { padding: 11px 12px; font-size: 13px }
  .actions { gap: 10px }
  .button { min-height: 44px; padding: 0 16px; width: 100%; max-width: 280px }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-focus > * { animation: rise .55s cubic-bezier(.16, 1, .3, 1) both }
  .hero-focus > *:nth-child(1) { animation-delay: .02s }
  .hero-focus > *:nth-child(2) { animation-delay: .06s }
  .hero-focus > *:nth-child(3) { animation-delay: .1s }
  .hero-focus > *:nth-child(4) { animation-delay: .14s }
  .hero-focus > *:nth-child(5) { animation-delay: .18s }
  .demo-reel { animation: rise .65s cubic-bezier(.16, 1, .3, 1) .12s both }
  .pulse-dot { animation: pulse-glow 1.8s ease-out infinite }
  @keyframes rise { 0% { opacity: 0; transform: translateY(14px) } }
  @keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55) }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0) }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0) }
  }
}
