:root {
  --bg-page: #ffffff;
  --card-dark: #191919;
  --card-light: #ffffff;
  --text-dark: #191919;
  --text-light: #f5f5f7;
}

* {
  box-sizing: border-box;
}

html,
body {
  scroll-behavior: smooth;
  font-family: 'Google Sans', 'Google Sans Text', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-dark);
  max-width: 100%;
  overflow-x: clip;
}

code,
kbd,
pre,
.font-mono {
  font-family: 'Google Sans Mono', ui-monospace, SFMono-Regular, monospace;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  background-color: #ffffff;
  background-image: radial-gradient(rgba(0, 0, 0, 0.13) 1px, transparent 1px);
  background-size: 22px 22px;
  overflow-x: clip;
}

/* Bento Card Surfaces with Permanent Floating Drop Shadow & Subtle 3D Push-in Hover */
.bento-dark {
  background-color: #191919;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 16px 16px;
  color: #ffffff;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 42px -8px rgba(0, 0, 0, 0.42), 0 4px 14px -2px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  min-width: 0;
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.bento-dark:hover {
  will-change: transform;
  box-shadow: 0 28px 56px -10px rgba(0, 0, 0, 0.58), 0 10px 24px -4px rgba(0, 0, 0, 0.32);
  border-color: rgba(255, 255, 255, 0.16);
  z-index: 20;
}

/* ============================================================================
   BENTO INTERACTIVE MOUSE-FOLLOWING AMBIENT GLOW SPOT
   Soft multi-stop radial spotlight (0 GPU blur passes) following the cursor.
   ============================================================================ */
.bento-glow-spot {
  position: absolute;
  top: 0;
  left: 0;
  width: 520px;
  height: 520px;
  margin-top: -260px;
  margin-left: -260px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(16, 185, 129, 0.22) 0%,
    rgba(16, 185, 129, 0.12) 26%,
    rgba(16, 185, 129, 0.045) 50%,
    rgba(16, 185, 129, 0.01) 66%,
    transparent 74%
  );
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 0, 0);
  transition: opacity 0.4s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 1;
}

.bento-light {
  background-color: #ffffff;
  background-image: radial-gradient(rgba(0, 0, 0, 0.055) 1px, transparent 1px);
  background-size: 16px 16px;
  color: #191919;
  border-radius: 28px;
  border: 1px solid rgba(0, 0, 0, 0.09);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.12), 0 4px 12px -2px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
  min-width: 0;
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.bento-light:hover {
  will-change: transform;
  box-shadow: 0 24px 48px -10px rgba(0, 0, 0, 0.14), 0 8px 20px -6px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.14);
  z-index: 20;
}

/* Concentric Inner Media Radius: R_inner = R_outer (28px) - padding (14px) = 14px */
.bento-inner-media {
  border-radius: 14px;
  overflow: hidden;
}

/* 3D Folder Card (Zalak Patel Case Study / Folder Hover Style) */
.folder-scene {
  perspective: 1100px;
  min-width: 0;
}

.folder-wrapper {
  position: relative;
  width: 100%;
  height: 300px;
  border-radius: 28px;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  user-select: none;
}

.folder-backplate {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.28), 0 10px 25px -8px rgba(0, 0, 0, 0.18);
  transition: filter 0.35s ease;
}

/* Top-left folder tab ear */
.folder-tab-ear {
  position: absolute;
  top: -12px;
  left: 0;
  width: 128px;
  height: 28px;
  border-top-left-radius: 16px;
  border-top-right-radius: 14px;
}

/* Fanned inner preview cards */
.folder-cards-stack {
  position: absolute;
  inset: 0;
  bottom: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
}

.folder-preview-item {
  position: absolute;
  width: 252px;
  height: 168px;
  border-radius: 16px;
  overflow: hidden;
  background: #222;
  border: 2.5px solid rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
  transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.25, 1.15), box-shadow 0.45s ease, opacity 0.35s ease;
  transform-origin: bottom center;
}

