/* DANIEL GOL — THE DOOR & IN-SCREEN 4K CINEMA (v41)
   Unified Architectural Smoked-Crystal Language · Apple-Premium Player Bar · Side Visual Playlist */

:root {
  --sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Daniel Gol Signature House Palette */
  --bg: #020605;
  --red: #e8250e;
  --amber: #ffb648;
  --cream: #f3ead6;
  --text-primary: #f5efe2;
  --text-secondary: rgba(243, 234, 214, 0.68);
  --text-muted: rgba(243, 234, 214, 0.44);

  /* Live Video-Harmonic Glass Tones (Updated at 30Hz per portal from 4K canvas) */
  --tone-rgb: 162, 182, 128;
  --tone2-rgb: 218, 210, 178;
  --glass-hi-rgb: 15, 19, 17;
  --glass-lo-rgb: 8, 10, 9;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);

  --door-h: 168px;
  /* Precision Architectural Geometry (Leica / B&O Chamfer) */
  --inset: clamp(16px, 1.8vw, 24px);
  --card-radius: 12px;
  --screen-radius: calc(var(--card-radius) + var(--inset));
  /* Centered 4K Cinema Canvas */
  --sw: min(92vw, calc((100svh - 48px) * 16 / 9), 1480px);
}

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

html, body {
  height: 100%;
  background: var(--bg);
}

body {
  color: var(--text-primary);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  user-select: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ── Main Stage & 4K Ambilight Rig ── */
.stage {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  perspective: 2200px;
}

.rig {
  position: relative;
  width: var(--sw);
  transform-style: preserve-3d;
  will-change: transform;
  backface-visibility: hidden;
}

/* Atmospheric Ambilight projecting from the 4K film into the dark room */
.amb, .room {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--screen-radius);
  pointer-events: none;
  opacity: 0;
  will-change: opacity;
  backface-visibility: hidden;
  transition: opacity 2.2s var(--ease);
}

.amb {
  z-index: 0;
  transform: translateZ(0) scale(1.18);
  filter: blur(calc(var(--sw) * 0.048)) saturate(1.38) contrast(1.03) brightness(0.92);
}

.room {
  z-index: 0;
  transform: translateZ(0) scale(2.4);
  filter: blur(calc(var(--sw) * 0.11)) saturate(1.35);
  mix-blend-mode: screen;
}

.rig::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 170vw;
  height: 170vh;
  z-index: 1;
  pointer-events: none;
  transform: translate3d(-50%, -50%, 0);
  background: radial-gradient(closest-side, transparent 52%, rgba(2, 6, 5, 0.48) 70%, rgba(2, 6, 5, 0.9) 88%, #020605 100%);
}

body.on .amb {
  opacity: 0.74;
  transition-delay: 0.45s;
}

body.on .room {
  opacity: 0.16;
  transition-delay: 0.7s;
}

body.cinema-open .amb {
  opacity: 0.86;
}

body.cinema-open .room {
  opacity: 0.22;
}

/* ── Borderless 4K UHD Screen (Self-Contained Cinema Viewport) ── */
.screen {
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--screen-radius);
  overflow: hidden;
  background: #030706;
  isolation: isolate;
  contain: layout paint;
  box-shadow:
    inset 0 0 0 1px rgba(243, 234, 214, 0.09),
    0 48px 130px -28px rgba(0, 0, 0, 0.94);
  transform-origin: 50% 50%;
  backface-visibility: hidden;
}

body.cinema-open.cinema-idle .screen {
  cursor: none;
}

.film, .reel-flash, .flash3, .cine-preview, .screen-shade, .privacy, .scan, .power {
  position: absolute;
  inset: 0;
}

.film {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: translateZ(0);
  will-change: transform;
  transition: transform 1.4s var(--ease);
}

body.cinema-open .film {
  cursor: pointer;
}

body:not(.cinema-open)[data-door]:not([data-door=""]) .film {
  transform: translateZ(0) scale(1.025);
}

/* Subtle Optical Crossfade Veil on Reel Switch */
.reel-flash {
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  background: rgba(2, 6, 5, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: opacity 0.42s var(--ease);
}

.reel-flash.is-flashing {
  opacity: 1;
}

/* Progressive top & bottom cinema shade inside the video */
.screen-shade {
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(2, 6, 5, 0.56) 0%,
    rgba(2, 6, 5, 0.16) 15%,
    transparent 28%,
    transparent 56%,
    rgba(2, 6, 5, 0.44) 78%,
    rgba(2, 6, 5, 0.78) 100%
  );
  transition: opacity 0.6s var(--ease);
}

