/* =====================================================================
   Kerala — God's Own Country. Photo scroll experience.
   Two modes:
     • default (no JS / reduced-motion): scenes stack vertically, readable.
     • html.is-animated: scenes become a fixed full-screen stage; GSAP
       cross-fades them and Ken-Burns / parallaxes the photos on scroll.
   ===================================================================== */

:root {
  --cream: #f6f3ea;
  --gold: #ffd479;
  --maxcap: 30rem;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color: var(--cream);
  background: #0b0f0d;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.noscript-note {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  background: #14201b; color: var(--cream);
  padding: 12px 18px; font-size: 14px; text-align: center;
  font-family: system-ui, sans-serif;
}

/* ---- Scenes --------------------------------------------------------- */
.experience { position: relative; }
.scene {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

html.is-animated .experience { height: 800vh; } /* 8 scenes of scroll */
html.is-animated .scene {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  opacity: 0;
  will-change: opacity;
}

/* ---- Photo background (Ken-Burns target) ---------------------------- */
.bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.06);            /* slight overscan for parallax room */
  will-change: transform;
  z-index: 0;
}
/* The hero's scroll-scrubbed frame canvas: no Ken-Burns, fills the viewport. */
.bg--seq { transform: none; width: 100%; height: 100%; display: block; }
/* Poster shows through before JS paints, or if animation is off. */
.scene--intro { background: #0b0f0d url('assets/hero-poster.jpg') center/cover no-repeat; }

/* ---- Scrims (legibility) -------------------------------------------- */
.scrim { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.scrim--left   { background: linear-gradient(90deg, rgba(8,12,10,.72) 0%, rgba(8,12,10,.32) 38%, transparent 62%); }
.scrim--right  { background: linear-gradient(270deg, rgba(8,12,10,.72) 0%, rgba(8,12,10,.32) 38%, transparent 62%); }
.scrim--center { background: radial-gradient(120% 90% at 50% 55%, transparent 38%, rgba(8,12,10,.66) 100%); }
.scrim--dark   { background: radial-gradient(120% 90% at 50% 50%, rgba(8,12,10,.3) 30%, rgba(8,12,10,.8) 100%); }
.scrim--full   { background: linear-gradient(180deg, rgba(8,12,10,.55), rgba(8,12,10,.78)); }

/* ---- Hero clouds (the "descent") ------------------------------------ */
.clouds {
  position: absolute; inset: -10%;
  z-index: 2;
  background:
    radial-gradient(38% 26% at 22% 30%, rgba(255,255,255,.95), transparent 70%),
    radial-gradient(42% 30% at 70% 24%, rgba(255,255,255,.9), transparent 72%),
    radial-gradient(50% 34% at 45% 70%, rgba(255,255,255,.85), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.25) 55%, transparent);
  filter: blur(2px);
}

/* ---- Captions ------------------------------------------------------- */
.caption {
  position: relative; z-index: 6;
  max-width: var(--maxcap);
  margin: 0 0 11vh 0;
  padding: 24px 28px;
  background: rgba(10, 14, 12, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  box-shadow: 0 22px 60px rgba(0,0,0,.4);
}
.caption h2 {
  margin: 0 0 .35em; font-size: clamp(2rem, 4.4vw, 3.1rem);
  letter-spacing: .01em; color: #fff; line-height: 1.05;
}
.caption p { margin: 0; font-size: clamp(1.02rem, 1.5vw, 1.18rem); line-height: 1.62; color: rgba(255,255,255,.92); }
.caption strong { color: var(--gold); font-weight: 600; }
.caption--left   { margin-left: 7vw; }
.caption--right  { margin-left: auto; margin-right: 7vw; }
.caption--center { margin-left: auto; margin-right: auto; text-align: center; }
/* caption--light kept as an alias (all captions are light now) */

/* ---- Intro ---------------------------------------------------------- */
.scene--intro { align-items: center; justify-content: center; text-align: center; }
.intro-copy { position: relative; z-index: 7; color: #fff; text-shadow: 0 4px 30px rgba(0,0,0,.5); }
.kicker { margin: 0; text-transform: uppercase; letter-spacing: .42em; font-size: .8rem; font-family: system-ui, sans-serif; opacity: .9; }
.title {
  margin: .08em 0 0;
  font-size: clamp(3.6rem, 16vw, 11rem);
  letter-spacing: .14em; line-height: .9; color: #fff;
}
.subtitle { margin: .35em 0 0; font-size: clamp(1.1rem, 2.4vw, 1.7rem); font-style: italic; opacity: .95; }
.scroll-hint { margin-top: 3rem; font-family: system-ui, sans-serif; font-size: .72rem; letter-spacing: .28em; text-transform: uppercase; opacity: .85; }
.scroll-hint i { display: block; width: 1px; height: 40px; margin: 12px auto 0; background: currentColor; animation: hint 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes hint { 0%,100% { transform: scaleY(.3); opacity:.3; } 50% { transform: scaleY(1); opacity:1; } }

/* ---- Outro ---------------------------------------------------------- */
.scene--outro { align-items: center; justify-content: center; text-align: center; }
.outro-copy { position: relative; z-index: 7; color: var(--cream); padding: 0 6vw; max-width: 52rem; }
.outro-copy h2 { font-size: clamp(2.6rem, 9vw, 6rem); letter-spacing: .12em; margin: 0; color: #fff; }
.outro-sub { font-size: clamp(1rem, 2.2vw, 1.5rem); margin: .4em 0 1.2em; opacity: .95; }
.outro-facts { margin: 0 auto 2rem; line-height: 1.7; font-size: 1.05rem; opacity: .92; }
.restart { font: inherit; cursor: pointer; background: var(--gold); color: #2a1c08; border: 0; padding: 13px 26px; border-radius: 999px; font-size: 1rem; box-shadow: 0 10px 26px rgba(0,0,0,.35); }
.restart:hover { background: #ffe3a0; }
.credit { margin-top: 2.6rem; font-family: system-ui, sans-serif; font-size: .72rem; line-height: 1.6; opacity: .62; }

/* ---- Progress rail -------------------------------------------------- */
.rail { position: fixed; z-index: 50; right: 22px; top: 50%; transform: translateY(-50%); font-family: system-ui, sans-serif; }
.rail__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.rail__dot { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; padding: 0; color: rgba(255,255,255,.9); flex-direction: row-reverse; }
.rail__dot::after { content: ""; width: 11px; height: 11px; border-radius: 50%; border: 2px solid rgba(255,255,255,.85); background: transparent; transition: background .3s, transform .3s; box-shadow: 0 1px 5px rgba(0,0,0,.5); }
.rail__dot span { font-size: .72rem; letter-spacing: .04em; opacity: 0; transform: translateX(6px); transition: opacity .25s, transform .25s; text-shadow: 0 1px 5px rgba(0,0,0,.7); white-space: nowrap; }
.rail__dot:hover span { opacity: .95; transform: none; }
.rail__dot.is-active::after { background: var(--gold); border-color: var(--gold); transform: scale(1.35); }
.rail__dot.is-active span { opacity: 1; transform: none; }
html:not(.is-animated) .rail { display: none; }

/* ---- Responsive ----------------------------------------------------- */
@media (max-width: 720px) {
  .caption { margin-left: 5vw !important; margin-right: 5vw !important; max-width: none; }
  .rail { right: 10px; }
  .rail__dot span { display: none; }
}

/* ---- Reduced motion: stop all motion, keep readable stacked scenes -- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
