/* ─── Fonts ──────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Digitechno';
  src: url('assets/fonts/Digitechno-FreeVersion.ttf') format('truetype');
  font-display: swap;
}

@font-face {
  font-family: 'Zen Dots';
  src: url('assets/fonts/ZenDots-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: normal;
  font-display: swap;
}

/* ─── Tokens ─────────────────────────────────────────────────────────────── */

:root {
  --bg-a:    #2a3546;
  --bg-b:    #1a212d;
  --bg-c:    #10151d;
  --surface: #141a24;
  --surface-lift: #161d28;

  --ink:     #F2F0EC;
  --muted:   #8893a0;
  --cold:    #6FA9B5;
  --warm:    #C49A63;
  --line:    rgba(242, 240, 236, 0.10);

  --display: 'Zen Dots', sans-serif;
  --util:    'Schibsted Grotesk', system-ui, sans-serif;
  --brand:   'Digitechno', var(--util);

  --ease-enter:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-std:    cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── Base ───────────────────────────────────────────────────────────────── */

html {
  /* No scroll-behavior: smooth — Lenis owns smoothing */
  -webkit-text-size-adjust: 100%;
}

body {
  background: linear-gradient(150deg, var(--bg-a), var(--bg-b) 48%, var(--bg-c));
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--util);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ─── Corner Brackets ────────────────────────────────────────────────────── */

.bracket {
  position: fixed;
  width: 34px;
  height: 34px;
  z-index: 100;
  opacity: 0.45;
  pointer-events: none;
}

.bracket--tl {
  top: 34px;
  left: 34px;
  border-top: 2px solid var(--ink);
  border-left: 2px solid var(--ink);
}

.bracket--br {
  bottom: 34px;
  right: 34px;
  border-bottom: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
}

/* ─── Hero ───────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  height: calc(var(--vh, 1vh) * 100);
  overflow: hidden;
  background: var(--bg-c);
  /* Sit above the room's 3D stacking context when pinned */
  z-index: 2;
}

/* Canvas */
#film {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
}

/* Gradient mask over canvas: left-side reading column + inner vignette */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      rgba(16, 21, 29, 0.82) 0%,
      rgba(16, 21, 29, 0.35) 38%,
      rgba(16, 21, 29, 0)    62%),
    radial-gradient(120% 90% at 50% 50%,
      rgba(16, 21, 29, 0)   55%,
      rgba(16, 21, 29, 0.6) 100%);
}

/* Text overlay */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
}

.hero-inner {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px;
}

.hero-col {
  max-width: 560px;
}

/* Wordmark */
.wordmark {
  font-family: var(--brand);
  font-size: clamp(26px, 3.4vw, 46px);
  letter-spacing: 0.24em;
  color: var(--ink);
  opacity: 0;
  line-height: 1;
}

/* Tighten tracking on small screens so "PLESSI DIGITAL" stays on one line */
@media (max-width: 420px) {
  .wordmark { letter-spacing: 0.10em; }
}

/* Loading bar (beneath wordmark, above h1) */
.load-bar {
  width: 100%;
  height: 1px;
  background: var(--line);
  margin: 24px 0 42px;
  position: relative;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.4s ease-out;
}

.load-fill {
  position: absolute;
  inset: 0 100% 0 0; /* width: 0 via inset shorthand trick */
  background: var(--cold);
  transition: right 0.25s ease-out;
}

/* h1 — Zen Dots: reduce raw size, positive tracking, more open line-height */
h1 {
  font-family: var(--display);
  font-style: normal;
  font-size: clamp(34px, 5.2vw, 76px);
  line-height: 1.35;
  letter-spacing: 0.07em;
  text-wrap: balance;
}

.hero-line {
  display: block;
  overflow: hidden;
}

.hero-line > span {
  display: block;
  transform: translateY(110%);
}

/* Zen Dots has no italic — emphasis via muted color instead */
.em-accent {
  color: var(--muted);
}

h1 .em-accent {
  color: var(--muted);
}

/* Sub copy */
.hero-sub {
  margin-top: 48px;
  font-size: clamp(15px, 1.5vw, 18px);
  color: var(--muted);
  overflow: hidden;
  max-width: 56ch;
  line-height: 1.6;
}

.hero-sub > span {
  display: block;
  transform: translateY(110%);
}

