:root {
  --bg: #07070b;
  --bg-soft: #0d0d14;
  --panel: rgba(6, 6, 11, 0.58);
  --panel-border: rgba(255, 255, 255, 0.1);
  --copy-panel: rgba(5, 5, 9, 0.62);
  --ink: #f3f1ea;
  --ink-soft: rgba(243, 241, 234, 0.68);
  --ink-faint: rgba(243, 241, 234, 0.42);
  --gold: #e8c473;
  --violet: #8f7cff;
  --teal: #6fd6c9;
  --radius: 22px;
  --serif: "Fraunces", "Georgia", serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.no-webgl .chapter { background: radial-gradient(circle at 30% 20%, rgba(143, 124, 255, 0.12), transparent 60%), var(--bg); }

a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
p { line-height: 1.6; margin: 0; }

#scene-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.progress-rail {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 60;
  background: rgba(255, 255, 255, 0.06);
}
.progress-rail span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--violet), var(--gold));
  transition: width 0.05s linear;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 32px;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(7, 7, 11, 0.75), rgba(7, 7, 11, 0));
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 1.15rem; color: var(--ink); }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.site-nav { display: flex; gap: 28px; }
.site-nav a { text-decoration: none; font-size: 0.92rem; color: var(--ink-soft); transition: color 0.2s; }
.site-nav a:hover { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 16px; }
.language-switcher { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--panel-border); border-radius: 999px; padding: 4px; }
.language-switcher button {
  border: none; background: transparent; color: var(--ink-faint); padding: 5px 11px; border-radius: 999px;
  font-size: 0.78rem; letter-spacing: 0.04em; cursor: pointer; font-family: var(--sans); font-weight: 700;
}
.language-switcher button.active { background: var(--ink); color: var(--bg); }
.login-link { text-decoration: none; font-size: 0.9rem; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--ink-faint); padding-bottom: 2px; }

/* Layout */
main { position: relative; z-index: 2; }
.chapter {
  position: relative;
  min-height: 100vh;
  padding: 140px 8vw 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}
.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.section-heading-block { max-width: 640px; display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.section-heading-block h2 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); }
.section-heading-block p { color: var(--ink-soft); font-size: 1.05rem; }

