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

:root {
  --bg: #0a0a0a;
  --text: #f0efe8;
  --muted: #707070;
  --accent: #7c4dff;
  --accent-glow: rgba(124, 77, 255, 0.35);
  --nav-h: 64px;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
}

body.nav-open { overflow: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Nav ---- */
#nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  padding: 0 24px;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--nav-h) + env(safe-area-inset-top));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: background 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}

#nav.scrolled {
  background: rgba(10, 10, 10, 0.88);
  border-bottom-color: rgba(255,255,255,0.06);
}

.nav-logo {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  display: none;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a:focus-visible { color: var(--text); }

.nav-signin {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.nav-signin:hover,
.nav-signin:focus-visible { color: var(--text); }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 8px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.35s, opacity 0.35s;
}

.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (min-width: 768px) {
  .nav-links { display: flex; }
  .nav-hamburger { display: none; }
}

/* Mobile menu overlay */
.nav-mobile {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 8, 0.98);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 44px;
  padding: env(safe-area-inset-top) 24px env(safe-area-inset-bottom);
}

.nav-mobile.open { display: flex; }

.nav-mobile-close {
  position: absolute;
  top: calc(20px + env(safe-area-inset-top));
  right: 24px;
  font-size: 22px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-mobile-link {
  font-family: var(--serif);
  font-size: clamp(32px, 8vw, 48px);
  color: var(--text);
  text-decoration: none;
  font-style: italic;
  transition: color 0.2s;
}

.nav-mobile-link:hover,
.nav-mobile-link:focus-visible { color: var(--accent); }

/* ---- Hero ---- */
#hero {
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 32px 120px;
  position: relative;
  overflow: hidden;
}

.hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(56px, 13vw, 132px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-subtitle {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--muted);
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.6;
}

.hero-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: absolute;
  bottom: calc(72px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
}

@media (min-width: 768px) {
  .hero-scroll {
    bottom: 110px;
  }
}

.scroll-arrow {
  width: 18px;
  height: 18px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  animation: bounce 2.2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: rotate(45deg) translate(0,0); opacity: 0.4; }
  50% { transform: rotate(45deg) translate(4px, 4px); opacity: 1; }
}

/* ---- Chapter 1 ---- */
#chapter1 {
  display: flex;
  flex-direction: column;
}

.chapter1-sticky {
  position: sticky;
  top: calc(var(--nav-h) + env(safe-area-inset-top));
  z-index: 2;
  background: var(--bg);
  padding: 36px 28px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.chapter1-content { max-width: 520px; }

.step-tag {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.chapter1-title {
  font-family: var(--serif);
  font-size: clamp(26px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.chapter1-body {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.75;
}

.chapter1-steps { display: flex; flex-direction: column; }

.step {
  position: relative;
  height: 85dvh;
  overflow: hidden;
}

.step-media {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: hidden;
}

.step-media img {
  width: 100%;
  height: 120%;
  object-fit: cover;
  display: block;
  will-change: transform;
  transform: translateY(-10%);
}

@media (min-width: 768px) {
  #chapter1 { flex-direction: row; }

  .chapter1-sticky {
    flex: 0 0 44%;
    align-self: flex-start;
    height: calc(100dvh - var(--nav-h));
    display: flex;
    align-items: center;
    padding: 60px 48px 60px 80px;
    border-bottom: none;
    border-right: 1px solid rgba(255,255,255,0.05);
  }

  .chapter1-steps { flex: 0 0 56%; }

  .step { height: 100dvh; }
}

/* ---- Sequence Section ---- */
#sequence-section {
  position: relative;
  height: 320vh;
}

#canvas-wrap {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

#sequence-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
}

.sequence-label {
  position: absolute;
  bottom: 14%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 100%;
  padding: 0 24px;
  pointer-events: none;
}

.sequence-label h2 {
  font-family: var(--serif);
  font-size: clamp(22px, 4vw, 46px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.sequence-label p {
  font-size: 15px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.sequence-progress {
  position: absolute;
  bottom: 32px;
  right: calc(24px + env(safe-area-inset-right));
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.25);
  font-variant-numeric: tabular-nums;
}

/* ---- Chapter 2 ---- */
#chapter2 {
  position: relative;
  height: 160vh;
  background: #060606;
}

.chapter2-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}

.chapter2-content { text-align: center; max-width: 760px; }

.chapter2-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

.chapter2-title {
  font-family: var(--serif);
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 60px;
}

.stat-number {
  font-family: var(--serif);
  font-size: clamp(36px, 7vw, 80px);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* ---- Outro ---- */
#outro {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 32px;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

.outro-content { max-width: 560px; }

.outro-title {
  font-family: var(--serif);
  font-size: clamp(44px, 8vw, 88px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.outro-subtitle {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 48px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px 52px;
  min-height: 56px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 60px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 10px 40px var(--accent-glow);
}

.btn:active { transform: translateY(-1px); }

/* ---- Footer ---- */
footer {
  padding: 36px 32px;
  padding-bottom: calc(36px + env(safe-area-inset-bottom));
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.05);
  color: var(--muted);
  font-size: 13px;
}
