:root {
  color-scheme: dark;
  --bg: #070a13;
  --bg-soft: #0b101d;
  --panel: #101728;
  --panel-2: #141c30;
  --panel-3: #0c1221;
  --line: #222c44;
  --line-strong: #33405e;
  --text: #eef1f8;
  --text-soft: #c7cede;
  --muted: #8e9ab3;
  --faint: #6f7a93;
  --accent: #8f7cf7;
  --accent-strong: #a78bfa;
  --accent-soft: rgb(143 124 247 / 14%);
  --teal: #5eead4;
  --pink: #f0abfc;
  --amber: #fcd34d;
  --danger: #ff9aab;
  --success: #7de1bd;
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(1100px 700px at 12% -8%, rgb(109 92 231 / 20%), transparent 60%),
    radial-gradient(900px 600px at 92% 4%, rgb(45 212 191 / 7%), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: rgb(143 124 247 / 38%);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.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;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Header ------------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: rgb(7 10 19 / 72%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: border-color 180ms ease, background 180ms ease;
}

.site-header.scrolled {
  border-color: var(--line);
  background: rgb(7 10 19 / 92%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 17px;
  font-weight: 780;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(145deg, #b6a4ff, #6d5ce7 55%, #4c3bc4);
  box-shadow: 0 6px 20px rgb(124 95 242 / 35%);
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
}

.brand-mark.small {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 18px;
}

.brand-version {
  margin-left: 2px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

.site-nav a,
.footer-links a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  text-decoration: none;
  transition: color 150ms ease;
}

.site-nav a:hover,
.footer-links a:hover {
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.language-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(13 19 34 / 80%);
}

.language-switch button {
  padding: 4px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.language-switch button:hover {
  color: var(--text);
}

.language-switch button.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.icon-link {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.icon-link:hover {
  border-color: var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
}

.icon-link svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

/* Hero -------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 92px 0 84px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgb(255 255 255 / 2.4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 2.4%) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 0%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 0%, #000 10%, transparent 72%);
}

.hero-glow {
  position: absolute;
  top: -160px;
  right: -120px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(143 124 247 / 18%), transparent 66%);
  filter: blur(10px);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 64px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 16px;
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.hero h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2.65rem, 5.2vw, 4.5rem);
  font-weight: 780;
  letter-spacing: -0.055em;
  line-height: 0.99;
}

.hero h1 > span {
  display: block;
}

.gradient-text {
  background: linear-gradient(100deg, #c4b5fd 0%, #8f7cf7 45%, #5eead4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  max-width: 58ch;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: linear-gradient(135deg, #9a88fa, #7360e6);
  box-shadow: 0 10px 30px rgb(115 96 230 / 28%);
  color: #fff;
}

.button.primary:hover {
  background: linear-gradient(135deg, #a997ff, #7d6bf0);
  box-shadow: 0 14px 36px rgb(115 96 230 / 36%);
}

.button.ghost {
  border-color: var(--line-strong);
  background: rgb(20 28 48 / 55%);
  color: var(--text-soft);
}

.button.ghost:hover {
  border-color: #4b5b7f;
  background: var(--panel-2);
  color: var(--text);
}

.button.small {
  padding: 9px 13px;
  font-size: 12px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 30px;
  color: var(--faint);
  font-size: 11px;
}

.hero-meta strong {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

.hero-demo {
  position: relative;
}

.hero-demo::before {
  content: "";
  position: absolute;
  inset: 12% -8% -10% 8%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(94 234 212 / 10%), transparent 65%);
  filter: blur(20px);
}

.terminal {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: linear-gradient(180deg, #0e1526, #090e1a);
  box-shadow:
    0 34px 90px rgb(0 0 0 / 48%),
    0 0 0 1px rgb(255 255 255 / 3%) inset;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgb(20 28 48 / 65%);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3a4560;
}

.terminal-dots i:nth-child(1) {
  background: #f87171;
}

.terminal-dots i:nth-child(2) {
  background: #fbbf24;
}

.terminal-dots i:nth-child(3) {
  background: #34d399;
}

.terminal-title {
  margin-left: auto;
  margin-right: auto;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.terminal-body {
  padding: 20px 20px 18px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
}

.terminal-line {
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.terminal-line .prompt {
  margin-right: 9px;
  color: var(--teal);
  font-weight: 700;
}

.terminal-line .string {
  color: #c4b5fd;
}

.terminal-out {
  margin: 6px 0 16px 20px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.hero-chart {
  display: block;
  width: 100%;
  height: auto;
  margin: 4px 0 10px;
}

.chart-grid line {
  stroke: rgb(255 255 255 / 8%);
  stroke-width: 1;
}

.chart-area {
  fill: url("#chart-fill");
}

.chart-path {
  fill: none;
  stroke: url("#chart-line");
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.chart-points circle {
  fill: #0b101d;
  stroke: #a78bfa;
  stroke-width: 2;
}

.terminal-note {
  color: var(--faint);
  font-family: var(--font);
  font-size: 10px;
}

/* Stats strip ------------------------------------------------------------- */

.stats-strip {
  border-block: 1px solid var(--line);
  background: rgb(10 15 27 / 55%);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
}

.stats-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 22px 26px;
  border-left: 1px solid var(--line);
}

.stats-grid > div:first-child {
  border-left: 0;
  padding-left: 0;
}

.stats-grid strong {
  color: var(--text);
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.stats-grid span {
  color: var(--faint);
  font-size: 11px;
}

/* Sections ---------------------------------------------------------------- */

.section {
  padding: 96px 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 34px;
}

.section-heading h2,
.section-heading h1,
.install-copy h2 {
  margin: 0;
  font-size: clamp(1.85rem, 3.2vw, 2.7rem);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.section-heading p,
.install-copy p {
  max-width: 62ch;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.section-heading.centered {
  display: block;
  max-width: 720px;
  margin: 0 auto 46px;
  text-align: center;
}

.section-heading.centered .eyebrow::before {
  display: none;
}

.section-heading.centered p {
  margin-inline: auto;
}

.live-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(13 19 34 / 65%);
  color: var(--faint);
  font-size: 10px;
  white-space: nowrap;
}

.pulse {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgb(94 234 212 / 35%);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgb(94 234 212 / 35%);
  }
  70% {
    box-shadow: 0 0 0 7px rgb(94 234 212 / 0%);
  }
  100% {
    box-shadow: 0 0 0 0 rgb(94 234 212 / 0%);
  }
}

/* Studio ------------------------------------------------------------------ */

.studio {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: 16px;
  height: 780px;
}

.coding-panel,
.docs-panel {
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgb(20 28 48 / 75%), rgb(12 18 33 / 90%));
  box-shadow: 0 22px 70px rgb(0 0 0 / 22%);
}

.studio-toolbar,
.docs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: rgb(13 19 34 / 55%);
}

.select-wrap {
  position: relative;
  min-width: 0;
}

.select-wrap::after {
  content: "▾";
  position: absolute;
  top: 50%;
  right: 11px;
  color: var(--faint);
  font-size: 10px;
  pointer-events: none;
  transform: translateY(-50%);
}

select {
  max-width: 270px;
  padding: 8px 30px 8px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  background: var(--panel-3);
  color: var(--text-soft);
  font-size: 12px;
  appearance: none;
}

select:hover {
  border-color: var(--line-strong);
}

select:focus {
  border-color: var(--accent);
}

.studio-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.text-button {
  padding: 4px 0;
  border: 0;
  background: none;
  color: #a9a2ed;
  font-size: 11px;
  font-weight: 600;
}

.text-button:hover {
  color: #d0caff;
}

.run-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, #8f7cf7, #6d5ce7);
  box-shadow: 0 6px 18px rgb(101 79 210 / 28%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.run-button:hover {
  background: linear-gradient(135deg, #a08fff, #7a68f0);
}

.run-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.run-icon {
  font-size: 9px;
}

.run-button kbd {
  margin-left: 3px;
  color: #ded8ff;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
}

.editor-wrap {
  position: relative;
  flex: 1;
  min-height: 260px;
  background: #0c1221;
}

#editor {
  position: absolute;
  inset: 0;
  font-size: 13px;
}

#editor .ace_gutter {
  background: #0a0f1c;
  color: #58647e;
}

#editor .ace_gutter-active-line,
#editor .ace_marker-layer .ace_active-line {
  background: rgb(143 124 247 / 7%);
}

#editor .ace_selection {
  background: rgb(143 124 247 / 25%) !important;
}

.editor-fallback {
  width: 100%;
  height: 100%;
  padding: 18px;
  border: 0;
  outline: none;
  resize: none;
  background: #0c1221;
  color: #e6eaf2;
  font: 13px/1.7 var(--mono);
  tab-size: 2;
}

.editor-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  background: rgb(10 15 27 / 55%);
}

.status-pill {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.status-pill[data-kind="success"] {
  border-color: #285d50;
  color: var(--success);
}

.status-pill[data-kind="error"] {
  border-color: #673646;
  color: var(--danger);
}

.status-pill[data-kind="running"] {
  border-color: #51447f;
  color: #d4c8ff;
}

.statusbar-note {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
}

.console-section {
  display: flex;
  min-height: 250px;
  flex: 0 0 300px;
  flex-direction: column;
  border-top: 1px solid var(--line);
  background: rgb(8 12 22 / 55%);
}

.console-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 15px 6px;
}

.console-heading .eyebrow {
  margin-bottom: 2px;
  font-size: 9px;
}

.console-heading h3,
.docs-toolbar h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.console-actions {
  display: flex;
  gap: 12px;
}

.output {
  flex: 1;
  overflow: auto;
  margin: 0;
  padding: 6px 15px 14px;
  color: #c8d1e2;
  font: 11.5px/1.65 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scrollbar-color: #3a4155 transparent;
}

.chart-panel {
  flex: none;
  max-height: 230px;
  overflow: auto;
  padding: 10px 15px 12px;
  border-top: 1px solid var(--line);
  background: rgb(13 19 34 / 55%);
}

.chart-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.chart-title {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
}

.chart-svg svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 170px;
}

