/* Halden & Roe: project page extras (orchard-lane.html). Banner, interiors key plans + room tiles, lightbox.
   Animated start states only apply under html.proj-anim (set in <head> when motion is allowed); js/project.js
   moves them to their final states. No GSAP. */

/* ---------- Banner: stepping out onto the porch ---------- */
/* --step: radius of the opening in the dark cover (0% = dark, 130% = clear) */
@property --step { syntax: "<percentage>"; inherits: true; initial-value: 130%; }
.project-banner {
  position: relative; isolation: isolate; overflow: hidden;
  height: clamp(440px, calc(100svh - 77px), 1100px);
  background: #12120F; color: var(--paper);
  display: flex; align-items: flex-end;
  --step: 130%;
}
.banner-photo, .banner-photo img, .banner-cover { position: absolute; inset: 0; width: 100%; height: 100%; }
.banner-photo { z-index: -3; }
.banner-photo img { object-fit: cover; object-position: 50% 50%; transform-origin: 54% 46%; }
/* The dark house interior, opening from the centre like the hero's develop */
.banner-cover {
  z-index: -2; background: #12120F; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse at 54% 46%, transparent calc(var(--step) - 30%), #000 var(--step));
          mask-image: radial-gradient(ellipse at 54% 46%, transparent calc(var(--step) - 30%), #000 var(--step));
}
/* Scrim so the paper text reads over the floorboards */
.project-banner::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, rgba(14,14,12,.78), rgba(14,14,12,.28) 38%, transparent 62%),
              linear-gradient(to right, rgba(14,14,12,.35), transparent 55%);
}
.banner-copy { padding-block: 0 clamp(2rem, 1.5rem + 3vw, 4.5rem); }
.banner-copy .crumbs { margin-bottom: clamp(.9rem, .7rem + .8vw, 1.4rem); }
.banner-copy .crumbs, .banner-copy .crumbs a, .banner-meta { color: #D9D3C6; }
.banner-copy .crumbs li + li::before { color: #8E887B; }
.banner-copy .crumbs a:hover { color: var(--paper); }
.banner-copy h1 { font-size: clamp(2.6rem, 1.4rem + 4.4vw, 5.4rem); line-height: 1; letter-spacing: -.02em; }
.banner-meta { margin: clamp(.9rem, .7rem + .6vw, 1.3rem) 0 0; }
@media (max-width: 600px) { .project-banner { height: 72svh; min-height: 440px; } }

/* Start state, then .is-out (js/project.js, once the photo has decoded) */
.proj-anim .project-banner { --step: 0%; }
.proj-anim .banner-photo img { transform: scale(1.12); filter: grayscale(1) contrast(.85) brightness(.85); }
.proj-anim .banner-copy > * { opacity: 0; transform: translateY(14px); }
.proj-anim .project-banner.is-out { --step: 130%; transition: --step 3s cubic-bezier(.45,.05,.35,1) .2s; }
.proj-anim .is-out .banner-photo img {
  transform: none; filter: none;
  transition: transform 5s cubic-bezier(.22,.61,.24,1), filter 2.6s var(--ease) 1s;
}
.proj-anim .is-out .banner-copy > * { opacity: 1; transform: none; transition: opacity .9s var(--ease), transform .9s var(--ease); }
.proj-anim .is-out .banner-copy > :nth-child(1) { transition-delay: 1.9s; }
.proj-anim .is-out .banner-copy > :nth-child(2) { transition-delay: 2.05s; }
.proj-anim .is-out .banner-copy > :nth-child(3) { transition-delay: 2.3s; }

/* ---------- Sheet 02 Interiors ---------- */
.rooms-title { margin-bottom: clamp(1.75rem, 1.2rem + 2vw, 3rem); }
.rooms { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(1.5rem, 1rem + 3vw, 4rem); align-items: start; }
@media (max-width: 1000px) { .rooms { grid-template-columns: 1fr; } }

/* Key plans */
.plans { display: grid; gap: 1.5rem; position: sticky; top: 1.5rem; }
@media (max-width: 1000px) { .plans { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .plans { grid-template-columns: 1fr; } }
.plan { margin: 0; }
.plan svg { width: 100%; height: auto; overflow: visible; }
.plan figcaption { margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--rule); }
.plan path, .plan rect, .plan circle { fill: none; stroke: var(--ink); stroke-linejoin: miter; }
.plan-walls path { stroke-width: 5; stroke-linecap: square; }
.plan-walls .plan-chimney { fill: var(--ink); }
.plan-thin path, .plan-thin, .plan-trees circle { stroke-width: 1; }
.plan-porch { stroke-width: 1.5; stroke-dasharray: 8 5; }
.plan-dash { stroke-width: 1 !important; stroke-dasharray: 5 5; }
.plan-trees circle { stroke: var(--rule-strong); }
.plan text { font: 400 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; fill: var(--ink-soft); text-anchor: middle; }
/* Room markers: camera point + view cone, like a photo key plan */
.plan-room { cursor: pointer; }
.plan-room .room-area { stroke: none; fill: transparent; transition: fill .35s var(--ease); }
.plan-room .room-view { fill: rgba(180,72,47,.1); stroke: var(--red); stroke-width: 1; transition: fill .35s var(--ease); }
.plan-room .room-dot { fill: var(--paper); stroke: var(--red); stroke-width: 1.5; transition: fill .35s var(--ease); }
.plan-room .room-num { fill: var(--red); font-size: 10px; letter-spacing: 0; transition: fill .35s var(--ease); }
.plan-room.is-hot .room-area { fill: rgba(180,72,47,.08); }
.plan-room.is-hot .room-view { fill: rgba(180,72,47,.28); }
.plan-room.is-hot .room-dot { fill: var(--red); }
.plan-room.is-hot .room-num { fill: var(--paper); }

/* Room tiles: line drawing, photo revealed through a soft circle (--r) at the cursor (--mx/--my) */
@property --r { syntax: "<length>"; inherits: true; initial-value: 2000px; }
.room-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.25rem, 2.2vw, 2.25rem) clamp(1rem, 2vw, 2rem); }
@media (max-width: 600px) { .room-grid { grid-template-columns: 1fr; } }
.room-open {
  display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none; color: inherit;
  font: inherit; text-align: left; cursor: zoom-in;
}
.room-art {
  position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden;
  background: var(--paper); outline: 1px solid var(--rule); outline-offset: -1px;
  --r: 2000px; --mx: 50%; --my: 50%;
}
.room-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.room-lines { mix-blend-mode: multiply; }
.room-photo {
  position: absolute; inset: 0;
  -webkit-mask-image: radial-gradient(circle at var(--mx) var(--my), #000 calc(var(--r) * .55), transparent var(--r));
          mask-image: radial-gradient(circle at var(--mx) var(--my), #000 calc(var(--r) * .55), transparent var(--r));
}
/* red registration corners appear on hover / focus */
.room-art::before, .room-art::after {
  content: ""; position: absolute; z-index: 2; width: 14px; height: 14px; pointer-events: none;
  border: 0 solid var(--red); opacity: 0; transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.room-art::before { top: 8px; left: 8px; border-width: 1px 0 0 1px; transform: translate(4px, 4px); }
.room-art::after { bottom: 8px; right: 8px; border-width: 0 1px 1px 0; transform: translate(-4px, -4px); }
.room-open:hover .room-art::before, .room-open:hover .room-art::after,
.room-open:focus-visible .room-art::before, .room-open:focus-visible .room-art::after,
.room-open.is-hot .room-art::before, .room-open.is-hot .room-art::after { opacity: 1; transform: none; }
.room-cap { display: block; padding-top: .9rem; }
.room-cap .label { display: block; margin-bottom: .35rem; color: var(--ink); }
.room-note { display: block; color: var(--ink-soft); font-size: 1rem; line-height: 1.55; }
.room-open:hover .room-title, .room-open.is-hot .room-title { color: var(--red-deep); }

.proj-anim .room-art { --r: 0px; transition: --r .7s var(--ease); }
.proj-anim .room-open.is-near .room-art { --r: 150px; transition-duration: .45s; }
.proj-anim .room-open.is-hot .room-art,
.proj-anim .room-open:focus-visible .room-art { --r: 1100px; --mx: 50%; --my: 50%; transition-duration: 1.1s; }
/* Touch screens have no hover: each photo develops once as the tile scrolls in */
.proj-anim .room-open.is-seen .room-art { --r: 1100px; --mx: 50%; --my: 50%; transition: --r 2.2s cubic-bezier(.45,.05,.35,1) .2s; }

/* ---------- Lightbox ---------- */
html.lb-open { overflow: hidden; }
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #11110F; color: var(--paper); overflow: hidden;
}
.lightbox::backdrop { background: transparent; }
.lightbox[open] { animation: lb-in .35s var(--ease); }
@keyframes lb-in { from { opacity: 0; } }
.lb-stage { position: relative; height: 100%; display: grid; place-items: center; padding: clamp(3.5rem, 6vh, 4.5rem) clamp(16px, 7vw, 120px) 1.25rem; }
.lb-figure { margin: 0; display: grid; gap: 1rem; justify-items: start; }
.lb-art {
  position: relative; aspect-ratio: 3 / 2;
  width: min(100vw - 2 * clamp(16px, 7vw, 120px), (100dvh - clamp(3.5rem, 6vh, 4.5rem) - 9.5rem) * 1.5);
  transition: opacity .25s var(--ease), filter 1.2s var(--ease);
}
.lb-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lb-high { opacity: 0; transition: opacity .4s var(--ease); }
.lb-high.is-ready { opacity: 1; }
.lb-art.is-grey { filter: grayscale(1) contrast(.85) brightness(.9); transition: opacity .25s var(--ease), filter 0s; }
.lb-art.is-swapping { opacity: 0; }
.lb-art::before, .lb-art::after {
  content: ""; position: absolute; z-index: 2; width: 16px; height: 16px; pointer-events: none; border: 0 solid #E58A6B;
}
.lb-art::before { top: -9px; left: -9px; border-width: 1px 0 0 1px; }
.lb-art::after { bottom: -9px; right: -9px; border-width: 0 1px 1px 0; }
.lb-cap { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1.25rem; align-items: baseline; max-width: 60rem; }
.lb-count { color: #B9B3A6; grid-row: span 2; }
.lb-title { font-size: clamp(1.3rem, 1.15rem + .55vw, 1.6rem); }
.lb-note { margin: 0; color: #D9D3C6; }
@media (max-width: 600px) { .lb-cap { grid-template-columns: 1fr; } .lb-count { grid-row: auto; } }
.lb-btn {
  position: absolute; display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  background: transparent; color: var(--paper); border: 1px solid rgba(244,241,234,.35); cursor: pointer;
  font: 400 1.25rem/1 var(--sans); transition: border-color .3s var(--ease), color .3s var(--ease);
}
.lb-btn:hover { border-color: #E58A6B; color: #E58A6B; }
.lb-btn:focus-visible { outline-color: #E58A6B; }
.lb-close { top: 12px; right: 12px; font-size: 1.6rem; }
.lb-prev, .lb-next { top: calc(50% - 24px - 2.5rem); }
.lb-prev { left: clamp(8px, 2vw, 40px); }
.lb-next { right: clamp(8px, 2vw, 40px); }
@media (max-width: 760px) {
  .lb-prev, .lb-next { top: auto; bottom: 12px; }
  .lb-stage { padding-bottom: 72px; }
}
::view-transition-group(lb-art) { animation-duration: .5s; animation-timing-function: cubic-bezier(.22,.61,.24,1); }
