/* ============================================================
   Mirror-hall work section — an immersive draggable 3D rotunda
   of project cards over a reflective pool (scripts/mirrorhall.js).
   Adapted from a full-page treatment to an in-flow 100vh section,
   restyled to the Devsteem palette (teals) and type (Chakra Petch
   display / IBM Plex Mono technical).
   ============================================================ */
.mirror-hall {
  position: relative;
  z-index: 20;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  background: #000;
}
.mh-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  /* pan-y keeps vertical touch-scroll alive; horizontal drags spin the ring */
  touch-action: pan-y;
  cursor: grab;
}
.mh-canvas.-dragging { cursor: grabbing; }

/* CSS3D card-label layer (real 3D perspective, parented per card) */
.mh-css3d {
  position: absolute !important;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.mh-card-label {
  white-space: nowrap;
  text-align: center;
  font-family: var(--font-display, "Chakra Petch"), sans-serif;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* ---- HUD: crisp DOM overlay, canvas stays draggable beneath ------- */
.mh-hud {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  color: #eafcff;
  --mh-accent: #4dd0e1;
}
.mh-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(130% 90% at 50% 42%, transparent 52%, rgba(1, 6, 8, 0.55) 100%),
    linear-gradient(to bottom, rgba(1, 6, 8, 0.42) 0%, transparent 20%, transparent 62%, rgba(1, 6, 8, 0.62) 100%);
}
.mh-frame {
  position: absolute;
  inset: clamp(14px, 2.4vh, 26px);
  border: 1px solid rgba(122, 216, 230, 0.12);
  border-radius: 3px;
  box-shadow: inset 0 0 60px rgba(1, 8, 11, 0.5);
}
.mh-frame::before,
.mh-frame::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(148, 226, 238, 0.55);
}
.mh-frame::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.mh-frame::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* masthead */
.mh-mast {
  position: absolute;
  top: clamp(30px, 6.6vh, 66px);
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  text-align: center;
}
.mh-kicker {
  font-family: var(--font-text, "IBM Plex Mono"), monospace;
  font-size: clamp(8.5px, 0.95vw, 10px);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(170, 214, 224, 0.55);
  margin-bottom: 15px;
}
.mh-kicker b { color: var(--mh-accent); font-weight: 600; }
.mh-mast h2 {
  margin: 0;
  font-family: var(--font-display, "Chakra Petch"), sans-serif;
  font-weight: 500;
  font-size: clamp(30px, 5.6vw, 66px);
  line-height: 1;
  letter-spacing: 0.015em;
  color: #f0fbfd;
  text-shadow: 0 2px 44px rgba(0, 168, 204, 0.4), 0 1px 3px rgba(0, 0, 0, 0.55);
}
.mh-sub {
  margin-top: 16px;
  font-family: var(--font-text, "IBM Plex Mono"), monospace;
  font-size: clamp(10.5px, 1.25vw, 13px);
  font-weight: 300;
  letter-spacing: 0.05em;
  color: rgba(196, 232, 238, 0.6);
}

/* focus caption — bottom-centre, tracks the front card */
.mh-focus {
  position: absolute;
  bottom: clamp(34px, 7vh, 74px);
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
}
.mh-counter {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font: 500 12px/1 var(--font-text, "IBM Plex Mono"), monospace;
  letter-spacing: 0.16em;
}
.mh-counter .mh-num {
  color: var(--mh-accent);
  font-size: 14px;
  text-shadow: 0 0 16px rgba(77, 208, 225, 0.5);
}
.mh-counter i { color: rgba(180, 226, 236, 0.34); font-style: normal; }
.mh-counter .mh-total { color: rgba(180, 226, 236, 0.5); }
.mh-name {
  font-family: var(--font-display, "Chakra Petch"), sans-serif;
  font-weight: 500;
  font-size: clamp(20px, 3.4vw, 34px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #effbfd;
  text-shadow: 0 2px 30px rgba(0, 168, 204, 0.4), 0 1px 2px rgba(0, 0, 0, 0.6);
  will-change: transform, opacity, filter;
}
@keyframes mhFocusSwap {
  from { opacity: 0; transform: translateY(9px); filter: blur(5px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
.mh-name.-swap { animation: mhFocusSwap 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.mh-dots { display: flex; align-items: center; gap: 9px; margin-top: 2px; }
.mh-dots i {
  width: 5px;
  height: 5px;
  border-radius: 4px;
  background: rgba(158, 210, 222, 0.26);
  transition: width 0.5s cubic-bezier(0.22, 0.61, 0.36, 1), background 0.5s ease, box-shadow 0.5s ease;
}
.mh-dots i.-on {
  width: 22px;
  background: var(--mh-accent);
  box-shadow: 0 0 12px rgba(77, 208, 225, 0.65);
}

/* drag hint — fades for good after the first interaction */
.mh-hint {
  position: absolute;
  bottom: clamp(34px, 7vh, 74px);
  right: clamp(26px, 4vw, 58px);
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-text, "IBM Plex Mono"), monospace;
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(178, 226, 236, 0.5);
  transition: opacity 0.8s ease;
}
.mh-hint::before {
  content: "";
  width: 22px;
  height: 1px;
  background: rgba(178, 226, 236, 0.4);
  animation: mhHintSlide 2.4s ease-in-out infinite;
}
@keyframes mhHintSlide {
  0%, 100% { transform: translateX(0); opacity: 0.35; }
  50% { transform: translateX(6px); opacity: 0.9; }
}

/* intro reveal — overlays settle in once the scene is built */
.mh-mast, .mh-focus, .mh-hint {
  opacity: 0;
  transform-origin: center;
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.mh-mast { transform: translateX(-50%) translateY(-12px); }
.mh-focus { transform: translateX(-50%) translateY(14px); }
.mirror-hall.-ready .mh-mast { opacity: 1; transform: translateX(-50%) translateY(0); }
.mirror-hall.-ready .mh-focus { opacity: 1; transform: translateX(-50%) translateY(0); }
.mirror-hall.-ready .mh-hint { opacity: 1; }
.mirror-hall.-nudged .mh-hint { opacity: 0 !important; }
.mh-frame { opacity: 0; transition: opacity 1.6s ease; }
.mirror-hall.-ready .mh-frame { opacity: 1; }

@media (max-width: 620px) {
  .mh-hint { display: none; }
  .mh-focus { bottom: clamp(26px, 5vh, 40px); }
}
