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

:root {
  --ease-cinematic: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: auto;
  overscroll-behavior: none;
}

body {
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  color: #fff;
  overscroll-behavior: none;
}

/* ── Loader ──────────────────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: opacity 0.8s var(--ease-cinematic), visibility 0.8s;
}

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

.loader-wordmark {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}

.loader-bar-track {
  width: 160px;
  height: 1px;
  background: rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
}

.loader-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: rgba(255,255,255,0.85);
  transition: width 0.15s linear;
}

.loader-pct {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.3);
  font-variant-numeric: tabular-nums;
}

/* ── Scroll container ────────────────────────────────────────── */
#scroll-container {
  position: relative;
  /* height set by JS based on frame count */
}

/* ── Sticky canvas stage ──────────────────────────────────────── */
#stage {
  position: sticky;
  top: 0;
  width: 100vw;
  height: 100vh;           /* fallback */
  height: 100dvh;          /* dynamic viewport — iOS Safari safe */
  height: var(--vh, 100vh);/* JS-set value — most accurate on iOS */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

#cinematic-canvas {
  display: block;
  /* sizing handled by JS to maintain aspect ratio */
  image-rendering: auto;
}

/* ── Scroll hint ─────────────────────────────────────────────── */
#scroll-hint {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 1;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

#scroll-hint.hidden {
  opacity: 0;
}

.scroll-hint-text {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

.scroll-hint-arrow {
  width: 20px;
  height: 28px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 10px;
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 5px;
}

.scroll-hint-dot {
  width: 3px;
  height: 6px;
  background: rgba(255,255,255,0.5);
  border-radius: 2px;
  animation: scroll-dot 1.6s var(--ease-cinematic) infinite;
}

@keyframes scroll-dot {
  0%   { transform: translateY(0);    opacity: 1; }
  60%  { transform: translateY(8px);  opacity: 0.2; }
  100% { transform: translateY(0);    opacity: 1; }
}

/* ════════════════════════════════════════════════════════════════
   HEADER / GLASS CAPSULE NAV
   ════════════════════════════════════════════════════════════════ */

:root {
  --nav-height: 52px;
  --nav-top: 20px;
  --glass-blur: 40px;
  --glass-saturate: 180%;
  --glass-bg: rgba(255,255,255,0.06);
  --glass-border: rgba(255,255,255,0.18);
  --glass-highlight: rgba(255,255,255,0.60);
  --glass-shadow: 0 25px 80px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.25);
  --nav-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-ease-fast: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Outer header wrapper ──────────────────────────────────────── */
#nav-header {
  position: fixed;
  top: calc(var(--nav-top) + env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 900;
  transform: translateX(-50%) translateY(0px);
  width: calc(100% - 48px);
  max-width: 960px;
  pointer-events: none;
  transition:
    top 0.5s var(--nav-ease),
    width 0.5s var(--nav-ease);
}

#nav-header.scrolled {
  --nav-top: 14px;
  --glass-blur: 56px;
  top: 14px;
}

/* ── Capsule ───────────────────────────────────────────────────── */
.nav-capsule {
  position: relative;
  display: flex;
  align-items: center;
  height: var(--nav-height);
  padding: 0 8px 0 18px;
  border-radius: 999px;
  pointer-events: all;

  /* Glass material */
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) brightness(110%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) brightness(110%);

  border: 1px solid var(--glass-border);

  box-shadow:
    var(--glass-shadow),
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -1px 0 rgba(255,255,255,0.04);

  transition:
    height 0.5s var(--nav-ease),
    box-shadow 0.5s var(--nav-ease),
    background 0.5s var(--nav-ease);
}

#nav-header.scrolled .nav-capsule {
  height: 46px;
  background: rgba(255,255,255,0.09);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.40),
    0 2px 8px rgba(0,0,0,0.30),
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -1px 0 rgba(255,255,255,0.04);
}

/* ── Top-edge optical highlight ───────────────────────────────── */
.nav-top-highlight {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.55) 30%,
    rgba(255,255,255,0.80) 50%,
    rgba(255,255,255,0.55) 70%,
    transparent 100%
  );
  border-radius: 999px;
  pointer-events: none;
}

/* ── Traveling glass reflection ───────────────────────────────── */
.nav-reflection {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  overflow: hidden;
  pointer-events: none;
}

.nav-reflection::after {
  content: '';
  position: absolute;
  top: -40%;
  left: -30%;
  width: 40%;
  height: 180%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255,255,255,0.03) 40%,
    rgba(255,255,255,0.07) 50%,
    rgba(255,255,255,0.03) 60%,
    transparent 100%
  );
  transform: skewX(-12deg);
  animation: glass-sweep 10s linear infinite;
}

