/* ============================================================
   T1 Process Training — "Solar Module Line 3D" hero showcase
   Scoped entirely under #hero-3d-stage so it can never leak onto,
   or be overridden by, the rest of the site's CSS. Colors are
   split into their own --ml-* variables (never the site's --bg /
   --surface-* / --text-* names) and re-declared for light mode
   under html[data-theme="light"] #hero-3d-stage.
   ============================================================ */

#hero-3d-stage {
  /* dark (default) palette */
  --ml-panel: rgba(11,22,48,.78);
  --ml-line: rgba(120,150,210,.22);
  --ml-ink: #ecf1fa;
  --ml-muted: #9fb0cf;
  --ml-sun: #f6b23c;
  --ml-ok: #4cc38a;
  --ml-bad: #e8574e;
  --ml-sky: #6aa6ff;
  --ml-flash-bg: #fff;
  --ml-f-display: "Unbounded","Arial Black",system-ui,sans-serif;
  --ml-f-body: "IBM Plex Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
  --ml-f-mono: "IBM Plex Mono",ui-monospace,Menlo,Consolas,monospace;

  position: relative;
  width: 100%;
  height: var(--ml-stage-h, 620px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  color: var(--ml-ink);
  font-family: var(--ml-f-body);
}
html[data-theme="light"] #hero-3d-stage {
  --ml-panel: rgba(255,255,255,.86);
  --ml-line: rgba(20,40,80,.16);
  --ml-ink: #15202e;
  --ml-muted: #5b6b85;
  --ml-sun: #c9790f;
  --ml-ok: #1f9d6c;
  --ml-bad: #d03b32;
  --ml-sky: #2f6fd1;
}

#hero-3d-stage #app { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(120% 90% at 70% 0%, rgba(120,150,210,.14) 0%, transparent 60%); }
#hero-3d-stage #gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#hero-3d-stage #gl.drag { cursor: grabbing; }
#hero-3d-stage #labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#hero-3d-stage .lb { position: absolute; left: 0; top: 0; transform: translate(-50%,-100%); white-space: nowrap; font: 600 12px/1 var(--ml-f-mono); letter-spacing: .06em; color: var(--ml-ink);
  background: rgba(7,14,28,.82); border: 1px solid var(--ml-line); padding: 6px 9px; border-radius: 7px; transition: opacity .25s; }
html[data-theme="light"] #hero-3d-stage .lb { background: rgba(255,255,255,.9); }
#hero-3d-stage .lb.st { font-size: 12.5px; text-transform: uppercase; color: var(--ml-muted); }
#hero-3d-stage .lb.st.cur { color: #1a1204; background: var(--ml-sun); border-color: var(--ml-sun); }
#hero-3d-stage .lb.small { font-size: 10.5px; padding: 3px 6px; border-radius: 5px; }
#hero-3d-stage .lb.tag { transform: translate(0,-50%); border-left: 3px solid var(--ml-sun); }
#hero-3d-stage .lb.row { transform: translate(-100%,-50%); background: transparent; border: 0; color: var(--ml-sun); font-size: 14px; padding: 0 4px; }
#hero-3d-stage .lb.col { transform: translate(-50%,-100%); background: transparent; border: 0; color: var(--ml-sun); font-size: 9.5px; padding: 0; }
#hero-3d-stage .lb.num { background: var(--ml-bad); border: 0; border-radius: 50%; width: 22px; height: 22px; padding: 0; display: grid; place-items: center; color: #fff; font-size: 12px; box-shadow: 0 0 12px rgba(232,87,78,.8); }
#hero-3d-stage .nb { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ml-bad); color: #fff; font: 600 10.5px var(--ml-f-mono); margin-right: 7px; font-style: normal; vertical-align: middle; }
#hero-3d-stage .r.dim { opacity: .32; }
#hero-3d-stage .ring { position: absolute; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 2px solid var(--ml-bad); border-radius: 50%; box-shadow: 0 0 14px rgba(232,87,78,.7); animation: ml3d-pulse 1.2s ease-in-out infinite; }
#hero-3d-stage .ring span { position: absolute; left: 40px; top: 50%; transform: translateY(-50%); white-space: nowrap; font: 600 11px var(--ml-f-mono); color: #fff; background: var(--ml-bad); padding: 3px 6px; border-radius: 5px; }
@keyframes ml3d-pulse { 50% { transform: scale(1.15); } }

