/* Collection · storyboard SB-P02 (v3, approved 25 Nov 2026). Board px x2 = desktop px at 1920. Shares five.css (play controls). */
.stage { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1.2s var(--ease); }
.stage.is-on { opacity: 1; }
html.has-cut .stage.is-on { opacity: 0; transition-duration: .28s; }   /* B44: a jump to a far room is a cut */
.page-collection main { position: relative; }
.ring { position: relative; z-index: 1; }
.ring__pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.ring__hit { left: 22%; right: 22%; top: 14%; bottom: 22%; }

/* frame 1: the header */
.ring__head { position: absolute; z-index: 3; left: var(--m); top: calc(var(--nav-h) + var(--nav-top) + 6vh); max-width: 40vw; }
.ring__giant { position: absolute; left: -.06em; top: -.42em; z-index: -1; font: 300 var(--fs-giant)/.9 var(--f-display); color: var(--ivory); opacity: .07; letter-spacing: -.02em; pointer-events: none; }
.ring__h1 { margin: 14px 0 0; display: grid; font: 300 var(--fs-h1)/1.04 var(--f-display); letter-spacing: -.01em; color: var(--ivory); }
.ring__h1 .d { color: var(--stone); }
.ring__intro { margin: 22px 0 0; max-width: 30em; color: var(--ink-3); }
.ring__cue { display: inline-block; margin-top: 8vh; font: 500 12px/1 var(--f-ui); letter-spacing: .2em; color: var(--gold); text-transform: uppercase; }
.ring__minis button { pointer-events: auto; padding: 6px 4px; font: inherit; color: inherit; transition: color var(--t-hover) var(--ease); }
.ring__minis button:hover { color: var(--gold); }

/* frames 2-6: a room */
.ring__rail { top: 50vh; }
.ring__count { position: absolute; left: calc(36 * var(--u)); top: calc(50vh - 48px); }
.ring__count.is-roll { animation: ps-roll .3s var(--ease); }
@keyframes ps-roll { from { opacity: 0; transform: translate3d(0, 10px, 0); } }
.room__words { position: absolute; z-index: 3; left: var(--m); top: calc(var(--nav-h) + var(--nav-top) + 8vh); max-width: 24vw; }
.room__name { margin: 14px 0 10px; font: 300 var(--fs-h1)/1 var(--f-display); letter-spacing: -.01em; color: var(--ivory); }
.room__spec { margin: 0; color: var(--ink-3); font-size: var(--fs-small); }
.room__lora { margin: 22px 0 0; font: italic 400 max(16px, calc(20 * var(--u)))/1.45 var(--f-accent); color: var(--gold); }
.room__rail { position: absolute; z-index: 3; right: var(--m); top: calc(var(--nav-h) + var(--nav-top) + 8vh); display: grid; justify-items: end; gap: 10px; }
.room__rail .five__chips { display: grid; justify-items: end; gap: 8px; }
.room__label { margin: 14px 0 0; font: 500 max(10px, calc(11 * var(--u)))/1 var(--f-ui); letter-spacing: .2em; color: var(--stone); text-transform: uppercase; }
.room__angles { display: grid; grid-template-columns: repeat(2, auto); gap: 8px; }
.room__angles .chip { cursor: pointer; justify-content: center; }
.room__angles .chip:hover { color: var(--ivory); box-shadow: inset 0 0 0 1px var(--gold); }
.room__angles .chip.is-on { background: var(--ivory); color: var(--ebony); box-shadow: none; }
.room__scrub { margin-top: 10px; }
.room__cta { position: absolute; z-index: 3; left: var(--m); bottom: calc(5vh + 64px); display: flex; flex-wrap: wrap; gap: 14px; }
.room__next { position: absolute; z-index: 3; right: var(--m); bottom: calc(5vh + 76px); font: 500 max(10px, calc(12 * var(--u)))/1 var(--f-ui); letter-spacing: .16em; color: var(--stone); text-transform: uppercase; }
.room__loop { position: absolute; z-index: 3; left: 50%; top: 20vh; margin: 0; transform: translate3d(-50%, 12px, 0); text-align: center; color: var(--stone); font-size: var(--fs-small);
  opacity: 0; transition: opacity var(--t-reveal) var(--ease), transform var(--t-reveal) var(--ease); pointer-events: none; }
