/* ==========================================================================
   Git2Tweet — marketing site
   Static CSS, navy dark theme + light theme, no build step.
   ========================================================================== */

:root {
  color-scheme: light;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f3f6fc;
  --bg-soft: #e9eff9;
  --surface: #ffffff;
  --surface-2: #eef3fb;
  --surface-3: #e3ebf8;
  --border: #d4deee;
  --border-strong: #b3c4dc;
  --text: #071226;
  --muted: #4a5b76;
  --accent: #1849c6;
  --accent-strong: #123a9e;
  --accent-soft: rgba(24, 73, 198, 0.08);
  --accent-line: rgba(24, 73, 198, 0.28);
  --accent-ink: #ffffff;
  --btn-from: #1e56e0;
  --btn-to: #123a9e;
  --glow: rgba(24, 73, 198, 0.18);
  --glow-2: rgba(37, 99, 235, 0.12);
  --rail: rgba(7, 18, 38, 0.12);
  --dot: rgba(7, 18, 38, 0.10);
  --code-bg: #050b18;
  --code-border: #223451;
  --code-text: #e7eefc;
  --code-muted: #93a6c4;
  --code-accent: #7ea6ff;
  --shadow: rgba(9, 25, 55, 0.20);
  --focus: #1849c6;
  --mark-from: #123a9e;
  --mark-to: #2457e6;
  --nav-cta-bg: #1849c6;
  --nav-cta-bg-hover: #123a9e;
  --nav-cta-fg: #ffffff;
  --nav-cta-border: rgba(24, 73, 198, 0.55);
  --nav-cta-shadow: rgba(24, 73, 198, 0.32);
  --nav-h: 74px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #05070e;
    --bg-soft: #070c17;
    --surface: #0a1120;
    --surface-2: #0d172a;
    --surface-3: #101d34;
    --border: #1b2a44;
    --border-strong: #2c4163;
    --text: #eef3fc;
    --muted: #9dadc6;
    --accent: #7ea6ff;
    --accent-strong: #a5c0ff;
    --accent-soft: rgba(126, 166, 255, 0.10);
    --accent-line: rgba(126, 166, 255, 0.30);
    --accent-ink: #04112b;
    --btn-from: #2f5fe0;
    --btn-to: #123a9e;
    --glow: rgba(37, 99, 235, 0.32);
    --glow-2: rgba(126, 166, 255, 0.12);
    --rail: rgba(238, 243, 252, 0.10);
    --dot: rgba(238, 243, 252, 0.08);
    --code-bg: #030712;
    --code-border: #1e304e;
    --code-text: #e7eefc;
    --code-muted: #8498b7;
    --code-accent: #8fb3ff;
    --shadow: rgba(0, 0, 0, 0.55);
    --focus: #7ea6ff;
    --mark-from: #123a9e;
    --mark-to: #2f5fe0;
    --nav-cta-bg: #f3f7ff;
    --nav-cta-bg-hover: #ffffff;
    --nav-cta-fg: #071226;
    --nav-cta-border: rgba(255, 255, 255, 0.7);
    --nav-cta-shadow: rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #05070e;
  --bg-soft: #070c17;
  --surface: #0a1120;
  --surface-2: #0d172a;
  --surface-3: #101d34;
  --border: #1b2a44;
  --border-strong: #2c4163;
  --text: #eef3fc;
  --muted: #9dadc6;
  --accent: #7ea6ff;
  --accent-strong: #a5c0ff;
  --accent-soft: rgba(126, 166, 255, 0.10);
  --accent-line: rgba(126, 166, 255, 0.30);
  --accent-ink: #04112b;
  --btn-from: #2f5fe0;
  --btn-to: #123a9e;
  --glow: rgba(37, 99, 235, 0.32);
  --glow-2: rgba(126, 166, 255, 0.12);
  --rail: rgba(238, 243, 252, 0.10);
  --dot: rgba(238, 243, 252, 0.08);
  --code-bg: #030712;
  --code-border: #1e304e;
  --code-text: #e7eefc;
  --code-muted: #8498b7;
  --code-accent: #8fb3ff;
  --shadow: rgba(0, 0, 0, 0.55);
  --focus: #7ea6ff;
  --mark-from: #123a9e;
  --mark-to: #2f5fe0;
  --nav-cta-bg: #f3f7ff;
  --nav-cta-bg-hover: #ffffff;
  --nav-cta-fg: #071226;
  --nav-cta-border: rgba(255, 255, 255, 0.7);
  --nav-cta-shadow: rgba(0, 0, 0, 0.5);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  scrollbar-color: var(--border-strong) var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

p { margin: 0 0 1rem; }
img { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.18em; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 32px);
}

