/* ==========================================================================
   WhisperScribe Landing Page
   Design tokens, base styles and all section styles.
   No dependencies, no build step. System font stack, automatic dark mode
   via prefers-color-scheme with manual [data-theme] override.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --bg: #ffffff;
  --bg-subtle: #f5f5f7;
  --bg-elevated: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #515154;
  --text-tertiary: #86868b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --border: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.16);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-window: 0 2px 8px rgba(0, 0, 0, 0.08), 0 24px 64px rgba(0, 0, 0, 0.16);
  --nav-bg: rgba(255, 255, 255, 0.78);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --container: 1080px;
  --nav-height: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0f;
    --bg-subtle: #16161c;
    --bg-elevated: #1c1c23;
    --text: #f5f5f7;
    --text-secondary: #b6b6bd;
    --text-tertiary: #84848c;
    --accent: #5e8ff5;
    --accent-hover: #7da4f7;
    --accent-contrast: #0b0b0f;
    --accent-soft: rgba(94, 143, 245, 0.14);
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.2);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-window: 0 2px 8px rgba(0, 0, 0, 0.5), 0 24px 64px rgba(0, 0, 0, 0.6);
    --nav-bg: rgba(11, 11, 15, 0.72);
  }
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-subtle: #f5f5f7;
  --bg-elevated: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #515154;
  --text-tertiary: #86868b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --border: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.16);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-window: 0 2px 8px rgba(0, 0, 0, 0.08), 0 24px 64px rgba(0, 0, 0, 0.16);
  --nav-bg: rgba(255, 255, 255, 0.78);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0f;
  --bg-subtle: #16161c;
  --bg-elevated: #1c1c23;
  --text: #f5f5f7;
  --text-secondary: #b6b6bd;
  --text-tertiary: #84848c;
  --accent: #5e8ff5;
  --accent-hover: #7da4f7;
  --accent-contrast: #0b0b0f;
  --accent-soft: rgba(94, 143, 245, 0.14);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.2);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-window: 0 2px 8px rgba(0, 0, 0, 0.5), 0 24px 64px rgba(0, 0, 0, 0.6);
  --nav-bg: rgba(11, 11, 15, 0.72);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

a:hover {
  text-decoration: underline;
}

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

p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

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

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

/* --------------------------------------------------------------------------
   3. Utilities
   -------------------------------------------------------------------------- */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
}

.section-subtle {
  background: var(--bg-subtle);
}

.section-head {
  max-width: 640px;
  margin: 0 auto 56px;
  text-align: center;
}

.section-title {
  font-size: clamp(28px, 4.5vw, 40px);
}

.section-sub {
  margin-top: 14px;
  font-size: 19px;
  color: var(--text-secondary);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--radius-sm);
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

/* --------------------------------------------------------------------------
   4. Navigation
   -------------------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
}

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

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.nav-links a {
  font-size: 15px;
  color: var(--text-secondary);
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

/* Icon shows the mode you would switch TO: moon in light mode, sun in dark.
   System preference applies only while no manual override is set. */
.theme-icon-moon {
  display: block;
}

.theme-icon-sun {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-icon-moon {
    display: none;
  }

  :root:not([data-theme]) .theme-icon-sun {
    display: block;
  }
}

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

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

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

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

.lang-btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 17px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-btn:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.nav-cta {
  height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 17px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease;
}

.nav-cta:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   5. Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: 96px 0 72px;
  text-align: center;
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin-bottom: 24px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(36px, 6.5vw, 64px);
  max-width: 800px;
  margin: 0 auto;
}

.hero-sub {
  max-width: 620px;
  margin: 20px auto 0;
  font-size: clamp(17px, 2.2vw, 21px);
  color: var(--text-secondary);
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
}

.store-badge {
  display: inline-block;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.store-badge:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

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

.hero-note {
  font-size: 14px;
  color: var(--text-tertiary);
}

.hero-visual {
  max-width: 880px;
  margin: 64px auto 0;
}

/* macOS window frame around screenshots */
.mac-window {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-window);
  overflow: hidden;
}

.mac-window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.mac-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.mac-dot-r {
  background: #ff5f57;
}

.mac-dot-y {
  background: #febc2e;
}

.mac-dot-g {
  background: #28c840;
}

/* --------------------------------------------------------------------------
   6. Trust band + stats
   -------------------------------------------------------------------------- */

