/* =====================================================================
   Cinematic layer for the homepage
   1) intro: gate (suit-up) -> iris -> draw one H -> ink -> signature -> album
   2) bridge typography
   3) studio room overlay (Three.js) + projects -> frame homography
   4) footer credits (room becomes a live picture on cream paper)
   Fonts/colours follow the existing paper sheet: Bricolage Grotesque for
   the name, Instrument Serif italic for quotes, JetBrains Mono for labels,
   ink #1c2419 on warm paper, highlighter #d6ff4a, red ink #d23a26.
   ===================================================================== */
:root {
  --ci-paper: #f7f5ef;
  --ci-paper-2: #fbf8f1;
  --ci-ink: #1c2419;
  --ci-mute: #5f6158;
  --ci-hi: #d6ff4a;
  --ci-red: #d23a26;
  --ci-serif: "Instrument Serif", Georgia, serif;
  --ci-name: "Bricolage Grotesque", "Inter Tight", Inter, sans-serif;
  --ci-mono: "JetBrains Mono", ui-monospace, monospace;
  --ci-sans: "Inter Tight", Inter, system-ui, sans-serif;
}

/* ---------- 1. intro pin ---------- */
.ci-pin { position: relative; height: 400vh; background: var(--ci-paper); }
.ci-sticky {
  --card: 0; --leave: 0; --album: 0;
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  background: radial-gradient(ellipse 60% 55% at 50% 45%, #fdfbf6 0%, var(--ci-paper) 70%);
  color: var(--ci-ink);
}
.ci-stage { position: absolute; inset: 0; transform-origin: 50% 50%; will-change: transform; }
.ci-track { position: absolute; inset: 0; width: 400vw; will-change: transform; }
.ci-albg { position: absolute; left: 88vw; top: 50%; transform: translate3d(0,0,0); translate: 0 -50%; display: flex; align-items: baseline; gap: .32em; white-space: nowrap; pointer-events: none; will-change: transform;
  font: 400 min(30vh, 17vw)/1 var(--ci-serif); letter-spacing: -.02em; color: transparent; -webkit-text-stroke: 1px rgba(30,26,18,.13); }
.ci-albg em { font-style: italic; color: rgba(214,255,74,.16); -webkit-text-stroke: 1px rgba(120,140,40,.22); }
.ci-quote { position: absolute; left: 0; top: 0; width: 100vw; height: 100%; }
#qInner { position: absolute; inset: 0; transform-origin: 50% 48%; }
.ci-sign { position: absolute; inset: 0; }
.ci-name {
  position: absolute; left: 50%; top: 46%; margin: 0; transform: translate(-50%, -50%);
  font: 800 clamp(2.2rem, 5.6vw, 6.4rem)/1 var(--ci-name); letter-spacing: -0.055em; color: var(--ci-ink);
  white-space: nowrap;
}
.ci-name .sl { display: inline-block; overflow: hidden; vertical-align: top; padding: .08em .03em .04em; margin: 0 -.03em; }
.ci-name .si { display: inline-block; will-change: transform; }
.ci-name .sp { display: inline-block; width: .28em; }
.ci-name .slot { position: relative; display: inline-block; vertical-align: top; }
.ci-name .slot-h { opacity: 0; }
.ci-name .under { position: absolute; left: 12%; right: 12%; bottom: .1em; height: .05em; background: #a59f90; transform: scaleX(0); transform-origin: center; }
.ci-hint {
  position: absolute; left: 50%; top: 80%; margin: 0; transform: translateX(-50%); opacity: 0; white-space: nowrap;
  font: 600 clamp(14px, 1.5vw, 22px)/1.2 var(--ci-mono); letter-spacing: .3em; text-transform: uppercase; color: rgba(28, 36, 25, .78);
}
.ci-esc {
  position: absolute; left: clamp(20px, 3vw, 56px); bottom: 3.6vh; z-index: 9; display: flex; align-items: center; gap: 8px;
  padding: 0; border: 0; background: none; cursor: pointer; opacity: 0;
  font: 500 10.5px var(--ci-mono); letter-spacing: .16em; text-transform: uppercase; color: #6f6d64;
}
.ci-esc kbd { font: inherit; border: 1px solid #cfc8b8; border-radius: 4px; padding: 2px 6px; background: rgba(255,255,255,.5); }
.ci-esc:hover { color: var(--ci-ink); }
.ci-q {
  position: absolute; left: 50%; top: 22.5%; margin: 0; transform: translateX(-50%); width: max-content; max-width: 92vw; text-align: center;
  font: italic 400 clamp(1.7rem, 3.1vw, 3.6rem)/1.12 var(--ci-serif); color: #4f5248; letter-spacing: -.005em;
}
.ci-q .qw { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .04em .08em; margin: 0 -.04em; }
.ci-q .qi { display: inline-block; will-change: transform, filter; }
.ci-q mark { background: linear-gradient(var(--ci-hi), var(--ci-hi)) no-repeat 0 84% / 0% 86%; color: var(--ci-ink); padding: 0; border-radius: 3px; }
.ci-q mark .qw { padding-left: .1em; padding-right: .1em; margin: 0; }
#sigSvg { position: absolute; left: 50%; top: 37.5%; width: min(33vw, 640px); transform: translateX(-50%); overflow: visible; }
#sigSvg .sgp { stroke-dasharray: 2000; stroke-dashoffset: 2000; }
.ci-cue {
  position: absolute; left: 50%; bottom: 6.5vh; transform: translateX(-50%); opacity: 0; text-align: center; white-space: nowrap;
  font: 500 10px var(--ci-mono); letter-spacing: .32em; text-transform: uppercase; color: #555a50;
}
.ci-cue i { display: block; width: 1px; height: 38px; margin: 14px auto 0; background: #7b7d72; transform-origin: top; }
.ci-pol {
  position: absolute; width: 26.6vw; margin: 0; padding: .75vw .75vw 3.1vw; background: #fffcf6; border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 14px 34px -14px rgba(60,50,30,.28), inset 0 0 0 1px rgba(28,36,25,.05); will-change: transform;
}
.ci-pol img { display: block; width: 100%; aspect-ratio: 604/760; object-fit: cover; }
.ci-pol figcaption { position: absolute; left: .85vw; bottom: 1.05vw; font: 500 .58vw var(--ci-mono); letter-spacing: .2em; text-transform: uppercase; color: #333; }
.ci-sparks i { position: absolute; width: 6px; height: 6px; pointer-events: none; }
.ci-sparks i::before, .ci-sparks i::after { content: ""; position: absolute; left: 50%; top: 50%; background: #fff; transform: translate(-50%,-50%); box-shadow: 0 0 6px 1px rgba(255,255,255,.9); }
.ci-sparks i::before { width: 1px; height: 6px; } .ci-sparks i::after { width: 6px; height: 1px; }
#ink, #fx { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
#ink { z-index: 6; transform-origin: 0 0; } #fx { z-index: 7; }
.ci-pad { position: absolute; inset: 0; z-index: 8; display: none; touch-action: none; cursor: none; }
.ci-sticky.is-signing .ci-pad { display: block; }
.ci-iris { position: absolute; left: 50%; top: 50%; width: 0; height: 0; border-radius: 50%; border: 1px solid rgba(24,22,18,.38); transform: translate(-50%,-50%); z-index: 21; pointer-events: none; opacity: 0; box-shadow: 0 0 40px rgba(24,22,18,.06); }
.ci-ripple { position: absolute; left: 0; top: 0; width: 200px; height: 200px; margin: -100px 0 0 -100px; border-radius: 50%; border: 1px solid rgba(26,25,22,.55); transform: scale(0); opacity: 0; z-index: 8; pointer-events: none; }
.ci-ripple.r2 { border-color: rgba(190,150,70,.6); }
.ci-pen { position: absolute; left: 0; top: 0; z-index: 30; width: 291px; pointer-events: none; transform-origin: 2.2px 2px; opacity: 0; will-change: transform; }

/* the existing gate sits on top and is opened by an ink drop that bleeds outward from the face */
.ci-sticky #gate {
  --r: 0px; --f: 14px; --cx: 50%; --cy: 50%; z-index: 20; background: var(--ci-paper);
  -webkit-mask-image: radial-gradient(circle at var(--cx) var(--cy), transparent calc(var(--r) - var(--f)), #000 var(--r));
  mask-image: radial-gradient(circle at var(--cx) var(--cy), transparent calc(var(--r) - var(--f)), #000 var(--r));
}
.ci-sticky #gate .gate-stage { z-index: 1; will-change: transform, filter; }
.ci-sticky #gate .gate-lines { z-index: 0; will-change: transform; }

/* hero: centred bust on the bottom edge, a small editorial name block on the left, "the other side" on the right */
.ci-sticky #gate .gate-still, .ci-sticky #gate .gate-fx {
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 84%, rgba(0,0,0,.5) 93%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 84%, rgba(0,0,0,.5) 93%, transparent 100%);
}
.ci-sticky #gate .gate-mark {
  left: clamp(20px, 5.2vw, 100px); top: 50%; bottom: auto; transform: translateY(-50%); z-index: 2;
  font: 800 clamp(26px, min(3.5vw, 6.4vh), 68px)/.92 var(--ci-name); letter-spacing: -.045em; color: #16140f; text-align: left;
}
.ci-sticky #gate .gate-mark span { display: block; will-change: transform; }
.ci-sticky #gate .gate-mark::before {
  content: "Full-stack engineer\A Ho Chi Minh City"; display: block; margin: 0 0 1.5em .06em; white-space: pre;
  font: 500 max(9px, min(.19em, 11px))/1.7 var(--ci-mono); letter-spacing: .24em; text-transform: uppercase; color: rgba(22,20,15,.58);
}
.ci-sticky #gate .gate-mark::after {
  content: ""; display: block; width: 1.5em; height: 2px; margin: .6em 0 0 .04em; background: var(--ci-red); transform-origin: 0 50%;
}
.ci-sticky #gate .gate-hint { left: clamp(20px, 5.2vw, 100px); translate: none; bottom: clamp(16px, 4vh, 40px); }
.ci-sticky #gate .gate-space { top: 50%; transform: translateY(-50%); right: clamp(20px, 5.2vw, 100px); left: auto; align-items: flex-end; z-index: 3; }
/* light leak + ink rim of the transition */
.ci-glow { position: absolute; inset: 0; z-index: 22; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at var(--cx, 50%) var(--cy, 50%), rgba(255,252,244,.98) 0, rgba(255,247,232,.72) 14%, rgba(255,240,215,.28) 34%, rgba(255,240,215,0) 62%); mix-blend-mode: screen; }
.ci-irisink { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 23; pointer-events: none; }
@media (max-width: 719px), (max-aspect-ratio: 21/20) {
  .ci-sticky #gate .gate-mark { top: calc(var(--header-h, 84px) + 14px); transform: none; font-size: clamp(26px, 8.4vw, 60px); }
  .ci-sticky #gate .gate-mark::before { margin-bottom: 1em; }
  .ci-sticky #gate .gate-space { display: none; }
  .ci-sticky #gate .gate-hint { display: none; }
}

.ci-scroll {
  position: absolute; right: clamp(20px, 4vw, 56px); bottom: 22px; z-index: 22; margin: 0; display: flex; flex-direction: column; align-items: flex-end;
  font: 500 10px/1.7 var(--ci-mono); letter-spacing: .2em; text-transform: uppercase; color: rgba(22,20,15,.55); pointer-events: none;
}
.ci-scroll i { display: block; width: 1px; height: 26px; margin-top: 8px; background: rgba(22,20,15,.4); transform-origin: top; animation: ci-cue 2.4s ease-in-out infinite; }
@keyframes ci-cue { 0%,100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

/* ---------- 2. bridge ---------- */
.ci-drift { position: relative; z-index: 1; height: 300vh; background: var(--ci-paper); }
.ci-dstage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--ci-paper); }
.ci-dpaper { position: absolute; inset: 0; will-change: transform; }
.ci-guide { position: absolute; left: 50%; top: 74%; width: 1px; height: 26%; background: var(--ci-ink); opacity: .5; transform-origin: top; transform: scaleY(0); }
.ci-bridge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: max-content; max-width: 92vw; text-align: center; }
.ci-kick { margin: 0 0 26px; font: 500 10px var(--ci-mono); letter-spacing: .24em; text-transform: uppercase; color: #77756c; }
.ci-bridge h3 { margin: 0; font: italic 400 clamp(2rem, min(4.1vw, 8.4vh), 4.8rem)/1.08 var(--ci-serif); color: #43463e; letter-spacing: -.01em; }
.ci-bridge h3 .w { display: inline-block; opacity: .12; }
.ci-bridge mark { background: linear-gradient(var(--ci-hi), var(--ci-hi)) no-repeat 0 84% / 0% 86%; color: inherit; padding: 0 .1em; border-radius: 3px; }
/* the night behind the highlight */
.ci-dark { position: absolute; inset: 0; z-index: 3; visibility: hidden; overflow: hidden; pointer-events: none; color: #f2efe8;
  background: radial-gradient(120% 80% at 50% 120%, #10142c 0, #070812 38%, #060606 70%); }
.ci-dark.is-on { visibility: visible; }
.ci-dark.is-open { pointer-events: auto; }
.ci-dstars { position: absolute; inset: -10%; will-change: transform; }
.ci-dstars--far { opacity: .55; background:
  radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 38% 62%, #fff 50%, transparent 51%),
  radial-gradient(1px 1px at 71% 27%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 86% 74%, #fff 50%, transparent 51%),
  radial-gradient(1px 1px at 55% 88%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 22% 81%, #fff 50%, transparent 51%);
  background-size: 260px 260px; }
.ci-dstars--near { opacity: .8; background:
  radial-gradient(1.6px 1.6px at 18% 34%, #fff 50%, transparent 51%), radial-gradient(1.4px 1.4px at 64% 12%, #dfe6ff 50%, transparent 51%),
  radial-gradient(1.8px 1.8px at 82% 58%, #fff 50%, transparent 51%), radial-gradient(1.2px 1.2px at 42% 84%, #fff 50%, transparent 51%);
  background-size: 430px 430px; }
.ci-dglow { position: absolute; left: 50%; top: 50%; width: min(1300px, 110vw); height: 80vh; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(64,72,220,.22), rgba(40,40,140,.08) 55%, transparent); opacity: 0; }
.ci-dring { position: absolute; left: 0; top: 0; z-index: 4; border-radius: 50%; pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 2px var(--ci-hi), 0 0 30px 6px rgba(214,255,74,.45), inset 0 0 40px 8px rgba(214,255,74,.25); }
.ci-phead { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(1100px, 88vw); text-align: center; }
.ci-phead__kick { display: flex; justify-content: center; gap: 1.6em; margin: 0 0 clamp(14px, 3.2vh, 34px); font: 500 clamp(9px, .72vw, 12px)/1 var(--ci-mono); letter-spacing: .28em; text-transform: uppercase; color: rgba(242,239,232,.62); }
.ci-phead__kick span { display: inline-block; opacity: 0; }
.ci-phead__kick span:first-child { color: var(--ci-hi); }
.ci-phead__h { margin: 0; font: 800 clamp(28px, min(5.6vw, 10.5vh), 104px)/.98 var(--ci-name); letter-spacing: -.045em; }
.ci-phead__h .ln { display: block; overflow: hidden; padding: .04em 0 .08em; }
.ci-phead__h .ln > span { display: inline-block; transform: translateY(110%); will-change: transform;
  /* light sweep through the letters */
  background: linear-gradient(100deg, #e9e5dc 0 40%, #fff 47%, #f6ffd6 50%, #fff 53%, #e9e5dc 60% 100%) var(--sweep, 0%) 0 / 300% 100% no-repeat;
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.ci-phead__h .ln:nth-child(2) > span { font-family: var(--ci-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.ci-phead__p { max-width: 36em; margin: clamp(10px, 2.4vh, 26px) auto 0; font: 400 clamp(13px, min(1.15vw, 2.6vh), 19px)/1.5 var(--sans-tight, "Inter Tight", Inter, sans-serif); color: rgba(242,239,232,.7); opacity: 0; }
.ci-phead__meta { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .9em 1.2em; margin: clamp(12px, 3vh, 34px) 0 0; font: 500 clamp(9px, .7vw, 11px)/1 var(--ci-mono); letter-spacing: .22em; text-transform: uppercase; color: rgba(242,239,232,.55); opacity: 0; }
.ci-phead__meta i { width: 22px; height: 1px; background: rgba(242,239,232,.3); }
.ci-phead__meta a { color: #f2efe8; text-decoration: none; border-bottom: 1px solid rgba(214,255,74,.7); padding-bottom: 3px; }
.ci-dcue { position: absolute; left: 50%; bottom: clamp(14px, 4vh, 40px); transform: translateX(-50%); margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px;
  font: 500 9px/1 var(--ci-mono); letter-spacing: .3em; text-transform: uppercase; color: rgba(242,239,232,.5); opacity: 0; }
.ci-dcue i { width: 1px; height: 30px; background: linear-gradient(rgba(242,239,232,.6), transparent); }
.ci-mini { position: absolute; width: min(15vw, 26vh); will-change: transform, filter; margin: 0; padding: .5vw .5vw 1.9vw; background: #fffcf6; box-shadow: 0 18px 40px -18px rgba(60,50,30,.35); }
.ci-mini img { display: block; width: 100%; aspect-ratio: 604/760; object-fit: cover; }
.ci-mini figcaption { position: absolute; left: .6vw; bottom: .6vw; font: 500 .48vw var(--ci-mono); letter-spacing: .2em; text-transform: uppercase; color: #333; }
.ci-mini.is-soft { filter: blur(1.2px); } .ci-mini.is-softer { filter: blur(1.6px); }

/* hand-off is plain document flow (no scroll-driven transforms): the sheet and everything on it scroll in together,
   and the section is exactly one viewport tall at every size so nothing is clipped below the fold before it pins */
html.cine #projects.ph-work { min-height: 0; height: 100vh; height: 100svh; }
html.cine #projects .ph-sticky { min-height: 0; }
/* the HUD is position:fixed upstream, which made it float over the half-entered sheet; pin it to the section instead */
html.cine #projects .work-hud { position: absolute; }
/* the title already developed in the pinned bridge stage, so the deck simply follows it, dark on dark */
html.cine #projects { margin-top: 0; }
html.cine #projects:not(.is-framed) .ph-sticky::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 11vh; z-index: 1; pointer-events: none; background: linear-gradient(#060606, rgba(6,6,6,0)); }

/* static fallback (recruiter mode / reduced) */
.ci-pin.is-static { height: auto; }
.ci-pin.is-static .ci-sticky { position: relative; height: auto; min-height: 100svh; overflow: visible; display: flex; flex-direction: column; }
.ci-pin.is-static #gate { position: relative; height: 100svh; -webkit-mask-image: none; mask-image: none; }
.ci-pin.is-static .ci-albg { display: none; }
.ci-pin.is-static .ci-stage, .ci-pin.is-static .ci-track { position: relative; width: auto; transform: none !important; }
.ci-pin.is-static .ci-quote { position: relative; width: 100%; height: 72vh; }
.ci-pin.is-static .ci-sign, .ci-pin.is-static #ink, .ci-pin.is-static #fx, .ci-pin.is-static .ci-cue, .ci-pin.is-static .ci-scroll, .ci-pin.is-static .ci-pen, .ci-pin.is-static .ci-sparks { display: none; }
.ci-pin.is-static #sigSvg .sgp { stroke-dashoffset: 0 !important; }
.ci-pin.is-static .ci-q mark { background-size: 100% 86%; }
.ci-pin.is-static .ci-pols { position: relative; display: flex; gap: 3vw; padding: 0 4vw 8vh; overflow-x: auto; }
.ci-pin.is-static .ci-pol { position: relative; left: auto !important; top: auto !important; flex: none; width: min(320px, 70vw); transform: none !important; padding: 10px 10px 34px; }
.ci-pin.is-static .ci-pol figcaption { left: 12px; bottom: 12px; font-size: 9px; }
.ci-drift.is-static { height: auto; padding: 0; }
.ci-drift.is-static .ci-dstage { position: relative; height: auto; overflow: visible; }
.ci-drift.is-static .ci-dpaper { position: relative; padding: 18vh 0; }
.ci-drift.is-static .ci-dark { position: relative; visibility: visible; pointer-events: auto; padding: 16vh 0 12vh; }
.ci-drift.is-static .ci-phead { position: relative; left: auto; top: auto; transform: none; margin: 0 auto; }
.ci-drift.is-static .ci-phead__kick span, .ci-drift.is-static .ci-phead__p, .ci-drift.is-static .ci-phead__meta { opacity: 1; }
.ci-drift.is-static .ci-phead__h .ln > span { transform: none; }
.ci-drift.is-static .ci-dcue, .ci-drift.is-static .ci-dring { display: none; }
.ci-drift.is-static .ci-mini, .ci-drift.is-static .ci-guide { display: none; }
.ci-drift.is-static .ci-bridge { position: relative; top: 0; left: 0; transform: none; margin: 0 auto; }
.ci-drift.is-static .ci-bridge h3 .w { opacity: 1; }
.ci-drift.is-static .ci-bridge mark { background-size: 100% 86%; }

@media (max-width: 760px) {
  .ci-pol { width: 62vw; padding: 2vw 2vw 8vw; }
  .ci-pol figcaption { font-size: 2vw; left: 2.4vw; bottom: 2.6vw; }
  #sigSvg { width: 76vw; top: 36%; }
  .ci-q { top: 20%; }
  .ci-mini { width: 30vw !important; }
  .ci-mini figcaption { display: none; }
  .ci-name { font-size: 11vw; }
}

/* ---------- 3. studio room ---------- */
/* while the deck is being projected into the wall frame it escapes its box and sits above the room */
#projects.ph-work.is-framed { overflow: visible; z-index: 45; background: transparent; border-radius: 0; box-shadow: none; }
#projects.is-framed .ph-sticky { transform-origin: 0 0; will-change: transform; backface-visibility: hidden; }
#projects.is-shrunk { pointer-events: none; }
#projects.is-shrunk .ph-sticky { box-shadow: 0 0 0 1px rgba(255,255,255,.04); }

.cs-room { position: relative; z-index: 1; background: #07080d; min-height: 0; }
html.cine-room .cs-room .cs-fallback { display: none; }
html.cine-static .cs-room, html:not(.cine-room) .cs-room { min-height: 0; padding: clamp(56px, 10vh, 120px) clamp(16px, 4vw, 64px); background: var(--ci-paper); }
html.cine-static .cs-room .cs-fallback, html:not(.cine-room) .cs-room .cs-fallback { position: relative; inset: auto; display: grid; max-width: 1080px; margin: 0 auto; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cs-fallback .studio-mobile-card { min-height: 160px; padding: 22px 20px; text-decoration: none; }
.cs-fallback .studio-mobile-card__title { font: 560 clamp(1.4rem, 2.4vw, 2rem)/1 var(--ci-name); letter-spacing: -.03em; }
.cs-fallback .studio-mobile-card__cta { font: 600 11px var(--ci-mono); letter-spacing: .14em; }

#roomStage { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; z-index: 40; visibility: hidden; overflow: hidden; transform-origin: 0 0; background: #050409; will-change: transform; contain: layout paint; pointer-events: none; }
#roomStage.is-hover { cursor: pointer; }
#roomCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#roomVig { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 75% 70% at 50% 48%, rgba(0,0,0,0) 55%, rgba(0,0,0,.55) 100%); }
#roomStage .arch-lbl { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; opacity: 0; color: #f3f1ea; white-space: nowrap; }
#roomStage .arch-lbl .tt { font: 560 22px var(--ci-name); letter-spacing: -.02em; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
#roomStage .arch-lbl .bt { position: absolute; left: 0; top: 0; font: 700 13px var(--ci-mono); letter-spacing: .1em; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.cs-pills { position: absolute; left: clamp(16px, 2vw, 32px); bottom: clamp(16px, 3vh, 32px); display: flex; gap: 10px; opacity: 0; z-index: 3; }
.cs-pill { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 18px; border-radius: 22px; background: rgba(14,12,20,.72); border: 1px solid rgba(255,255,255,.1); font: 600 11px var(--ci-mono); letter-spacing: .14em; text-transform: uppercase; color: #ece9f5; text-decoration: none; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background .25s, border-color .25s, transform .25s; }
.cs-pill:hover, .cs-pill:focus-visible { background: rgba(30,26,40,.9); border-color: rgba(255,255,255,.28); transform: translateY(-1px); }
.cs-pill i { width: 9px; height: 9px; border-radius: 50%; }
.room-hint { position: absolute; right: clamp(16px, 2vw, 32px); bottom: clamp(22px, 3.4vh, 38px); font: 500 10px var(--ci-mono); letter-spacing: .2em; text-transform: uppercase; color: rgba(236,233,245,.7); opacity: 0; pointer-events: none; }
.room-chip { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px 0 18px; border-radius: 22px; background: rgba(16,14,22,.9); border: 1px solid rgba(255,255,255,.14); box-shadow: 0 10px 30px -8px rgba(0,0,0,.6); color: #fff; font: 500 14px var(--ci-sans); white-space: nowrap; pointer-events: none; opacity: 0; transform-origin: 0 0; }
.room-chip i { font-style: normal; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #d6ff4a; color: #141414; font-size: 12px; }
.room-chip i::before { content: attr(data-i); }
.room-chip[data-arch="0"] i { background: #e8c46a; } .room-chip[data-arch="1"] i { background: #ff5a44; color: #fff; } .room-chip[data-arch="2"] i { background: #7ad8e6; }

/* ---------- 4. footer credits ---------- */
.cf { position: relative; z-index: 2; background: var(--ci-paper); color: #141414; font-family: var(--ci-sans); }
.cf-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: radial-gradient(ellipse 70% 60% at 50% 40%, #fbf9f4 0%, var(--ci-paper) 75%); }
.cf-specks { position: absolute; inset: 0; pointer-events: none; }
.cf-specks i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #b9b4a8; }
.cf-pic { position: absolute; left: 50%; top: 8.4vh; width: 15.6vw; aspect-ratio: 16 / 9; transform: translateX(-50%); }
.cf-mat { position: absolute; inset: -9px; background: #fff; border-radius: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 24px 50px -22px rgba(30,20,10,.45); opacity: 0; }
.cf-cap { position: absolute; left: 0; right: 0; top: calc(100% + 18px); display: flex; justify-content: space-between; font: 500 9px var(--ci-mono); letter-spacing: .18em; text-transform: uppercase; color: #77736a; opacity: 0; }
.cf-cap b { font-weight: 500; color: #141414; }
.cf-ask { position: static; }
.cf-head { position: absolute; left: 0; right: 0; top: 34vh; margin: 0; text-align: center; font: 560 clamp(2.5rem, 4.6vw, 6rem)/1.0 var(--ci-name); letter-spacing: -.045em; color: #16140f; }
.cf-head .fw { display: inline-block; overflow: hidden; vertical-align: top; padding: .04em .05em .12em; margin: -.04em -.05em -.12em; }
.cf-head .fi { display: inline-block; will-change: transform, filter; }
.cf-ink { position: absolute; left: 0; top: 0; pointer-events: none; }
.cf-cta { position: absolute; left: 0; right: 0; top: 56.5vh; display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; }
.cf-btn, .cf-talk { display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 24px; border-radius: 30px; font: 500 15px var(--ci-sans); letter-spacing: -.01em; cursor: pointer; transition: transform .25s, background .25s; }
.cf-btn { border: 0; background: #262626; color: #fff; }
.cf-btn i { width: 8px; height: 8px; border-radius: 50%; background: var(--ci-hi); box-shadow: 0 0 0 3px rgba(214,255,74,.22); }
.cf-talk { border: 1px solid #d9d4c8; background: #faf9f6; color: #16140f; }
.cf-btn:hover, .cf-talk:hover { transform: translateY(-2px); }
.cf-mail { margin-left: 20px; font: 400 15px var(--ci-sans); color: #6b6862; text-decoration: none; background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px; transition: background-size .35s; }
.cf-mail:hover { background-size: 100% 1px; color: #16140f; }
.cf-rule { position: absolute; left: 3.4vw; right: 3.4vw; height: 1px; background: #dcd8ce; transform-origin: 0 50%; }
#fRule1 { top: 67vh; } #fRule2 { bottom: 9.4vh; }
.cf-cols { position: absolute; left: 3.4vw; right: 3.4vw; top: 71.5vh; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3vw; }
.cf-col h6 { margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid #e3dfd5; font: 500 10px var(--ci-mono); letter-spacing: .2em; text-transform: uppercase; color: #77736a; }
.cf-col ul { list-style: none; margin: 0; padding: 0; }
.cf-col li { margin-bottom: 11px; font: 400 15px/1.1 var(--ci-sans); letter-spacing: -.01em; color: #191919; white-space: nowrap; }
.cf-col a { color: inherit; text-decoration: none; background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px; transition: background-size .3s, color .3s; }
.cf-col a:hover { background-size: 100% 1px; }
.cf-col a.is-here { color: #d23a26; }
.cf-note { margin: 4px 0 0; font: 400 11px/1.5 var(--ci-mono); letter-spacing: .04em; color: #77736a; }
.cf-dot { display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; background: #b6e62e; box-shadow: 0 0 0 3px rgba(182,230,46,.2); vertical-align: 1px; }
.cf-copy { position: absolute; left: 3.4vw; bottom: 3.2vh; margin: 0; font: 400 12px var(--ci-mono); letter-spacing: .06em; color: #4a4740; }
.cf-sig { position: absolute; right: 4.4vw; bottom: .4vh; width: 12.5vw; height: auto; overflow: visible; }
.cf-tag { position: absolute; right: calc(4.4vw + 12.5vw + 14px); bottom: 3.2vh; margin: 0; font: 400 11px var(--ci-mono); letter-spacing: .14em; text-transform: uppercase; color: #77736a; }

/* footer without the room (recruiter / reduced / no WebGL) and on narrow or short screens: normal flow */
html:not(.cine-room) .cf-sticky { position: relative; height: auto; min-height: 0; padding: 12vh 0 0; }
html:not(.cine-room) .cf-pic { display: none; }
html:not(.cine-room) .cf { height: auto !important; }
@media (max-width: 900px), (max-height: 640px) {
  .cf-sticky { display: flex; flex-direction: column; align-items: stretch; height: auto; min-height: 100svh; padding: 0 20px 24px; }
  .cf-pic { position: relative; left: auto; top: auto; transform: none; width: min(78vw, 420px); margin: 7vh auto 7vh; }
  .cf-head, .cf-cta, .cf-cols, .cf-rule, .cf-copy, .cf-sig, .cf-tag { position: relative; left: auto; right: auto; top: auto; bottom: auto; }
  .cf-head { font-size: clamp(2.3rem, 10vw, 3.4rem); }
  .cf-cta { margin: 28px 0 34px; }
  .cf-mail { margin: 8px 0 0; flex-basis: 100%; text-align: center; background: none; }
  .cf-cols { grid-template-columns: repeat(2, 1fr); gap: 26px 18px; margin: 26px 0; }
  .cf-col li { white-space: normal; }
  .cf-copy { margin-top: 18px; font-size: 11px; }
  .cf-tag { margin-top: 18px; }
  .cf-sig { width: 46vw; margin: -24px 0 0 auto; }
  .room-hint { display: none; }
  .cs-pills { left: 50%; transform: translateX(-50%); bottom: 18px; gap: 6px; }
  .cs-pill { height: 36px; padding: 0 12px; font-size: 10px; letter-spacing: .08em; }
  html.cine-static .cs-room .cs-fallback, html:not(.cine-room) .cs-room .cs-fallback { grid-template-columns: 1fr; }
}
html.in-room nav.chapters { opacity: 0; pointer-events: none; transition: opacity .3s; }
/* static footer on desktop (no room to pull back from): same parts, normal flow */
html:not(.cine-room) .cf-sticky { display: flex; flex-direction: column; padding: clamp(80px, 14vh, 160px) 3.4vw 28px; }
html:not(.cine-room) .cf-head, html:not(.cine-room) .cf-cta, html:not(.cine-room) .cf-cols, html:not(.cine-room) .cf-rule,
html:not(.cine-room) .cf-copy, html:not(.cine-room) .cf-sig, html:not(.cine-room) .cf-tag { position: relative; left: auto; right: auto; top: auto; bottom: auto; }
html:not(.cine-room) .cf-cta { margin: 36px 0 64px; }
html:not(.cine-room) .cf-cols { margin: 34px 0 40px; }
html:not(.cine-room) .cf-copy { margin-top: 22px; }
html:not(.cine-room) .cf-tag { align-self: flex-end; margin: -18px 15vw 0 0; }
html:not(.cine-room) .cf-sig { align-self: flex-end; margin-top: -40px; }
.ci-pin.is-static #gate { order: -1; }
.ci-pin.is-static .ci-glow, .ci-pin.is-static .ci-irisink { display: none; }

/* ---------- film layer: grain, vignette, letterbox (bars only during camera moves) ---------- */
.ci-film { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.ci-film__grain { position: absolute; inset: -60px; opacity: .055; background: url("./grain.png") repeat; background-size: 180px 180px; mix-blend-mode: overlay; animation: ci-grain .9s steps(6) infinite; }
html.dark .ci-film__grain, html.in-room .ci-film__grain { opacity: .07; }
.ci-film__vig { position: absolute; inset: 0; background: radial-gradient(130% 100% at 50% 50%, transparent 58%, rgba(10,8,4,.16) 100%); opacity: calc(.55 + var(--lb, 0) * .45); }
.ci-film__lb { position: absolute; left: 0; right: 0; height: min(7.5vh, 64px); background: #050505; transform: scaleY(var(--lb, 0)); will-change: transform; }
.ci-film__lb--t { top: 0; transform-origin: top; }
.ci-film__lb--b { bottom: 0; transform-origin: bottom; }
html:not(.is-letterbox) .ci-film__lb { visibility: hidden; }
@keyframes ci-grain { 0% { transform: translate(0,0); } 17% { transform: translate(-22px,14px); } 33% { transform: translate(18px,-26px); } 50% { transform: translate(-12px,-8px); } 67% { transform: translate(26px,20px); } 83% { transform: translate(-30px,6px); } 100% { transform: translate(0,0); } }
html.film-still .ci-film__grain { animation: none; }
html.film-still .ci-film__lb { display: none; }
@media (prefers-reduced-motion: reduce) { .ci-film__grain { animation: none; } }
@media print { .ci-film { display: none; } }
