/* Section transitions; progress variables come from js/custom/transitions.js. */

/* Shared: later sections sit above earlier ones. */
.hero-section { position: relative; z-index: 0; }
.section-services { position: relative; z-index: 2; }
.section-works.set-2 { position: relative; z-index: 3; }
/* Dimming layers (opacity driven per mode below). */
.hero-section::after,
.section-services::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  background: #080808;
  opacity: 0;
  pointer-events: none;
}
.hero-section::after { top: 0; }
.section-services::after { height: 100vh; }

/* ---------- Stack ---------- */
/* Hero recedes (moves at ~half speed) and dims while the white section slides over it. */
html[data-transitions="stack"] .hero-section { transform: translate3d(0, calc(var(--t1, 0) * 45vh), 0); }
html[data-transitions="stack"] .hero-section::after { opacity: calc(var(--t1, 0) * 0.75); }
html[data-transitions="stack"] .section-services {
  border-radius: 1.5rem 1.5rem 0 0;
  box-shadow: 0 -2rem 4rem rgba(0, 0, 0, 0.35);
}
/* Services' last screen recedes and dims under the dark portfolio. */
html[data-transitions="stack"] .section-services { transform: translate3d(0, calc(var(--t2, 0) * 40vh), 0); }
html[data-transitions="stack"] .section-services::after { opacity: calc(var(--t2, 0) * 0.6); }
html[data-transitions="stack"] .section-works.set-2 {
  border-radius: 1.5rem 1.5rem 0 0;
  box-shadow: 0 -2rem 4rem rgba(0, 0, 0, 0.3);
  background-color: #080808;
}

/* ---------- Fade ---------- */
/* Services' final screen fades to dark as the portfolio arrives. */
html[data-transitions="fade"] .section-services::after { opacity: var(--t2, 0); }

/* ---------- Switch (prototype) ---------- */
.transitions-switch {
  position: fixed;
  left: max(1rem, env(safe-area-inset-left, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: rgba(8, 8, 8, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font: 600 11px/1 Thicccboi, Arial, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.transitions-switch span { padding: 0 8px 0 6px; color: rgba(255, 255, 255, 0.5); }
.transitions-switch button {
  padding: 8px 10px; border: 0; background: none; color: rgba(255, 255, 255, 0.75);
  font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer;
}
.transitions-switch button[aria-pressed="true"] { background: #fff; color: #080808; }

@media (prefers-reduced-motion: reduce) {
  html[data-transitions="stack"] .hero-section,
  html[data-transitions="stack"] .section-services { transform: none; }
}

.transitions-switch-link { margin-left: 6px; padding: 8px 10px; border-left: 1px solid rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.75); text-decoration: none; }
.transitions-switch-link:hover { color: #fff; }