body.cinema-open.cinema-idle .screen-shade {
  opacity: 0;
}

/* ── Top Unboxed Cinema Horizon (Pure Architectural Credit Line) ── */
.bar {
  position: absolute;
  top: var(--inset);
  left: var(--inset);
  right: var(--inset);
  z-index: 14;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px;
  opacity: 0;
  transform: translate3d(0, -8px, 0);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}

body.on .bar {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

body.cinema-open.cinema-idle .bar {
  opacity: 0;
  transform: translate3d(0, -10px, 0);
  pointer-events: none;
}

.brand-sig {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65);
  transition: opacity 0.3s var(--ease);
}

.brand-sig:hover {
  opacity: 0.88;
}

.wm-name {
  font-family: var(--sans);
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.024em;
  color: var(--text-primary);
  white-space: nowrap;
}

.bar-sep {
  width: 1px;
  height: 13px;
  background: rgba(243, 234, 214, 0.20);
  flex-shrink: 0;
}

.wm-sub {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.bar-ctrls {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65);
}

.bar-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px;
  margin: 0 -10px;
  border-radius: 7px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  transition:
    color 0.3s var(--ease),
    background-color 0.3s var(--ease),
    box-shadow 0.35s var(--ease),
    transform 0.35s var(--ease-out);
}

.bar-action .btn-icon {
  transition: transform 0.38s var(--ease-out);
}

.bar-action:hover,
.bar-action:focus-visible {
  background: rgba(243, 234, 214, 0.11);
  box-shadow:
    inset 0 1px 0 rgba(243, 234, 214, 0.22),
    0 8px 20px -6px rgba(0, 0, 0, 0.55);
  transform: translate3d(0, -1px, 0);
  outline: none;
}

.bar-action:active {
  transform: translate3d(0, 0, 0) scale(0.97);
}

a.bar-action:hover .btn-icon,
a.bar-action:focus-visible .btn-icon {
  transform: translate3d(1.5px, -1.5px, 0);
}

#cFsBtn:hover .btn-icon,
#cFsBtn:focus-visible .btn-icon {
  transform: scale(1.1);
}

#cCloseBtn:hover .btn-icon,
#cCloseBtn:focus-visible .btn-icon {
  transform: rotate(90deg);
}

#soundBtn[aria-pressed="false"]:hover .eq i:nth-child(1) {
  height: 8px;
}

#soundBtn[aria-pressed="false"]:hover .eq i:nth-child(2) {
  height: 11px;
}

#soundBtn[aria-pressed="false"]:hover .eq i:nth-child(3) {
  height: 9px;
}

.eq {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 11px;
}

.eq i {
  display: block;
  width: 1.5px;
  height: 5px;
  border-radius: 1px;
  background: currentColor;
  transition: height 0.2s ease;
}

.eq i:nth-child(2) {
  height: 9px;
}

.eq i:nth-child(3) {
  height: 6px;
}

.bar-action[aria-pressed="true"] .eq i {
  background: rgb(var(--tone-rgb));
}

.bar-action[aria-pressed="true"] .eq i:nth-child(1) { animation: eqbar 0.5s ease-in-out infinite alternate; }
.bar-action[aria-pressed="true"] .eq i:nth-child(2) { animation: eqbar 0.36s ease-in-out 0.12s infinite alternate; }
.bar-action[aria-pressed="true"] .eq i:nth-child(3) { animation: eqbar 0.58s ease-in-out 0.2s infinite alternate; }

@keyframes eqbar {
  from { height: 3px; }
  to { height: 10px; }
}

/* Power-on aperture line */
.power {
  z-index: 18;
  background: var(--cream);
  opacity: 0;
  pointer-events: none;
}

body.boot .screen {
  transform: scaleY(0.003) scaleX(0.4);
  filter: brightness(3.5);
}

body.boot .power {
  opacity: 1;
}

body.on .screen {
  animation: poweron 1.15s var(--ease-io) both;
}

body.on .power {
  animation: powerflash 1.15s var(--ease) both;
}

body.ready .screen,
body.ready .power,
body.leaving .screen {
  animation: none;
}