.folder-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* At rest: 1 BIG hero image in center front (item-0), 2 back images (item-1, item-2) ~90% hidden behind it */
.folder-preview-item.item-0 {
  transform: translate(0px, -14px) rotate(0deg) scale(1.0);
  z-index: 15;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
}
.folder-preview-item.item-1 {
  transform: translate(-24px, -6px) rotate(-7deg) scale(0.91);
  z-index: 11;
  opacity: 0.92;
}
.folder-preview-item.item-2 {
  transform: translate(24px, -6px) rotate(7deg) scale(0.91);
  z-index: 12;
  opacity: 0.92;
}

/* On Hover: Center card lifts up, 2 back cards peek out wider from behind */
.folder-wrapper:hover .folder-preview-item.item-0 {
  transform: translate(0px, -32px) rotate(0deg) scale(1.05);
  box-shadow: 0 26px 46px rgba(0, 0, 0, 0.44);
}
.folder-wrapper:hover .folder-preview-item.item-1 {
  transform: translate(-56px, -20px) rotate(-13deg) scale(0.95);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.32);
  opacity: 1;
}
.folder-wrapper:hover .folder-preview-item.item-2 {
  transform: translate(56px, -20px) rotate(13deg) scale(0.95);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.32);
  opacity: 1;
}

/* Front Frosted Pocket — Compact bottom bar so images are never covered */
.folder-front-pocket {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 82px;
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(0,0,0,0.48) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1.5px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
  z-index: 20;
  transform-origin: bottom center;
  transition: transform 0.42s cubic-bezier(0.2, 0.85, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 18px;
}

.folder-wrapper:hover .folder-front-pocket {
  transform: rotateX(-20deg);
}

/* Dashboard Explore Folder Card variant */
.dashboard-folder-card .dash-preview-0,
.dashboard-folder-card .dash-preview-1,
.dashboard-folder-card .dash-preview-2 {
  width: 224px;
  height: 144px;
}
.dashboard-folder-card:hover .dash-preview-0 {
  transform: translate(0px, -26px) rotate(0deg) scale(1.05);
}
.dashboard-folder-card:hover .dash-preview-1 {
  transform: translate(-48px, -16px) rotate(-12deg) scale(0.95);
}
.dashboard-folder-card:hover .dash-preview-2 {
  transform: translate(48px, -16px) rotate(12deg) scale(0.95);
}
.dashboard-folder-card:hover .dash-pocket {
  transform: rotateX(-18deg);
}

/* Staggered Bento Card Reveal Animation */
@keyframes bentoReveal {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.bento-stagger-item {
  animation: bentoReveal 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--stagger-delay, 0ms);
  will-change: opacity, transform;
}

/* Smooth Dynamic Controls Transition inside Bento Cards */
@keyframes bentoControlsEnter {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.bento-controls-enter {
  animation: bentoControlsEnter 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.animate-view {
  opacity: 1;
}

/* Hide scrollbars utility */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Mobile Responsive Adjustments for 3D Folder Cards */
@media (max-width: 640px) {
  .folder-wrapper {
    height: 280px;
  }
  .folder-preview-item {
    width: 216px;
    height: 146px;
  }
  .folder-preview-item.item-0 {
    transform: translate(0px, -12px) rotate(0deg) scale(1.0);
  }
  .folder-preview-item.item-1 {
    transform: translate(-20px, -5px) rotate(-7deg) scale(0.91);
  }
  .folder-preview-item.item-2 {
    transform: translate(20px, -5px) rotate(7deg) scale(0.91);
  }
  .folder-front-pocket {
    height: 78px;
    padding: 10px 16px;
  }
}

/* ============================================================================
   FULLSCREEN VIDEO ASPECT RATIO FIX
   Prevent vertical (9:16) videos from zooming and filling horizontally.
   Always preserve full video frame with native aspect ratio & black letterboxing.
   ============================================================================ */
video:fullscreen,
:fullscreen video {
  object-fit: contain !important;
  background-color: #000000 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
}

video:-webkit-full-screen,
:-webkit-full-screen video {
  object-fit: contain !important;
  background-color: #000000 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
}

video:-moz-full-screen,
:-moz-full-screen video {
  object-fit: contain !important;
  background-color: #000000 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
}

/* ============================================================================
   BRAND LOGOS MARQUEE (LEFT-TO-RIGHT WITH SMOOTH FADED EDGES)
   Each logo is a PNG sitting directly on dark background without frames.
   ============================================================================ */
.logo-marquee-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  /* Smooth progressive fade out on both left (0-12%) and right (88-100%) edges */
  mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
  padding: 0.3rem 0;
}

.logo-marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  will-change: transform;
  /* Scrolls smoothly from Left to Right */
  animation: logoMarqueeLtoR 24s linear infinite;
}

.logo-marquee-wrapper:hover .logo-marquee-track {
  animation-play-state: paused;
}

@keyframes logoMarqueeLtoR {
  0% {
    transform: translateX(-50%);
  }
  100% {
    transform: translateX(0%);
  }
}

.logo-marquee-item {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.65rem; /* Compact gap between logos */
  user-select: none;
}

.logo-marquee-item img {
  height: 1.65rem; /* ~26px on mobile */
  width: auto;
  max-width: 130px;
  object-fit: contain;
  opacity: 0.85;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  -webkit-user-drag: none;
}

@media (min-width: 640px) {
  .logo-marquee-item {
    padding: 0 0.8rem; /* ~25px gap on desktop for compact look */
  }
  .logo-marquee-item img {
    height: 1.75rem; /* ~28px on desktop */
    max-width: 140px;
  }
}

.logo-marquee-item:hover img {
  opacity: 1;
  transform: scale(1.08);
}

/* ============================================================================
   WORK TAB PROJECT CARDS (HOVER SCALE & FLOATING 3D LIFT)
   Scales up smoothly on hover and elevates with enhanced drop shadow.
   ============================================================================ */
/* Isolated stacking context for Work Grid without clipping outer cards/shadows */
#work-projects-grid {
  isolation: isolate;
}