.trust {
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 36px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trust-list li {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
}

.trust-list svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
  flex-shrink: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 64px;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: clamp(26px, 3.5vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.stat-label {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-tertiary);
}

/* --------------------------------------------------------------------------
   7. Features
   -------------------------------------------------------------------------- */

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

.feature-card {
  padding: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

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

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

.feature-card h3 {
  font-size: 19px;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 15px;
  color: var(--text-secondary);
}

.formats {
  margin-top: 56px;
  padding: 28px 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.formats h3 {
  font-size: 17px;
  margin-bottom: 16px;
}

.format-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.format-list li {
  padding: 5px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.formats-note {
  font-size: 14px;
  color: var(--text-tertiary);
}

/* --------------------------------------------------------------------------
   8. Privacy
   -------------------------------------------------------------------------- */

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.privacy-card {
  padding: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.privacy-card .feature-icon {
  margin: 0 auto 18px;
}

.privacy-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.privacy-card p {
  font-size: 15px;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   9. Screenshots
   -------------------------------------------------------------------------- */

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

.shot figcaption {
  margin-top: 12px;
  text-align: center;
  font-size: 14px;
  color: var(--text-tertiary);
}

/* --------------------------------------------------------------------------
   10. How it works
   -------------------------------------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 16px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
}

.step h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.step p {
  font-size: 15px;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   11. Pricing
   -------------------------------------------------------------------------- */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}

.price-card {
  display: flex;
  flex-direction: column;
  padding: 32px 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.price-card-featured {
  border: 2px solid var(--accent);
  position: relative;
}

.price-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.price-card h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-secondary);
}

.price-value {
  margin-top: 14px;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.price-per {
  font-size: 14px;
  color: var(--text-tertiary);
}

.price-desc {
  margin-top: 14px;
  font-size: 15px;
  color: var(--text-secondary);
  flex-grow: 1;
}

.price-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  height: 44px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.price-cta:hover {
  background: var(--bg-subtle);
  text-decoration: none;
}

.price-cta-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.price-cta-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.pricing-includes {
  max-width: 560px;
  margin: 40px auto 0;
  text-align: center;
  font-size: 15px;
  color: var(--text-secondary);
}

.grandfather {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 640px;
  margin: 24px auto 0;
  padding: 16px 24px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  text-align: center;
}

.grandfather svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

.pricing-note {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* --------------------------------------------------------------------------
   12. FAQ
   -------------------------------------------------------------------------- */

.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

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

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

.faq-item summary::after {
  content: "";
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-tertiary);
  border-bottom: 2px solid var(--text-tertiary);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

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

.faq-item p {
  padding: 0 4px 20px;
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 640px;
}

/* --------------------------------------------------------------------------
   13. Final CTA + footer
   -------------------------------------------------------------------------- */

.final-cta {
  text-align: center;
}

.final-cta .store-badge {
  margin-top: 32px;
}

.final-cta .hero-note {
  margin-top: 14px;
}

.footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.footer-brand img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.footer-tagline {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-tertiary);
}

.footer-links {
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
}

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

.footer-legal {
  margin-top: 32px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.footer-legal p + p {
  margin-top: 6px;
}

/* --------------------------------------------------------------------------
   14. Privacy page
   -------------------------------------------------------------------------- */

.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 72px 24px 96px;
}

.legal-page h1 {
  font-size: clamp(30px, 5vw, 42px);
}

.legal-page h2 {
  font-size: 21px;
  margin-top: 40px;
}

.legal-page p {
  margin-top: 14px;
  color: var(--text-secondary);
}

.legal-page .updated {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-tertiary);
}

/* --------------------------------------------------------------------------
   15. Reveal animations (respect reduced motion)
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   16. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .section {
    padding: 72px 0;
  }

  .nav-links {
    display: none;
  }

  .feature-grid,
  .privacy-grid,
  .steps,
  .pricing-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 32px 20px;
  }

  .price-card-featured {
    order: -1;
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

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

  .feature-grid,
  .privacy-grid,
  .steps,
  .pricing-grid,
  .shots-grid {
    grid-template-columns: 1fr;
  }

  .price-card-featured {
    grid-column: auto;
  }

  .footer-inner {
    flex-direction: column;
  }

  .nav-cta {
    display: none;
  }
}
