/* Palette mirrors the app's Assets.xcassets colorsets (Any = light, Dark = dark). */
:root {
  color-scheme: light dark;
  --background: #ffffff;
  --surface: #f5f7fa;
  --surface-raised: #ebeef4;
  --border: #d0d6e0;
  --text: #141d2a;
  --text-secondary: #5c6678;
  --accent: #3d5bfa;
  --accent-muted: rgba(61, 91, 250, 0.15);
  --accent-cyan: #25a9fc;
  --accent-violet: #7b52f6;
  --danger: #e04d4d;
  --success: #1fb86c;
  --on-accent: #ffffff;
  --brand-gradient: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-violet) 100%);
  --header-bg: rgba(255, 255, 255, 0.82);
  --card-bg: rgba(255, 255, 255, 0.78);
  --glow-cyan: rgba(37, 169, 252, 0.18);
  --glow-violet: rgba(123, 82, 246, 0.16);
  --shadow: 0 18px 50px rgba(20, 29, 42, 0.08);
  --radius: 22px;
  --radius-sm: 16px;
  --max-width: 1120px;
  --content-width: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #040b13;
    --surface: #0c1420;
    --surface-raised: #141c2c;
    --border: #243044;
    --text: #ffffff;
    --text-secondary: #8b95a8;
    --accent: #4b6bff;
    --accent-muted: rgba(75, 107, 255, 0.22);
    --accent-cyan: #05c9fd;
    --accent-violet: #7a3df8;
    --danger: #ff5c5c;
    --success: #3de08a;
    --header-bg: rgba(4, 11, 19, 0.82);
    --card-bg: rgba(12, 20, 32, 0.78);
    --glow-cyan: rgba(5, 201, 253, 0.14);
    --glow-violet: rgba(122, 61, 248, 0.18);
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 85% -10%, var(--glow-violet), transparent 70%),
    radial-gradient(700px 480px at -10% 10%, var(--glow-cyan), transparent 70%),
    var(--background);
  min-height: 100vh;
  line-height: 1.6;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-violet);
}

code {
  font-size: 0.92em;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-raised);
}

.container {
  width: min(var(--max-width), calc(100% - 40px));
  margin-inline: auto;
}

.gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

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

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--accent-muted);
  color: var(--accent);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary,
.site-nav a.btn-primary {
  background: var(--brand-gradient);
  color: var(--on-accent);
  box-shadow: 0 10px 24px var(--glow-violet);
}

.btn-primary:hover,
.site-nav a.btn-primary:hover {
  background: var(--brand-gradient);
  color: var(--on-accent);
  filter: brightness(1.06);
}

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

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

.btn-light {
  background: var(--on-accent);
  color: var(--accent);
}

.btn-light:hover {
  color: var(--accent-violet);
}

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 88px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero-lead {
  margin: 0 0 28px;
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 34rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-qr {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding: 14px 18px;
  max-width: fit-content;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-qr img {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  border-radius: 8px;
}

.hero-qr p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  max-width: 9rem;
}

.hero-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

/* Beat hero: a clip that cuts on every beat of a looping waveform */

.beat-hero {
  --beat-screen-width: 230px;
  display: grid;
  gap: 18px;
}

.beat-hero__screen {
  position: relative;
  width: min(100%, var(--beat-screen-width));
  aspect-ratio: 9 / 16;
  margin-inline: auto;
  border-radius: 26px;
  overflow: hidden;
  background: var(--surface-raised);
  border: 6px solid var(--text);
  box-shadow: var(--shadow);
}

.beat-hero__scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.12);
  transition: opacity 0.14s ease-out, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.beat-hero__scene.is-active {
  opacity: 1;
  transform: scale(1);
}

.beat-hero__scene--sunrise {
  background: linear-gradient(180deg, var(--accent-cyan) 0%, var(--accent) 55%, var(--accent-violet) 100%);
}

.beat-hero__scene--sunrise::before {
  content: "";
  position: absolute;
  width: 46%;
  aspect-ratio: 1;
  left: 27%;
  top: 34%;
  border-radius: 50%;
  background: var(--on-accent);
  opacity: 0.85;
}

.beat-hero__scene--sunrise::after {
  content: "";
  position: absolute;
  inset: 58% 0 0;
  background: linear-gradient(180deg, var(--accent-violet), var(--accent));
}

.beat-hero__scene--pixels {
  background: linear-gradient(160deg, var(--accent-violet) 0%, var(--accent) 100%);
}

.beat-hero__scene--pixels span {
  position: absolute;
  border-radius: 14%;
  background: var(--on-accent);
}

.beat-hero__scene--pixels span:nth-child(1) {
  width: 30%;
  aspect-ratio: 1;
  left: 18%;
  top: 26%;
  opacity: 0.9;
}

.beat-hero__scene--pixels span:nth-child(2) {
  width: 26%;
  aspect-ratio: 1;
  left: 50%;
  top: 44%;
  opacity: 0.7;
}

.beat-hero__scene--pixels span:nth-child(3) {
  width: 18%;
  aspect-ratio: 1;
  left: 26%;
  top: 60%;
  opacity: 0.5;
}

.beat-hero__scene--waves {
  background:
    repeating-radial-gradient(circle at 50% 120%, transparent 0 18px, rgba(255, 255, 255, 0.22) 18px 22px),
    linear-gradient(200deg, var(--accent-cyan) 0%, var(--accent-violet) 100%);
}

