/* ============================================================
   AeroClear — Single-Phase Smart Aligner Landing Page
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
  --bg-light: #f8fafc;
  --bg-dark: #0f172a;
  --accent-blue: #38bdf8;
  --accent-mint: #34d399;
  --text-on-light: #1e293b;
  --text-on-dark: #f8fafc;
  --text-muted: #64748b;
  --font-display: 'Oakes', 'Outfit', 'Helvetica Neue', sans-serif;
  --font-body: 'Inter', sans-serif;
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-on-light);
  background: var(--bg-light);
  overflow-x: hidden;
  line-height: 1.6;
}

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

strong {
  font-weight: 600;
}

/* ============================================================
   LOADER
   ============================================================ */
#loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  transition: opacity 0.6s var(--ease-out-expo), visibility 0.6s var(--ease-out-expo);
}

#loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-brand {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-on-light);
}

#loader-bar-wrap {
  width: 200px;
  height: 2px;
  background: #e2e8f0;
  border-radius: 1px;
  overflow: hidden;
}

#loader-bar {
  width: 0%;
  height: 100%;
  background: var(--text-on-light);
  border-radius: 1px;
  transition: width 0.15s ease-out;
}

#loader-percent {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 24px 5vw;
  pointer-events: none;
}

.header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.header-logo,
.header-cta {
  pointer-events: auto;
}

.header-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-on-light);
}

.header-cta {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-on-light);
  padding: 10px 22px;
  border: 1px solid rgba(30, 41, 59, 0.25);
  border-radius: 100px;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.header-cta:hover {
  background: var(--text-on-light);
  color: var(--bg-light);
  border-color: var(--text-on-light);
}

/* Header transitions when over video canvas */
.site-header.over-video .header-logo {
  color: var(--text-on-dark);
  transition: color 0.5s;
}

.site-header.over-video .header-cta {
  color: var(--text-on-dark);
  border-color: rgba(248, 250, 252, 0.35);
  transition: color 0.5s, border-color 0.5s;
}

.site-header.over-video .header-cta:hover {
  background: var(--text-on-dark);
  color: var(--bg-dark);
  border-color: var(--text-on-dark);
}

/* ============================================================
   HERO (standalone 100vh)
   ============================================================ */
.hero-standalone {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  z-index: 50;
  background: var(--bg-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.hero-inner {
  max-width: 900px;
  padding: 0 5vw;
}

.hero-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-blue);
  margin-bottom: 28px;
}

.hero-heading {
  font-family: var(--font-display);
  font-size: clamp(6rem, 14vw, 14rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 0.9;
  color: var(--text-on-light);
  margin-bottom: 32px;
}

.hero-heading .char {
  display: inline-block;
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.hero-scroll-indicator span {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero-scroll-indicator svg {
  animation: scrollBounce 2s ease-in-out infinite;
  color: var(--text-muted);
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ============================================================
   CANVAS WRAP
   ============================================================ */
.canvas-wrap {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  z-index: 8;
  clip-path: circle(0% at 50% 50%);
  pointer-events: none;
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   DARK OVERLAY
   ============================================================ */
#dark-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  z-index: 12;
  background: var(--bg-dark);
  opacity: 0;
  pointer-events: none;
}

/* ============================================================
   MARQUEE
   ============================================================ */
.marquee-wrap {
  position: fixed;
  top: 50%;
  left: 0;
  width: 100%;
  z-index: 30;
  transform: translateY(-50%);
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}

.marquee-text {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 10rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-on-dark);
  white-space: nowrap;
  will-change: transform;
}

/* ============================================================
   SCROLL CONTAINER
   ============================================================ */
#scroll-container {
  position: relative;
  height: 900vh;
  z-index: 18;
}

/* ============================================================
   SCROLL SECTIONS
   ============================================================ */
.scroll-section {
  position: absolute;
  width: 100%;
  pointer-events: none;
}

.section-inner {
  pointer-events: auto;
}

/* Side alignment zones */
.align-left {
  padding-left: 5vw;
  padding-right: 55vw;
}

.align-right {
  padding-left: 55vw;
  padding-right: 5vw;
}

.align-left .section-inner,
.align-right .section-inner {
  max-width: 40vw;
}

/* Section typography */
.section-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-blue);
  margin-bottom: 20px;
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4.5vw, 4.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--text-on-light);
  margin-bottom: 28px;
}

.section-body {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  font-weight: 400;
  line-height: 1.75;
  color: #475569;
  max-width: 520px;
}

/* ============================================================
   STATS SECTION (center with dark overlay)
   ============================================================ */
.section-stats {
  padding-left: 5vw;
  padding-right: 5vw;
  text-align: center;
}

.section-stats .section-inner {
  max-width: 100%;
}

.stats-grid {
  display: flex;
  justify-content: center;
  gap: clamp(40px, 8vw, 100px);
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.stat-number-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8vw, 8rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-on-dark);
}

.stat-suffix {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-on-dark);
  opacity: 0.6;
}

.stat-label {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-on-dark);
  opacity: 0.5;
}

/* ============================================================
   CTA SECTION
   ============================================================ */
.section-cta {
  padding-left: 5vw;
  padding-right: 5vw;
  text-align: center;
}

.section-cta .section-inner {
  max-width: 700px;
  margin: 0 auto;
}

.cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.cta-heading {
  color: var(--text-on-light);
  margin-bottom: 0;
}

.cta-body {
  color: #475569;
  max-width: 480px;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--bg-light);
  background: var(--text-on-light);
  padding: 16px 36px;
  border-radius: 100px;
  transition: background 0.3s, transform 0.3s;
}

.cta-button:hover {
  background: #0f172a;
  transform: translateY(-2px);
}

.cta-arrow {
  transition: transform 0.3s;
}

.cta-button:hover .cta-arrow {
  transform: translateX(4px);
}

.cta-price {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ============================================================
   MOBILE (< 768px)
   ============================================================ */
@media (max-width: 768px) {

  /* Collapse side alignment to centered with dark backdrops */
  .align-left,
  .align-right {
    padding-left: 6vw;
    padding-right: 6vw;
    text-align: center;
  }

  .align-left .section-inner,
  .align-right .section-inner {
    max-width: 100%;
  }

  .section-body {
    max-width: 100%;
    margin: 0 auto;
  }

  /* Add subtle dark backdrop behind mobile text for readability over canvas */
  .section-content .section-inner {
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 32px 24px;
  }

  /* Reduce scroll height */
  #scroll-container {
    height: 550vh;
  }

  /* Smaller stats */
  .stats-grid {
    gap: 32px;
  }

  .stat-number {
    font-size: clamp(2.5rem, 10vw, 4.5rem);
  }

  /* Reduce header padding */
  .site-header {
    padding: 16px 6vw;
  }

  /* Smaller hero */
  .hero-heading {
    font-size: clamp(3.5rem, 12vw, 7rem);
  }

  .hero-tagline {
    font-size: 0.95rem;
  }

  /* Keep CTA button touch-friendly */
  .cta-button {
    padding: 14px 30px;
    font-size: 0.9375rem;
  }

  /* Adjust marquee */
  .marquee-text {
    font-size: clamp(2rem, 8vw, 5rem);
  }
}

/* Small phones */
@media (max-width: 480px) {
  .hero-heading {
    font-size: 3.2rem;
  }

  .section-heading {
    font-size: 2rem;
  }

  .stats-grid {
    flex-direction: column;
    gap: 28px;
  }

  #scroll-container {
    height: 480vh;
  }
}
