:root {
  --bg: #0a0918;
  --bg-elevated: #14122e;
  --card: rgba(255, 255, 255, 0.045);
  --card-border: rgba(255, 255, 255, 0.09);
  --glow: #4a31bd;
  --accent: #7c5cff;
  --accent-bright: #9c87ff;
  --text: #f2f1fa;
  --text-muted: #9c99c2;
  --text-faint: #6b6890;

  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
  --font-mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;

  --ease-spring: cubic-bezier(0.18, 0.92, 0.2, 1);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

img { display: block; max-width: 100%; }

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

/* Ambient background glow -- fixed, behind everything */
.glow-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(560px 420px at 50% -8%, rgba(74, 49, 189, 0.55), transparent 60%),
    radial-gradient(700px 500px at 85% 15%, rgba(124, 92, 255, 0.14), transparent 55%),
    radial-gradient(600px 500px at 10% 60%, rgba(74, 49, 189, 0.16), transparent 55%),
    var(--bg);
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 56px);
  backdrop-filter: blur(16px);
  background: rgba(10, 9, 24, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 28px);
  font-size: 0.9rem;
}

.nav-links a { text-decoration: none; color: var(--text-muted); transition: color 0.15s ease; }
.nav-links a:hover { color: var(--text); }

.nav-cta {
  color: var(--text) !important;
  background: var(--card);
  border: 1px solid var(--card-border);
  padding: 7px 14px;
  border-radius: 8px;
  font-weight: 550;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.nav-cta:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.18); }

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

.hero {
  position: relative;
  padding: clamp(48px, 9vw, 96px) clamp(20px, 5vw, 56px) 0;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

/* Ambient shader wash behind the hero copy and notch demo -- see
   colorbends-init.js for the restrained, brand-toned parameters. Never
   intercepts clicks; fades at the edges so it blends into the page glow. */
.hero-bends {
  position: absolute;
  inset: -40px -10vw 0 -10vw;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
  /* Centered on the eyebrow/headline/subhead block specifically -- the
     stage demo below already has its own bezel gradient. */
  mask-image: radial-gradient(ellipse 90% 46% at 50% 26%, #000 55%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 46% at 50% 26%, #000 55%, transparent 100%);
}

.hero > *:not(.hero-bends) {
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--text-faint);
  margin: 0 0 22px;
}

.hero h1 {
  font-size: clamp(2.75rem, 6.4vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin: 0 0 22px;
  background: linear-gradient(180deg, #ffffff 10%, #cfcaf0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 40px;
}

.cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: clamp(56px, 8vw, 96px);
}

.btn-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(10, 9, 24, 0.7);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s var(--ease-spring);
}
.btn-copy:hover { border-color: rgba(255, 255, 255, 0.22); }
.btn-copy:active { transform: scale(0.98); }
.btn-copy-prompt { color: var(--accent-bright); font-family: var(--font-mono); }
.btn-copy code { display: block; font-family: var(--font-mono); font-size: 0.85rem; min-width: 0; overflow-x: auto; white-space: nowrap; }
.btn-copy-icon { display: flex; color: var(--text-faint); transition: color 0.15s ease; }
.btn-copy.copied .btn-copy-icon { color: #6ee7a0; }

.btn-secondary {
  text-decoration: none;
  color: var(--bg);
  background: var(--text);
  padding: 13px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.15s var(--ease-spring), box-shadow 0.15s ease;
}
.btn-secondary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(124, 92, 255, 0.25); }

/* ---------- Signature: the live notch stage ---------- */

.stage {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
}

.stage-bezel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 360px;
  background:
    radial-gradient(480px 320px at 50% 0%, rgba(124, 92, 255, 0.20), transparent 65%),
    radial-gradient(360px 260px at 15% 85%, rgba(74, 49, 189, 0.22), transparent 70%),
    radial-gradient(360px 260px at 88% 80%, rgba(124, 92, 255, 0.12), transparent 70%),
    linear-gradient(180deg, #1c1a35, #100e24);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px 22px 8px 8px;
  padding: 18px 18px 0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 40px 90px -20px rgba(0, 0, 0, 0.65);
}

.stage-cam { display: none; }

.stage-caption {
  margin-top: auto;
  padding: 22px 0 26px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  transition: opacity 0.2s ease;
  min-height: 1.2em;
}

.notch {
  position: relative;
  margin: 0 auto;
  background: #000;
  border-radius: 0 0 18px 18px;
  overflow: hidden;
  width: 150px;
  height: 28px;
  transition:
    width 0.5s var(--ease-spring),
    height 0.5s var(--ease-spring),
    border-radius 0.4s var(--ease-spring);
}

.notch > div {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.notch-idle { transition-delay: 0.08s; }
.notch[data-state="idle"] .notch-idle { opacity: 0.9; }

.notch[data-state="compact"] {
  width: 300px;
  height: 40px;
  border-radius: 0 0 20px 20px;
}
.notch-compact { justify-content: space-between; padding: 0 14px; transition-delay: 0.18s; }
.notch[data-state="compact"] .notch-compact { opacity: 1; }
.compact-art {
  width: 28px; height: 28px;
  border-radius: 7px;
  object-fit: cover;
}
.waveform { display: flex; align-items: center; gap: 2px; height: 12px; }
.waveform span {
  display: block;
  width: 2px;
  border-radius: 1px;
  background: var(--accent-bright);
  height: 40%;
  animation: bar 1.1s ease-in-out infinite;
}
.waveform span:nth-child(1) { animation-delay: 0s; }
.waveform span:nth-child(2) { animation-delay: 0.12s; }
.waveform span:nth-child(3) { animation-delay: 0.24s; }
.waveform span:nth-child(4) { animation-delay: 0.36s; }
.waveform span:nth-child(5) { animation-delay: 0.18s; }
.waveform span:nth-child(6) { animation-delay: 0.3s; }
@keyframes bar {
  0%, 100% { height: 30%; }
  50% { height: 100%; }
}

.notch[data-state="expanded"] {
  width: min(680px, 90vw);
  height: 306px;
  border-radius: 20px;
}
.notch-expanded { transition-delay: 0.22s; }
.notch[data-state="expanded"] .notch-expanded { opacity: 1; }
.notch-expanded img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.stage-shadow {
  height: 46px;
  margin: 0 auto;
  max-width: 82%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55), transparent 70%);
  filter: blur(2px);
  transform: translateY(-6px);
}