.room__loop span { display: block; font: 300 max(44px, calc(90 * var(--u)))/1 var(--f-display); color: var(--gold); }
.ring__pin.is-loop .room__loop { opacity: 1; transform: translate3d(-50%, 0, 0); }

/* which words show: the header, or a room */
.ring__head, .ring__minis, .room__words, .room__rail, .room__cta, .room__next, .ring__count, .ring__rail {
  opacity: 0; visibility: hidden; transform: translate3d(0, var(--reveal-y), 0);
  transition: opacity calc(var(--t-reveal) * .65) var(--ease-leave), transform calc(var(--t-reveal) * .65) var(--ease-leave), visibility 0s linear calc(var(--t-reveal) * .65); }
.ring__rail { transform: rotate(180deg) translate3d(0, calc(var(--reveal-y) * -1), 0); }
[data-phase="head"] :is(.ring__head, .ring__minis),
[data-phase="room"] :is(.room__words, .room__rail, .room__cta, .room__next, .ring__count) {   /* the new part waits for the old one to leave (B27) */
  opacity: 1; visibility: visible; transform: none; transition: opacity var(--t-reveal) var(--ease) calc(var(--t-reveal) * .65), transform var(--t-reveal) var(--ease) calc(var(--t-reveal) * .65), visibility 0s calc(var(--t-reveal) * .65); }
[data-phase="room"] .ring__rail { opacity: 1; visibility: visible; transform: rotate(180deg); transition: opacity var(--t-reveal) var(--ease), visibility 0s; }
.ring__pin.is-playing .room__words { opacity: .35; }

/* frame 10: the bar that stays (hides while you hold a box) */
.ringbar { position: fixed; z-index: 40; left: var(--m); right: var(--m); bottom: 16px; display: flex; align-items: center; gap: 10px; pointer-events: none;
  opacity: 0; transform: translate3d(0, 12px, 0); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.ringbar > * { pointer-events: auto; }
.ringbar.is-in { opacity: 1; transform: none; }
body.is-holding .ringbar { opacity: 0; pointer-events: none; }
.ringbar .chip { cursor: pointer; min-height: 40px; }
.ringbar .chip:hover { color: var(--ivory); box-shadow: inset 0 0 0 1px var(--gold); }
.ringbar__link { margin-left: auto; font-size: 13px; color: var(--stone); padding: 10px 8px; transition: color var(--t-hover) var(--ease); }
.ringbar__link:hover { color: var(--gold); }
.page-collection .room__cta { bottom: calc(16px + 64px); }
.page-collection .room__next { bottom: calc(16px + 78px); }

/* frames 8 and 9: overlays */
.overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgba(11, 11, 11, .86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .3s var(--ease); }
.overlay.is-open { opacity: 1; }
.overlay__in { position: relative; width: min(1120px, 100%); max-height: 88vh; overflow: auto; padding: clamp(28px, 4vw, 56px); border-radius: 6px; background: #101010; box-shadow: inset 0 0 0 1px var(--hair-soft); }
.overlay__close { position: absolute; right: 16px; top: 16px; cursor: pointer; min-height: 40px; }
.index { display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; align-items: center; }
.index__rows { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--hair-soft); }
.index__row { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--hair-soft); transition: background-color var(--t-row) linear, color var(--t-row) linear;
  opacity: 0; transform: translate3d(0, var(--reveal-y), 0); }