.hero-sub .accent {
  color: var(--ink);
}

/* Scroll cue */
.scroll-cue {
  position: absolute;
  left: 40px;
  bottom: 42px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--util);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
}

.cue-bar {
  width: 46px;
  height: 1px;
  background: var(--muted);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.cue-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateX(-100%);
  animation: cue-sweep 2.6s ease-in-out infinite;
}

@keyframes cue-sweep {
  0%   { transform: translateX(-100%); }
  55%  { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* ─── Room ───────────────────────────────────────────────────────────────── */

.room {
  position: relative;
  z-index: 1;
  /* clip-path instead of overflow:hidden — Safari flattens preserve-3d when any
     ancestor has overflow:hidden; clip-path clips without creating a stacking context. */
  -webkit-clip-path: inset(0);
          clip-path: inset(0);
  /* horizontal drag handled by JS; vertical pan stays native/Lenis */
  touch-action: pan-y;
}

/* ── 3D mode (JS adds .is3d for all non-reduced-motion users) ── */

.room.is3d {
  /* Explicit floor so the section never collapses before ScrollTrigger pins it */
  min-height: calc(var(--vh, 1vh) * 100);
}

.room.is3d .room-inner {
  height: calc(var(--vh, 1vh) * 100);
  display: flex;
  align-items: center;
  justify-content: center;
  /* perspective = 2×D (cube is 100vw, D = 50vw) → side walls recede at 2× scale */
  perspective: 100vw;
  perspective-origin: 50% 50%;
}

.room.is3d .cube {
  position: relative;
  /* Fill full viewport so walls surround you */
  width: 100vw;
  height: calc(var(--vh, 1vh) * 100);
  -webkit-transform-style: preserve-3d;
          transform-style: preserve-3d;
  will-change: transform;
}

.room.is3d .wall {
  position: absolute;
  inset: -1px; /* 1px overlap on every edge closes hairline seams at face joins */
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #1c2535, #10151e 65%);
  backface-visibility: hidden;
  overflow: hidden;
}

/* ── 2D mobile fallback (no .is3d) ── */

.room:not(.is3d) .wall {
  min-height: 72vh;
  min-height: 72svh;
  border-top: 1px solid var(--line);
  position: relative;
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity  0.9s var(--ease-enter),
    transform 0.9s var(--ease-enter);
}

.room:not(.is3d) .wall.in {
  opacity: 1;
  transform: translateY(0);
}

/* Wall image background */
.wall-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.wall-bg img,
.wall-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  display: block;
}

/* Wall text content layer */
.wall-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  min-height: inherit;
  padding: clamp(34px, 5vw, 72px);
  background: linear-gradient(
    to top,
    rgba(8, 12, 20, 0.88) 0%,
    rgba(8, 12, 20, 0.30) 40%,
    transparent 70%
  );
}

/* 3D: float text absolutely over bg; centered; scrim stays uniform so text is legible everywhere */
.room.is3d .wall-body {
  position: absolute;
  inset: 0;
  height: auto;
  min-height: 0;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: radial-gradient(
    ellipse 80% 70% at center,
    rgba(8, 12, 20, 0.24) 0%,
    rgba(8, 12, 20, 0.38) 100%
  );
  will-change: opacity, transform, filter;
}

@media (max-width: 700px) {
  .room.is3d .wall-body {
    will-change: opacity, transform; /* mobile dissolve skips filter */
  }
}

/* ── Ceiling & floor — 3D desktop only ─────────────────────────────── */

/* Hidden in mobile / reduced-motion stacked fallback */
.room:not(.is3d) .room-ceiling,
.room:not(.is3d) .room-floor {
  display: none;
}

.room-ceiling,
.room-floor {
  position: absolute;
  left: -1px;                    /* 1px horizontal overlap closes wall seams */
  width: calc(100% + 2px);
  /* height = cube width (2D) so the square face closes the box floor plan;
     +2px closes the seam at the front/back wall edges */
  height: calc(100vw + 2px);
  overflow: hidden;
  /* visible: normal at 90° to z-axis; hidden would be browser-dependent */
  backface-visibility: visible;
  background: linear-gradient(160deg, #141c28, #0b1018);
}

/* Image slot — same pattern as wall-bg */
.room-ceiling .wall-bg,
.room-floor .wall-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.room-ceiling .wall-bg img,
.room-ceiling .wall-bg video,
.room-floor .wall-bg img,
.room-floor .wall-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.55;
}

