/* ==========================================================================
   O&G Asset Management Services — Interactive Simulation Lab
   Teaser card (hero) + fullscreen simulation overlay
   ========================================================================== */

/* ── Teaser card in the hero ─────────────────────────────────────────────── */
.sim-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 1rem;
  text-align: left;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
}
.sim-card:hover,
.sim-card:focus-visible {
  border-color: rgba(169,188,240,.45);
  transform: translateY(-3px);
  box-shadow: 0 18px 50px rgba(5,8,25,.55);
}
.sim-card:focus-visible { outline: 2px solid #a9bcf0; outline-offset: 3px; }

.sim-card-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, rgba(95,127,217,.12), transparent 70%);
}
.sim-card-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.sim-badge {
  position: absolute; top: .7rem; left: .7rem; z-index: 3;
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .6rem;
  border-radius: 999px;
  background: rgba(11,16,48,.72);
  border: 1px solid rgba(255,255,255,.14);
  font-family: var(--font-mono); font-size: .55rem; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.72);
  backdrop-filter: blur(6px);
}
.sim-badge::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: #7fc9a8; animation: pulseDot 1.6s ease-in-out infinite;
}

/* Call-to-action veil */
.sim-veil {
  position: absolute; inset: 0; z-index: 4;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 1.15rem;
  background: linear-gradient(to top, rgba(8,12,38,.86) 0%, rgba(8,12,38,.28) 38%, transparent 62%);
  transition: background .3s var(--ease);
}
.sim-cta {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .6rem 1.05rem;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.26);
  backdrop-filter: blur(10px);
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase;
  color: #fff;
  transition: background .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.sim-card:hover .sim-cta,
.sim-card:focus-visible .sim-cta {
  background: rgba(169,188,240,.22);
  border-color: rgba(169,188,240,.6);
  transform: translateY(-2px);
}
.sim-cta-play {
  display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; flex-shrink: 0;
}
.sim-cta-play svg { width: 8px; height: 8px; fill: var(--navy); }

.sim-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .85rem; }
.sim-card-note {
  font-family: var(--font-mono); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.4);
}