.work-card {
  transition:
    transform 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: visible !important;
  transform-style: flat;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.work-card:hover {
  transform: perspective(1000px) translateY(-4px) scale(1.025);
  z-index: 30;
  box-shadow: 0 24px 48px -10px rgba(0, 0, 0, 0.14), 0 8px 20px -6px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.12);
}

/* ============================================================================
   WORK TAB ADAPTIVE CARD STACK (DUO & TRIO POP-OUT)
   Multi-card layered deck for projects with 2 or 3 sub-projects/editions.
   Clean 2D transforms keep crisp border-radius on Firefox/Zen & Chromium.
   ============================================================================ */
.work-stack-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  background-color: transparent;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.work-stack-card {
  position: absolute;
  width: 90%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background-color: #f0f1f4;
  border: none;
  outline: none;
  transition:
    transform 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center bottom;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.work-card:hover .work-stack-card {
  will-change: transform;
}

.work-stack-card.is-loaded {
  background-color: transparent;
}

.work-stack-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  border-radius: 14px;
  clip-path: inset(0 round 14px);
}

/* --- TRIO CONFIGURATION (3 CARDS) --- */
/* Resting positions */
.work-stack-stage.is-trio .card-0 {
  transform: translate(0px, 2px) rotate(0deg) scale(1);
  z-index: 15;
  box-shadow: 0 14px 28px -4px rgba(0, 0, 0, 0.22), 0 4px 10px -2px rgba(0, 0, 0, 0.12);
}

.work-stack-stage.is-trio .card-1 {
  transform: translate(-12px, 0px) rotate(-3.5deg) scale(0.95);
  z-index: 11;
  opacity: 0.94;
  box-shadow: 0 8px 18px -3px rgba(0, 0, 0, 0.16), 0 2px 6px -1px rgba(0, 0, 0, 0.08);
}

.work-stack-stage.is-trio .card-2 {
  transform: translate(12px, 0px) rotate(3.5deg) scale(0.95);
  z-index: 12;
  opacity: 0.94;
  box-shadow: 0 8px 18px -3px rgba(0, 0, 0, 0.16), 0 2px 6px -1px rgba(0, 0, 0, 0.08);
}

/* Hover pop-out (slight edge overhang while keeping clear gap from adjacent cards) */
.work-card:hover .work-stack-stage.is-trio .card-0 {
  transform: translate(0px, -8px) rotate(0deg) scale(1.03);
  box-shadow: 0 22px 42px -6px rgba(0, 0, 0, 0.26), 0 6px 14px -2px rgba(0, 0, 0, 0.14);
  z-index: 25;
}

