/* ==========================================================================
   Immersive home: "From plan to place"
   A blueprint house drawn in sand-coloured lines, a walk through its door into a
   finished project, build films scrubbed by scroll, then a corridor of projects.
   ========================================================================== */

.is-immersive { --night: #0e1925; background: var(--night); }
.is-immersive .site-main { position: relative; }
.imm-gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; pointer-events: none; }
.imm-stage { position: relative; z-index: 1; color: var(--white); }
.imm-content { position: relative; z-index: 1; background: var(--paper); }
.is-immersive .cta-band, .is-immersive .site-footer { position: relative; z-index: 1; }
.imm-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

/* Entrance */
.imm-loader { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: var(--night); transition: opacity .9s var(--ease), visibility .9s; }
.imm-loader.is-done { opacity: 0; visibility: hidden; }
.imm-loader-inner { display: grid; justify-items: center; gap: 22px; text-align: center; }
.imm-loader svg { width: 110px; height: 132px; color: var(--sand); }
.imm-loader svg path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: imm-draw 1.8s var(--ease) forwards; }
.imm-loader svg path:nth-child(2) { animation-delay: .6s; }
.imm-loader svg path:nth-child(3) { animation-delay: .9s; }
.imm-loader svg path:nth-child(4) { animation-delay: 1.1s; }
@keyframes imm-draw { to { stroke-dashoffset: 0; } }
.imm-loader-word { margin: 0; font-family: var(--f-label); font-size: 14px; letter-spacing: .42em; text-transform: uppercase; line-height: 1.7; color: rgba(255, 255, 255, .85); }
.imm-loader-bar { width: 180px; height: 1px; background: rgba(200, 173, 128, .25); overflow: hidden; }
.imm-loader-bar span { display: block; height: 100%; width: 0; background: var(--sand); transition: width .3s; }
.imm-loader-skip { background: none; border: 0; color: rgba(255, 255, 255, .6); font-family: var(--f-label); letter-spacing: .2em; text-transform: uppercase; font-size: 13px; cursor: pointer; }

/* Stage 1: blueprint house */
.imm-hero { height: 520vh; }
.imm-kicker { position: absolute; left: var(--gut); top: calc(var(--header-h) + clamp(28px, 6vh, 72px)); max-width: 34em; }
.imm-kicker p:last-child { color: rgba(255, 255, 255, .78); font-size: clamp(16px, 1.3vw, 19px); }
.imm-lines { position: absolute; left: var(--gut); right: var(--gut); bottom: clamp(48px, 10vh, 120px); pointer-events: none; }
.imm-line { position: absolute; left: 0; bottom: 0; margin: 0; max-width: 12ch; opacity: 0; transform: translateY(40px);
  font-family: var(--f-display); font-weight: 500; font-size: clamp(44px, 7.4vw, 124px); line-height: .98; letter-spacing: -.02em; }
.imm-line.is-last { color: var(--sand); }
.imm-caption { position: absolute; left: var(--gut); bottom: clamp(40px, 8vh, 96px); max-width: 560px; opacity: 0; }
.imm-caption::before { content: ""; position: absolute; inset: -90px -80px -90px calc(-1 * var(--gut) - 40px); z-index: -1; filter: blur(24px);
  background: linear-gradient(90deg, rgba(14, 25, 37, .9), rgba(14, 25, 37, .65) 60%, rgba(14, 25, 37, 0)); }