@keyframes poweron {
  0% { transform: scaleY(0.003) scaleX(0.4); filter: brightness(3.5); }
  28% { transform: scaleY(0.003) scaleX(1); filter: brightness(3.5); }
  100% { transform: none; filter: none; }
}

@keyframes powerflash {
  0%, 26% { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Hover States on Screen (When in Doors Mode) ── */
.flash3 {
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(2, 6, 5, 0.75);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease);
}

.flash3 i {
  background: #020605 center / cover no-repeat;
}

body:not(.cinema-open)[data-door="archive"] .flash3.ready {
  opacity: 1;
}

/* Door 02: Pure Minimalist 2-Film Diptych on Hover */
.cine-preview {
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
}

body:not(.cinema-open)[data-door="cinema"] .cine-preview {
  opacity: 1;
}

.cp-mirage {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50%;
  background: #080504 url("media/mirage-poster.jpg") center / cover no-repeat;
  transform: scale(1.04);
  transition: transform 1.2s var(--ease-out);
}

body:not(.cinema-open)[data-door="cinema"] .cp-mirage {
  transform: scale(1);
}

.cp-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(243, 234, 214, 0.55);
  box-shadow: 0 0 20px rgba(232, 37, 14, 0.5);
}

/* Door 03: Warm Daniel Gol Vermilion & Amber Vault Veil */
.privacy {
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 42%, rgba(232, 37, 14, 0.24), rgba(2, 6, 5, 0.84) 72%);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  backdrop-filter: blur(24px) saturate(1.3);
  transition: opacity 0.55s var(--ease);
}

.privacy-orb {
  width: 32%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 37, 14, 0.52) 0%, rgba(255, 182, 72, 0.14) 58%, transparent 76%);
  filter: blur(32px);
}

body:not(.cinema-open)[data-door="pilot"] .privacy {
  opacity: 1;
}

/* Door 04: Optical Calibration Split */
.scan {
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
}

body:not(.cinema-open)[data-door="tools"] .scan {
  opacity: 1;
}

.scan-raw {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--scan, 50%)) 0 0);
  will-change: clip-path;
  -webkit-backdrop-filter: grayscale(1) contrast(0.88);
  backdrop-filter: grayscale(1) contrast(0.88);
}

.scan-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--scan, 50%);
  width: 1px;
  background: rgba(243, 234, 214, 0.65);
  box-shadow: 0 0 18px rgba(232, 37, 14, 0.45);
}

/* ============================================================================
   UNIFIED SMOKED-CRYSTAL SURFACE SYSTEM (.door, .cpl-card, .c-player)
   ============================================================================ */
.door,
.cpl-card,
.c-player {
  -webkit-backdrop-filter: blur(40px) saturate(1.82) brightness(1.03);
  backdrop-filter: blur(40px) saturate(1.82) brightness(1.03);
}

/* 360° Proximity Specular Rim Illumination on all Smoked-Crystal Surfaces */
.door::before,
.cpl-card::before,
.c-player::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(
    300px circle at var(--mx, 50%) var(--my, -120px),
    rgba(251, 247, 238, 0.72) 0%,
    rgba(var(--tone-rgb), 0.44) 36%,
    rgba(243, 234, 214, 0.09) 74%
  );
  opacity: 0.78;
  transition: opacity 0.4s var(--ease);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.door:hover::before,
.door:focus-visible::before,
.door.is-hovered::before,
.cpl-card:hover::before,
.cpl-card.is-active::before,
.c-player:hover::before {
  opacity: 1;
}

/* Cursor-tracked video-harmonic spotlight inside surface */
.door::after,
.cpl-card::after,
.c-player::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    260px 190px at var(--mx, 50%) var(--my, 120%),
    rgba(var(--tone2-rgb), 0.14) 0%,
    rgba(var(--tone-rgb), 0.12) 42%,
    transparent 74%
  );
  opacity: 0.35;
  transition: opacity 0.42s var(--ease);
}

/* Video-Harmonic Atmospheric Light Aura Inside Each Surface */
.d-aura {
  position: absolute;
  right: -42px;
  bottom: -52px;
  width: 240px;
  height: 220px;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    circle,
    rgba(var(--tone-rgb), 0.34) 0%,
    rgba(var(--tone2-rgb), 0.15) 45%,
    transparent 74%
  );
  filter: blur(28px);
  opacity: 0.58;
  transition: transform 0.65s var(--ease-out), opacity 0.5s var(--ease);
}

