/* ============================================
   Astrolaabh · Our Story — scroll film
   ============================================ */
:root {
  --warm-bone: #f4ecdd;
  --beige: #d9d2bf;
  --champagne-gold: #c3a058;
  --matte-gold: #b08a3e;
  --deep-olive: #3a4030;
  --ink: #20251a;
  --ink-soft: #595236;
  --paper: #f4ecdd;
  --font-title: "Cormorant Garamond", Georgia, serif;
  --font-body: "Outfit", -apple-system, sans-serif;
  --font-deva: "Noto Sans Devanagari", sans-serif;
  /* tokens the shared nav (site-nav.css) expects on every page */
  --nav-h: 76px;
  --pad-x: clamp(1.25rem, 5vw, 4.5rem);
  --font-ui: "Outfit", -apple-system, sans-serif;
}

/* ---------- Shared top nav on the film: fixed, auto-hide on scroll-down ---------- */
#site-nav .nav {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
  will-change: transform;
}
body.nav-hidden #site-nav .nav {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}
/* the nav carries its own centred brand mark, so drop the standalone film logo */
.story-logo { display: none; }

/* our-story only: solid opaque nav (no transparency / blur over the film) */
#site-nav .nav {
  background: #f6f4ec;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  background: #000;
  color: var(--warm-bone);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.gold-text { color: var(--champagne-gold); }

/* ---------- Film stage ---------- */
.film-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #000;
  pointer-events: none;
}
#film { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.film-vignette {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4), transparent 45%, transparent);
}
.film-grain {
  position: absolute; inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* ---------- Brand logo, top-centre ---------- */
.story-logo {
  position: fixed;
  top: 1.25rem; left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  display: block;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.5));
}
.story-logo img { height: 52px; width: auto; display: block; }
@media (max-width: 767px) { .story-logo img { height: 42px; } }

/* ---------- Slokas ---------- */
.slokas { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.sloka {
  position: absolute;
  height: 24px; width: auto;
  opacity: 0;
  mix-blend-mode: screen;
  filter: blur(0.6px) drop-shadow(0 0 14px rgba(195,160,88,0.2));
  transition: opacity 300ms linear, transform 300ms linear;
}
@media (max-width: 767px) { .slokas { display: none; } }

/* ---------- Overlay ---------- */
.film-overlay { position: fixed; inset: 0; z-index: 10; pointer-events: none; }

/* Chapters */
.chapter {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 0 6vw;
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px);
  transition: opacity 200ms linear, transform 200ms linear;
}
.chapter-scrim {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 46vh;
  pointer-events: none;
  background: linear-gradient(to top, rgba(6,6,4,0.82) 0%, rgba(6,6,4,0.5) 42%, rgba(6,6,4,0) 100%);
}
.chapter.tone-light .chapter-scrim {
  background: linear-gradient(to top, rgba(244,236,221,0.96) 0%, rgba(244,236,221,0.7) 40%, rgba(244,236,221,0) 100%);
}
.chapter-box {
  position: relative;
  max-width: 460px;
  margin: 0 auto;
}
/* vertical placement — bottom clearance keeps copy above the floating search bar */
.chapter { justify-content: flex-end; padding-bottom: calc(9svh + 6rem); }
.chapter.v-top { justify-content: flex-end; padding-bottom: calc(9svh + 6rem); }
@media (min-width: 768px) {
  .chapter { padding: 0 8vw; }
  .chapter.align-center { justify-content: flex-end; padding-bottom: 7.5rem; text-align: center; }
  .chapter.align-left { justify-content: center; text-align: left; }
  .chapter.align-left .chapter-box { margin-left: 0; margin-right: auto; }
  .chapter.align-right { justify-content: center; text-align: right; }
  .chapter.align-right .chapter-box { margin-right: 0; margin-left: auto; }
  .chapter.align-left .chapter-scrim,
  .chapter.align-right .chapter-scrim { display: none; }
  .chapter.v-top.align-left,
  .chapter.v-top.align-right { justify-content: flex-start; padding-top: 16svh; }
}
@media (max-width: 767px) {
  .chapter { align-items: center; text-align: center; }
  .chapter-box { margin: 0 auto; }
}

