:root {
  --bg: #202124;
  --surface: #292a2d;
  --surface-border: #35363a;
  --surface-hover: #313236;
  --text: #ececef;
  --text-secondary: #8b8b8e;
  --text-tertiary: #55555a;
  --accent: #4ade80;
  --accent-dim: rgba(74, 222, 128, 0.1);
  --accent-border: rgba(74, 222, 128, 0.25);
  --danger: #f87171;
  --mono: "SF Mono", "Fira Code", "JetBrains Mono", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, "Helvetica Neue", sans-serif;
  --wrap: 680px;
  --gutter: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: dark; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

main.wrap { flex: 1; padding-bottom: 64px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, kbd {
  font-family: var(--mono);
  font-size: 0.92em;
}

code {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 4px;
  padding: 1px 6px;
}

pre {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 16px 0;
  line-height: 1.5;
}

pre code { background: none; border: 0; padding: 0; font-size: 13.5px; }

.ref { color: var(--accent); }

/* Header & footer */

.site-header {
  border-bottom: 1px solid var(--surface-border);
  background: rgba(32, 33, 36, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .wrap,
.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.brand:hover { text-decoration: none; }
.brand img { border-radius: 6px; }

.site-nav, .site-footer nav { display: flex; gap: 18px; }
.site-nav a, .site-footer nav a { color: var(--text-secondary); font-size: 14px; }
.site-nav a:hover, .site-footer nav a:hover { color: var(--text); text-decoration: none; }

.site-footer {
  border-top: 1px solid var(--surface-border);
  color: var(--text-tertiary);
  font-size: 13px;
}

/* Docs sub-navigation */

.docs-nav {
  border-bottom: 1px solid var(--surface-border);
  background: var(--surface);
}
.docs-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  overflow-x: auto;
}
.docs-nav a {
  display: block;
  padding: 10px 12px;
  color: var(--text-secondary);
  font-size: 14px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.docs-nav a:hover { color: var(--text); text-decoration: none; }
.docs-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

/* Prose */

main h1 { font-size: 36px; letter-spacing: -1px; line-height: 1.15; margin: 48px 0 12px; color: #fff; }
main h2 { font-size: 22px; letter-spacing: -0.4px; margin: 40px 0 10px; color: #fff; }
main h3 { font-size: 17px; margin: 28px 0 8px; color: #fff; }
main p, main ul, main ol { margin: 0 0 14px; color: var(--text); }
main ul, main ol { padding-left: 22px; }
main li + li { margin-top: 4px; }
main li:has(> input[type="checkbox"]) { list-style: none; margin-left: -22px; }
main li > input[type="checkbox"] { accent-color: var(--accent); margin-right: 8px; vertical-align: -1px; }
main .lede { font-size: 18px; color: var(--text-secondary); }
main hr { border: 0; border-top: 1px solid var(--surface-border); margin: 32px 0; }

main .table-wrap { overflow-x: auto; max-width: 100%; margin: 16px 0; }
main table { min-width: 100%; border-collapse: collapse; margin: 0; font-size: 14.5px; }
main th, main td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--surface-border); vertical-align: top; }
main th { color: var(--text-secondary); font-weight: 500; }
main td code { white-space: nowrap; }

/* Landing: hero */

.hero {
  position: relative;
  text-align: center;
  padding: 72px 0 40px;
  overflow-x: clip;
  overflow-clip-margin: 100vw;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -56px -100vw 0;
  background-image:
    linear-gradient(var(--surface-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--surface-border) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 60% 70% at 50% 30%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 30%, #000 30%, transparent 100%);
  opacity: 0.45;
  pointer-events: none;
  z-index: -1;
}
.hero-logo { width: 84px; height: 84px; margin: 0 auto 24px; }
.hero-logo img { width: 100%; height: 100%; object-fit: contain; }
.hero h1 { font-size: 52px; letter-spacing: -2px; line-height: 1; margin: 0 0 12px; }
.hero .tagline { font-size: 20px; color: var(--text-secondary); margin: 0 auto 36px; max-width: 520px; }

.terminal {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  transition: border-color 0.4s ease;
}
.terminal.is-ref { border-color: var(--accent-border); }
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--surface-border);
  color: var(--text-tertiary);
  font-size: 12px;
  font-family: var(--mono);
}
.terminal-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-border); display: inline-block; }
.terminal-bar span { margin-left: 8px; }
.terminal-body {
  padding: 18px 16px;
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.7;
  white-space: nowrap;
  overflow-x: auto;
}
.terminal-body .comment { color: var(--text-tertiary); }
.terminal-body .key { color: var(--text); }
.terminal-body .val { color: var(--danger); transition: color 0.4s ease; }
.terminal.is-swapping .val { opacity: 0.4; }
.terminal.is-ref .val { color: var(--accent); }
.terminal-body .cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  vertical-align: text-bottom;
  background: var(--text-secondary);
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .terminal-body .cursor { animation: none; }
  .terminal, .terminal-body .val { transition: none; }
}

/* Landing: install */

.install { margin: 28px auto 0; }
.install-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  padding: 12px 14px;
}
.install-box .prompt { color: var(--accent); font-family: var(--mono); }
.install-box code {
  flex: 1;
  background: none;
  border: 0;
  padding: 0;
  font-size: 14px;
  overflow-x: auto;
  white-space: nowrap;
}
.copy-btn {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.copy-btn:hover { background: var(--accent-border); }
.install-note { text-align: center; color: var(--text-tertiary); font-size: 13px; margin-top: 12px; }

/* Landing: sections */

.section { padding: 56px 0 0; }
.section-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.section h2 { margin-top: 0; }
.section .lede { margin-bottom: 20px; }

.steps { display: grid; gap: 12px; counter-reset: step; }
.step {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 18px 18px 18px 56px;
  position: relative;
  counter-increment: step;
}
.step::before {
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 18px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  display: grid;
  place-items: center;
}
.step h3 { margin: 0 0 4px; font-size: 16px; }
.step p { margin: 0; color: var(--text-secondary); font-size: 14.5px; }

.claims { list-style: none; padding: 0; display: grid; gap: 10px; }
.claims li {
  padding: 14px 16px 14px 40px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  position: relative;
  font-size: 15px;
}
.claims li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 20px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.section .more { display: inline-block; margin-top: 16px; font-size: 14px; }

@media (min-width: 640px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .step { padding: 52px 18px 18px; }
  .step::before { left: 18px; top: 16px; }
}

@media (max-width: 480px) {
  .hero { padding-top: 48px; }
  .hero h1 { font-size: 42px; }
  .hero .tagline { font-size: 17px; }
  main h1 { font-size: 30px; }
  .site-header .wrap, .site-footer .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
}

/* Landing-page demo video */
.demo-video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  margin-top: 8px;
}

