/* Module 1 — Welcome · Your Role */

body.m01-locked { overflow: hidden; }

/* Scene-leave confirmation overlay — "Ready to go?" gate so the trainee can keep exploring */
.m01-confirm-overlay {
  position: fixed; inset: 0; z-index: 9300;
  background: rgba(7, 6, 15, 0.78);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  animation: m01-fade-in 0.25s ease-out;
}
@keyframes m01-fade-in { from { opacity: 0; } to { opacity: 1; } }
.m01-confirm-card {
  max-width: 480px; width: 100%;
  padding: 2rem 2.2rem;
  background: linear-gradient(180deg, rgba(20, 18, 38, 0.98), rgba(15, 13, 28, 0.98));
  border: 1px solid rgba(201, 180, 111, 0.35);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  text-align: center;
  animation: m01-rise-in 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}
@keyframes m01-rise-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.m01-confirm-q {
  font-family: 'Newsreader', serif; font-size: 1.4rem; line-height: 1.4;
  color: var(--text, #f5f4ef); letter-spacing: -0.01em;
  margin: 0 0 1.6rem;
}
.m01-confirm-actions {
  display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap;
}
.m01-confirm-actions .cmp-btn { min-width: 140px; }

/* ----- HTML sign overlays ----- */
/* Crisp readable text laid over Skybox 360 scenes. Generative AI can't render
   legible text in panoramas, so we render signage as HTML positioned at fixed
   yaw/pitch via Pannellum. Variants below mimic real-world signage materials. */

.m01-sign { pointer-events: none; }
.m01-sign-inner {
  font-family: 'Newsreader', serif;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-align: center;
  user-select: none;
}
.m01-sign-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.65em;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 0.25em;
  opacity: 0.85;
}

/* Wall sign — large brushed-metal lobby placard */
.m01-sign--wall-sign .m01-sign-inner {
  font-size: 2.2rem;
  font-weight: 600;
  color: #f5f1e6;
  background: linear-gradient(180deg, rgba(28, 24, 60, 0.92), rgba(18, 15, 40, 0.94));
  padding: 1rem 2.4rem;
  border: 1px solid rgba(201, 180, 111, 0.5);
  border-radius: 6px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  letter-spacing: 0.18em;
}