#hero-3d-stage .hud { position: absolute; pointer-events: none; inset: 0; padding: 16px 16px 14px; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; }
#hero-3d-stage .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
#hero-3d-stage .ml-card { pointer-events: auto; background: var(--ml-panel); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--ml-line); border-radius: 14px; padding: 16px 18px; max-width: min(430px,62vw); }
#hero-3d-stage .brand { font: 500 11px var(--ml-f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ml-muted); display: flex; gap: 8px; align-items: center; }
#hero-3d-stage .brand i { width: 8px; height: 8px; border-radius: 2px; background: var(--ml-sun); display: inline-block; }
#hero-3d-stage .ml-eyebrow { margin-top: 10px; font: 500 12px var(--ml-f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ml-sun); }
#hero-3d-stage h1 { font-family: var(--ml-f-display); font-weight: 700; font-size: clamp(20px,2.4vw,32px); line-height: 1.05; margin: 6px 0 8px; letter-spacing: -.01em; color: var(--ml-ink); }
#hero-3d-stage .ml-cap { margin: 0; color: var(--ml-muted); font-size: clamp(13px,1.1vw,16px); line-height: 1.45; min-height: 2.9em; }
#hero-3d-stage .ml-cap b { color: var(--ml-ink); font-weight: 600; }
#hero-3d-stage .ro { min-width: 230px; max-width: 330px; padding: 12px 14px; display: grid; gap: 7px; }
#hero-3d-stage .ro .h { font: 500 11px var(--ml-f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ml-muted); }
#hero-3d-stage .ro .r { display: flex; justify-content: space-between; gap: 12px; font: 500 13px var(--ml-f-mono); font-variant-numeric: tabular-nums; color: var(--ml-muted); }
#hero-3d-stage .ro .r b { color: var(--ml-ink); font-weight: 600; }
#hero-3d-stage .pill { font: 600 11px var(--ml-f-mono); padding: 4px 8px; border-radius: 99px; justify-self: start; }
#hero-3d-stage .pill.ok { background: rgba(76,195,138,.18); color: var(--ml-ok); }
#hero-3d-stage .pill.x { background: rgba(232,87,78,.18); color: var(--ml-bad); }
#hero-3d-stage .pill.w { background: rgba(246,178,60,.18); color: var(--ml-sun); }
#hero-3d-stage #ivbox { display: none; margin-top: 4px; }
#hero-3d-stage #ivbox canvas { width: 100%; height: auto; display: block; border-radius: 8px; background: rgba(5,9,18,.7); }

#hero-3d-stage .bottom { display: grid; gap: 10px; pointer-events: auto; }
#hero-3d-stage .bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#hero-3d-stage .ml-btn { font: 600 12.5px var(--ml-f-mono); color: var(--ml-ink); background: var(--ml-panel); backdrop-filter: blur(8px); border: 1px solid var(--ml-line); border-radius: 9px; padding: 9px 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
#hero-3d-stage .ml-btn:hover { border-color: var(--ml-muted); }
#hero-3d-stage .ml-btn.pri { background: var(--ml-sun); color: #1a1204; border-color: var(--ml-sun); }
#hero-3d-stage .ml-btn:focus-visible, #hero-3d-stage .ch:focus-visible { outline: 2px solid var(--ml-sun); outline-offset: 2px; }
#hero-3d-stage .hint { font: 500 11.5px var(--ml-f-mono); color: var(--ml-muted); }
#hero-3d-stage .chs { display: grid; grid-template-columns: repeat(9,minmax(0,1fr)); gap: 6px; touch-action: none; }
#hero-3d-stage .ch { position: relative; overflow: hidden; border: 1px solid var(--ml-line); background: var(--ml-panel); backdrop-filter: blur(8px); border-radius: 10px; padding: 9px 8px 11px; cursor: pointer; text-align: left; color: var(--ml-muted); font: 500 11.5px var(--ml-f-mono); min-width: 0; }
#hero-3d-stage .ch b { display: block; font: 600 11px var(--ml-f-mono); color: var(--ml-muted); margin-bottom: 2px; }
#hero-3d-stage .ch span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hero-3d-stage .ch i { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--ml-sun); }
#hero-3d-stage .ch.done i { width: 100%; background: var(--ml-ok); }
#hero-3d-stage .ch.done b { color: var(--ml-ok); }
#hero-3d-stage .ch.cur { border-color: var(--ml-sun); color: var(--ml-ink); }
#hero-3d-stage .ch.cur b { color: var(--ml-sun); }
#hero-3d-stage #flash { position: absolute; inset: 0; background: var(--ml-flash-bg); opacity: 0; pointer-events: none; }

@media (max-width: 760px) {
  #hero-3d-stage { --ml-stage-h: 760px; }
  #hero-3d-stage .top { flex-direction: column; }
  #hero-3d-stage .ml-card { max-width: none; padding: 12px 14px; }
  #hero-3d-stage .ro { min-width: 0; max-width: none; width: 100%; box-sizing: border-box; grid-template-columns: 1fr 1fr; column-gap: 16px; }
  #hero-3d-stage .ro .h { grid-column: 1 / -1; }
  #hero-3d-stage .chs { grid-template-columns: repeat(9,minmax(64px,1fr)); overflow-x: auto; }
  #hero-3d-stage .hint { display: none; }
}
@media (max-width: 760px) and (max-height: 700px) { #hero-3d-stage .ml-cap { min-height: 0; } }

@media (prefers-reduced-motion: reduce) {
  #hero-3d-stage .ring { animation: none; }
}
