/* =========================================================
   Work — the exhibition.
   Each project is a magazine spread on a 12-column grid: the text
   page takes columns 1–4, the plates 5–12, split by a hairline fold.
   On wide screens the spreads pin under the masthead and slide past
   sideways, dwelling on each room. Narrow screens and reduced motion
   stack them.
   ========================================================= */

.page-work { --mast-h: 55px; --foot-h: 64px; --col-gap: clamp(12px, 1.6vw, 24px); --rule2: #EEE7DA14; background: var(--room); }
.page-work .grid12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); padding-inline: var(--gutter); }
.page-work .display { font-family: var(--f-display); font-weight: 500; letter-spacing: -.02em; line-height: .96; margin: 0; }
.page-work .display em { font-style: italic; font-weight: 400; color: var(--accent); }

/* ---------- Opening: contents spread ---------- */
.wk-open { min-height: calc(100vh - var(--mast-h)); min-height: calc(100svh - var(--mast-h)); display: grid; grid-template-rows: 1fr var(--foot-h); }
.wk-open__body { align-content: center; row-gap: 28px; padding-block: 40px; }
.wk-open__kicker { grid-column: 1 / span 4; color: var(--muted); border-top: 2px solid var(--fg); padding-top: 10px; }
.wk-open__title { grid-column: 1 / span 7; grid-row: 2; font-size: clamp(3.6rem, 1.4rem + 8vw, 11rem); }
.wk-open__deck { grid-column: 1 / span 4; grid-row: 3; margin: 0; color: #CFC6B8; font-size: 1.15rem; line-height: 1.5; }
.wk-contents { grid-column: 8 / -1; grid-row: 2 / span 2; align-self: end; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--fg); }
.wk-contents a { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.wk-contents .rn { font-family: var(--f-display); font-size: 1.5rem; color: var(--accent); line-height: 1; }
.wk-contents strong { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.3rem, 1rem + 1vw, 1.9rem); line-height: 1.05; transition: color .2s; }
.wk-contents a:hover strong { color: var(--accent); }
.wk-contents .pc { color: var(--muted); }
.wk-open__foot { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding-inline: var(--gutter); border-top: 1px solid var(--rule); color: var(--muted); }