.repl-form {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 6px 11px;
  border-top: 1px solid var(--line);
  background: rgb(10 15 27 / 65%);
}

.repl-prompt {
  color: #a99af7;
  font-family: var(--mono);
  font-size: 11px;
}

.repl-form input {
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: #0a0f1c;
  color: var(--text);
  font: 11.5px var(--mono);
}

.repl-form input:focus {
  border-color: var(--accent);
}

.repl-submit {
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: #282343;
  color: #d3cbff;
  font-size: 10px;
  font-weight: 600;
}

.repl-submit:hover {
  background: #39305e;
}

.repl-submit:disabled {
  cursor: wait;
  opacity: 0.6;
}

/* Docs -------------------------------------------------------------------- */

.docs-toolbar {
  align-items: flex-end;
}

.docs-toolbar .eyebrow {
  margin-bottom: 3px;
  font-size: 9px;
}

.docs-toolbar select {
  max-width: 170px;
}

.docs-toc {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  scrollbar-width: thin;
}

.docs-toc:empty {
  display: none;
}

.toc-link {
  color: var(--faint);
  font-size: 10px;
  text-decoration: none;
}

.toc-link:hover {
  color: #c3b9ff;
}

.toc-h1,
.toc-h2 {
  font-weight: 700;
}

.docs-content {
  flex: 1;
  overflow: auto;
  padding: 8px 20px 22px;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.7;
  scrollbar-color: #3a4155 transparent;
}

