/* ============================================================
   REECHE & CO. / ROOM TO ROOM
   Theatre layer: 3D stages, blueprint, conveyor, wipes, gallery
   ============================================================ */

/* ---------- shared: macro zoom band ---------- */

.macro-band { overflow: clip; border-block: 2px solid var(--ink); background: var(--forest); }
.macro-band figure { margin: 0; position: relative; }
.macro-band img { width: 100%; height: min(92svh, 820px); object-fit: cover; }
html[data-enhanced] .macro-band figure { transform: scale(1.12); }
@media (prefers-reduced-motion: reduce) { html[data-enhanced] .macro-band figure { transform: none; } }
.macro-band figcaption {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--cream); color: var(--ink); border: 2px solid var(--ink);
  padding: 8px 14px; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.16em;
  box-shadow: 4px 5px 0 var(--ink); white-space: nowrap;
}

.theatre-hint { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em; opacity: 0.66; margin: 14px 0 0; grid-column: 2; }
.theatre-hint::after { content: " ↓"; }

/* live media: poster image + silent film overlay */
.live-media { position: relative; }
.live-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.live-media figcaption { z-index: 2; }
@media (prefers-reduced-motion: reduce) { .live-media video { display: none; } }

/* ---------- CANS : the theatre ---------- */

.theatre {
  display: grid; grid-template-columns: 5fr 7fr;
  background: var(--plum); color: var(--cream);
  border-bottom: 2px solid var(--ink);
  position: relative;
}
.theatre-copy { display: grid; align-content: center; gap: 0; padding: clamp(50px, 6vw, 100px) var(--gutter); min-height: 100svh; position: relative; }
.theatre-act { max-width: 44ch; }
.theatre-act .kicker { color: var(--butter); }
.theatre-act h2 { font-family: var(--serif); font-size: clamp(2rem, 3.6vw, 3.8rem); line-height: 0.98; letter-spacing: -0.035em; margin: 6px 0 16px; }
.theatre-act p { margin: 0 0 34px; font-size: 1rem; opacity: 0.94; }
html[data-enhanced] .theatre.is-pinned .theatre-act { position: absolute; top: 50%; left: var(--gutter); right: var(--gutter); transform: translateY(-40%); opacity: 0; max-width: min(44ch, calc(100% - var(--gutter) * 2)); transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out); }
html[data-enhanced] .theatre.is-pinned .theatre-act.act-live { opacity: 1; transform: translateY(-50%); }

