/* ============================================================
   Tsinglan iGEM Wiki — Cinematic homepage ("you NAILed it")
   ------------------------------------------------------------
   Structure inspired by 2026 GreatBay-SCIE's homepage
   (loader → painted hero → scroll story chapters → product),
   but every colour / font / illustration is Tsinglan's own:
   deep navy + mustard + cream + coral, Playfair Display,
   shells, waves, nails, peptides.

   Pairs with:
     - wiki/pages/home.html      (markup, inline SVG art)
     - static/js/home-cinema.js  (loader + scroll choreography)

   Animation contract:
     JS drives CSS custom properties only —
       --anim-y   vertical offset (px)
       --anim-x   horizontal offset (px)
       --anim-s   uniform scale
       --anim-sy  vertical scale
     plus opacity and stroke-dashoffset. Every animated element
     keeps its own base transform and folds the vars into it, so
     static (no-JS / reduced-motion) rendering stays correct.
   ============================================================ */

body.page-home-cinema {
  --cinema-deep: #0d2544;
  --cinema-deep-2: #123c66;
  --cinema-navy: #1f426b;
  --cinema-mustard: #e9b91a;
  --cinema-cream: #f5ebc4;
  --cinema-cream-2: #e8d59a;
  --cinema-coral: #ef6a9e;
  --cinema-seafoam: #79d4b8;
  --cinema-sky: #59b5e1;
}

.cinema-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ============================================================
   Loader (GreatBay-style: percentage + typed wordmark + wipe)
   ============================================================ */

