/* ==========================================================================
   Universes 02-06: transitions, spatial moments, extra gallery shapes.
   ========================================================================== */

/* --- Transitions between universes ------------------------------------- */

.warp {
  position: relative;
  height: var(--warp-h, 320vh);
  background: var(--paper);
}
.warp__stage {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 540px;
  overflow: hidden;
  isolation: isolate;
  background: var(--paper);
}
.warp__ground {
  position: absolute;
  inset: 0;
  background: var(--space);
  clip-path: circle(0 at 50% 50%);
  will-change: clip-path;
}
.warp[data-variant="editorial"] .warp__ground { background: var(--paper-3); }
.warp[data-variant="editorial"] .arrival__page { box-shadow: 0 30px 80px -30px rgb(19 19 18 / 0.35); }

.warp-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.warp__teaser {
  position: absolute;
  left: var(--margin);
  right: var(--margin);
  bottom: clamp(40px, 10vh, 110px);
  display: grid;
  gap: 18px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  transform-origin: 50% 100%;
}
.warp__teaser .label { color: var(--grey); }
.warp__teaser-title {
  font-size: var(--fs-h3);
  font-weight: 600;
  font-stretch: 62%;
  line-height: 0.82;
  text-transform: uppercase;
  color: var(--paper-3);
}
.warp__teaser-title span:first-child { color: var(--grey); margin-right: 0.18em; }

.is-static .warp,
.no-js .warp { display: none; }

/* --- 02 · Brise-soleil -------------------------------------------------- */

.louvers { position: relative; height: 240vh; }
.louvers__viewport {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  overflow: hidden;
}
.louvers__frame {
  width: min(88vw, calc(74svh * 1.459));
  aspect-ratio: 2400 / 1645;
  display: flex;
  perspective: 1800px;
  background: var(--paper);
}
.louvers__frame > img { width: 100%; height: 100%; object-fit: cover; }
.slat {
  position: relative;
  flex: 1;
  height: 100%;
  background-repeat: no-repeat;
  backface-visibility: hidden;
  will-change: transform;
}
.slat::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #131312;
  opacity: var(--shade, 0);
}
.louvers__meta {
  width: min(88vw, calc(74svh * 1.459));
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--gutter);
}
.louvers__meta p:first-child {
  max-width: 30ch;
  font-size: clamp(20px, 1.8vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-stretch: 90%;
}
.louvers__meta .label { color: var(--grey); }

.is-static .louvers,
.no-js .louvers { height: auto; padding-block: 64px; }
.is-static .louvers__viewport,
.no-js .louvers__viewport { position: relative; height: auto; }

/* --- 03 · Media wall ---------------------------------------------------- */

.wall { position: relative; height: 260vh; }
.wall__viewport {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--paper);
}
.wall__grid {
  width: min(94vw, 168svh);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(6px, 0.7vw, 12px);
  will-change: transform;
}
.wall__grid > * {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--paper-2);
}
.wall__grid img,
.wall__grid video { width: 100%; height: 100%; object-fit: cover; }
.wall__caption {
  position: absolute;
  left: var(--margin);
  bottom: clamp(24px, 5vh, 48px);
  padding: 12px 16px 13px;
  background: var(--paper);
  font-size: clamp(20px, 1.8vw, 28px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  font-stretch: 90%;
  opacity: 0;
}
.is-static .wall,
.no-js .wall { height: auto; padding-block: 64px; }
.is-static .wall__viewport,
.no-js .wall__viewport { position: relative; height: auto; }
.is-static .wall__caption,
.no-js .wall__caption { position: static; opacity: 1; margin-top: 24px; }

/* --- 04 · The book ---------------------------------------------------- */

.book { position: relative; height: 280vh; }
.book__viewport {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 26px;
  overflow: hidden;
}
.book__object {
  position: relative;
  width: min(86vw, 150svh);
  aspect-ratio: 2 / 1;
  perspective: 2600px;
  box-shadow: 0 50px 90px -50px rgb(19 19 18 / 0.45);
}
.book__object > img { width: 100%; height: 100%; object-fit: cover; }
.book__object::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 6%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgb(0 0 0 / 0.14) 48%, rgb(255 255 255 / 0.08) 52%, transparent);
  pointer-events: none;
  z-index: 400;
}
.book__face {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background-size: 200% 100%;
  background-repeat: no-repeat;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.book__base--left { left: 0; }
.book__base--right { left: 50%; }
.book__leaf {
  position: absolute;
  left: 50%;
  top: 0;
  width: 50%;
  height: 100%;
  transform-origin: 0 50%;
  transform-style: preserve-3d;
  will-change: transform;
}
.book__leaf .book__face { left: 0; width: 100%; }
.book__back { transform: rotateY(180deg); }
.book__leaf .book__face::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgb(0 0 0 / 0.28), transparent 55%);
  opacity: var(--fold, 0);
}
.book__meta {
  width: min(86vw, 150svh);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--gutter);
}
.book__meta p:first-child {
  max-width: 30ch;
  font-size: clamp(20px, 1.8vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-stretch: 90%;
}
.book__meta .label { color: var(--grey); }
.is-static .book,
.no-js .book { height: auto; padding-block: 64px; }
.is-static .book__viewport,
.no-js .book__viewport { position: relative; height: auto; }

/* --- 05 · Broadcast slices -------------------------------------------- */

.slices { position: relative; height: 300vh; }
.slices__viewport {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--gutter);
  padding-inline: var(--margin);
  overflow: hidden;
  background: #0f0f10;
  color: #f1eee8;
}
.slices__text { display: grid; gap: 22px; align-content: center; max-width: 34ch; }
.slices__text .label { color: #9a978f; }
.slices__text p:not(.label) {
  font-size: clamp(26px, 3vw, 50px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-stretch: 82%;
  font-weight: 500;
}
.slices__counter { font-variant-numeric: tabular-nums; }
.slices__frame {
  position: relative;
  height: min(84svh, 150vw);
  aspect-ratio: 0.64;
  overflow: hidden;
  background: #1a1a1b;
}
.slices__layer { position: absolute; inset: 0; }
.strip {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  will-change: transform;
}
.is-static .slices,
.no-js .slices { display: none; }

/* --- 06 · Morph -------------------------------------------------------- */

.morph { position: relative; height: 280vh; }
.morph__viewport {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 3vw, 56px);
  padding-inline: var(--margin);
  overflow: hidden;
}
.morph__intro { display: grid; gap: 18px; align-self: center; }
.morph__intro p:not(.label) {
  font-size: clamp(22px, 2.2vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  font-stretch: 88%;
}
.morph__intro .label { color: var(--grey); }
.morph__frame {
  position: relative;
  width: min(76svh, 60vw);
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--paper-2);
}
.morph__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}
.morph__frame img:first-child { opacity: 1; }
.morph__frame.is-gl img { visibility: hidden; }
.morph__steps { display: grid; gap: 12px; align-self: center; }
.morph__steps li {
  display: flex;
  gap: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--grey);
  transition: color 0.4s var(--ease-out);
}
.morph__steps li.is-current { color: var(--ink); }
.morph__steps b { font-weight: 500; }

