/* ==========================================================================
   Audiofin — marketing site stylesheet
   Shared by index.html and privacy.html. No frameworks, no external assets.
   ==========================================================================

   Contents
   --------
   1.  Design tokens (custom properties)
   2.  Reset & base
   3.  Typography
   4.  Layout helpers
   5.  Header & navigation (CSS-only mobile menu)
   6.  Buttons
   7.  Hero
   8.  Section chrome (eyebrows, headings)
   9.  Intro
   10. Feature grid
   11. How it works
   12. FAQ (details/summary)
   13. Support card
   14. Footer
   15. Privacy page
   16. Accessibility & motion
   ========================================================================== */


/* 1. Design tokens
   ========================================================================== */

:root {
  /* Color */
  --bg:            #0a0c13;
  --bg-raised:     #10131d;
  --card:          #12151f;
  --card-hover:    #161a27;
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text:          #e9ebf3;
  --text-muted:    #a2a9bd;
  --text-faint:    #78809a;

  --accent-1:      #7c5cff;
  --accent-2:      #4a90e2;
  --accent-soft:   #a795ff;              /* readable accent on dark */
  --gradient:      linear-gradient(135deg, var(--accent-1), var(--accent-2));

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 7rem;

  /* Shape & effects */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
  --glow: 0 0 60px rgba(124, 92, 255, 0.25);

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --container: 68rem;
  --header-h: 4rem;
}


/* 2. Reset & base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  /* Soft ambient glows behind the whole page */
  background-image:
    radial-gradient(56rem 32rem at 85% -6rem, rgba(124, 92, 255, 0.14), transparent 60%),
    radial-gradient(48rem 30rem at 0% 22rem, rgba(74, 144, 226, 0.10), transparent 60%);
  background-repeat: no-repeat;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

svg {
  display: block;
}

/* Anchored sections land below the sticky header */
section[id],
[id] {
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}


/* 3. Typography
   ========================================================================== */

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 6.5vw, 3.75rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.375rem);
}

h3 {
  font-size: 1.125rem;
}

p {
  margin: 0;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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


/* 4. Layout helpers
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.section {
  padding-block: var(--space-8);
}

@media (min-width: 48em) {
  .section {
    padding-block: var(--space-9);
  }
}


/* 5. Header & navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 12, 19, 0.8);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--header-h);
  position: relative;
}

/* Brand (logo + wordmark) */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

/* Logo mark — the real app icon PNG (already a gradient rounded square).
   No wrapper gradient/badge here so we don't double up the icon's own look. */
.logo-mark {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.55rem;
  flex: none;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(124, 92, 255, 0.35);
}

.logo-mark--hero {
  width: 5.25rem;
  height: 5.25rem;
  border-radius: 1.35rem;
  box-shadow: 0 6px 24px rgba(124, 92, 255, 0.45), var(--glow);
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.35rem 0.15rem;
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Mobile toggle (CSS-only checkbox pattern) */
.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav-burger:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-burger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* Show ring on the burger when the (hidden) checkbox is keyboard-focused */
.nav-toggle:focus-visible ~ .nav-burger {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

@media (max-width: 47.99em) {
  .nav-burger {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-2) var(--space-3) var(--space-3);
    background: rgba(12, 14, 22, 0.97);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.45);

    /* Collapsed by default */
    visibility: hidden;
    opacity: 0;
    transform: translateY(-0.5rem);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }

  .nav-toggle:checked ~ .nav-links {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }

  .nav-links a {
    display: block;
    padding: 0.85rem var(--space-3);
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
  }

  .nav-links a:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  /* Burger morphs into an X when open */
  .nav-toggle:checked ~ .nav-burger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle:checked ~ .nav-burger span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle:checked ~ .nav-burger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}


/* 6. Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease,
              border-color 0.2s ease;
}

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

.btn:active {
  transform: translateY(0);
}

.btn svg {
  width: 1.1em;
  height: 1.1em;
  flex: none;
}

.btn-primary {
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 4px 18px rgba(124, 92, 255, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 6px 26px rgba(124, 92, 255, 0.55);
}

.btn-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
}

/* Non-interactive "coming soon" state — subdued, no gradient, no hover lift */
.btn-soon {
  color: var(--text-muted);
  background: rgba(124, 92, 255, 0.08);
  border: 1px solid var(--border-strong);
  cursor: default;
}

.btn-soon:hover {
  transform: none;
  text-decoration: none;
}

.btn-soon svg {
  color: var(--text-faint);
}


/* 7. Hero
   ========================================================================== */

.hero {
  padding-block: var(--space-8) var(--space-8);
  text-align: center;
}

@media (min-width: 48em) {
  .hero {
    padding-block: var(--space-9);
  }
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  max-width: 44rem;
  margin-inline: auto;
}

/* Gradient wash on part of the headline */
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-tagline {
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  color: var(--text-muted);
  max-width: 36rem;
  text-wrap: balance;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

/* "100% free" — a confident but understated line with a check glyph */
.hero-free {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--space-2);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
}

.hero-free svg {
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
  color: var(--accent-soft);
}

.hero-note {
  font-size: 0.9rem;
  color: var(--text-faint);
  letter-spacing: 0.01em;
}

/* Small pill above the H1 ("Beta on TestFlight") */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(124, 92, 255, 0.4);
  background: rgba(124, 92, 255, 0.1);
  color: var(--accent-soft);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hero-badge .dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--gradient);
}