.home-loader {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
  overflow: hidden;
  background: var(--cinema-deep, #0d2544);
}

html.is-page-loading .home-loader {
  display: block;
}

.home-loader__fill,
.home-loader__erase {
  position: absolute;
  inset: 0;
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

.home-loader__fill {
  z-index: 1;
  background: var(--cinema-mustard, #e9b91a);
  transition: transform 0.18s linear;
}

.home-loader__erase {
  z-index: 3;
  background: var(--cinema-deep, #0d2544);
}

.home-loader.is-done .home-loader__erase {
  transform: scaleX(1);
  transition: transform 0.65s cubic-bezier(0.7, 0, 0.2, 1);
}

.home-loader__readout {
  position: absolute;
  inset: 0;
  z-index: 2;
  color: var(--cinema-cream, #f5ebc4);
  font-family: var(--font-display);
  /* cream over deep navy → light gold; over the mustard fill → blue.
     Always readable, always on-palette. */
  mix-blend-mode: difference;
}

.home-loader__percentage {
  position: absolute;
  top: 50%;
  left: clamp(1.5rem, 4vw, 5rem);
  transform: translateY(-50%);
  min-width: 3ch;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.5rem, 3vw, 3rem);
  line-height: 1;
}

.home-loader__wordmark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  white-space: nowrap;
  letter-spacing: -0.02em;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(1.9rem, 5.2vw, 5.6rem);
  line-height: 1;
}

.home-loader__wordmark .wl-char {
  display: inline-block;
  white-space: pre;
}

.home-loader__wordmark .wl-caret {
  display: inline-block;
  width: 0.075em;
  height: 0.78em;
  margin-left: 0.08em;
  vertical-align: -0.04em;
  background: currentColor;
  animation: home-loader-caret 0.64s step-end infinite;
}

@keyframes home-loader-caret {
  0%, 48% { visibility: visible; }
  49%, 100% { visibility: hidden; }
}

/* ============================================================
   Cinema scaffolding — tall track + sticky full-screen scene
   ============================================================ */

.cinema {
  position: relative;
}

.cinema-track {
  position: relative;
  height: 320vh;
}

.cinema-track--hero { height: 200vh; }
.cinema-track--mid  { height: 260vh; }
.cinema-track--xl   { height: 400vh; }

.cinema-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

/* Static fallback: no JS / reduced motion → plain stacked scenes */
html:not(.cinema-js) .cinema-track {
  height: auto;
}

html:not(.cinema-js) .cinema-sticky {
  position: relative;
  height: auto;
  min-height: 100vh;
  min-height: 100svh;
  padding: 6rem 1.5rem;
}

/* Scene backdrops */

.ch-hero__scene {
  background:
    radial-gradient(60% 50% at 72% 18%, rgba(89, 181, 225, 0.16), transparent 70%),
    radial-gradient(50% 45% at 18% 80%, rgba(239, 106, 158, 0.12), transparent 70%),
    var(--cinema-deep);
}

.ch-fingertips__scene {
  background:
    radial-gradient(55% 45% at 80% 75%, rgba(233, 185, 26, 0.10), transparent 70%),
    #0f2d52;
}

.ch-ocean__scene {
  background: linear-gradient(180deg, #0d2544 0%, #10324f 55%, #0a3a54 100%);
}

.ch-stats__scene {
  background:
    radial-gradient(55% 45% at 20% 15%, rgba(245, 235, 196, 0.55), transparent 70%),
    var(--cinema-mustard);
}

.ch-gap__scene {
  background:
    radial-gradient(50% 40% at 78% 22%, rgba(239, 106, 158, 0.10), transparent 70%),
    #10294a;
}

.ch-mech__scene {
  background: linear-gradient(160deg, #0d2544 0%, #123c66 60%, #14505e 100%);
}

.ch-product__scene {
  background:
    radial-gradient(46% 42% at 50% 46%, rgba(233, 185, 26, 0.14), transparent 72%),
    var(--cinema-deep);
}

/* ============================================================
   Shared scene typography
   ============================================================ */

.scene-line {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translateY(var(--anim-y, 0px));
  margin: 0;
  width: min(90vw, 62rem);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 4.6vw, 3.9rem);
  line-height: 1.22;
  color: var(--cinema-cream);
  text-wrap: balance;
  z-index: 3;
}

.scene-thought {
  position: absolute;
  right: clamp(1rem, 8vw, 9rem);
  bottom: clamp(5rem, 14vh, 9rem);
  z-index: 4;
  max-width: 19rem;
  padding: 1rem 1.4rem;
  border-radius: 1.6rem 1.6rem 1.6rem 0.3rem;
  background: var(--cinema-cream);
  color: var(--cinema-deep);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  line-height: 1.4;
  transform: scale(var(--anim-s, 1));
  transform-origin: bottom left;
}

.scene-thought__dot {
  position: absolute;
  border-radius: 50%;
  background: var(--cinema-cream);
}

.scene-thought__dot--lg {
  width: 1.1rem;
  height: 1.1rem;
  left: -1.1rem;
  bottom: -0.9rem;
}

.scene-thought__dot--sm {
  width: 0.6rem;
  height: 0.6rem;
  left: -2.1rem;
  bottom: -1.8rem;
}

/* ============================================================
   Chapter 1 — Hero: brush-painted reveal
   ============================================================ */

.ch-hero__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(48% 38% at 50% 40%, rgba(245, 235, 196, 0.08), transparent 70%);
  pointer-events: none;
}

.ch-hero__strokes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.ch-hero__strokes .stroke-wipe {
  transition: clip-path 0.9s cubic-bezier(0.65, 0, 0.25, 1);
}

html.cinema-js .ch-hero__strokes .stroke-wipe {
  clip-path: inset(0 100% 0 0);
}

html.cinema-js .ch-hero__scene.is-live .stroke-wipe {
  clip-path: inset(0 0 0 0);
}

html.cinema-js .ch-hero__scene.is-live .stroke-wipe--2 { transition-delay: 0.35s; }
html.cinema-js .ch-hero__scene.is-live .stroke-wipe--3 { transition-delay: 0.7s; }

.ch-hero__brush {
  position: absolute;
  top: 30%;
  left: 0;
  z-index: 2;
  width: clamp(70px, 9vw, 130px);
  display: none;
  pointer-events: none;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.35));
}

html.cinema-js .ch-hero__scene.is-live .ch-hero__brush {
  display: block;
  animation: hero-brush-sweep 2.4s cubic-bezier(0.6, 0, 0.3, 1) 0.15s both;
}

@keyframes hero-brush-sweep {
  0%   { transform: translate(-20vw, -6vh) rotate(-14deg); opacity: 0; }
  8%   { opacity: 1; }
  55%  { transform: translate(46vw, 4vh) rotate(6deg); }
  85%  { transform: translate(96vw, -3vh) rotate(10deg); opacity: 1; }
  100% { transform: translate(112vw, -6vh) rotate(12deg); opacity: 0; }
}

.ch-hero__decor .float {
  position: absolute;
  z-index: 2;
  opacity: 0.9;
}

.float--1 { width: clamp(56px, 7vw, 96px);  top: 16%; left: 9%; }
.float--2 { width: clamp(64px, 8vw, 110px); top: 12%; right: 12%; }
.float--3 { width: clamp(30px, 3.4vw, 48px); top: 30%; right: 26%; }
.float--4 { width: clamp(22px, 2.6vw, 38px); top: 52%; left: 16%; }
.float--5 { width: clamp(28px, 3vw, 44px);   top: 24%; left: 33%; }
.float--6 { width: clamp(52px, 6vw, 88px);   top: 58%; right: 8%; }

@media (prefers-reduced-motion: no-preference) {
  .float--1 { animation: cinema-bob 5.2s ease-in-out infinite; }
  .float--2 { animation: cinema-bob 6.1s ease-in-out 0.6s infinite; }
  .float--3 { animation: cinema-bob 4.4s ease-in-out 0.3s infinite; }
  .float--4 { animation: cinema-bob 5.7s ease-in-out 1s infinite; }
  .float--5 { animation: cinema-bob 4.9s ease-in-out 0.9s infinite; }
  .float--6 { animation: cinema-bob 6.6s ease-in-out 0.2s infinite; }
}

@keyframes cinema-bob {
  0%, 100% { transform: translateY(-10px) rotate(-3deg); }
  50%      { transform: translateY(10px) rotate(3deg); }
}

.ch-hero__copy {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1.5rem;
}

.ch-hero__eyebrow {
  margin: 0 0 1.2rem;
  font-size: clamp(0.95rem, 1.6vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--cinema-seafoam);
}

.ch-hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: clamp(3rem, 10vw, 8.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--cinema-cream);
  text-shadow: 0 10px 44px rgba(13, 37, 68, 0.55);
}

