:root {
  --paper: oklch(0.96 0.01 85);
  --panel: oklch(0.99 0.005 85);
  --ink: oklch(0.22 0.015 50);
  --ink-soft: oklch(0.52 0.02 50);
  --accent: oklch(0.52 0.12 35);
  --brand: #c1502e;
  --brown: #000000;
  --line-faint: color-mix(in oklch, var(--ink) 8%, transparent);
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-pill: 999px;
  --mono: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --page: 1120px;
  --page-gutter: 22px;
  --section-pad-y: 88px;
  --section-kicker-gap: 12px;
  --section-title-gap: 36px;
  --section-block-gap: 32px;

  /* Shared type scale — same role = same size across sections */
  --text-kicker: 12px;
  --text-label: 12px;
  --text-h2: clamp(1.5rem, 3vw, 2rem);
  --text-body: 14px;
  --text-body-lh: 1.55;
  --text-card-title: 12px;
  /* Mono reads optically large; slight em shrink so code matches body */
  --text-code: 0.875em;
}

/* Shared centered content column for all major page sections */
.page {
  width: min(100%, var(--page));
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
  max-width: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  text-wrap: balance;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

a {
  color: inherit;
}

code {
  font-family: var(--mono);
  font-size: var(--text-code);
}

/* ---------- interactions ---------- */

.btn-interactive {
  transition: transform 120ms ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-interactive:hover {
  transform: scale(1.04);
}

.btn-interactive:active {
  transform: scale(0.94);
}

/* Sections fade + rise into place the first time they cross into view
   (see app.js's IntersectionObserver); .is-visible is added once and
   never removed, so scrolling back up doesn't re-hide content. */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.sparks {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 5;
}

.spark {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--spark-size);
  height: var(--spark-size);
  margin: calc(var(--spark-size) / -2) 0 0 calc(var(--spark-size) / -2);
  border-radius: 50%;
  animation: spark-burst 420ms ease-out both;
}

@keyframes spark-burst {
  0% {
    transform: translate(0, 0) scale(0.3);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(1);
    opacity: 0;
  }
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  background: transparent;
  color: var(--ink);
}

.btn-label,
.btn-icon {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.btn-primary {
  color: var(--paper);
}

.btn-secondary {
  color: var(--ink);
}

.btn.small {
  width: 100%;
  color: var(--paper);
  margin-top: 2px;
}

/* ---------- 1. Fold (viewport) ---------- */

.fold {
  /* Leave room so section 2 peeks on typical laptop viewports */
  min-height: 0;
  padding-block: 16px 48px;
  display: flex;
  flex-direction: column;
}

/* Sticky nav bar - own full-width background + wobble divider so it reads
   as a fixed shelf above the rest of the page, not a see-through overlay. */
.site-header-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  padding-top: 14px;
  margin-bottom: 72px;
}

.fold-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.header-divider {
  position: relative;
  width: 100%;
  height: 9px;
  margin-top: -2px;
  pointer-events: none;
}

.wordmark {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 28px 12px 24px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
  color: var(--ink);
}

/* The brand "seed" - orange pip that echoes the library's seeded PRNG. */
.brand-seed {
  position: relative;
  z-index: 1;
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  /* Flat fallback before JS; SVG fill replaces this with a wobbly pip. */
  background: var(--brand);
  flex-shrink: 0;
  overflow: visible;
}

.brand-seed:has(.wobble-border-svg) {
  background: transparent;
}

.wordmark-label {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 0;
  font-size: 16px;
  line-height: 28px;
  /* Solid fill only - no faux outline around the letterforms. */
  -webkit-text-stroke: 0;
  text-stroke: 0;
  paint-order: fill;
  font-variation-settings: 'SOFT' 0, 'WONK' 0;
}

.fold-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--ink-soft);
}

.nav-quiet {
  text-decoration: none;
}

.nav-quiet:hover {
  color: var(--ink);
}

.wobble-hover-text {
  transition: filter 80ms ease;
}

.wobble-hover-text.is-wobbling,
.wordmark-label.is-wobbling {
  filter: url(#wobble-text-filter);
}

/* Always-on hero phrase; uses its own SVG filter (see #wobble-text-filter-live). */
.wobble-text-live,
#hero-drawn-by-hand {
  display: inline;
  filter: url(#wobble-text-filter-live);
  font-weight: 500;
  font-style: italic;
}

.fold-grid {
  flex: 0 1 auto;
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(320px, 1.15fr);
  gap: 48px;
  align-items: center;
  min-height: 0;
  width: 100%;
}

.pitch {
  max-width: 34rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-top: 8px;
  padding-bottom: 8px;
}

.eyebrow {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  text-align: left;
}

.eyebrow a {
  color: var(--accent);
  text-decoration: none;
}

.eyebrow a:hover {
  text-decoration: underline;
}

.pitch h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.12;
  margin-bottom: 14px;
  text-align: left;
  text-wrap: wrap;
}