.work-card:hover .work-stack-stage.is-trio .card-1 {
  transform: translate(-34px, -4px) rotate(-6deg) scale(0.97);
  box-shadow: 0 14px 28px -4px rgba(0, 0, 0, 0.2), 0 4px 10px -2px rgba(0, 0, 0, 0.1);
  opacity: 1;
  z-index: 13;
}

.work-card:hover .work-stack-stage.is-trio .card-2 {
  transform: translate(34px, -4px) rotate(6deg) scale(0.97);
  box-shadow: 0 14px 28px -4px rgba(0, 0, 0, 0.2), 0 4px 10px -2px rgba(0, 0, 0, 0.1);
  opacity: 1;
  z-index: 14;
}

/* --- DUO CONFIGURATION (2 CARDS) --- */
/* Resting positions */
.work-stack-stage.is-duo .card-0 {
  transform: translate(-7px, 2px) rotate(-2deg) scale(0.99);
  z-index: 15;
  box-shadow: 0 14px 28px -4px rgba(0, 0, 0, 0.22), 0 4px 10px -2px rgba(0, 0, 0, 0.12);
}

.work-stack-stage.is-duo .card-1 {
  transform: translate(9px, -1px) rotate(3.5deg) scale(0.96);
  z-index: 12;
  opacity: 0.94;
  box-shadow: 0 8px 18px -3px rgba(0, 0, 0, 0.16), 0 2px 6px -1px rgba(0, 0, 0, 0.08);
}

/* Hover pop-out (slight edge overhang while keeping clear gap from adjacent cards) */
.work-card:hover .work-stack-stage.is-duo .card-0 {
  transform: translate(-24px, -7px) rotate(-5deg) scale(1.02);
  box-shadow: 0 22px 42px -6px rgba(0, 0, 0, 0.26), 0 6px 14px -2px rgba(0, 0, 0, 0.14);
  z-index: 16;
  opacity: 1;
}

.work-card:hover .work-stack-stage.is-duo .card-1 {
  transform: translate(30px, -4px) rotate(6deg) scale(0.99);
  box-shadow: 0 14px 28px -4px rgba(0, 0, 0, 0.2), 0 4px 10px -2px rgba(0, 0, 0, 0.1);
  z-index: 14;
  opacity: 1;
}

@media (max-width: 480px) {
  .work-stack-card {
    width: 84%;
  }
  .work-card:hover .work-stack-stage.is-trio .card-1 {
    transform: translate(-24px, -2px) rotate(-6.5deg) scale(0.95);
  }
  .work-card:hover .work-stack-stage.is-trio .card-2 {
    transform: translate(24px, -2px) rotate(6.5deg) scale(0.95);
  }
}


/* ============================================================================
   EXPLORE ALL WORKS - 5-CARD INTERACTIVE STACK (ORGANIC CASUAL FAN DECK)
   Slightly larger cards, organic asymmetric tilt at rest, interactive reveal.
   ============================================================================ */
.card-stack-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
  padding: 0.75rem 0.25rem 0.65rem 0.25rem;
  overflow: visible;
}

.stack-card {
  position: relative;
  width: 86px;
  height: 126px;
  border-radius: 14px;
  overflow: hidden;
  background-color: #16181f;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: -4px 8px 22px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3);
  /* Default organic resting rotation & vertical stagger */
  transform: translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
  transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.38s ease, border-color 0.38s ease;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  transform-origin: center bottom;
  will-change: transform;
}

@media (min-width: 640px) {
  .stack-card {
    width: 104px;
    height: 150px;
    border-radius: 16px;
  }
}

/* Organic asymmetric default scatter (không đều quá, tạo cảm giác xếp bài tự nhiên) */
.stack-card:nth-child(1) { --default-rot: -5.5deg; --default-y: 3px; }
.stack-card:nth-child(2) { --default-rot: 2.2deg;  --default-y: -4px; }
.stack-card:nth-child(3) { --default-rot: -2.8deg; --default-y: -6px; }
.stack-card:nth-child(4) { --default-rot: 4.8deg;  --default-y: -2px; }
.stack-card:nth-child(5) { --default-rot: 7.2deg;  --default-y: 4px; }