.ch-hero__title .ch-hero__nail {
  color: var(--cinema-mustard);
  font-style: normal;
}

.ch-hero__lead {
  margin: 1.4rem 0 2.2rem;
  font-size: clamp(1.05rem, 2.1vw, 1.7rem);
  color: rgba(245, 235, 196, 0.88);
}

.ch-hero__cta {
  display: inline-block;
  padding: 0.85rem 2.4rem;
  border: 3px solid var(--cinema-mustard);
  border-radius: 999px;
  background: rgba(233, 185, 26, 0.12);
  color: var(--cinema-cream);
  font-weight: 700;
  font-size: clamp(0.95rem, 1.5vw, 1.2rem);
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.ch-hero__cta:hover,
.ch-hero__cta:focus-visible {
  background: var(--cinema-mustard);
  color: var(--cinema-deep);
  transform: translateY(-3px);
}

/* hero copy: staged entrance (gated behind .cinema-js) */

html.cinema-js .ch-hero__copy > * {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

html.cinema-js .ch-hero__scene.is-live .ch-hero__copy > * {
  opacity: 1;
  transform: translateY(0);
}

html.cinema-js .ch-hero__scene.is-live [data-hero-copy="1"] { transition-delay: 0.9s; }
html.cinema-js .ch-hero__scene.is-live [data-hero-copy="2"] { transition-delay: 1.05s; }
html.cinema-js .ch-hero__scene.is-live [data-hero-copy="3"] { transition-delay: 1.25s; }
html.cinema-js .ch-hero__scene.is-live [data-hero-copy="4"] { transition-delay: 1.45s; }
html.cinema-js .ch-hero__scene.is-live [data-hero-copy="5"] { transition-delay: 1.8s; }

.cinema-hint {
  position: absolute;
  left: 50%;
  bottom: 13vh;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: rgba(245, 235, 196, 0.85);
  font-size: 0.95rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(13, 37, 68, 0.8);
}

.cinema-hint__chevron {
  width: 14px;
  height: 14px;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(45deg);
}

@media (prefers-reduced-motion: no-preference) {
  .cinema-hint__chevron { animation: cinema-hint-dip 1.6s ease-in-out infinite; }
}

@keyframes cinema-hint-dip {
  0%, 100% { transform: rotate(45deg) translate(0, 0); }
  50%      { transform: rotate(45deg) translate(5px, 5px); }
}

/* ============================================================
   Chapter 2 — Fingertips
   ============================================================ */

/* lift the story text above the hand */
.ch-fingertips__scene .scene-line {
  top: 27%;
}

.ch-fingertips__hand {
  position: absolute;
  left: 50%;
  bottom: -4vh;
  transform: translateX(-50%);
  z-index: 2;
  width: clamp(280px, 38vw, 500px);
  height: auto;
  opacity: 0.96;
}

.nail-polish {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: scaleY(var(--anim-sy, 1));
}

html.cinema-js .nail-polish {
  --anim-sy: 0;
}

.ch-fingertips__hand [data-a="pop"] {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(var(--anim-s, 1));
}

html:not(.cinema-js) .ch-fingertips__hand {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  display: block;
  margin: 2rem auto 0;
}

html:not(.cinema-js) .scene-line,
html:not(.cinema-js) .scene-thought {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  transform: none;
  margin: 1.4rem auto;
}

/* ============================================================
   Chapter 3 — Ocean
   ============================================================ */

.ch-ocean__waves {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.ch-ocean__waves .wave {
  transform-box: fill-box;
}

html.cinema-js .ch-ocean__waves .wave {
  transform: translateY(102%);
}

.ch-ocean__shell,
.ch-ocean__bubble {
  position: absolute;
  z-index: 2;
}

.ch-ocean__shell--1 { width: clamp(64px, 8vw, 120px);  left: 10%; bottom: 12%; }
.ch-ocean__shell--2 { width: clamp(72px, 9vw, 130px);  right: 9%; bottom: 18%; }
.ch-ocean__shell--3 { width: clamp(58px, 7vw, 100px);  left: 24%; bottom: 26%; }
.ch-ocean__shell--4 { width: clamp(46px, 5.5vw, 84px); right: 22%; bottom: 8%; }
.ch-ocean__bubble--1 { width: clamp(26px, 3vw, 44px);  left: 40%; bottom: 30%; }
.ch-ocean__bubble--2 { width: clamp(20px, 2.4vw, 34px); left: 62%; bottom: 38%; }

@media (prefers-reduced-motion: no-preference) {
  .ch-ocean__shell--1 { animation: cinema-bob 6.2s ease-in-out infinite; }
  .ch-ocean__shell--2 { animation: cinema-bob 5.4s ease-in-out 0.5s infinite; }
  .ch-ocean__shell--3 { animation: cinema-bob 7s ease-in-out 0.9s infinite; }
  .ch-ocean__shell--4 { animation: cinema-bob 5.8s ease-in-out 0.3s infinite; }
  .ch-ocean__bubble--1 { animation: cinema-rise 7.5s ease-in infinite; }
  .ch-ocean__bubble--2 { animation: cinema-rise 9s ease-in 1.4s infinite; }
}

@keyframes cinema-rise {
  0%   { transform: translateY(0); opacity: 0; }
  12%  { opacity: 0.9; }
  100% { transform: translateY(-46vh); opacity: 0; }
}

/* ============================================================
   Chapter 4 — Stats (mustard flip)
   ============================================================ */

.ch-stats__scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.6rem, 4vh, 3rem);
  padding: 5rem 1.5rem 3rem;
  color: var(--cinema-deep);
}

.ch-stats__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: clamp(1.9rem, 4.6vw, 4rem);
  color: var(--cinema-deep);
  text-align: center;
  transform: translateY(var(--anim-y, 0px));
}