.imm-caption h2 { font-family: var(--f-display); font-weight: 500; font-size: clamp(30px, 3.6vw, 56px); line-height: 1.04; margin: 10px 0 14px; }
.imm-caption p { color: rgba(255, 255, 255, .85); }
.imm-caption .btn-row { margin-top: 22px; }
.imm-rail { position: absolute; right: var(--gut); top: 50%; transform: translateY(-50%); display: grid; gap: 14px; }
.imm-rail span { display: flex; align-items: center; gap: 10px; font-family: var(--f-label); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: rgba(255, 255, 255, .4); transition: color .4s; }
.imm-rail span::before { content: ""; width: 22px; height: 1px; background: currentColor; transition: width .4s var(--ease); }
.imm-rail span.on { color: var(--sand); }
.imm-rail span.on::before { width: 40px; }
.imm-hint { position: absolute; right: var(--gut); bottom: clamp(48px, 10vh, 120px); display: flex; align-items: center; gap: 12px; font-family: var(--f-label); font-size: 13px; letter-spacing: .24em; text-transform: uppercase; color: rgba(255, 255, 255, .65); }
.imm-hint i { display: block; width: 1px; height: 56px; background: linear-gradient(var(--sand), transparent); animation: imm-hint 2s var(--ease) infinite; }
@keyframes imm-hint { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@media (max-width: 700px) { .imm-rail, .imm-hint { display: none; } .imm-kicker p:last-child { display: none; } }

/* Stage 2: build films */
.imm-film { height: calc(var(--films, 3) * 380vh + 100vh); background: var(--night); }
.imm-film-canvas, .imm-film-final { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.imm-film-final { object-fit: cover; opacity: 0; pointer-events: none; }
.imm-film-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(14, 25, 37, .7) 0%, rgba(14, 25, 37, 0) 26%, rgba(14, 25, 37, 0) 50%, rgba(14, 25, 37, .9) 100%); }
.imm-film-top { position: absolute; left: var(--gut); right: var(--gut); top: calc(var(--header-h) + 16px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.imm-film-top .eyebrow { margin: 0; }
.imm-film-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.imm-film-tabs button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 14px; background: rgba(14, 25, 37, .55); backdrop-filter: blur(6px); border: 1px solid rgba(200, 173, 128, .35); color: rgba(255, 255, 255, .7); cursor: pointer; font-family: var(--f-label); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; transition: background-color .35s, border-color .35s, color .35s; }
.imm-film-tabs button b { font-family: var(--f-display); font-weight: 500; font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--white); }
.imm-film-tabs button.on { background: var(--sand); border-color: var(--sand); color: var(--navy-2); }
.imm-film-tabs button.on b { color: var(--navy-2); }
.imm-film-cap { position: absolute; left: var(--gut); bottom: clamp(64px, 12vh, 130px); max-width: min(640px, calc(100% - 2 * var(--gut))); }
.imm-film-cap h2 { font-family: var(--f-display); font-weight: 500; font-size: clamp(34px, 5vw, 80px); line-height: 1; letter-spacing: -.02em; margin: 12px 0 16px; }
.imm-film-link { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-label); font-size: 14px; letter-spacing: .18em; text-transform: uppercase; color: var(--sand); text-decoration: none; }
.imm-film-link .icon { width: 16px; height: 16px; }
.imm-swap { transition: opacity .35s, transform .5s var(--ease); }
.is-swapping .imm-swap { opacity: 0; transform: translateY(16px); }
.imm-film-bar { position: absolute; left: var(--gut); right: var(--gut); bottom: clamp(36px, 6vh, 64px); height: 2px; background: rgba(255, 255, 255, .18); }
.imm-film-bar span { display: block; height: 100%; width: 0; background: var(--sand); }
.imm-film-bar i { position: absolute; top: -4px; width: 1px; height: 10px; background: rgba(255, 255, 255, .4); }
.imm-film-note { position: absolute; right: var(--gut); bottom: clamp(44px, 7vh, 74px); margin: 0; font-size: 12px; color: rgba(255, 255, 255, .55); max-width: 300px; text-align: right; }
@media (max-width: 700px) { .imm-film-note { display: none; } .imm-film-tabs button { padding: 7px 10px; } .imm-film-tabs button span { display: none; } }

/* Stage 3: corridor of projects */
.imm-work { height: calc(var(--projects, 6) * 165vh + 100vh); }
.imm-work .imm-sticky::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(14, 25, 37, .92) 0%, rgba(14, 25, 37, .6) 34%, rgba(14, 25, 37, 0) 60%), linear-gradient(0deg, rgba(14, 25, 37, .75) 0%, rgba(14, 25, 37, 0) 38%); }
.imm-work-head { position: absolute; left: var(--gut); top: calc(var(--header-h) + 24px); }
.imm-work-head h2 { font-family: var(--f-display); font-weight: 500; font-size: clamp(28px, 3vw, 44px); line-height: 1.08; margin-top: 10px; max-width: 16ch; }
@media (max-height: 720px) { .imm-work-head h2 { display: none; } }
.imm-work-card { position: absolute; left: var(--gut); bottom: clamp(40px, 8vh, 96px); width: min(520px, calc(100% - 2 * var(--gut))); }
.imm-work-count { font-family: var(--f-label); font-size: 14px; letter-spacing: .2em; color: rgba(255, 255, 255, .6); margin: 0; }
.imm-work-count b { color: var(--sand); font-weight: 500; }
.imm-work-name { font-family: var(--f-display); font-weight: 500; font-size: clamp(34px, 4.6vw, 72px); line-height: 1; letter-spacing: -.015em; margin: 12px 0; }
.imm-work-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; font-family: var(--f-label); font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--sand); }
.imm-work-scope { margin: 12px 0 18px; color: rgba(255, 255, 255, .82); max-width: 40ch; }
.imm-work-types { position: absolute; right: var(--gut); bottom: clamp(40px, 8vh, 96px); display: flex; gap: 8px; }
.imm-work-types span { padding: 8px 14px; border: 1px solid rgba(200, 173, 128, .35); font-family: var(--f-label); font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255, 255, 255, .55); transition: background-color .35s, color .35s, border-color .35s; }
.imm-work-types span.on { background: var(--sand); border-color: var(--sand); color: var(--navy-2); }
@media (max-width: 700px) { .imm-work-types { display: none; } }

