/* A jewel case and its track index share the available glass. */
body[data-page="projects"] #content { overflow: hidden; gap: .35cqw; }
.disc-browser {
  flex: 1; min-height: 0; min-width: 0; container-type: size;
  display: grid; grid-template-columns: 44% minmax(0,1fr); grid-template-rows: minmax(0,1fr) auto;
  grid-template-areas: "case index" "info index"; column-gap: 6%; padding-bottom: .3cqw;
}
.disc-stage { text-decoration:none; grid-area: case; min-height: 0; display: grid; place-items: center; container-type: size; perspective: 800px; }
.disc-cycle { display:none; }
.jewel-case {
  position: relative; width: min(89cqw, 92cqh); aspect-ratio: 1.06; transform-style: preserve-3d;
  transform: rotateY(-13deg) rotateZ(-4deg);
}
.disc-stage.browsing .jewel-case { animation: rack-case .22s ease-out; }
@keyframes rack-case { from { opacity: .72; transform: rotateY(-34deg) rotateZ(-6deg); } }
.disc-tray, .disc-lid { position: absolute; inset: 0; border: 1px solid; border-color: #bec5ad #364031 #313d2e #adb5a4; }
.disc-tray {
  background: repeating-linear-gradient(90deg,#17231d 0 2px,#26332a 2px 3px);
  box-shadow: 2px 2px #465346, 4px 4px #0a130f, 5px 7px 7px #02070499; display:grid; place-items:center;
}
.disc-tray i { width: 83%; aspect-ratio:1; border-radius:50%; background: conic-gradient(#a9b3a2,#586760,#c1c5b0,#64786e,#b7b8a7,#a9b3a2); border: 1px solid #d7dbc9; display:grid; place-items:center; }
.disc-tray i::after { content:""; width:18%; aspect-ratio:1; border-radius:50%; background:#1c2b22; outline:2px solid #848f7d; }
.disc-lid { background:#313b32; transform-origin: left center; display:flex; padding:1.5%; backface-visibility:visible; }
.disc-spine { width:7%; background: repeating-linear-gradient(90deg,#0b130f 0 1px,#465143 1px 2px,#2a342c 2px 3px); border-right:1px solid #87907f; }
.disc-insert { flex:1; min-width:0; container-type:size; position:relative; overflow:hidden; isolation:isolate; color:var(--ink); background:var(--paper); border:1px solid #101812; }
.disc-insert::before { content:""; position:absolute; inset:0; background:var(--accent); mask:var(--motif) center / cover; opacity:.42; z-index:-1; }
.disc-insert::after { content:""; position:absolute; inset:0; background:linear-gradient(119deg,transparent 36%,#ffffff14 36.5%,#ffffff04 62%,transparent 62.5%); pointer-events:none; }
.disc-imprint, .disc-print { position:absolute; left:5%; right:5%; display:flex; align-items:center; justify-content:space-between; font: 4.8cqw/1 MenuText,monospace; }
.disc-imprint { top:5%; border-bottom:1px solid currentColor; padding-bottom:3%; letter-spacing:.12em; }
.disc-imprint b { background:var(--ink); color:var(--paper); padding:.16em .32em; }
.disc-mark { position:absolute; inset:24% 9% 26%; display:grid; grid-template: minmax(0,1fr) auto / minmax(0,1fr); justify-items:center; }
.disc-mark img { display:block; width:100%; height:100%; min-height:0; object-fit:contain; }
.disc-mark b, .track-thumb b { font: 5cqw/1 MenuText,monospace; letter-spacing:.25em; }
.disc-print { bottom:5%; gap:5%; align-items:flex-end; line-height:1.15; }
.disc-print b { flex:none; font:9cqw/1 MenuDisplay,monospace; }
.disc-info { grid-area:info; text-align:center; min-width:0; align-self:center; }
:is(.disc-title, .disc-title-measure) { display:block; color:#d7e3c6; font: 3.5cqw/1.02 MenuDisplay,monospace; }
:is(.disc-caption, .disc-caption-measure) { color:#a7b79d; font:1.9cqw/1.22 MenuText,monospace; margin:.25em 0; }
.disc-titles, .disc-captions { display:grid; min-width:0; }
.disc-titles > *, .disc-captions > * { grid-area:1 / 1; }
.disc-title-measure, .disc-caption-measure { visibility:hidden; pointer-events:none; }
.disc-open { font-size:2.15cqw; }
.disc-index { grid-area:index; display:flex; flex-direction:column; min-height:0; min-width:0; }
.disc-index-head { display:flex; justify-content:space-between; border-bottom:1px solid #617459; padding:.3em 0 .55em; color:#97ae8e; font:1.65cqw/1 MenuText,monospace; letter-spacing:.07em; }
.disc-counter { color:#d9e6bf; }
.disc-tracks { flex:1; min-height:0; min-width:0; position:relative; display:grid; grid-template-rows:repeat(11,minmax(0,1fr)); }
body[data-page="projects"] .disc-track {
  display:flex; align-items:center; min-height:0; min-width:0; text-align:left; padding:0 2%;
  gap:3%; border-bottom:1px solid #53654b33; text-transform:none; letter-spacing:0;
  font: min(2.8cqw, 6.7cqh)/1 MenuDisplay,monospace;
}
.disc-track::after { display:none; }
.disc-track::before { content:""; width:.43em; height:.65em; flex:none; background:currentColor; clip-path:polygon(0 0,30% 0,30% 15%,60% 15%,60% 30%,100% 50%,60% 70%,60% 85%,30% 85%,30% 100%,0 100%); opacity:0; }
.disc-track.active::before { opacity:1; }
body[data-page="projects"] .disc-track.active { background:#9ab87c20; color:#e4edc8; }
.track-number { font:1.6cqw/1 MenuText,monospace; color:#96a98d; }
.track-thumb { display:none; }
.track-name { min-width:0; }
@media (max-width:700px), (max-height:500px) {
  body.zoomed[data-page="projects"] #content { overflow:hidden; }
  body.zoomed .disc-browser { grid-template: minmax(0,1fr) auto auto / minmax(0,1fr); grid-template-areas:"case" "index" "info"; gap:1.5%; }
  body.zoomed .disc-stage { touch-action:pan-y; }
  body.zoomed .disc-stage .jewel-case { width:min(calc(100cqw - 80px),92cqh); }
  body.zoomed .disc-cycle { grid-area:case; align-self:center; justify-self:start; z-index:1; width:44px; height:44px; display:grid; place-items:center; padding:0; background:none; border:0; color:#a5b397; font-size:24px; }
  body.zoomed .disc-cycle[data-disc-cycle="1"] { justify-self:end; }
  body.zoomed .disc-cycle[data-disc-cycle="-1"] span { transform:rotate(180deg); }
  body.zoomed .disc-cycle.game-selected { color:#e4ebbc; }
  body.zoomed .disc-index-head { border:0; padding:0 2% .3em; font-size:min(11px,5.5cqh); }
  body.zoomed .disc-tracks { --thumb:18.4%; display:flex; flex:none; align-items:center; gap:2%; padding-block:2px; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; scroll-snap-type:x mandatory; overscroll-behavior-x:contain; }
  body.zoomed .disc-tracks::-webkit-scrollbar { display:none; }
  body.zoomed .disc-tracks::before, body.zoomed .disc-tracks::after { content:""; flex:0 0 calc(48% - var(--thumb) / 2); }
  body.zoomed[data-page="projects"] .disc-track { display:grid; grid-template:minmax(0,1fr) / minmax(0,1fr); flex:0 0 var(--thumb); min-height:44px; aspect-ratio:1.28; padding:2px; background:#253029; border:1px solid #64715f; scroll-snap-align:center; }
  body.zoomed[data-page="projects"] .disc-track.active { border-color:#d5e5aa; background:#a8b997; }
  body.zoomed .disc-track::before, body.zoomed .track-number { display:none; }
  body.zoomed .track-thumb { align-self:stretch; container-type:size; min-width:0; min-height:0; display:grid; grid-template:minmax(0,1fr) auto / minmax(0,1fr); justify-items:center; padding:5%; background:var(--paper); color:var(--ink); border-left:3px solid #16241b; }
  body.zoomed .track-thumb img { min-width:0; min-height:0; width:100%; height:100%; object-fit:contain; }
  body.zoomed .track-thumb b { font-size:min(16cqw,22cqh); }
  body.zoomed .track-name { position:absolute; width:1px; height:1px; clip-path:inset(50%); overflow:hidden; }
  body.zoomed .disc-open { font-size:18px; min-height:44px; padding:.25em .65em; }
  body.zoomed .disc-open::before { opacity:1; }
  body.zoomed :is(.disc-title, .disc-title-measure) { font-size:min(22px,12cqh); }
  body.zoomed :is(.disc-caption, .disc-caption-measure) { font-size:min(15px,8cqh); }
}
@media (prefers-reduced-motion: reduce) { .disc-stage.browsing .jewel-case { animation:none; } }
.project-kind { color: #869b80; font: .5cqw/1.2 MenuText, monospace; letter-spacing: .08em; margin-bottom: .35cqw; }
.dossier-name { font: 1.25cqw/1.05 MenuDisplay, monospace; color: #d2ddbf; margin-bottom: .4cqw; }
.dossier-context { font: .62cqw/1.3 MenuText, monospace; color: #aabb9e; margin: 0 0 .45cqw; }
.project-links { display: flex; flex-wrap: wrap; gap: .3cqw .7cqw; margin-top: .65cqw; font: .6cqw/1.3 MenuText, monospace; color: #94ab94; }
.project-links a { color: #bdcfa6; text-decoration: underline; text-underline-offset: .2em; }
.project-links a.game-selected { color: #ecf4ce; background: #364b31; }
.project-preview { width: 100%; margin: 0; }
.project-preview img { width: 100%; aspect-ratio: 4/3; object-fit: contain; display: block; border: 1px solid #74816a; background: #101c15; }
.project-preview figcaption { font: .5cqw/1.3 MenuText, monospace; color: #8c9f84; margin-top: .3cqw; }
/* Give the courier description room beside the film, including its longer English lines. */
body[data-page="courier"] .film-dossier { column-gap: 2%; }
body.project-page .preview-dossier { grid-template-columns: 44% 1fr; gap: 4%; }
.preview-dossier .dossier-picture { align-self: center; container-type: normal; }
.preview-dossier .dossier-story ol { font-size: .67cqw; line-height: 1.3; }
.preview-dossier .dossier-title { font-size: .95cqw; margin-bottom: .45cqw; }
.about-profile { flex: 1; min-height: 0; display: grid; grid-template-columns: 26% 1fr; grid-template-rows: minmax(0,1fr); align-items: center; gap: 4%; padding-bottom: .6cqw; }
.profile-identity { text-align: center; }
.profile-portrait { position: relative; overflow: hidden; display: grid; place-items: center; aspect-ratio: 4/5; max-height: 10.5cqw; max-width: 100%; margin-inline: auto; background: repeating-linear-gradient(0deg,#17281f 0 3px,#1c2d23 3px 4px); border: 1px solid #6c7a61; box-shadow: inset 0 0 0 .25cqw #122017; color: #819576; }
.profile-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-identity h2 { font: 1.15cqw/1.2 MenuDisplay, monospace; color: #c8d5b5; margin-top: .6cqw; }
.profile-story { max-height: 100%; min-height: 0; overflow-y: auto; padding-inline-end: .45cqw; scrollbar-width: thin; scrollbar-color: #74846a #17271f; }
.profile-story:focus-visible { outline: 1px solid #94ab87; outline-offset: 1px; }
.profile-story .profile-intro { color: #d2ddbf; }
.profile-story p + p { margin-top: .5cqw; }
.profile-story p { font: .8cqw/1.3 MenuText, monospace; color: #b4c2a9; }
/* Make room for business context alongside the unchanged film and transport. */
@media (min-width: 701px) and (min-height: 501px) {
  .film-dossier .dossier-logo { height: 1.3cqw; margin-bottom: .3cqw; }
  .film-dossier .dossier-title { margin-bottom: .4cqw; }
  .film-dossier .dossier-story ol { line-height: 1.25; }
  .film-dossier .dossier-story li + li { margin-top: .55em; }
}
body:not(.zoomed) .film-dossier .dossier-logo { height: 1.3cqw; margin-bottom: .3cqw; }
body:not(.zoomed) .film-dossier .dossier-title { margin-bottom: .4cqw; }
body:not(.zoomed) .film-dossier .dossier-story ol { line-height: 1.25; }
body:not(.zoomed) .film-dossier .dossier-story li + li { margin-top: .55em; }
@media (max-width: 700px), (max-height: 500px) {
  body.zoomed .project-kind { font-size: 10px; margin-bottom: 6px; }
  body.zoomed .dossier-name { font-size: 26px; margin-bottom: 8px; }
  body.zoomed .dossier-context { font-size: 14px; margin-bottom: 10px; }
  body.zoomed .project-links { font-size: 14px; gap: 10px 18px; margin-top: 14px; }
  body.zoomed .project-links a { padding-block: 7px; }
  body.zoomed .project-preview figcaption { font-size: 11px; margin-top: 6px; }
  body.zoomed .preview-dossier .dossier-story ol { font-size: 16px; }
  body.zoomed .preview-dossier .dossier-title { font-size: 22px; }
  body.zoomed .about-profile { flex: none; grid-template-columns: 1fr; grid-template-rows: auto; gap: 20px; padding: 12px 0; }
  body.zoomed .profile-portrait { width: 144px; max-height: none; margin: auto; }
  body.zoomed .profile-identity h2 { font-size: 25px; margin-top: 10px; }
  body.zoomed .profile-story p + p { margin-top: 12px; }
  body.zoomed .profile-story p { font-size: 16px; }
  body.zoomed .profile-story { overflow: visible; max-height: none; padding-inline-end: 0; }
}
@media (max-height: 500px) and (min-width: 701px) {
  body.zoomed .about-profile { grid-template-columns: 27% 1fr; }
}

/* New case studies retain their business context beside the film. The slightly
   wider text column keeps this readable without shrinking the body copy. */
body.project-page .portfolio-film { grid-template-columns: 48% 1fr; }
.portfolio-film .dossier-name { font-size: 1.1cqw; margin-bottom: .3cqw; }
@media (max-width: 700px), (max-height: 500px) {
  body.zoomed.project-page .portfolio-film { grid-template-columns: 1fr; }
  body.zoomed .portfolio-film .dossier-name { font-size: 24px; margin-bottom: 8px; }
}
@media (max-height: 500px) and (min-width: 701px) {
  body.zoomed.project-page .portfolio-film { grid-template-columns: 48% 1fr; }
}

@media (orientation: landscape) and (max-width:700px), (orientation: landscape) and (max-height:500px) {
  body.zoomed .disc-browser { grid-template: minmax(0,1fr) auto / 36% minmax(0,1fr); grid-template-areas:"case info" "case index"; column-gap:5%; }
  body.zoomed .disc-index-head { font-size:min(2cqw,7cqh); }
  body.zoomed :is(.disc-title, .disc-title-measure) { font-size:min(4.5cqw,14cqh); }
  body.zoomed :is(.disc-caption, .disc-caption-measure) { font-size:min(2.6cqw,7.5cqh); }
  body.zoomed .disc-open { font-size:16px; }
}

/* On short phones, keep the action beside the description so it cannot cover the strip. */
@media (orientation: landscape) and (max-height: 400px) {
  body.zoomed[data-page="projects"] #content { padding-block:0; }
  body.zoomed .disc-info { display:grid; grid-template:"title open" auto "caption open" auto / minmax(0,1fr) auto; align-items:center; column-gap:6px; text-align:left; }
  body.zoomed .disc-titles { grid-area:title; align-self:end; }
  body.zoomed :is(.disc-title, .disc-title-measure) { font-size:16px; }
  body.zoomed .disc-captions { grid-area:caption; align-self:start; }
  body.zoomed :is(.disc-caption, .disc-caption-measure) { font-size:12px; }
  body.zoomed .disc-open { grid-area:open; }
  body.zoomed .disc-index-head { font-size:10px; }
}

@media (orientation: landscape) and (max-height: 500px) {
  body.zoomed .about-profile { grid-template: auto / minmax(72px, 22%) 1fr; align-items: start; gap: 12px; padding: 0; }
  body.zoomed .profile-portrait { width: min(100%, 24svh); }
  body.zoomed .profile-identity h2 { font-size: 17px; margin-top: 3px; }
  /* Size the deck against the actual remaining pane, after header and footer. */
  body.zoomed.project-page #content { padding-block: 0; gap: 0; overflow: hidden; }
  body.zoomed.project-page .project-dossier {
    flex: 1; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 56fr) minmax(0, 44fr);
    align-items: stretch; gap: 0 12px; min-height: 0;
  }
  body.zoomed.project-page .dossier-picture { container-type: size; align-self: stretch; }
  body.zoomed.project-page .dossier-story { min-height: 0; overflow-y: auto; padding-inline-end: 6px; }
  body.zoomed.project-page .dossier-picture .media-deck {
    --frame-width: min(calc(100cqw - 110px), calc((100cqh - 31px) * 4 / 3));
    display: grid; grid-template-columns: var(--frame-width) 100px;
    width: fit-content; align-items: center; max-width: 100%;
  }
  body.zoomed.project-page .deck-title { grid-column: 1 / -1; height: 22px; }
  body.zoomed.project-page .deck-panel { padding: 0 2px; }
  body.zoomed.project-page .deck-transport { display: grid; justify-content: center; gap: 3px; }
  body.zoomed.project-page .deck-keys { gap: 0; }
  body.zoomed.project-page .deck-key { min-width: 32px; width: 32px; height: 36px; }
  body.zoomed.project-page .deck-clock { margin: auto; }
  body.zoomed.project-page .dossier-title { font-size: 18px; }
  body.zoomed.project-page .dossier-story ol { font-size: 14px; }
}