.ch-stats__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2.4rem);
  width: min(94vw, 72rem);
}

.stat-card {
  flex: 1 1 15rem;
  max-width: 21rem;
  padding: clamp(1.2rem, 2.6vw, 2rem);
  border: 4px solid var(--cinema-deep);
  border-radius: 1.4rem;
  background: var(--cinema-cream);
  box-shadow: 8px 8px 0 0 var(--cinema-deep);
  text-align: center;
  transform: scale(var(--anim-s, 1));
}

.stat-card__num {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.6rem, 5.6vw, 4.6rem);
  line-height: 1;
  color: var(--cinema-deep);
}

.stat-card__unit {
  margin-left: 0.35rem;
  font-size: 0.42em;
  font-weight: 700;
  color: var(--cinema-coral);
}

.stat-card__label {
  margin: 0.7rem 0 0;
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  font-weight: 600;
  color: #2b4468;
}

.ch-stats__foot {
  margin: 0;
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  font-weight: 700;
  font-style: italic;
  color: rgba(13, 37, 68, 0.85);
}

/* ============================================================
   Chapter 5 — Gap
   ============================================================ */

.ch-gap__headline {
  top: 22%;
}

.ch-gap__bottles {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: clamp(1.4rem, 5vw, 4rem);
}

.gap-bottle {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  transform: translateY(var(--anim-y, 0px));
}