.hero-any {
  font-style: italic;
  font-family: 'Newsreader', var(--font-display), Georgia, serif;
  font-weight: 600;
  color: var(--brand);
}

.lede {
  margin: 0 0 28px;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.55;
  max-width: 36ch;
  text-align: left;
}

.pitch-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.pitch-secondary {
  font-size: 13.5px;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pitch-secondary:hover {
  color: var(--ink);
}

.pitch .library-strip {
  margin-top: 0;
  justify-content: flex-start;
}

/* Studio as product preview */

.studio {
  position: relative;
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  /* Cap height so hero + section-2 peek fit in ~900px laptop viewports */
  max-height: min(520px, calc(100svh - 160px));
}

.studio-top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.studio-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
}

.studio-live-dot {
  position: relative;
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
  overflow: visible;
}

.studio-live-dot:has(.wobble-border-svg) {
  background: transparent;
}

.pane-note {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
}

.shape-chips {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shape-item {
  position: relative;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

.shape-item:hover,
.shape-item.active {
  color: var(--ink);
  font-weight: 600;
}

.studio-canvas {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 120px;
  max-height: 180px;
  border-radius: var(--radius-md);
  background-image:
    linear-gradient(var(--line-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-faint) 1px, transparent 1px);
  background-size: 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#canvas-svg {
  width: 100%;
  height: 100%;
  max-height: 180px;
}

.canvas-font {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.canvas-font[hidden] {
  display: none;
}

.canvas-font-text {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  filter: url(#wobble-text-filter);
}

.studio-controls {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  align-items: end;
}

.studio-controls .btn.small {
  grid-column: 1 / -1;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  color: var(--ink-soft);
}

.control[hidden],
.path-only[hidden] {
  display: none;
}

.control-row,
.seed-row,
.color-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-row {
  justify-content: space-between;
}

.control input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
}

.control input[type='color'] {
  width: 34px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.control select {
  width: 100%;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-faint);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.color-row input[type='range'] {
  flex: 1;
}

.readout {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  white-space: nowrap;
}

.toggle-row {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.toggle-row input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.mini-btn {
  position: relative;
  border: none;
  background: color-mix(in oklch, var(--ink) 6%, transparent);
  border-radius: 6px;
  min-width: 34px;
  height: 24px;
  padding: 0 6px;
  cursor: pointer;
  font-size: 10px;
  font-family: var(--mono);
  color: var(--ink);
  flex-shrink: 0;
}

/* ---------- 2. Proof ---------- */

.proof {
  padding-block: var(--section-pad-y);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 40px 48px;
  align-items: center;
}

.proof-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
  text-align: left;
}

.proof h2 {
  margin: 0 0 var(--section-title-gap);
  max-width: 18ch;
}

.proof-block {
  max-width: 42ch;
  width: 100%;
}

.proof-block + .proof-block {
  margin-top: var(--section-block-gap);
}

.proof-label {
  margin: 0 0 12px;
  font-family: var(--font-body);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.3;
}

.proof-copy p,
.proof-copy .use-case-list li {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-body);
  line-height: var(--text-body-lh);
}

.proof-copy .use-case-list li {
  white-space: nowrap;
}

.proof-copy code {
  font-size: var(--text-code);
  color: var(--ink);
}

.proof-copy a {
  color: var(--accent);
}

.library-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
}

.proof-block .library-strip {
  margin-top: 16px;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  max-width: 100%;
}

.library-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 8px;
  border: 1px solid var(--line-faint);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.proof-block .library-pill {
  flex: 0 1 auto;
  gap: 4px;
  padding: 5px 8px 5px 6px;
  font-size: 12px;
}

.proof-block .library-icon {
  width: 12px;
  height: 12px;
}

.library-icon {
  flex-shrink: 0;
  color: var(--brand);
}

.use-case-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.proof-copy .use-case-list {
  display: grid;
  width: max-content;
  max-width: 100%;
  text-align: left;
  justify-items: start;
}

.proof-block:has(.use-case-list) {
  max-width: 52ch;
}

.use-case-list li {
  position: relative;
  padding-left: 1.05em;
  color: var(--ink-soft);
  font-size: var(--text-body);
  line-height: var(--text-body-lh);
}

.use-case-list .copy-accent {
  color: var(--brand);
}

.use-case-list code {
  font-size: var(--text-code);
}

.use-case-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
}

.proof-shot {
  position: relative;
  margin: 0;
  margin-inline: auto;
  border-radius: var(--radius-lg);
  overflow: visible;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: fit-content;
  max-height: 100%;
  padding: 10px;
}

.proof-shot img {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  height: auto;
  max-height: min(380px, 58vh);
  max-width: min(210px, 100%);
  object-fit: contain;
  object-position: center;
}

/* ---------- 3. Benefits ---------- */

.benefits {
  padding-block: var(--section-pad-y);
  /* Tighter top so a hero peek reveals the section kicker, not empty pad */
  padding-top: 56px;
}

.benefits-intro {
  margin-bottom: var(--section-title-gap);
  max-width: 36rem;
}

.benefits-intro .close-title {
  margin-bottom: 0;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.benefit {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: var(--radius-lg);
  min-height: 100%;
}

/* Light 3D tilt, shared by the benefit cards and the final CTA card
   (app.js targets every .tilt-card). Desktop: --tilt-x/--tilt-y follow the
   pointer and clear on leave. Touch: they follow the device's own tilt via
   DeviceOrientation instead, since there's no hover/pointer to read. */
.tilt-card {
  transform: perspective(800px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.tilt-card.is-tilting {
  transition: transform 60ms linear;
}

@media (prefers-reduced-motion: reduce) {
  .tilt-card {
    transform: none !important;
    transition: none;
  }
}

.benefit-visual {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  margin: 3px 3px 0;
  padding: 20px 16px 14px;
  background: color-mix(in oklch, var(--paper) 72%, var(--brand) 6%);
  border-radius: calc(var(--radius-lg) - 4px) calc(var(--radius-lg) - 4px) 8px 8px;
}

.benefit-demo {
  display: block;
  width: 100%;
  max-width: 200px;
  height: auto;
}

.benefit-copy {
  position: relative;
  z-index: 1;
  padding: 22px 22px 24px;
}

.benefit h3 {
  font-family: var(--font-display);
  font-size: var(--text-card-title);
  font-weight: 700;
  margin-bottom: 8px;
}

.benefit p {
  margin: 0;
  font-size: var(--text-body);
  line-height: var(--text-body-lh);
  color: var(--ink-soft);
}

/* ---------- 4. Get started / copy prompts ---------- */

.close {
  padding-block: var(--section-pad-y);
}

.section-kicker {
  margin: 0 0 var(--section-kicker-gap);
  font-family: var(--font-body);
  font-size: var(--text-kicker);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  line-height: 1.3;
}

/* Beat .proof-copy p so Compatibility kicker matches Why / Get started */
.proof-copy .section-kicker {
  margin: 0 0 var(--section-kicker-gap);
  font-size: var(--text-kicker);
  color: var(--brand);
  line-height: 1.3;
}

.close-title {
  font-size: var(--text-h2);
  margin-bottom: var(--section-title-gap);
}

.get-started {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(280px, 1.15fr);
  gap: 32px;
  align-items: start;
}

.get-started-copy h3.proof-label {
  margin: 0 0 12px;
}

.get-started-copy h3.proof-label:not(:first-child) {
  margin-top: var(--section-block-gap);
}

.get-started-copy p,
.get-started-copy .use-case-list li {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-body);
  line-height: var(--text-body-lh);
}

.get-started-copy p {
  max-width: 42ch;
}

.get-started-copy .use-case-list {
  margin-top: 12px;
}

.copy-prompt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0 0 8px;
  padding: 12px 14px;
  border: 1px solid var(--line-faint);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--ink);
  transition: border-color 120ms ease, transform 120ms ease;
}

.copy-prompt:hover {
  border-color: color-mix(in oklch, var(--ink) 22%, transparent);
  transform: translateY(-1px);
}

.copy-prompt.is-copied {
  border-color: var(--accent);
}

.copy-prompt-code {
  font-family: var(--mono);
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-prompt-prefix {
  color: var(--ink-soft);
  margin-right: 6px;
}

.copy-accent {
  color: var(--accent);
}

.copy-icon,
.copy-icon-btn {
  color: var(--ink-soft);
  flex-shrink: 0;
}

.copy-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
}

.copy-icon-btn:hover {
  color: var(--ink);
  background: color-mix(in oklch, var(--ink) 6%, transparent);
}

.copy-hint {
  margin: 12px 0 0;
}

.code-card {
  position: relative;
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 36px;
  overflow: hidden;
}

.code-card-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  margin-bottom: 14px;
}

