#practice-film {
  --pf-paper: #eef9fc;
  --pf-ink: #183c50;
  --pf-accent: #0b64ae;
  --pf-pad: clamp(16px, 2.4vw, 40px);
  --pf-top: max(16svh, 110px);
  font-family: var(--f-display, "Arial", sans-serif);
}
.pf-track { position: relative; isolation: isolate; }
.pf-stage {
  position: sticky; top: 0; z-index: 1;
  height: 100vh; height: 100svh; margin-bottom: -100vh; margin-bottom: -100svh;
  overflow: hidden; isolation: isolate;
  background: var(--pf-ink); color: var(--pf-ink);
  container-type: size;
}
.pf-stage *, .pf-dialog * { box-sizing: border-box; }
.pf-stage :where(h2,p), .pf-dialog :where(h2,p) { margin: 0; }
.pf-stage [hidden] { display: none !important; }
.pf-marker { position: relative; pointer-events: none; height:var(--duration); scroll-margin-top:var(--chapter-landing); }
.pf-marker-room:last-child { height: calc(var(--duration) + 100svh); }
.pf-marker:focus { outline: 0; }
.pf-stage img { display: block; max-width: none; user-select: none; -webkit-user-drag: none; }
.pf-stage :where(.pf-taste,.pf-cutaway,.pf-surface,.pf-cellar,.pf-banquet,.pf-tableau,.pf-room,.pf-set,.pf-intertitles) { position: absolute; inset: 0; }
.pf-taste { background: var(--pf-ink); overflow: hidden; color: var(--pf-paper); }
.pf-cutaway { transform: translateY(var(--cut-y, 0%)); opacity: var(--cut-fade, 1); }
.pf-surface {
  background: #175473 url("./assets/film/sets/wall-gallery.webp") center bottom / cover;
  overflow: hidden;
}
.pf-surface::before {
  content: ""; position: absolute; inset: 78% 0 0;
  background: #c5dce4 url("./assets/film/sets/floor-gallery.webp") center top / 100% 100%;
}
.pf-surface p { position: absolute; top: 21%; left: var(--pf-pad); z-index: 1; font-size: clamp(60px, 8.8vw, 180px); font-weight: 300; line-height: .88; letter-spacing: -.06em; }
.pf-surface p i { color: var(--pf-accent); font-style: normal; }
.pf-surface img {
  position: absolute; width: min(53vw, 74vh); height: 58%; right: 5%; bottom: 11%;
  object-fit: contain; transform: rotate(var(--tray-rotation, 0deg)); filter: drop-shadow(1.5vw 2.5vw 1.3vw #183c5050);
}
.pf-cellar {
  top: 100%; bottom: -100%; background-color: #86adbe; color: #183c50;
  background-image: linear-gradient(118deg,#b3d3de66,#47718855), repeating-linear-gradient(2deg,#759baa60 0 2px,transparent 3px 11px);
  overflow: hidden;
}
.pf-cellar::before {
  content: ""; position: absolute; inset: 16% 6% 9%; border: clamp(9px,1.4vmin,22px) solid #608699; border-bottom-color: #bdd7e1;
  border-top-color: #7497a8;
  background: linear-gradient(130deg,#698e9f,#b7d0d9 66%,#7294a6);
  box-shadow: inset .8vw 1.4vw 2vw #26455770,0 .6vw .5vw #294a5b74;
}
.pf-machinery { position: absolute; left: 7%; bottom: 11%; width: 54%; height: 59%; transform: translateY(var(--machine-lift,0%)); }
.pf-machinery img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; filter: drop-shadow(1vw 1.2vw .55vw #335a7088); }
.pf-cellar p { position: absolute; left: 62%; right: 10%; top: 29%; font-size: clamp(25px,3.1vw,64px); letter-spacing: -.04em; font-weight: 400; line-height: 1.07; }
.pf-intertitles { display: grid; align-items: center; justify-items: center; pointer-events: none; }
.pf-intertitles span { grid-area: 1/1; opacity: 0; color: #b2dbee; font: 400 clamp(82px,16vw,320px)/.85 var(--f-serif,Georgia,serif); letter-spacing: -.04em; }
.pf-intertitles span + span { color: #eef9fc; }
.pf-intertitles i { color: #0b64ae; font-style: normal; }

.pf-banquet { background: #c5dce4 url("./assets/film/sets/banquet-wall.webp") 0 0 / auto 49vh; }
.pf-cloth {
  position: absolute; left: -15%; right: -15%; bottom: -4%; height: 31%;
  background: #eef6f8 url("./assets/film/sets/banquet-linen.webp") center top / auto 100% repeat-x;
}
.pf-tableau { isolation: isolate; }
.pf-tableau h2 {
  position: absolute; top: 21%; left: 0; right: 0; z-index: 3;
  font-size: clamp(48px, 8.2vw, 158px); letter-spacing: -.055em; font-weight: 700; line-height: .96; text-align: center;
  opacity: var(--table-title, 1); transform: translateY(calc((1 - var(--table-title,1)) * 10px));
}
.pf-tableau em { font: italic 400 1.04em/.8 var(--f-serif,Georgia,serif); color: #0b5899; }
.pf-tableau h2 span { color: var(--pf-accent); }
.pf-table-people { position:absolute; z-index: 0; inset: 34% 0 27%; overflow:hidden; }
.pf-table-people .pf-patient {
  left: 48%; bottom: -30%; height: 121%; transform: translateX(-50%) translateY(calc((1 - var(--table-person,1)) * 72%));
}
.pf-fixtures { position: absolute; inset: 46% -16% 20%; transform: translateX(var(--banquet-pan,0)); pointer-events: none; }
.pf-fixture { position: absolute; width: 11%; left: calc(4% + var(--slot) * 21%); height: 100%; }
.pf-fixture::before, .pf-relic::before {
  content: ""; width: 84%; height: 10%; bottom: 1%; left: 9%; position: absolute;
  border-radius: 50%; background: #f0f8fa;
  box-shadow: 0 2px 0 #9eb9c4, 0 .5vh .45vh #294b5c40, inset 0 .3vh 1vh #aec8d380;
}
.pf-fixture img { position: absolute; inset: auto 10% 6%; width: 80%; height: 65%; object-fit: contain; object-position: bottom; filter: drop-shadow(.25vw .45vw .18vw #183c5052); }
.pf-tableau .pf-link { position: absolute; left: 50%; bottom: 9%; transform: translateX(-50%); opacity: var(--table-action,0); background:var(--pf-paper); color:var(--pf-ink); }
.pf-link,.pf-close {
  appearance: none; cursor: pointer; font: 700 15px/1.15 var(--f-display,Arial,sans-serif); color: inherit;
  border: 1px solid currentColor; border-radius: 999px; padding: .7em 1.2em; background: transparent;
}
.pf-link:hover,.pf-close:hover { text-decoration: underline; text-underline-offset: .18em; }
.pf-link:focus-visible,.pf-close:focus-visible { outline: 3px solid var(--pf-accent); outline-offset: 4px; }


.pf-performance { position:absolute; inset:0; width:100%; height:100%; display:block; pointer-events:none; }
.pf-play-controls { position:absolute; inset:0; pointer-events:none; }
.pf-play-piece {
  position:absolute; top:0; left:0; pointer-events:auto; appearance:none; padding:0; margin:0; border:0;
  border-radius:999px; background:transparent; color:transparent; cursor:pointer;
}
.pf-play-piece.is-draggable { cursor:grab; touch-action:none; }
.pf-play-piece.is-draggable:active { cursor:grabbing; }
.pf-play-piece:focus-visible { outline:3px solid var(--pf-accent); outline-offset:3px; }
.pf-room { overflow:hidden; pointer-events:none; color:var(--pf-ink); }
.pf-room[data-ink="light"] { color:var(--pf-paper); }
.pf-room[data-ink="light"] .pf-link:focus-visible { outline-color:var(--pf-paper); }
.pf-r1 .pf-copy .pf-type-piece { text-shadow:0 0 .045em #eef9fc,0 0 .13em #eef9fcaf; }
.pf-r2[data-ink="light"] .pf-copy .pf-type-piece,.pf-r5 .pf-copy .pf-type-piece {
  text-shadow:0 0 .05em #183c50,0 0 .14em #183c50d9;
}
.pf-table-people .pf-patient { position:absolute; width:auto; }
.pf-transcript { position:absolute; width:1px; height:1px; clip-path:inset(50%); overflow:hidden; white-space:nowrap; }
.pf-title,.pf-copy { position:absolute; top:var(--pf-top); left:var(--pf-pad); width:min(51%, 20em); }
.pf-title { opacity:0; }
.pf-typeset { display:block; }
.pf-type-mask {
  display:inline-block; white-space:nowrap; vertical-align:baseline;
  clip-path:inset(-.18em -.11em -.145em -.11em);
}
.pf-type-mask.pf-type-line { display:block; }
.pf-type-piece { display:inline-block; transform-origin:0 100%; }
.pf-title h2 { font-size:clamp(38px,4.8vw,97px); max-width:13ch; font-weight:700; letter-spacing:-.044em; line-height:.98; text-wrap:balance; }
.pf-r6 .pf-title { left:auto; right:var(--pf-pad); text-align:right; }
.pf-r6 .pf-title h2 { margin-left:auto; }
.pf-copy { opacity:0; font-weight:340; font-size:clamp(23px,2.55vw,50px); line-height:1.12; letter-spacing:-.03em; text-wrap:pretty; }
.pf-copy[data-style=word],.pf-copy[data-style=center] { font-weight:350; font-size:clamp(42px,6.4vw,124px); letter-spacing:-.052em; line-height:.97; }
.pf-copy[data-style=center] { text-align:center; top:33%; width:96%; left:2%; }
.pf-copy[data-style=right] { text-align:right; left:auto; right:var(--pf-pad); max-width:16em; }
.pf-copy[data-style=serif] { font:italic 400 clamp(36px,5vw,95px)/.99 var(--f-serif,Georgia,serif); max-width:10em; }
.pf-copy[data-style=speech] { font:400 clamp(19px,1.9vw,37px)/1.1 var(--f-serif,Georgia,serif); border-radius:1em; color:#183c50; background:#eef9fc; padding:.65em .9em; border:1px solid #183c50; top:29%; width:min(34%, 18em); }
.pf-copy[data-style=speech]::after { content:""; position:absolute; bottom:-.32em; right:17%; width:.65em; height:.65em; transform:rotate(45deg); border-right:1px solid #183c50; border-bottom:1px solid #183c50; background:#eef9fc; }
.pf-copy .pf-link { pointer-events:auto; margin-top:1.15em; font-size:clamp(14px,1.04vw,20px); }
.pf-copy[inert] .pf-link { pointer-events:none; }

.pf-dialog {
  box-sizing:border-box; width:min(94vw,960px); max-width:none; max-height:94svh; color:var(--pf-paper);
  padding:0; border:1px solid #ffffff2a; border-radius:16px; background:var(--pf-ink);
  font-family:var(--f-display,Arial,sans-serif); margin:auto; overflow:auto;
}
.pf-dialog:not([open]) { display:none; }
.pf-dialog::backdrop { background:#112d3bd9; }
.pf-dialog-bar { min-height:64px; padding:12px 18px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.pf-dialog-bar h2 { font-size:clamp(18px,2.6vw,28px); line-height:1; letter-spacing:-.035em; }
.pf-close { color:var(--pf-ink); background:#b2dbee; border:0; display:flex; align-items:center; gap:8px; }
.pf-close span { font-size:1.25em; }
.pf-dialog-body video { display:block; width:100%; max-height:65svh; object-fit:contain; background:#112c39; }
.pf-dialog-body > p { padding:13px 18px 18px; font:400 clamp(15px,1.1vw,18px)/1.35 var(--f-mono,monospace); }
.pf-model-pane { position:relative; height:min(58svh,580px); background:radial-gradient(ellipse at 53% 48%,#e1f0f5,#94bac8); }
.pf-model-pane model-viewer,.pf-poster { position:absolute; inset:0; width:100%;height:100%; }
.pf-poster { object-fit:contain; pointer-events:none; }
.pf-model-loaded .pf-poster { display:none; }

@media (orientation:portrait), (max-width:700px) {
  #practice-film { --pf-top: max(13svh, 88px); }
  .pf-surface p { top:17%; font-size:clamp(54px,14vw,103px); }
  .pf-surface img { right:-2%; bottom:12%; width:90%; height:42%; }
  .pf-cellar::before { inset:13% 5% 8%; }
  .pf-cellar p { left:12%; right:12%; top:20%; font-size:clamp(24px,6.5vw,42px); }
  .pf-machinery { left:6%; width:88%; bottom:13%; height:42%; }
  .pf-intertitles span { font-size:clamp(70px,20vw,150px); }
  .pf-cloth { bottom:0; height:36%; }
  .pf-tableau h2 { top:19%; font-size:clamp(44px,12.5vw,88px); padding:0 5vw; }
  .pf-table-people { inset:30% 0 36%; }
  .pf-table-people .pf-patient { height:113%; }
  .pf-fixtures { inset:43% -59% 30%; }
  .pf-tableau .pf-link { bottom:13%; }
  .pf-title,.pf-copy,.pf-r6 .pf-title { width:calc(100% - 2 * var(--pf-pad)); text-align:left; left:var(--pf-pad); right:auto; }
  .pf-title h2 { font-size:clamp(37px,9.8vw,68px); max-width:15ch; }
  .pf-r6 .pf-title h2 { margin-left:0; }
  .pf-copy { max-width:23em; font-size:clamp(22px,6.3vw,38px); }
  .pf-copy[data-style=word],.pf-copy[data-style=center] { font-size:clamp(38px,12vw,82px); }
  .pf-copy[data-style=center] { width:92%; left:4%; top:26%; }
  .pf-copy[data-style=right] { width:86%; }
  .pf-copy[data-style=serif] { font-size:clamp(35px,9vw,69px); }
  .pf-copy[data-style=speech] { top:23%; width:74%; font-size:clamp(20px,5vw,29px); }
  .pf-copy .pf-link { margin-top:.75em; font-size:14px; }
}
@media (max-height:650px) and (orientation:landscape) {
  #practice-film { --pf-top:90px; }
  .pf-title h2 { font-size:clamp(30px,4vw,56px); }
  .pf-copy { font-size:clamp(17px,2.4vw,30px); }
}
@media (prefers-reduced-motion:reduce) {
  .pf-room { padding:var(--pf-top) var(--pf-pad) 0; }
  .pf-room .pf-title,.pf-room .pf-copy {
    position:static; width:min(100%,42rem); text-align:left; transform:none!important;
  }
  .pf-room .pf-title h2 { max-width:none; margin:0; font-size:clamp(30px,min(6.5vw,7.8svh),72px); }
  .pf-room .pf-copy { margin-top:clamp(12px,2svh,24px); font-size:clamp(18px,min(5.6vw,4.2svh),38px); }
}

@media (min-aspect-ratio: 9/10) {
  .pf-r3 .pf-title,.pf-r3 .pf-copy { max-width:30%; }
}