.docs-content h1,
.docs-content h2,
.docs-content h3 {
  margin: 24px 0 9px;
  color: #f4f5fa;
  line-height: 1.25;
}

.docs-content h1 {
  font-size: 22px;
  letter-spacing: -0.03em;
}

.docs-content h2 {
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  letter-spacing: -0.02em;
}

.docs-content h3 {
  font-size: 13px;
}

.docs-content p {
  margin: 8px 0 12px;
}

.docs-content a {
  color: #aaa0ff;
}

.docs-content ul,
.docs-content ol {
  padding-left: 20px;
}

.docs-content li {
  margin: 4px 0;
}

.docs-content code {
  padding: 2px 4px;
  border-radius: 4px;
  background: #1b2234;
  color: #d6cfff;
  font: 11px var(--mono);
}

.docs-content pre {
  position: relative;
  overflow: auto;
  margin: 12px 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a0f1c;
}

.docs-content pre code {
  padding: 0;
  background: none;
  color: #c3cbe0;
  line-height: 1.6;
}

.docs-content table {
  width: 100%;
  margin: 12px 0;
  border-collapse: collapse;
  font-size: 11px;
}

.docs-content th,
.docs-content td {
  padding: 6px;
  border: 1px solid var(--line-strong);
  text-align: left;
  vertical-align: top;
}

