/* The Smooth Swing - Static Promo Site
   Tokens match constants/theme.ts in the mobile app */

:root {
  --bg: #f5f2ec;
  --surface: #ffffff;
  --sunken: #f0ece4;
  --selected: #ffffff;
  --pressed: #e8e3da;
  --border: #e2ddd3;
  --track: #e2ddd3;
  --text: #141414;
  --muted: #57534e;
  --accent: #ea5752;
  --accent-text: #b9332e;
  --on-accent: #141414;
  --inverse: #141414;
  --on-inverse: #ffffff;
  --bezel: #18181b;
  --shadow:
    0 24px 60px rgba(20, 20, 20, 0.08), 0 4px 16px rgba(20, 20, 20, 0.04);
  --shadow-sm: 0 2px 10px rgba(20, 20, 20, 0.05);
  --font-body:
    "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Lora", Georgia, serif;
}

[data-theme="dark"] {
  --bg: #000000;
  --surface: #141414;
  --sunken: #0a0a0a;
  --selected: #2e2e2e;
  --pressed: #2e2e2e;
  --border: #2a2a2a;
  --track: #1f1f1f;
  --text: #ffffff;
  --muted: #a1a1a6;
  --accent: #ea5752;
  --accent-text: #ea5752;
  --on-accent: #141414;
  --inverse: #ffffff;
  --on-inverse: #000000;
  --bezel: #27272a;
  --shadow:
    0 28px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 760px;
}

/* --- Header --- */

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

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--text);
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition:
    background-color 0.15s ease,
    transform 0.15s ease;
}

.theme-toggle:hover {
  background: var(--pressed);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.icon-moon,
[data-theme="dark"] .icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: block;
}

/* --- Hero --- */

.hero {
  padding: 64px 0 88px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: 56px;
}

