/* ============================================================
   ThinkingScript — dark, glowing, confident
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ---- Palette ---- */

:root {
  --bg: #050505;
  --bg-subtle: #0a0a0a;
  --fg: #f5f5f5;
  --fg-muted: #888;
  --fg-dim: #555;
  --accent: #e879f9;
  --accent-blue: #38bdf8;
  --accent-green: #4ade80;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.1);
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-bg-hover: rgba(255, 255, 255, 0.06);
  --code-bg: #0c0c0c;
  --code-fg: #e4e4e7;
  --code-header-bg: #141414;
  --code-header-fg: #666;
  --terminal-bg: #080808;
  --terminal-fg: #d4d4d8;
  --glow-fuchsia: rgba(232, 121, 249, 0.15);
  --glow-blue: rgba(56, 189, 248, 0.1);
  --glow-green: rgba(74, 222, 128, 0.1);
  --mono: "SF Mono", "Fira Code", "Fira Mono", "Cascadia Code", Menlo, monospace;
  --nav-height: 4rem;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

html {
  scroll-padding-top: calc(var(--nav-height) + 1rem);
}

/* ---- Reset ---- */

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

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

/* ---- Body ---- */

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---- Dot grid background ---- */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

/* ---- Nav ---- */

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.6rem 1.75rem;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: calc(100% - 4rem);
  max-width: 64rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.nav-brand {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo {
  font-size: 1.4rem;
}

/* Checkbox — always hidden */
.nav-toggle {
  display: none;
}

/* Menu button — hidden on desktop */
.nav-menu-btn {
  display: none;
  cursor: pointer;
  color: var(--fg-muted);
  font-size: 0.9rem;
  font-weight: 700;
  transition: color 0.2s;
  margin-left: auto;
}

.nav-menu-btn:hover { color: var(--fg); }

.nav-menu-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  white-space: nowrap;
}

.nav-menu-links a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  transition: color 0.2s;
}

.nav-menu-links a:hover { color: var(--fg); }

.nav-menu-icons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-menu-icons a {
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.nav-menu-icons a:hover { color: var(--fg); }
.nav-menu-icons a svg { display: block; }

/* Mobile overlay — outside nav to avoid transform containing block */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  flex-direction: column;
  padding: calc(var(--nav-height) + 1rem) 2rem 2rem;
  gap: 0.25rem;
}

.nav-overlay a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.6rem 0;
  transition: color 0.2s;
}

.nav-overlay a:hover { color: var(--fg); }

.nav-overlay-close {
  position: absolute;
  top: 1.55rem;
  right: 3rem;
  cursor: pointer;
  color: var(--fg-dim);
  font-size: 0.9rem;
  font-weight: 700;
  transition: color 0.2s;
}

.nav-overlay-close:hover { color: var(--fg); }

.nav-overlay-icons {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.nav-overlay-icons a {
  padding: 0.4rem 0;
  display: flex;
  align-items: center;
}

.nav-overlay-icons svg { display: block; }

.nav-toggle:checked ~ .nav-overlay {
  display: flex;
}

/* ---- Main ---- */

main {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 2rem 6rem;
  position: relative;
  z-index: 1;
}

/* ---- Typography ---- */

h1 {
  font-size: 3rem;
  line-height: 1.08;
  letter-spacing: -0.045em;
  margin-bottom: 1rem;
  color: var(--fg);
  font-weight: 900;
  text-wrap: balance;
}

h2 {
  font-size: 1.6rem;
  letter-spacing: -0.035em;
  margin-top: 4rem;
  margin-bottom: 0.75rem;
  color: var(--fg);
  font-weight: 800;
  text-wrap: balance;
}

h3 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--fg);
  font-weight: 700;
}

p {
  margin-bottom: 1rem;
  color: var(--fg-muted);
  font-size: 1.05rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #f0a5fc;
}

/* ---- Gradient text ---- */