@keyframes glass-sweep {
  0%   { left: -40%; }
  100% { left: 130%; }
}

/* ── Logo ──────────────────────────────────────────────────────── */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.3s var(--nav-ease);
}

.nav-logo:hover { opacity: 0.75; }

.logo-mark {
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.25));
}

.logo-wordmark {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgba(255,255,255,0.92);
}

/* ── Center nav links ──────────────────────────────────────────── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0 auto;
}

.nav-link {
  display: block;
  padding: 6px 14px;
  font-size: 13.5px;
  font-weight: 450;
  letter-spacing: -0.005em;
  color: rgba(255,255,255,0.58);
  text-decoration: none;
  border-radius: 999px;
  transition:
    color 0.25s var(--nav-ease),
    background 0.25s var(--nav-ease),
    transform 0.25s var(--nav-ease),
    opacity 0.25s var(--nav-ease);
  position: relative;
}

.nav-link:hover {
  color: rgba(255,255,255,0.95);
  transform: translateY(-1px);
  background: rgba(255,255,255,0.06);
}

.nav-link.active {
  color: rgba(255,255,255,0.95);
  font-weight: 500;
}

/* ── CTA button ────────────────────────────────────────────────── */
.nav-cta {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  flex-shrink: 0;
  padding: 0 18px;
  height: 34px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: rgba(255,255,255,0.92);
  text-decoration: none;
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.30);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 2px 12px rgba(0,0,0,0.2);
  transition:
    transform 0.3s var(--nav-ease),
    background 0.3s var(--nav-ease),
    box-shadow 0.3s var(--nav-ease);
  cursor: pointer;
}

.nav-cta:hover {
  transform: scale(1.04);
  background: rgba(255,255,255,0.20);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    0 0 20px rgba(255,255,255,0.10),
    0 4px 16px rgba(0,0,0,0.25);
}

/* Shine sweep on hover */
.cta-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255,255,255,0.18) 50%,
    transparent 70%
  );
  transform: translateX(-100%) skewX(-12deg);
  transition: transform 0s;
}

.nav-cta:hover .cta-shine {
  transform: translateX(200%) skewX(-12deg);
  transition: transform 0.5s var(--nav-ease);
}

/* ── Hamburger (mobile) ────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  border: none;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.nav-hamburger:hover { background: rgba(255,255,255,0.14); }

.nav-hamburger span {
  display: block;
  width: 14px;
  height: 1px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
  transition: transform 0.35s var(--nav-ease), opacity 0.25s ease;
  transform-origin: center;
}

/* Open state */
.nav-hamburger[aria-expanded="true"] span:first-child {
  transform: translateY(3px) rotate(45deg);
}
.nav-hamburger[aria-expanded="true"] span:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

/* ── Mobile panel ──────────────────────────────────────────────── */
.mobile-panel {
  position: fixed;
  top: calc(var(--nav-top) + var(--nav-height) + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: calc(100% - 48px);
  max-width: 960px;
  z-index: 880;
  padding: 20px;
  border-radius: 28px;
  background: rgba(10,10,10,0.75);
  backdrop-filter: blur(56px) saturate(160%);
  -webkit-backdrop-filter: blur(56px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.12);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.35s var(--nav-ease),
    transform 0.35s var(--nav-ease);
}

.mobile-panel.open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}

.mobile-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-link {
  display: block;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 450;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  border-radius: 14px;
  transition: color 0.2s ease, background 0.2s ease;
}

.mobile-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.07);
}

.mobile-cta {
  display: block;
  margin-top: 14px;
  padding: 13px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  border-radius: 14px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.20);
  transition: background 0.2s ease;
}

.mobile-cta:hover { background: rgba(255,255,255,0.16); }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 680px) {
  #nav-header {
    width: calc(100% - 32px);
  }

  .nav-links,
  .nav-cta {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .mobile-panel {
    width: calc(100% - 32px);
  }
}

/* ════════════════════════════════════════════════════════════════
   FOOTER GLASS CAPSULE
   ════════════════════════════════════════════════════════════════ */

#site-footer {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: 900;
  transform: translateX(-50%);
  pointer-events: none;
}

.footer-capsule {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  height: 40px;
  padding: 0 22px;
  border-radius: 999px;
  pointer-events: all;
  overflow: hidden;

  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) brightness(110%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) brightness(110%);
  border: 1px solid var(--glass-border);
  box-shadow:
    var(--glass-shadow),
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -1px 0 rgba(255,255,255,0.04);
}