.sr-only {
  position: absolute !important;
  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: -100px;
  left: 16px;
  z-index: 300;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- Ambient background ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1050px 700px at 50% -18%, var(--glow), transparent 64%),
    var(--bg);
}

.ambient::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 48%, transparent 92%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 48%, transparent 92%);
  opacity: 0.9;
}

.orb {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  will-change: transform;
}

.orb-a {
  width: 46vw; height: 46vw;
  min-width: 360px; min-height: 360px;
  left: -10vw; top: -12vw;
  background: radial-gradient(circle, var(--glow-2), transparent 64%);
  animation: drift-a 26s ease-in-out infinite alternate;
}

.orb-b {
  width: 38vw; height: 38vw;
  min-width: 320px; min-height: 320px;
  right: -8vw; top: 12vh;
  background: radial-gradient(circle, var(--glow), transparent 66%);
  animation: drift-b 32s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(6vw, 5vh, 0) scale(1.12); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-7vw, 8vh, 0) scale(0.92); }
}

/* ---------- Frame / rails ---------- */

.site-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1280px;
  min-height: 100vh;
  margin-inline: auto;
}

@media (min-width: 900px) {
  .site-frame { border-inline: 1px solid var(--rail); }
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  box-shadow: 0 18px 50px -44px var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  max-width: 1180px;
  min-height: var(--nav-h);
  margin-inline: auto;
  padding-inline: clamp(18px, 3.5vw, 32px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  flex: none;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand svg { display: block; flex: none; }

.nav-main {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  margin-inline: auto;
}

.nav-main a {
  display: inline-block;
  padding: 0.48rem 0.68rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.nav-main a:hover { color: var(--text); background: var(--accent-soft); }
.nav-main a[aria-current="location"] { color: var(--accent); background: var(--accent-soft); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: none;
  margin-left: auto;
}

.gh-stars,
.pypi-downloads {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 38px;
  padding: 0 0.72rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.gh-stars svg,
.pypi-downloads svg { width: 14px; height: 14px; color: var(--accent); flex: none; }
.gh-stars:hover,
.pypi-downloads:hover {
  color: var(--text);
  border-color: var(--accent-line);
  transform: translateY(-1px);
}
.gh-stars-value,
.pypi-downloads-value { min-width: 2.5em; text-align: center; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  flex: none;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}
.icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  transform: translateY(-1px);
}
.icon-btn svg { width: 16px; height: 16px; }

.theme-toggle .sun-icon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun-icon { display: block; }
:root[data-theme="dark"] .theme-toggle .moon-icon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun-icon { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon-icon { display: none; }
}

.scroll-progress {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.82rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.93rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.btn svg { width: 17px; height: 17px; flex: none; }

.btn-primary {
  background: linear-gradient(180deg, var(--btn-from), var(--btn-to));
  border-color: var(--accent-line);
  color: #ffffff;
  box-shadow:
    0 16px 34px -22px var(--glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 22px 46px -20px var(--glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: 0 10px 30px -30px var(--shadow);
}
.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line);
  color: var(--accent);
}

.btn-sm { padding: 0.54rem 0.9rem; font-size: 0.79rem; }
.btn-sm svg { width: 14px; height: 14px; }

.header-install {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-left: 0.1rem;
  padding: 0 1.05rem;
  border: 1px solid var(--nav-cta-border);
  border-radius: 999px;
  background: var(--nav-cta-bg);
  color: var(--nav-cta-fg);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 12px 26px -18px var(--nav-cta-shadow);
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.header-install:hover {
  background: var(--nav-cta-bg-hover);
  color: var(--nav-cta-fg);
  transform: translateY(-1px);
  box-shadow: 0 16px 30px -18px var(--nav-cta-shadow);
}
.header-install:active { transform: translateY(0); }

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

.hero {
  position: relative;
  padding-block: clamp(58px, 8vw, 108px) clamp(44px, 6vw, 76px);
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%; top: -320px;
  width: min(1200px, 125vw);
  height: 760px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 45%, var(--glow), transparent 66%);
  filter: blur(24px);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin-inline: auto;
  text-align: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.5rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  box-shadow: 0 12px 30px -30px var(--shadow);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  letter-spacing: 0.01em;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.kicker-dot {
  width: 6px; height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero h1 {
  max-width: 15ch;
  margin: 0 auto 1.45rem;
  font-size: clamp(2.2rem, 7vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.mark {
  display: inline-block;
  padding: 0.015em 0.14em 0.085em;
  border-radius: 0.14em;
  background: linear-gradient(135deg, var(--mark-from), var(--mark-to));
  box-shadow:
    0 24px 70px -26px var(--glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: #ffffff;
  white-space: nowrap;
}

.lede {
  max-width: 60ch;
  margin: 0 auto 2rem;
  color: var(--muted);
  font-size: clamp(1rem, 2.1vw, 1.16rem);
  line-height: 1.65;
  text-wrap: pretty;
}

.install-box {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  max-width: 480px;
  margin: 0 auto 1.15rem;
  padding: 0.55rem 0.55rem 0.55rem 1rem;
  border: 1px solid var(--code-border);
  border-radius: 14px;
  background: var(--code-bg);
  box-shadow:
    0 24px 60px -40px var(--shadow),
    0 0 0 1px var(--accent-soft);
  text-align: left;
}

.install-cmd {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-width: 0;
  padding-block: 0.2rem;
  overflow-x: auto;
  scrollbar-width: none;
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 2.5vw, 0.88rem);
  white-space: nowrap;
}
.install-cmd::-webkit-scrollbar { display: none; }
.ps1 { color: var(--code-muted); user-select: none; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  flex: none;
  min-width: 5rem;
  padding: 0.44rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}
.copy-btn:hover {
  color: var(--code-accent);
  border-color: var(--code-accent);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}
.copy-btn:focus-visible { outline-color: var(--code-accent); }
.copy-btn svg { width: 14px; height: 14px; flex: none; }
.copy-check { display: none; }
.copy-btn.copied { color: var(--code-accent); border-color: var(--code-accent); }
.copy-btn.copied .copy-copy { display: none; }
.copy-btn.copied .copy-check { display: block; }

.hero-star-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: -0.15rem auto 1.2rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.2s ease;
}
.hero-star-line:hover { color: var(--accent); }
.hero-star-glyph { width: 14px; height: 14px; flex: none; color: var(--accent); }
.hero-star-line-count { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-star-line-arrow {
  color: var(--accent);
  transition: transform 0.2s ease;
}
.hero-star-line:hover .hero-star-line-arrow { transform: translateX(2px); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.demo-wrap {
  position: relative;
  margin-top: clamp(2.6rem, 5vw, 4rem);
}

.demo-wrap::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -12% -4%;
  background: radial-gradient(ellipse at 50% 50%, var(--glow), transparent 66%);
  filter: blur(55px);
  pointer-events: none;
}

.demo {
  position: relative;
  max-width: 1010px;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: var(--surface);
  box-shadow:
    0 60px 130px -65px var(--shadow),
    0 0 0 1px var(--accent-soft);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.window-dots { display: flex; gap: 5px; flex: none; }
.window-dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
}
.window-title {
  margin-left: 0.3rem;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-media {
  aspect-ratio: 3 / 1;
  overflow: hidden;
  background: #000000;
}
.demo img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 50%;
  background: #000000;
}

.hero-kicker, .hero h1, .lede, .install-box, .hero-star-line, .hero-actions, .demo-wrap {
  animation: hero-rise 0.85s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero h1 { animation-delay: 0.06s; }
.lede { animation-delay: 0.12s; }
.install-box { animation-delay: 0.18s; }
.hero-star-line { animation-delay: 0.21s; }
.hero-actions { animation-delay: 0.24s; }
.demo-wrap { animation-delay: 0.3s; }

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.section {
  position: relative;
  padding-block: clamp(64px, 8.5vw, 112px);
  border-top: 1px solid var(--border);
}

.section--alt {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface) 42%, transparent),
    color-mix(in srgb, var(--bg-soft) 50%, transparent)
  );
}

@media (min-width: 900px) {
  .section::before,
  .section::after {
    content: "";
    position: absolute;
    top: -4px;
    width: 7px; height: 7px;
    border: 1px solid var(--border-strong);
    background: var(--bg);
    pointer-events: none;
  }
  .section::before { left: 3px; }
  .section::after { right: 3px; }
}

.section-head {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  height: 1.85rem;
  padding-inline: 0.55rem;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  margin-top: 0.42rem;
  flex: none;
}

.section h2 {
  font-size: clamp(2rem, 4.7vw, 3.3rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

/* ---------- Reveal motion ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Steps / flow / shots ---------- */

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 760px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.step {
  position: relative;
  padding: 1.6rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface-2) 42%, var(--surface)));
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}
.step::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 100% at 0 0, var(--accent-soft), transparent 58%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.step:hover {
  transform: translateY(-4px);
  border-color: var(--accent-line);
  box-shadow: 0 30px 60px -46px var(--shadow);
}
.step:hover::before { opacity: 1; }

.step-num {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.25rem; height: 2.25rem;
  margin-bottom: 1.1rem;
  border: 1px solid var(--accent-line);
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
}
.step h3 {
  position: relative;
  margin-bottom: 0.4rem;
  font-size: 1.08rem;
  letter-spacing: -0.015em;
}
.step p {
  position: relative;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.flow {
  position: relative;
  margin-top: 1rem;
  padding: clamp(0.9rem, 3vw, 1.8rem);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(80% 120% at 50% 0%, var(--accent-soft), transparent 60%),
    linear-gradient(160deg, var(--surface), var(--surface-2));
}
.flow::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(80% 120% at 50% 0%, #000, transparent 72%);
  mask-image: radial-gradient(80% 120% at 50% 0%, #000, transparent 72%);
  pointer-events: none;
}

.flow-svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.flow-svg text { font-family: var(--font-mono); }
.node {
  fill: color-mix(in srgb, var(--surface) 78%, var(--bg));
  stroke: var(--border-strong);
  stroke-width: 1;
}
.node--accent { stroke: var(--accent-line); }
.node-kicker { fill: var(--accent); font-size: 11px; letter-spacing: 0.12em; }
.node-title { fill: var(--text); font-size: 15px; font-weight: 600; }
.node-sub { fill: var(--muted); font-size: 11px; }
.arrow { stroke: var(--accent); stroke-width: 1.4; opacity: 0.7; }
.flow-mobile {
  display: none;
  width: 100%;
  max-width: 400px;
  margin-inline: auto;
}

.shots {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}

.shot {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--code-bg);
  box-shadow: 0 24px 50px -46px var(--shadow);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.shot:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: 0 36px 70px -48px var(--shadow);
}
.shot .window-bar {
  border-bottom-color: var(--code-border);
  background: rgba(255, 255, 255, 0.03);
}
.shot .window-title { color: var(--code-muted); }
.shot .window-dots span { background: rgba(255, 255, 255, 0.22); }
.shot img {
  display: block;
  width: 100%; height: auto;
  margin: auto;
  background: var(--code-bg);
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.shot:hover img { transform: scale(1.012); }

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

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 1rem;
  container-type: inline-size;
}

.feature {
  position: relative;
  padding: 1.45rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface-2) 30%, var(--surface)));
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}
.feature::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 100% at 85% 0%, var(--accent-soft), transparent 55%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.feature:hover {
  transform: translateY(-4px);
  border-color: var(--accent-line);
  box-shadow: 0 34px 64px -50px var(--shadow);
}
.feature:hover::before { opacity: 1; }

.icon-tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.55rem; height: 2.55rem;
  margin-bottom: 1.05rem;
  border: 1px solid var(--accent-line);
  border-radius: 11px;
  background: linear-gradient(145deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 30%, transparent));
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.3s ease;
}
.feature:hover .icon-tile { transform: scale(1.06) rotate(-2deg); }
.icon-tile svg { width: 20px; height: 20px; }

.feature h3 {
  position: relative;
  margin-bottom: 0.38rem;
  font-size: 1rem;
  line-height: 1.35;
  letter-spacing: -0.012em;
}
.feature p {
  position: relative;
  margin: 0;
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.6;
}

@container (min-width: 806px) {
  .feature--wide {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    grid-column: 1 / -1;
  }
  .feature--wide .icon-tile { flex: none; margin-bottom: 0; }
  .feature--wide h3 { margin-bottom: 0.12rem; }
}

/* ---------- Inline code ---------- */

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
}
.feature code, .notes code, .privacy-panel code, .faq-answer code {
  padding: 0.12em 0.34em;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
  white-space: nowrap;
}
.section--alt .feature code,
.section--alt .faq-answer code { background: var(--bg); }

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