.theatre-stage { position: relative; border-left: 2px solid var(--ink); background: #082a1f; min-height: 100svh; }
.higgs-stage { position: sticky; top: 74px; height: calc(100svh - 74px); display: grid; place-items: center; overflow: clip; }
.higgs-fallback { max-height: 84%; width: auto; max-width: 86%; object-fit: contain; }
.turntable-canvas { position: absolute; inset: 4% 6%; width: 88%; height: 92%; opacity: 0; pointer-events: none; transition: opacity 0.6s ease; }
.higgs-stage.is-webgl-ready .turntable-canvas { opacity: 1; }
.higgs-fallback { transition: opacity 0.6s ease; }
.higgs-stage.is-webgl-ready .higgs-fallback { opacity: 0; }

/* poster-to-film fade: videos stay invisible until actually playing */
html.js .act-hero-film, html.js .live-media video { opacity: 0; transition: opacity 0.6s ease; }
html.js .act-hero-film.is-playing, html.js .live-media video.is-playing { opacity: 1; }
.stage-status {
  position: absolute; right: 20px; bottom: 20px;
  font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.16em;
  color: var(--cream); opacity: 0.7;
}

.spec-strip { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 2px solid var(--ink); }
.spec-strip article { padding: clamp(30px, 4vw, 60px); border-right: 2px solid var(--ink); background: var(--cream); }
.spec-strip article:nth-child(2) { background: var(--butter); }
.spec-strip article:last-child { border-right: 0; background: var(--ivory); }
.spec-strip h3 { font-family: var(--serif); font-size: clamp(1.5rem, 2.4vw, 2.3rem); letter-spacing: -0.02em; margin: 8px 0 12px; }
.spec-strip p { margin: 0; font-size: 0.95rem; max-width: 40ch; }

/* ---------- BOXES : the blueprint ---------- */

.blueprint-hero { background: var(--ivory); border-bottom: 2px solid var(--ink); padding-bottom: clamp(60px, 8vw, 120px); }
.blueprint-type { display: grid; grid-template-columns: 2fr 8fr 2fr; gap: 26px; align-items: end; padding: clamp(80px, 9vw, 140px) var(--gutter) clamp(40px, 5vw, 70px); }
.blueprint-type h1 { grid-column: 2; font-family: var(--serif); font-size: clamp(3rem, 6.4vw, 7.6rem); line-height: 0.88; letter-spacing: -0.05em; margin: 0; }
.blueprint-type .kicker { grid-column: 1; grid-row: 1; }
.blueprint-lede { grid-column: 3; font-size: 0.98rem; margin: 0; }

.blueprint-stage { position: relative; margin: 0 var(--gutter); border: 2px solid var(--ink); background: var(--cream); box-shadow: var(--shadow-pop); overflow: clip; aspect-ratio: 1570 / 975; }
.blueprint-drawing { display: block; width: 100%; height: auto; position: relative; z-index: 2; }
.bp-grid path { stroke: rgba(63, 110, 92, 0.16); stroke-width: 1; transition: opacity 1s var(--ease-out); }
.bp-line ellipse, .bp-line path { stroke: var(--forest); stroke-width: 3; transition: opacity 1.1s var(--ease-out); }
.bp-notes .bp-leader { stroke: var(--tomato); stroke-width: 2; stroke-dasharray: 7 6; }
.bp-notes text { fill: var(--ink); font-family: var(--mono); font-size: 26px; letter-spacing: 0.1em; }
html.js [data-bp-line] ellipse, html.js [data-bp-line] path { stroke-dasharray: 2200; stroke-dashoffset: 2200; }
html.reduced-motion [data-bp-line] ellipse, html.reduced-motion [data-bp-line] path { stroke-dashoffset: 0 !important; animation: none !important; }
.blueprint-stage.is-drawn [data-bp-line] ellipse, .blueprint-stage.is-drawn [data-bp-line] path {
  animation: bpDraw 2.6s var(--ease-out) forwards;
}
@keyframes bpDraw { to { stroke-dashoffset: 0; } }
html.js .bp-notes { opacity: 0; transition: opacity 0.8s var(--ease-out) 1.6s; }
html.js .blueprint-stage.is-drawn .bp-notes, html.reduced-motion .bp-notes { opacity: 1; }

/* the traced drawing sits exactly over the photographed box; the photo fades in
   underneath and the trace recedes so the outline becomes the object */
.blueprint-photo { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 1.2s var(--ease-out); z-index: 1; }
.blueprint-photo img { width: 100%; height: 100%; object-fit: cover; }
.blueprint-photo figcaption {
  position: absolute; z-index: 3; left: 14px; bottom: 14px; background: var(--cream); border: 1px solid var(--ink);
  padding: 6px 9px; font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.12em;
  opacity: 0; transition: opacity 0.8s var(--ease-out) 0.6s;
}
.blueprint-stage.is-photo .blueprint-photo { opacity: 1; }
.blueprint-stage.is-photo .blueprint-photo figcaption { opacity: 1; }
.blueprint-stage.is-photo .bp-grid path { opacity: 0; }
.blueprint-stage.is-photo .bp-line ellipse, .blueprint-stage.is-photo .bp-line path { opacity: 0.3; }
.blueprint-stage.is-photo .bp-notes { opacity: 0; transition-delay: 0s; }

.box-truths { padding: clamp(80px, 10vw, 150px) var(--gutter); display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(22px, 3vw, 44px); background: var(--cream); position: relative; }
.truth-note { position: relative; border: 2px solid var(--ink); background: var(--ivory); padding: clamp(24px, 3vw, 44px); box-shadow: 8px 10px 0 var(--ink); }
.truth-note:nth-child(2) { transform: rotate(0.7deg); background: var(--cream); }
.truth-note:nth-child(3) { transform: rotate(-0.6deg); }
.truth-pin { position: absolute; top: -9px; left: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--tomato); border: 2px solid var(--ink); transform: translateX(-50%); }
.truth-note h2 { font-family: var(--serif); font-size: clamp(1.5rem, 2.3vw, 2.2rem); letter-spacing: -0.02em; margin: 6px 0 12px; }
.truth-note p { margin: 0; font-size: 0.95rem; }