.gap-bottle svg {
  width: clamp(74px, 9.5vw, 132px);
  height: auto;
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.35));
}

.gap-bottle figcaption {
  max-width: 11rem;
  text-align: center;
  font-weight: 700;
  font-size: clamp(0.85rem, 1.4vw, 1.1rem);
  color: rgba(245, 235, 196, 0.92);
}

.ch-gap__crack {
  position: absolute;
  left: 50%;
  top: 62%;
  transform: translateX(-50%);
  z-index: 3;
  width: min(88vw, 62rem);
  height: clamp(40px, 7vw, 90px);
}

.ch-gap__punch {
  top: 82%;
}

.ch-gap__punch span {
  color: var(--cinema-coral);
}

html:not(.cinema-js) .ch-gap__bottles,
html:not(.cinema-js) .ch-gap__crack {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  margin: 1.6rem auto;
}

/* ============================================================
   Chapter 6 — Mechanism
   ============================================================ */

.ch-mech__stage {
  position: absolute;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: clamp(0.4rem, 1.6vw, 1.4rem);
  max-width: 96vw;
}

@media (max-width: 700px) {
  .ch-mech__stage {
    flex-wrap: wrap;
    bottom: 12%;
  }

  .mech-arrow {
    display: none;
  }
}

.mech-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  transform: scale(var(--anim-s, 1));
}

.mech-step svg {
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.3));
}

.mech-step--dna svg     { width: clamp(56px, 7vw, 100px); }
.mech-step--peptide svg { width: clamp(120px, 16vw, 220px); }
.mech-step--coat svg    { width: clamp(120px, 16vw, 220px); }

.mech-step p {
  margin: 0;
  font-weight: 700;
  font-size: clamp(0.85rem, 1.4vw, 1.1rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245, 235, 196, 0.85);
}

.mech-arrow {
  width: clamp(48px, 7vw, 96px);
  flex: none;
  align-self: center;
  margin-bottom: 2.2rem;
}

.mech-coat-dots circle {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(var(--anim-s, 1));
}

html.cinema-js .mech-coat-dots circle {
  --anim-s: 0;
}

.ch-mech__note {
  position: absolute;
  left: 50%;
  bottom: 3.2%;
  transform: translateX(-50%);
  z-index: 2;
  margin: 0;
  font-size: clamp(0.95rem, 1.6vw, 1.25rem);
  font-style: italic;
  color: rgba(245, 235, 196, 0.75);
  white-space: nowrap;
}

html:not(.cinema-js) .ch-mech__stage,
html:not(.cinema-js) .ch-mech__note {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  margin: 1.6rem auto;
}

/* ============================================================
   Chapter 7 — Product
   ============================================================ */

.ch-product__halo {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  width: clamp(320px, 44vw, 620px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 185, 26, 0.22) 0%, rgba(233, 185, 26, 0.05) 46%, transparent 70%);
  pointer-events: none;
}

.ch-product__bottle {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%) scale(var(--anim-s, 1));
  z-index: 2;
  width: clamp(120px, 15vw, 200px);
}

.ch-product__bottle svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.45));
}

@media (prefers-reduced-motion: no-preference) {
  html.cinema-js .ch-product__bottle { animation: cinema-bob 5.5s ease-in-out infinite; }
}

.ch-product__name {
  position: absolute;
  left: 50%;
  top: 9%;
  transform: translateX(-50%) translateY(var(--anim-y, 0px));
  z-index: 3;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  white-space: nowrap;
  font-size: clamp(2.2rem, 6.4vw, 5.2rem);
  color: var(--cinema-cream);
}

.ch-product__name span {
  color: var(--cinema-mustard);
  font-style: normal;
}

.ch-product__tag {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%) translateY(var(--anim-y, 0px));
  z-index: 3;
  margin: 0;
  text-align: center;
  font-size: clamp(1rem, 2vw, 1.5rem);
  line-height: 1.45;
  color: rgba(245, 235, 196, 0.88);
}