.code-card-file {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid color-mix(in oklch, var(--ink) 14%, transparent);
}

.code-card-body {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
}

.code-card-body code {
  font-family: inherit;
  font-size: inherit;
  white-space: pre;
}

.tok-kw {
  color: var(--brand);
}

.tok-str {
  color: var(--brand);
}

.tok-fn {
  color: var(--ink);
}

.tok-num {
  color: var(--accent);
}

.tok-comment {
  color: var(--ink-soft);
}

.get-started-copy code {
  color: var(--brand);
  font-size: var(--text-code);
}

.get-started-copy .copy-prompt-code {
  font-size: 13.5px;
}

/* ---------- 5. Final CTA ---------- */

.final-cta {
  padding-block: 0 var(--section-pad-y);
}

.final-cta-card {
  position: relative;
  padding: clamp(28px, 4vw, 40px) clamp(22px, 4vw, 36px);
  background: var(--panel);
  border-radius: var(--radius-lg);
  text-align: center;
}

.final-cta-card .section-kicker {
  margin-bottom: 10px;
}

.final-cta-card .close-title {
  margin: 0 auto 12px;
  max-width: 18ch;
}

.final-cta-lede {
  margin: 0 auto 24px;
  max-width: 42ch;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: var(--text-body-lh);
}