/* Glass backdrop for copy blocks that sit over the busy 3D scene */
.section-heading-block,
.chaos-copy,
.gather-copy,
.final-copy,
.privacy > div,
.contact-copy {
  background: var(--copy-panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 30px 34px;
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
}
.gather-copy, .final-copy { display: flex; flex-direction: column; gap: 14px; }

/* Reveal animation base state (toggled via IntersectionObserver) */
.reveal { opacity: 0; transform: translateY(28px); }
.reveal.is-visible { opacity: 1; transform: translateY(0); transition: opacity 0.9s cubic-bezier(.2,.7,.2,1), transform 0.9s cubic-bezier(.2,.7,.2,1); }
.reveal-line { display: block; opacity: 0; transform: translateY(40px) rotateX(35deg); transform-origin: bottom; }
.reveal-line.is-visible { opacity: 1; transform: translateY(0) rotateX(0deg); transition: opacity 0.8s ease, transform 0.9s cubic-bezier(.2,.7,.2,1); }
.hero-title .reveal-line:nth-child(1) { transition-delay: 0.02s; }
.hero-title .reveal-line:nth-child(2) { transition-delay: 0.12s; }
.hero-title .reveal-line:nth-child(3) { transition-delay: 0.22s; }
.hero-title .reveal-line:nth-child(4) { transition-delay: 0.32s; }

/* HERO */
.hero { align-items: flex-start; padding-top: 160px; }
.hero-inner { max-width: 760px; perspective: 800px; }
.hero-title { font-size: clamp(3rem, 8vw, 6.4rem); line-height: 0.98; margin: 18px 0 26px; }
.hero-title .accent { background: linear-gradient(90deg, var(--gold), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-text { max-width: 480px; font-size: 1.15rem; color: var(--ink-soft); margin-bottom: 8px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.primary-action, .secondary-action {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 28px; border-radius: 999px; font-weight: 700; font-size: 0.95rem; text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.primary-action { background: linear-gradient(90deg, var(--gold), #f4dda0); color: #201804; box-shadow: 0 12px 32px -12px rgba(232, 196, 115, 0.6); }
.primary-action:hover { transform: translateY(-2px); }
.secondary-action { border: 1px solid var(--panel-border); color: var(--ink); background: var(--panel); }
.secondary-action:hover { border-color: rgba(255,255,255,0.25); }
.scroll-cue { position: absolute; bottom: 48px; left: 8vw; display: flex; align-items: center; gap: 10px; color: var(--ink-faint); font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; }
.scroll-cue i { width: 1px; height: 40px; background: linear-gradient(var(--ink-faint), transparent); display: block; animation: scrollcue 2.2s ease-in-out infinite; }
@keyframes scrollcue { 0%,100% { opacity: 0.2; } 50% { opacity: 1; } }

/* CHAOS */
.chaos { align-items: center; text-align: center; }
.chaos-copy { max-width: 620px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.chaos-copy h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
.chaos-copy p { color: var(--ink-soft); font-size: 1.05rem; }
.chaos-words { position: relative; height: 260px; margin-top: 20px; }
.chaos-word {
  position: absolute; top: 50%; left: 50%; white-space: nowrap;
  padding: 10px 20px; border-radius: 999px; background: var(--panel); border: 1px solid var(--panel-border);
  font-size: 0.95rem; color: var(--ink-soft);
  transform: translate(-50%, -50%) translate(var(--sx, 0px), var(--sy, 0px)) rotate(var(--sr, 0deg));
  transition: transform 1s cubic-bezier(.2,.8,.2,1);
}
.chaos-word:nth-child(1) { --sx: -260px; --sy: -70px; --sr: -8deg; }
.chaos-word:nth-child(2) { --sx: 220px; --sy: -40px; --sr: 6deg; }
.chaos-word:nth-child(3) { --sx: -200px; --sy: 60px; --sr: 5deg; }
.chaos-word:nth-child(4) { --sx: 240px; --sy: 90px; --sr: -6deg; }
.chaos-word.gathered:nth-child(1) { transform: translate(-50%, -50%) translate(0, -78px) rotate(0deg); }
.chaos-word.gathered:nth-child(2) { transform: translate(-50%, -50%) translate(0, -26px) rotate(0deg); }
.chaos-word.gathered:nth-child(3) { transform: translate(-50%, -50%) translate(0, 26px) rotate(0deg); }
.chaos-word.gathered:nth-child(4) { transform: translate(-50%, -50%) translate(0, 78px) rotate(0deg); }

/* GATHER */
.gather { align-items: center; text-align: center; gap: 14px; }
.gather h2 { font-size: clamp(2rem, 4vw, 3.2rem); max-width: 720px; margin: 0 auto; }
.gather-text { max-width: 520px; margin: 0 auto; color: var(--ink-soft); }
.ticker { width: 100%; overflow: hidden; margin-top: 40px; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.ticker-track { display: flex; gap: 14px; width: max-content; animation: ticker 26s linear infinite; }
.ticker-track span { padding: 10px 22px; border-radius: 999px; border: 1px solid var(--panel-border); background: var(--panel); font-size: 0.88rem; color: var(--ink-soft); white-space: nowrap; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* MODULES */
.modules { flex-direction: row; align-items: stretch; gap: 60px; min-height: 220vh; padding-top: 120px; }
.modules-sticky {
  position: sticky; top: 0; height: 100vh; flex: 0 0 320px;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 28px;
}
.module-index { font-family: var(--serif); display: flex; align-items: baseline; gap: 8px; }
.module-index #module-counter { font-size: 3.4rem; color: var(--ink); }
.module-index em { font-style: normal; color: var(--ink-faint); font-size: 1rem; }
.module-ring { display: flex; flex-direction: column; gap: 10px; }
.ring-dot { width: 34px; height: 6px; border-radius: 999px; background: var(--panel-border); transition: background 0.4s ease, width 0.4s ease; display: block; }
.ring-dot.active { background: linear-gradient(90deg, var(--gold), var(--violet)); width: 64px; }
.module-list { flex: 1; display: flex; flex-direction: column; gap: 26vh; padding: 8vh 0 20vh; max-width: 560px; }
.module-card { padding: 32px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--panel-border); backdrop-filter: blur(10px); opacity: 0.35; transform: translateY(10px); transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.5s ease; }
.module-card.active { opacity: 1; transform: translateY(0); border-color: rgba(232, 196, 115, 0.4); }
.module-num { color: var(--gold); font-family: var(--serif); font-size: 1.1rem; }
.module-card h3 { font-size: 1.6rem; margin: 10px 0 8px; }
.module-benefit { font-size: 1.05rem; color: var(--ink); margin-bottom: 6px; }
.module-text { color: var(--ink-soft); font-size: 0.95rem; }

/* SCREENS */
.screens { align-items: center; text-align: center; }
.phone-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 20px; perspective: 1400px; }
.phone-stage::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 420px; height: 420px;
  transform: translate(-50%, -55%);
  background: radial-gradient(circle, rgba(232, 196, 115, 0.22), rgba(143, 124, 255, 0.16) 45%, transparent 72%);
  filter: blur(10px);
  z-index: 0;
  pointer-events: none;
}
.phone-frame {
  position: relative;
  z-index: 1;
  width: min(260px, 60vw); aspect-ratio: 9 / 19.5; border-radius: 42px; padding: 10px;
  background: linear-gradient(160deg, #1c1c26, #08080c);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 40px 90px -24px rgba(0,0,0,0.85), 0 0 60px -10px rgba(143, 124, 255, 0.25), 0 0 0 1px rgba(255,255,255,0.03) inset;
  transform: rotateY(var(--ry, -12deg)) rotateX(var(--rx, 6deg));
  transition: transform 0.4s ease-out;
}
.phone-frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 32px;
  box-shadow: inset 0 0 40px 12px rgba(7, 7, 11, 0.75);
  background: radial-gradient(circle at 50% 20%, transparent 55%, rgba(7, 7, 11, 0.55) 100%);
  pointer-events: none;
}
.phone-frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 32px; display: block; filter: brightness(0.92) contrast(1.05) saturate(0.9); }
.phone-dots { display: flex; gap: 10px; }
.phone-dot { width: 8px; height: 8px; border-radius: 50%; border: none; background: var(--panel-border); cursor: pointer; }
.phone-dot.active { background: var(--gold); }
.phone-caption {
  position: relative; z-index: 1; color: var(--ink-soft); max-width: 420px;
  background: var(--copy-panel); border: 1px solid var(--panel-border); border-radius: 999px;
  padding: 10px 22px; backdrop-filter: blur(16px);
}

/* DAY ARC */
.day { align-items: center; }
.day-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; width: 100%; max-width: 980px; margin: 0 auto; }
.day-card { padding: 30px 26px; border-radius: var(--radius); border: 1px solid var(--panel-border); background: var(--panel); }
.day-card span { display: block; font-family: var(--serif); font-size: 1.3rem; margin-bottom: 10px; }
.day-card p { color: var(--ink-soft); font-size: 0.95rem; }
.day-card[data-tone="morning"] { border-color: rgba(232,196,115,0.35); }
.day-card[data-tone="evening"] { border-color: rgba(143,124,255,0.35); }

/* PRIVACY */
.privacy { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.privacy h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); margin-top: 12px; }
.privacy-points { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; }
.privacy-points span { padding-left: 22px; position: relative; color: var(--ink-soft); font-size: 0.98rem; }
.privacy-points span::before { content: ""; position: absolute; left: 0; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.legal-links { display: flex; gap: 22px; }
.legal-links a { text-decoration: none; font-size: 0.9rem; color: var(--ink-soft); border-bottom: 1px solid var(--panel-border); padding-bottom: 2px; }

/* FAQ */
.faq { align-items: center; }
.faq-list { width: 100%; max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-list details { border: 1px solid var(--panel-border); background: var(--panel); border-radius: 16px; padding: 18px 22px; }
.faq-list summary { cursor: pointer; font-weight: 700; font-size: 1.02rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--gold); font-size: 1.3rem; }
.faq-list details[open] summary::after { content: "–"; }
.faq-list p { margin-top: 12px; color: var(--ink-soft); font-size: 0.95rem; }

/* EARLY ACCESS */
.early { align-items: center; }
.early-access-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: center; }
.early-access-grid article { padding: 20px 26px; border-radius: 16px; border: 1px solid var(--panel-border); background: var(--panel); min-width: 220px; }
.early-access-grid article strong { display: block; margin-bottom: 6px; }
.early-access-grid article span { color: var(--ink-soft); font-size: 0.9rem; }

/* CONTACT */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.contact-copy h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); margin: 12px 0; }
.contact-copy p { color: var(--ink-soft); }
.contact-form { display: flex; flex-direction: column; gap: 16px; padding: 30px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--panel-border); }
.contact-form label { display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; color: var(--ink-soft); }
.contact-form input, .contact-form textarea {
  background: rgba(255,255,255,0.03); border: 1px solid var(--panel-border); border-radius: 12px; padding: 12px 14px;
  color: var(--ink); font-family: var(--sans); font-size: 0.95rem;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--gold); }