/* ── Ghost cursor (used by the teaser and the guided demo) ───────────────── */
.sim-ghost {
  position: absolute; top: 0; left: 0; z-index: 6;
  width: 26px; height: 26px;
  margin: -3px 0 0 -3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s var(--ease);
  will-change: transform;
}
.sim-ghost.is-on { opacity: 1; }
.sim-ghost svg { width: 18px; height: 18px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.sim-ghost-ring {
  position: absolute; top: 0; left: 0;
  width: 28px; height: 28px; margin: -8px 0 0 -8px;
  border: 2px solid rgba(255,255,255,.85);
  border-radius: 50%;
  opacity: 0; transform: scale(.3);
}
.sim-ghost.is-tap .sim-ghost-ring { animation: simTap .5s var(--ease-out); }
@keyframes simTap {
  0%   { opacity: .9; transform: scale(.3); }
  100% { opacity: 0;  transform: scale(1.5); }
}

/* ── Fullscreen lab ──────────────────────────────────────────────────────── */
.simlab[hidden] { display: none; }
.simlab {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; flex-direction: column;
  background: linear-gradient(165deg, #070b26 0%, var(--navy) 45%, #0d1440 100%);
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.simlab.is-open { opacity: 1; }
.simlab-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(169,188,240,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(169,188,240,.05) 1px, transparent 1px);
  background-size: 56px 56px;
}

/* top bar */
.simlab-bar {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 1.25rem;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: rgba(7,11,38,.6);
  backdrop-filter: blur(10px);
}
.simlab-brand { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.simlab-brand img { height: 20px; width: auto; }
.simlab-brand span {
  font-family: var(--font-mono); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,255,255,.5);
}
.simlab-tabs { display: flex; gap: .4rem; margin: 0 auto; flex-wrap: wrap; justify-content: center; }
.simlab-tab {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem .9rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.68);
  font-family: var(--font-mono); font-size: .6rem; letter-spacing: .07em; text-transform: uppercase;
  cursor: pointer;
  transition: all .22s var(--ease);
}
.simlab-tab:hover { background: rgba(255,255,255,.1); color: #fff; }
.simlab-tab[aria-selected="true"] {
  background: rgba(169,188,240,.18);
  border-color: rgba(169,188,240,.6);
  color: #fff;
}
.simlab-tab-num { font-size: .55rem; color: rgba(255,255,255,.4); }
.simlab-tab[aria-selected="true"] .simlab-tab-num { color: #a9bcf0; }

.simlab-close {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.06);
  cursor: pointer;
  transition: all .22s var(--ease);
}
.simlab-close svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 2; stroke-linecap: round; fill: none; }
.simlab-close:hover { background: #fb7185; border-color: #fb7185; transform: rotate(90deg); }
.simlab-close:focus-visible { outline: 2px solid #a9bcf0; outline-offset: 3px; }
.simlab-close-hint {
  position: absolute; top: 100%; right: 1.25rem; margin-top: .45rem;
  font-family: var(--font-mono); font-size: .55rem; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255,255,255,.35);
  pointer-events: none;
}

/* stage */
.simlab-body {
  position: relative; z-index: 1;
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 1fr 300px; gap: 1.25rem;
  padding: 1.25rem;
}
.simlab-stage {
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.03);
  overflow: hidden;
  touch-action: none;
}
.simlab-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.simlab-stage[data-sim="twin"] canvas { cursor: grab; }
.simlab-stage.is-locked canvas { cursor: default; }
.simlab-stage[data-sim="twin"].is-dragging canvas { cursor: grabbing; }

/* coach overlay shown during the 5-second guided demo */
.simlab-coach {
  position: absolute; left: 1rem; right: 1rem; bottom: 1rem; z-index: 5;
  display: flex; align-items: center; gap: .9rem;
  padding: .8rem 1rem;
  border-radius: 10px;
  background: rgba(7,11,38,.82);
  border: 1px solid rgba(169,188,240,.3);
  backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(8px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  pointer-events: none;
}
.simlab-coach.is-on { opacity: 1; transform: none; }
.simlab-coach-step {
  flex-shrink: 0;
  font-family: var(--font-mono); font-size: .55rem; letter-spacing: .1em;
  color: #a9bcf0;
}
.simlab-coach-text { flex: 1; font-size: .82rem; color: #fff; line-height: 1.45; }
.simlab-coach-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: rgba(255,255,255,.08); border-radius: 0 0 10px 10px; overflow: hidden; }
.simlab-coach-fill { height: 100%; width: 0; background: linear-gradient(90deg,#5f7fd9,#a9bcf0); }

/* "your turn" flash */
.simlab-turn {
  position: absolute; inset: 0; z-index: 6;
  display: grid; place-items: center;
  pointer-events: none;
  opacity: 0;
}
.simlab-turn.is-on { animation: simTurn 1.8s var(--ease) forwards; }
.simlab-turn span {
  padding: .7rem 1.3rem; border-radius: 999px;
  background: rgba(169,188,240,.2); border: 1px solid rgba(169,188,240,.6);
  backdrop-filter: blur(10px);
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #fff;
}
@keyframes simTurn {
  0%   { opacity: 0; transform: scale(.94); }
  18%  { opacity: 1; transform: scale(1); }
  72%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1.03); }
}

/* side panel */
.simlab-side {
  display: flex; flex-direction: column; gap: 1rem;
  min-height: 0; overflow-y: auto;
  padding-right: .25rem;
}
.simlab-panel {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  padding: 1.1rem;
}
.simlab-eyebrow {
  font-family: var(--font-mono); font-size: .55rem; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,255,255,.38); display: block; margin-bottom: .5rem;
}
.simlab-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; color: #fff; margin-bottom: .45rem; line-height: 1.25; }
.simlab-desc { font-size: .8rem; color: rgba(255,255,255,.66); line-height: 1.6; }

.simlab-ctl { margin-bottom: 1.05rem; }
.simlab-ctl:last-child { margin-bottom: 0; }
.simlab-ctl-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: .5rem; }
.simlab-ctl-label { font-size: .72rem; color: rgba(255,255,255,.72); }
.simlab-ctl-val { font-family: var(--font-mono); font-size: .68rem; color: #a9bcf0; }
.simlab-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.14);
  outline: none; cursor: pointer;
}
.simlab-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid #5f7fd9; cursor: grab;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.simlab-range::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid #5f7fd9; cursor: grab;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.simlab-range:focus-visible { outline: 2px solid #a9bcf0; outline-offset: 4px; }

