#book {
  --cloth: #315e79;
  --edge: #204359;
  --foil: #f2dda4;
  inset: 0;
  width: min(69rem, 91vw);
  height: min(39rem, 78dvh);
  max-width: none;
  max-height: none;
  padding: 0;
  margin: auto;
  color: #304064;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
#book[data-room="projects"] { --cloth:#bb682e; --edge:#864325; --foil:#fff0b9; }
#book::backdrop { background: #26385275; backdrop-filter: blur(4px); }
.book-binding {
  width:100%; height:100%; position:relative; perspective:1800px;
  transform: translateX(-25%) rotate(-1deg);
  transition: transform .94s cubic-bezier(.45,0,.25,1);
}
#book.is-open .book-binding { transform:rotate(-.55deg); }
.book-spread {
  display:grid; grid-template-columns:1fr 1fr; height:100%; border-radius:.38rem;
  background:#f6eedc; overflow:hidden;
  clip-path:inset(-12% -12% -20% 50%); transition:clip-path 0s .43s;
  box-shadow:0 2px #ded0b0, 0 4px #efe3c6, 0 6px #ccb893, 0 1.3rem 2.8rem -.8rem #17212e6b;
}
#book.is-open .book-spread { clip-path:inset(-12% -12% -20% -12%); }
.book-page {
  min-width:0; min-height:0; display:flex; flex-direction:column;
  padding:clamp(1rem,2.4vw,2.5rem); padding-bottom:4.2rem;
  background:radial-gradient(ellipse at 25% 0%,#fffaf0,#fbf4e4 62%,#f3e7ca);
}
.book-left { box-shadow:inset -1.45rem 0 1.5rem -1.3rem #7760426b; overflow:auto; }
.book-right { box-shadow:inset 1.45rem 0 1.5rem -1.3rem #77604270; }
.book-page small,.book-page figcaption { font-size:.83rem; color:#616b83; line-height:1.5; }
:is(#book-page-number,.book-page-number) { align-self:flex-end; font-variant-numeric:tabular-nums; }
:is(#book-title,.book-title) { margin:.55rem 0 1rem; font-size:clamp(1.35rem,2.4vw,2.1rem); line-height:1.23; }
.book-page figure { margin:auto 0; }
:is(#book-film,.book-film) { display:block; width:100%; aspect-ratio:960/620; max-height:47dvh; background:#e9e8e2; border:1px solid #c4ba9d; border-radius:.48rem; object-fit:contain; }
.book-page figcaption { margin-top:.6rem; }
:is(#book-notes,.book-notes) { margin:.8rem 0; flex:1; overflow:auto; scrollbar-width:thin; scrollbar-color:#b6a98b70 transparent; }
:is(#book-notes,.book-notes) section + section { margin-top:1.15rem; padding-top:1rem; border-top:1px solid #a994703b; }
:is(#book-notes,.book-notes) h3 { font-size:1.16rem; line-height:1.5; margin:0 0 .35rem; }
:is(#book-notes,.book-notes) p { font-size:1rem; line-height:1.8; margin:0; overflow-wrap:anywhere; }
.book-turns { position:absolute; inset:auto clamp(1rem,2.4vw,2.5rem) 1rem; display:flex; justify-content:space-between; pointer-events:none; visibility:hidden; }
#book.is-open .book-turns { visibility:visible; }
.book-turns button { pointer-events:auto; min-height:2.2rem; }
#book.turning .book-turns { visibility:hidden; }
.book-turns button,.book-close { font-size:.9rem; text-underline-offset:.25em; text-decoration:underline; }
.book-turns button:disabled { opacity:.35; cursor:default; text-decoration:none; }
#book .book-close { position:absolute; top:100%; left:50%; transform:translateX(-50%); width:auto; height:auto; margin:.55rem 0 0; padding:.35rem .7rem; color:white; white-space:nowrap; text-shadow:0 1px 5px #162237; background:#1a293b85; border-radius:1rem; }
.book-cover { position:absolute; z-index:2; inset:-3px -3px -3px 50%; transform-origin:left center; transform-style:preserve-3d; pointer-events:none; transition:transform .94s cubic-bezier(.45,0,.25,1); }
#book.is-open .book-cover { transform:rotateY(-180deg); }
.book-cloth { position:absolute; inset:0; display:grid; place-content:center; justify-items:center; gap:.7rem; color:var(--foil); backface-visibility:hidden;
  border-radius:3px .65rem .65rem 3px;
  background:repeating-linear-gradient(43deg,#fff1 0 1px,transparent 1px 4px),repeating-linear-gradient(-43deg,#0001 0 1px,transparent 1px 4px),linear-gradient(90deg,var(--edge),var(--cloth) 7%,var(--edge) 9%,var(--cloth) 12% 97%,var(--edge));
  box-shadow:inset 2px 1px 3px #fff4,0 .9rem 1.6rem -.6rem #17212e88;
}
.book-cloth::after { content:""; position:absolute; inset:5%; border:3px double currentColor; opacity:.72; border-radius:.24rem; }
.book-cloth strong { font-size:clamp(1.5rem,3vw,2.6rem); letter-spacing:.09em; }
.book-cloth span { font-size:.85rem; letter-spacing:.2em; }
.book-cloth svg { width:clamp(4rem,8vw,7rem); }
#book[data-room="intern"] .book-leaf,#book[data-room="projects"] .book-fish { display:none; }
@media(max-width:680px) {
  #book { width:calc(100vw - 1.5rem); height:min(48rem,81dvh); }
  .book-binding { transform:none; }
  #book.is-open .book-binding { transform:none; }
  .book-spread { display:block; padding-bottom:3.5rem; overflow:hidden auto; clip-path:none; scrollbar-width:none; }
  .book-page { padding:1.05rem 1.2rem; }
  .book-left { box-shadow:inset 0 -10px 12px -12px #715f3e; overflow:visible; }
  .book-right { box-shadow:inset 0 10px 14px -15px #715f3e; }
  .book-cover { left:0; }
  .book-turns { inset:auto 0 0; padding:.3rem 1.2rem; border-radius:0 0 .38rem .38rem; background:#f8efdd; border-top:1px solid #cbbf9e70; }
  :is(#book-notes,.book-notes) { overflow:visible; }
  :is(#book-film,.book-film) { max-height:34dvh; }
}
@media(prefers-reduced-motion:reduce) {
  .book-binding,.book-spread,.book-cover { transition:none; }
}
/* Each band carries both printed faces. Their edges meet along the curved sheet. */
.leaf-stage {
  position:absolute; inset:0; z-index:3; pointer-events:none;
  perspective:2200px; perspective-origin:50% 50%;
}
.leaf-band { position:absolute; top:0; height:100%; left:0; transform-origin:0 50%; transform-style:preserve-3d; }
.leaf-face { position:absolute; inset:0; overflow:hidden; background:#fbf4e4; backface-visibility:hidden; }
.leaf-back { transform:rotateY(180deg); }
.leaf-face::after { content:""; position:absolute; inset:0; background:#6e5a39; opacity:var(--shade,0); }
.leaf-print { position:absolute; top:0; overflow:hidden; pointer-events:none; }
.leaf-stationary { position:absolute; top:0; overflow:hidden; pointer-events:none; }
.leaf-shadow { position:absolute; inset-block:0; width:50%; pointer-events:none; }
#book .leaf-print .book-spread { clip-path:none; box-shadow:none; }
@media(max-width:680px) { .leaf-stage { overflow:clip; border-radius:.38rem; } }
.book-page figure.phone-demo {
  flex:1; min-height:0; display:flex; flex-direction:column;
  align-items:center; gap:.5rem; margin:0; text-align:center;
}
.phone-demo :is(#book-film,.book-film) {
  flex:1 1 0; min-height:0; width:100%; height:0; max-height:none;
  aspect-ratio:auto; border:0; border-radius:0; background:transparent;
  object-fit:contain;
  -webkit-mask:var(--phone-mask) center / contain no-repeat;
  mask:var(--phone-mask) center / contain no-repeat;
}
.phone-demo figcaption { margin:0; font-variant-numeric:tabular-nums; }
.phone-controls,.phone-controls > div { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:.2rem; }
.phone-controls[hidden] { display:none; }
.phone-controls button { padding:.25em .5em; font-size:.77rem; line-height:1.5; border-radius:.55em; }
.phone-controls button[aria-pressed=true] { background:#9a713221; color:#71471a; }
.phone-controls button:first-child:only-of-type { border:1px solid #98754055; }
#book.is-closing .book-close { opacity:0; pointer-events:none; }
#book.is-closing .book-binding { animation:book-depart .25s ease-in .94s both; }
#book.is-closing::backdrop { animation:book-backdrop-out .25s ease-in .94s both; }
@keyframes book-depart { from{opacity:1} to{opacity:0} }
@keyframes book-backdrop-out { from{opacity:1} to{opacity:0} }
@media(max-width:680px) {
  .phone-demo :is(#book-film,.book-film) { flex:none; height:min(53dvh,30rem); }
}
@media(prefers-reduced-motion:reduce) {
  #book.is-closing .book-binding,#book.is-closing::backdrop { animation:none; }
}
.book-screen { display:contents; }
.book-page figure.mixed-demo {
  flex:1; min-height:0; display:flex; flex-direction:column;
  align-items:center; gap:.55rem; margin:0; text-align:center;
}
.mixed-demo .book-screen {
  display:grid; place-items:center; width:100%; flex:1; min-height:0; container-type:size;
}
.mixed-demo :is(#book-film,.book-film) {
  width:min(100cqw,calc(100cqh * var(--clip-ratio))); height:auto;
  max-height:100cqh; aspect-ratio:var(--clip-ratio); object-fit:contain;
}
.mixed-demo figcaption { margin:0; }
@media(max-width:680px) {
  .mixed-demo .book-screen { flex:none; height:min(49dvh,26rem); }
  .mixed-demo.wide-clip .book-screen { height:auto; aspect-ratio:var(--clip-ratio); }
}