/* Ceiling image — readable storm sky; toned by filter, not by a heavy dark overlay */
.room-ceiling .wall-bg img,
.room-ceiling .wall-bg video {
  opacity: 0.74;
  filter: brightness(0.84) contrast(1.06) saturate(0.88);
}

/* Atmosphere overlay — shared base */
.room-ceiling::after,
.room-floor::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Ceiling: almost no overlay — image toned by filter instead.
   Only a soft edge fade so the perimeter blends into the walls. */
.room-ceiling::after {
  background: radial-gradient(
    ellipse 90% 90% at center,
    transparent 0%,
    rgba(10, 15, 24, 0.42) 100%
  );
}

/* Floor: same light edge-only fade as ceiling so terrazzo reads clearly */
.room-floor::after {
  background: radial-gradient(
    ellipse 90% 90% at center,
    transparent 0%,
    rgba(10, 15, 24, 0.42) 100%
  );
}

/* Floor image — terrazzo; same opacity/filter grade as ceiling */
.room-floor .wall-bg img,
.room-floor .wall-bg video {
  opacity: 0.74;
  filter: brightness(0.84) contrast(1.06) saturate(0.82);
}

/* Wall content (shared) */
.wall-label {
  font-family: var(--display);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--cold);
  margin-bottom: 22px;
  line-height: 1;
}

.wall-text {
  font-family: var(--display);
  font-style: normal;
  font-size: clamp(30px, 4.5vw, 60px);
  line-height: 1.35;
  letter-spacing: 0.05em;
  text-wrap: balance;
}

.wall-text .em-accent {
  color: var(--muted);
}

/* Room walls: all text full white — no muted emphasis */
.room .wall-body .em-accent {
  color: var(--white);
}

.wall-list {
  list-style: none;
  font-family: var(--display);
  font-style: normal;
  font-size: clamp(22px, 3vw, 40px);
  line-height: 1.8;
  letter-spacing: 0.04em;
}

/* ─── Work / Gallery ─────────────────────────────────────────────────────── */

.work {
  background: var(--surface);
  padding: 130px 0 100px;
  border-top: 1px solid var(--line);
}

.work-header {
  max-width: 1240px;
  margin: 0 auto 64px;
  padding: 0 40px;
}

.section-label {
  font-family: var(--util);
  font-size: 12px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--cold);
  line-height: 1;
  margin-bottom: 22px;
}

.work-header h2 {
  font-family: var(--display);
  font-style: normal;
  font-size: clamp(22px, 3vw, 44px);
  line-height: 1.4;
  letter-spacing: 0.05em;
  max-width: 22ch;
  text-wrap: balance;
}

/* Embla root */
.embla {
  overflow: hidden;
  cursor: grab;
  user-select: none;
}

.embla.is-dragging {
  cursor: grabbing;
}

/* Embla track */
.embla__container {
  display: flex;
  gap: 1px;               /* hairline between slides */
  background: var(--line); /* gap color = hairline */
  touch-action: pan-y pinch-zoom; /* let Lenis own vertical */
}

/* Individual slide */
.embla__slide {
  flex: 0 0 78vw;
  min-width: 0;
  aspect-ratio: 5 / 4;
  max-height: 80svh;
  min-height: 300px;
  position: relative;
  outline: none;
  background: var(--bg-b); /* dark fallback before video loads */
}

.embla__slide:focus-visible {
  outline: 1.5px solid var(--cold);
  outline-offset: -1.5px;
}

/* slide figure */
.slide-fig {
  width: 100%;
  height: 100%;
  position: relative;
  margin: 0;
  display: block;
}

/* slide as link — wraps the entire slide content */
.slide-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.embla.is-dragging .slide-link { cursor: grabbing; }

@media (hover: hover) and (pointer: fine) {
  .slide-link:hover .slide-name { color: var(--cold); }
  .slide-link:hover .slide-alt  { opacity: 1; }
}

/* cover image — always visible at all breakpoints; no JS dependency */
.slide-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* video overlay — hidden until loaded; sits above the cover image */
.slide-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.6s ease-out;
}