.final-cta-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 14px;
}

.final-cta-actions .btn {
  background: color-mix(in oklch, var(--paper) 70%, var(--brand) 4%);
}

/* Buttons pop onto a layer above the card on hover, as if lifting off the
   surface - desktop/hover only (app.js drives --pop-x/--pop-y from cursor
   position). Touch has no hover to trigger this, so buttons stay flat. */
.btn-pop {
  transform: translateZ(0);
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) and (pointer: fine) {
  .btn-pop:hover {
    transform: perspective(600px) translateZ(30px) scale(1.06) rotateX(var(--pop-x, 0deg)) rotateY(var(--pop-y, 0deg));
    z-index: 3;
    transition: transform 140ms ease-out;
  }

  .btn-pop:hover:active {
    transform: perspective(600px) translateZ(16px) scale(0.98) rotateX(var(--pop-x, 0deg)) rotateY(var(--pop-y, 0deg));
  }
}

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

.site-footer {
  padding-block: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line-faint);
  font-size: 13px;
  color: var(--ink-soft);
}

.site-footer-copy,
.site-footer-nav {
  margin: 0;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

.site-footer-credits {
  flex-basis: 100%;
  margin: 0;
  font-size: 12px;
}

.site-footer-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  :root {
    --section-pad-y: 112px;
    --section-title-gap: 28px;
    --section-block-gap: 36px;
    --page-gutter: 20px;
    --text-h2: 1.75rem;
  }

  .fold {
    min-height: auto;
    padding-block: 16px 56px;
    overflow-x: clip;
  }

  .site-header-bar {
    margin-bottom: 36px;
  }

  .fold-bar {
    gap: 10px;
    min-width: 0;
  }

  .wordmark {
    font-size: 20px;
    padding: 6px 12px 10px 12px;
    min-width: 0;
    flex-shrink: 1;
    max-width: calc(100% - 9.5rem);
  }

  .wordmark-label {
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    line-height: 28px;
  }

  .fold-nav {
    gap: 8px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .fold-grid,
  .proof,
  .benefits-grid,
  .get-started {
    grid-template-columns: minmax(0, 1fr);
  }

  .fold-grid {
    /* Stacked pitch → studio: tight enough to peek the next block */
    gap: 56px;
    width: 100%;
    min-width: 0;
  }

  .pitch,
  .studio {
    min-width: 0;
    max-width: 100%;
  }

  .pitch {
    max-width: none;
    width: 100%;
    padding-top: 16px;
    padding-bottom: 16px;
    align-items: center;
  }

  .eyebrow {
    margin-bottom: 16px;
    text-align: center;
    justify-content: center;
  }

  .pitch h1 {
    width: 100%;
    max-width: 100%;
    text-align: center;
    font-size: clamp(2.25rem, 8.8vw, 3.05rem);
    line-height: 1.06;
    margin-bottom: 16px;
    overflow-wrap: break-word;
  }

  .lede {
    margin-bottom: 48px;
    padding-bottom: 0;
    max-width: none;
    width: 100%;
    overflow-wrap: break-word;
    text-align: center;
  }

  .btn {
    padding-block: 15px;
    padding-inline: 20px;
  }

  .pitch-cta {
    width: 100%;
    margin-bottom: 16px;
    max-width: 100%;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 16px;
  }

  #btn-primary {
    width: 100%;
  }

  .pitch .library-strip {
    max-width: 100%;
    justify-content: center;
  }

  .proof {
    gap: 48px;
  }

  .proof-copy {
    align-items: flex-start;
    text-align: left;
    min-width: 0;
  }

  .proof h2 {
    max-width: none;
  }

  .proof-copy .use-case-list {
    width: 100%;
    max-width: 100%;
  }

  .proof-copy .use-case-list li {
    white-space: normal;
  }

  .code-card,
  .get-started-copy,
  .get-started {
    min-width: 0;
    max-width: 100%;
  }

  .code-card-body code {
    white-space: pre;
  }

  .proof-block .library-strip {
    gap: 5px;
  }

  .proof-block .library-pill {
    padding: 4px 7px 4px 5px;
    font-size: 12px;
  }

  .proof-shot {
    justify-self: center;
  }

  .benefits-grid {
    gap: 36px;
  }

  .get-started {
    gap: 44px;
  }

  .final-cta-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .final-cta-actions .btn {
    width: 100%;
  }

  .studio {
    max-height: none;
    padding: 22px 18px;
    width: 100%;
  }

  .studio-top {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .pane-note {
    overflow-wrap: anywhere;
  }

  .shape-chips {
    max-width: 100%;
  }

  .studio-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer {
    padding-block: 40px 56px;
  }
}

@media (max-width: 480px) {
  :root {
    --section-pad-y: 96px;
    --page-gutter: 16px;
  }

  .fold {
    padding-block: 14px 48px;
  }

  .site-header-bar {
    margin-bottom: 20px;
  }

  .fold-bar {
    gap: 8px;
  }

  .wordmark {
    font-size: 18px;
    padding: 4px 8px 6px 8px;
    max-width: calc(100% - 8.75rem);
  }

  .wordmark-label {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    max-width: none;
    line-height: 28px;
  }

  .fold-nav {
    gap: 6px;
    font-size: 12px;
  }

  .fold-grid {
    gap: 48px;
  }

  .pitch {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .eyebrow {
    margin-bottom: 16px;
    text-align: center;
  }

  .pitch h1 {
    font-size: clamp(2.15rem, 10.2vw, 2.75rem);
    line-height: 1.05;
    margin-bottom: 16px;
  }

  .lede {
    margin-bottom: 48px;
  }

  .btn {
    width: 100%;
    padding-block: 16px;
  }

  #btn-primary {
    width: 100%;
  }

  .pitch-cta {
    width: 100%;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
  }

  .pitch .library-strip {
    gap: 8px;
  }

  .studio {
    padding: 18px 14px;
  }

  .shape-chips {
    gap: 6px 5px;
  }

  .shape-item {
    padding: 5px 9px;
  }

  .proof-block .library-strip {
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .proof-block .library-strip::-webkit-scrollbar {
    display: none;
  }

  .proof-block .library-pill {
    padding: 4px 6px 4px 5px;
    font-size: 12px;
  }
}

/* Desktop hero: always left-aligned (mobile centering stays in max-width queries above) */
@media (min-width: 901px) {
  .fold {
    /* ~100–140px peek of section 2 on common laptop heights */
    padding-block: 12px 40px;
  }

  .site-header-bar {
    margin-bottom: 112px;
  }

  .fold-grid {
    align-items: center;
    gap: 48px;
  }

  .pitch {
    align-items: flex-start;
    text-align: left;
  }

  .pitch .eyebrow {
    justify-content: flex-start;
    text-align: left;
  }

  .pitch h1 {
    text-align: left;
    text-wrap: wrap;
  }

  .pitch .lede {
    text-align: left;
  }

  .pitch-cta {
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    flex-direction: row;
    width: auto;
  }

  .pitch .library-strip {
    justify-content: flex-start;
  }

  #btn-primary {
    width: auto;
  }

  .studio {
    max-height: min(500px, calc(100svh - 180px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-interactive {
    transition: none;
  }

  .spark {
    animation: none;
  }
}