/* 8. Section chrome
   ========================================================================== */

.section-head {
  max-width: 40rem;
  margin: 0 auto var(--space-7);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.section-head p {
  color: var(--text-muted);
}


/* 9. Intro
   ========================================================================== */

.intro {
  border-block: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}

.intro-inner {
  max-width: 44rem;
  margin-inline: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.intro-inner p {
  font-size: 1.15rem;
  color: var(--text-muted);
}

.intro-inner strong {
  color: var(--text);
}


/* 10. Feature grid
   ========================================================================== */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: var(--space-4);
}

.feature-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 92, 255, 0.35);
  background: var(--card-hover);
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.97rem;
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.8rem;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.16), rgba(74, 144, 226, 0.14));
  border: 1px solid rgba(124, 92, 255, 0.25);
  color: var(--accent-soft);
}

.feature-icon svg {
  width: 1.4rem;
  height: 1.4rem;
}


/* 11. How it works
   ========================================================================== */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: var(--space-5);
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
}

.step {
  counter-increment: step;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
}

.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}

.step p {
  color: var(--text-muted);
  font-size: 0.97rem;
}

.step code {
  font-size: 0.9em;
  padding: 0.1em 0.4em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  color: var(--text);
  word-break: break-all;
}

/* Always-visible library-setup callout below the steps */
.setup-note {
  max-width: 46rem;
  margin: var(--space-6) auto 0;
  padding: var(--space-5);
  border: 1px solid rgba(124, 92, 255, 0.3);
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(124, 92, 255, 0.08), rgba(74, 144, 226, 0.06)),
    var(--card);
}

.setup-note h3 {
  margin-bottom: var(--space-2);
}

.setup-note p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.97rem;
}

.setup-note p + p {
  margin-top: var(--space-3);
}

.setup-note strong {
  color: var(--text);
}

/* The key structural takeaway — a subtle monospace "path" chip */
.setup-tree {
  overflow-x: auto;
}

.setup-tree code {
  display: inline-block;
  max-width: 100%;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: nowrap;
}


/* 12. FAQ
   ========================================================================== */

.faq-list {
  max-width: 46rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item[open] {
  border-color: rgba(124, 92, 255, 0.35);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

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

.faq-item summary:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Chevron */
.faq-item summary::after {
  content: "";
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2px solid var(--text-faint);
  border-bottom: 2px solid var(--text-faint);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-top: -0.25rem;
}

.faq-item[open] summary::after {
  transform: rotate(225deg);
  margin-top: 0.25rem;
}

.faq-item .faq-answer {
  padding: 0 var(--space-5) var(--space-5);
  color: var(--text-muted);
}

.faq-answer a {
  font-weight: 500;
}


/* 13. Support card
   ========================================================================== */

.support-card {
  position: relative;
  max-width: 44rem;
  margin-inline: auto;
  padding: var(--space-7) var(--space-5);
  text-align: center;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(30rem 16rem at 50% -6rem, rgba(124, 92, 255, 0.18), transparent 65%),
    var(--card);
  border: 1px solid rgba(124, 92, 255, 0.3);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.support-card p {
  color: var(--text-muted);
  max-width: 32rem;
}


/* 14. Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-6);
  margin-top: var(--space-8);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: 0.9rem;
  color: var(--text-faint);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0;
}

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

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


/* 15. Privacy page
   ========================================================================== */

.legal {
  max-width: 44rem;
  margin-inline: auto;
  padding-block: var(--space-7) var(--space-8);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: var(--space-6);
}

.legal h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin-bottom: var(--space-2);
}

.legal-updated {
  color: var(--text-faint);
  font-size: 0.95rem;
  margin-bottom: var(--space-6);
}

.legal h2 {
  font-size: 1.35rem;
  margin: var(--space-7) 0 var(--space-3);
}

.legal p {
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

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

.legal ul {
  color: var(--text-muted);
  margin: 0 0 var(--space-4);
  padding-left: 1.4rem;
}

.legal li {
  margin-bottom: var(--space-2);
}


/* 16. Accessibility & motion
   ========================================================================== */

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

.btn:focus-visible {
  outline-offset: 4px;
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--gradient);
  color: #fff;
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