.install-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}
.install-grid > * { min-width: 0; }
.quickstart-wrap { min-width: 0; }

.tablist {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}

.tab {
  appearance: none;
  padding: 0.48rem 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.4;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--border), 0 4px 12px -7px var(--shadow);
}

.tabpanel { margin-top: 0.9rem; animation: panel-in 0.32s ease both; }
.tabpanel:focus-visible { outline-offset: 6px; }
.tabpanel[hidden] { display: none !important; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.code-block {
  overflow: hidden;
  border: 1px solid var(--code-border);
  border-radius: 14px;
  background: var(--code-bg);
  box-shadow: 0 26px 60px -50px var(--shadow);
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem 0.45rem 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}
.code-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--code-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}
.code-title::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--code-accent);
  box-shadow: 0 0 0 3px rgba(126, 166, 255, 0.12);
}
.code-block pre {
  margin: 0;
  padding: 1.05rem;
  overflow-wrap: anywhere;
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.85;
  tab-size: 2;
}
.code-block code { font-family: inherit; font-size: inherit; }
.line {
  display: block;
  padding-left: 1.2em;
  text-indent: -1.2em;
  white-space: pre-wrap;
}
.line--comment { padding-left: 1.2em; text-indent: 0; margin-top: 0.15rem; }
.comment { color: var(--code-muted); }
.str { color: var(--code-text); }