.simlab-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.simlab-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .45rem .75rem; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.6);
  font-family: var(--font-mono); font-size: .58rem; letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.simlab-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .4; }
.simlab-chip[aria-pressed="true"] { color: #fff; background: rgba(255,255,255,.1); border-color: currentColor; }
.simlab-chip[aria-pressed="true"]::before { opacity: 1; box-shadow: 0 0 8px currentColor; }
.simlab-chip:focus-visible { outline: 2px solid #a9bcf0; outline-offset: 2px; }

/* readout rows */
.simlab-read { display: flex; flex-direction: column; gap: .55rem; }
.simlab-read-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: .55rem; border-bottom: 1px solid rgba(255,255,255,.07); }
.simlab-read-row:last-child { border-bottom: 0; padding-bottom: 0; }
.simlab-read-k { font-size: .72rem; color: rgba(255,255,255,.55); }
.simlab-read-v { font-family: var(--font-mono); font-size: .72rem; color: #fff; text-align: right; }
.simlab-read-v.is-good { color: #8fd3ae; }
.simlab-read-v.is-warn { color: #f5c164; }
.simlab-read-v.is-bad  { color: #fb7185; }

/* business value card */
.simlab-value {
  border-radius: 12px;
  padding: 1.1rem;
  background: linear-gradient(135deg, rgba(30,58,159,.55), rgba(16,31,86,.55));
  border: 1px solid rgba(169,188,240,.25);
}
.simlab-value p { font-size: .82rem; color: rgba(255,255,255,.9); line-height: 1.55; }
.simlab-value strong { color: #fff; font-weight: 600; }

.simlab-actions { display: flex; gap: .55rem; flex-wrap: wrap; }
.simlab-btn {
  flex: 1; min-width: 120px;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .7rem 1rem; border-radius: 8px;
  font-family: var(--font-mono); font-size: .6rem; letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.05); color: #fff;
  transition: all .22s var(--ease);
}
.simlab-btn:hover { background: rgba(255,255,255,.12); }
.simlab-btn--go { background: #fff; color: var(--navy); border-color: #fff; }
.simlab-btn--go:hover { background: #dbe3f7; }
.simlab-btn svg { width: 12px; height: 12px; }
.simlab-btn:focus-visible { outline: 2px solid #a9bcf0; outline-offset: 3px; }

/* responsive */
@media (max-width: 960px) {
  .simlab-body { grid-template-columns: 1fr; grid-template-rows: minmax(240px, 1fr) auto; overflow-y: auto; }
  .simlab-side { overflow: visible; }
  .simlab-tabs { order: 3; width: 100%; margin: 0; }
  .simlab-bar { flex-wrap: wrap; row-gap: .75rem; }
  .simlab-brand { margin-right: auto; }
  .simlab-close-hint { display: none; }
}
@media (max-width: 560px) {
  .simlab-tab { padding: .45rem .7rem; font-size: .55rem; }
  .simlab-body { padding: .75rem; gap: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sim-ghost, .simlab-turn { display: none !important; }
  .simlab, .simlab-coach { transition: none; }
}