.gradient-text {
  background: linear-gradient(135deg, #e879f9 0%, #38bdf8 50%, #e879f9 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 8s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

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

.hero {
  text-align: center;
  padding: calc(var(--nav-height) + 5rem) 0 4rem;
  position: relative;
}

/* Radial glow behind hero */
.hero::before {
  content: "";
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  height: 60vh;
  background: radial-gradient(ellipse at center, var(--glow-fuchsia) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.hero-logo {
  font-size: 5rem;
  margin-bottom: 2rem;
  filter: drop-shadow(0 0 40px rgba(232, 121, 249, 0.4));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hero h1 {
  font-size: 4.25rem;
  max-width: 52rem;
  margin: 0 auto 1.25rem;
  line-height: 1.1;
  letter-spacing: -0.025em;
  word-spacing: 0.08em;
  text-wrap: balance;
}

.hero-sub {
  font-size: 1.3rem;
  color: var(--fg-muted);
  max-width: 36rem;
  margin: 0 auto 2rem;
  line-height: 1.6;
  text-wrap: balance;
}

.hero-install {
  display: inline-block;
  margin: 0 auto;
  position: relative;
  background: var(--terminal-bg);
  border: 1px solid var(--border-strong);
  border-radius: 0.5rem;
  padding: 0.65rem 1.25rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  user-select: none;
  max-width: 100%;
  overflow-x: auto;
}

.hero-install:hover {
  border-color: rgba(232, 121, 249, 0.25);
  box-shadow: 0 0 30px var(--glow-fuchsia);
}

.hero-install:active {
  transform: scale(0.98);
}

.hero-install pre {
  margin: 0;
}

.hero-install code {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--terminal-fg);
  transition: opacity 0.2s;
}

.hero-install.copied code {
  opacity: 0.3;
}

.hero-install-copied {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-green);
  opacity: 0;
  transition: opacity 0.2s;
}

.copied .hero-install-copied {
  opacity: 1;
}

.page-hero {
  padding: calc(var(--nav-height) + 6rem) 0 1.5rem;
}

.page-hero hgroup h1 {
  font-size: 3rem;
  margin-bottom: 0.35rem;
}

.page-hero hgroup .hero-sub {
  font-size: 1.15rem;
  max-width: none;
  margin: 0;
}

/* ---- Code blocks ---- */

.code-block, .terminal-block {
  border-radius: 0.75rem;
  overflow: hidden;
  margin: 1.5rem 0;
  border: 1px solid var(--border-strong);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.code-block:hover, .terminal-block:hover {
  border-color: rgba(232, 121, 249, 0.2);
  box-shadow:
    0 0 30px var(--glow-fuchsia),
    0 0 60px rgba(56, 189, 248, 0.05);
}

.code-header {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.6rem 1rem;
  background: var(--code-header-bg);
  color: var(--code-header-fg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  display: inline-block;
  transition: box-shadow 0.3s;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #eab308; }
.dot.green { background: #22c55e; margin-right: 0.4rem; }

.code-block:hover .dot.red,
.terminal-block:hover .dot.red { box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
.code-block:hover .dot.yellow,
.terminal-block:hover .dot.yellow { box-shadow: 0 0 8px rgba(234, 179, 8, 0.6); }
.code-block:hover .dot.green,
.terminal-block:hover .dot.green { box-shadow: 0 0 8px rgba(34, 197, 94, 0.6); }

.code-block pre,
.terminal-block pre {
  padding: 1.25rem;
  overflow-x: auto;
  margin: 0;
}

.code-block {
  background: var(--code-bg);
}

.code-block code,
.terminal-block code {
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.65;
}

.code-block code {
  color: var(--code-fg);
}

.terminal-block {
  background: var(--terminal-bg);
}

.terminal-block .code-header {
  background: #0e0e0e;
}

.terminal-block code {
  color: var(--terminal-fg);
}

.prompt {
  color: var(--accent-green);
  user-select: none;
}

.sh { color: var(--accent-green); }
.fm { color: #a78bfa; }
.comment { color: var(--fg-dim); }
.output { color: #fbbf24; }
.tool-dot { color: var(--accent-blue); font-weight: 700; }

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

p code, li code, td code, strong code, .anatomy-part code,
.config-level code, .binary-card code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
  padding: 0.15em 0.45em;
  border-radius: 0.3rem;
}

/* ---- Example pairs ---- */

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

@media (max-width: 700px) {
  .example-pair {
    grid-template-columns: 1fr;
  }
}

/* ---- Three steps ---- */

.three-steps {
  margin: 2rem 0;
}

.step-showcase {
  margin-bottom: 4rem;
}

.step-showcase-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.step-showcase-header h2 {
  margin: 0;
}

.step-num {
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
  box-shadow: 0 0 20px var(--glow-fuchsia), inset 0 0 12px var(--glow-fuchsia);
  transition: box-shadow 0.3s;
}

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

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 3rem 0;
}

.feature-card {
  padding: 1.75rem;
  background: var(--card-bg);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.feature-card:hover {
  background: var(--card-bg-hover);
  border-color: var(--border-strong);
  box-shadow: 0 0 30px var(--glow-fuchsia);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
  display: inline-block;
  transition: transform 0.3s;
}

.feature-card:hover .feature-icon {
  transform: scale(1.15);
}

.feature-card h3 {
  margin-top: 0;
  font-weight: 700;
}

.feature-card p {
  font-size: 0.95rem;
  margin-bottom: 0;
}

@media (max-width: 700px) {
  .features {
    grid-template-columns: 1fr;
  }
}

/* ---- Pipe example ---- */

.pipe-example {
  margin: 4rem 0;
}

/* ---- Big example ---- */

.big-example {
  margin: 4rem 0;
}

/* ---- Tools grid ---- */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

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

@media (max-width: 700px) {
  .tools-grid-2 {
    grid-template-columns: 1fr;
  }
}

.tool-card {
  padding: 1.25rem;
  background: var(--card-bg);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.tool-card:hover {
  background: var(--card-bg-hover);
  border-color: var(--border-strong);
}

.tool-card code {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  background: none;
  padding: 0;
}

.tool-card p {
  font-size: 0.9rem;
  margin: 0.5rem 0;
  flex: 1;
}

.tool-card .tool-badge {
  margin-top: 0.25rem;
  align-self: flex-start;
}

.tool-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2em 0.6em;
  border-radius: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tool-safe {
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.15);
}

.tool-approve {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.15);
}

/* ---- Approval ---- */

.approval-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
}

.approval-option {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  align-items: start;
  gap: 1rem;
}

.approval-key {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-blue);
  border-radius: 0.4rem;
  border: 1px solid var(--border-strong);
  white-space: nowrap;
}

.approval-option strong {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--fg);
}

.approval-option p {
  margin: 0;
  font-size: 0.9rem;
}

/* ---- Anatomy ---- */

.anatomy-parts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.anatomy-part {
  padding: 1.25rem;
  background: var(--card-bg);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
}

.anatomy-part strong { display: block; margin-bottom: 0.25rem; color: var(--fg); }
.anatomy-part p { font-size: 0.9rem; margin: 0; }

@media (max-width: 700px) {
  .anatomy-parts {
    grid-template-columns: 1fr;
  }
}

/* ---- Loop diagram ---- */

.loop-diagram {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
  overflow-x: auto;
  padding: 1rem 0;
}

.loop-step {
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  min-width: 8rem;
  text-align: center;
  transition: all 0.3s;
}

.loop-step p { font-size: 0.8rem; margin: 0.25rem 0 0; }

.loop-step-highlight {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--glow-fuchsia);
}

.loop-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--fg);
}

.loop-arrow {
  color: var(--fg-dim);
  font-size: 1.25rem;
  min-width: 1.5rem;
  text-align: center;
}

/* ---- Config stack ---- */

.config-stack {
  display: flex;
  flex-direction: column;
  margin: 1.5rem 0;
  border: 1px solid var(--border-strong);
  border-radius: 0.75rem;
  overflow: hidden;
}

.config-level {
  padding: 0.75rem 1.25rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.config-level:last-child { border-bottom: none; }
.config-level strong { display: block; margin-bottom: 0.1rem; color: var(--fg); }
.config-level code { font-size: 0.8em; }

.config-top {
  background: rgba(232, 121, 249, 0.06);
  border-bottom-color: rgba(232, 121, 249, 0.1);
}

/* ---- Binaries ---- */

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

.binary-card {
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.binary-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 0 20px var(--glow-blue);
}

.binary-card code {
  font-size: 1.5rem;
  font-weight: 700;
  background: none;
  padding: 0;
  color: var(--accent);
}

.binary-card p {
  font-size: 0.95rem;
  margin: 0.5rem 0 0;
}

@media (max-width: 700px) {
  .binaries {
    grid-template-columns: 1fr;
  }
}

/* ---- CTA ---- */

.cta {
  padding: 5rem 0 4rem;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  position: relative;
}

.cta::before {
  content: "";
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 200%;
  height: 180%;
  background:
    radial-gradient(ellipse at center, rgba(232, 121, 249, 0.18) 0%, transparent 45%),
    radial-gradient(ellipse at center, rgba(56, 189, 248, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.cta h2 {
  font-size: 2.5rem;
  margin-top: 0;
}

.cta .terminal-block {
  max-width: 36rem;
  margin: 2rem auto;
  text-align: left;
  border-color: rgba(232, 121, 249, 0.15);
  box-shadow:
    0 0 60px rgba(232, 121, 249, 0.1),
    0 0 160px rgba(232, 121, 249, 0.07),
    0 0 300px rgba(232, 121, 249, 0.04),
    0 0 500px rgba(56, 189, 248, 0.03);
  transition: box-shadow 0.6s ease, border-color 0.6s ease;
}

.cta .terminal-block:hover {
  border-color: rgba(232, 121, 249, 0.3);
  box-shadow:
    0 0 80px rgba(232, 121, 249, 0.15),
    0 0 200px rgba(232, 121, 249, 0.1),
    0 0 400px rgba(232, 121, 249, 0.06),
    0 0 600px rgba(56, 189, 248, 0.04);
}

.cta-objections {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.cta-objections a {
  color: var(--fg-dim);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}

.cta-objections a:hover {
  color: var(--fg);
}

.cta-links {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s;
  background: var(--accent);
  color: #000;
  text-decoration: none;
}

.btn:hover {
  box-shadow: 0 0 25px var(--glow-fuchsia);
  transform: translateY(-1px);
  color: #000;
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-ghost:hover {
  background: rgba(232, 121, 249, 0.08);
  color: var(--accent);
}

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

footer {
  border-top: 1px solid var(--border);
  padding: 4rem 2rem;
  position: relative;
  z-index: 1;
  text-align: center;
}

.footer-inner {
  max-width: 52rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.2s;
}

.footer-links a:hover { color: #f0a5fc; }

.footer-dot {
  color: var(--fg-dim);
  font-size: 0.7rem;
  user-select: none;
}

footer p {
  font-size: 0.85rem;
  color: var(--fg-dim);
  margin: 0;
}

footer p a {
  color: var(--fg-muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

footer p a:hover { color: var(--fg); }

/* ---- Tables ---- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  display: block;
  overflow-x: auto;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
}

/* ---- Lists ---- */

ol, ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
  color: var(--fg-muted);
}

li {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

li strong {
  color: var(--fg);
}

/* ============================================================
   Scroll animations
   ============================================================ */

.animate-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.stagger > *:nth-child(1) { transition-delay: 0s; }
.stagger > *:nth-child(2) { transition-delay: 0.08s; }
.stagger > *:nth-child(3) { transition-delay: 0.16s; }
.stagger > *:nth-child(4) { transition-delay: 0.24s; }
.stagger > *:nth-child(5) { transition-delay: 0.32s; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .animate-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-logo, .gradient-text {
    animation: none;
  }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 640px) {
  .hero {
    padding: calc(var(--nav-height) + 2rem) 0 3rem;
  }

  .hero h1 {
    font-size: 2.75rem;
    letter-spacing: -0.02em;
  }

  .hero-sub {
    font-size: 1.1rem;
  }

  .hero-install code {
    font-size: 0.75rem;
  }

  .hero-logo {
    font-size: 3.5rem;
  }

  h1 {
    font-size: 2.25rem;
  }

  nav {
    gap: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  main {
    padding: 0 1rem 3rem;
  }

  .loop-diagram {
    flex-wrap: wrap;
    justify-content: center;
  }

  .loop-arrow {
    display: none;
  }

  /* Mobile nav: show Menu button, hide inline links/icons */
  .nav-menu-btn {
    display: block;
  }

  .nav-menu-links,
  .nav-menu-icons {
    display: none;
  }
}
