/* ==========================================================================
   scroll-effects.css — cinematic-scrolltelling-skill
   Structural CSS for the 10 effects. JS adds motion; this file guarantees
   every section is presentable even before/without JavaScript.
   ========================================================================== */

/* ---- 01 · Video Scrub Hero ---- */
.csk-hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.csk-hero video,
.csk-hero .csk-hero__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.csk-hero__content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.6rem;
  padding-inline: var(--space-inline);
  max-width: 900px;
}

/* ---- 02 · Pinned Story ---- */
.csk-pinned-story {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding-inline: var(--space-inline);
  overflow: hidden;
}
.csk-pinned-story__media {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
}
.csk-pinned-story__media [data-phase-media] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.7s var(--ease-in-out);
}
.csk-pinned-story__media [data-phase-media].is-active {
  opacity: 1;
}
.csk-pinned-story__phases {
  position: relative;
  min-height: 40vh;
}
.csk-phase {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.2rem;
}
.csk-phase.is-static {
  position: relative;
  inset: auto;
  opacity: 1 !important;
  transform: none !important;
  margin-bottom: 3rem;
}

/* ---- 03 · Horizontal Gallery ---- */
.csk-h-gallery {
  position: relative;
  overflow: hidden;
}
.csk-h-gallery__track {
  display: flex;
  gap: clamp(1rem, 3vw, 3rem);
  padding-inline: var(--space-inline);
  width: max-content;
  align-items: center;
  height: 100vh;
  height: 100svh;
}
.csk-h-gallery__item {
  position: relative;
  width: clamp(300px, 42vw, 640px);
  flex-shrink: 0;
}
.csk-h-gallery__item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
}
.csk-h-gallery__item figcaption {
  margin-top: 1rem;
  color: var(--color-text-muted);
  font-size: var(--text-caption);
  letter-spacing: 0.08em;
}
.csk-h-gallery__progress {
  position: absolute;
  bottom: 2.4rem;
  left: var(--space-inline);
  right: var(--space-inline);
  height: 1px;
  background: rgba(245, 244, 242, 0.15);
}
.csk-h-gallery__progress span {
  display: block;
  height: 100%;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left center;
}
/* Mobile / reduced motion: native swipe with scroll-snap */
.csk-h-gallery.is-native-scroll {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.csk-h-gallery.is-native-scroll .csk-h-gallery__track {
  height: auto;
  padding-block: var(--space-section);
}
.csk-h-gallery.is-native-scroll .csk-h-gallery__item {
  scroll-snap-align: center;
}
.csk-h-gallery.is-native-scroll .csk-h-gallery__progress {
  display: none;
}

/* ---- 04 · Apple Product Reveal ---- */
.csk-reveal {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.csk-reveal__stage {
  position: relative;
  width: min(1100px, 88vw);
}
.csk-reveal__media {
  width: 100%;
  border-radius: 16px;
  will-change: transform;
}
.csk-reveal__feature {
  position: absolute;
  left: var(--fx, 50%);
  top: var(--fy, 50%);
  transform: translate(-50%, -50%);
  max-width: 240px;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(245, 244, 242, 0.12);
  opacity: 0; /* GSAP reveals; .is-visible covers reduced-motion */
}
.csk-reveal__feature.is-visible {
  opacity: 1;
}
.csk-reveal__feature h4 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}
.csk-reveal__feature p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ---- 05 · Parallax Depth Scene ---- */
.csk-parallax {
  position: relative;
  min-height: 120vh;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.csk-parallax__layer {
  position: absolute;
  inset: -5%;
  display: grid;
  place-items: center;
  will-change: transform;
}
.csk-parallax__layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.csk-parallax__layer--content {
  position: relative;
  inset: auto;
  z-index: 3;
  text-align: center;
  padding-inline: var(--space-inline);
}

/* ---- 06 · Card Stack ---- */
.csk-cards {
  position: relative;
  padding-inline: var(--space-inline);
}
.csk-card {
  position: sticky;
  top: var(--card-top, 0px);
  min-height: 78vh;
  margin-inline: auto;
  max-width: 1100px;
  margin-bottom: 8vh;
  padding: clamp(2rem, 5vw, 4.5rem);
  border-radius: 24px;
  background: var(--color-surface);
  border: 1px solid rgba(245, 244, 242, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.4rem;
  will-change: transform;
  overflow: hidden;
}

/* ---- 07 · Text Mask Reveal (splitter internals) ---- */
.csk-split__line-mask {
  display: block;
  overflow: hidden;
}
.csk-split__line {
  display: block;
  will-change: transform;
}
.csk-split__word {
  display: inline-block;
  white-space: pre;
}

/* ---- 08 · Image Sequence ---- */
.csk-sequence {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.csk-sequence__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.csk-sequence__content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-inline: var(--space-inline);
  max-width: 900px;
  gap: 1.4rem;
}

/* ---- 09 · Transition Portal ---- */
.csk-portal {
  position: relative;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.csk-portal__mask {
  position: absolute;
  inset: 0;
  clip-path: circle(8% at 50% 50%); /* JS animates; static shape without JS */
  will-change: clip-path, transform;
  overflow: hidden;
}
.csk-portal__mask img,
.csk-portal__mask video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.csk-portal__caption {
  position: relative;
  z-index: 2;
  text-align: center;
  padding-inline: var(--space-inline);
}

/* ---- 10 · Conversion Ending + Sticky CTA ---- */
.csk-final {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  text-align: center;
}
.csk-final__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}
.csk-final__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  padding-inline: var(--space-inline);
}
.csk-final__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.csk-sticky-cta {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: var(--z-sticky-cta);
  display: none; /* mobile-only — enabled in responsive.css */
  transform: translateY(120%);
  transition: transform 0.5s var(--ease-out);
}
.csk-sticky-cta.is-visible {
  transform: translateY(0);
}
.csk-sticky-cta .csk-btn {
  width: 100%;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