.slide-video.is-loaded {
  opacity: 1;
}

/* alt image — crossfades in on hover / touch; sits above cover in DOM */
.slide-alt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* Touch: show alt while slide is pressed */
.embla__slide.is-pressed .slide-alt { opacity: 1; }

/* Touch: show alt on the centered (selected) slide */
@media (hover: none) {
  .embla__slide.is-centered .slide-alt { opacity: 1; }
}

/* scrim — always-on dark layer between images and caption */
.slide-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    170deg,
    rgba(6, 9, 15, 0.18) 0%,
    rgba(6, 9, 15, 0.54) 60%,
    rgba(6, 9, 15, 0.82) 100%
  );
  pointer-events: none;
}

/* caption overlay — no background; scrim handles contrast */
.slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 28px 28px;
  pointer-events: none;
}

.slide-name {
  font-family: var(--display);
  font-style: normal;
  font-size: clamp(16px, 1.8vw, 26px);
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: 0.04em;
}

.slide-desc {
  font-family: var(--util);
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0.02em;
}

/* Gallery nav */
.embla__nav {
  display: flex;
  justify-content: flex-end;
  gap: 1px;
  padding: 20px 40px 0;
  max-width: none;
}

.embla__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition:
    color 180ms var(--ease-std),
    border-color 180ms var(--ease-std);
}

@media (hover: hover) and (pointer: fine) {
  .embla__btn:hover {
    color: var(--ink);
    border-color: rgba(242, 240, 236, 0.28);
  }
}

.embla__btn:focus-visible {
  outline: 1.5px solid var(--cold);
  outline-offset: 2px;
}

.embla__btn[aria-disabled="true"] {
  opacity: 0.25;
  pointer-events: none;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--line);
  padding: 54px 40px;
  background: var(--bg-c);
}

.foot-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.foot-line {
  font-family: var(--util);
  font-style: italic;
  font-size: clamp(18px, 1.8vw, 24px);
  color: var(--ink);
  line-height: 1.3;
}

.foot-nav {
  display: flex;
  align-items: center;
  gap: 36px;
  flex-wrap: wrap;
}

.foot-link {
  font-family: var(--util);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-decoration: none;
  position: relative;
  display: inline-block;
  transition: color 200ms var(--ease-std);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.foot-link.foot-email {
  font-family: var(--brand);
  letter-spacing: 0.12em;
}

@media (hover: hover) and (pointer: fine) {
  .foot-link:hover { color: var(--ink); }
}

.foot-link:focus-visible {
  outline: 1.5px solid var(--cold);
  outline-offset: 3px;
}

/* ── CenterUnderline ─────────────────────────────────────────── */

.ul-center::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease-in-out;
}

@media (hover: hover) and (pointer: fine) {
  .ul-center:hover::after { transform: scaleX(1); }
}

/* ── ComesInGoesOutUnderline ─────────────────────────────────── */

.ul-comes-in::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
}

@media (hover: hover) and (pointer: fine) {
  .ul-comes-in:hover::after {
    animation: ul-comes-left 0.65s ease-in-out forwards;
  }
  .ul-comes-in[data-dir="right"]:hover::after {
    animation: ul-comes-right 0.65s ease-in-out forwards;
  }
}

@keyframes ul-comes-left {
  0%   { left: 0;    right: auto; width: 0;    }
  49%  { left: 0;    right: auto; width: 100%; }
  51%  { left: auto; right: 0;    width: 100%; }
  100% { left: auto; right: 0;    width: 0;    }
}

@keyframes ul-comes-right {
  0%   { right: 0;    left: auto; width: 0;    }
  49%  { right: 0;    left: auto; width: 100%; }
  51%  { right: auto; left: 0;    width: 100%; }
  100% { right: auto; left: 0;    width: 0;    }
}

/* ── GoesOutComesInUnderline ─────────────────────────────────── */

.ul-goes-out::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
}

@media (hover: hover) and (pointer: fine) {
  .ul-goes-out:hover::after {
    animation: ul-goes-left 0.65s ease-out forwards;
  }
  .ul-goes-out[data-dir="right"]:hover::after {
    animation: ul-goes-right 0.65s ease-out forwards;
  }
}