.ch-product__features {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.feature {
  position: absolute;
  margin: 0;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: clamp(0.9rem, 1.5vw, 1.2rem);
  color: var(--cinema-deep);
  background: var(--cinema-cream);
  box-shadow: 6px 6px 0 0 rgba(13, 37, 68, 0.55);
  transform: translateX(var(--anim-x, 0px));
}

.feature--left  { left: clamp(4%, 9vw, 16%); }
.feature--right { right: clamp(4%, 9vw, 16%); }

.feature:nth-child(1) { top: 34%; background: var(--cinema-seafoam); }
.feature:nth-child(2) { top: 44%; background: var(--cinema-cream); }
.feature:nth-child(3) { top: 58%; background: var(--cinema-mustard); }
.feature:nth-child(4) { top: 68%; background: var(--cinema-coral); color: var(--cinema-cream); }

.ch-product__cta {
  position: absolute;
  left: 50%;
  bottom: 6%;
  transform: translateX(-50%) translateY(var(--anim-y, 0px));
  z-index: 3;
  display: inline-block;
  padding: 0.8rem 2.2rem;
  border: 3px solid var(--cinema-mustard);
  border-radius: 999px;
  background: rgba(233, 185, 26, 0.12);
  color: var(--cinema-cream);
  font-weight: 700;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease;
  white-space: nowrap;
}

.ch-product__cta:hover,
.ch-product__cta:focus-visible {
  background: var(--cinema-mustard);
  color: var(--cinema-deep);
}

html:not(.cinema-js) .ch-product__bottle,
html:not(.cinema-js) .ch-product__name,
html:not(.cinema-js) .ch-product__tag,
html:not(.cinema-js) .ch-product__cta {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  transform: none;
  margin: 1.2rem auto;
  display: block;
  text-align: center;
  width: fit-content;
}

html:not(.cinema-js) .ch-product__features {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  inset: auto;
}

html:not(.cinema-js) .feature {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
}

/* ============================================================
   Chapter dots navigation
   ============================================================ */

.cinema-dots {
  position: fixed;
  right: clamp(0.6rem, 2vw, 1.6rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  display: none;
  flex-direction: column;
  gap: 0.9rem;
}

html.cinema-js .cinema-dots {
  display: flex;
}

.cinema-dots button {
  position: relative;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 2px solid rgba(245, 235, 196, 0.75);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.cinema-dots button:hover,
.cinema-dots button:focus-visible {
  transform: scale(1.35);
  border-color: var(--cinema-mustard);
}

.cinema-dots button.is-active {
  background: var(--cinema-mustard);
  border-color: var(--cinema-mustard);
  transform: scale(1.3);
}

.cinema-dots button span {
  position: absolute;
  right: 1.6rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.2rem 0.7rem;
  border-radius: 0.6rem;
  background: rgba(13, 37, 68, 0.85);
  color: var(--cinema-cream);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.cinema-dots button:hover span,
.cinema-dots button:focus-visible span {
  opacity: 1;
}

@media (max-width: 768px) {
  .cinema-dots { display: none !important; }
}

/* ============================================================
   Animated element initial states (JS-driven choreography)
   ============================================================ */

html.cinema-js [data-a]:not([data-a="float"]):not([data-a="draw"]):not([data-a="wave"]):not([data-a="nail"]):not([data-a="coatdot"]):not([data-a="count"]) {
  opacity: 0;
  will-change: transform, opacity;
}

html.cinema-js [data-a="draw"] {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

/* ============================================================
   More about us — explore cards (inside bio-canvas)
   ============================================================ */

.home-explore {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
  margin-top: 1.6rem;
}

.home-explore__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.4rem 1rem 1.2rem;
  border: 3px solid var(--navy);
  border-radius: 1.2rem;
  background: var(--cream-light);
  box-shadow: 6px 6px 0 0 var(--navy);
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.home-explore__card:hover,
.home-explore__card:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 0 var(--navy);
  background: var(--cream);
  color: var(--ink);
}

.home-explore__card svg {
  width: 52px;
  height: 52px;
}

.home-explore__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
}

.home-explore__text {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .home-loader__wordmark .wl-caret { animation: none; }

  html.cinema-js .ch-hero__scene.is-live .ch-hero__brush { animation: none; display: none; }

  .ch-hero__cta,
  .ch-product__cta,
  .home-explore__card { transition: none; }
}