.hero-title {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 3.65rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.hero-lead {
  margin: 0 0 30px;
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 48ch;
  line-height: 1.65;
}

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

.store-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

.store-badge:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.store-badge img {
  height: 48px;
  width: auto;
}

.hero-meta {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

/* --- Interactive Phone Demo --- */

.phone-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.phone {
  width: 100%;
  max-width: 348px;
  border-radius: 40px;
  background: var(--bg);
  border: 8px solid var(--bezel);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-notch {
  width: 96px;
  height: 22px;
  margin: 10px auto 4px;
  border-radius: 999px;
  background: var(--bezel);
}

.phone-header {
  text-align: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 6px 16px 10px;
}

.phone-progress {
  margin: 0 20px;
  height: 3px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}

.phone-progress-bar {
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}

.phone-stage {
  padding: 18px 20px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.viz-svg {
  width: 210px;
  height: 210px;
  overflow: visible;
}

.viz-ring-fill {
  fill: var(--border);
  fill-opacity: 0.18;
  transition:
    fill 0.08s ease,
    fill-opacity 0.25s ease,
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.viz-ring-stroke {
  fill: none;
  stroke: var(--border);
  stroke-width: 2;
  transition:
    stroke 0.08s ease,
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.viz-group {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.viz-group.is-takeaway {
  transform: scale(1.1);
}
.viz-group.is-takeaway .viz-ring-fill {
  fill: var(--muted);
  fill-opacity: 0.72;
}
.viz-group.is-takeaway .viz-ring-stroke {
  stroke: var(--muted);
}

.viz-group.is-top {
  transform: scale(1.1);
}
.viz-group.is-top .viz-ring-fill {
  fill: var(--text);
  fill-opacity: 0.78;
}
.viz-group.is-top .viz-ring-stroke {
  stroke: var(--text);
}

.viz-group.is-impact {
  transform: scale(1.12);
}
.viz-group.is-impact .viz-ring-fill {
  fill: var(--accent);
  fill-opacity: 0.88;
}
.viz-group.is-impact .viz-ring-stroke {
  stroke: var(--accent);
}

.phone-phase {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  min-height: 1.2em;
}

.phone-phase.is-accent {
  color: var(--accent-text);
}

.phone-stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.phone-stats strong {
  color: var(--text);
  font-weight: 600;
}

.phone-panel {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  padding: 16px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.seg-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--sunken);
}

.seg-btn {
  border: 0;
  height: 34px;
  border-radius: 9px;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.seg-btn.is-selected {
  background: var(--selected);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.tempo-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.tempo-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.tempo-chip {
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--sunken);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.tempo-chip.is-selected {
  background: var(--inverse);
  border-color: var(--inverse);
  color: var(--on-inverse);
  font-weight: 700;
}

.demo-actions {
  display: flex;
  gap: 8px;
}

.demo-start {
  flex: 1;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 0.96rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.demo-start:hover {
  opacity: 0.92;
}

.demo-start:active {
  transform: scale(0.98);
}

.demo-tone-select {
  height: 46px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--sunken);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.phone-caption {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  text-align: center;
}

/* --- Sections --- */

.section {
  padding: 76px 0;
}

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

.section-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-text);
  margin: 0 0 10px;
}

.section-title {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.section-lead {
  margin: 0 0 40px;
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 58ch;
}

/* --- How It Works (Ratio + Beats) --- */

.rhythm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
}

.card h3 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.art-well {
  background: var(--sunken);
  border-radius: 18px;
  padding: 26px 24px;
  margin-bottom: 22px;
  min-height: 148px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.ratio-num {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.ratio-bars {
  display: flex;
  gap: 8px;
}

.ratio-bar {
  height: 14px;
  border-radius: 999px;
}

.ratio-bar-back {
  flex: 3;
  background: var(--text);
}

.ratio-bar-down {
  flex: 1;
  background: var(--accent);
}

.ratio-labels {
  display: flex;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.ratio-labels span:first-child {
  flex: 3;
}

.ratio-labels span:last-child {
  flex: 1;
}

.beats {
  position: relative;
  display: flex;
  justify-content: space-between;
  padding: 0 12px;
}

.beats::before {
  content: "";
  position: absolute;
  left: 44px;
  right: 44px;
  top: 24px;
  height: 2px;
  background: var(--border);
}

.beat {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.beat-dot {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
}

.beat-dot-impact {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.beat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

/* --- 5 Visualisations --- */

.viz-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.viz-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  text-align: center;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease;
}

.viz-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.viz-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.viz-card-label {
  padding: 10px 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

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

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

.feature-card-wide {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 24px;
}

.watch-art {
  background: var(--sunken);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.watch-art img {
  max-height: 180px;
  width: auto;
  object-fit: contain;
}

.tone-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tone-pill {
  border: 1px solid var(--border);
  background: var(--sunken);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.tone-pill:hover {
  border-color: var(--accent);
}

.tone-pill.is-playing {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.interval-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.interval-pill {
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--sunken);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.interval-pill.is-active {
  background: var(--inverse);
  border-color: var(--inverse);
  color: var(--on-inverse);
}

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

.cta-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 52px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cta-icon {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.cta-box h2 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3.2vw, 2.3rem);
  line-height: 1.18;
}

.cta-box p {
  margin: 0 0 28px;
  color: var(--muted);
  max-width: 46ch;
}

.cta-box .store-row {
  justify-content: center;
  margin-bottom: 0;
}

/* --- Prose / Privacy Page --- */

.prose {
  padding: 64px 0 88px;
}

.prose h1 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.15;
}

.prose-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 36px;
}

.prose-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  margin-bottom: 24px;
}

.prose-card h2 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 1.35rem;
}

.prose-card h3 {
  margin: 22px 0 6px;
  font-size: 1rem;
  font-weight: 700;
}

.prose-card p,
.prose-card li {
  color: var(--muted);
  font-size: 0.96rem;
}

.prose-card ul {
  padding-left: 20px;
  margin: 10px 0 0;
}

.prose-card li + li {
  margin-top: 6px;
}

.prose-card a {
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- Footer --- */

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 44px;
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

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

/* --- Responsive --- */

@media (max-width: 900px) {
  .hero {
    padding: 40px 0 64px;
  }

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

  .rhythm-grid,
  .feature-grid,
  .feature-card-wide {
    grid-template-columns: 1fr;
  }

  .feature-card-wide {
    grid-column: span 1;
  }

  .viz-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .nav-links .nav-link-hide {
    display: none;
  }

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

  .cta-box {
    padding: 38px 22px;
  }

  .prose-card {
    padding: 24px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
