/* The studio is the full scrolling viewport. Type and navigation sit over the film. */
.motion-story {
  position:relative;
  background:#d2c5b9;
  color:#292720;
}
.motion-story.enhanced {
  height:calc(100svh + clamp(2000px, 355svh, 3700px));
}
.story-pin {
  position:sticky;
  top:0;
  height:100vh;
  height:100dvh;
  width:100%;
  isolation:isolate;
  overflow:hidden;
}
.film-screen, .film-screen picture, .film-screen img, .film-video,
.film-screen canvas, .atelier-shade {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
}
.film-screen { background:#cbbfb3; z-index:-2; }
.film-screen img, .film-video { object-fit:cover; object-position:center; }
.film-video, .film-screen canvas { opacity:0; pointer-events:none; }
.film-screen.has-film .film-video.shown, .film-screen.has-canvas canvas { opacity:1; }
.film-screen canvas { z-index:1; }
.atelier-shade {
  z-index:-1;
  pointer-events:none;
  background:linear-gradient(180deg,#f8f1e55e 0%,transparent 19%),
             linear-gradient(0deg,#151512ce 0%,#1d1a1659 16%,transparent 34%);
}
.atelier-top, .atelier-bottom {
  position:absolute;
  left:max(var(--side),env(safe-area-inset-left));
  right:max(var(--side),env(safe-area-inset-right));
}
.atelier-top {
  top:calc(clamp(22px,4.5vh,65px) + env(safe-area-inset-top));
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  pointer-events:none;
}
.atelier-top p, .chapter-count, .film-action {
  font-family:var(--sans);
  font-size:.73rem;
  line-height:1.4;
  font-weight:600;
  letter-spacing:.14em;
}
.atelier-top h2 { margin:5px 0 0; font-size:clamp(2.6rem,4vw,4.8rem); }
.skip-story {
  pointer-events:auto;
  font-size:.83rem;
  font-weight:550;
  line-height:1.4;
  padding:5px 0 3px;
  border-bottom:1px solid;
}
.atelier-bottom {
  bottom:calc(clamp(12px,2.8vh,42px) + env(safe-area-inset-bottom));
  color:#fff9ea;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:end;
  gap:clamp(13px,2vh,28px) 18px;
  pointer-events:none;
}
.chapter-count {display:flex;align-items:center;gap:9px;color:#f2e5cf;font-size:.7rem;}
.chapter-count i {width:24px;height:1px;background:currentColor;opacity:.75;}
.atelier-caption h3 {margin:5px 0 4px;font:400 clamp(2.55rem,3.8vw,4.5rem)/.99 var(--serif);letter-spacing:-.02em;}
.atelier-caption p {max-width:410px;line-height:1.45;color:#fbf4e7;font-size:clamp(.86rem,1.12vw,1.02rem);}
.film-action {text-align:right;font-size:.75rem;letter-spacing:.03em;font-weight:500;}
#final-actions {display:flex;align-items:center;gap:14px;pointer-events:auto;}
#final-actions a {border-bottom:1px solid;padding-block:4px;}
#pause-turn {background:#211d1840;color:inherit;display:grid;place-items:center;width:38px;height:38px;border:1px solid #fff8e7aa;border-radius:50%;}
#pause-turn .icon {width:14px;height:14px;}
.chapter-tabs {grid-column:1/-1;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:13px;pointer-events:auto;}
.chapter-tabs button {
  padding:7px 0 2px;
  min-height:40px;
  text-align:left;
  background:none;
  color:#e8ddcc;
  border:0;
  font:500 .76rem/1.25 var(--sans);
}
.chapter-tabs button[aria-pressed=true] {color:white;}
.chapter-tabs button:hover i {background:#f1e7cfb0;}
.chapter-tabs button i {display:block;height:2px;position:relative;background:#fff2d75c;margin:0 0 7px;}
.chapter-tabs button i::after {
  content:"";position:absolute;inset:0;background:#ffefd4;
  transform:scaleX(var(--fill,0));transform-origin:left center;
}
.no-motion {position:absolute;bottom:0;padding:10px;background:var(--paper);}
@media (max-width:720px) {
  .atelier-top {top:calc(20px + env(safe-area-inset-top));}
  .atelier-top p {font-size:.62rem;letter-spacing:.15em;}
  .atelier-top h2 {font-size:2.75rem;}
  .skip-story {font-size:.73rem;}
  .atelier-bottom {bottom:calc(5px + env(safe-area-inset-bottom));gap:8px;}
  .atelier-caption {grid-column:1/-1;}
  .atelier-caption h3 {font-size:clamp(2.35rem,8.6vw,3.35rem);}
  .atelier-caption p {font-size:.88rem;max-width:32ch;}
  .film-action {grid-column:1/-1;text-align:left;min-height:22px;display:flex;align-items:center;}
  .film-action #scroll-hint {font-size:.71rem;color:#e5d9c9;}
  #final-actions {gap:11px;font-size:.79rem;}
  #pause-turn {width:30px;height:30px;}
  .chapter-tabs {gap:6px;}
  .chapter-tabs button {min-height:34px;padding:6px 0;}
  .chapter-tabs button i {margin:0;}
  .chapter-tabs button span {position:absolute;clip-path:inset(50%);height:1px;width:1px;overflow:hidden;}
  .atelier-shade {
    background:linear-gradient(180deg,#f8f1e553 0%,transparent 19%),
               linear-gradient(0deg,#171513db 0%,#1b1814a1 11%,#1b181436 22%,transparent 35%);
  }
}
@media (orientation:landscape) and (max-height:560px) {
  .atelier-top {top:10px;}
  .atelier-top h2 {font-size:2rem;}
  .atelier-bottom {bottom:4px;gap:3px 15px;}
  .atelier-caption {grid-column:1;}
  .atelier-caption h3 {font-size:1.95rem;}
  .atelier-caption p {font-size:.78rem;max-width:40ch;}
  .film-action {grid-column:2;justify-self:end;}
  .chapter-tabs button {min-height:26px;}
}
@media (orientation:portrait) and (max-height:740px) {
  .atelier-bottom { gap:5px; }
  .atelier-caption h3 { font-size:2.12rem; margin:2px 0; }
  .atelier-caption p { font-size:.82rem; line-height:1.35; }
  .atelier-caption .chapter-count { font-size:.62rem; }
  .film-action:has(#final-actions[hidden]) { display:none; }
  .chapter-tabs button { min-height:32px; }
}

html:has(#atelier:target) { scroll-behavior:auto; }