.docs-content th {
  color: #ded8ff;
}

.docs-content blockquote {
  margin: 12px 0;
  padding-left: 12px;
  border-left: 2px solid #7967e8;
  color: var(--muted);
}

.copy-code {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgb(20 28 48 / 92%);
  color: var(--muted);
  font-size: 9px;
}

.copy-code:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.docs-note {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  background: rgb(10 15 27 / 55%);
}

.docs-note .eyebrow {
  margin-bottom: 5px;
  font-size: 9px;
}

.docs-note p {
  margin: 0;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.55;
}

/* Features ---------------------------------------------------------------- */

.features-section {
  border-top: 1px solid var(--line);
  background: rgb(8 12 22 / 35%);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.feature-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgb(20 28 48 / 65%), rgb(12 18 33 / 65%));
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.feature-card::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(143 124 247 / 12%), transparent 70%);
  pointer-events: none;
}

.feature-card:hover {
  border-color: #3a4766;
  background: linear-gradient(180deg, rgb(24 33 56 / 75%), rgb(14 21 38 / 75%));
  transform: translateY(-3px);
}

.feature-icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 18px;
  place-items: center;
  border: 1px solid rgb(143 124 247 / 28%);
  border-radius: 10px;
  background: var(--accent-soft);
  color: #c4b5fd;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

/* Install ----------------------------------------------------------------- */

.install-section {
  border-top: 1px solid var(--line);
}

.install-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 64px;
  align-items: center;
}

.install-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.install-cards {
  display: grid;
  gap: 12px;
}

.install-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b101d;
}

.install-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  background: rgb(20 28 48 / 55%);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 650;
}

.copy-button {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-3);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.copy-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.copy-button.copied {
  border-color: #285d50;
  color: var(--success);
}

.install-card pre {
  margin: 0;
  padding: 16px;
  overflow: auto;
  color: #c8d1e2;
  font: 11.5px/1.7 var(--mono);
}

.install-card pre code {
  font: inherit;
}

.install-note {
  margin: 0;
  padding: 0 16px 14px;
  color: var(--faint);
  font-size: 10px;
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--line);
  background: rgb(8 12 22 / 55%);
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 28px 0;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.footer-inner p {
  max-width: 58ch;
  margin: 0;
  color: var(--faint);
  font-size: 11px;
}

