/* ============================================================
   Mercure Lab — C · Robot 3D header
   Overrides ONLY the hero + adds the Discovery glass card and the
   blur-the-site chat modal. Everything else inherits lab-b.css.
   ============================================================ */

.lb-hero--robot .lb-hero__bg { background: var(--mc-bg-1); }

/* Robot — full hero, ABOVE the M watermark, drag to rotate */
.lb-hero__robot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  /* Pure CSS fade-in that starts on the very first frames (no waiting on
     the Spline 'load' event — that fired too late). The scene streams in
     behind this; by the time it renders the host is already opaque. */
  /* Masked while the Spline scene streams in (the mauve M + bg hold the
     screen, no empty flash). JS adds .is-revealed on the first rendered
     frame → smooth fade, never a hard pop. */
  opacity: 0;
  transform: scale(1.07);
  transition:
    opacity 1.2s var(--mc-ease-out),
    transform 1.4s var(--mc-ease-out);
}
.lb-hero__robot.is-revealed {
  opacity: 1;
  transform: none;
}

/* Giant Mercure M — outline only, mauve, semi-opaque, breathing pulse.
   Sits BEHIND the robot (z-index 0). If the Spline scene has a transparent
   background the M reads through as a luminous brand watermark; if not it
   stays a subtle depth layer behind the model. */
/* Sits ABOVE the robot (z-index 2, below the text content at z-index 4)
   with screen blend + very low opacity, so it reads as a luminous mark
   fused into the scene rather than a flat layer in front of it. */
.lb-hero__m {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(74vw, 1080px);
  height: auto;
  transform: translate(-50%, -50%);
  /* Genuinely BEHIND the robot. The hover hit zones live in a separate
     overlay in front of the robot (.lb-hero__m-hits) so the contour can
     still be targeted. */
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  /* Soft mauve halo that gently breathes (spreads) at all times — the M
     is alive even before you hover it. */
  animation: lbHeroMHalo 7s ease-in-out infinite;
}
/* Base outline — apparent even at rest, slow breathing */
.lb-hero__m-line {
  fill: none;
  stroke: var(--mc-mauve);           /* #b88cff mauve */
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  stroke-linecap: round;
  animation: lbHeroMRest 7s var(--mc-ease) infinite;
}
.lb-hero__m-line + .lb-hero__m-line { animation-delay: -3s; }

/* Permanent breathing halo — the "spread" creative touch */
@keyframes lbHeroMHalo {
  0%, 100% { filter: drop-shadow(0 0 7px  rgba(184,140,255,0.20)); }
  50%      { filter: drop-shadow(0 0 18px rgba(184,140,255,0.34)); }
}

/* Glow overlay — same contour, painted with the cursor-tracked radial
   gradient (#lbMGlow). Only the stretch of the M near the pointer lights
   up, with a soft radius — the glass-card spotlight, on the logo. */
.lb-hero__m-glow {
  fill: none;
  stroke: url(#lbMGlow);
  stroke-width: 3.2;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 0.9s var(--mc-ease-out);
}

/* Hit overlay — same placement as the M, but IN FRONT of the robot so the
   contour stays hoverable while the M itself sits behind. */
.lb-hero__m-hits {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(74vw, 1080px);
  height: auto;
  transform: translate(-50%, -50%);
  z-index: 3;                           /* above robot (1), below text (4) */
  pointer-events: none;                 /* only the hit strokes opt back in */
}
/* Invisible fat hit strokes — wide target that hugs the M's contour.
   stroke-width is in viewBox units (no non-scaling) so it scales up with
   the huge SVG → ~40px of forgiving hover zone around the actual outline. */
.lb-hero__m-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
  pointer-events: stroke;               /* only the contour band reacts */
}

/* Rest: very faint breathing — barely there, deliberately discreet */
@keyframes lbHeroMRest {
  0%, 100% { opacity: 0.17; }
  50%      { opacity: 0.30; }
}

/* ── .is-hot is toggled by JS when the overlay hit strokes are hovered.
   The M lights up even though it's behind the robot. ── */
.lb-hero__m.is-hot {
  mix-blend-mode: normal;
  /* Halo swells wider + brighter, still breathing (animation, not a static
     filter, so it never fights the rest-state halo). */
  animation: lbHeroMHaloHover 4.5s ease-in-out infinite;
}
.lb-hero__m.is-hot .lb-hero__m-glow { opacity: 1; }
@keyframes lbHeroMHaloHover {
  0%, 100% {
    filter:
      drop-shadow(0 0 20px rgba(184,140,255,0.45))
      drop-shadow(0 0 52px rgba(184,140,255,0.22));
  }
  50% {
    filter:
      drop-shadow(0 0 34px rgba(184,140,255,0.62))
      drop-shadow(0 0 84px rgba(184,140,255,0.32));
  }
}