.pull-strip { display: grid; grid-template-columns: 5fr 7fr; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); background: var(--plum); color: var(--cream); }
.pull-strip figure { margin: 0; border-right: 2px solid var(--ink); overflow: clip; position: relative; }
.pull-strip img { width: 100%; height: 100%; object-fit: cover; min-height: 420px; }
.pull-strip figcaption { position: absolute; left: 12px; top: 12px; background: var(--cream); color: var(--ink); border: 1px solid var(--ink); padding: 5px 8px; font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.12em; }
.pull-copy { padding: clamp(40px, 5vw, 90px); display: grid; align-content: center; gap: 8px; }
.pull-copy .kicker { color: var(--butter); }
.pull-copy h2 { font-family: var(--serif); font-size: clamp(2.2rem, 4.4vw, 4.8rem); line-height: 0.92; letter-spacing: -0.04em; margin: 0 0 18px; }
.pull-copy p:last-child { margin: 0; max-width: 46ch; font-size: 1.02rem; opacity: 0.94; }

/* ---------- HOW : the conveyor ---------- */

.conveyor { background: var(--forest); color: var(--cream); border-bottom: 2px solid var(--ink); overflow: clip; }
.conveyor-clip { position: relative; overflow-x: auto; overflow-y: clip; scroll-snap-type: x mandatory; scrollbar-color: var(--butter) transparent; }
html[data-enhanced] .conveyor-clip.is-pinned { overflow: visible; }
.conveyor-line { position: absolute; left: 0; top: 182px; width: 100%; min-width: 100%; height: 2px; background: rgba(246, 239, 220, 0.3); }
html[data-enhanced] .conveyor-clip.is-pinned .conveyor-line { width: 100%; }
.conveyor-line i { display: block; height: 100%; background: var(--butter); transform-origin: left center; }
html.js .conveyor-line i { transform: scaleX(0); }
.conveyor-dot {
  position: absolute; left: 0; top: 50%; width: 20px; height: 20px; border-radius: 50%;
  background: var(--butter); border: 2px solid var(--ink);
  transform: translate(-2px, -50%);
}
html.no-enhance .conveyor-line i { transform: none; }
.conveyor-track { display: flex; gap: clamp(30px, 4vw, 80px); width: max-content; padding: 236px var(--gutter) clamp(70px, 9vw, 120px); }
.station { flex: 0 0 min(560px, 82vw); scroll-snap-align: start; position: relative; }
.station-no {
  position: absolute; top: -118px; left: 0;
  font-family: var(--serif); font-size: clamp(3rem, 5vw, 5rem); color: var(--butter); line-height: 1;
}
.station-card { border: 2px solid var(--ink); background: var(--cream); color: var(--ink); padding: clamp(26px, 3vw, 48px); box-shadow: 8px 10px 0 var(--ink); min-height: 300px; display: grid; align-content: start; gap: 12px; }
.station:nth-child(even) .station-card { background: var(--butter); }
.station-card h2 { font-family: var(--serif); font-size: clamp(1.8rem, 3vw, 3rem); letter-spacing: -0.03em; line-height: 0.98; margin: 0; }
.station-card p { margin: 0; font-size: 1rem; max-width: 46ch; }
.station-stamp { display: inline-block; margin-top: 16px; font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.18em; opacity: 0.75; }

.conveyor-close { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(30px, 4vw, 70px); align-items: center; padding: clamp(80px, 10vw, 150px) var(--gutter); border-bottom: 2px solid var(--ink); }
.conveyor-close h2 { font-family: var(--serif); font-size: clamp(2.6rem, 5.4vw, 6.2rem); letter-spacing: -0.045em; line-height: 0.92; margin: 16px 0 22px; }
.conveyor-close p { max-width: 52ch; font-size: 1.02rem; margin: 0; }
.conveyor-close .btn-big { justify-self: start; }