.beat-hero__scene--stripes {
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.16) 0 14px, transparent 14px 34px),
    linear-gradient(20deg, var(--accent) 0%, var(--accent-cyan) 100%);
}

.beat-hero__scene--stripes::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.55), transparent 45%);
}

.beat-hero__flash {
  position: absolute;
  inset: 0;
  background: var(--on-accent);
  opacity: 0;
  pointer-events: none;
}

.beat-hero__flash.is-flashing {
  animation: beat-flash 0.28s ease-out;
}

.beat-hero__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--on-accent);
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  transition: transform 0.12s ease-out;
}

.beat-hero__badge.is-beat {
  transform: scale(1.12);
}

.beat-hero__caption {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--on-accent);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

.beat-hero__timeline {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

.beat-hero__clips {
  display: flex;
  gap: 3px;
  height: 22px;
}

.beat-hero__clip {
  border-radius: 6px;
  background: var(--accent-muted);
  transition: background 0.15s ease;
}

.beat-hero__clip.is-active {
  background: var(--brand-gradient);
}

.beat-hero__wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 44px;
}

.beat-hero__bar {
  flex: 1;
  border-radius: 2px;
  background: var(--border);
}

.beat-hero__bar.is-played {
  background: var(--accent);
}

.beat-hero__bar.is-beat {
  background: var(--accent-violet);
}

.beat-hero__playhead {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 12px;
  width: 2px;
  border-radius: 1px;
  background: var(--text);
  pointer-events: none;
}

@keyframes beat-flash {
  0% {
    opacity: 0.4;
  }
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .beat-hero__scene,
  .beat-hero__badge {
    transition: none;
  }

  .beat-hero__flash.is-flashing {
    animation: none;
  }
}

/* Sections */

.section {
  padding: 72px 0;
}

.section-header {
  margin-bottom: 36px;
}

.section-header h2 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-header p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 40rem;
}

.feature-grid,
.tool-grid {
  display: grid;
  gap: 18px;
}

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

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

.feature-card,
.tool-card,
.content-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.tool-card {
  padding: 20px;
  border-radius: var(--radius-sm);
}

.feature-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--brand-gradient);
  color: var(--on-accent);
  margin-bottom: 14px;
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature-card h3,
.tool-card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.tool-card h3 {
  font-size: 1rem;
}

.feature-card p,
.tool-card p {
  margin: 0;
  color: var(--text-secondary);
}

.tool-card p {
  font-size: 0.92rem;
}

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

.workflow-step {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
}

.workflow-step span {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--brand-gradient);
  color: var(--on-accent);
  font-weight: 700;
  margin-bottom: 10px;
}

.workflow-step h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.workflow-step p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.format-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 18px;
  margin-top: 28px;
}

.format-chip {
  display: grid;
  justify-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.format-chip i {
  display: block;
  width: 56px;
  border-radius: 8px;
  border: 2px solid var(--accent);
  background: var(--accent-muted);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
}

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.check-list li {
  position: relative;
  padding-left: 32px;
  color: var(--text-secondary);
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--brand-gradient);
}

.check-list li::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 7px;
  width: 6px;
  height: 10px;
  border: solid var(--on-accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.check-list strong {
  color: var(--text);
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

/* CTA */

.cta-band {
  margin: 24px 0 80px;
  padding-inline: 20px;
  display: flex;
  justify-content: center;
}

.cta-band-inner {
  width: min(var(--max-width), 100%);
  margin-inline: auto;
  background: var(--brand-gradient);
  color: var(--on-accent);
  border-radius: 28px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 20px;
  box-shadow: var(--shadow);
}

.cta-icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.cta-band h2 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.2;
}

.cta-band p {
  margin: 0;
  opacity: 0.92;
}

/* Inner pages */

.page-hero {
  padding: 56px 0 28px;
}

.page-hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
}

.page-hero-icon {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.page-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.page-hero p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 40rem;
}

.content-card {
  width: min(var(--content-width), 100%);
  margin: 0 auto 72px;
}

.content-card h2 {
  margin: 28px 0 10px;
  font-size: 1.3rem;
}

.content-card h2:first-child {
  margin-top: 0;
}

.content-card h3 {
  margin: 20px 0 8px;
  font-size: 1.05rem;
}

.content-card p,
.content-card li {
  color: var(--text-secondary);
}

.content-card strong {
  color: var(--text);
}

.content-card ul {
  padding-left: 1.2rem;
}

.faq-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
  color: var(--text-secondary);
}

.faq-search input {
  flex: 1;
  border: none;
  outline: none;
  font: inherit;
  color: var(--text);
  background: transparent;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 20px;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-muted);
  color: var(--accent);
  font-weight: 700;
}

.faq-item[open] summary::after {
  content: "×";
}

.faq-item p {
  margin: 0;
  padding: 0 20px 18px;
  color: var(--text-secondary);
}

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

.support-card h3 {
  margin: 0 0 8px;
}

.support-card p {
  margin: 0;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

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

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

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

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

@media (max-width: 960px) {
  .hero-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .tool-grid,
  .workflow,
  .support-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .hero {
    padding-top: 48px;
  }

  .hero-grid,
  .feature-grid,
  .tool-grid,
  .workflow,
  .support-grid,
  .page-hero-grid {
    grid-template-columns: 1fr;
  }

  .page-hero-icon {
    display: none;
  }

  .site-nav a:not(.btn) {
    display: none;
  }
}
