/* scroll.css — styles for scroll.js effects */

/* ---------- Horizontal ---------- */
.fx-h { position: relative; overflow: hidden; }
.fx-h__track {
  display: flex; gap: clamp(1rem, 3vw, 3rem); width: max-content;
  height: 100vh; height: 100svh; align-items: center; padding: 0 6vw; will-change: transform;
}
.fx-h__panel { flex: 0 0 auto; width: clamp(280px, 62vw, 980px); display: grid; gap: 1.25rem; }
.fx-h__media { overflow: hidden; border-radius: var(--fx-radius); aspect-ratio: 16 / 10; }
.fx-h__media > * { width: 120%; height: 100%; margin-left: -10%; object-fit: cover; display: block; }
.fx-h__progress { position: absolute; left: 6vw; right: 6vw; bottom: 5vh; height: 1px; background: color-mix(in srgb, var(--fx-fg) 20%, transparent); }
.fx-h__progress > span { display: block; height: 100%; background: var(--fx-fg); transform-origin: left; transform: scaleX(0); }
@media (max-width: 767px), (prefers-reduced-motion: reduce) {
  .fx-h__track {
    height: auto; width: auto; padding: 4rem 6vw; overflow-x: auto;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  }
  .fx-h__panel { width: 82vw; scroll-snap-align: center; }
  .fx-h__media > * { width: 100%; margin-left: 0; }
  .fx-h__progress { display: none; }
}

/* ---------- Sticky stack ---------- */
.fx-stack { position: relative; perspective: 1400px; padding-bottom: 10vh; }
.fx-stack__card {
  --dim: 0;
  position: sticky; top: calc(10vh + var(--i, 0) * 1.4rem);
  min-height: 72vh; margin-bottom: 8vh; border-radius: calc(var(--fx-radius) * 1.5);
  overflow: hidden; transform-origin: 50% 0%; will-change: transform;
}
.fx-stack__card::after {
  content: ""; position: absolute; inset: 0; background: #000; opacity: var(--dim); pointer-events: none;
}

/* ---------- Section wipe ---------- */
[data-fx="section-wipe"] { position: relative; will-change: clip-path; }
[data-wipe="circle"], [data-wipe="curtain"] { min-height: 100vh; min-height: 100svh; }
.fx-wipe__curtain { position: absolute; inset: 0; background: var(--curtain, var(--fx-bg)); z-index: 5; pointer-events: none; }

/* ---------- Clip reveal ---------- */
[data-fx="clip-reveal"] { overflow: hidden; border-radius: var(--fx-radius); }
[data-fx="clip-reveal"] > img, [data-fx="clip-reveal"] > video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Parallax columns helper ---------- */
.fx-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2vw; overflow: hidden; }
.fx-cols > * { display: grid; gap: 2vw; }
@media (max-width: 767px) { .fx-cols { grid-template-columns: 1fr 1fr; } }

/* ---------- Text highlight ---------- */
[data-fx="text-highlight"] { font-size: clamp(1.6rem, 3.4vw, 3.4rem); line-height: 1.18; letter-spacing: -0.02em; }
[data-fx="text-highlight"] mark {
  color: inherit; padding: 0 0.1em;
  background: linear-gradient(var(--fx-accent), var(--fx-accent)) no-repeat left center / 0% 100%;
}

/* ---------- Velocity marquee ---------- */
.fx-marquee { overflow: hidden; white-space: nowrap; padding: 2.5vh 0; }
.fx-marquee__inner { display: inline-flex; will-change: transform; }
.fx-marquee__inner > * {
  padding-right: 3vw; font-size: clamp(2.5rem, 8vw, 8rem); letter-spacing: -0.03em; line-height: 1;
}
.fx-marquee__inner .is-outline { color: transparent; -webkit-text-stroke: 1px currentColor; }

/* ---------- Perspective grid ---------- */
.fx-pgrid { perspective: 1200px; overflow: hidden; padding: 10vh 4vw; }
.fx-pgrid__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5vw;
  transform-style: preserve-3d; transform-origin: 50% 0%;
}
.fx-pgrid__item { aspect-ratio: 3 / 4; overflow: hidden; border-radius: 12px; }
.fx-pgrid__item img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 767px) { .fx-pgrid__grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Scroll progress ---------- */
.fx-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 9000;
  background: var(--fx-accent); transform-origin: left; transform: scaleX(0);
}

/* ---------- Color shift ---------- (add class="fx-themed" to <body>) */
body.fx-themed { background: var(--fx-bg); color: var(--fx-fg); }

/* ---------- Sticky story ---------- */
.fx-story { display: grid; grid-template-columns: 1fr 1fr; gap: 5vw; padding: 0 5vw; }
.fx-story__media {
  position: sticky; top: 10vh; height: 80vh; border-radius: var(--fx-radius); overflow: hidden;
}
.fx-story__media > * { position: absolute; inset: 0; clip-path: inset(100% 0% 0% 0%); }
.fx-story__media > *:first-child { clip-path: inset(0% 0% 0% 0%); }
.fx-story__media img, .fx-story__media video { width: 100%; height: 100%; object-fit: cover; }
.fx-story__steps { padding: 30vh 0; }
.fx-story__step {
  min-height: 60vh; display: flex; flex-direction: column; justify-content: center;
  opacity: 0.25; transition: opacity 0.6s var(--fx-ease-out);
}
.fx-story__step.is-active { opacity: 1; }
@media (max-width: 767px) {
  .fx-story { grid-template-columns: 1fr; }
  .fx-story__media { top: 8vh; height: 45vh; z-index: 1; }
  .fx-story__steps { padding: 5vh 0 20vh; }
  .fx-story__step { min-height: 50vh; }
}

/* ---------- Kinetic type ---------- */
.fx-kinetic { overflow: hidden; padding: 8vh 0; }
.fx-kinetic__row {
  white-space: nowrap; font-size: clamp(3.5rem, 13vw, 14rem); line-height: 0.9; letter-spacing: -0.045em;
  will-change: transform;
}

/* ---------- Footer reveal ---------- */
.fx-page { position: relative; z-index: 1; background: var(--fx-bg); }
[data-fx="footer-reveal"] { position: sticky; bottom: 0; z-index: 0; overflow: hidden; }
