/* ─────────────────────────────────────────────────────────────
   ScribeSwift Landing — landing.css
   Order: tokens → reset → base → typography → layout →
          nav → hero → sections → components → footer →
          keyframes → breakpoints → reduced-motion
   ───────────────────────────────────────────────────────────── */

/* ── 1. Design tokens ─────────────────────────────────────── */
:root {
  /* Backgrounds */
  --color-bg-hero:    #0f0d0b;
  --color-bg-dark:    #1c1917;
  --color-bg-footer:  #0b0906;
  --color-bg-cream:   #f8f5f0;
  --color-bg-white:   #fdfdfc;
  --color-bg-surface: #f0ece6;

  /* Text on dark */
  --color-text-hero:    #f0ebe4;
  --color-text-muted-dk:#c4bdb4;  /* raised: readable body on dark without harshness */
  --color-text-dim-dk:  #9b9189;  /* raised from #6b6259: captions/trust lines now legible */

  /* Text on light */
  --color-text-body:  #1c1917;
  --color-text-muted: #786e64;
  --color-text-dim:   #9b9189;

  /* Brand */
  --color-green:      #22c55e;
  --color-green-light:#4ade80;
  --color-green-dim:  #16a34a;
  --color-green-glow: rgba(34, 197, 94, 0.12);

  /* Warm accent (decorative only) */
  --color-amber:      #c4973a;
  --color-amber-dim:  rgba(196, 151, 58, 0.15);

  /* Borders */
  --color-border-dk:  rgba(240, 235, 228, 0.14);  /* raised: nav border and dark-bg dividers visible */
  --color-border-lt:  rgba(28, 25, 23, 0.10);

  /* Spacing (8px base) */
  --space-1:  8px;
  --space-2:  16px;
  --space-3:  24px;
  --space-4:  32px;
  --space-6:  48px;
  --space-8:  64px;
  --space-10: 80px;
  --space-12: 96px;
  --space-16: 128px;
  --space-20: 160px;

  /* Content widths */
  --width-container: 1200px;
  --width-text:       680px;
  --width-narrow:     520px;

  /* Type scale */
  --text-hero:   clamp(2.5rem, 5vw + 1rem, 5rem);
  --text-h2:     clamp(1.75rem, 3vw + 0.5rem, 3rem);
  --text-h3:     clamp(1.25rem, 2vw + 0.25rem, 1.75rem);
  --text-large:  clamp(1.1rem, 1.5vw + 0.25rem, 1.375rem);
  --text-body:   clamp(1rem, 1vw + 0.25rem, 1.125rem);
  --text-small:  0.875rem;
  --text-caption:0.8125rem;
}

/* ── 2. Reset ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── 3. Base elements ─────────────────────────────────────── */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text-body);
  background-color: var(--color-bg-hero);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
  text-decoration: underline;
}

p {
  max-width: var(--width-text);
}

/* ── 4. Typography utilities ──────────────────────────────── */
.font-display {
  font-family: 'Lora', Georgia, serif;
}

.eyebrow {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: var(--text-caption);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-amber);
}

.eyebrow--light {
  color: var(--color-text-dim-dk);
}

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

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

/* ── 5. Layout utilities ──────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--width-container);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

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

.section--dark {
  background-color: var(--color-bg-dark);
  color: var(--color-text-hero);
}

.section--hero-bg {
  background-color: var(--color-bg-hero);
  color: var(--color-text-hero);
}

.section--cream {
  background-color: var(--color-bg-cream);
  color: var(--color-text-body);
}

.section--white {
  background-color: var(--color-bg-white);
  color: var(--color-text-body);
}

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

.text-narrow {
  max-width: var(--width-narrow);
  margin-inline: auto;
}

.text-reading {
  max-width: var(--width-text);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

/* reversed: visual moves to left column at tablet+, via order in breakpoint */

/* ── 6. Skip link ─────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-2);
  padding: var(--space-1) var(--space-2);
  background: var(--color-green);
  color: #0f0d0b;
  font-weight: 500;
  border-radius: 4px;
  z-index: 9999;
  transition: top 0.2s;
}

.skip-link:focus {
  top: var(--space-2);
}

/* ── 7. Navigation ────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding-block: var(--space-1);
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease,
              box-shadow 0.3s ease;
}

.nav--scrolled {
  background-color: rgba(15, 13, 11, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--color-border-dk);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__wordmark {
  display: flex;
  align-items: center;
  animation: fade-in 0.5s ease-out 0.3s both;
}

.nav__wordmark:hover {
  text-decoration: none;
  opacity: 0.85;
}

.nav__logo {
  display: block;
  width: 228px;
  height: auto;
  max-height: 86px;
  object-fit: contain;
}

.nav__cta {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: var(--text-small);
  font-weight: 500;
  color: rgba(240, 235, 228, 0.72);
  padding: 6px 14px;
  border: 1px solid rgba(240, 235, 228, 0.22);
  border-radius: 6px;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
  animation: fade-in 0.5s ease-out 0.3s both;
}

.nav__cta:hover {
  color: var(--color-text-hero);
  border-color: rgba(240, 235, 228, 0.40);
  text-decoration: none;
}

/* ── 8. Hero section ─────────────────────────────────────── */
.hero {
  position: relative;
  background-color: var(--color-bg-hero);
  padding-top: calc(var(--space-16) + var(--space-4));
  padding-bottom: var(--space-16);
  text-align: center;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
}

