/**
 * HHScenes: Scene choreography styles
 *
 * Support styles for all scene types. Each scene manages its own transforms
 * via JS; these styles provide the base layout and aesthetic framework.
 */

:root {
  /* Scene progress custom property: 0..1 */
  --p: 0;
}

/* ========================================================================== */
/* HORIZONTAL SCROLL SCENE */
/* ========================================================================== */

[data-hhscene='horizontal'] {
  position: relative;
  width: 100%;
  height: auto;
  background: var(--paper);
}

.hhscene-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  will-change: transform;
  z-index: 10;
}

.hhscene-track {
  display: flex;
  gap: 0;
  height: 100vh;
  width: 100%;
  will-change: transform;
}

.hhscene-track > * {
  flex-shrink: 0;
  width: 100vw;
  height: 100%;
  overflow-y: auto;
}

/* Mobile/reduced-motion fallback: let track scroll normally */
@media (max-width: 879px), (prefers-reduced-motion: reduce) {
  [data-hhscene='horizontal'] {
    height: auto;
  }

  .hhscene-stage {
    position: relative;
    top: auto;
    height: auto;
    overflow: visible;
  }

  .hhscene-track {
    display: block;
    width: 100%;
    height: auto;
  }

  .hhscene-track > * {
    width: 100%;
    height: auto;
    overflow-y: visible;
    display: block;
  }
}

/* ========================================================================== */
/* STACKING PANELS SCENE */
/* ========================================================================== */

[data-hhscene='stack'] {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 400vh;
  /* Extra scroll space for panels to stack */
}

/* Mobile/reduced-motion fallback */
@media (max-width: 879px), (prefers-reduced-motion: reduce) {
  [data-hhscene='stack'] {
    min-height: auto;
    height: auto;
  }

}

/* ========================================================================== */
/* LAYERED PARALLAX SCENE */
/* ========================================================================== */

[data-hhscene='layers'] {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--paper);
}

/* Mobile/reduced-motion fallback */
@media (max-width: 879px), (prefers-reduced-motion: reduce) {
  [data-hhscene='layers'] {
    height: auto;
    perspective: none;
  }

}

/* ========================================================================== */
/* CLIP REVEAL SCENE */
/* ========================================================================== */

[data-hhscene='clip'] {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--paper);
}

[data-hhscene='clip'] img,
[data-hhscene='clip'] > div {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: clip-path;
}

/* Mobile/reduced-motion fallback */
@media (max-width: 879px), (prefers-reduced-motion: reduce) {
  [data-hhscene='clip'] {
    height: auto;
  }

  [data-hhscene='clip'] img,
  [data-hhscene='clip'] > div {
    height: auto;
    clip-path: none !important;
  }
}

/* ========================================================================== */
/* SCRUBBED COUNTER SCENE */
/* ========================================================================== */

[data-hhscene='counter'] {
  font-family: 'Courier New', monospace;
  font-size: 3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}

.well [data-hhscene='counter'],
.on-dark [data-hhscene='counter'] {
  color: var(--gold);
}

@media (max-width: 879px), (prefers-reduced-motion: reduce) {
  [data-hhscene='counter'] {
    font-size: 2rem;
  }
}

/* ========================================================================== */
/* PROGRESS RAIL SCENE */
/* ========================================================================== */

[data-hhscene='rail'] {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 3rem;
  width: 100%;
  background: var(--paper-2);
  border-radius: 0.25rem;
  overflow: hidden;
  padding: 0 1rem;
  box-sizing: border-box;
}

@media (max-width: 879px), (prefers-reduced-motion: reduce) {
  [data-hhscene='rail'] {
    flex-direction: column;
    height: auto;
    gap: 0.5rem;
    padding: 0.5rem;
  }

}

/* ========================================================================== */
/* UTILITY & RESETS */
/* ========================================================================== */

/* Ensure scenes don't have default margins that break layout */
[data-hhscene] {
  margin: 0;
  padding: 0;
}

/* High viewport: enable scenes */
@media (min-width: 880px) and (prefers-reduced-motion: no-preference) {
  [data-hhscene] {
    /* Scenes are active */
  }
}

/* Low viewport or reduced-motion: degrade gracefully */
@media (max-width: 879px) or (prefers-reduced-motion: reduce) {
  [data-hhscene] {
    /* All scene transforms disabled in CSS */
    /* JS respects this and doesn't apply animations */
  }
}