@keyframes ul-goes-left {
  0%   { left: 0;    right: auto; width: 100%; }
  49%  { left: 0;    right: auto; width: 0;    }
  51%  { left: auto; right: 0;    width: 0;    }
  100% { left: auto; right: 0;    width: 100%; }
}

@keyframes ul-goes-right {
  0%   { right: 0;    left: auto; width: 100%; }
  49%  { right: 0;    left: auto; width: 0;    }
  51%  { right: auto; left: 0;    width: 0;    }
  100% { right: auto; left: 0;    width: 100%; }
}

/* ─── CTA section ────────────────────────────────────────────────────────── */

.cta-section {
  background: var(--bg-c);
  border-top: 1px solid var(--line);
  padding: clamp(120px, 16vw, 220px) 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Magnetic field — extends the hover zone well beyond the button */
.cta-magnetic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 56px 80px;
}

.cta-btn {
  font-family: var(--display);
  font-style: normal;
  font-size: clamp(24px, 4vw, 58px);
  letter-spacing: 0.06em;
  color: var(--ink);
  background: rgba(242, 240, 236, 0.03);
  border: 1px solid rgba(242, 240, 236, 0.2);
  padding: clamp(22px, 2.8vw, 38px) clamp(64px, 9vw, 120px);
  cursor: pointer;
  will-change: transform;
  transition:
    background 350ms var(--ease-std),
    border-color 350ms var(--ease-std);
}

@media (hover: hover) and (pointer: fine) {
  .cta-btn:hover {
    background: rgba(111, 169, 181, 0.08);
    border-color: rgba(111, 169, 181, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
}

.cta-btn:focus-visible {
  outline: 1.5px solid var(--cold);
  outline-offset: 5px;
}

@media (max-width: 760px) {
  .cta-section {
    padding: 100px 26px;
  }
  .cta-magnetic {
    padding: 36px 40px;
  }
}

/* ─── Footer CTA ─────────────────────────────────────────────────────────── */

.contact-cta {
  font-family: var(--util);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  padding: 11px 22px;
  cursor: pointer;
  transition:
    color 200ms var(--ease-std),
    border-color 200ms var(--ease-std);
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .contact-cta:hover {
    color: var(--warm);
    border-color: var(--warm);
  }
}

.contact-cta:focus-visible {
  outline: 1.5px solid var(--cold);
  outline-offset: 2px;
}

/* ─── Contact modal ──────────────────────────────────────────────────────── */

dialog#contact-modal {
  border: none;
  padding: 0;
  background: transparent;
  color: var(--ink);
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  overflow: hidden;
}

dialog#contact-modal::backdrop {
  display: none; /* custom overlay below */
}

.contact-overlay {
  width: 100%;
  height: 100%;
  background: rgba(10, 13, 18, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  overflow-y: auto;
}

.contact-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  width: 100%;
  max-width: 540px;
  padding: clamp(36px, 5vw, 60px);
  position: relative;
  flex-shrink: 0;
}

/* Close button */
.contact-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition:
    color 180ms var(--ease-std),
    border-color 180ms var(--ease-std);
}

@media (hover: hover) and (pointer: fine) {
  .contact-close:hover {
    color: var(--ink);
    border-color: rgba(242, 240, 236, 0.28);
  }
}

.contact-close:focus-visible {
  outline: 1.5px solid var(--cold);
  outline-offset: 2px;
}

/* Headings */
.contact-kicker {
  font-family: var(--util);
  font-size: 11px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--cold);
  margin-bottom: 14px;
  line-height: 1;
}

.contact-heading {
  font-family: var(--display);
  font-style: normal;
  font-size: clamp(24px, 3.2vw, 44px);
  line-height: 1.2;
  letter-spacing: 0.05em;
  margin-bottom: 40px;
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-family: var(--util);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.field input,
.field textarea {
  font-family: var(--util);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface-lift);
  border: 1px solid var(--line);
  padding: 13px 15px;
  width: 100%;
  resize: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 180ms var(--ease-std);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
  opacity: 0.45;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--cold);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--warm);
}

/* Submit button */
.contact-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--util);
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 15px 30px;
  background: none;
  border: 1px solid var(--cold);
  color: var(--cold);
  cursor: pointer;
  align-self: flex-start;
  transition:
    background 200ms var(--ease-std),
    color 200ms var(--ease-std);
}