/* Top-edge highlight — identical to nav */
.footer-top-highlight {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.55) 30%,
    rgba(255,255,255,0.80) 50%,
    rgba(255,255,255,0.55) 70%,
    transparent 100%
  );
  border-radius: 999px;
  pointer-events: none;
}

/* Traveling reflection — identical to nav */
.footer-reflection {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.footer-reflection::after {
  content: '';
  position: absolute;
  top: -40%;
  left: -30%;
  width: 40%;
  height: 180%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255,255,255,0.03) 40%,
    rgba(255,255,255,0.07) 50%,
    rgba(255,255,255,0.03) 60%,
    transparent 100%
  );
  transform: skewX(-12deg);
  animation: glass-sweep 10s linear infinite;
}

.footer-link {
  font-size: 12.5px;
  font-weight: 450;
  letter-spacing: -0.005em;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  padding: 0 4px;
  transition: color 0.25s var(--nav-ease);
}

.footer-link:hover {
  color: rgba(255,255,255,0.92);
}

.footer-divider {
  display: block;
  width: 1px;
  height: 12px;
  background: rgba(255,255,255,0.18);
  margin: 0 14px;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════
   STORY OVERLAY SYSTEM
   ════════════════════════════════════════════════════════════════ */

#story-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  pointer-events: none;
}

/* ── Story section ──────────────────────────────────────────── */
.story-section {
  position: absolute;
  bottom: 88px;
  left: 64px;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  will-change: opacity, transform;
}

/* Label */
.story-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  text-shadow: 0 1px 12px rgba(0,0,0,0.6);
}

/* Headline */
.story-headline {
  font-size: clamp(32px, 3.6vw, 56px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 0;
  text-shadow:
    0 2px 24px rgba(0,0,0,0.55),
    0 1px 4px rgba(0,0,0,0.4);
}

/* Bullets */
.story-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.story-bullets li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.60);
  letter-spacing: -0.005em;
  line-height: 1.4;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

.story-bullets li::before {
  content: '';
  flex-shrink: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.30);
}

/* CTA button */
.story-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 11px 22px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: rgba(255, 255, 255, 0.90);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 999px;
  pointer-events: auto;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    0 4px 16px rgba(0,0,0,0.25);
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.3s ease,
    box-shadow 0.3s ease;
}

.story-cta-btn:hover {
  transform: scale(1.03);
  background: rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.20),
    0 0 24px rgba(255,255,255,0.07),
    0 4px 20px rgba(0,0,0,0.3);
}

/* ── KPI clusters ───────────────────────────────────────────── */
.kpi-cluster {
  position: absolute;
  right: 64px;
  bottom: 120px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  will-change: opacity, transform;
}

.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 28px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  min-width: 180px;
}

.kpi-number {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.96);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.kpi-unit {
  font-size: 22px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.50);
  letter-spacing: -0.02em;
}

.kpi-label {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.42);
  margin-top: 2px;
}

/* ── Section progress indicator ─────────────────────────────── */
#story-progress {
  position: absolute;
  right: 64px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.prog-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transition: height 0.4s cubic-bezier(0.22, 1, 0.36, 1), background 0.4s ease;
}

.prog-dot.active {
  height: 20px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.75);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 680px) {
  /* Story section — sits above footer + safe area */
  .story-section {
    left: 20px;
    right: 20px;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    max-width: none;
    gap: 12px;
  }

  .story-label {
    font-size: 10px;
  }

  .story-headline {
    font-size: clamp(22px, 6.5vw, 30px);
  }

  .story-bullets li {
    font-size: 13px;
  }

  .story-cta-btn {
    font-size: 12px;
    padding: 10px 18px;
  }

  /* KPI — compact row, top of screen below nav */
  .kpi-cluster {
    left: 20px;
    right: 20px;
    bottom: auto;
    top: 86px;
    flex-direction: row;
    gap: 10px;
  }

  .kpi-card {
    flex: 1;
    padding: 12px 16px;
    min-width: 0;
    border-radius: 16px;
  }

  .kpi-number {
    font-size: 26px;
  }

  .kpi-unit {
    font-size: 16px;
  }

  .kpi-label {
    font-size: 10px;
  }

  /* Progress dots — bottom center, horizontal strip */
  #story-progress {
    right: auto;
    left: 50%;
    top: auto;
    bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    flex-direction: row;
    gap: 6px;
  }

  .prog-dot {
    width: 4px;
    height: 4px;
  }

  .prog-dot.active {
    width: 20px;
    height: 4px;
    border-radius: 2px;
  }
}