.chapter-eyebrow {
  font-family: var(--font-body);
  font-size: 0.625rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--champagne-gold);
  margin-bottom: 1rem;
}
.chapter h2 {
  font-family: var(--font-title);
  font-weight: 300;
  font-size: clamp(1.875rem, 4vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--warm-bone);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6), 0 2px 28px rgba(0,0,0,0.5);
  text-wrap: balance;
}
.chapter.tone-light h2 {
  font-weight: 400;
  color: var(--ink);
  text-shadow: 0 1px 8px rgba(244,236,221,0.55);
}
.chapter-rule {
  height: 1px;
  width: 3.5rem;
  background: var(--champagne-gold);
  opacity: 0.5;
  margin: 1.25rem 0;
}
.chapter.align-center .chapter-rule { margin-left: auto; margin-right: auto; }
.chapter.align-right .chapter-rule { margin-left: auto; }
.chapter p {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.9375rem;
  line-height: 1.8;
  max-width: 400px;
  color: rgba(217, 210, 191, 0.9);
  text-shadow: 0 1px 12px rgba(0,0,0,0.7);
  text-wrap: pretty;
}
.chapter.align-center p { margin-left: auto; margin-right: auto; }
.chapter.align-right p { margin-left: auto; }
.chapter.tone-light p {
  font-weight: 400;
  color: var(--ink);
  text-shadow: 0 1px 12px rgba(244,236,221,0.95), 0 0 28px rgba(244,236,221,0.75);
}
.chapter-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.75rem;
  height: 2.75rem;
  padding: 0 1.75rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.65625rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--warm-bone);
  border: 1px solid rgba(195,160,88,0.55);
  background: rgba(11,10,7,0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: auto;
  transition: background 0.3s ease, color 0.3s ease;
}
.chapter.tone-light .chapter-cta {
  color: var(--deep-olive);
  border-color: rgba(89,82,54,0.45);
  background: rgba(244,236,221,0.55);
}
.chapter-cta span { transition: transform 0.3s ease; }
.chapter-cta:hover span { transform: translateX(4px); }
.chapter.tone-light .chapter-cta:hover { background: var(--deep-olive); color: var(--warm-bone); }

/* ---------- Opening ---------- */
.opening {
  position: absolute;
  bottom: 6.5rem; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: opacity 700ms ease;
}
.zodiac {
  position: absolute;
  bottom: 0; left: 50%;
  transform: translate(-50%, 56%);
  width: 220px; max-width: none;
  opacity: 0.18;
  filter: saturate(0.6) brightness(1.15);
  animation: spin-slow 60s linear infinite;
  pointer-events: none;
}
@media (min-width: 768px) { .zodiac { width: 320px; } }
@keyframes spin-slow { to { transform: translate(-50%, 56%) rotate(360deg); } }
.blessing { display: flex; align-items: center; justify-content: center; gap: 1.25rem; }
.blessing .rule { width: 2.5rem; height: 1px; background: linear-gradient(90deg, transparent, rgba(195,160,88,0.7)); }
.blessing .rule:last-child { background: linear-gradient(270deg, transparent, rgba(195,160,88,0.7)); }
.blessing .deva {
  font-family: var(--font-deva);
  font-weight: 300;
  font-size: clamp(1.75rem, 3.5vw, 2.375rem);
  line-height: 1;
  letter-spacing: 0.06em;
  color: rgba(195,160,88,0.92);
  text-shadow: 0 0 26px rgba(195,160,88,0.35);
}
.blessing-sub {
  font-family: var(--font-body);
  font-weight: 300;
  margin-top: 0.75rem;
  font-size: clamp(0.8125rem, 1.4vw, 0.9375rem);
  line-height: 1.4;
  color: rgba(217,210,191,0.8);
  max-width: 440px;
}
.scroll-cue-label {
  font-family: var(--font-body);
  margin-top: 2.5rem;
  font-size: 0.65625rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(214,196,158,0.55);
}
.scroll-cue {
  position: relative;
  width: 1px; height: 2.5rem;
  margin-top: 0.9rem;
  overflow: hidden;
  background: rgba(255,255,255,0.15);
}
.scroll-cue-dot {
  position: absolute; left: 0; top: 0;
  width: 1px; height: 1rem;
  background: var(--champagne-gold);
  animation: cue-drop 2s ease-in-out infinite;
}
@keyframes cue-drop { 0% { transform: translateY(-100%); } 60%,100% { transform: translateY(250%); } }