@media (hover: hover) and (pointer: fine) {
  .contact-submit:not([disabled]):hover {
    background: var(--cold);
    color: var(--bg-c);
  }
}

.contact-submit:focus-visible {
  outline: 1.5px solid var(--cold);
  outline-offset: 3px;
}

.contact-submit[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.submit-sending { display: none; }

.contact-submit.is-loading .submit-label  { display: none; }
.contact-submit.is-loading .submit-sending { display: block; }

/* Status messages */
.contact-success,
.contact-error {
  margin-top: 32px;
}

.contact-success p {
  font-family: var(--util);
  font-style: italic;
  font-size: clamp(18px, 1.8vw, 24px);
  color: var(--ink);
  line-height: 1.4;
}

.contact-error p {
  font-family: var(--util);
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.contact-error a {
  color: var(--cold);
  text-decoration: none;
  transition: color 180ms var(--ease-std);
}

@media (hover: hover) and (pointer: fine) {
  .contact-error a:hover { color: var(--ink); }
}

/* ─── Reveal utility ─────────────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity  1s var(--ease-enter),
    transform 1s var(--ease-enter);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Project pages ─────────────────────────────────────────────────────── */

/* Fixed header — gradient scrim, transparent until scrolled */
.proj-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 40px;
  background: linear-gradient(to bottom, rgba(10,15,24,0.7) 0%, transparent 100%);
  pointer-events: none;
  transition: background 300ms var(--ease-std), border-color 300ms var(--ease-std);
}

.proj-header > * { pointer-events: auto; }

.proj-header--scrolled {
  background: rgba(10,15,24,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.proj-wordmark {
  font-family: var(--brand);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--ink);
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 200ms var(--ease-std);
}

@media (hover: hover) and (pointer: fine) {
  .proj-wordmark:hover { opacity: 1; }
}

.proj-back {
  font-family: var(--util);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-decoration: none;
  transition: color 200ms var(--ease-std);
}

@media (hover: hover) and (pointer: fine) {
  .proj-back:hover { color: var(--ink); }
}

/* Lead — full-bleed hero with media behind, text at bottom */
.proj-lead {
  position: relative;
  width: 100%;
  height: calc(var(--vh, 1vh) * 100);
  overflow: hidden;
  background: var(--bg-c);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.proj-lead-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.proj-lead-media img,
.proj-lead-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.proj-lead::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(10,15,24,0.04) 30%, rgba(10,15,24,0.84) 100%);
}

.proj-lead-text {
  position: relative;
  z-index: 2;
  padding: 0 clamp(26px,5vw,80px) clamp(48px,7vh,96px);
  max-width: 880px;
}

.proj-name {
  font-family: var(--display);
  font-style: normal;
  font-size: clamp(30px,4.4vw,64px);
  line-height: 1.2;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin: 0 0 18px;
  text-wrap: balance;
}

.proj-concept {
  font-family: var(--util);
  font-style: italic;
  font-size: clamp(17px,1.8vw,24px);
  line-height: 1.45;
  color: rgba(242,240,236,0.6);
  margin: 0;
}

/* Intro + meta */
.proj-intro-wrap {
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.proj-intro-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: clamp(56px,8vw,120px) clamp(26px,5vw,80px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px 80px;
  align-items: start;
}

.proj-intro-text {
  font-family: var(--util);
  font-size: clamp(17px,1.6vw,22px);
  line-height: 1.6;
  color: var(--ink);
  text-wrap: pretty;
  margin: 0;
  max-width: 55ch;
}

.proj-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 28px;
  align-content: start;
  white-space: nowrap;
  margin: 4px 0 0;
  transition-delay: 0.18s; /* stagger after intro text */
}

.proj-meta dt {
  font-family: var(--util);
  font-size: 10px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--cold);
  line-height: 1.7;
}

.proj-meta dd {
  font-family: var(--util);
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}

/* Editorial sequence */
.proj-sequence {
  background: var(--bg-b);
  padding: clamp(80px,10vw,160px) 0 clamp(40px,6vw,80px);
}

.seq-item {
  margin: 0;
  padding-bottom: clamp(72px,10vw,140px);
}