.contact-status { min-height: 20px; font-size: 0.88rem; }
.contact-status[data-tone="success"] { color: var(--teal); }
.contact-status[data-tone="error"] { color: #ff9a8a; }

/* FINAL CTA */
.final-cta { align-items: center; text-align: center; gap: 18px; }
.final-cta h2 { font-size: clamp(2rem, 4vw, 3.4rem); max-width: 720px; margin: 0 auto; }
.final-cta p { max-width: 520px; margin: 0 auto; color: var(--ink-soft); }
.final-cta .hero-actions { justify-content: center; }

/* FOOTER */
.site-footer {
  position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px;
  padding: 48px 8vw; border-top: 1px solid var(--panel-border); background: rgba(7,7,11,0.6);
}
.site-footer strong { font-family: var(--serif); font-size: 1.1rem; }
.site-footer p { color: var(--ink-faint); max-width: 320px; margin-top: 8px; font-size: 0.9rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.site-footer nav a { text-decoration: none; color: var(--ink-soft); font-size: 0.9rem; }

@media (max-width: 900px) {
  .privacy, .contact { grid-template-columns: 1fr; }
  .modules { flex-direction: column; min-height: unset; gap: 30px; }
  .modules-sticky { position: relative; top: unset; height: auto; flex-direction: row; justify-content: space-between; }
  .module-list { gap: 20px; padding: 0; max-width: none; }
  .day-grid { grid-template-columns: 1fr; }
  .chapter { padding: 110px 6vw 90px; }
  .chaos-words { height: auto; display: flex; flex-direction: column; gap: 12px; align-items: center; }
  .chaos-word { position: static; transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal-line { opacity: 1 !important; transform: none !important; }
  .ticker-track { animation: none; }
}