/* Door label — small etched plaque */
.m01-sign--door-label .m01-sign-inner {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #f5f1e6;
  background: rgba(20, 18, 38, 0.85);
  padding: 0.35rem 0.9rem;
  border: 1px solid rgba(201, 180, 111, 0.4);
  border-radius: 3px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

/* Sticky note — yellow square taped on a surface */
.m01-sign--sticky-note .m01-sign-inner {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #2b2410;
  background: linear-gradient(165deg, #fff5b1 0%, #ffe892 100%);
  padding: 0.7rem 1rem;
  border-radius: 2px;
  box-shadow: 1px 4px 12px rgba(0, 0, 0, 0.35);
  transform: rotate(-3deg);
  letter-spacing: 0.12em;
}

/* Poster — wall-mounted printed sheet */
.m01-sign--poster .m01-sign-inner {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a1a;
  background: #fafaf6;
  padding: 0.8rem 1.2rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 2px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  max-width: 220px;
  white-space: normal;
  line-height: 1.4;
}

/* Binder spine — vertical text on a binder */
.m01-sign--binder-spine .m01-sign-inner {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: #f5f1e6;
  background: rgba(40, 32, 24, 0.85);
  padding: 0.3rem 0.7rem;
  border-radius: 2px;
  letter-spacing: 0.1em;
  border: 1px solid rgba(201, 180, 111, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Wall clock with simple numerals */
.m01-sign--wall-clock .m01-sign-inner {
  font-family: 'Newsreader', serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: #1a1a1a;
  background: #fafaf6;
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #2b2410;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.m01 {
  position: fixed; inset: 0; z-index: 9100;
  background: var(--bg, #0f0f1a);
  color: var(--text, #f4f1ea);
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: 1fr 360px;
  font-family: 'Inter', system-ui, sans-serif;
}

.m01-header {
  grid-column: 1 / -1;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px;
  background: var(--bg-soft, #15152a);
  border-bottom: 0.5px solid var(--line, rgba(255,255,255,0.08));
}
.m01-eyebrow {
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold, #c4a35f); margin-bottom: 4px;
}
.m01-title {
  font-family: 'Newsreader', Georgia, serif; font-weight: 400;
  font-size: 22px; letter-spacing: -0.02em;
  color: var(--text, #f4f1ea); margin: 0;
}

.m01-stage { position: relative; background: #000; }
.m01-pano { width: 100%; height: 100%; min-height: 400px; }

/* Hotspot dots */
.m01-hotspot-marker { position: absolute; pointer-events: auto; }
.m01-hotspot-marker > span { display: none; }
.m01-dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold, #c4a35f);
  box-shadow: 0 0 0 4px rgba(196,163,95,0.25), 0 0 16px rgba(196,163,95,0.6);
  cursor: pointer;
  animation: m01-pulse 2.4s cubic-bezier(0.25,1,0.5,1) infinite;
  border: 2px solid rgba(255,255,255,0.6);
  transition: all 0.3s;
}
@keyframes m01-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

.m01-side {
  background: var(--surface, #1c1d35);
  border-left: 0.5px solid var(--line, rgba(255,255,255,0.08));
  padding: 22px 24px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 22px;
}
.m01-objective p:not(.m01-eyebrow) {
  font-size: 13px; line-height: 1.6;
  color: var(--text-soft, rgba(244,241,234,0.78));
}
.m01-progress ul {
  list-style: none; padding: 0; margin: 6px 0 0;
  font-size: 13px; color: var(--text-soft, rgba(244,241,234,0.78));
}
.m01-progress li {
  padding: 6px 0;
  border-bottom: 0.5px solid var(--line, rgba(255,255,255,0.06));
  cursor: default;
}

.m01-popover {
  position: absolute; right: 380px; bottom: 24px;
  width: 320px;
  background: rgba(15,15,26,0.96);
  backdrop-filter: blur(12px);
  border: 0.5px solid var(--line, rgba(255,255,255,0.08));
  border-radius: 8px;
  padding: 18px 20px;
  z-index: 5;
}
.m01-pop-meta {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold, #c4a35f); margin: 0 0 6px;
}
.m01-pop-title {
  font-family: 'Newsreader', Georgia, serif; font-weight: 400;
  font-size: 18px; letter-spacing: -0.01em; margin: 0 0 8px;
  color: var(--text, #f4f1ea);
}
.m01-pop-body {
  font-size: 13px; color: var(--text-soft, rgba(244,241,234,0.78)); line-height: 1.6;
  margin: 0 0 8px;
}
.m01-pop-cite {
  font-size: 11px; color: var(--text-mute, rgba(244,241,234,0.45));
  font-style: italic; margin: 0 0 12px;
}

/* ---------- Beat 2: drive ---------- */
.m01-drive-stage {
  position: relative; background: #1a1a2e; overflow: hidden;
  display: grid; place-items: center;
}
.m01-drive-canvas {
  position: relative;
  width: 100%; height: 100%;
  max-width: 480px;
  background: linear-gradient(to bottom, #16161f 0%, #1d1d2c 50%, #16161f 100%);
  overflow: hidden;
}
.m01-drive-road {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(to bottom,
      transparent 0px, transparent 30px,
      rgba(255,255,255,0.4) 30px, rgba(255,255,255,0.4) 60px) calc(33% - 1.5px) 0/3px 100% no-repeat,
    repeating-linear-gradient(to bottom,
      transparent 0px, transparent 30px,
      rgba(255,255,255,0.4) 30px, rgba(255,255,255,0.4) 60px) calc(67% - 1.5px) 0/3px 100% no-repeat;
  animation: m01-road-scroll 0.8s linear infinite;
}
@keyframes m01-road-scroll {
  0% { background-position: calc(33% - 1.5px) 0, calc(67% - 1.5px) 0; }
  100% { background-position: calc(33% - 1.5px) 90px, calc(67% - 1.5px) 90px; }
}
.m01-drive-car {
  position: absolute; bottom: 60px;
  left: calc(50% - 24px);
  width: 48px; height: 70px;
  transition: left 0.2s cubic-bezier(0.25,1,0.5,1);
  z-index: 3;
}
.m01-car-body {
  width: 100%; height: 100%;
  background: linear-gradient(180deg, var(--gold-bright, #e0bc73) 0%, var(--gold, #c4a35f) 100%);
  border-radius: 10px 10px 6px 6px;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.4),
    0 -4px 8px rgba(196,163,95,0.4);
}
.m01-car-body::before {
  content: ''; position: absolute;
  top: 12px; left: 6px; right: 6px;
  height: 18px;
  background: rgba(0,0,0,0.4);
  border-radius: 4px;
}
.m01-drive-traffic { position: absolute; inset: 0; pointer-events: none; }
.m01-obstacle {
  position: absolute;
  width: 36px; height: 56px;
  background: linear-gradient(180deg, #5b6b8a 0%, #3a4a6a 100%);
  border-radius: 6px 6px 4px 4px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
  z-index: 2;
}
.m01-obstacle::before {
  content: ''; position: absolute;
  top: 10px; left: 4px; right: 4px;
  height: 14px;
  background: rgba(0,0,0,0.4);
  border-radius: 3px;
}
.m01-drive-hud {
  position: absolute; top: 16px; left: 16px; right: 16px;
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-soft, rgba(244,241,234,0.78));
  z-index: 4;
}
.m01-drive-time {
  background: rgba(0,0,0,0.6); padding: 6px 12px; border-radius: 4px;
  border: 0.5px solid var(--line, rgba(255,255,255,0.06));
  font-weight: 600; color: var(--text, #f4f1ea);
}
.m01-drive-distance {
  background: rgba(0,0,0,0.6); padding: 6px 12px; border-radius: 4px;
  border: 0.5px solid var(--line, rgba(255,255,255,0.06));
}
.m01-drive-side {
  background: var(--surface, #1c1d35);
}

/* ---------- Beat 4: Marisol card overlay ---------- */
.m01-marisol-card {
  position: absolute;
  bottom: 24px; left: 24px;
  width: 380px; max-width: calc(100% - 48px);
  background: rgba(10, 10, 20, 0.96);
  backdrop-filter: blur(14px);
  border: 0.5px solid var(--gold, #c4a35f);
  border-radius: 10px;
  padding: 18px;
  z-index: 5;
  display: grid;
  grid-template-columns: 80px 1fr;
  grid-template-rows: auto auto auto auto;
  gap: 8px 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.m01-marisol-img {
  grid-row: 1 / 3;
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold, #c4a35f);
}
.m01-marisol-meta {
  align-self: center;
}
.m01-marisol-name {
  font-family: 'Newsreader', serif; font-weight: 500;
  font-size: 16px; color: var(--text, #f4f1ea); margin: 0 0 2px;
}
.m01-marisol-role {
  font-size: 11px; color: var(--text-mute, rgba(244,241,234,0.5));
  margin: 0;
}
.m01-marisol-controls {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 4px;
}
.m01-marisol-controls .cmp-btn { width: 100%; }
.m01-marisol-progress {
  height: 4px;
  background: rgba(255,255,255,0.10);
  border-radius: 2px;
  overflow: hidden;
}
.m01-marisol-progress span {
  display: block; height: 100%; width: 0%;
  background: var(--gold, #c4a35f);
  transition: width 0.2s linear;
}
.m01-marisol-transcript {
  grid-column: 1 / -1;
  font-size: 12px; color: var(--text-soft, rgba(244,241,234,0.7));
  font-style: italic; line-height: 1.5;
}
.m01-marisol-transcript p { margin: 4px 0; }
.m01-trans-hint {
  font-style: normal !important; color: var(--gold, #c4a35f) !important;
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
}

/* ---------- Beat 5: tablet handoff prompt ---------- */
.m01-tablet-prompt {
  grid-column: 1 / -1;
  display: grid; place-items: center;
  text-align: center;
  padding: 40px;
}
.m01-tablet-prompt h3 {
  font-family: 'Newsreader', serif; font-weight: 400;
  font-size: 28px; letter-spacing: -0.02em;
  color: var(--text, #f4f1ea); margin: 0 0 12px;
}
.m01-tablet-prompt p {
  color: var(--text-soft, rgba(244,241,234,0.7));
  margin: 0 0 20px; max-width: 50ch;
}
.m01-tablet-progress {
  margin-top: 20px;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold, #c4a35f);
}

/* ---------- Beat 5: case handoff card ---------- */
.m01-case-handoff {
  grid-column: 1 / -1;
  display: grid; place-items: center;
  padding: 30px;
}
.m01-case-card {
  max-width: 560px; width: 100%;
  background: var(--surface, #1c1d35);
  border: 0.5px solid var(--gold, #c4a35f);
  border-radius: 10px;
  padding: 28px 32px;
}
.m01-case-card .m01-eyebrow {
  font-size: 10px; letter-spacing: 0.22em; margin-bottom: 4px;
}
.m01-pof {
  font-size: 13px; color: var(--gold-bright, #e0bc73); margin: 0 0 18px;
  font-weight: 600;
}
.m01-case-name {
  font-family: 'Newsreader', serif; font-weight: 400;
  font-size: 32px; letter-spacing: -0.025em;
  margin: 0 0 4px; color: var(--text, #f4f1ea);
}
.m01-case-meta {
  font-size: 13px; color: var(--text-soft, rgba(244,241,234,0.7));
  margin: 0 0 18px;
}
.m01-case-facts {
  display: grid; grid-template-columns: 130px 1fr; gap: 6px 16px;
  margin: 16px 0; font-size: 13px;
}
.m01-case-facts dt {
  color: var(--text-mute, rgba(244,241,234,0.45));
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
}
.m01-case-facts dd { color: var(--text, #f4f1ea); margin: 0; }
.m01-case-note {
  font-size: 12px; color: var(--text-soft, rgba(244,241,234,0.6));
  font-style: italic;
  margin: 16px 0 22px;
  padding: 12px 14px;
  background: rgba(196,163,95,0.06);
  border-left: 2px solid var(--gold, #c4a35f);
  border-radius: 0 4px 4px 0;
}
.m01-case-card .cmp-btn--primary { width: 100%; padding: 14px; font-size: 14px; }

@media (max-width: 1024px) {
  .m01 { grid-template-columns: 1fr; grid-template-rows: auto 50vh auto; }
  .m01-side { border-left: 0; border-top: 0.5px solid var(--line, rgba(255,255,255,0.08)); }
  .m01-popover { position: fixed; right: 16px; left: 16px; bottom: 16px; width: auto; }
  .m01-marisol-card { position: fixed; left: 16px; right: 16px; bottom: 16px; width: auto; }
}

/* Locked module card on course home (linear progression) */
.module-card.is-locked {
  opacity: 0.45;
  cursor: not-allowed !important;
  filter: grayscale(0.5);
}
.module-card.is-locked:hover {
  transform: none !important;
  border-color: var(--line, rgba(255,255,255,0.08)) !important;
  box-shadow: none !important;
}
.module-card__status--locked {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--text-mute, rgba(244,241,234,0.4));
  font-size: 11px; letter-spacing: 0.06em;
}
.module-card__status--locked svg {
  width: 12px; height: 12px;
}

/* Missing-required prompt */
.m01-missing-prompt {
  grid-column: 1 / -1;
  display: grid; place-items: center;
  padding: 60px 30px;
}
.m01-missing-card {
  max-width: 540px; width: 100%;
  background: var(--surface, #1c1d35);
  border: 0.5px solid var(--warn, #d97757);
  border-radius: 10px;
  padding: 32px 36px;
  text-align: center;
}
.m01-missing-card h3 {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.022em;
  color: var(--text, #f4f1ea);
  margin: 4px 0 14px;
}
.m01-missing-card p {
  font-size: 14px;
  color: var(--text-soft, rgba(244,241,234,0.78));
  line-height: 1.6;
  margin: 0 0 16px;
}
.m01-missing-list-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold, #c4a35f);
  margin-top: 18px !important;
  margin-bottom: 8px !important;
}
.m01-missing-list {
  list-style: none; padding: 0;
  font-size: 13px;
  color: var(--text-mute, rgba(244,241,234,0.55));
  text-align: left;
  display: inline-block;
}
.m01-missing-list li {
  padding: 4px 0;
}
.m01-missing-list li::before {
  content: '○ ';
  color: var(--warn, #d97757);
}
.m01-missing-card .cmp-btn--primary {
  margin-top: 18px;
  padding: 14px 24px;
  font-size: 14px;
}

/* Preview host fix: keep the home scene from compositing through the module overlay while a module is open. */
body.m01-locked .scene--home { visibility: hidden; }
body.m01-locked .fullscreen-toggle { display: none; }