/* ============================================================================
   STATE A: 4 KINETIC ARCHITECTURAL GLASS PORTALS (.doors)
   ============================================================================ */
.doors {
  position: absolute;
  left: var(--inset);
  right: var(--inset);
  bottom: var(--inset);
  z-index: 10;
  display: flex;
  gap: 11px;
  will-change: transform;
  backface-visibility: hidden;
  visibility: visible;
  transition: visibility 0s 0s;
}

body.cinema-open .doors {
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s 0.5s;
}

.door {
  position: relative;
  flex: 1 1 0%;
  min-width: 0;
  height: var(--door-h);
  border-radius: var(--card-radius);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 20px 15px;
  overflow: hidden;
  isolation: isolate;
  contain: paint;
  background: linear-gradient(160deg, rgba(var(--glass-hi-rgb), 0.66) 0%, rgba(var(--glass-lo-rgb), 0.85) 100%);
  -webkit-backdrop-filter: blur(40px) saturate(1.82) brightness(1.03);
  backdrop-filter: blur(40px) saturate(1.82) brightness(1.03);
  box-shadow:
    inset 0 1px 0 rgba(243, 234, 214, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.42),
    0 24px 56px -14px rgba(0, 0, 0, 0.82);
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition:
    flex-grow 0.62s cubic-bezier(0.19, 1, 0.22, 1),
    opacity 0.55s var(--ease),
    transform 0.45s var(--ease-out),
    background 0.45s var(--ease),
    box-shadow 0.45s var(--ease);
  cursor: pointer;
}

/* Kinetic Expansion: Active portal expands horizontally while total flex sum stays locked at 4.00 */
body.ready:not(.cinema-open)[data-door="archive"] .door--archive,
body.ready:not(.cinema-open)[data-door="cinema"] .door--cinema,
body.ready:not(.cinema-open)[data-door="pilot"] .door--pilot,
body.ready:not(.cinema-open)[data-door="tools"] .door--tools {
  flex-grow: 1.36;
}

body.ready:not(.cinema-open)[data-door="archive"] .door:not(.door--archive),
body.ready:not(.cinema-open)[data-door="cinema"] .door:not(.door--cinema),
body.ready:not(.cinema-open)[data-door="pilot"] .door:not(.door--pilot),
body.ready:not(.cinema-open)[data-door="tools"] .door:not(.door--tools) {
  flex-grow: 0.88;
  opacity: 0.64;
}

body.cinema-open .door {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translate3d(0, 26px, 0) scale(0.97) !important;
  transition:
    opacity 0.42s var(--ease),
    transform 0.48s var(--ease-io) !important;
}

body.cinema-open .door:nth-child(1) { transition-delay: 0s !important; }
body.cinema-open .door:nth-child(2) { transition-delay: 0.03s !important; }
body.cinema-open .door:nth-child(3) { transition-delay: 0.06s !important; }
body.cinema-open .door:nth-child(4) { transition-delay: 0.09s !important; }

.door:hover .d-aura,
.door:focus-visible .d-aura,
.door.is-hovered .d-aura,
.cpl-card:hover .d-aura,
.cpl-card.is-active .d-aura {
  opacity: 1;
  transform: translate3d(calc(var(--px, 0) * -12px), calc(var(--py, 0) * -8px), 0) scale(1.22);
}