.stack-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  transition: transform 0.4s ease;
}

/* Overlapping stacking */
.stack-card + .stack-card {
  margin-left: -34px;
}

@media (min-width: 640px) {
  .stack-card + .stack-card {
    margin-left: -44px;
  }
}

/* When a card is hovered: lifts up prominently, tilts, expands and glows */
.stack-card:hover {
  transform: translateY(-14px) rotate(-8deg) scale(1.1) !important;
  z-index: 30;
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow: -8px 24px 44px rgba(0, 0, 0, 0.8), 0 0 24px rgba(255, 255, 255, 0.22);
}

.stack-card:hover img {
  transform: scale(1.08);
}

/* ============================================================================
   SYMMETRICAL BI-DIRECTIONAL EXPANSION (ALIGN GIỮA ĐỐI XỨNG HAI PHÍA)
   Hover thẻ nào thì các thẻ bên trái dạt sang trái, các thẻ bên phải dạt sang phải.
   Cụm 5 thẻ luôn giữ trọng tâm chính giữa cân đối hoàn hảo.
   ============================================================================ */

/* Mobile bi-directional shifts */
.card-stack-container:has(.stack-card:nth-child(1):hover) .stack-card:nth-child(n+2) {
  transform: translateX(32px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
}

.card-stack-container:has(.stack-card:nth-child(2):hover) .stack-card:nth-child(1) {
  transform: translateX(-20px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
}
.card-stack-container:has(.stack-card:nth-child(2):hover) .stack-card:nth-child(n+3) {
  transform: translateX(26px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
}

.card-stack-container:has(.stack-card:nth-child(3):hover) .stack-card:nth-child(1) {
  transform: translateX(-28px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
}
.card-stack-container:has(.stack-card:nth-child(3):hover) .stack-card:nth-child(2) {
  transform: translateX(-18px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
}
.card-stack-container:has(.stack-card:nth-child(3):hover) .stack-card:nth-child(4) {
  transform: translateX(18px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
}
.card-stack-container:has(.stack-card:nth-child(3):hover) .stack-card:nth-child(5) {
  transform: translateX(28px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
}

.card-stack-container:has(.stack-card:nth-child(4):hover) .stack-card:nth-child(-n+3) {
  transform: translateX(-26px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
}
.card-stack-container:has(.stack-card:nth-child(4):hover) .stack-card:nth-child(5) {
  transform: translateX(20px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
}

.card-stack-container:has(.stack-card:nth-child(5):hover) .stack-card:nth-child(-n+4) {
  transform: translateX(-32px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
}

/* Desktop bi-directional shifts (min-width: 640px) */
@media (min-width: 640px) {
  .card-stack-container:has(.stack-card:nth-child(1):hover) .stack-card:nth-child(n+2) {
    transform: translateX(44px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
  }

  .card-stack-container:has(.stack-card:nth-child(2):hover) .stack-card:nth-child(1) {
    transform: translateX(-28px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
  }
  .card-stack-container:has(.stack-card:nth-child(2):hover) .stack-card:nth-child(n+3) {
    transform: translateX(36px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
  }

  .card-stack-container:has(.stack-card:nth-child(3):hover) .stack-card:nth-child(1) {
    transform: translateX(-38px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
  }
  .card-stack-container:has(.stack-card:nth-child(3):hover) .stack-card:nth-child(2) {
    transform: translateX(-24px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
  }
  .card-stack-container:has(.stack-card:nth-child(3):hover) .stack-card:nth-child(4) {
    transform: translateX(24px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
  }
  .card-stack-container:has(.stack-card:nth-child(3):hover) .stack-card:nth-child(5) {
    transform: translateX(38px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
  }

  .card-stack-container:has(.stack-card:nth-child(4):hover) .stack-card:nth-child(-n+3) {
    transform: translateX(-36px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
  }
  .card-stack-container:has(.stack-card:nth-child(4):hover) .stack-card:nth-child(5) {
    transform: translateX(28px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
  }

  .card-stack-container:has(.stack-card:nth-child(5):hover) .stack-card:nth-child(-n+4) {
    transform: translateX(-44px) translateY(var(--default-y, 0px)) rotate(var(--default-rot, 0deg));
  }
}

/* Overlay brand badge that fades in on card hover */
.stack-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.25) 45%, transparent 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
  display: flex;
  align-items: flex-end;
  padding: 0.6rem;
  pointer-events: none;
}

.stack-card:hover .stack-card-overlay {
  opacity: 1;
}

.stack-card-overlay span {
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* ============================================================================
   ERGONOMIC 3D GLTF MORPH RANGE SLIDERS (COMPACT LIGHT MODE)
   Compact hit target (22px desktop / 30px touch), filled track & center tick.
   ============================================================================ */
.gltf-slider-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 22px;
  width: 100%;
}

.gltf-slider-mid-tick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 9px;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.28);
  border-radius: 999px;
  pointer-events: none;
  z-index: 1;
}

.gltf-range-slider {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  z-index: 2;
  touch-action: pan-y;
}

.gltf-range-slider:focus {
  outline: none;
}

.gltf-range-slider::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 9999px;
  background: linear-gradient(
    90deg,
    #0ea5e9 0%,
    #0ea5e9 var(--val-pct, 0%),
    rgba(15, 23, 42, 0.12) var(--val-pct, 0%),
    rgba(15, 23, 42, 0.12) 100%
  );
}

.gltf-range-slider::-moz-range-track {
  height: 5px;
  border-radius: 9999px;
  background: linear-gradient(
    90deg,
    #0ea5e9 0%,
    #0ea5e9 var(--val-pct, 0%),
    rgba(15, 23, 42, 0.12) var(--val-pct, 0%),
    rgba(15, 23, 42, 0.12) 100%
  );
}

.gltf-range-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  margin-top: -5px;
  border-radius: 9999px;
  background: #ffffff;
  border: 2px solid #0ea5e9;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.gltf-range-slider::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 9999px;
  background: #ffffff;
  border: 2px solid #0ea5e9;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.gltf-range-slider:hover::-webkit-slider-thumb,
.gltf-range-slider:active::-webkit-slider-thumb {
  transform: scale(1.16);
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.3), 0 0 0 4px rgba(14, 165, 233, 0.16);
}

.gltf-range-slider:hover::-moz-range-thumb,
.gltf-range-slider:active::-moz-range-thumb {
  transform: scale(1.16);
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.3), 0 0 0 4px rgba(14, 165, 233, 0.16);
}

@media (pointer: coarse) {
  .gltf-slider-wrap,
  .gltf-range-slider {
    height: 30px;
  }
  .gltf-range-slider::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    margin-top: -7.5px;
  }
  .gltf-range-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }
}

/* ============================================================================
   3D GLTF ANNOTATION HOTSPOTS (PROJECTED MEASUREMENT PINS)
   ============================================================================ */
.gltf-hotspot-dot {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  border: 1.5px solid rgba(15, 23, 42, 0.22);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  z-index: 3;
}

.gltf-hotspot-dot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 9999px;
}

.gltf-hotspot-core {
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background: #191919;
  transition: transform 0.15s ease;
}

.gltf-hotspot-tip {
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 9.5px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-weight: 700;
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 9999px;
  background: rgba(25, 25, 25, 0.88);
  color: #ffffff;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.gltf-hotspot-dot:hover,
.gltf-hotspot-dot:focus-visible {
  border-color: #e11d74;
  box-shadow: 0 0 0 4px rgba(225, 29, 116, 0.18), 0 3px 10px rgba(15, 23, 42, 0.24);
  outline: none;
  z-index: 6;
}

.gltf-hotspot-dot:hover .gltf-hotspot-core,
.gltf-hotspot-dot:focus-visible .gltf-hotspot-core {
  background: #e11d74;
  transform: scale(1.2);
}

.gltf-hotspot-dot:hover .gltf-hotspot-tip,
.gltf-hotspot-dot:focus-visible .gltf-hotspot-tip {
  opacity: 1;
}

.gltf-hotspot-dot.is-backface {
  opacity: 0.34;
  z-index: 1;
}

.gltf-hotspot-dot.is-backface:hover {
  opacity: 0.95;
  z-index: 6;
}

.gltf-hotspot-dot.is-active {
  background: #e11d74;
  border-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(225, 29, 116, 0.28), 0 3px 10px rgba(225, 29, 116, 0.35);
  opacity: 1;
  z-index: 5;
}

.gltf-hotspot-dot.is-active .gltf-hotspot-core {
  background: #ffffff;
}

.gltf-hotspot-dot.is-active .gltf-hotspot-tip {
  opacity: 1;
  background: #e11d74;
}

@media (max-width: 639px) {
  .gltf-hotspot-dot {
    width: 13px;
    height: 13px;
    border-width: 1.5px;
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.22);
  }
  .gltf-hotspot-dot::after {
    inset: -9px;
  }
  .gltf-hotspot-core {
    width: 4px;
    height: 4px;
  }
  .gltf-hotspot-dot.is-backface {
    opacity: 0;
    pointer-events: none;
  }
  .gltf-hotspot-dot.is-active {
    box-shadow: 0 0 0 3px rgba(225, 29, 116, 0.28), 0 2px 6px rgba(225, 29, 116, 0.32);
  }
  .gltf-hotspot-dot.is-active .gltf-hotspot-tip {
    display: none;
  }
}

@media (pointer: coarse) and (min-width: 640px) {
  .gltf-hotspot-dot {
    width: 18px;
    height: 18px;
  }
  .gltf-hotspot-dot::after {
    inset: -7px;
  }
}

/* ============================================================================
   ULTRA-LIGHTWEIGHT IMAGE PLACEHOLDER & SHIMMER (0 NETWORK REQUESTS)
   Suppresses raw browser alt-text while loading/failing (Firefox/Zen/Chrome),
   renders a clean Bento surface + inline SVG frame (~260 bytes) + shimmer,
   then smoothly fades images in and halts GPU shimmer on load.
   ============================================================================ */
#app-root img,
#lightbox-modal img {
  color: transparent;
  font-size: 0;
}

.media-placeholder-shell {
  background-color: #f0f1f4;
  overflow: hidden;
}

.media-placeholder-shell:not(.work-stack-card) {
  position: relative;
}

.media-placeholder-shell.is-dark {
  background-color: #1c1e26;
}

.media-placeholder-shell.is-loaded:not(.work-stack-card) {
  background-color: transparent;
}

.media-placeholder-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.045);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 36px 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 24 24' fill='none' stroke='%23191919' stroke-opacity='0.14' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='3'/%3E%3Ccircle cx='8.5' cy='9.5' r='1.5'/%3E%3Cpath d='M21 15.5l-4.5-4.5a1.5 1.5 0 0 0-2.1 0L6 19.4'/%3E%3C/svg%3E");
  transition: opacity 0.24s ease;
}

.media-placeholder-shell.is-dark::before {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='0.18' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='3'/%3E%3Ccircle cx='8.5' cy='9.5' r='1.5'/%3E%3Cpath d='M21 15.5l-4.5-4.5a1.5 1.5 0 0 0-2.1 0L6 19.4'/%3E%3C/svg%3E");
}

.media-placeholder-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(110deg, transparent 22%, rgba(255, 255, 255, 0.65) 50%, transparent 78%);
  transform: translateX(-100%);
  animation: mediaPlaceholderShimmer 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.media-placeholder-shell.is-dark::after {
  background: linear-gradient(110deg, transparent 22%, rgba(255, 255, 255, 0.08) 50%, transparent 78%);
}

.media-placeholder-shell.is-loaded::before,
.media-placeholder-shell.is-loaded::after {
  opacity: 0;
  animation: none;
}

.media-placeholder-shell.is-error::after {
  opacity: 0;
  animation: none;
}

.media-placeholder-shell.is-native-height:not(.is-loaded) {
  min-height: 200px;
}

.media-placeholder-shell.is-native-height.is-compact:not(.is-loaded) {
  min-height: 96px;
}

@keyframes mediaPlaceholderShimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .media-placeholder-shell::after {
    animation: none;
    opacity: 0;
  }
}

.media-img-fade {
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.media-img-fade.is-loaded {
  opacity: 1;
}

.media-img-fade.is-instant {
  opacity: 1;
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.media-img-fade.is-error {
  opacity: 0 !important;
}