.config-block { margin-top: 1rem; }

.notes {
  margin: 1.8rem 0 0;
  padding: 1.4rem 0 0;
  border-top: 1px solid var(--border);
  list-style: none;
  display: grid;
  gap: 0.72rem;
}
.notes li {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}
.notes strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.77rem;
  font-weight: 600;
}
.notes code {
  background: var(--surface-2);
}

.quickstart-label {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

/* ---------- Privacy ---------- */

.privacy-panel {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  overflow: hidden;
  padding: clamp(1.6rem, 4.5vw, 3.2rem);
  border: 1px solid var(--accent-line);
  border-radius: 22px;
  background:
    radial-gradient(120% 100% at 100% 0%, var(--accent-soft), transparent 52%),
    linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface-2) 28%, var(--surface)));
  box-shadow: 0 40px 100px -70px var(--shadow);
}
.privacy-panel::before {
  content: "";
  position: absolute;
  top: -220px; right: -120px;
  width: 460px; height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 66%);
  filter: blur(40px);
  opacity: 0.65;
  pointer-events: none;
}
.privacy-copy { position: relative; }
.privacy-copy .section-index { margin-bottom: 1.2rem; }
.privacy-panel h2 {
  max-width: 18ch;
  font-size: clamp(1.65rem, 3.6vw, 2.55rem);
  line-height: 1.04;
}
.privacy-panel p {
  max-width: 58ch;
  margin: 1.15rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.4rem;
  padding: 0.38rem 0.75rem;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 600;
}
.privacy-badge svg { width: 14px; height: 14px; }