.footer-links {
  display: flex;
  gap: 18px;
  margin-left: auto;
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 1024px) {
  .hero-grid {
    gap: 40px;
  }

  .studio {
    grid-template-columns: 1fr;
    height: auto;
  }

  .coding-panel {
    height: 720px;
  }

  .docs-panel {
    height: 640px;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .install-grid {
    gap: 40px;
  }
}

@media (max-width: 900px) {
  .site-nav {
    display: none;
  }

  .hero {
    padding: 64px 0 56px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: 15ch;
  }

  .hero-demo {
    max-width: 620px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid > div:nth-child(3) {
    border-left: 0;
    padding-left: 0;
  }

  .stats-grid > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .section {
    padding: 72px 0;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .install-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 28px, 1180px);
  }

  .header-inner {
    height: 60px;
  }

  .brand-version {
    display: none;
  }

  .hero {
    padding-top: 48px;
  }

  .hero h1 {
    font-size: clamp(2.3rem, 11vw, 3.2rem);
  }

  .hero-lead {
    font-size: 0.98rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .hero-meta {
    gap: 6px 16px;
  }

  .terminal-body {
    padding: 16px;
    font-size: 11px;
  }

  .terminal-line .string {
    display: inline;
  }

  .stats-grid > div {
    padding: 16px 14px;
  }

  .stats-grid > div:first-child {
    padding-left: 0;
  }

  .stats-grid strong {
    font-size: 14px;
  }

  .section {
    padding: 56px 0;
  }

  .section-heading h2,
  .install-copy h2 {
    font-size: 1.8rem;
  }

  .studio-toolbar {
    flex-wrap: wrap;
  }

  .select-wrap {
    width: 100%;
  }

  select {
    width: 100%;
    max-width: none;
  }

  .studio-actions {
    width: 100%;
    justify-content: space-between;
  }

  .coding-panel {
    height: 700px;
  }

  .docs-panel {
    height: 600px;
  }

  .console-section {
    flex-basis: 300px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    padding: 20px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .footer-links {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dedicated playground shares the editor, examples and docs with the homepage. */
.playground-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

body[data-page="playground"] {
  display: flex;
  height: 100dvh;
  overflow: hidden;
  flex-direction: column;
  background: #0a0f1c;
}
body[data-page="playground"] .site-header { flex: none; }
body[data-page="playground"] .header-inner { height: 52px; }
body[data-page="playground"] .brand-version { display: none; }
body[data-page="playground"] .header-inner.shell { width: calc(100% - 32px); }
body[data-page="playground"] main { display: flex; flex: 1; min-height: 0; }
body[data-page="playground"] .playground-section { flex: 1; min-width: 0; padding: 0; }
body[data-page="playground"] .playground-section > .shell { width: 100%; height: 100%; }
body[data-page="playground"] .studio {
  grid-template-columns: 230px minmax(0, 1fr) 330px;
  gap: 0;
  height: 100%;
  border-top: 1px solid var(--line);
}
body[data-page="playground"].workspace-docs-hidden .studio { grid-template-columns: 230px minmax(0, 1fr); }
body[data-page="playground"].workspace-docs-hidden .docs-panel { display: none; }
body[data-page="playground"] .coding-panel,
body[data-page="playground"] .docs-panel {
  min-height: 0;
  height: 100%;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}
body[data-page="playground"] .editor-wrap { min-height: 100px; }
body[data-page="playground"] .console-section { flex: 0 0 30%; min-height: 150px; overflow: auto; }
body[data-page="playground"] .output { min-height: 35px; }
body[data-page="playground"] .studio-toolbar { min-height: 46px; flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
body[data-page="playground"] .studio-actions { gap: 14px; flex-wrap: wrap; }
body[data-page="playground"] .studio-toolbar select { max-width: 230px; }
body[data-page="playground"] .site-nav [aria-current="page"] { color: var(--text); }

.workspace-explorer { display: flex; min-height: 0; overflow: auto; flex-direction: column; padding: 12px 10px; background: #0a0f1c; }
.workspace-explorer-heading { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 14px; gap: 8px; }
.workspace-explorer-heading h1 { margin: 0; color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.workspace-imports { display: grid; gap: 7px; }
.workspace-button { padding: 9px 10px; border: 1px solid #54458f; border-radius: 5px; background: #28203f; color: #e4dbff; font-size: 11px; text-align: left; }
.workspace-button.secondary { border-color: var(--line); background: transparent; color: var(--muted); }
.workspace-button:hover { border-color: var(--accent); }
.workspace-group { margin: 20px 6px 6px; font-size: 10px; font-weight: 650; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.workspace-file-list { display: grid; gap: 3px; }
.workspace-file-row { display: flex; align-items: center; min-width: 0; gap: 4px; }
.workspace-file-name { min-width: 0; overflow: hidden; flex: 1; padding: 7px 6px; border: 0; border-radius: 4px; background: transparent; color: var(--text-soft); font: 11px var(--mono); text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.workspace-file-name:hover, .workspace-file-name[aria-current="true"] { background: #1b2337; }
.workspace-icon { flex: none; border: 0; border-radius: 4px; padding: 4px 6px; background: transparent; color: var(--muted); font-size: 13px; }
.workspace-icon:hover { background: #27223e; color: white; }
.workspace-tabs { display: flex; flex: none; overflow-x: auto; min-height: 38px; background: #080d18; }
.workspace-tab { flex: none; padding: 10px 16px; border: 0; border-right: 1px solid var(--line); border-top: 2px solid transparent; background: transparent; color: var(--faint); font: 11px var(--mono); }
.workspace-tab[aria-selected="true"] { border-top-color: var(--accent); background: #111827; color: var(--text); }
.workspace-preview { max-height: 260px; overflow: auto; flex: none; margin-top: 14px; font-size: 10px; }
.workspace-preview:empty { display: none; }
.workspace-preview strong { display: block; overflow-wrap: anywhere; color: var(--muted); }
.workspace-preview p { color: var(--faint); }
.workspace-preview table { border-collapse: collapse; font: 10px var(--mono); }
.workspace-preview th, .workspace-preview td { padding: 5px 7px; border: 1px solid var(--line); white-space: nowrap; }
.workspace-preview th { color: var(--muted); }
.workspace-explorer-footer { margin-top: auto; padding: 24px 6px 0; color: var(--faint); font-size: 10px; line-height: 1.65; }
#workspace-message { color: var(--teal); overflow-wrap: anywhere; }
.workspace-dragging { outline: 2px dashed var(--teal); outline-offset: -4px; }

@media (max-width: 1100px) {
  body[data-page="playground"] .studio,
  body[data-page="playground"].workspace-docs-hidden .studio { grid-template-columns: 190px minmax(0, 1fr); }
  body[data-page="playground"] .docs-panel { position: fixed; top: 52px; right: 0; bottom: 0; width: min(360px, 85vw); height: auto; z-index: 60; background: #0c1221; box-shadow: -12px 0 40px #0008; }
  body[data-page="playground"] .run-button kbd { display: none; }
}
@media (max-width: 640px) {
  body[data-page="playground"] .studio,
  body[data-page="playground"].workspace-docs-hidden .studio { grid-template-columns: 135px minmax(0, 1fr); }
  .workspace-explorer { padding-inline: 6px; }
  .workspace-button { padding: 8px 6px; font-size: 10px; }
  body[data-page="playground"] .studio-actions { gap: 10px; }
  body[data-page="playground"] .studio-toolbar select { max-width: 100%; }
  body[data-page="playground"] .console-section { flex-basis: 35%; min-height: 140px; }
  body[data-page="playground"] .text-button { font-size: 10px; }
}

/* Chart viewer: history, data export and a viewport-sized expanded view. */
.chart-panel { display: flex; flex-direction: column; gap: 8px; max-height: 380px; min-height: 0; }
.chart-panel[hidden] { display: none; }
.chart-heading { flex: none; gap: 10px; margin: 0; flex-wrap: wrap; }
.chart-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.chart-history-nav { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 120px; }
.chart-history-nav select { width: 100%; max-width: 260px; min-width: 60px; padding-block: 5px; font-size: 10px; }
.chart-history-nav > button { padding: 2px 5px; font-size: 21px; line-height: 1; }
.chart-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; flex: none; }
.chart-tools select { padding: 4px 24px 4px 8px; font-size: 10px; }
.chart-tools label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.chart-tools input { accent-color: var(--accent); }
.chart-zoom-tools { display: flex; align-items: center; gap: 8px; }
.chart-tools button:disabled, .chart-history-nav button:disabled { opacity: .3; cursor: default; }
.chart-svg { min-height: 90px; flex: 1; overflow: auto; border: 1px solid var(--line); border-radius: 7px; background: #111827; }
.chart-svg[data-theme="light"] { background: white; }
.chart-svg svg { display: block; width: calc(100% * var(--chart-zoom, 1)); max-width: none; height: auto; max-height: none; }
.chart-svg circle:hover, .chart-svg circle:focus, .chart-svg rect:hover, .chart-svg rect:focus { filter: brightness(1.25); outline: none; stroke: #5eead4; stroke-width: 2px; }
.chart-info { flex: none; margin: 0; font-size: 10px; color: var(--faint); }
.console-section:has(.chart-panel:not([hidden])) { flex-basis: 420px; }
.console-section:has(.chart-panel:not([hidden])) .output { flex: 0 0 52px; }
.console-section:has(.chart-panel:not([hidden])) .chart-panel { flex: 1; max-height: none; }
body[data-page="playground"] .console-section:has(.chart-panel:not([hidden])) { flex-basis: 55%; min-height: 260px; }
.chart-panel.is-expanded {
  position: fixed;
  inset: 16px;
  z-index: 100;
  max-height: none;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #0c1221;
  box-shadow: 0 0 0 100vmax #030712db;
}
@media (max-width: 640px) {
  .chart-panel.is-expanded { inset: 6px; padding: 10px; }
  .chart-title { max-width: 120px; }
  .chart-tools { gap: 8px; }
}