/* Grain + veil stay above the robot for legibility */
.lb-hero--robot .lb-hero__grain { z-index: 2; }
.lb-hero--robot .lb-hero__veil {
  z-index: 3;
  background:
    linear-gradient(180deg, rgba(10,11,16,0.55) 0%, rgba(10,11,16,0) 16%),
    linear-gradient(90deg, rgba(10,11,16,0.50) 0%, transparent 42%),
    linear-gradient(180deg,
      rgba(10,11,16,0)    62%,
      rgba(10,11,16,0.40) 80%,
      rgba(10,11,16,0.85) 92%,
      var(--mc-bg-1)        100%);
}

/* ─────────── Title — compact, top-left corner ─────────── */
.lb-hero__title-block--corner {
  top: 120px;
  left: 56px;
  transform: none;
  max-width: 560px;
}
.lb-hero--robot .lb-hero__h1 {
  font-size: clamp(26px, 3vw, 44px);
  line-height: 1.06;
}
.lb-hero--robot .lb-hero__eyebrow { margin-bottom: 14px; }

/* ─────────── Bottom-left : tags ABOVE the wordmark ─────────── */
.lb-hero__brandblock {
  position: absolute;
  left: 56px;
  bottom: 36px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}
/* Neutralise the absolute positioning these had in lab-b.css */
.lb-hero--robot .lb-hero__tags,
.lb-hero--robot .lb-hero__brand {
  position: static;
  inset: auto;
}
/* lab-b.css caps .lb-hero__tags at max-width:50% + right-align → it wrapped
   onto 2 lines. Force a single clean line, left-aligned under the wordmark. */
.lb-hero--robot .lb-hero__tags {
  max-width: none;
  white-space: nowrap;
  text-align: left;
  transform: none;
}

/* ─────────── Right : glass Discovery card ─────────── */
.lb-hero__discovery {
  position: absolute;
  right: 40px;
  bottom: 40px;               /* bottom-right corner */
  width: min(320px, 30vw);
  z-index: 4;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 30px 80px -30px rgba(0,0,0,0.6),
    0 1px 0 rgba(255,255,255,0.06) inset;
}
.lb-hero__discovery-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.lb-hero__discovery-video iframe {
  position: absolute;
  top: 50%; left: 50%;
  width: 100%;
  height: 56.25vw;
  min-height: 100%;
  min-width: 177.78%;
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}
.lb-hero__discovery-tag {
  position: absolute;
  top: 12px; left: 14px;
  font-family: var(--mc-font-mono);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}
.lb-hero__discovery-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.lb-hero__discovery .lb-hero__sub {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--mc-ink-2);
  /* lab-b.css forces nowrap + right-align on .lb-hero__sub — undo that
     so the copy wraps cleanly inside the narrow card. */
  white-space: normal;
  text-align: left;
}
.lb-hero__discovery .lb-hero__sub strong { color: #fff; font-weight: 500; }
.lb-hero__discovery .lb-hero__cta {
  align-self: flex-start;
  cursor: pointer;
  border: 0;
  font: inherit;
}

/* ─────────── Discovery chat — glass modal that blurs the site ─────────── */
.lb-chat-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 9, 13, 0.45);
  backdrop-filter: blur(16px) saturate(0.75);
  -webkit-backdrop-filter: blur(16px) saturate(0.75);
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s var(--mc-ease);
}
.lb-chat-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lb-chat {
  position: fixed;
  z-index: 201;
  right: 40px;
  bottom: 40px;
  width: min(420px, calc(100vw - 48px));
  max-height: min(640px, calc(100vh - 80px));
  display: flex;
  flex-direction: column;
  background: rgba(20, 22, 30, 0.62);
  backdrop-filter: blur(30px) saturate(1.5);
  -webkit-backdrop-filter: blur(30px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 40px 100px -30px rgba(0,0,0,0.75),
    0 1px 0 rgba(255,255,255,0.08) inset;
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  pointer-events: none;
  transition:
    opacity .5s var(--mc-ease-out),
    transform .5s var(--mc-ease-out);
}
.lb-chat.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.lb-chat__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.lb-chat__id { display: flex; align-items: center; gap: 12px; flex: 1; }
.lb-chat__orb {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--mc-indigo), var(--mc-mauve));
  box-shadow: 0 0 18px rgba(184,140,255,0.5);
  flex-shrink: 0;
}
.lb-chat__meta { display: flex; flex-direction: column; gap: 3px; }
.lb-chat__meta .name {
  font-family: var(--mc-font-display);
  font-weight: 500;
  font-size: 14px;
  color: #fff;
}
.lb-chat__meta .status {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mc-font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mc-ink-3);
}
.lb-chat__meta .status i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--mc-cyan);
  box-shadow: 0 0 8px var(--mc-cyan);
}
.lb-chat__close {
  width: 30px; height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background .25s var(--mc-ease);
}
.lb-chat__close:hover { background: rgba(255,255,255,0.12); }
.lb-chat__close::before,
.lb-chat__close::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 12px; height: 1.5px;
  background: #fff;
}
.lb-chat__close::before { transform: translate(-50%,-50%) rotate(45deg); }
.lb-chat__close::after  { transform: translate(-50%,-50%) rotate(-45deg); }

