/* D2 Five Rooms v2 — Fraunces (museum placard serif, opsz) + Manrope; analogous room accents on one graphite-navy ground.
   v2 (28 Oct): hero lives inside the rooms stage (walk through the door), one room per scroll, cards docked at the
   optimum spot, portrait (phones, tablets upright) designed first. Layout switch = aspect ratio, same test as the JS. */
body[data-dir="rooms"] { --font-display: "Fraunces", Georgia, serif; --font-body: "Manrope", sans-serif; --bg: #0a0f1c; background: #0a0f1c; }
body[data-dir="rooms"] h1, body[data-dir="rooms"] h2, body[data-dir="rooms"] h3 { font-weight: 400; font-optical-sizing: auto; line-height: 1.04; }

/* ---------- the world: one sticky stage + six scroll steps (hero + 5 rooms) ---------- */
:root { --enter: 0; --nav-h: 68px; }
.rooms-world { position: relative; background: #0a0f1c; }
.rooms-stage { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; z-index: 1; }
.rooms-stage + .room-step { margin-top: -100vh; margin-top: -100dvh; }
.room-step { height: 100vh; height: 100dvh; pointer-events: none; }
.rooms-canvas { position: absolute; inset: 0; }
.rooms-canvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gl-fallback { position: absolute; inset: 0; background: radial-gradient(120% 80% at 75% 40%, #12223f 0%, #0a0f1c 60%); }

/* ---------- hero: the original Rooms homepage (its own section, above the stage) ---------- */
.door-hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--nav-h) + var(--space-8)) 0 var(--space-12); background: radial-gradient(120% 80% at 75% 40%, #12223f 0%, #0a0f1c 60%); overflow: hidden; }
.door-grid { display: grid; grid-template-columns: 1fr minmax(320px, 480px); gap: var(--space-16); align-items: center; width: min(100% - 2 * var(--gutter), var(--container)); }
.door-copy { transform: translate3d(0, calc(var(--enter) * -32px), 0); opacity: calc(1 - var(--enter) * 1.4); }
.door-hero .hero-h { font-size: clamp(2.75rem, 1.2rem + 5.4vw, 6rem); line-height: .95; letter-spacing: -.045em; margin: var(--space-6) 0 var(--space-8); max-width: 11ch; text-wrap: balance; }
.door-hero .lede { color: var(--steel-200); }
.door { display: grid; gap: var(--space-4); justify-items: center; transform: scale(calc(1 + var(--enter) * 0.22)); transform-origin: 50% 60%; opacity: calc(1 - var(--enter) * 0.9); }
.door-glass {
  position: relative; width: 100%; aspect-ratio: 5 / 7; border-radius: 999px 999px 0 0; overflow: hidden;
  outline: 1px solid color-mix(in oklab, var(--ice) 40%, transparent); outline-offset: 10px; touch-action: pan-y;
  background: radial-gradient(70% 46% at 50% 70%, #31588c 0%, #10203d 62%, #0b1426 100%);
}
@media (min-aspect-ratio: 9/10) { .door-glass { width: min(100%, calc((100dvh - var(--nav-h) - 150px) * 5 / 7)); } }
.door-room { position: absolute; inset: 0; container-type: size; }
/* v7: the whole range to one scale — 1 m = 27% of the window height (typical category sizes; Techmark
   has not published dimensions). Floor line 6% from the bottom; wall units at their usual mounting height. */
.dr { position: absolute; height: auto; filter: drop-shadow(0 10px 14px rgba(3, 8, 20, .45)); }
.dr-fan { width: 32.4cqh; left: 50%; margin-left: -16.2cqh; top: 3%; opacity: .92; }           /* 1200 mm sweep */
.dr-led { width: 14.9cqh; right: 5%; top: 9%; }                                                   /* ~550 mm luminaire */
.dr-ac  { width: 25.6cqh; left: 50%; margin-left: -9cqh; bottom: 64%; }                            /* ~950 mm indoor unit, 2.1 m up */
.dr-wh  { width: 21.6cqh; right: 3%; bottom: 47%; }                                               /* 80 L horizontal, ~800 mm, 1.5 m up */
.dr-hp  { height: 51.3cqh; width: auto; left: 3%; bottom: 6%; z-index: 1; }                        /* 200–300 L floor unit, ~1.9 m */
.dr-df  { width: 29.7cqh; left: 50%; margin-left: -17cqh; bottom: 5.5%; z-index: 1; }              /* hard top ~1.1 m wide, lid open */
.dr-wd  { height: 28.4cqh; width: auto; right: 4%; bottom: 6%; z-index: 1; }                       /* floor dispenser ~1.05 m */
.dr-ar  { height: 14.9cqh; width: auto; left: 50%; margin-left: 4cqh; bottom: 3.5%; z-index: 3; }  /* Arctiq 42 L ~0.55 m */
.door-scale { position: absolute; left: 50%; bottom: 1%; transform: translateX(-50%); font: 600 9px/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: rgba(211, 218, 234, .55); white-space: nowrap; z-index: 4; }
.door-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 22%; background: radial-gradient(60% 70% at 50% 100%, rgba(154, 214, 255, .22), transparent 70%); }
.door-hint { font: 600 var(--text-xs)/1.4 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--steel-300); text-align: center; }

/* ---------- HUD ---------- */
.rooms-hud { position: absolute; left: 50%; bottom: var(--space-6); transform: translateX(-50%); display: flex; align-items: center; gap: var(--space-4); white-space: nowrap; z-index: 4;
  font: 600 var(--text-xs)/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--steel-300);
  opacity: 0; visibility: hidden; transition: opacity var(--dur-slow) var(--ease-out), visibility 0s linear var(--dur-slow); }
.in-rooms .rooms-hud { opacity: 1; visibility: visible; transition: opacity var(--dur-slow) var(--ease-out); }
.rooms-hud b { color: var(--white); font-variant-numeric: tabular-nums; }
.rooms-hud b[data-room-name] { color: var(--room-accent, var(--white)); margin-left: var(--space-2); }
.hud-of { color: var(--steel-400); }
.rooms-holds { text-transform: none; letter-spacing: .01em; font-weight: 500; color: var(--steel-200); font-size: var(--text-sm); }
.rooms-hud ol { display: flex; list-style: none; margin: 0; padding: 0; }
.rooms-hud button { width: 36px; height: var(--tap); padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.rooms-hud button i { display: block; width: 26px; height: 3px; border-radius: 2px; background: color-mix(in oklab, var(--steel-300) 30%, transparent); transition: background-color var(--dur) var(--ease-out), width var(--dur) var(--ease-out); }
.rooms-hud button:hover i { background: var(--steel-200); }
.rooms-hud button:focus-visible { outline: 2px solid var(--blue-300); outline-offset: -6px; }
.rooms-hud li.done i { background: var(--steel-200); }
.rooms-hud li.on i { background: var(--room-accent, var(--amber)); width: 32px; }
.hud-skip { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--steel-300); text-decoration: underline; text-decoration-color: color-mix(in oklab, currentColor 40%, transparent); text-underline-offset: 4px; letter-spacing: .08em; }
.hud-skip:hover { color: var(--white); }

/* ---------- room cards: docked at one spot, one at a time ---------- */
.room-cards { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.room { position: absolute; top: 50%; left: var(--gutter); width: min(27rem, 36vw); transform: translate3d(0, calc(-50% + 24px), 0); opacity: 0; visibility: hidden;
  transition: opacity 280ms var(--ease-out), transform 280ms var(--ease-out), visibility 0s linear 280ms; }
.room.right { left: auto; right: var(--gutter); }
.room.is-current { opacity: 1; visibility: visible; transform: translate3d(0, -50%, 0); pointer-events: auto;
  transition: opacity 520ms var(--ease-out) 60ms, transform 720ms var(--ease-out) 60ms; }
.room-card { padding: var(--space-8); border-radius: var(--radius-sm); background: color-mix(in oklab, #0a0f1c 72%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid color-mix(in oklab, var(--room, var(--ice)) 30%, transparent); }
.room-card.cold { --room: var(--ice); } .room-card.cool { --room: #7fd8d2; } .room-card.hot { --room: var(--amber); } .room-card.air { --room: #e9edf5; } .room-card.trade { --room: var(--blue-300); }
.room-num { font: 600 var(--text-xs)/1.4 var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--room); }
.room h2 { font-size: var(--text-4xl); line-height: 1.04; letter-spacing: -.035em; margin: var(--space-3) 0 var(--space-4); text-wrap: balance; }
.room p { color: var(--steel-200); text-wrap: pretty; }
.room-facts { display: grid; gap: var(--space-3); margin: var(--space-6) 0 var(--space-4); }
.room-facts div { display: flex; justify-content: space-between; gap: var(--space-4); border-top: 1px solid var(--line); padding-top: var(--space-3); }
.room-facts dt { font-size: var(--text-sm); color: var(--steel-300); }
.room-facts dd { margin: 0; font-weight: 600; font-size: var(--text-sm); text-align: right; font-variant-numeric: tabular-nums; }
/* staggered entrance inside the current card */
.room.is-current .room-card > * { animation: card-in 640ms var(--ease-out) both; }
.room.is-current .room-card > :nth-child(2) { animation-delay: 70ms; } .room.is-current .room-card > :nth-child(3) { animation-delay: 130ms; }
.room.is-current .room-card > :nth-child(4) { animation-delay: 180ms; } .room.is-current .room-card > :nth-child(5) { animation-delay: 220ms; }
@keyframes card-in { from { transform: translate3d(0, 14px, 0); } to { transform: none; } }

/* no WebGL / no JS: the rooms become a plain stacked list — nothing is lost */
html:not(.js-gl) .rooms-world .rooms-stage { position: relative; height: auto; overflow: visible; }
html:not(.js-gl) .rooms-world .rooms-canvas, html:not(.js-gl) .rooms-world .room-step, html:not(.js-gl) .rooms-world .rooms-hud { display: none; }
html:not(.js-gl) .rooms-world .room-cards { position: relative; display: grid; gap: var(--space-6); padding: var(--space-12) var(--gutter) var(--sec); pointer-events: auto; }
html:not(.js-gl) .rooms-world .room { position: relative; inset: auto; width: auto; max-width: 34rem; transform: none; opacity: 1; visibility: visible; }
html:not(.js-gl) .rooms-world .room.right { margin-left: auto; }

/* ---------- end ---------- */
.room-index { list-style: none; margin: 0 0 var(--space-8); padding: 0; display: grid; width: 100%; }
.room-index a { display: grid; grid-template-columns: 3rem 1fr; align-items: baseline; gap: 0 var(--space-4); min-height: 64px; padding: var(--space-4) 0; border-top: 1px solid var(--line); text-decoration: none; font: 500 var(--text-2xl)/1.1 var(--font-display); letter-spacing: -.02em; transition: color var(--dur) var(--ease-out), padding-left var(--dur) var(--ease-out); }
.room-index li:last-child a { border-bottom: 1px solid var(--line); }
.room-index a:hover { color: var(--amber); padding-left: var(--space-2); }
.room-index span { font: 600 var(--text-xs)/1 var(--font-body); letter-spacing: .14em; color: var(--steel-300); }
.room-index em { grid-column: 2; font: 400 var(--text-sm)/1.4 var(--font-body); color: var(--steel-300); font-style: normal; }
body[data-dir="rooms"] .end { background: #0a0f1c; }
body[data-dir="rooms"] .end-rooms { display: grid; justify-items: start; gap: var(--space-4); }
body[data-dir="rooms"] .end h2 { font-size: clamp(2.5rem, 1rem + 5vw, 5.5rem); color: var(--white); }
body[data-dir="rooms"] .business { background: #0a0f1c; }

/* ---------- tablet landscape / small laptop ---------- */
@media (max-width: 1100px) and (min-aspect-ratio: 9/10) {
  .door-grid { grid-template-columns: 1fr minmax(280px, 400px); gap: var(--space-10); }
  .room { width: min(24rem, 40vw); }
  .room-card { padding: var(--space-6); }
  .room h2 { font-size: var(--text-3xl); }
  .rooms-holds { display: none; }
}

/* ---------- PORTRAIT: phones and upright tablets — designed first ---------- */
@media (max-aspect-ratio: 9/10) {
  .rooms-world { --nav-h: 64px; }
  .door-hero { align-items: stretch; height: 100vh; height: 100svh; min-height: 560px; padding: calc(var(--nav-h) + var(--space-4)) 0 calc(var(--space-6) + env(safe-area-inset-bottom, 0px)); }
  .door-grid { display: flex; flex-direction: column; gap: var(--space-5); height: 100%; }
  .door-hero .hero-h { font-size: clamp(2.5rem, 1.2rem + 6.4vw, 4.6rem); margin: var(--space-3) 0 var(--space-3); max-width: 12ch; }
  .door-hero .lede { font-size: var(--text-base); line-height: 1.5; margin: 0; max-width: 40ch; }
  .door-hero .row-cta { margin-top: var(--space-4); gap: var(--space-4); flex-wrap: nowrap; }
  .door-hero .row-cta .btn { padding: 0 var(--space-5); }
  .door { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; gap: var(--space-3); width: 100%; }
  .door-glass { height: 100%; width: auto; max-width: 100%; aspect-ratio: 4 / 5; outline-offset: 7px; }
  .door-hint { font-size: 0.6875rem; }

  .rooms-hud { top: calc(var(--nav-h) + var(--space-1)); bottom: auto; left: var(--space-4); right: var(--space-4); transform: none; justify-content: space-between; gap: var(--space-2); }
  .rooms-holds { display: none; }
  .rooms-hud button { width: 30px; }
  .rooms-hud button i { width: 20px; }
  .rooms-hud li.on i { width: 26px; }
  .hud-skip { font-size: 0.6875rem; }
  .hud-of { display: none; }
  .rooms-hud b[data-room-name] { margin-left: var(--space-1); }

  /* the card becomes a bottom sheet of text on a scrim: no box, the scene keeps the screen */
  .room { top: auto; bottom: 0; left: 0; right: 0; width: auto; transform: translate3d(0, 24px, 0); }
  .room.right { right: 0; }
  .room.is-current { transform: none; }
  .room-card { border: 0; border-radius: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
    padding: var(--space-16) var(--gutter) calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, transparent 0%, #0a0f1cd9 22%, #0a0f1c 58%); }
  .room h2 { font-size: clamp(1.75rem, 1rem + 4vw, 2.6rem); margin: var(--space-2) 0 var(--space-2); }
  .room p { font-size: var(--text-sm); line-height: 1.5; max-width: 46ch; }
  .room-facts { grid-template-columns: 1fr 1fr; gap: var(--space-4); margin: var(--space-4) 0 var(--space-1); }
  .room-facts div { display: grid; gap: 2px; justify-content: start; padding-top: var(--space-2); }
  .room-facts dt { font-size: var(--text-xs); }
  .room-facts dd { text-align: left; font-size: var(--text-sm); }
}
@media (max-width: 420px) { .hud-long { display: none; } }
@media (max-aspect-ratio: 9/10) and (max-height: 700px) {
  .door-hero .hero-h { font-size: 2.25rem; }
  .lede-long { display: none; }
  .room p:not(.room-num) { display: none; }
}
@media (max-aspect-ratio: 9/10) and (min-width: 700px) {
  .room-card { padding-inline: var(--space-12); }
  .room-facts { max-width: 36rem; }
  .rooms-hud { left: var(--space-12); right: var(--space-12); }
}

@media (prefers-reduced-motion: reduce) {
  .room, .room.is-current { transition-duration: 1ms; }
  .room.is-current .room-card > * { animation: none; }
}

/* the sticky thumb CTA never covers a room card */
body.in-rooms .thumb-cta { transform: translateY(140%); }

/* inside the rooms the nav floats on a soft fade, never a dark bar across the scene */
body.in-rooms .nav.fx-scrolled { background-color: transparent !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
body.in-rooms .nav::before { content: ""; position: absolute; inset: 0 0 -24px; z-index: -1; pointer-events: none; background: linear-gradient(180deg, #0a0f1cb8 0%, #0a0f1c66 55%, transparent 100%); }

/* ---------- loading screen: the Techmark logo fills with its own colours as the page loads, then two doors open ----------
   One continuous gradient across both doors (background-size 200%), so there is no seam where they meet. */
.preload { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; pointer-events: auto; }
.pl-door { position: absolute; top: 0; bottom: 0; width: 50.5%; background: radial-gradient(70% 60% at 50% 50%, #12233f 0%, #0a0f1c 72%); background-size: 198% 100%; transition: transform 1000ms cubic-bezier(.77, 0, .18, 1); }
.pl-l { left: 0; background-position: 0 0; }
.pl-r { right: 0; background-position: 100% 0; }
.pl-core { position: relative; display: grid; justify-items: center; gap: var(--space-5); text-align: center; transition: opacity 360ms var(--ease-out), transform 600ms var(--ease-out); }
.pl-logo { position: relative; width: min(280px, 68vw); aspect-ratio: 5 / 1; }
.pl-logo img { position: absolute; inset: 0; width: 100%; height: 100%; }
.pl-logo-base { filter: grayscale(1) brightness(.5); opacity: .45; }
/* the colour rises from the bottom of the logo like a level gauge: 100 % = the real white, green and red */
.pl-logo-fill { clip-path: inset(calc((1 - var(--fill)) * 100%) 0 0 0); }
.pl-n { font: 300 clamp(2.4rem, 1.6rem + 3vw, 3.4rem)/1 "Fraunces", Georgia, serif; letter-spacing: -.04em; color: var(--steel-200); font-variant-numeric: tabular-nums; min-width: 3.2ch; }
.pl-n small { font-size: .42em; letter-spacing: 0; color: var(--steel-400); margin-left: .1em; vertical-align: .7em; }
.pl-line { font: 600 var(--text-xs)/1.4 var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--steel-300); }
.pl-done { pointer-events: none; }
.pl-done .pl-core { opacity: 0; transform: scale(.96); }
.pl-done .pl-l { transform: translate3d(-101%, 0, 0); }
.pl-done .pl-r { transform: translate3d(101%, 0, 0); }
.pl-quick .pl-core { display: none; }
.pl-quick.pl-done .pl-door { transition-duration: 600ms; }
html.pl-lock, html.pl-lock body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .pl-door { transition: opacity 300ms linear; } .pl-done .pl-l, .pl-done .pl-r { transform: none; opacity: 0; } }

/* v7: the current room's dash fills while its products take their turn at the front */
.rooms-hud li.on i { background: linear-gradient(90deg, var(--room-accent, #9ad6ff) calc(var(--tour, 1) * 100%), rgba(211, 218, 234, .28) 0) !important; }