/* X-ray lens on the residential / commercial cards */
@property --r { syntax: '<length>'; inherits: true; initial-value: 0px; }
.sector-media.has-lens { position: relative; --mx: 50%; --my: 50%; --r: 0px; transition: --r .45s var(--ease); }
.sector-media.has-lens.lens-on { --r: clamp(100px, 11vw, 160px); }
.sector-media.has-lens img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sector-media.has-lens.lens-on img { transform: none !important; }
.sector-media .xray { z-index: 1;
  -webkit-mask: radial-gradient(circle var(--r) at var(--mx) var(--my), #000 97%, transparent 100%);
  mask: radial-gradient(circle var(--r) at var(--mx) var(--my), #000 97%, transparent 100%); }
.lens-ring { position: absolute; z-index: 2; left: var(--mx); top: var(--my); width: calc(var(--r) * 2); height: calc(var(--r) * 2); transform: translate(-50%, -50%); border: 1px solid var(--sand); border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .3s; }
.lens-on .lens-ring { opacity: 1; }
.lens-ring span { position: absolute; left: 50%; top: -12px; transform: translateX(-50%); padding: 3px 8px; background: var(--sand); color: var(--navy-2); font-family: var(--f-label); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; white-space: nowrap; }
.lens-hint { position: absolute; z-index: 3; top: 16px; right: 16px; padding: 6px 10px; font-family: var(--f-label); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--white); background: rgba(14, 25, 37, .55); border: 1px solid rgba(255, 255, 255, .3); transition: opacity .3s; }
.lens-on .lens-hint { opacity: 0; }
@media (hover: none) { .lens-hint, .lens-ring { display: none; } }

/* Tape-measure cursor */
.imm-tape { position: fixed; left: 0; top: 0; z-index: 250; pointer-events: none; opacity: 0; transition: opacity .3s; mix-blend-mode: difference; }
.imm-tape.on { opacity: 1; }
.imm-tape-line { position: fixed; left: 0; height: 9px; transform: translateY(-4px);
  background: repeating-linear-gradient(90deg, rgba(200, 173, 128, .9) 0 1px, transparent 1px 10px), linear-gradient(rgba(200, 173, 128, .9), rgba(200, 173, 128, .9)) 0 4px / 100% 1px no-repeat; }
.imm-tape-x { position: fixed; width: 15px; height: 15px; transform: translate(-50%, -50%); }
.imm-tape-x::before, .imm-tape-x::after { content: ""; position: absolute; background: var(--sand); }
.imm-tape-x::before { left: 7px; top: 0; width: 1px; height: 15px; }
.imm-tape-x::after { top: 7px; left: 0; height: 1px; width: 15px; }
.imm-tape-read { position: fixed; transform: translate(12px, 10px); font-family: var(--f-label); font-size: 11px; letter-spacing: .14em; color: var(--sand); white-space: nowrap; }
@media (hover: none), (pointer: coarse) { .imm-tape { display: none; } }

/* Headings: each word rises from behind a cut line */
.rise-word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.rise-word > span { display: inline-block; will-change: transform; }

/* Fallback: no WebGL or reduced motion — the stages become ordinary sections */
.imm-static .imm-gl { display: none; }
.imm-static .imm-hero { height: auto; background: center / cover no-repeat var(--imm-hero, none), var(--navy); }
.imm-static .imm-hero .imm-sticky { position: relative; height: auto; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding: calc(var(--header-h) + 40px) 0 64px; }
.imm-static .imm-hero .imm-sticky::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14, 25, 37, .45), rgba(14, 25, 37, .92)); }
.imm-static .imm-kicker, .imm-static .imm-caption { position: relative; left: auto; top: auto; bottom: auto; opacity: 1; margin: 0 var(--gut) 24px; }
.imm-static .imm-lines, .imm-static .imm-rail, .imm-static .imm-hint { display: none; }
.imm-static .imm-work { height: auto; }
.imm-static .imm-work .imm-sticky { position: relative; height: auto; padding: 96px var(--gut); }
.imm-static .imm-work .imm-sticky::before, .imm-static .imm-work-card, .imm-static .imm-work-types { display: none; }
.imm-static .imm-work-head { position: static; margin-bottom: 32px; }
.imm-static .imm-work .sr-only { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal;
  list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.imm-static .imm-work .sr-only a { display: block; padding: 20px; border: 1px solid rgba(200, 173, 128, .35); color: var(--white); text-decoration: none; font-family: var(--f-display); font-size: 22px; }
