:root {
  --bg: #0b0c0f;
  --bg-elevated: #141519;
  --text: #f2f2f4;
  --text-muted: #9a9ba3;
  --border: #24252b;
  --accent: #7c8cff;
  --accent-text: #0b0c0f;
  --radius: 14px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf9f7;
    --bg-elevated: #ffffff;
    --text: #16171a;
    --text-muted: #5c5d66;
    --border: #e6e5e1;
    --accent: #4a55d6;
    --accent-text: #ffffff;
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; }

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; display: block; }

/* icon-512.png is solid black on transparent, invisible on the dark
   background that's the default theme. Invert it to white by default and
   un-invert under the light theme, same dark-first pattern as the color
   tokens above. */
.brand img, .hero img.icon { filter: invert(1); }
@media (prefers-color-scheme: light) {
  .brand img, .hero img.icon { filter: none; }
}
nav.site a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  margin-left: 22px;
}
nav.site a:hover { color: var(--text); }

.hero { padding: 64px 0 48px; text-align: center; }
.hero img.icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 12px 32px rgba(0,0,0,0.25); }
.hero h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.15; margin: 28px 0 14px; letter-spacing: -0.02em; }
.hero p.lede { color: var(--text-muted); font-size: 18px; max-width: 560px; margin: 0 auto 32px; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
}
.btn-primary { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.btn-secondary { color: var(--text); background: transparent; }
.req { color: var(--text-muted); font-size: 13px; margin-top: 14px; }

.platform-links { color: var(--text-muted); font-size: 13px; margin-top: 10px; }
.platform-links a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.platform-links a:hover { color: var(--text); }

.install {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin-top: 18px;
  padding: 6px 6px 6px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.install code {
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--text);
}
/* Shared by the hero install line and the docs command blocks. */
button.copy {
  flex: none;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 10px;
  cursor: pointer;
}
button.copy:hover { color: var(--text); border-color: var(--text-muted); }
button.copy.copied { color: var(--accent); border-color: var(--accent); }

/* A command block with its own copy button (docs pages). */
main.prose .cmd {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 0 0 12px;
}
main.prose .cmd pre {
  flex: 1;
  min-width: 0;
  margin: 0;
}
main.prose .cmd pre code { white-space: pre; }
main.prose .cmd button.copy {
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 0 14px;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 56px 0;
}
.feature { background: var(--bg-elevated); padding: 26px 22px; }
.feature h3 { font-size: 15px; margin: 0 0 8px; }
.feature p { font-size: 14px; color: var(--text-muted); margin: 0; }

.story-showcase { margin: 56px 0; }
.story-showcase .section-title { margin-bottom: 20px; }
.story-viewport {
  position: relative;
  height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: center;
  margin: 0 -24px;
}
.story-track {
  display: flex;
  gap: 24px;
  padding-inline: max(24px, calc((100vw - 900px) / 2));
  will-change: transform;
}
.story-card {
  flex: 0 0 auto;
  height: min(68vh, 520px);
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  position: relative;
  transition: box-shadow 0.2s ease;
}
.story-card:hover { box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
.story-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.story-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,12,15,0) 45%, rgba(11,12,15,0.82) 100%);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: white;
}
.story-overlay h4 { font-size: 16px; margin: 0 0 4px; font-weight: 600; }
.story-overlay p { font-size: 13px; margin: 0; opacity: 0.9; }
.story-progress {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  width: min(240px, 60vw);
  height: 3px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}
.story-progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}
.story-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 12px;
  transition: opacity 0.3s ease;
  animation: pulse-hint 2s ease-in-out infinite;
}
@keyframes pulse-hint {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Below 769px, or when the visitor asked for less motion: no pin, no
   scroll-jacking. Plain horizontal swipe strip with snap. */
@media (max-width: 768px), (prefers-reduced-motion: reduce) {
  .story-viewport {
    height: auto;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .story-viewport::-webkit-scrollbar { display: none; }
  .story-track {
    transform: none !important;
    padding-inline: 24px;
  }
  .story-card {
    height: auto;
    width: min(80vw, 420px);
    scroll-snap-align: center;
  }
  .story-progress { display: none; }
  .story-hint { animation: none; opacity: 0.7; }
}

.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin: 0 0 16px; }

.faq { margin: 56px 0; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  padding: 4px 22px;
  margin-bottom: 10px;
}
.faq-item summary {
  padding: 16px 0;
  font-size: 15px;
  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(--text-muted); font-weight: 400; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { font-size: 14px; color: var(--text-muted); margin: 0 0 18px; }
.faq-item p:not(:last-of-type) { margin-bottom: 10px; }
.faq-item a { color: var(--accent); }
.faq-item code {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  vertical-align: bottom;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 7px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--text);
  white-space: nowrap;
}

/* Prose pages (docs, changelog) */
main.prose { padding: 48px 0 32px; }
main.prose h1 { font-size: clamp(26px, 4vw, 36px); letter-spacing: -0.02em; margin: 0 0 8px; }
main.prose > p.intro { color: var(--text-muted); font-size: 16px; margin: 0 0 40px; }
main.prose section { margin-bottom: 36px; }
main.prose h2 { font-size: 19px; margin: 0 0 10px; }
main.prose h3 { font-size: 15px; margin: 20px 0 6px; }
main.prose p { font-size: 15px; margin: 0 0 12px; }
main.prose p, main.prose li { color: var(--text); }
main.prose ul { margin: 0 0 12px; padding-left: 20px; }
main.prose ol { margin: 0 0 16px; padding-left: 22px; }
main.prose ol li { margin-bottom: 10px; padding-left: 2px; }
main.prose ol li::marker { color: var(--text-muted); font-variant-numeric: tabular-nums; }
main.prose li { font-size: 15px; margin-bottom: 6px; }
main.prose kbd {
  display: inline-block;
  min-width: 1.6em;
  margin: 0 1px;
  padding: 1px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  color: var(--text);
}
main.prose code {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
main.prose pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 12px;
}
main.prose pre code { border: none; padding: 0; background: none; }
main.prose .card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}

/* Changelog */
.release { border-bottom: 1px solid var(--border); padding: 28px 0; }
.release:first-of-type { padding-top: 0; }
.release:last-of-type { border-bottom: none; }
.release-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.release-head h2 { font-size: 18px; margin: 0; }
.release-date { color: var(--text-muted); font-size: 13px; }
.release-body { font-size: 14px; color: var(--text-muted); }
.release-body p { margin: 0 0 10px; }
.release-body p:last-child { margin-bottom: 0; }
.release-body ul { margin: 0 0 10px; padding-left: 20px; }
.release-body li { margin-bottom: 4px; }
.release-body strong { color: var(--text); }
.release-body a { color: var(--accent); }

footer.site {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 28px 0 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
}
footer.site a { text-decoration: none; color: var(--text-muted); margin-right: 18px; }
footer.site a:hover { color: var(--text); }
