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

:root {
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-serif: "DM Serif Display", Georgia, "Times New Roman", serif;

  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-muted: #f0efed;
  --border: #e8e6e2;
  --text: #141414;
  --text-muted: #6b6b6b;
  --text-subtle: #9a9a9a;
  --headline-muted: #8a8a8a;
  --btn-bg: #141414;
  --btn-text: #ffffff;
  --btn-hover: #2a2a2a;

  --page-max: 1160px;
  --section-x: clamp(20px, 4vw, 40px);
  --section-y: clamp(56px, 8vw, 96px);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --surface: #1e1c19;
    --surface-muted: #252320;
    --border: #2e2c28;
    --text: #eae6de;
    --text-muted: #949088;
    --text-subtle: #706c66;
    --headline-muted: #949088;
    --btn-bg: #eae6de;
    --btn-text: #141414;
    --btn-hover: #d4d0ca;

    color-scheme: dark;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

/* ── Nav ─────────────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 14px var(--section-x);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  justify-self: start;
}

.nav__logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}

.nav__logo-name {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.nav__links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.5vw, 32px);
}

.nav__links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}

.nav__links a:hover {
  color: var(--text);
}

.nav__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--btn-hover);
}

.btn--sm {
  padding: 10px 18px;
  font-size: 0.875rem;
}

.btn--lg {
  padding: 15px 28px;
  font-size: 1rem;
}

.btn__arrow {
  font-size: 1.05em;
  line-height: 1;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */

.hero {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) var(--section-x) clamp(48px, 7vw, 80px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.hero__content {
  min-width: 0;
}

.hero__headline {
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 4.8vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.hero__headline em {
  font-style: normal;
  color: var(--headline-muted);
}

.hero__body {
  font-size: clamp(1rem, 1.5vw, 1.0625rem);
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 34rem;
  margin-bottom: 28px;
}

.hero__cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-bottom: 14px;
}

.hero__cta-note {
  font-size: 0.8125rem;
  color: var(--text-subtle);
}

.hero__avail {
  font-size: 0.8125rem;
  color: var(--text-subtle);
  letter-spacing: 0.02em;
}

.hero__preview {
  min-width: 0;
}

/*
 * Preview cards pin the aspect ratio of the clip they host (LOOP_SIZES in
 * marketing/src/lib/loopKit.tsx) via a per-card --clip-ratio, so
 * object-fit: cover never crops content. The fallback matches the compact
 * 460×560 canvas.
 */
.preview-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--clip-ratio, 460 / 560);
  /* Cap width, not height: clamping height while width stays fluid would
     break the pinned ratio and put object-fit cropping back in play. */
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
  border-radius: 24px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
}

/*
 * Rendered app clip; sits over the placeholder text immediately, showing
 * its poster frame (set synchronously on page load) while the mp4 itself
 * loads lazily. Poster and first video frame are identical, so there's no
 * fade needed once playback actually starts — only a cover for the rare
 * case the poster itself is still fetching.
 */
.preview-card__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.preview-card__video[poster],
.preview-card__video--ready {
  opacity: 1;
}

.preview-card__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 12px;
}

.preview-card__title {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.25;
  margin-bottom: 8px;
}

.preview-card__hint {
  font-size: 0.875rem;
  color: var(--text-subtle);
}

/* ── Sections ────────────────────────────────────────────────────────────── */

.section {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--section-y) var(--section-x);
}

.section--narrow {
  max-width: 720px;
}

.section--center {
  text-align: center;
}

.section--center p {
  margin-left: auto;
  margin-right: auto;
}

.section + .section {
  border-top: 1px solid var(--border);
}

.section h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.625rem, 3vw, 2.375rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  max-width: 28ch;
}

.section--center h2 {
  max-width: none;
}

.section p {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 38rem;
}

.section p + p {
  margin-top: 14px;
}

.section p em {
  font-style: italic;
}

.section a.inline-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Split sections (content + preview panel) ───────────────────────────── */

.section--split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.section-split__content {
  min-width: 0;
}

.section-split__preview {
  min-width: 0;
}

.preview-card--sm {
  padding: 24px;
}