.is-static .morph,
.no-js .morph { height: auto; padding-block: 64px; }
.is-static .morph__viewport,
.no-js .morph__viewport { position: relative; height: auto; grid-template-columns: 1fr; }
.is-static .morph__frame,
.no-js .morph__frame {
  width: 100%;
  aspect-ratio: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gutter);
  background: none;
}
.is-static .morph__frame img,
.no-js .morph__frame img { position: static; opacity: 1; aspect-ratio: 1; }

/* --- Extra gallery shapes -------------------------------------------- */

.g-2 { grid-column: span 2; }
.g-6 { grid-column: span 6; }
.g-7 { grid-column: span 7; }
.g-4o { grid-column: 9 / span 4; }
.g-10o { grid-column: 2 / span 10; }
.media--portrait .media__frame { aspect-ratio: 0.64; }
.media--square .media__frame { aspect-ratio: 1; }
.media--card .media__frame { aspect-ratio: 4 / 5; }
.media--contain .media__frame > img { object-fit: contain; }

.case-chapter {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 14px;
  margin-top: clamp(40px, 8vh, 100px);
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.case-chapter .label { grid-column: 1 / span 3; color: var(--grey); }
.case-chapter h4 {
  grid-column: 4 / span 4;
  font-size: clamp(22px, 2vw, 32px);
  font-weight: 500;
  font-stretch: 84%;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.case-chapter p:last-child { grid-column: 8 / span 5; color: var(--ink-2); max-width: 44ch; }

.support__link {
  display: inline-flex;
  gap: 8px;
  margin-top: 18px;
  padding-bottom: 3px;
  border-bottom: 1px solid currentColor;
  font-size: var(--fs-small);
}
.support__link:hover { color: var(--klein); }
.proof-list a { display: block; }
.proof-list a:hover b { color: var(--klein); }
.proof-list a:hover img { transform: scale(1.03); }
.proof-list img { transition: transform 0.8s var(--ease-out); }

@media (max-width: 1000px) {
  .g-2 { grid-column: span 4; }
  .g-6, .g-7, .g-4o, .g-10o { grid-column: 1 / -1; }
  .case-chapter .label, .case-chapter h4, .case-chapter p:last-child { grid-column: 1 / -1; }
  .slices__viewport { grid-template-columns: 1fr; align-content: center; justify-items: center; }
  .slices__text { max-width: none; text-align: center; justify-items: center; }
  .slices__frame { height: 62svh; }
  .morph__viewport { grid-template-columns: 1fr; align-content: center; justify-items: center; }
  .morph__intro { text-align: center; }
  .morph__frame { width: min(86vw, 52svh); }
  .morph__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(86vw, 52svh); }
}
