:root {
  --bg: #0f1419;
  --bg-2: #16181c;
  --bg-3: #1c1f26;
  --border: #2f3336;
  --border-soft: #21262d;
  --text: #e7e9ea;
  --muted: #71767b;
  --muted-2: #8b93a1;
  --accent: #1d9bf0;
  --accent-warm: #f91880;
  --accent-good: #00ba7c;
  --accent-dim: rgba(29, 155, 240, 0.12);

  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", "JetBrains Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;

  --rhythm: clamp(1.25rem, 3.5vw, 2rem);
  --measure: 64ch;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(1200px 500px at 50% -100px, rgba(29, 155, 240, 0.06), transparent 70%),
    var(--bg);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease;
}

a:hover { border-bottom-color: var(--accent); }

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

kbd {
  display: inline-block;
  padding: 0 .35em;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-2);
  font-size: .85em;
  color: var(--text);
}

.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 4.5rem) clamp(1rem, 4vw, 1.75rem) 3rem;
}

/* ─── hero ─────────────────────────────────── */

.hero {
  text-align: center;
  margin-bottom: calc(var(--rhythm) * 2);
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.wordmark {
  font-size: clamp(2.5rem, 9vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 .5rem;
  line-height: 1;
  display: inline-block;
}

.wordmark::after {
  content: "▋";
  color: var(--accent);
  font-weight: 400;
  font-size: .55em;
  margin-left: .1em;
  vertical-align: 0.18em;
  animation: blink 1.1s steps(1, end) infinite;
}

.tagline {
  color: var(--muted-2);
  font-size: clamp(.95rem, 2.2vw, 1.05rem);
  margin: 0 auto var(--rhythm);
  max-width: 52ch;
  text-wrap: balance;
}

/* ─── install block ────────────────────────── */

.install {
  margin: 0 auto calc(var(--rhythm) * .8);
  text-align: center;
}

.cmd {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
  margin: 0;
  padding: .7rem 1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .92rem;
  line-height: 1.4;
  white-space: nowrap;
  text-align: left;
  max-width: 100%;
  overflow-x: auto;
}

.cmd .prompt { color: var(--accent); user-select: none; margin-right: .4em; }
.cmd .url { color: var(--text); }

.copy {
  flex: 0 0 auto;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: .95rem;
  padding: .2rem .45rem;
  cursor: pointer;
  transition: color 120ms, border-color 120ms, background 120ms;
}

.copy:hover { color: var(--text); border-color: var(--muted); }
.copy.ok { color: var(--accent-good); border-color: var(--accent-good); }

.sub {
  color: var(--muted);
  font-size: .8rem;
  margin: .6rem 0 0;
  text-align: center;
}

.sub code {
  background: var(--bg-2);
  padding: .08em .4em;
  border-radius: 4px;
  border: 1px solid var(--border-soft);
  color: var(--text);
}

/* ─── action buttons ───────────────────────── */

.actions {
  display: flex;
  justify-content: center;
  gap: .6rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: .5rem .9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--bg-2);
  font-size: .88rem;
  transition: border-color 120ms, color 120ms, background 120ms, transform 120ms;
}

.btn:hover {
  border-color: var(--muted);
  border-bottom-color: var(--muted);
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.btn.primary:hover { background: rgba(29, 155, 240, 0.18); }

.hero { --hero-dim: 1; }

.hero:has(.stat:hover),
.hero:has(.stat:focus-within),
.hero:has(.stat.is-open) {
  --hero-dim: 0.18;
}

.hero > *:not(.stat) {
  opacity: var(--hero-dim);
  transition: opacity 260ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .hero > *:not(.stat) { transition: none; }
}

.stat {
  position: relative;
  display: inline-block;
  margin: .9rem 0 0;
  font-size: .78rem;
  color: var(--muted);
  letter-spacing: .02em;
}

.stat-trigger {
  appearance: none;
  background: transparent;
  border: 0;
  padding: .25em .55em;
  margin: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  cursor: help;
  border-radius: 6px;
  transition: background-color 140ms ease, color 140ms ease;
}

.stat-trigger:hover,
.stat-trigger:focus-visible,
.stat.is-open .stat-trigger {
  background: var(--accent-dim);
  color: var(--text);
  outline: none;
}

.stat-trigger:focus-visible {
  box-shadow: 0 0 0 1px var(--accent);
}

.stat-trigger strong {
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-right: .35em;
}

.stat-label {
  opacity: .85;
  border-bottom: 1px dotted currentColor;
  padding-bottom: 1px;
}

.stat-popover {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: min(340px, calc(100vw - 2rem));
  padding: .9rem 1rem .8rem;
  background:
    linear-gradient(180deg, rgba(29, 155, 240, 0.05), transparent 80px),
    var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow:
    0 18px 40px -12px rgba(0, 0, 0, .65),
    0 2px 8px -2px rgba(0, 0, 0, .4),
    inset 0 1px 0 rgba(255, 255, 255, .03);
  font-size: .76rem;
  text-align: left;
  color: var(--text);
  letter-spacing: 0;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    visibility 180ms;
  z-index: 10;
}

.stat-popover::after,
.stat-popover::before {
  content: '';
  position: absolute;
  left: 50%;
  border: 7px solid transparent;
}

.stat-popover::after {
  top: 100%;
  transform: translateX(-50%);
  border-top-color: var(--bg-2);
}

.stat-popover::before {
  top: calc(100% + 1px);
  transform: translateX(-50%);
  border-top-color: var(--border);
  border-width: 8px;
  margin-left: -1px;
}

.stat:hover .stat-popover,
.stat:focus-within .stat-popover,
.stat.is-open .stat-popover {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.stat-popover-title {
  display: block;
  color: var(--accent);
  font-weight: 600;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}

.stat-popover-body {
  display: block;
  color: var(--muted-2);
  line-height: 1.55;
}

.stat-popover-body code {
  color: var(--text);
  background: var(--bg-3);
  padding: 0 .35em;
  border-radius: 3px;
  font-size: .92em;
}

.stat-popover-rows {
  display: block;
  margin: .8rem 0 .65rem;
  padding: .6rem 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.stat-popover-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: .12rem 0;
}

.stat-popover-key {
  color: var(--muted);
}

.stat-popover-val {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.stat-popover-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .68rem;
  color: var(--muted);
}

.stat-popover-note { opacity: .85; }

@media (max-width: 480px) {
  .stat-popover {
    max-width: calc(100vw - 1.5rem);
  }
  .stat-popover-foot {
    flex-direction: column;
    gap: .2rem;
  }
}

/* ─── screenshot carousel ──────────────────── */

.shot {
  margin: calc(var(--rhythm) * 1.2) auto 0;
  position: relative;
  width: min(1200px, calc(100vw - 2rem));
  margin-left: calc(50% - min(600px, calc(50vw - 1rem)));
  margin-right: calc(50% - min(600px, calc(50vw - 1rem)));
}

.slides {
  position: relative;
  display: grid;
  grid-template-areas: "stack";
  width: 100%;
  aspect-ratio: 90 / 53;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-2);
  isolation: isolate;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.02),
    0 20px 60px -20px rgba(0, 0, 0, 0.6);
}

.slide {
  grid-area: stack;
  margin: 0;
  min-width: 0;
  min-height: 0;
  opacity: 0;
  transition: opacity 420ms ease;
  pointer-events: none;
}

.slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(15, 20, 25, 0.72);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 160ms ease, border-color 160ms, background 160ms, transform 160ms;
  z-index: 2;
}