/* ── Pack examples ───────────────────────────────────────────────────────── */

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

.pack-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

.pack-card__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 8px;
}

.pack-card__title {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.3;
  margin-bottom: 14px;
}

.pack-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
}

/* ── Stat callouts ───────────────────────────────────────────────────────── */

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
  max-width: 34rem;
}

.stat__value {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1;
  margin-bottom: 8px;
}

.stat__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

/* ── Silent-context list ─────────────────────────────────────────────────── */

.context-list {
  list-style: none;
  margin-top: 24px;
  max-width: 30rem;
  border-top: 1px solid var(--border);
}

.context-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}

.context-list__place {
  color: var(--text);
}

.context-list__badge {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.context-list__badge--yes {
  color: var(--text);
}

.context-list__badge--no {
  color: var(--text-subtle);
  text-decoration: line-through;
  text-decoration-color: var(--text-subtle);
}

/* ── Feature trio ────────────────────────────────────────────────────────── */

.trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 40px);
}

.trio__item h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.3;
  margin-bottom: 10px;
}

.trio__item p {
  font-size: 0.9375rem;
  line-height: 1.6;
  max-width: none;
}

.trio__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text);
  margin-bottom: 14px;
}

/* ── Comparison table ────────────────────────────────────────────────────── */

.section--comparison h2 {
  max-width: none;
  margin-bottom: 28px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.comparison th {
  text-align: left;
  padding: 10px 16px 10px 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-subtle);
  white-space: nowrap;
}

.comparison th.col-reverb {
  color: var(--text);
}

.comparison td {
  padding: 14px 16px 14px 0;
  line-height: 1.5;
  color: var(--text-muted);
  vertical-align: top;
  border-top: 1px solid var(--border);
}

.comparison td.col-label {
  color: var(--text);
  font-weight: 500;
}

.comparison td.col-reverb {
  color: var(--text);
}

/* ── Science block (inside the comparison section) ───────────────────────── */

.science {
  margin-top: clamp(48px, 6vw, 72px);
  padding-top: clamp(32px, 4vw, 48px);
  border-top: 1px solid var(--border);
}

.science h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.375rem, 2.4vw, 1.875rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
}

.science__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 40px);
}

.science__item h4 {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.3;
  margin-bottom: 8px;
}

.science__item p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: none;
}

.science__item sup {
  font-size: 0.6875em;
  color: var(--text-subtle);
}

.science__coda {
  margin-top: 28px;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 44rem;
}

.science__sources {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  max-width: 44rem;
}

.science__sources-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 8px;
}

.science__sources ol {
  list-style: decimal;
  padding-left: 1.25em;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.science__sources li {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-subtle);
  font-family: var(--font-serif);
  font-style: italic;
}

.science__sources li::marker {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.75rem;
}

/* ── Closing CTA ─────────────────────────────────────────────────────────── */

.section--closing {
  padding-bottom: clamp(72px, 10vw, 112px);
}

.section--closing h2 {
  max-width: none;
  font-size: clamp(1.75rem, 3.5vw, 2.625rem);
}

.section--closing p {
  margin-bottom: 32px;
  max-width: 28rem;
}

.section--closing__note {
  margin-top: 14px;
  font-size: 0.8125rem;
  color: var(--text-subtle);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 20px var(--section-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer__copy {
  font-size: 0.8125rem;
  color: var(--text-subtle);
}

.footer__links {
  display: flex;
  gap: 20px;
}

.footer__links a {
  font-size: 0.8125rem;
  color: var(--text-subtle);
  text-decoration: none;
  transition: color 0.15s;
}

.footer__links a:hover {
  color: var(--text-muted);
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .nav__inner {
    grid-template-columns: 1fr auto;
  }

  .nav__links {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .hero__preview {
    order: 3;
  }

  .trio {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .section--split {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .section-split__preview {
    order: 3;
  }

  .pack-grid {
    grid-template-columns: 1fr;
  }

  .science__grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .stats-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 560px) {
  .stats-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .hero__cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__cta-row .btn {
    width: 100%;
  }

  .hero__cta-note {
    text-align: center;
  }
}