/* ---------- PLACEMENTS : room wipes ---------- */

.room-wipes { position: relative; }
.room-panel { position: sticky; top: 0; height: 100svh; overflow: clip; border-bottom: 2px solid var(--ink); }
.room-panel figure { margin: 0; position: absolute; inset: 0; }
.room-panel img { width: 100%; height: 100%; object-fit: cover; }
.room-panel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(8deg, rgba(32, 27, 23, 0.5) 0%, rgba(32, 27, 23, 0.06) 46%); }
.room-plate {
  position: absolute; z-index: 2; left: clamp(20px, 4vw, 70px); bottom: clamp(20px, 4vw, 60px);
  max-width: min(560px, 86%);
  border: 2px solid var(--ink); box-shadow: var(--shadow-pop);
  padding: clamp(22px, 3vw, 44px);
}
.room-plate-euca { background: var(--euca); color: var(--cream); }
.room-plate-plum { background: var(--plum); color: var(--cream); }
.room-plate-tomato { background: var(--tomato); color: var(--ink); }
.room-plate-brown { background: var(--butter); color: var(--ink); }
.room-plate h2 { font-family: var(--serif); font-size: clamp(2.2rem, 4.4vw, 4.6rem); line-height: 0.92; letter-spacing: -0.04em; margin: 8px 0 12px; }
.room-plate p { margin: 0; font-size: 1rem; max-width: 40ch; }
.room-code-rail {
  position: fixed; z-index: 40; right: clamp(14px, 2.4vw, 40px); top: 50%;
  transform: translateY(-50%); text-align: right;
  color: var(--cream); mix-blend-mode: difference;
  display: none;
}
html[data-enhanced][data-route="placements"] .room-code-rail { display: block; }
.room-code-rail b { display: block; font-family: var(--mono); font-size: clamp(1.6rem, 3vw, 2.6rem); letter-spacing: 0.1em; }
.room-code-rail span { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.16em; opacity: 0.85; }
.rooms-close { padding: clamp(90px, 11vw, 170px) var(--gutter); background: var(--butter); border-bottom: 2px solid var(--ink); }
.rooms-close h2 { font-family: var(--serif); font-size: clamp(2.4rem, 5.2vw, 6rem); letter-spacing: -0.045em; line-height: 0.94; margin: 18px 0 44px; max-width: 20ch; }

/* ---------- CONCEPTS : gallery wall ---------- */

.gallery-wall { padding: clamp(50px, 6vw, 90px) var(--gutter); columns: 3 340px; column-gap: clamp(20px, 2.6vw, 40px); background: var(--cream); }
.exhibit {
  break-inside: avoid; margin: 0 0 clamp(20px, 2.6vw, 40px); position: relative;
  border: 2px solid var(--ink); background: var(--ivory); box-shadow: 8px 10px 0 var(--ink);
  cursor: zoom-in; overflow: clip;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.exhibit:hover, .exhibit:focus-visible { transform: translate(-2px, -4px) rotate(-0.4deg); box-shadow: 12px 15px 0 var(--ink); }
.exhibit img { width: 100%; display: block; }
.exhibit figcaption {
  display: flex; gap: 10px; align-items: baseline; justify-content: space-between;
  padding: 12px 14px; border-top: 2px solid var(--ink);
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em; background: var(--cream);
}
.exhibit figcaption b { font-weight: 700; }
.exhibit figcaption span { border: 1px solid var(--ink); padding: 2px 6px; background: var(--butter); }
.lightbox { border: 2px solid var(--ink); background: var(--cream); padding: 14px; max-width: min(1180px, 94vw); box-shadow: 14px 16px 0 var(--ink); }
.lightbox::backdrop { background: rgba(32, 27, 23, 0.82); }
.lightbox img { max-height: 76svh; width: auto; max-width: 100%; margin: 0 auto; border: 1px solid var(--ink); }
.lightbox-cap { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.13em; margin: 12px 4px 2px; }
.lightbox-close { position: absolute; right: 14px; top: 14px; border: 2px solid var(--ink); background: var(--butter); font-weight: 700; padding: 8px 14px; cursor: pointer; box-shadow: 3px 4px 0 var(--ink); }
.lightbox-close:hover { background: var(--tomato); color: var(--cream); }
.gallery-essay { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 50px); padding: clamp(60px, 8vw, 120px) var(--gutter); background: var(--euca); color: var(--cream); border-block: 2px solid var(--ink); }
.gallery-essay .kicker { color: var(--butter); }
.gallery-essay h2 { font-family: var(--serif); font-size: clamp(1.7rem, 2.6vw, 2.6rem); letter-spacing: -0.02em; margin: 6px 0 12px; }
.gallery-essay p { margin: 0; font-size: 0.97rem; max-width: 40ch; opacity: 0.94; }

