/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f5f5f7;
  --bg-canvas: #f5f5f7;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  overflow-x: hidden;
}

::selection {
  background: rgba(0, 113, 227, 0.15);
  color: var(--text-primary);
}

/* ===== LOADER ===== */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

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

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

.loader-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

.loader-progress {
  width: 200px;
  height: 2px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto 1rem;
}

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

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

/* ===== HEADER ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 3vw;
  height: 56px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

.logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo span {
  font-weight: 400;
  color: var(--text-secondary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.25s ease;
  letter-spacing: 0.01em;
}

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

.nav-cta {
  background: var(--accent) !important;
  color: #fff !important;
  padding: 0.45rem 1.2rem;
  border-radius: 980px;
  font-size: 0.82rem !important;
  transition: background 0.25s ease !important;
}

.nav-cta:hover {
  background: var(--accent-hover) !important;
}

/* ===== HERO ===== */
.hero-standalone {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: var(--bg);
  padding: 0 7vw;
  z-index: 10;
}

.hero-content {
  max-width: 600px;
}

.hero-heading {
  font-family: var(--font-display);
  font-size: clamp(4rem, 10vw, 10rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.hero-heading .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
}

.hero-tagline {
  font-size: clamp(1rem, 1.3vw, 1.25rem);
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 480px;
  font-weight: 400;
  opacity: 0;
  transform: translateY(20px);
}

.case-legal-note {
  margin-top: 14px;
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-tertiary);
  opacity: 0.5;
}

.scroll-indicator {
  position: absolute;
  bottom: 3rem;
  left: 7vw;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0;
}

.scroll-indicator svg {
  animation: bounce 2s ease-in-out infinite;
}

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

/* ===== CANVAS ===== */
.canvas-wrap {
  position: fixed;
  top: 0;
  right: 0;
  scale: 1.3;
  width: 60vw;
  height: 100vh;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  clip-path: circle(0% at 50% 50%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 18%);
  mask-image: linear-gradient(to right, transparent 0%, black 18%);
}

#canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ===== DARK OVERLAY ===== */
#dark-overlay {
  position: fixed;
  inset: 0;
  background: rgba(29, 29, 31, 0.92);
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s linear;
}

/* ===== MARQUEE ===== */
.marquee-wrap {
  position: fixed;
  bottom: 4vh;
  left: 0;
  width: 100vw;
  z-index: 5;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.marquee-text {
  font-family: var(--font-display);
  font-size: 10vw;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.04);
  white-space: nowrap;
  letter-spacing: -0.03em;
  will-change: transform;
  line-height: 1;
}

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

/* ===== SECTIONS ===== */
.scroll-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 45vw;
  height: 100vh;
  display: flex;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 7;
}

.scroll-section.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Text on the LEFT — animation stays on right via canvas */
.align-left {
  justify-content: flex-start;
  padding-left: 7vw;
  padding-right: 3vw;
}

.align-left .section-inner {
  max-width: 420px;
}

/* ===== SECTION TYPOGRAPHY ===== */
.section-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4.5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
}

.section-body {
  font-size: clamp(0.95rem, 1.1vw, 1.1rem);
  line-height: 1.7;
  color: var(--text-secondary);
  font-weight: 400;
}

.section-note {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-top: 0.8rem;
}

/* ===== STATS ===== */
.section-stats {
  width: 100vw;
  justify-content: center;
  align-items: center;
  z-index: 9;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3rem;
  max-width: 900px;
  width: 90vw;
  text-align: center;
}

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

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(3rem, 5vw, 5rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-suffix {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 2rem);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.2rem;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.6rem;
  letter-spacing: 0.03em;
}

/* ===== CTA ===== */
.cta-button {
  display: inline-block;
  margin-top: 2rem;
  padding: 1rem 2.8rem;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 980px;
  letter-spacing: 0.01em;
  transition: background 0.3s ease, transform 0.3s ease;
}

.cta-button:hover {
  background: var(--accent-hover);
  transform: scale(1.03);
}

/* ===== FOOTER ===== */
.site-footer {
  position: relative;
  z-index: 10;
  padding: 0.9rem 7vw;
  background: var(--bg);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
}

.site-footer p {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* ===== TEXT ON DARK OVERLAY ===== */
.section-stats .stat-number,
.section-stats .stat-suffix,
.section-stats .stat-label {
  position: relative;
  z-index: 7;
}

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

  /* --- Header --- */
  .nav-links {
    display: none;
  }

  /* --- Hero: keep original centered layout --- */
  .hero-standalone {
    padding: 0 6vw;
  }

  .hero-heading {
    font-size: clamp(2.6rem, 13vw, 4.5rem);
  }

  .hero-tagline {
    font-size: clamp(0.9rem, 4vw, 1.1rem);
    max-width: 100%;
  }

  .scroll-indicator {
    left: 6vw;
  }

  /* --- Canvas: top portion of screen, phone always fully visible --- */
  .canvas-wrap {
    width: 100vw;
    height: 54vh;
    top: 56px;
    bottom: auto;
    left: 0;
    right: 0;
    scale: 1;
    /* Fade bottom edge into page background — seamless transition to text */
    -webkit-mask-image: linear-gradient(to bottom, black 48%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 48%, transparent 100%);
  }

  /* --- Sections: anchored to bottom of screen — never overlap phone --- */
  .scroll-section {
    width: 100vw;
    height: auto;
    min-height: 42vh;
    top: auto;
    bottom: 0;
    left: 0;
    align-items: flex-start;
    padding: 1.2rem 6vw 2.5rem;
  }

  .align-left {
    justify-content: flex-start;
    padding-left: 6vw;
    padding-right: 6vw;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

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

  /* --- Stats: align to start so they sit in the bottom zone --- */
  .section-stats {
    justify-content: flex-start;
    align-items: flex-start;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 2.5rem;
    text-align: left;
  }

  .stat {
    align-items: flex-start;
  }

  /* --- Marquee: conflicts with bottom text zone — hide on mobile --- */
  .marquee-wrap {
    display: none;
  }

  /* --- Footer: slides in at the end, then sticks — won't scroll away on swipe --- */
  .site-footer {
    position: sticky;
    bottom: 0;
    z-index: 8;
    padding: 0.55rem 6vw;
  }

  /* --- Scroll container height --- */
  #scroll-container {
    height: 600vh;
  }

  /* --- Typography --- */
  .section-heading {
    font-size: clamp(1.9rem, 7.5vw, 3rem);
  }

  .section-body {
    font-size: clamp(0.85rem, 3.8vw, 1rem);
  }

  .stat-number {
    font-size: clamp(2.2rem, 8vw, 3.5rem);
  }

  .cta-button {
    padding: 0.85rem 2.2rem;
    font-size: 0.95rem;
    margin-top: 1.2rem;
  }
}

/* ===== SMOOTH TRANSITIONS ===== */
.scroll-section {
  transition: opacity 0.4s ease;
}
