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

:root {
  --bg-color: #030303;
  --text-primary: #f5f5f7;
  --accent-white: #ffffff;
  --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease-apple: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-snap-type: y mandatory;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-stack);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  user-select: none;
  -webkit-user-select: none;
  overflow-x: hidden;
}

/* Minimal Top Buffer Bar */
.loader-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.95));
  z-index: 100;
  pointer-events: none;
  transition: width 0.12s ease-out, opacity 0.5s ease-out;
}

.loader-bar.complete {
  opacity: 0;
}

/* Pinned Background Canvas Layer */
.canvas-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  background: var(--bg-color);
}

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

/* Subtle Vignette for Contrast & Focus */
.vignette-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(3, 3, 3, 0.1) 40%, rgba(3, 3, 3, 0.65) 100%);
  pointer-events: none;
}

/* Dynamic Ambient Scrim (Apple Contrast Veil over Light Rays) */
.ambient-scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 75% 65% at 50% 50%, rgba(3, 3, 6, 0.78) 0%, rgba(3, 3, 6, 0.52) 48%, rgba(3, 3, 6, 0.18) 78%, transparent 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity;
}

/* Apple-Minimalist Overlay Numerals & Feature Stages */
.milestones-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
}

.milestone-num {
  position: absolute;
  font-size: clamp(8rem, 22vw, 17rem);
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--accent-white);
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: scale(0.92);
  will-change: opacity, transform;
  pointer-events: none;
}

/* Framer-Specified Headline Style for Milestone 1 */
.milestone-num.milestone-headline {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  font-size: clamp(32px, 4.5vw, 56px);
  font-weight: 700;
  letter-spacing: -1.2px;
  line-height: 1.15em;
  text-align: center;
  color: #ffffff;
  max-width: min(92vw, 980px);
  width: max-content;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
  padding: 0 1.5rem;
}

/* Apple AirPods Pro Feature Layout Style for Milestone 2 */
.milestone-num.milestone-feature {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  max-width: min(92vw, 780px);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1.5rem;
  line-height: 1;
}

.feature-eyebrow {
  font-size: clamp(16px, 1.8vw, 21px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

.feature-headline {
  font-size: clamp(38px, 6vw, 74px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08em;
  color: #ffffff;
  margin: 0 0 1.35rem 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95), 0 8px 32px rgba(0, 0, 0, 0.95), 0 0 45px rgba(0, 0, 0, 0.85);
}

.feature-body {
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: 400;
  line-height: 1.55em;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.94);
  max-width: min(90vw, 680px);
  margin: 0 auto;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95), 0 4px 20px rgba(0, 0, 0, 0.9);
}

/* =========================================================
   Section 3: Persistent Header & Frosted Glass Showcase Cards
   ========================================================= */

.section3-pinned-header {
  position: fixed;
  top: clamp(2.4rem, 5.6vh, 4.4rem);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 15;
  pointer-events: none;
  opacity: 0;
  width: min(92vw, 920px);
  will-change: opacity, transform;
}

.pinned-eyebrow {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  font-size: clamp(12px, 1.2vw, 14px);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.pinned-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  font-size: clamp(32px, 4.6vw, 54px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 4px 32px rgba(0, 0, 0, 0.85), 0 1px 2px rgba(0, 0, 0, 0.9);
}

/* Apple Frosted Glass Showcase Cards (Stages 3a, 3b, 3c) */
.milestone-num.milestone-card {
  position: fixed;
  top: clamp(210px, 34vh, 350px);
  left: 50%;
  transform: translate(-50%, 0);
  width: min(92vw, 800px);
  background: rgba(10, 10, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  padding: clamp(1.8rem, 3.2vh, 2.4rem) clamp(1.6rem, 3.4vw, 2.8rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  will-change: opacity, transform;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  line-height: 1;
}

.card-headline {
  font-size: clamp(20px, 2.3vw, 27px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
  text-wrap: balance;
  color: #f5f5f7;
  margin: 0 0 0.85rem 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.card-body {
  font-size: clamp(15px, 1.5vw, 17px);
  font-weight: 400;
  line-height: 1.6em;
  letter-spacing: -0.01em;
  color: rgba(245, 245, 247, 0.86);
  max-width: 620px;
  margin: 0 auto;
}

/* 3b: Living Matter Corpus Pills */
.matter-corpus-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 620px;
  margin: 1.1rem auto 0 auto;
}

.corpus-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.48rem 1.05rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  font-size: clamp(12.5px, 1.2vw, 14px);
  font-weight: 500;
  letter-spacing: -0.01em;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.corpus-pill.highlight {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.22);
}

/* =========================================================
   Milestone 4: Introducing Chambers (Apple Keynote Reveal)
   ========================================================= */

.milestone-num.milestone-reveal {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  max-width: min(92vw, 980px);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1.5rem;
  line-height: 1;
}

.reveal-lead {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  font-size: clamp(44px, 6.4vw, 78px);
  font-weight: 700;
  letter-spacing: -0.038em;
  line-height: 1.08em;
  color: #ffffff;
  margin: 0 0 1.15rem 0;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.95), 0 2px 10px rgba(0, 0, 0, 0.95), 0 0 50px rgba(0, 0, 0, 0.85);
  text-wrap: balance;
}

.reveal-sub {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  font-size: clamp(28px, 4.2vw, 50px);
  font-weight: 500;
  letter-spacing: -0.026em;
  line-height: 1.2em;
  color: rgba(245, 245, 247, 0.84);
  margin: 0;
  max-width: min(92vw, 860px);
  text-shadow: 0 3px 20px rgba(0, 0, 0, 0.95), 0 1px 8px rgba(0, 0, 0, 0.9);
  text-wrap: balance;
}

/* Edge Pagination Navigation Dots */
.pagination-nav {
  position: fixed;
  right: clamp(1.2rem, 3vw, 2.5rem);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 20;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  padding: 0;
  transition:
    background 0.3s var(--ease-apple),
    border-color 0.3s var(--ease-apple),
    transform 0.3s var(--ease-apple),
    box-shadow 0.3s var(--ease-apple);
  outline: none;
}

.nav-dot:hover {
  border-color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.2);
}

.nav-dot.active {
  background: var(--accent-white);
  border-color: var(--accent-white);
  transform: scale(1.45);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

/* Native Scroll Runway with Extra Scroll Distance & Scroll-Snap */
.scroll-container {
  position: relative;
  width: 100%;
}

.milestone-section {
  width: 100%;
  height: 150vh; /* Extra comfortable scroll runway between checkpoints */
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  pointer-events: none;
}

.milestone-section:last-child {
  height: 100vh;
}