/* ---------- The exhibition: pinned spreads ---------- */
.wk-track { position: relative; }
.wk-pin { position: sticky; top: var(--mast-h); height: calc(100vh - var(--mast-h)); height: calc(100svh - var(--mast-h)); overflow: hidden; display: grid; grid-template-rows: 1fr var(--foot-h); border-top: 1px solid var(--rule); }
.wk-view { position: relative; overflow: hidden; }
.wk-rooms { display: flex; width: 100%; height: 100%; will-change: transform; }
.spread { flex: 0 0 100%; width: 100%; height: 100%; grid-template-rows: minmax(0, 1fr); overflow: clip; align-items: stretch; padding-block: clamp(20px, 3.4vh, 40px); position: relative; }
.spread__lamp { position: absolute; left: 38%; right: 0; top: -20%; height: 100%; pointer-events: none; opacity: var(--lit, 0);
  background: radial-gradient(45% 60% at 55% 45%, #F5C46B22, transparent 70%); transition: opacity .5s; }

/* Text page: cols 1–4 */
.wk-page { grid-column: 1 / span 4; display: flex; flex-direction: column; gap: 16px; min-width: 0; padding-right: var(--col-gap); position: relative; z-index: 1; }
.wk-page__num { display: flex; align-items: baseline; gap: 14px; }
.wk-page__num .rn { font-family: var(--f-display); font-size: clamp(3rem, 2rem + 3vw, 5rem); line-height: .8; color: var(--accent); }
.wk-page__num .mono { color: var(--muted); }
.wk-page__logo.wk-page__logo--wordmark { width: auto; height: clamp(20px, 1.8vw, 26px); }
.wk-page__logo { display: block; flex: none; align-self: flex-start; width: clamp(48px, 4.4vw, 64px); height: auto; }
.wk-page h2 { font-size: clamp(2.2rem, 1.2rem + 2.6vw, 3.8rem); text-wrap: balance; }
.wk-page__stand { margin: 0; font-size: clamp(1rem, .9rem + .3vw, 1.18rem); line-height: 1.5; color: #CFC6B8; max-width: 34ch; }
.wk-page__stand a { color: var(--fg); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.wk-facts { margin: 0; margin-top: auto; border-top: 1px solid var(--rule); }
.wk-facts div { display: grid; grid-template-columns: 6.4rem minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule2); }
.wk-facts dt { font-family: var(--f-mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.wk-facts dd { margin: 0; font-size: .92rem; }
.wk-works { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.wk-works li { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; gap: 8px; font-size: .88rem; align-items: baseline; }
.wk-works .fig { font-family: var(--f-mono); font-size: .66rem; color: var(--accent); }
.wk-works .ty { font-family: var(--f-mono); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* The fold: col 5 starts the plates, a hairline marks the gutter */
.plates { grid-column: 5 / -1; position: relative; min-width: 0; border-left: 1px solid var(--rule); padding-left: var(--col-gap); display: grid; column-gap: var(--col-gap); row-gap: 14px; align-items: end; z-index: 1; }
.plate { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; row-gap: 10px; min-height: 0; min-width: 0; height: 100%; transition: opacity .5s; }
.plate__frame { min-height: 0; display: flex; align-items: flex-end; justify-content: flex-start; }
.plate figcaption { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: baseline; border-top: 1px solid var(--rule); padding-top: 8px; font-size: .84rem; line-height: 1.35; }
.plate figcaption .fig { font-family: var(--f-mono); font-size: .64rem; color: var(--accent); letter-spacing: .06em; }
.plate figcaption .ty { grid-column: 2; font-family: var(--f-mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.plate.is-waiting .m > video { opacity: .42; transition: opacity .5s; }

/* Media: each piece keeps its own shape */
.m { position: relative; overflow: hidden; background: var(--bg2); flex: none; max-width: 100%; max-height: 100%; box-shadow: 0 0 0 1px #EEE7DA1f, 0 30px 50px -30px #000; aspect-ratio: var(--ar); width: 100%; }
.m img, .m video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.m video { background: #000; }
.m video { cursor: pointer; }
/* Play cue: every clip says it can be played; a playing one offers Pause on hover or focus. */
.vcue { position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 16px 10px 13px; border-radius: 999px; border: 1px solid #EEE7DA40; background: #110E14c7; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--fg); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; box-shadow: 0 12px 28px -12px #000;
  transition: opacity .25s, border-color .2s, transform .25s; }
.vcue i { width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent var(--accent); }
.vcue:hover, .vcue:focus-visible { border-color: var(--accent); transform: translate(-50%, -50%) scale(1.04); }
.vcue:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.plate.is-playing .vcue { opacity: 0; pointer-events: none; }
.plate.is-playing .vcue i { width: 10px; height: 12px; border: 0; border-left: 3px solid var(--accent); border-right: 3px solid var(--accent); box-sizing: border-box; }
.plate.is-playing .m:hover .vcue, .plate.is-playing .vcue:focus-visible { opacity: 1; pointer-events: auto; }
.plate.is-waiting:hover .m > video { opacity: .75; }
@media (hover: none) { .plate.is-playing .m:hover .vcue { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .vcue { transition: none; } }

/* One-at-a-time playback bar */
.plates.has-seq { padding-bottom: 46px; }
.seq { position: absolute; left: var(--col-gap); right: 0; bottom: 0; display: flex; gap: 8px; }
.seq__seg { all: unset; cursor: pointer; flex: 1 1 0; min-width: 0; display: grid; gap: 7px; }
.seq__seg:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.seq__track { display: block; height: 2px; background: var(--rule); overflow: hidden; }
.seq__track i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.seq__lab { display: flex; gap: 6px; align-items: baseline; font-family: var(--f-mono); font-size: .58rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; }
.seq__lab b { font-weight: 400; color: var(--accent); }
.seq__dur { margin-left: auto; padding-left: 8px; }
.seq__seg[aria-current="true"] .seq__lab { color: var(--fg); }

/* Layouts, chosen by the media */
.plates[data-layout="reel"] { grid-template-columns: minmax(0, 3.16fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.plates[data-layout="header"] { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr) minmax(0, 1.5fr); }
.plates[data-layout="header"] .plate:first-of-type { grid-column: 1 / -1; }
.plates[data-layout="header"] .plate:first-of-type .plate__frame { align-items: flex-start; }
.plates[data-layout="single"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.plates[data-layout="rows"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
.plates[data-layout="diptych"] { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); }
.plates[data-layout="study"] { grid-template-columns: repeat(2, minmax(0, 3fr)) minmax(0, 4fr); grid-template-rows: minmax(0, 1fr); }
.study-tag { position: absolute; top: 0; left: var(--col-gap); display: flex; gap: 8px; align-items: center; color: var(--muted); }
.study-tag i { width: 32px; height: 1px; background: var(--accent); }

/* Section tabs */
.wk-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: stretch; padding-inline: var(--gutter); border-top: 1px solid var(--rule); }
.wk-tabs button { all: unset; cursor: pointer; display: grid; align-content: center; gap: 2px; padding: 0 14px 0 0; position: relative; color: var(--muted); min-width: 0; }
.wk-tabs button::before { content: ""; position: absolute; left: 0; right: 14px; top: -1px; height: 2px; background: transparent; transition: background .3s; }
.wk-tabs button[aria-current="true"] { color: var(--fg); }
.wk-tabs button[aria-current="true"]::before { background: var(--accent); }
.wk-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.wk-tabs .rn { font-family: var(--f-display); font-size: 1.05rem; line-height: 1; color: var(--accent); }
.wk-tabs .t { font-family: var(--f-mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.wk-note { padding: clamp(40px, 6vw, 80px) var(--gutter); border-top: 1px solid var(--rule); color: var(--muted); }
.wk-note p { margin: 0; max-width: 60ch; }

/* Short screens: the works list repeats the figure captions, so it goes first */
@media (min-width: 961px) and (max-height: 860px) {
  .wk-works { display: none; }
  .wk-page { gap: 12px; }
  .wk-page__num .rn { font-size: clamp(2.6rem, 1.6rem + 2.4vw, 4rem); }
  .wk-page h2 { font-size: clamp(2rem, 1.1rem + 2.2vw, 3.2rem); }
  .wk-page__stand { font-size: 1rem; }
  .wk-facts div { padding: 5px 0; }
}

/* ---------- Narrow screens and reduced motion: spreads stack, no pinning ---------- */
@media (max-width: 960px), (prefers-reduced-motion: reduce) {
  .wk-track { height: auto !important; }
  .wk-pin { position: relative; top: 0; height: auto; display: block; overflow: visible; border-top: 0; }
  .wk-tabs { display: none; }
  .wk-rooms { flex-direction: column; height: auto; transform: none !important; }
  .spread { flex: none; height: auto; grid-template-rows: auto; overflow: visible; row-gap: 28px; padding-block: 56px; border-top: 1px solid var(--rule); --lit: 1; }
  .m { width: 100% !important; height: auto !important; }
  .plates[data-layout] { grid-template-rows: auto; }
  .plates[data-layout] .plate { height: auto; }
}
@media (max-width: 960px) {
  .wk-open__title, .wk-open__deck, .wk-open__kicker, .wk-contents { grid-column: 1 / -1; grid-row: auto; }
  /* Two fixed lines, so the title can't rewrap when the display face arrives. */
  .wk-open__title em { display: block; }
  .wk-open__foot { white-space: nowrap; }
  .wk-page, .plates { grid-column: 1 / -1; }
  .wk-page { padding-right: 0; }
  .plates { border-left: 0; padding-left: 0; }
  .plates[data-layout] { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; }
  .plates[data-layout] .plate { grid-column: auto; grid-row: auto; height: auto; }
  .plates[data-layout="single"] { grid-template-columns: minmax(0, 1fr); }
  .plates .plate.is-wide { grid-column: 1 / -1; }
  .plates[data-layout="reel"] .plate { grid-column: 1 / -1; }
  .plates[data-layout="reel"] .plate .m[data-kind="portrait"] { width: 62% !important; }
  .study-tag { position: static; grid-column: 1 / -1; }
  .plates.has-seq { padding-bottom: 0; }
  .seq { position: static; grid-column: 1 / -1; }
  .wk-open__foot span:last-child { display: none; }
}