.hero__icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  animation: fade-up 0.8s ease-out 0.1s both;
}

.hero__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--color-green);
  opacity: 0.4;
  animation: record-pulse 3.5s ease-in-out 0.9s infinite;
}

.hero__pulse-2 {
  animation-delay: 1.75s;
  opacity: 0.2;
}

.hero__eyebrow {
  animation: fade-up 0.6s ease-out 0.0s both;
}

.hero__headline {
  font-family: 'Lora', Georgia, serif;
  font-size: var(--text-hero);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--color-text-hero);
  animation: fade-up 0.8s ease-out 0.1s both;
}

.hero__sub {
  font-size: var(--text-large);
  color: var(--color-text-muted-dk);
  line-height: 1.6;
  max-width: 540px;
  animation: fade-up 0.7s ease-out 0.3s both;
}

.hero__cta-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  animation: fade-up 0.6s ease-out 0.5s both;
}

.hero__trust-line {
  font-size: var(--text-small);
  color: var(--color-text-muted-dk);
  letter-spacing: 0.04em;
}

.hero__waveform {
  margin-top: var(--space-6);
  animation: fade-up 0.6s ease-out 0.7s both;
}

.hero-sentinel {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* ── 9. Waveform SVG bars ─────────────────────────────────── */
.waveform-bar {
  transform-origin: bottom center;
  animation: waveform-grow 0.6s ease-out both;
}

/* ── 10. CTA buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease,
              transform 0.15s ease, box-shadow 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn:focus-visible {
  outline: 3px solid var(--color-green);
  outline-offset: 3px;
}

.btn--primary {
  font-size: 1rem;
  padding: 15px 30px;
  background-color: var(--color-green);
  color: #0f0d0b;
}

.btn--primary:hover {
  background-color: var(--color-green-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.25);
}

.btn--primary:active {
  background-color: var(--color-green-dim);
  transform: translateY(0);
  box-shadow: none;
}

.btn--ghost {
  font-size: var(--text-small);
  padding: 11px 22px;
  color: var(--color-text-muted-dk);
  border: 1px solid rgba(240, 235, 228, 0.40);
  background: transparent;
}

.btn--ghost:hover {
  color: var(--color-text-hero);
  border-color: rgba(240, 235, 228, 0.5);
}

.btn--ghost-lt {
  font-size: var(--text-small);
  padding: 10px 20px;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-lt);
  background: transparent;
}

.btn--ghost-lt:hover {
  color: var(--color-text-body);
  border-color: rgba(28, 25, 23, 0.25);
}

/* ── 11. Section: The moment ──────────────────────────────── */
.section-moment {
  background-color: var(--color-bg-white);
  padding-block: var(--space-20);
}

.section-moment__inner {
  display: flex;
  justify-content: center;
}

.section-moment__copy {
  max-width: 640px;
  text-align: center;
}

.section-moment__copy p {
  font-family: 'Lora', Georgia, serif;
  font-size: var(--text-h3);
  line-height: 1.65;
  color: var(--color-text-body);
  max-width: none;
}

.section-moment__copy p + p {
  margin-top: var(--space-4);
}

.section-moment__copy p:last-child {
  color: var(--color-text-muted);
  margin-top: var(--space-6);
  font-style: italic;
}

/* ── 12. Section: How it works ────────────────────────────── */
.section-how {
  background-color: var(--color-bg-cream);
}

.section-how__header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.section-how__subhead {
  margin-top: var(--space-2);
  font-size: var(--text-large);
  color: var(--color-text-muted);
  max-width: none;
}

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.step {
  background-color: var(--color-bg-white);
  border: 1px solid var(--color-border-lt);
  border-radius: 12px;
  padding: var(--space-4) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.step__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.step__number {
  font-family: 'Lora', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1;
  color: var(--color-amber);
  opacity: 0.7;
}

.step__icon {
  color: var(--color-green);
  flex-shrink: 0;
}

.step__title {
  font-family: 'Lora', Georgia, serif;
  font-size: var(--text-h3);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text-body);
}

.step__body {
  font-size: var(--text-body);
  color: var(--color-text-muted);
  line-height: 1.65;
  max-width: none;
}

/* ── 13. Section: Capture ────────────────────────────────── */
.section-capture {
  background-color: var(--color-bg-white);
}

.section-capture .section-label,
.section-retrieval .section-label,
.section-offline .section-label,
.section-intelligence .section-label {
  display: block;
  margin-bottom: var(--space-3);
}

.section-capture .two-col__text h2,
.section-retrieval .two-col__text h2,
.section-offline .two-col__text h2 {
  margin-bottom: var(--space-4);
}

.section-capture .two-col__text p,
.section-retrieval .two-col__text p,
.section-offline .two-col__text p {
  color: var(--color-text-muted);
  max-width: 56ch;
}

.section-capture .two-col__text p + p,
.section-retrieval .two-col__text p + p,
.section-offline .two-col__text p + p {
  margin-top: var(--space-3);
}

/* ── 14. Section label (eyebrow for feature sections) ────── */
.section-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: var(--text-caption);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-amber);
  opacity: 0.88;
}