body.on .door {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

body.on .door:nth-child(1) { transition-delay: 0s, 1.02s, 1.02s, 0s, 0s; }
body.on .door:nth-child(2) { transition-delay: 0s, 1.10s, 1.10s, 0s, 0s; }
body.on .door:nth-child(3) { transition-delay: 0s, 1.18s, 1.18s, 0s, 0s; }
body.on .door:nth-child(4) { transition-delay: 0s, 1.26s, 1.26s, 0s, 0s; }
body.ready .door { transition-delay: 0s; }

.door:hover,
.door:focus-visible,
.door.is-hovered {
  transform: translate3d(calc(var(--px, 0) * 1.6px), -4px, 0);
  background: linear-gradient(160deg, rgba(var(--glass-hi-rgb), 0.78) 0%, rgba(var(--glass-lo-rgb), 0.91) 100%);
  box-shadow:
    inset 0 1px 0 rgba(251, 247, 238, 0.34),
    inset 0 -1px 0 rgba(var(--tone-rgb), 0.16),
    0 34px 72px -14px rgba(0, 0, 0, 0.94),
    0 0 36px -10px rgba(var(--tone-rgb), 0.18);
  outline: none;
}

.door:active {
  transform: translate3d(calc(var(--px, 0) * 0.8px), -1.5px, 0) scale(0.992);
}

.door:hover::after,
.door:focus-visible::after,
.door.is-hovered::after,
.cpl-card:hover::after,
.cpl-card.is-active::after,
.c-player:hover::after {
  opacity: 1;
}

.d-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.d-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.d-name {
  font-family: var(--sans);
  font-size: clamp(16px, 1.45vw, 19px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.024em;
  color: var(--text-primary);
  white-space: nowrap;
}

.d-sub {
  font-family: var(--sans);
  font-size: clamp(11px, 0.95vw, 12.5px);
  font-weight: 400;
  line-height: 1.38;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  max-width: 26ch;
  text-wrap: pretty;
}

.d-index {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: rgba(243, 234, 214, 0.34);
  padding-top: 3px;
  transition: color 0.35s var(--ease), transform 0.38s var(--ease-out);
}

.door:hover .d-index,
.door:focus-visible .d-index,
.door.is-hovered .d-index,
.cpl-card.is-active .d-index,
.cpl-card:hover .d-index {
  color: var(--text-primary);
  transform: translate3d(0, -1px, 0);
}

.d-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 11px;
  margin-top: auto;
  border-top: 1px solid rgba(243, 234, 214, 0.11);
  transition: border-color 0.4s var(--ease);
}

.door:hover .d-foot,
.door:focus-visible .d-foot,
.door.is-hovered .d-foot {
  border-top-color: rgba(243, 234, 214, 0.26);
}

.d-cta {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  transition: color 0.3s var(--ease), transform 0.38s var(--ease-out);
}

body:not(.cinema-open)[data-door=""] .door--archive .d-cta,
.door:hover .d-cta,
.door:focus-visible .d-cta,
.door.is-hovered .d-cta {
  color: var(--text-primary);
}

.door:hover .d-cta,
.door:focus-visible .d-cta,
.door.is-hovered .d-cta {
  transform: translate3d(3px, 0, 0);
}

/* Precision Architectural Icon Jewel (7px chamfered square) */
.d-node {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(243, 234, 214, 0.07);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px rgba(243, 234, 214, 0.16);
  flex-shrink: 0;
  transition:
    background-color 0.35s var(--ease),
    color 0.35s var(--ease),
    box-shadow 0.35s var(--ease),
    transform 0.38s var(--ease-out);
}

.d-node .btn-icon {
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

/* At rest (no door hovered), Door 01 holds the primary warm cream jewel.
   When any door is hovered/focused, the solid cream jewel transfers exclusively to that door. */
body:not(.cinema-open)[data-door=""] .d-node--primary,
.cp-play,
.door:hover .d-node,
.door:focus-visible .d-node,
.door.is-hovered .d-node {
  background: var(--cream);
  color: #080908;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 2px 10px rgba(0, 0, 0, 0.34);
}

.door:hover .d-node,
.door:focus-visible .d-node,
.door.is-hovered .d-node,
.cp-play:hover,
.cp-play:focus-visible {
  background: #fbf7ee;
  color: #080908;
  transform: translate3d(0, -1.5px, 0) scale(1.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 6px 18px rgba(243, 234, 214, 0.22),
    0 2px 8px rgba(0, 0, 0, 0.42);
}

.cp-play:active {
  transform: translate3d(0, 0, 0) scale(0.96);
}

/* Signature per-portal icon micro-kinematics */
.door--archive:hover .d-node .btn-icon,
.door--archive:focus-visible .d-node .btn-icon,
.door--archive.is-hovered .d-node .btn-icon {
  transform: translate3d(1.5px, -1.5px, 0);
}

.door--cinema:hover .d-node .btn-icon,
.door--cinema:focus-visible .d-node .btn-icon,
.door--cinema.is-hovered .d-node .btn-icon {
  transform: translate3d(1px, 0, 0) scale(1.08);
}

.door--pilot:hover .d-node .btn-icon,
.door--pilot:focus-visible .d-node .btn-icon,
.door--pilot.is-hovered .d-node .btn-icon {
  transform: translate3d(0, -1px, 0) scale(1.06);
}

.door--tools:hover .d-node .btn-icon,
.door--tools:focus-visible .d-node .btn-icon,
.door--tools.is-hovered .d-node .btn-icon {
  transform: rotate(90deg) scale(1.08);
}

.btn-icon {
  width: 11px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-icon--play {
  fill: currentColor;
  stroke: none;
}

.door[aria-disabled="true"] {
  cursor: default;
}

.door.nudge {
  animation: nudge 0.48s var(--ease);
}

@keyframes nudge {
  0%, 100% { translate: 0; }
  25% { translate: -4px; }
  60% { translate: 3px; }
}

/* ============================================================================
   STATE B1: RIGHT-SIDE VISUAL PLAYLIST (2 Pure Smoked-Crystal Cards, Zero Outer Box)
   ============================================================================ */
.c-playlist {
  position: absolute;
  right: var(--inset);
  bottom: calc(var(--inset) + 64px);
  width: clamp(176px, 19vw, 228px);
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 10px;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s 0.55s;
}

body.cinema-open .c-playlist {
  visibility: visible;
  pointer-events: auto;
  transition: visibility 0s 0s;
}

body.cinema-open.cinema-idle .c-playlist {
  pointer-events: none;
}

.cpl-card {
  position: relative;
  padding: 9px 10px 10px;
  border-radius: var(--card-radius);
  overflow: hidden;
  isolation: isolate;
  contain: paint;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: linear-gradient(160deg, rgba(var(--glass-hi-rgb), 0.66) 0%, rgba(var(--glass-lo-rgb), 0.85) 100%);
  -webkit-backdrop-filter: blur(38px) saturate(1.75) brightness(1.02);
  backdrop-filter: blur(38px) saturate(1.75) brightness(1.02);
  box-shadow:
    inset 0 1px 0 rgba(243, 234, 214, 0.16),
    0 24px 56px -14px rgba(0, 0, 0, 0.82);
  opacity: 0;
  transform: translate3d(24px, 0, 0);
  transition:
    opacity 0.48s var(--ease),
    transform 0.52s var(--ease-out),
    background 0.4s var(--ease),
    box-shadow 0.4s var(--ease);
}

body.cinema-open .cpl-card:nth-child(1) {
  transition-delay: 0.12s, 0.12s, 0s, 0s;
}

body.cinema-open .cpl-card:nth-child(2) {
  transition-delay: 0.18s, 0.18s, 0s, 0s;
}

body.cinema-open .cpl-card {
  opacity: 0.62;
  transform: translate3d(0, 0, 0);
}

body.cinema-open .cpl-card:hover {
  opacity: 0.92;
  transform: translate3d(-3px, 0, 0);
}

body.cinema-open .cpl-card.is-active {
  opacity: 1;
  background: linear-gradient(160deg, rgba(var(--glass-hi-rgb), 0.78) 0%, rgba(var(--glass-lo-rgb), 0.92) 100%);
  box-shadow:
    inset 0 1px 0 rgba(243, 234, 214, 0.30),
    0 28px 60px -14px rgba(0, 0, 0, 0.92);
}

body.cinema-open.cinema-idle .cpl-card {
  opacity: 0 !important;
  transform: translate3d(18px, 0, 0) !important;
  transition-delay: 0s !important;
}

.cpl-thumb {
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 7px;
  overflow: hidden;
  background: #040706;
}

.cpl-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.65s var(--ease-out);
}

.cpl-card:hover .cpl-thumb img,
.cpl-card.is-active .cpl-thumb img {
  transform: scale(1.05);
}

.cpl-dur {
  position: absolute;
  right: 6px;
  bottom: 5px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  background: rgba(8, 10, 9, 0.76);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(243, 234, 214, 0.14);
}

.cpl-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}

.cpl-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cpl-name {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.018em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cpl-sub {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================================
   STATE B2: APPLE-PREMIUM SMOKED-CRYSTAL PLAYER BAR (.c-player)
   Single 52px Bar · Liquid Cream Scrubber · Exact Same Language as /door/
   ============================================================================ */
.c-player {
  position: absolute;
  left: var(--inset);
  right: var(--inset);
  bottom: var(--inset);
  height: 52px;
  padding: 0 14px 0 12px;
  z-index: 12;
  border-radius: var(--card-radius);
  overflow: hidden;
  isolation: isolate;
  contain: paint;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(160deg, rgba(var(--glass-hi-rgb), 0.68) 0%, rgba(var(--glass-lo-rgb), 0.86) 100%);
  -webkit-backdrop-filter: blur(38px) saturate(1.75) brightness(1.02);
  backdrop-filter: blur(38px) saturate(1.75) brightness(1.02);
  box-shadow:
    inset 0 1px 0 rgba(243, 234, 214, 0.16),
    0 24px 56px -14px rgba(0, 0, 0, 0.86);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 22px, 0);
  transition:
    opacity 0.48s var(--ease),
    transform 0.52s var(--ease-out),
    visibility 0s 0.52s;
}

body.cinema-open .c-player {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
  transition:
    opacity 0.48s var(--ease) 0.16s,
    transform 0.52s var(--ease-out) 0.16s,
    visibility 0s 0s;
}

body.cinema-open.cinema-idle .c-player {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translate3d(0, 14px, 0) !important;
  transition-delay: 0s !important;
}

.cp-play {
  position: relative;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.cp-meta {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex-shrink: 0;
}

.cp-meta .d-index {
  padding-top: 0;
}

.cp-title {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.018em;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Apple TV+ Liquid Cream Progress Scrubber */
.cp-scrubber {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cp-time {
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.cp-time--dur {
  color: var(--text-muted);
}

.cp-timeline {
  position: relative;
  flex: 1;
  height: 28px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.cp-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(243, 234, 214, 0.16);
  overflow: hidden;
  transition: height 0.25s var(--ease);
}

.cp-timeline:hover .cp-track {
  height: 6px;
}

.cp-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: var(--cream);
  transform-origin: 0 50%;
  transform: scaleX(0);
  will-change: transform;
}

.cp-knob {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fbf7ee;
  transform: translate(-50%, -50%) scale(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  transition: transform 0.2s var(--ease);
}

.cp-timeline:hover .cp-knob {
  transform: translate(-50%, -50%) scale(1);
}

.cp-hover-time {
  position: absolute;
  bottom: 24px;
  left: 0;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  background: rgba(8, 10, 9, 0.88);
  box-shadow: inset 0 0 0 1px rgba(243, 234, 214, 0.16);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.cp-timeline:hover .cp-hover-time {
  opacity: 1;
}

/* Right Minimalist Actions (Same .bar-action style as Top Bar) */
.cp-actions {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.cp-act {
  margin: 0 -6px;
  padding: 0 8px;
}

.cp-vol {
  width: 54px;
  height: 28px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.cp-vol-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(243, 234, 214, 0.16);
  overflow: hidden;
  transition: height 0.2s ease;
}

.cp-vol:hover .cp-vol-track {
  height: 6px;
}

.cp-vol-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: var(--cream);
}

.cp-doors-btn {
  margin: 0 -4px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.cp-doors-btn:hover {
  color: var(--text-primary);
}

/* ── Portal Leave Transition ── */
body.leaving .doors,
body.leaving .c-playlist,
body.leaving .c-player,
body.leaving .bar {
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}

body.leaving .doors {
  transform: translate3d(0, 20px, 0) !important;
  transition: opacity 0.45s var(--ease), transform 0.6s var(--ease);
}

body.leaving .screen-shade {
  opacity: 0;
}

body.leaving-archive .screen,
body.leaving-tools .screen,
body.leaving-pilot .screen {
  transition: transform 0.85s var(--ease-io), border-radius 0.85s var(--ease-io);
  transform: translate3d(var(--zx, 0), var(--zy, 0), 0) scale(var(--zs, 1));
  border-radius: 0;
}

/* ── Responsive Layout ── */
@media (max-width: 720px) {
  :root {
    --door-h: auto;
    --inset: 14px;
    --card-radius: 10px;
    --sw: calc(100vw - 24px);
  }
  .brand-sig .bar-sep,
  .wm-sub,
  .cp-vol {
    display: none;
  }
  .stage {
    inset: 12px 0;
    perspective: none;
  }
  .rig, .screen, .amb, .room {
    aspect-ratio: auto;
    height: 100%;
  }
  .doors {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .door {
    height: auto;
    padding: 13px 16px;
    gap: 10px;
  }
  .d-name {
    font-size: 16px;
  }
  .d-sub {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.boot .screen { transform: none; filter: none; }
  body.on .screen, body.on .power { animation: none; }
  .power { display: none; }
  .door { transform: none; }
}
