/* The two project chapters share the site's reading grid. Each keeps its own art and tools. */
.project-chapters.works { display:block; background:#f5f4f1; }
.chapter-frame { max-width:var(--frame); margin-inline:auto; padding:clamp(56px,6.6vw,104px) var(--pad) clamp(80px,8vw,136px); }
.project-chapters #worksTitle { margin:0 0 clamp(24px,3vw,43px); }
.project-spread { --spread-pad:clamp(26px,3.45vw,54px); --action-fg:#fff; isolation:isolate; overflow:hidden; border-radius:clamp(19px,2.4vw,34px); color:var(--spread-ink); background:var(--spread-bg); }
.project-spread + .project-spread { margin-top:clamp(28px,4.5vw,72px); }
.game-spread { --spread-bg:#241e25; --spread-ink:#fff4ec; --spread-dim:#dccbc8; --line:#55434c; --accent:#f4c2af; --action-fg:#2b2025; --lab-bg:#2d252d; --tab-bg:#453940; --stage-bg:#231f26; }
.bead-spread { --spread-bg:#e9eee4; --spread-ink:#1e3026; --spread-dim:#405547; --line:#bfccbd; --accent:#304d3c; --lab-bg:#f3f5ee; --tab-bg:#dce5d9; --stage-bg:#e5e9dd; }
.spread-hero { display:grid; grid-template-columns:minmax(0,.82fr) minmax(0,1.18fr); }
.spread-intro { padding:clamp(32px,5vw,76px) var(--spread-pad); display:flex; flex-direction:column; justify-content:center; align-items:flex-start; }
.project-spread h3 { font-size:clamp(38px,4.0vw,65px); line-height:1.15; letter-spacing:-.05em; font-weight:680; margin:.28em 0 .35em; }
.spread-lead { max-width:19em; color:var(--spread-dim); font-size:clamp(18px,1.45vw,23px); line-height:1.55; text-wrap:pretty; }
.spread-action { display:inline-flex; align-items:center; justify-content:center; gap:.8em; min-height:46px; background:var(--accent); color:var(--action-fg); padding:10px 21px; margin-top:clamp(19px,2vw,31px); border-radius:999px; font-size:17px; line-height:1.25; font-weight:650; text-decoration:none; }
.project-spread :is(a,button):focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.spread-visual { min-width:0; display:block; position:relative; overflow:hidden; }
.spread-visual img { display:block; width:100%; height:100%; object-fit:cover; aspect-ratio:1260/860; }
.project-gallery { min-width:0; background:var(--lab-bg); }
.project-plates { position:relative; aspect-ratio:1260/860; overflow:hidden; }
.project-plates figure { position:absolute; inset:0; margin:0; }
.project-plates [hidden] { display:none; }
.project-plates .spread-visual, .project-plates .spread-visual img { display:block; width:100%; height:100%; }
.project-plates .spread-visual img { object-fit:cover; }
.project-plates .gallery-detail { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:clamp(8px,1.4vw,20px); padding:14px; }
.project-plates .gallery-detail[hidden] { display:none; }
.gallery-detail img { max-height:75%; max-width:80%; height:auto; width:auto; object-fit:contain; }
.gallery-detail .mini-map { width:52%; }
.gallery-detail .mini-dusk { width:76%; image-rendering:pixelated; border-radius:5px; }
.gallery-detail figcaption { color:var(--spread-ink); font-size:clamp(17px,1.55vw,23px); font-weight:600; }
.gallery-choices { display:flex; align-items:center; justify-content:center; gap:clamp(8px,1.6vw,26px); min-height:54px; padding:4px 12px; }
.gallery-choices button { flex:0 1 auto; min-width:52px; min-height:44px; padding:6px 10px; color:var(--spread-dim); font-size:16px; line-height:1.25; border-radius:4px; }
.gallery-choices button[aria-pressed=true] { text-decoration:underline; text-underline-offset:7px; text-decoration-thickness:2px; font-weight:650; color:var(--spread-ink); }
@media(max-width:700px) {
  .chapter-frame { padding-inline:clamp(12px,4.8vw,27px); }
  .project-chapters #worksTitle { padding-inline:3px; }
  .spread-hero { grid-template-columns:minmax(0,1fr); }
  .spread-intro { padding:26px var(--spread-pad); }
  .project-plates { aspect-ratio:16/9; }
  .gallery-choices { min-height:48px; padding:2px 8px; gap:10px; }
}
@media(max-width:370px) {
  .project-spread { --spread-pad:20px; }
}
@media(prefers-reduced-motion:no-preference) {
  .project-plates figure[data-enter] { animation:project-sample-in .25s ease-out both; }
  @keyframes project-sample-in { from { opacity:.4; transform:translateY(3px); } to { opacity:1; transform:none; } }
  .spread-action .chev { transition:translate .22s ease; }
}
@media(hover:hover) and (prefers-reduced-motion:no-preference) {
  .spread-action:hover .chev { translate:3px 0; }
}


/* In the two long case studies the chapter index and close button stay in reach. */
#panel:has(.case-reader) { width:1120px; max-width:calc(100vw - 52px); max-height:calc(100svh - 46px); background:#faf9f7; }
#panelBody:has(.case-reader) { padding:0; scrollbar-gutter:stable; }
.case-reader { --reader-pad:clamp(23px,4.5vw,68px); --index-height:59px; position:relative; }
.reader-index { display:flex; position:sticky; top:0; z-index:4; height:var(--index-height); align-items:center; padding-inline:var(--reader-pad) 68px; border-bottom:1px solid #d9d7d0; background:#faf9f7f7; }
.reader-index-inner { display:flex; align-items:center; gap:clamp(6px,1.8vw,25px); max-width:100%; overflow:auto; scrollbar-width:none; }
.reader-index-inner::-webkit-scrollbar { display:none; }
.reader-index button { white-space:nowrap; position:relative; font-size:16px; font-weight:560; padding:0 3px; min-height:44px; color:#5e5a58; flex:none; }
.reader-index button[aria-current=location] { color:#171719; }
.reader-index button[aria-current=location]::after { content:""; height:2px; border-radius:2px; background:currentColor; left:3px; right:3px; position:absolute; bottom:3px; }
.reader-index button:focus-visible { outline-offset:-3px; }
.reader-content { padding:clamp(26px,3.3vw,50px) var(--reader-pad) clamp(42px,5vw,72px); }
#panel:has(.case-reader) .dismiss { z-index:5; right:14px; top:7px; }
@media(max-width:700px) {
  #panel:has(.case-reader) { width:100%; max-width:100%; height:100svh; max-height:100svh; margin:0; border-radius:0; }
  #panelBody:has(.case-reader) { height:100%; scrollbar-gutter:auto; }
  .case-reader { --reader-pad:clamp(15px,4.5vw,25px); --index-height:56px; }
  .reader-index { padding-right:57px; }
  .reader-index-inner { gap:12px; }
  .reader-index button { font-size:15px; }
  #panel:has(.case-reader) .dismiss { right:7px; top:6px; }
}

/* Key poses from the released game. */
.case-reader { display:block; }
pose-study { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); background:#ede9e5; color:#312a2e; border-radius:19px; overflow:hidden; }
.pose-view { display:grid; place-items:center; position:relative; background-color:#443640; background-image:linear-gradient(#ffffff0b 1px,transparent 1px),linear-gradient(90deg,#ffffff0b 1px,transparent 1px); background-size:36px 36px; }
.pose-view::before { content:""; position:absolute; top:calc(50% + min(30vw,96px)); height:1px; left:12%; right:12%; background:#d4b7a771; }
.pose-figure { width:100%; max-width:232px; aspect-ratio:1; background-image:url("assets/chapters/kick-keys.webp"); background-size:400% 100%; background-position:calc(var(--pose) * 100% / 3) 50%; z-index:1; }
.pose-tools { padding:clamp(22px,3vw,43px); align-self:center; }
.pose-steps { display:flex; flex-wrap:wrap; gap:4px; }
.pose-steps button,.pose-play { min-height:44px; border-radius:8px; padding:4px 9px; color:#3f353b; }
.pose-steps button[aria-pressed=true] { background:#44353e; color:#fff; }
.pose-play { text-decoration:underline; text-underline-offset:4px; font-weight:650; padding-inline:0; }
@media(max-width:640px) {
  pose-study { grid-template-columns:1fr; }
  .pose-figure { max-width:180px; }
  .pose-view::before { top:calc(50% + 74px); }
  .pose-tools { padding:18px; }
}


#panel .gd-cover { min-height:0; display:grid; grid-template-columns:1fr 1fr; align-items:center; background:#15151c; }
#panel .gd-cover::before { display:none; }
#panel .gd-cover>img { position:static; grid-column:2; grid-row:1; height:100%; object-fit:contain; z-index:auto; background:#0c1017; }
#panel .gd-cover-caption { grid-column:1; grid-row:1; padding:clamp(22px,3vw,44px); text-shadow:none; }
#panel .gd-cover h2 { font-size:clamp(36px,4.3vw,62px); }
@media(max-width:640px) {
  #panel .gd-cover { grid-template-columns:1fr; }
  #panel .gd-cover-caption { grid-row:1; grid-column:1; }
  #panel .gd-cover>img { grid-row:2; grid-column:1; width:100%; max-height:226px; }
}
@media(max-width:370px) {
  .reader-index-inner { gap:8px; }
  .reader-index button { font-size:14px; }
}
@media(prefers-reduced-motion:no-preference) {
  .chapter-arriving .spread-intro { animation:chapter-copy-in .48s cubic-bezier(.24,.76,.18,1) backwards; }
  .chapter-arriving .spread-visual img { animation:chapter-plate-in .62s cubic-bezier(.21,.7,.24,1) backwards; }
  @keyframes chapter-copy-in { from { opacity:.6; transform:translateY(12px); } }
  @keyframes chapter-plate-in { from { transform:scale(1.026); } }
}

.bead-project-file { display:inline-flex; min-height:44px; align-items:center; text-underline-offset:5px; text-decoration:underline; color:#485446; font-weight:580; }

.gd-story .gd-section > h3 { margin-bottom: clamp(14px, 2vw, 22px); }
.gd-story .gd-picker button { min-height: 44px; font-size: clamp(16px, 1.55vw, 18px); }
.gd-story .gd-board-head { justify-content: center; }
.gd-story .gd-board-head > span,
.gd-story .gd-legend,
.gd-story .gd-session button,
.gd-story .gd-choices button,
.gd-story .gd-character [data-again] { font-size: 15px; }
.gd-story .gd-feedback { min-height: 1.45em; margin: 0; }
.gd-story .pose-play { margin-top: 12px; }
.gd-story .gd-character h4 { margin-bottom: 14px; }

.bd-case .bd-intro h2 { margin-block:0 6px; }
.bd-case .bd-lead { font-size:clamp(20px,2.6vw,28px); color:var(--bd-muted); }
.bd-case .bd-cover figcaption { font-size:clamp(18px,2.5vw,26px); }
.bd-case .bd-board-sum { color:var(--bd-ink); font-size:clamp(18px,2vw,24px); font-weight:650; margin:0 0 13px; }
.bd-case .bd-inventory button { font-size:16px; min-height:44px; }
.bd-case .bd-inventory b { font-size:16px; }
.bd-case .bd-readouts { font-size:15px; margin:8px 0 14px; flex-wrap:wrap; }
.bd-case .bd-hint { display:none; }
.bd-lab:has(.bd-editor:focus-visible) .bd-hint { display:block; font-size:15px; }
.bd-case .bd-live,.bd-case .bd-export-note:not(:empty) { font-size:15px; }
.bd-case .bd-specs { margin-top:12px; }
.bd-case .bd-specs summary { cursor:pointer; min-height:44px; padding:10px 0; font-size:17px; }
.bd-specs summary:focus-visible { outline:3px solid #347951; outline-offset:3px; border-radius:4px; }
.bd-specs ul { padding-left:1.35em; margin:6px 0 8px; font-size:16px; line-height:1.65; }
.bd-specs li + li { margin-top:4px; }
.bd-native-files .bead-project-file { font-size:18px; }
.bd-case .bd-native-layout figcaption { font-size:15px; }
@media (max-width:510px) {
  .bd-case .bd-inventory {grid-template-columns:repeat(2,minmax(0,1fr));}
  .bd-case .bd-board-list button { font-size:15px; min-height:44px; }
  .bd-case .bd-viewbar button { font-size:15px; min-height:44px; }
  .bd-case .bd-exports { align-items:flex-start; gap:7px 12px; }
}