.section-label--light {
  color: var(--color-text-dim-dk);
}

/* ── 15. Mockup visuals ──────────────────────────────────── */
.mockup-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.mockup-phone {
  width: 100%;
  max-width: 300px;
}

.mockup-search {
  width: 100%;
  max-width: 480px;
}

.mockup-diagram {
  width: 100%;
  max-width: 480px;
}

/* ── 16. Section: Retrieval ──────────────────────────────── */
.section-retrieval {
  background-color: var(--color-bg-cream);
}

.section-retrieval .two-col__text .detail-note {
  margin-top: var(--space-4);
  font-size: var(--text-small);
  font-style: italic;
  color: var(--color-text-dim);
  max-width: 48ch;
}

/* ── 17. Section: Privacy ────────────────────────────────── */
.section-privacy {
  background-color: var(--color-bg-dark);
  color: var(--color-text-hero);
}

.section-privacy__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.section-privacy .eyebrow {
  color: var(--color-amber);
  opacity: 0.9;
  margin-bottom: var(--space-4);
}

.section-privacy h2 {
  color: var(--color-text-hero);
  margin-bottom: var(--space-6);
}

.section-privacy .privacy-body {
  max-width: 640px;
  text-align: left;
}

.section-privacy .privacy-body p {
  color: var(--color-text-muted-dk);
  max-width: none;
}

.section-privacy .privacy-body p + p {
  margin-top: var(--space-3);
}

.section-privacy .privacy-body .highlight-line {
  font-family: 'Lora', Georgia, serif;
  font-size: var(--text-large);
  color: var(--color-text-hero);
  border-left: 2px solid var(--color-amber);
  padding-left: var(--space-3);
  margin-block: var(--space-6);
}

.section-privacy .diagram-wrap {
  margin-top: var(--space-10);
  width: 100%;
  max-width: 560px;
}

/* ── 18. Section: Offline ────────────────────────────────── */
.section-offline {
  background-color: var(--color-bg-white);
}

/* Offline status indicator — cards always stack vertically */
.offline-states {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.offline-state {
  padding: var(--space-6);
  border-radius: 12px;
  border: 1px solid rgba(28, 25, 23, 0.07);
  background-color: var(--color-bg-surface);
}

.offline-state__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-body);
  margin-bottom: var(--space-2);
}

.offline-state__badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.offline-state__badge .dot--green {
  background-color: var(--color-green);
}

.offline-state__badge .dot--amber {
  background-color: var(--color-amber);
}

.offline-state__label {
  font-size: var(--text-small);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.offline-state__features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.offline-state__features li {
  font-size: var(--text-small);
  color: var(--color-text-body);
  padding-left: 20px;
  position: relative;
  line-height: 1.7;
}

.offline-state__features li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--color-green);
  font-size: 0.75rem;
}

.offline-state__features li.unavailable {
  color: var(--color-text-muted);
}

.offline-state__features li.unavailable::before {
  content: '\25CB';
  color: var(--color-text-dim);
}

/* ── 19. Section: Intelligence ──────────────────────────── */
.section-intelligence {
  background-color: var(--color-bg-cream);
}

.section-intelligence__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.section-intelligence h2 {
  margin-bottom: var(--space-6);
}

.section-intelligence .intel-body {
  max-width: 600px;
  text-align: left;
}

.section-intelligence .intel-body p {
  color: var(--color-text-muted);
  max-width: none;
}

.section-intelligence .intel-body p + p {
  margin-top: var(--space-3);
}