.lb-chat__body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lb-chat__day {
  align-self: center;
  font-family: var(--mc-font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mc-ink-3);
  margin-bottom: 6px;
}
.lb-chat__bubble {
  max-width: 80%;
  padding: 11px 15px;
  font-size: 13.5px;
  line-height: 1.5;
  border-radius: 16px;
  animation: lbChatBubbleIn .4s var(--mc-ease-out) both;
}
.lb-chat__bubble--in {
  align-self: flex-start;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.92);
  border-bottom-left-radius: 5px;
}
.lb-chat__bubble--out {
  align-self: flex-end;
  background: linear-gradient(140deg, var(--mc-indigo), var(--mc-mauve));
  color: #fff;
  border-bottom-right-radius: 5px;
}
@keyframes lbChatBubbleIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.lb-chat__foot {
  display: flex;
  gap: 10px;
  padding: 16px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.lb-chat__input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 12px 14px;
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color .25s var(--mc-ease);
}
.lb-chat__input::placeholder { color: var(--mc-ink-3); }
.lb-chat__input:focus { border-color: rgba(184,140,255,0.45); }
.lb-chat__send {
  width: 44px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(140deg, var(--mc-indigo), var(--mc-mauve));
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: filter .25s var(--mc-ease), transform .25s var(--mc-ease);
}
.lb-chat__send:hover { filter: brightness(1.12); transform: translateY(-1px); }
.lb-chat__send::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 7px; height: 7px;
  border-right: 2px solid #fff;
  border-top: 2px solid #fff;
  transform: translate(-60%, -50%) rotate(45deg);
}

@media (max-width: 900px) {
  .lb-hero__m { width: 92vw; }
  .lb-hero__title-block--corner { top: 96px; left: 22px; right: 22px; }
  .lb-hero__discovery {
    position: static;
    transform: none;
    width: auto;
    margin: 24px 22px;
  }
  .lb-hero__brandblock { left: 22px; bottom: 22px; }
  .lb-chat { right: 12px; left: 12px; bottom: 12px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .lb-hero__m path { animation: none; opacity: 0.16; }
}

/* ============================================================
   lb-app2 final phase — content blurs back, a glass video
   placeholder rises in the center. JS sets --app2-reveal-p
   (0→1) over scroll progress [0.85 → 1.0]. lab-c only.
   ============================================================ */
/* Blur is set inline by JS, continuously, driven by scroll progress —
   so no CSS transition (it would lag/fight the per-frame updates). */

.lb-app2__reveal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 5;
  opacity: var(--app2-reveal-p, 0);
  pointer-events: none;
  /* Dark scrim so the blurred content reads as "pushed back" */
  background: rgba(8, 9, 13, 0.55);
}
.lb-app2__player {
  position: relative;
  width: min(620px, 58vw);
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(26px) saturate(1.5);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 50px 110px -40px rgba(0,0,0,0.7),
    0 1px 0 rgba(255,255,255,0.07) inset;
  /* Eases up + scales in with the reveal progress */
  transform: translateY(calc((1 - var(--app2-reveal-p, 0)) * 40px))
             scale(calc(0.94 + var(--app2-reveal-p, 0) * 0.06));
}
.lb-app2__play {
  pointer-events: auto;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 0 0 0 rgba(184,140,255,0.4),
    0 18px 50px -16px rgba(0,0,0,0.6),
    0 1px 0 rgba(255,255,255,0.18) inset;
  transition:
    transform .35s var(--mc-ease-out),
    box-shadow .45s var(--mc-ease-out),
    background .35s var(--mc-ease-out);
}
.lb-app2__play svg {
  width: 30px; height: 30px;
  fill: #fff;
  margin-left: 4px;                 /* optically center the triangle */
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}
.lb-app2__play:hover {
  transform: scale(1.06);
  background: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 0 0 10px rgba(184,140,255,0.10),
    0 22px 60px -16px rgba(0,0,0,0.65),
    0 1px 0 rgba(255,255,255,0.22) inset;
}
.lb-app2__player-cap {
  font-family: var(--mc-font-mono);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}

@media (max-width: 900px) {
  .lb-app2__player { width: 86vw; }
  .lb-app2__play { width: 66px; height: 66px; }
  .lb-app2__play svg { width: 24px; height: 24px; }
}