@media (prefers-reduced-motion: reduce) {
  .notch, .notch > div { transition: none !important; }
  .waveform span { animation: none !important; height: 60% !important; }
}

/* ---------- Feature grid ---------- */

.features {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(96px, 12vw, 148px) clamp(20px, 5vw, 56px) 0;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--text-faint);
  text-align: center;
  margin: 0 0 40px;
}

.feature-explorer {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: stretch;
  max-width: 1080px;
  margin: 0 auto;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feature-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.feature-row:hover {
  background: rgba(255, 255, 255, 0.045);
}
.feature-row.is-active {
  background: rgba(124, 92, 255, 0.1);
  border-color: rgba(124, 92, 255, 0.3);
}

.feature-row-icon {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  margin-top: 2px;
  color: var(--accent-bright);
  background: rgba(124, 92, 255, 0.14);
}

.feature-row-text { display: flex; flex-direction: column; gap: 3px; }

.feature-row-title {
  font-size: 0.95rem;
  font-weight: 620;
  letter-spacing: -0.01em;
}
.feature-row-sub {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.feature-row:not(.is-active) .feature-row-sub {
  display: none;
}

.feature-preview {
  background: linear-gradient(180deg, #1c1a35, #100e24);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.55);
  min-height: 320px;
}

/* Reuses the hero notch's collapse/expand motion language as the
   transition between feature screenshots: shrink to a small black pill,
   then grow back out with the next image, instead of a hard cut. */
.feature-preview-notch {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  transform-origin: center top;
  transition: transform 0.28s var(--ease-spring), border-radius 0.28s ease;
}
.feature-preview-notch.is-morphing {
  transform: scale(0.24, 0.16);
  border-radius: 18px;
}

.feature-preview-notch img {
  display: block;
  width: 100%;
  border-radius: inherit;
  transition: opacity 0.16s ease;
}
.feature-preview-notch.is-morphing img {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .feature-preview-notch,
  .feature-preview-notch img { transition: none; }
}

@media (max-width: 780px) {
  .feature-explorer { grid-template-columns: 1fr; }
}

/* ---------- Philosophy ---------- */

.philosophy {
  padding: clamp(96px, 12vw, 148px) clamp(20px, 5vw, 56px);
}
.philosophy-inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}
.philosophy h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 660;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 20px;
}
.philosophy-copy {
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

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

.install {
  max-width: 620px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 80px) clamp(20px, 5vw, 56px) clamp(96px, 12vw, 140px);
  text-align: center;
}
.install h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
}

.terminal {
  text-align: left;
  background: #0d0c1f;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 70px -25px rgba(0, 0, 0, 0.6);
}
.terminal-bar {
  display: flex;
  gap: 7px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.terminal-body { padding: 20px 18px; }
.terminal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
}
.terminal-row .prompt { color: var(--accent-bright); }
.terminal-row code { display: block; flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; }
.term-copy {
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 550;
  padding: 6px 11px;
  border-radius: 7px;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.term-copy:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.22); }
.term-copy.copied { color: #6ee7a0; border-color: rgba(110, 231, 160, 0.35); }

.install-alt {
  margin: 22px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.install-alt a { color: var(--accent-bright); text-decoration: none; }
.install-alt a:hover { text-decoration: underline; }

.install-fine {
  margin: 14px 0 0;
  font-size: 0.8rem;
  color: var(--text-faint);
  line-height: 1.6;
}
.install-fine a { color: var(--text-faint); text-decoration: underline; }

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

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 32px clamp(20px, 5vw, 56px) 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-mark {
  display: flex; align-items: center; gap: 7px;
  text-decoration: none;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.footer-links { display: flex; gap: 22px; font-size: 0.85rem; }
.footer-links a { text-decoration: none; color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }
.footer-fine {
  width: 100%;
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-faint);
  text-align: center;
}

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

@media (max-width: 860px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .btn-copy, .btn-secondary { width: 100%; max-width: 100%; box-sizing: border-box; }
  .btn-copy { justify-content: flex-start; }
  .stage-bezel { padding: 14px 10px 20px; border-radius: 18px 18px 6px 6px; }
  .notch[data-state="expanded"] { width: 100%; height: 220px; }
  .site-footer { justify-content: center; text-align: center; }
  .footer-links { justify-content: center; }
}