.section-intelligence .positioning-line {
  margin-top: var(--space-8);
  font-family: 'Lora', Georgia, serif;
  font-size: var(--text-large);
  color: var(--color-text-body);
  font-style: italic;
  text-align: center;
  max-width: none;
}

/* ── 20. Section: Get started ────────────────────────────── */
.section-start {
  background-color: var(--color-bg-hero);
  color: var(--color-text-hero);
}

.section-start__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 600px;
  margin-inline: auto;
}

.section-start h2 {
  color: var(--color-text-hero);
  margin-bottom: var(--space-4);
}

.section-start .start-body {
  color: var(--color-text-muted-dk);
  max-width: 52ch;
  text-align: center;
}

.section-start .start-body p + p {
  margin-top: var(--space-3);
}

.section-start .cta-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.section-start .trust-lines {
  margin-top: var(--space-4);
  font-size: var(--text-small);
  color: var(--color-text-muted-dk);
  letter-spacing: 0.02em;
}

/* ── 21. Section: h2 base style ─────────────────────────── */
h2 {
  font-family: 'Lora', Georgia, serif;
  font-size: var(--text-h2);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h3 {
  font-family: 'Lora', Georgia, serif;
  font-size: var(--text-h3);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* ── 22. Footer ─────────────────────────────────────────── */
.footer {
  background-color: var(--color-bg-footer);
  color: var(--color-text-muted-dk);
  padding-block: var(--space-12);
  border-top: 1px solid rgba(240, 235, 228, 0.1);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer__logo {
  display: block;
  max-width: 260px;
  width: 100%;
  height: auto;
  object-fit: contain;
  margin-left: -16px;
  margin-bottom: 1rem;
}

.footer__tagline {
  font-size: var(--text-small);
  color: var(--color-text-muted-dk);
  max-width: none;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-left: 5rem;
}

.footer__links a {
  font-size: var(--text-small);
  color: rgba(240, 235, 228, 0.68);
  transition: color 0.2s;
}

.footer__links a:hover {
  color: var(--color-text-hero);
  text-decoration: none;
}

.footer__bottom {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(240, 235, 228, 0.09);
  font-size: var(--text-caption);
  color: rgba(240, 235, 228, 0.50);
  line-height: 1.6;
}

.footer__bottom p {
  max-width: none;
}

.footer__philosophy {
  margin-top: var(--space-3);
  font-style: italic;
  color: rgba(240, 235, 228, 0.42);
  letter-spacing: 0.01em;
}

/* ── 23. Scroll reveal ───────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal--delay-1 { transition-delay: 0.1s; }
.reveal--delay-2 { transition-delay: 0.2s; }
.reveal--delay-3 { transition-delay: 0.3s; }
.reveal--delay-4 { transition-delay: 0.4s; }

/* ── 24. Keyframes ───────────────────────────────────────── */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes record-pulse {
  0%   { transform: scale(1);    opacity: 0.5; }
  50%  { transform: scale(1.22); opacity: 0.08; }
  100% { transform: scale(1);    opacity: 0.5; }
}

@keyframes waveform-grow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

/* ── 25. Breakpoints ─────────────────────────────────────── */

/* Mobile: <640px */
@media (max-width: 639px) {
  .nav__cta {
    padding: 0.65rem 0.9rem;
    font-size: 0.875rem;
  }

  .footer__brand {
    align-items: center;
  }

  .footer__logo {
    margin-left: auto;
    margin-right: auto;
  }

  .footer__links {
    margin-left: 0;
    align-items: center;
  }
}

/* Tablet: 640px+ */
@media (min-width: 640px) {
  .container {
    padding-inline: var(--space-8);
  }

  .two-col {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }

  .two-col--reversed .two-col__visual {
    order: -1;
  }

  .footer__inner {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
  .section {
    padding-block: var(--space-20);
  }

  .section-moment {
    padding-block: calc(var(--space-20) + var(--space-4));
  }

  .container {
    padding-inline: var(--space-10);
  }

  .two-col {
    grid-template-columns: 5fr 4fr;
    gap: var(--space-12);
  }

  .steps {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }

  .hero {
    padding-top: calc(var(--space-16) + var(--space-6));
    padding-bottom: var(--space-12);
  }

  .hero__inner {
    gap: var(--space-4);
  }

  .hero__waveform {
    margin-top: var(--space-3);
  }

  .section-offline .two-col {
    grid-template-columns: 1fr 1fr;
  }

  .footer__inner {
    grid-template-columns: 2fr 1fr;
  }
}

/* Wide: 1280px+ */
@media (min-width: 1280px) {
  .container {
    padding-inline: var(--space-12);
  }
}

/* ── 26. Reduced motion (always last) ────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  * {
    animation: none !important;
    transition: none !important;
  }
}