.excluded {
  position: relative;
  align-self: center;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg) 82%, var(--surface));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.excluded-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.9rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.excluded-label svg { width: 16px; height: 16px; }
.excluded ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.excluded li code {
  display: inline-block;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.77rem;
}

/* ---------- FAQ ---------- */

.faq-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.2rem;
  align-items: start;
}
.faq-intro { position: relative; }
.faq-intro .section-index { margin-bottom: 1.2rem; }
.faq-intro h2 {
  font-size: clamp(2.2rem, 5.2vw, 3.8rem);
  line-height: 0.98;
}
.faq-note {
  max-width: 30ch;
  margin: 1.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.faq-note a { color: var(--text); text-decoration-color: var(--accent-line); }
.faq-note a:hover { color: var(--accent); }

.faq-list { border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 0.2rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  cursor: pointer;
  list-style: none;
  transition: color 0.2s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { content: ""; }
.faq-item summary:hover { color: var(--accent); }

.faq-toggle {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 1.6rem; height: 1.6rem;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--accent);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.faq-item summary:hover .faq-toggle { border-color: var(--accent-line); background: var(--accent-soft); }
.faq-toggle::before,
.faq-toggle::after {
  content: "";
  position: absolute;
  border-radius: 1px;
  background: currentColor;
}
.faq-toggle::before { width: 9px; height: 1.5px; }
.faq-toggle::after { width: 1.5px; height: 9px; transition: transform 0.22s ease; }
.faq-item[open] .faq-toggle::after { transform: rotate(90deg); }

.faq-answer {
  max-width: 74ch;
  padding: 0 0.2rem 1.4rem;
  color: var(--muted);
  font-size: 0.95rem;
  animation: answer-in 0.3s ease both;
}
.faq-answer p { margin: 0; }
@keyframes answer-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Star callout ---------- */

.star-cta {
  position: relative;
  padding-block: clamp(10px, 2vw, 20px) clamp(48px, 7vw, 88px);
}

.star-cta-inner {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 1.5rem);
  padding: clamp(1.15rem, 2.6vw, 1.6rem) clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--accent-line);
  border-radius: 20px;
  background:
    radial-gradient(90% 130% at 0% 0%, var(--accent-soft), transparent 58%),
    linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface-2) 32%, var(--surface)));
  box-shadow: 0 34px 90px -72px var(--shadow);
}