.slide-nav.prev { left: .6rem; }
.slide-nav.next { right: .6rem; }

.shot:hover .slide-nav,
.shot:focus-within .slide-nav {
  opacity: 1;
}

.slide-nav:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(29, 155, 240, 0.14);
}

.slide-nav:active { transform: translateY(-50%) scale(0.94); }

.slide-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(29, 155, 240, 0.08);
  z-index: 2;
  pointer-events: none;
}

.slide-progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width linear;
  will-change: width;
}

.slide-caption {
  margin-top: .9rem;
  color: var(--muted-2);
  font-size: .85rem;
  text-align: center;
  min-height: 1.3em;
}

.slide-dots {
  margin-top: .7rem;
  display: flex;
  justify-content: center;
  gap: .4rem;
}

.slide-dots button {
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  border: 0;
  background: var(--border);
  padding: 0;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.slide-dots button:hover { background: var(--muted); }

.slide-dots button[aria-selected="true"] {
  background: var(--accent);
  transform: scale(1.25);
}

.shot.is-paused .slide-progress-fill {
  background: var(--muted);
}

.shot figcaption code {
  background: var(--bg-2);
  padding: .08em .45em;
  border-radius: 4px;
  border: 1px solid var(--border-soft);
  color: var(--accent-warm);
}

/* ─── features ─────────────────────────────── */

.features { margin-top: calc(var(--rhythm) * 1.5); }

.features h2 {
  font-size: .85rem;
  font-weight: 400;
  letter-spacing: .04em;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.features dl {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 1rem 1.5rem;
  margin: 0;
}

.features .feat {
  display: contents;
}

.features dt {
  color: var(--accent);
  font-weight: 500;
  padding-top: 2px;
}

.features dd {
  margin: 0;
  color: var(--text);
  padding-bottom: .75rem;
  border-bottom: 1px dashed var(--border-soft);
}

.features .feat:last-child dd { border-bottom: 0; padding-bottom: 0; }

/* ─── pull quote ───────────────────────────── */

.quote {
  margin: calc(var(--rhythm) * 1.8) auto calc(var(--rhythm) * 1.2);
  text-align: center;
}

.quote blockquote {
  margin: 0 auto;
  max-width: 44ch;
  color: var(--muted-2);
  font-style: italic;
  font-size: 1rem;
  border-left: 2px solid var(--accent);
  padding: .2rem 0 .2rem 1.2rem;
  text-align: left;
  display: inline-block;
}

.quote blockquote p { margin: 0; }

/* ─── footer ───────────────────────────────── */

.foot {
  margin-top: calc(var(--rhythm) * 1.5);
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-soft);
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
}

.foot a { color: var(--muted-2); }
.foot a:hover { color: var(--text); border-bottom-color: var(--muted); }
.foot .dot { margin: 0 .5rem; color: var(--border); }
.foot .muted { color: var(--muted); }

/* ─── small viewports ──────────────────────── */

@media (max-width: 600px) {
  .features dl {
    grid-template-columns: 1fr;
    gap: .5rem 0;
  }
  .features dt { padding-top: 0; }
  .features dd {
    padding-bottom: 1rem;
    margin-bottom: 0;
  }
}

@media (max-width: 480px) {
  .cmd {
    font-size: .78rem;
    padding: .6rem .8rem;
    gap: .6rem;
  }
}

@media (max-width: 360px) {
  .cmd {
    font-size: .72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wordmark::after { animation: none; }
  .btn:hover { transform: none; }
}