/* grain overlay for gallery + home */
html[data-route="concepts"] body::after,
html[data-route="home"] body::after {
  content: ""; position: fixed; inset: 0; z-index: 96; pointer-events: none;
  opacity: 0.05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
}

/* ---------- responsive: theatre layer ---------- */

@media (max-width: 1100px) {
  .theatre { grid-template-columns: 1fr; }
  .theatre-stage { border-left: 0; border-top: 2px solid var(--ink); min-height: 72svh; }
  .theatre-copy { min-height: 0; padding-bottom: 20px; }
  /* pinned mobile theatre: stage fills the viewport, acts rise as frosted sheets */
  html[data-enhanced] .theatre.is-pinned { display: block; position: relative; }
  html[data-enhanced] .theatre.is-pinned .theatre-stage { border-top: 0; min-height: 100svh; }
  html[data-enhanced] .theatre.is-pinned .theatre-copy { position: absolute; inset: 0; z-index: 3; padding: 0; pointer-events: none; }
  html[data-enhanced] .theatre.is-pinned .theatre-act {
    top: auto; bottom: 18px; left: 14px; right: 14px;
    transform: translateY(12px); max-width: none;
    background: rgba(6, 35, 28, 0.74);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    padding: 18px 18px 20px; border-top: 2px solid var(--butter);
  }
  html[data-enhanced] .theatre.is-pinned .theatre-act.act-live { transform: translateY(0); }
  html[data-enhanced] .theatre.is-pinned .theatre-act h2 { font-size: clamp(1.7rem, 7.5vw, 2.6rem); }
  html[data-enhanced] .theatre.is-pinned .theatre-act p { margin-bottom: 14px; font-size: 0.92rem; }
  html[data-enhanced] .theatre.is-pinned .theatre-act .link-rule,
  html[data-enhanced] .theatre.is-pinned .theatre-act .btn-solid { pointer-events: auto; }
  .higgs-stage { position: relative; top: 0; height: 72svh; }
  html[data-enhanced] .theatre.is-pinned .higgs-stage { height: 100svh; }
  .spec-strip { grid-template-columns: 1fr; }
  .spec-strip article { border-right: 0; border-bottom: 2px solid var(--ink); }
  .spec-strip article:last-child { border-bottom: 0; }
  .box-truths { grid-template-columns: 1fr; }
  .truth-note:nth-child(2), .truth-note:nth-child(3) { transform: none; }
  .pull-strip { grid-template-columns: 1fr; }
  .pull-strip figure { border-right: 0; border-bottom: 2px solid var(--ink); }
  .conveyor-close { grid-template-columns: 1fr; }
  .gallery-essay { grid-template-columns: 1fr; }
  html[data-enhanced][data-route="placements"] .room-code-rail { display: none; }
}

@media (max-width: 680px) {
  .macro-band img { height: 64svh; }
  .station { flex-basis: 88vw; }
  .station-no { top: -104px; }
  .room-plate { left: 14px; right: 14px; bottom: 14px; max-width: none; }
  .gallery-wall { columns: 1; }
  .blueprint-stage { margin: 0 12px; }
  .bp-notes text { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .exhibit:hover { transform: none; }
  .diptych-side:hover { flex-grow: 1; }
}
