/* =========================================================================
   Slide presentation for SHOWCASE pages only (home, about, how-it-works,
   support wall, contact, error). Task pages (catalogue, story detail,
   support form, request access, leader, thank-you) pass slides=false and
   scroll normally.

   Two layers:
     body.is-slides   — the rhythm: every top-level section is one full
                        viewport, content centered, dots rail + scroll cue.
     body.is-curtain  — the parallax deck (added by slides.js ONLY when
                        every slide fits the viewport, desktop only):
                        each slide pins and the next slides up over it.
                        If any slide overflows, the page stays in clean
                        flow — no mixed pinning, no covered content, ever.
   ========================================================================= */

/* ---- rhythm: one slide = one screen ---- */
body.is-slides #main > section {
  position: relative;   /* also beats pages.css #main>section for paint order */
  z-index: 0;           /* own stacking context: children can't bleed across slides */
  box-sizing: border-box;
  min-height: calc(100svh - var(--nav-h));
  align-content: center; /* centers content without touching display mode */
  /* No overflow clipping: on a short laptop screen a slide simply grows past
     one viewport instead of cutting its own content off. */
  background-color: var(--bg); /* opaque ground for the curtain */
}

/* Full-bleed grid heroes (catalogue triptych): stretch the row so the side
   art owns the slide's complete height — centering would letterbox it. */
body.is-slides #main > section.hero-triptych {
  align-content: stretch;
}

/* Centering provides the breathing room; the marketing flow's big section
   padding would double it. (The first slide is a full-bleed hero.) */
body.is-slides #main > section:not(:first-of-type) {
  padding-block: clamp(1.5rem, 3.5vh, 2.75rem);
}

/* The closing slide (a CTA band on every showcase page) hugs the footer
   instead of owning a whole screen — the empty gap read as a mistake. */
body.is-slides #main > section:last-of-type:not(:first-of-type) {
  min-height: 0;
  padding-block: clamp(1.5rem, 4vh, 3rem);
}

/* Split heroes: own exactly one screen; the headline scales with viewport
   height so short laptop screens still fit copy, art and button. */
body.is-slides #main > section.hero-split {
  height: calc(100svh - var(--nav-h));
  min-height: 0;
  max-height: none;
  align-content: stretch;
}
body.is-slides .hero-split .hero-copy { padding-block: clamp(1rem, 3vh, 2.5rem); }
body.is-slides .hero-split .t-hero { font-size: clamp(1.9rem, min(4.6vw, 7.2vh), 4.25rem); }
body.is-slides .hero-split .t-lead { font-size: clamp(0.95rem, 2.2vh, 1.15rem); }
body.is-slides .hero-split .hero-art { min-height: 0; height: 100%; }

/* ---- curtain: pin + cover (slides.js adds .is-curtain when safe) ---- */
body.is-curtain #main > section {
  position: sticky;
  top: var(--nav-h);
  /* Depth cue kept cheap: hairline + tight shadow. Large blurs on
     viewport-sized sticky layers overload Chrome's compositor. */
  border-top: 1px solid rgba(224, 169, 60, 0.10);
  box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.45);
}
body.is-curtain #main > section:first-of-type { border-top: 0; }

/* The footer needs its own opaque ground so it covers the last pinned
   slide as it scrolls in. */
body.is-curtain .footer {
  position: relative;
  background-color: var(--bg);
  border-top: 1px solid rgba(224, 169, 60, 0.10);
  box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.45);
}

/* ---- dots rail (injected by slides.js) ---- */
.slide-dots {
  position: fixed;
  right: clamp(0.9rem, 2.2vw, 2rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: calc(var(--z-nav) - 1);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.slide-dots button {
  position: relative;
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  transition: background var(--t) var(--ease), transform var(--t) var(--ease),
              box-shadow var(--t) var(--ease);
}
.slide-dots button:hover { background: var(--gold-deep); }
.slide-dots button.is-active {
  background: var(--gold);
  transform: scale(1.25);
  box-shadow: 0 0 12px var(--gold-glow);
}
/* hover label */
.slide-dots button::after {
  content: attr(data-label);
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-2);
  background: rgba(8, 6, 5, 0.92);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 4px 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t) var(--ease);
}
.slide-dots button:hover::after,
.slide-dots button:focus-visible::after { opacity: 1; }
@media (max-width: 1100px) { .slide-dots { display: none; } }

/* ---- mobile slide indicator: thin progress bar under the nav ----
   (dots are hidden on small screens; this keeps the "where am I" signal) */
.slide-progress {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  height: 2px;
  width: 100%;
  z-index: calc(var(--z-nav) - 1);
  background: transparent;
  pointer-events: none;
}
.slide-progress i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  transform-origin: 0 50%;
  transform: scaleX(0);
}
@media (min-width: 1101px) { .slide-progress { display: none; } }

/* ---- scroll cue on the first slide (injected by slides.js) ---- */
.slide-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(0.9rem, 3.5vh, 2.2rem);
  transform: translateX(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(8, 6, 5, 0.55);
  color: var(--gold);
  cursor: pointer;
  animation: slide-cue-bob 2.4s ease-in-out infinite;
  transition: opacity var(--t) var(--ease), border-color var(--t) var(--ease);
}
.slide-cue:hover { border-color: var(--line-strong); }
.slide-cue.is-hidden { opacity: 0; pointer-events: none; }
@keyframes slide-cue-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(7px); }
}
@media (prefers-reduced-motion: reduce) {
  .slide-cue { animation: none; }
}

/* ---- phones: sections take their natural height ----
   One screen per section only works when a section holds a screen's worth
   of content. On a phone most hold far less, and centring them inside a
   full-height box left long empty gaps between sections. The hero keeps
   its full first screen; everything after it simply flows. The scroll
   cue goes too: it sat on top of the hero buttons, and the gold progress
   bar under the nav already says there is more below. */
@media (max-width: 720px) {
  body.is-slides #main > section:not(:first-of-type) {
    min-height: 0;
    padding-block: clamp(2.25rem, 7vw, 3rem);
  }
  body.is-slides #main > section:first-of-type:not(.hero-split):not(.hero-band) { min-height: 0; }
  .slide-cue { display: none; }
}