/* ---------- Finale ---------- */
.finale {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(7svh + 6rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 1.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 250ms linear, transform 250ms linear;
}
@media (min-width: 768px) { .finale { bottom: 7.5rem; } }
.finale-eyebrow {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
  text-shadow: 0 1px 12px rgba(244,236,221,0.9);
}
.finale-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  height: 3rem;
  padding: 0 2.5rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  background: var(--deep-olive);
  color: var(--warm-bone);
  pointer-events: auto;
}
.finale-btn span { transition: transform 0.3s ease; }
.finale-btn:hover span { transform: translateX(4px); }
.finale-link {
  font-family: var(--font-body);
  margin-top: 1rem;
  font-size: 0.6875rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  pointer-events: auto;
  text-shadow: 0 1px 12px rgba(244,236,221,0.9);
  transition: color 0.3s ease;
}
.finale-link:hover { color: var(--deep-olive); }

/* ---------- Progress rail ---------- */
.rail {
  position: absolute;
  right: 2.5rem; top: 50%;
  transform: translateY(-50%);
  height: 46vh; width: 1px;
  background: rgba(255,255,255,0.1);
  pointer-events: auto;
}
@media (max-width: 767px) { .rail { display: none; } }
.rail-fill { position: absolute; top: 0; left: 0; width: 1px; background: var(--champagne-gold); height: 0; }
.rail-head {
  position: absolute;
  left: -3px;
  width: 7px; height: 7px;
  transform: rotate(45deg);
  background: var(--champagne-gold);
  box-shadow: 0 0 10px rgba(195,160,88,0.8);
  top: 0;
}
.rail-tick {
  position: absolute;
  left: -8px;
  width: 17px; height: 17px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer;
}
.rail-tick i {
  width: 5px; height: 5px;
  transform: rotate(45deg);
  background: rgba(244,236,221,0.3);
  transition: transform 0.3s ease, background 0.3s ease;
}
.rail-tick.reached i { background: var(--champagne-gold); }
.rail-tick:hover i { transform: rotate(45deg) scale(1.5); }
.rail-tick label {
  position: absolute;
  right: 1.5rem; top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 0.59375rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(217,210,191,0.85);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.rail-tick:hover label { opacity: 1; }

/* ---------- Sound toggle ---------- */
.sound-toggle {
  position: fixed;
  bottom: 1.25rem; left: 1.25rem;
  z-index: 70;
  width: 2.75rem; height: 2.75rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20,18,11,0.45);
  border: 1px solid rgba(195,160,88,0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--champagne-gold);
  cursor: pointer;
  transition: background 0.3s ease;
}
.sound-toggle:hover { background: rgba(20,18,11,0.7); }

/* ---------- Curtain ---------- */
.curtain {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #0e0d09;
  background-image: linear-gradient(rgba(14,13,9,0.58), rgba(14,13,9,0.72)), url("assets/story/frames/hero-hd/0000.webp");
  background-size: cover;
  background-position: center;
  transition: opacity 600ms ease;
}
.curtain.fade { opacity: 0; pointer-events: none; }
.curtain-mark { width: 140px; height: auto; animation: loader-breathe 2.4s ease-in-out infinite; }
@keyframes loader-breathe { 0%,100% { opacity: 0.7; transform: scale(0.98); } 50% { opacity: 1; transform: scale(1.02); } }
.curtain-bar {
  position: relative;
  margin-top: 2.25rem;
  width: 180px; height: 2px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(176,138,62,0.25);
}
.curtain-fill {
  position: absolute;
  inset-block: 0; left: 0;
  width: 0%;
  border-radius: 999px;
  background: var(--matte-gold);
  box-shadow: 0 0 10px rgba(176,138,62,0.5);
  transition: width 300ms ease;
}
.curtain-pct {
  font-family: var(--font-body);
  margin-top: 1rem;
  font-size: 0.65625rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(217,210,191,0.8);
  font-variant-numeric: tabular-nums;
}

/* search-bar home button — no link underline */
.ai-btn, .ai-home, .ai-home:hover, .ai-home:focus { text-decoration: none; }
.ai-home i { text-decoration: none; }

/* ---------- Scroll spacer ---------- */
.film-track { height: 4000vh; }

@media (prefers-reduced-motion: reduce) {
  .zodiac, .scroll-cue-dot, .curtain-mark { animation: none; }
}