.seq-item[data-pos="1"] { padding-left: clamp(16px,4vw,60px); padding-right: clamp(80px,18vw,320px); }
.seq-item[data-pos="2"] { padding-left: clamp(80px,18vw,320px); padding-right: clamp(16px,4vw,60px); }
.seq-item[data-pos="3"] { padding-left: 0; padding-right: 0; }
.seq-item[data-pos="4"] { padding-left: clamp(40px,10vw,180px); padding-right: clamp(40px,10vw,180px); }

.seq-item img {
  width: 100%;
  height: clamp(340px,60vh,940px);
  object-fit: cover;
  display: block;
  background: var(--surface);
}

.seq-caption {
  display: block;
  font-family: var(--util);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 14px;
  padding-left: 3px;
}

/* Portrait (9:16) vertical editorial sequence — e.g. Masi campaign */
.proj-sequence--portrait .seq-item {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto clamp(80px, 12vw, 160px);
  padding: 0;
}

/* Override all data-pos horizontal offsets — no editorial stagger for portrait stacks */
.proj-sequence--portrait .seq-item[data-pos] {
  padding: 0;
}

.proj-sequence--portrait .seq-item img {
  max-height: 90vh;
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  background: transparent;
}

.proj-sequence--portrait .seq-caption {
  text-align: center;
  padding-left: 0;
}

/* ── Grid sequence (portrait 9:16 tiles) ──────────────────────────── */
.proj-sequence--grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(4px, 0.7vw, 10px);
  padding: clamp(60px, 8vw, 120px) clamp(20px, 4vw, 60px);
  background: var(--bg-b);
}

@media (max-width: 760px) {
  .proj-sequence--grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 40px 12px;
  }
}