.index__row.is-in { opacity: 1; transform: none; transition: background-color var(--t-row) linear, color var(--t-row) linear, opacity var(--t-reveal) var(--ease) calc(var(--i) * .06s), transform var(--t-reveal) var(--ease) calc(var(--i) * .06s); }
.index__row > button { flex: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 18px 10px; text-align: left; color: inherit; }
.index__name { font: 400 max(22px, calc(32 * var(--u)))/1.1 var(--f-display); }
.index__type { font-size: 13px; color: var(--stone); transition: color var(--t-row) linear; }
.index__tags { display: flex; gap: 8px; padding-right: 10px; }
.index__tags .chip { cursor: pointer; }
.index__row:hover, .index__row:focus-within { background: var(--ivory); color: var(--ebony); }
.index__row:hover .index__type, .index__row:focus-within .index__type { color: var(--stone-shade); }
.index__row:hover .chip, .index__row:focus-within .chip { color: var(--ebony); box-shadow: inset 0 0 0 1px rgba(11, 11, 11, .35); background: transparent; }
.index__card { aspect-ratio: 4 / 3; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--hair-soft); background: radial-gradient(60% 60% at 50% 45%, #1a1a1a, #0b0b0b 70%); }
.quiz { max-width: 720px; }
.quiz__h2 { margin: 0; display: grid; font: 300 var(--fs-h2)/1.05 var(--f-display); color: var(--ivory); }
.quiz__h2 .d { color: var(--stone); }
.quiz__form { display: grid; gap: 18px; margin-top: 30px; max-width: 520px; }
.quiz__form label { display: grid; gap: 8px; font: 500 12px/1.2 var(--f-ui); letter-spacing: .14em; color: var(--stone); text-transform: uppercase; }
.quiz__form select, .quiz__form input { height: 46px; padding: 0 14px; border: 0; border-radius: 2px; background: #151515; color: var(--ivory); box-shadow: inset 0 0 0 1px var(--hair);
  font: 400 15px/1 var(--f-ui); letter-spacing: 0; text-transform: none; }
.quiz__form select:focus, .quiz__form input:focus { outline: none; box-shadow: inset 0 0 0 1px var(--gold); }
.quiz__out { min-height: 1.5em; margin: 6px 0 0; font: italic 400 18px/1.45 var(--f-accent); color: var(--gold); }
.quiz__pick { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; font: inherit; }
.quiz__form .pill { justify-self: start; }

/* phones and portrait screens */
@media (max-width: 767px), (max-aspect-ratio: 23/20) {
  .ring__hit { left: 4%; right: 4%; top: 22%; bottom: 40%; }
  .ring__head { max-width: none; right: var(--m); }
  .room__words { max-width: none; right: var(--m); top: calc(var(--nav-h) + var(--nav-top) + 10px); }
  .room__name { font-size: 34px; margin: 8px 0 6px; }
  .room__lora { display: none; }
  .room__rail { left: var(--m); right: var(--m); top: auto; bottom: 184px; justify-items: start; gap: 8px; }
  .room__rail .five__chips, .room__angles { display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; gap: 8px; }
  .room__label, .room__scrub { display: none; }
  .room__cta { left: var(--m); right: var(--m); bottom: 64px; gap: 10px; }
  .room__next, .ring__rail, .ring__count { display: none; }
  .ringbar { left: 12px; right: 12px; bottom: 10px; }
  .index { grid-template-columns: 1fr; }
  .index__card { display: none; }
}

/* the index shows its box live in the card: the page behind goes dark instead of blurred, so the 3D shows through */
.overlay[data-overlay="index"] { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.has-index .ring__pin > *:not(.ring__hit), .has-index .ringbar { visibility: hidden; }
.overlay[data-overlay="index"] .overlay__in { background: transparent; }
.index__card { background: transparent; }
.index__card:not(.is-live) { background: radial-gradient(60% 60% at 50% 45%, #1a1a1a, #0b0b0b 70%); }

/* the room's words cross-fade when the next box takes the room */
.room__words > * { transition: opacity .3s var(--ease); }
.room__words.is-swap > * { opacity: 0; transition: opacity .25s var(--ease-leave); }