/* Changelog: release video and timeline */

.page-head { margin: 48px 0 32px; }
.page-head h1 { margin: 0 0 10px; }
.page-head > p { margin: 0; font-size: 18px; color: var(--text-secondary); }

.release-video { margin: 0 0 48px; }
.release-video video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--accent-border);
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.release-video figcaption {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 14px;
}
.release-video figcaption a { margin-left: auto; font-size: 14px; }
.release-pill {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 2px 10px;
}

.timeline {
  list-style: none;
  position: relative;
  margin: 0;
  padding: 0 0 8px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--surface-border) 0 calc(100% - 80px), transparent);
}
.release {
  position: relative;
  padding-left: 40px;
  margin: 0 0 40px;
  scroll-margin-top: 72px; /* clear the sticky header when jumping to #x.y.z */
}
.release + .release { margin-top: 0; }
.release-marker {
  position: absolute;
  left: 0;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--accent-border);
}
.is-unreleased .release-marker {
  background: var(--bg);
  border: 2px solid var(--text-tertiary);
  box-shadow: 0 0 0 4px var(--bg);
}
.release-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-bottom: 14px;
}
main .release-version {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.6px;
  line-height: 1.2;
}
.release-version a { color: #fff; }
.release-version a:hover { color: var(--accent); text-decoration: none; }
.release-date {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-secondary);
}
.release-unreleased {
  color: var(--text-tertiary);
  border: 1px dashed var(--surface-border);
  border-radius: 999px;
  padding: 1px 10px;
}
.release-details > summary {
  cursor: pointer;
  list-style: none;
}
.release-details > summary::-webkit-details-marker { display: none; }
.release-details[open] > summary { margin-bottom: 12px; }
.release-count {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-tertiary);
}
.release-count::after { content: " ▸"; }
.release-details[open] .release-count::after { content: " ▾"; }
.release-details > summary:hover .release-count { color: var(--text-secondary); }
.release-body {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 18px 20px 20px;
}
.release-body > p { color: var(--text-secondary); font-size: 15.5px; }
.release-body > p:last-child, .release-body ul:last-child, .change-group:last-child ul { margin-bottom: 0; }
.release-empty { margin: 0; color: var(--text-secondary); font-size: 15px; }
.change-group + .change-group { margin-top: 20px; }
main .change-type {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.change-type::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--change-color, var(--text-tertiary));
}
.change-added { --change-color: var(--accent); }
.change-changed { --change-color: #fbbf24; }
.change-fixed { --change-color: #60a5fa; }
.change-removed { --change-color: var(--danger); }
.change-security { --change-color: #a78bfa; }
.release-body ul { list-style: disc; padding-left: 20px; font-size: 15px; }
.release-body li + li { margin-top: 8px; }
.release-body li::marker { color: var(--text-tertiary); }