.proj-sequence--grid .seq-item {
  margin: 0;
  padding: 0;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.proj-sequence--grid .seq-item[data-pos] { padding: 0; }

.proj-sequence--grid .seq-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.proj-sequence--grid .seq-item:hover img { transform: scale(1.08); }

@media (prefers-reduced-motion: reduce) {
  .proj-sequence--grid .seq-item:hover img { transform: none; }
}

.proj-sequence--grid .seq-caption { display: none; }

/* ── Lightbox ────────────────────────────────────────────────────────── */
.proj-lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(6, 9, 15, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.proj-lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}

.proj-lightbox__img {
  max-height: 92vh;
  max-width: 92vw;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.15s ease;
}

.proj-lightbox__img.is-fading { opacity: 0; }

.proj-lightbox__close,
.proj-lightbox__prev,
.proj-lightbox__next {
  position: absolute;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  opacity: 0.45;
  padding: 12px;
  line-height: 1;
  transition: opacity 0.2s ease;
}

.proj-lightbox__close:hover,
.proj-lightbox__prev:hover,
.proj-lightbox__next:hover { opacity: 1; }

.proj-lightbox__close  { top: 22px; right: 22px; }
.proj-lightbox__prev   { left: 16px;  top: 50%; transform: translateY(-50%); }
.proj-lightbox__next   { right: 16px; top: 50%; transform: translateY(-50%); }

/* ── Unimatic frame scrub ────────────────────────────────────────────── */
.uni-scrub {
  position: relative;
  height: calc(var(--vh, 1vh) * 100);
  background: #060c16;
  overflow: hidden;
}

.uni-film {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.uni-static {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
  .uni-film   { display: none; }
  .uni-static { display: block; }
}

.uni-title {
  position: absolute;
  bottom: clamp(36px, 6vh, 72px);
  left: clamp(24px, 5vw, 80px);
  z-index: 2;
  pointer-events: none;
}

.uni-title .proj-name {
  font-family: var(--display);
  font-style: normal;
  font-size: clamp(28px, 4.5vw, 64px);
  letter-spacing: 0.06em;
  color: var(--ink);
  line-height: 1.2;
}

.uni-title .proj-concept {
  font-family: var(--util);
  font-size: clamp(12px, 1.3vw, 15px);
  color: var(--muted);
  margin-top: 10px;
  letter-spacing: 0.02em;
}

/* Project footer */
.proj-footer {
  background: var(--bg-c);
  border-top: 1px solid var(--line);
}

.proj-footer-nav {
  max-width: 1260px;
  margin: 0 auto;
  padding: clamp(56px,8vw,100px) clamp(26px,5vw,80px) clamp(32px,4vw,56px);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 24px;
}

.proj-prev-link,
.proj-next-link {
  font-family: var(--display);
  font-style: normal;
  font-size: clamp(18px,2.4vw,36px);
  letter-spacing: 0.05em;
  color: var(--muted);
  text-decoration: none;
  transition: color 200ms var(--ease-std);
  text-wrap: balance;
}

@media (hover: hover) and (pointer: fine) {
  .proj-prev-link:hover,
  .proj-next-link:hover { color: var(--ink); }
}

.proj-footer-cta {
  max-width: 1260px;
  margin: 0 auto;
  padding: clamp(28px,4vw,48px) clamp(26px,5vw,80px) clamp(40px,6vw,72px);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.proj-cta-link {
  font-family: var(--display);
  font-style: normal;
  font-size: clamp(22px,3vw,44px);
  letter-spacing: 0.06em;
  color: var(--cold);
  text-decoration: none;
  transition: color 200ms var(--ease-std);
}

@media (hover: hover) and (pointer: fine) {
  .proj-cta-link:hover { color: var(--ink); }
}

.proj-footer-copy {
  font-family: var(--util);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--muted);
  opacity: 0.45;
  margin: 0;
}

/* Reveal override — slower + more travel for large editorial images */
.project-page .reveal {
  transform: translateY(48px);
  transition:
    opacity  1.3s var(--ease-enter),
    transform 1.3s var(--ease-enter);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 760px) {
  .hero-col {
    max-width: none;
  }

  .hero::after {
    background: linear-gradient(180deg,
      rgba(16, 21, 29, 0.2)  0%,
      rgba(16, 21, 29, 0.75) 100%);
  }

  .hero-overlay {
    align-items: flex-end;
  }

  .hero-inner {
    padding: 0 26px 110px;
  }

  .scroll-cue {
    display: none;
  }

  .bracket {
    width: 24px;
    height: 24px;
  }

  .bracket--tl { top: 22px; left: 22px; }
  .bracket--br { bottom: 22px; right: 22px; }

  .work-header {
    padding: 0 26px;
    margin-bottom: 40px;
  }

  .embla__slide {
    flex: 0 0 92vw;
  }

  .slide-caption {
    padding: 48px 26px 28px;
  }

  .embla__nav {
    padding: 16px 26px 0;
  }

  footer {
    padding: 40px 26px;
  }

  .foot-nav {
    gap: 22px;
  }

  .contact-panel {
    padding: 36px 26px 40px;
  }

  .contact-heading {
    margin-bottom: 30px;
  }

  /* Project page mobile */
  .proj-header {
    padding: 22px 26px;
  }

  .proj-lead-text {
    padding: 0 26px clamp(40px,8vh,72px);
  }

  .proj-intro-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .proj-meta {
    white-space: normal;
  }

  .seq-item[data-pos="1"],
  .seq-item[data-pos="2"],
  .seq-item[data-pos="3"],
  .seq-item[data-pos="4"] {
    padding-left: clamp(16px,5vw,40px);
    padding-right: clamp(16px,5vw,40px);
  }

  .proj-footer-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .proj-footer-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ─── Reduced motion ─────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  /* Instant reveals */
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  /* No scroll cue animation */
  .cue-bar::after {
    animation: none;
  }

  /* No image crossfade or video fade-in */
  .slide-alt,
  .slide-video {
    transition: none;
  }

  /* No wall transitions in mobile mode */
  .room:not(.is3d) .wall {
    transition: none;
  }

  /* No loading bar transition */
  .load-fill {
    transition: none;
  }

  /* No CTA magnetic / glass transitions */
  .cta-btn {
    transition: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* No modal animations */
  .contact-overlay,
  .contact-panel,
  .contact-submit,
  .contact-close,
  .field input,
  .field textarea,
  .contact-error a {
    transition: none;
  }

  /* No underline animations */
  .ul-center::after,
  .ul-comes-in::after,
  .ul-goes-out::after {
    animation: none !important;
    transition: none;
  }

  /* For GoesOutComesInUnderline: keep the underline visible but static */
  .ul-goes-out::after {
    width: 100%;
  }

  /* Project page: instant reveals */
  .project-page .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
