:root {
  --ink: #f4f1ea;
  --ink-dim: rgba(244, 241, 234, 0.72);
  --accent: #d8b97a;
  --bg: #0a0c0a;
  --sans: "Inter", "Helvetica Neue", "Segoe UI", Arial, sans-serif;
}

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

html { background: var(--bg); }
html, body { overscroll-behavior-y: none; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Preloader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: opacity 0.9s ease, visibility 0.9s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-mark {
  font-size: clamp(44px, 7vw, 84px);
  font-weight: 200;
  letter-spacing: 0.42em;
  margin-left: 0.42em; /* optically recenters tracked text */
}
.loader-sub {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.6em;
  margin-left: 0.6em;
  color: var(--ink-dim);
  margin-bottom: 34px;
}
.loader-bar {
  width: min(240px, 60vw);
  height: 1px;
  background: rgba(244, 241, 234, 0.15);
}
.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.25s ease;
}
.loader-pct {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}

/* ---------- Stage ---------- */
.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(4, 5, 4, 0.55) 0%, rgba(4, 5, 4, 0.28) 60%, rgba(4, 5, 4, 0.12) 100%);
  opacity: 0;
  pointer-events: none;
}
.vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 52%, rgba(5, 6, 5, 0.55) 100%),
    linear-gradient(to bottom, rgba(5, 6, 5, 0.35), transparent 22%, transparent 72%, rgba(5, 6, 5, 0.55));
  pointer-events: none;
}
.grain {
  position: absolute;
  inset: -100px;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-40px, 30px); }
  50% { transform: translate(30px, -50px); }
  75% { transform: translate(-30px, -20px); }
  100% { transform: translate(0, 0); }
}
/* ---------- Header ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 4vw, 56px);
}
.logo {
  color: var(--ink);
  text-decoration: none;
  font-weight: 300;
  font-size: 20px;
  letter-spacing: 0.34em;
}
.logo span {
  display: block;
  font-size: 8px;
  letter-spacing: 0.62em;
  color: var(--ink-dim);
  margin-top: 3px;
}
.header-cta {
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 12px 22px;
  border: 1px solid rgba(244, 241, 234, 0.35);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  background: rgba(10, 12, 10, 0.2);
  transition: background 0.3s, border-color 0.3s;
}
.header-cta:hover {
  background: rgba(244, 241, 234, 0.12);
  border-color: rgba(244, 241, 234, 0.7);
}

/* ---------- Progress line ---------- */
.progress-line {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 30;
  background: transparent;
}
.progress-line-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
}

/* ---------- Dots nav ---------- */
.dots {
  position: fixed;
  right: clamp(16px, 3vw, 40px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.dot {
  position: relative;
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: rgba(244, 241, 234, 0.3);
  cursor: pointer;
  padding: 0;
  transition: background 0.3s, transform 0.3s;
}
.dot:hover { background: rgba(244, 241, 234, 0.7); }
.dot.active {
  background: var(--accent);
  transform: scale(1.35);
}
.dot .tip {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.dot:hover .tip, .dot.active .tip { opacity: 1; }

/* ---------- Chapter counter ---------- */
.chapter-counter {
  position: fixed;
  left: clamp(20px, 4vw, 56px);
  bottom: clamp(28px, 5vh, 56px);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
}
.chapter-num {
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.chapter-sep {
  width: 44px;
  height: 1px;
  background: rgba(244, 241, 234, 0.3);
}
.chapter-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ---------- Scroll hint ---------- */
.scroll-hint {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: clamp(32px, 6vh, 64px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: opacity 0.6s;
}
.scroll-hint.hidden { opacity: 0; }
.scroll-hint-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: hint 2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes hint {
  0% { transform: scaleY(0); opacity: 0; }
  40% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(18px); opacity: 0; }
}

/* ---------- Overlays ---------- */
.overlays {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(24px, 6vw, 96px);
  opacity: 0;
  visibility: hidden;
}
.overlay-center { align-items: center; text-align: center; }
.overlay-left { align-items: flex-start; text-align: left; }
.overlay-left > * { max-width: 560px; }
.overlay-right { align-items: flex-end; text-align: right; }
.overlay-right > * { max-width: 560px; }

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 26px;
}
.display {
  font-size: clamp(34px, 5.4vw, 74px);
  font-weight: 200;
  line-height: 1.12;
  letter-spacing: 0.01em;
  text-wrap: balance;
}
.title {
  font-size: clamp(30px, 4.2vw, 58px);
  font-weight: 200;
  line-height: 1.14;
  text-wrap: balance;
}
.lede {
  margin-top: 28px;
  font-size: clamp(15px, 1.4vw, 19px);
  font-weight: 300;
  line-height: 1.65;
  color: var(--ink-dim);
}
.body {
  margin-top: 24px;
  font-size: clamp(15px, 1.3vw, 18px);
  font-weight: 300;
  line-height: 1.7;
  color: var(--ink-dim);
}

/* text shadow for readability over bright frames */
.overlay h1, .overlay h2, .overlay p, .overlay li, .stat {
  text-shadow: 0 1px 22px rgba(0, 0, 0, 0.55), 0 1px 4px rgba(0, 0, 0, 0.35);
}

.steps {
  list-style: none;
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  font-size: clamp(14px, 1.25vw, 17px);
  font-weight: 300;
  color: var(--ink);
}
.steps li {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 16px;
}
.overlay-left .steps li { justify-content: flex-start; }
.steps i {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent);
  min-width: 22px;
  text-align: right;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: clamp(28px, 5vw, 84px);
  margin-top: 10px;
}
.stat b {
  display: block;
  font-size: clamp(30px, 4vw, 58px);
  font-weight: 200;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.stat span {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.cta-row {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.btn {
  display: inline-block;
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 17px 36px;
  border-radius: 999px;
  transition: transform 0.3s, background 0.3s, border-color 0.3s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--accent);
  color: #131108;
  border: 1px solid var(--accent);
  font-weight: 500;
}
.btn-ghost {
  color: var(--ink);
  border: 1px solid rgba(244, 241, 234, 0.4);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { border-color: rgba(244, 241, 234, 0.85); }

/* ---------- Scroll track ---------- */
.scroll-track {
  position: relative;
  width: 1px;
  height: 700vh; /* overwritten by JS */
  pointer-events: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .stats { grid-template-columns: repeat(2, auto); gap: 30px 48px; }
  .dots .tip { display: none; }
  .chapter-counter { display: none; }
  .header-cta { padding: 10px 16px; font-size: 10px; }
  .overlay-left > *, .overlay-right > * { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .grain, .scroll-hint-line { animation: none; }
}