.star-cta-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px; height: 42px;
  border: 1px solid var(--accent-line);
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
}
.star-cta-icon svg { width: 19px; height: 19px; }
.star-cta-copy { min-width: 0; }
.star-cta-copy h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.star-cta-copy p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.star-cta-btn {
  flex: none;
  margin-left: auto;
  padding: 0.72rem 1.1rem;
  font-size: 0.86rem;
}

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

.site-footer {
  position: relative;
  padding-block: 3rem 1.8rem;
  overflow: hidden;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 45%, transparent), var(--bg));
}
.site-footer::before {
  content: "";
  position: absolute;
  left: 50%; bottom: -240px;
  width: 800px; height: 400px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow-2), transparent 68%);
  filter: blur(50px);
  opacity: 0.55;
  pointer-events: none;
}

.footer-top {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.footer-brand p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.35rem;
  max-width: 440px;
  padding-top: 0.3rem;
}
.footer-nav a {
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-nav a:hover { color: var(--accent); }

.footer-bottom {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}
.footer-bottom a { color: var(--muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--accent); }

.visit-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}
.visit-chip svg { width: 14px; height: 14px; color: var(--accent); flex: none; }
.visit-chip strong { color: var(--text); font-weight: 600; }
.visit-chip[data-state="error"] strong { color: var(--muted); }

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

@media (min-width: 700px) {
  .shots { grid-template-columns: 1.25fr 1fr; }
}

@media (min-width: 800px) {
  .privacy-panel { grid-template-columns: 1.35fr 0.65fr; align-items: center; }
}

@media (min-width: 900px) {
  .faq-layout { grid-template-columns: 0.82fr 1.18fr; gap: clamp(2.5rem, 6vw, 5rem); }
  .faq-intro { position: sticky; top: calc(var(--nav-h) + 32px); }
}

@media (min-width: 960px) {
  .install-grid { grid-template-columns: 1.06fr 0.94fr; gap: 2.5rem; }
  .quickstart-wrap { position: sticky; top: calc(var(--nav-h) + 24px); }
}

@media (max-width: 1000px) {
  .nav-main a { padding-inline: 0.55rem; font-size: 0.8rem; }
}

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

@media (max-width: 900px) {
  .flow {
    max-width: 560px;
    margin-inline: auto;
  }
  .flow-wide { display: none; }
  .flow-mobile { display: block; }
}

@media (max-width: 760px) {
  .header-install { display: none; }
}

@media (max-width: 600px) {
  .demo-media { aspect-ratio: 16 / 9; }
  .demo img { object-fit: contain; }
}

@media (max-width: 600px) {
  .gh-stars-value,
  .pypi-downloads-value { min-width: 0; }
  .header-inner { gap: 0.65rem; }
  .header-actions { gap: 0.35rem; }
  .gh-stars,
  .pypi-downloads { padding-inline: 0.6rem; }
}

@media (max-width: 640px) {
  .star-cta-inner { flex-wrap: wrap; align-items: flex-start; }
  .star-cta-copy { flex: 1 1 220px; }
  .star-cta-btn { width: 100%; margin-left: 0; }
}

@media (max-width: 420px) {
  :root { --nav-h: 64px; }
  .copy-label { font-size: 0.67rem; }
  .footer-bottom { align-items: flex-start; flex-direction: column; }
  .section-head { gap: 0.7rem; }
  .section-index { min-width: 2.15rem; }
}

/* ---------- Reduced motion ---------- */

@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;
  }
  .js .reveal { opacity: 1; transform: none; }
  .orb { animation: none; }
  .tabpanel, .faq-answer { animation: none; }
}
