/* holocame456 · holocam.css
   Theme aligned to frednew (Metatrix.ai):
     - Pure black base (#000 / #050b15) under everything
     - Matrix-rain canvas (purple katakana + digits)
     - SVG fractal-noise grain layer (matches site-wide metatrix-grain)
     - Scanline overlay (matches site-wide metatrix-scanlines)
     - Glassmorphic frosted panels with cyan/purple/amber accents
*/

:root {
  --bg-0:#000000;
  --bg-1:#040208;
  --bg-2:#090414;
  --ink:#d6f1ff;
  --ink-soft:#bccae4;
  --ink-d:#9bb6ce;
  --muted:#5e7a92;
  --line:rgba(167,139,250,0.22);     /* purple-tinted hairline */
  --line-2:rgba(255,255,255,0.06);
  --line-cyan:rgba(0,229,255,0.22);

  --cyan:#00e5ff;
  --cyan-soft:rgba(0,229,255,0.14);
  --amber:#ffb547;
  --amber-soft:rgba(255,181,71,0.14);
  --magenta:#ff5cd1;
  --green:#5be29a;
  --purple:#a78bfa;
  --purple-2:#c3a7ff;
  --purple-deep:#5530c0;
  --orange:#ff8a65;
  --crimson:#ef4458;

  --r-1:6px;
  --r-2:12px;
  --r-3:20px;
  --mono: ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --panel-bg: rgba(8, 4, 20, 0.62);
  --panel-bg-strong: rgba(8, 4, 20, 0.82);
  --glass: blur(14px) saturate(140%);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100vh; }
html { background: #000; }
body {
  position: relative;
  background: #000;
  color: var(--ink);
  font-family: var(--sans);
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ----- background stack -------------------------------------------- */
/* From bottom to top of the z-stack:
     1. .bg-rainbow      135° diagonal fade: white(TL)→green→blue→red→purple→black(BR)
     2. .bg-darken       global dark overlay so the rainbow is a base note, not the foreground
     3. .bg-vignette     soft purple/cyan radial halos
     4. .bg-grain        SVG fractal-noise grain (matches site-wide metatrix-grain)
     5. .bg-scan         repeating scanlines (matches site-wide metatrix-scanlines)
     6. .bg-edge         inset shadow vignette frame
     7. .matrix-banner   futuristic top ribbon (separate stacking context, z=5)             */

.bg-stack > * {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.bg-rainbow {
  z-index: 0;
  background:
    /* extra white wash anchored at the top-left so it bleeds further down */
    radial-gradient(85% 85% at 0% 0%,
      rgba(255,255,255,1.00) 0%,
      rgba(255,255,255,0.70) 10%,
      rgba(255,255,255,0.42) 22%,
      rgba(255,255,255,0.18) 36%,
      rgba(255,255,255,0)    52%),
    /* main rainbow diagonal */
    linear-gradient(135deg,
      #ffffff   0%,
      #ffffff  10%,
      #f3fff0  18%,
      #b8f0cf  28%,
      #4fd28a  38%,
      #1f8de0  48%,
      #5a3df0  60%,
      #c11a4a  72%,
      #6a1a8e  83%,
      #1a0220  94%,
      #000000 100%);
  opacity: 0.66;
}
.bg-darken {
  z-index: 1;
  background:
    /* keep the top-left lighter than before so the white reads through */
    radial-gradient(120% 120% at 0% 0%, rgba(0,0,0,0) 0%, rgba(0,0,0,0.45) 55%, rgba(0,0,0,0.92) 100%),
    linear-gradient(135deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.35) 45%, rgba(0,0,0,0.85) 100%);
}
.bg-vignette {
  z-index: 2;
  background:
    radial-gradient(60% 60% at 50% 0%, rgba(167,139,250,0.16), transparent 60%),
    radial-gradient(70% 70% at 50% 100%, rgba(0,229,255,0.08), transparent 60%);
}
.bg-grain {
  z-index: 3;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.bg-scan {
  z-index: 4;
  background-image: repeating-linear-gradient(
    0deg, transparent 0px, transparent 2px,
    rgba(0,0,0,0.30) 2px, rgba(0,0,0,0.30) 3px);
  mix-blend-mode: multiply;
  opacity: 0.45;
  animation: scanMove 9s linear infinite;
}
@keyframes scanMove {
  0%   { background-position-y: 0; }
  100% { background-position-y: 6px; }
}
.bg-edge {
  z-index: 5;
  box-shadow: inset 0 0 220px rgba(0,0,0,0.85);
}

/* ----- futuristic top matrix banner ------------------------------- */
.matrix-banner {
  position: fixed; z-index: 6;
  top: 0; left: 0; right: 0;
  height: 160px;
  pointer-events: none;
  background: #000;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 55%,
    rgba(0,0,0,0.55) 78%,
    rgba(0,0,0,0)  100%);
          mask-image: linear-gradient(180deg,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 55%,
    rgba(0,0,0,0.55) 78%,
    rgba(0,0,0,0)  100%);
  box-shadow: 0 30px 60px -20px rgba(167,139,250,0.18);
}
.matrix-banner .bg-matrix {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.matrix-banner .banner-edges {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg,
      rgba(0,0,0,0.85) 0%,
      transparent     10%,
      transparent     90%,
      rgba(0,0,0,0.85) 100%),
    radial-gradient(60% 100% at 50% 0%, rgba(167,139,250,0.12), transparent 70%);
}
.matrix-banner .banner-title {
  position: absolute; left: 50%; top: 12px;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.48em;
  text-transform: uppercase;
  color: var(--purple-2);
  text-shadow: 0 0 10px rgba(167,139,250,0.5);
  padding: 6px 18px;
  border: 1px solid rgba(167,139,250,0.35);
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
}
.matrix-banner .banner-title .pin {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: pin-blink 1.6s ease-in-out infinite;
}
@keyframes pin-blink {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}
.matrix-banner .banner-rail {
  position: absolute; left: 0; right: 0; bottom: 22px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 28px;
  font-family: var(--mono);
  font-size: 9px; letter-spacing: 0.42em;
  color: var(--purple-2);
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(167,139,250,0.5);
}
.matrix-banner .banner-rail .glitch {
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0,229,255,0.7);
  animation: banner-glitch 4.6s steps(8, end) infinite;
}
@keyframes banner-glitch {
  0%, 92%, 100% { opacity: 1; transform: translateX(0); filter: none; }
  93%           { opacity: 0.25; transform: translateX(2px) skewX(8deg); filter: blur(0.5px); }
  94%           { opacity: 1; transform: translateX(-1px); }
  95%           { opacity: 0.55; transform: translateX(1px); }
}
.matrix-banner .banner-tick {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%, rgba(167,139,250,0.05) 8%,
    rgba(167,139,250,0.95) 50%,
    rgba(167,139,250,0.05) 92%, transparent 100%);
  box-shadow: 0 0 14px rgba(167,139,250,0.65);
}
.matrix-banner .banner-tick-cyan {
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%, rgba(0,229,255,0.0) 30%,
    rgba(0,229,255,0.9) 50%,
    rgba(0,229,255,0.0) 70%, transparent 100%);
  box-shadow: 0 0 10px rgba(0,229,255,0.6);
  animation: tick-sweep 5.5s linear infinite;
}
@keyframes tick-sweep {
  0%   { transform: translateX(-30%); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateX(30%); opacity: 0; }
}

/* push content down so crumbs/header start under the banner */
body { padding-top: 160px; }

/* Everything visible sits above the background stack */
.crumbs, header.section, main.shell, footer { position: relative; z-index: 10; }

/* ----- crumbs / header --------------------------------------------- */
.crumbs {
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  backdrop-filter: var(--glass);
  background: rgba(0,0,0,0.32);
}
.crumbs a { color: var(--purple-2); text-decoration: none; }
.crumbs a:hover { color: #fff; }
.crumbs .here { color: var(--amber); text-shadow: 0 0 12px rgba(255,181,71,0.35); }

header.section {
  padding: 36px 24px 12px;
  max-width: 1320px;
  margin: 0 auto;
}
header.section .eyebrow {
  font-family: var(--mono);
  color: var(--purple-2);
  letter-spacing: 0.38em;
  font-size: 11px;
  text-transform: uppercase;
  margin-bottom: 10px;
  text-shadow: 0 0 14px rgba(167,139,250,0.35);
}
header.section h1 {
  margin: 0;
  font-size: clamp(30px, 4.6vw, 56px);
  font-weight: 600;
  letter-spacing: 0.018em;
  color: #fff;
  text-shadow:
    0 0 24px rgba(167,139,250,0.30),
    0 0 3px rgba(0,229,255,0.55);
}
header.section h1 .accent { color: var(--amber); font-weight: 600; text-shadow: 0 0 18px rgba(255,181,71,0.45); }
header.section h1 .glyph  { color: var(--purple); font-weight: 600; text-shadow: 0 0 18px rgba(167,139,250,0.55); }
header.section p {
  color: var(--ink-soft);
  max-width: 840px;
  margin: 16px 0 0;
  font-size: 15px;
  line-height: 1.65;
}
.equation {
  display: inline-block;
  margin-top: 14px;
  padding: 9px 16px;
  border: 1px dashed var(--line);
  background: rgba(0,0,0,0.55);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ink);
}
.equation b { color: var(--amber); font-weight: 600; }

/* ----- main grid --------------------------------------------------- */
.shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 380px;
  grid-template-areas:
    "modes  side"
    "stage  side"
    "chat   side"
    "extra  extra";
  gap: 16px;
}
@media (max-width: 1024px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-areas: "modes" "stage" "chat" "side" "extra";
  }
}

/* ----- mode switcher ---------------------------------------------- */
.modes { grid-area: modes; }
.modes .modes-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.modes .modes-head h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--muted);
}
.modes .modes-head .mode-now {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--amber);
}
.modes .modes-head .mode-now span#modeGesture { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  --c: var(--cyan);
  appearance: none;
  background: rgba(8, 4, 20, 0.55);
  backdrop-filter: var(--glass);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 9px 15px 9px 12px;
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--ink-d);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  transition: border 120ms, color 120ms, background 120ms, transform 120ms, box-shadow 200ms;
}
.chip .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 14px var(--c), 0 0 4px var(--c);
}
.chip:hover {
  border-color: var(--c); color: #fff; transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.4), 0 0 0 1px var(--c) inset;
}
.chip.active {
  border-color: var(--c); color: #fff;
  background: linear-gradient(180deg, rgba(0,229,255,0.06), rgba(0,0,0,0.55));
  box-shadow: inset 0 0 0 1px var(--c), 0 0 20px rgba(167,139,250,0.10);
}

/* ----- stage ------------------------------------------------------- */
.stage-wrap {
  grid-area: stage;
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
  background:
    radial-gradient(60% 60% at 50% 50%, rgba(167,139,250,0.10), transparent 65%),
    radial-gradient(80% 80% at 50% 50%, rgba(0,0,0,0.85), rgba(0,0,0,0.55) 70%);
  min-height: 540px;
  aspect-ratio: 16/10;
  box-shadow:
    0 0 0 1px rgba(167,139,250,0.10) inset,
    0 24px 60px rgba(0,0,0,0.50);
}
.stage-frame { position: absolute; inset: 0; }
.avatar-home { position: absolute; inset: 0; }
#avatarCanvas { width: 100%; height: 100%; display: block; }
#modeStage { position: absolute; inset: 0; }

.stage-meta {
  position: absolute; left: 16px; bottom: 16px;
  display: flex; gap: 18px; align-items: center;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase;
  color: rgba(214,241,255,0.55);
  pointer-events: none;
}
.stage-meta .pulse { color: var(--purple-2); text-shadow: 0 0 12px var(--purple); }
.stage-meta .pulse::before {
  content:'●'; margin-right: 6px;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}
.stage-corner {
  position: absolute; pointer-events: none;
  width: 30px; height: 30px;
  border: 1px solid var(--purple-2);
  filter: drop-shadow(0 0 6px rgba(167,139,250,0.45));
}
.stage-corner.tl { top: 10px; left: 10px;  border-right: 0; border-bottom: 0; }
.stage-corner.tr { top: 10px; right: 10px; border-left:  0; border-bottom: 0; }
.stage-corner.bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
.stage-corner.br { bottom: 10px; right: 10px; border-left:  0; border-top: 0; }

/* ----- chat -------------------------------------------------------- */
.chat { grid-area: chat; }
.chat .log {
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  background: var(--panel-bg);
  backdrop-filter: var(--glass);
  padding: 14px;
  height: 220px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
}
.chat .log .msg { padding: 4px 0; }
.chat .log .msg-user { color: var(--cyan); }
.chat .log .msg-max  { color: var(--ink); }
.chat .log .msg-max::before  { content: 'MAX · ';  color: var(--amber);  text-shadow: 0 0 8px rgba(255,181,71,0.35); }
.chat .log .msg-user::before { content: 'YOU · ';  color: var(--muted); }
.chat .log .msg-sys {
  color: var(--purple-2); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
}
.chat .row { display: flex; gap: 8px; margin-top: 10px; }
.chat textarea {
  flex: 1;
  resize: none;
  background: rgba(8, 4, 20, 0.7);
  backdrop-filter: var(--glass);
  border: 1px solid var(--line-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--r-2);
  min-height: 44px;
  max-height: 96px;
}
.chat textarea:focus {
  outline: none; border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0,229,255,0.18);
}
.chat .btn {
  background: linear-gradient(180deg, rgba(0,229,255,0.10), rgba(0,229,255,0.04));
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 0 14px;
  border-radius: var(--r-2);
  cursor: pointer;
  transition: background 120ms, color 120ms;
}
.chat .btn:hover { background: rgba(0,229,255,0.16); color: #fff; }
.chat .btn.ptt {
  color: var(--amber); border-color: var(--amber);
  background: linear-gradient(180deg, rgba(255,181,71,0.10), rgba(255,181,71,0.04));
}
.chat .btn.ptt.live {
  animation: ptt-pulse 1s infinite;
  background: rgba(255,181,71,0.20);
}
@keyframes ptt-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,181,71,0.6); }
  50%      { box-shadow: 0 0 0 12px rgba(255,181,71,0); }
}

/* ----- side rail --------------------------------------------------- */
.side { grid-area: side; display: flex; flex-direction: column; gap: 14px; }
.card {
  border: 1px solid var(--line);
  background: var(--panel-bg);
  backdrop-filter: var(--glass);
  border-radius: var(--r-2);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167,139,250,0.55), transparent);
}
.card h3 {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--amber);
}
.mind-line {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(167,139,250,0.10);
}
.mind-line:last-child { border-bottom: 0; }
.mind-line span { color: var(--muted); letter-spacing: 0.2em; text-transform: uppercase; font-size: 10px; }
.mind-line b { color: var(--ink); font-weight: 500; }
.mind-line.ok  b { color: var(--green); text-shadow: 0 0 10px rgba(91,226,154,0.4); }
.mind-line.ask b { color: var(--amber); text-shadow: 0 0 10px rgba(255,181,71,0.4); }

.hp-row {
  display:flex; justify-content:space-between; padding: 4px 0;
  font-family: var(--mono); font-size: 12px;
}
.hp-row span { color: var(--muted); }
.hp-row b.ok  { color: var(--green); }
.hp-row b.off { color: var(--amber); }

/* ----- bluetooth --------------------------------------------------- */
.bt-shell {}
.bt-head { margin-bottom: 10px; }
.bt-title { font-family: var(--mono); font-size: 11px; letter-spacing: 0.38em; color: var(--amber); }
.bt-sub   { color: var(--muted); font-size: 12px; margin-top: 4px; }
.bt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bt-btn {
  appearance: none;
  border: 1px solid var(--line-2);
  background: rgba(8, 4, 20, 0.6);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 10px 8px;
  border-radius: var(--r-1);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  transition: border 120ms, color 120ms, background 120ms;
}
.bt-btn:hover { border-color: var(--purple-2); color: #fff; background: rgba(167,139,250,0.06); }
.bt-btn.primary { border-color: var(--cyan); color: var(--cyan); }
.bt-btn.primary:hover { background: rgba(0,229,255,0.10); color: #fff; }
.bt-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.bt-glyph { font-size: 14px; }
.bt-note { margin-top: 10px; font-size: 11px; color: var(--ink-d); line-height: 1.55; }
.bt-list { margin-top: 10px; }
.bt-list-head { font-family: var(--mono); font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--muted); margin: 6px 0; }
.bt-row {
  display: grid;
  grid-template-columns: 22px 1fr auto auto auto;
  gap: 8px; align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-1);
  margin-top: 6px;
  background: rgba(0, 0, 0, 0.45);
}
.bt-row-glyph { color: var(--cyan); text-align: center; text-shadow: 0 0 8px var(--cyan); }
.bt-row-name { font-size: 12px; }
.bt-row-kind { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; color: var(--muted); text-transform: uppercase; }
.bt-row-id   { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.bt-row-x {
  appearance: none; border: 1px solid var(--line-2);
  background: transparent; color: var(--muted); width: 22px; height: 22px;
  border-radius: 50%; cursor: pointer;
}
.bt-row-x:hover { border-color: var(--crimson); color: var(--crimson); }
.bt-panel {
  margin-top: 10px; padding: 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-1);
  background: rgba(0, 0, 0, 0.55);
}
.bt-phone-title, .bt-cast-title {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.34em;
  color: var(--purple-2); text-transform: uppercase; margin-bottom: 8px;
  text-shadow: 0 0 8px rgba(167,139,250,0.35);
}
.bt-phone-url { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bt-phone-url code {
  font-size: 12px; color: var(--ink);
  background: rgba(167,139,250,0.08);
  padding: 4px 8px; border-radius: 4px;
  border: 1px solid rgba(167,139,250,0.18);
}
.bt-link-btn {
  background: transparent; border: 1px solid var(--cyan); color: var(--cyan);
  font-family: var(--mono); font-size: 10px; padding: 4px 10px; cursor: pointer;
  border-radius: 4px; letter-spacing: 0.24em;
}
.bt-link-btn:hover { background: rgba(0,229,255,0.10); color: #fff; }
.bt-phone-hint, .bt-cast-hint { color: var(--muted); font-size: 11px; margin-top: 8px; line-height: 1.5; }
.bt-cast-list { margin: 6px 0; padding-left: 16px; font-size: 12px; color: var(--ink-d); line-height: 1.8; }
.bt-cast-list b { color: var(--amber); font-weight: 500; }

/* ----- devices panel ---------------------------------------------- */
.devices { grid-area: extra; }
.devices .dev-head {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.38em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 12px;
}
.dev-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.dev-tile {
  border: 1px solid var(--line);
  background: var(--panel-bg);
  backdrop-filter: var(--glass);
  border-radius: var(--r-2);
  padding: 14px;
  cursor: pointer;
  position: relative;
  transition: border 120ms, transform 120ms, background 120ms;
  overflow: hidden;
}
.dev-tile::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167,139,250,0.50), transparent);
}
.dev-tile-mode {
  --c: var(--cyan);
  width: 30px; height: 4px; border-radius: 2px;
  background: var(--c); box-shadow: 0 0 12px var(--c);
  margin-bottom: 10px;
}
.dev-tile-name { font-family: var(--mono); font-size: 13px; color: var(--ink); }
.dev-tile-meta {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.22em; color: var(--muted);
  margin-top: 4px; text-transform: uppercase;
}
.dev-tile:hover { border-color: var(--purple-2); transform: translateY(-2px); background: rgba(167,139,250,0.06); }

/* ----- footer ----------------------------------------------------- */
footer {
  text-align: center; padding: 28px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: var(--glass);
  font-size: 11px; letter-spacing: 0.24em;
  text-transform: uppercase;
}
footer b { color: var(--purple-2); text-shadow: 0 0 8px rgba(167,139,250,0.4); font-weight: 500; }

/* ----- looking glass mode · light-field quilt -------------------- */
.lg-shell { width: 100%; height: 100%; display: flex; flex-direction: column; background: #000; }
.lg-stage {
  flex: 1; display: grid; gap: 2px;
  background: #000;
  padding: 12px;
}
.lg-tile {
  position: relative;
  overflow: hidden; border-radius: 3px;
  background: #000;
  opacity: 0; animation: lg-fade-in 380ms ease-out forwards;
}
@keyframes lg-fade-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1);    }
}
.lg-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lg-tile-az {
  position: absolute; bottom: 2px; right: 4px;
  font-family: var(--mono); font-size: 8px;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.55);
  text-shadow: 0 0 4px rgba(0,0,0,0.85);
  opacity: 0; transition: opacity 120ms;
}
.lg-tile:hover .lg-tile-az { opacity: 1; }
.lg-loading { color: var(--muted); align-self: center; justify-self: center; grid-column: 1/-1; font-family: var(--mono); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; }
.lg-rail { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line-2); align-items: center; flex-wrap: wrap; background: rgba(0,0,0,0.55); }
.lg-chip { font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em; color: var(--muted); text-transform: uppercase; padding: 4px 8px; border: 1px solid var(--line-2); border-radius: 4px; }
.lg-chip#lgStatus { color: #7df0d0; border-color: rgba(125,240,208,0.35); margin-left: auto; }
.lg-btn { font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em; color: #7df0d0; background: transparent; border: 1px solid #7df0d0; padding: 6px 12px; border-radius: 4px; cursor: pointer; }
.lg-btn:hover { background: rgba(125,240,208,0.10); color: #fff; }

/* ----- webxr mode · headset billboards --------------------------- */
.xr-shell { width: 100%; height: 100%; display: flex; flex-direction: column; background: #000; }
.xr-stage {
  flex: 1; perspective: 1200px;
  display: grid; place-items: center;
  background:
    radial-gradient(50% 50% at 50% 55%, rgba(167,139,250,0.16), transparent 75%),
    #000;
  overflow: hidden;
  position: relative;
}
.xr-floor {
  position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%) rotateX(70deg);
  width: 600px; height: 600px;
  background:
    repeating-linear-gradient(0deg, rgba(167,139,250,0.16) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(167,139,250,0.16) 0 1px, transparent 1px 40px);
  -webkit-mask-image: radial-gradient(50% 50% at 50% 50%, #000 0%, transparent 70%);
          mask-image: radial-gradient(50% 50% at 50% 50%, #000 0%, transparent 70%);
  pointer-events: none;
}
.xr-ring { position: relative; transform-style: preserve-3d; width: 1px; height: 1px; transition: transform 60ms linear; }
.xr-card {
  position: absolute; transform-style: preserve-3d;
  width: 120px; height: 120px;
  margin-left: -60px; margin-top: -60px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(167,139,250,0.55);
  box-shadow: 0 0 20px rgba(167,139,250,0.30);
  background: #000;
  opacity: 0; animation: xr-card-in 420ms ease-out forwards;
}
@keyframes xr-card-in {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; }
}
.xr-card img { width: 100%; height: 100%; display: block; }
.xr-anchor { position: absolute; color: var(--purple-2); font-size: 36px; text-shadow: 0 0 22px var(--purple); animation: pulse 2.4s ease-in-out infinite; }
.xr-rail { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line-2); align-items: center; flex-wrap: wrap; background: rgba(0,0,0,0.55); }
.xr-chip { font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em; color: var(--muted); text-transform: uppercase; padding: 4px 8px; border: 1px solid var(--line-2); border-radius: 4px; }
.xr-chip#xrStatus { color: var(--purple-2); border-color: rgba(167,139,250,0.35); margin-left: auto; }
.xr-btn  { font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em; color: var(--purple-2); background: transparent; border: 1px solid var(--purple); padding: 6px 12px; border-radius: 4px; cursor: pointer; }
.xr-btn:hover { background: rgba(167,139,250,0.10); color: #fff; }
.xr-btn + .xr-btn { margin-left: 6px; }

/* ----- hud mode --------------------------------------------------- */
.hud-shell { width: 100%; height: 100%; position: relative; background: #000; }
.hud-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hud-avatar { position: absolute !important; inset: 0 !important; mix-blend-mode: screen; }
.hud-grid   { position: absolute; inset: 0; pointer-events: none; }
.hud-corner { position: absolute; width: 28px; height: 28px; border: 1px solid var(--amber); filter: drop-shadow(0 0 6px rgba(255,181,71,0.5)); }
.hud-corner.tl { top: 14px; left: 14px;  border-right: 0; border-bottom: 0; }
.hud-corner.tr { top: 14px; right: 14px; border-left:  0; border-bottom: 0; }
.hud-corner.bl { bottom: 14px; left: 14px; border-right: 0; border-top: 0; }
.hud-corner.br { bottom: 14px; right: 14px; border-left:  0; border-top: 0; }
.hud-ring {
  position: absolute; top: 50%; left: 50%;
  width: 280px; height: 280px; transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px dashed rgba(255,181,71,0.35);
  box-shadow: inset 0 0 80px rgba(255,181,71,0.06);
}
.hud-reticle { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.hud-reticle-r {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  border-radius: 50%; border: 1px solid rgba(255,181,71,0.45);
}
.hud-reticle-r:nth-child(1) { width: 40px;  height: 40px;  }
.hud-reticle-r:nth-child(2) { width: 80px;  height: 80px;  }
.hud-reticle-r:nth-child(3) { width: 140px; height: 140px; }
.hud-rail {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: flex; gap: 10px;
}
.hud-chk { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.18); transition: background 150ms, box-shadow 150ms; }
.hud-chk.lit.hud-chk-crown  { background: var(--purple);  box-shadow: 0 0 14px var(--purple); }
.hud-chk.lit.hud-chk-brow   { background: #6f8dff;       box-shadow: 0 0 14px #6f8dff; }
.hud-chk.lit.hud-chk-throat { background: var(--cyan);   box-shadow: 0 0 14px var(--cyan); }
.hud-chk.lit.hud-chk-heart  { background: var(--green);  box-shadow: 0 0 14px var(--green); }
.hud-chk.lit.hud-chk-plexus { background: var(--amber);  box-shadow: 0 0 14px var(--amber); }
.hud-chk.lit.hud-chk-sacral { background: var(--orange); box-shadow: 0 0 14px var(--orange); }
.hud-chk.lit.hud-chk-root   { background: var(--crimson);box-shadow: 0 0 14px var(--crimson); }
.hud-meta {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.32em;
  color: rgba(255,181,71,0.85);
  display: flex; gap: 18px; text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255,181,71,0.35);
}
.hud-meta span:nth-child(2) { color: var(--cyan); text-shadow: 0 0 8px rgba(0,229,255,0.45); }
.hud-meta span:nth-child(3) { color: var(--purple-2); text-shadow: 0 0 8px rgba(167,139,250,0.45); }

/* ----- camera mode · live AR mirror ------------------------------ */
.cam-shell {
  width: 100%; height: 100%; position: relative;
  background:
    radial-gradient(80% 80% at 50% 50%, rgba(0,0,0,0.55), #000 90%),
    #000;
  overflow: hidden;
}
.cam-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  filter: contrast(1.05) saturate(1.05);
  z-index: 1;
}
.cam-fx {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: none; z-index: 2; pointer-events: none;
  mix-blend-mode: screen;
}
.cam-shell.holographic .cam-video { opacity: 0;  }
.cam-shell.holographic .cam-fx    { display: block; }
.cam-shell.holographic {
  background:
    radial-gradient(80% 80% at 50% 50%, rgba(167,139,250,0.10), #000 85%),
    #000;
}
.cam-scan {
  position: absolute; inset: 0; z-index: 3;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    0deg, transparent 0 2px, rgba(0,229,255,0.06) 2px 3px);
  mix-blend-mode: screen;
  opacity: 0; transition: opacity 200ms;
}
.cam-shell.holographic .cam-scan { opacity: 1; }
.cam-overlay {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 4;
}
.cam-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
  box-shadow: inset 0 0 180px rgba(0,0,0,0.7),
              inset 0 0 60px rgba(167,139,250,0.10);
}
.cam-shell.holographic .cam-vignette {
  box-shadow: inset 0 0 180px rgba(0,0,0,0.65),
              inset 0 0 80px rgba(167,139,250,0.35),
              inset 0 0 40px rgba(0,229,255,0.20);
}
.cam-avatar {
  position: absolute !important; inset: 0 !important;
  mix-blend-mode: screen; pointer-events: none; z-index: 6;
}
.cam-controls {
  position: absolute; bottom: 16px; left: 16px; right: 16px;
  display: flex; gap: 6px; justify-content: center; flex-wrap: wrap;
  z-index: 8;
}
.cam-btn {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(167,139,250,0.45);
  color: var(--purple-2);
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.24em; text-transform: uppercase;
  padding: 7px 12px; border-radius: 4px; cursor: pointer;
  transition: border 120ms, color 120ms, background 120ms;
}
.cam-btn:hover { background: rgba(167,139,250,0.14); color: #fff; }
.cam-btn.on    {
  background: rgba(167,139,250,0.22); color: #fff;
  border-color: var(--purple-2);
  box-shadow: 0 0 12px rgba(167,139,250,0.40);
}
.cam-note {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  color: rgba(214,241,255,0.85); background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  padding: 5px 12px; border-radius: 4px; text-transform: uppercase;
  border: 1px solid rgba(167,139,250,0.35); z-index: 9;
}
.cam-meta {
  position: absolute; top: 14px; right: 16px;
  display: flex; gap: 14px; align-items: center;
  font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.28em; text-transform: uppercase;
  color: rgba(214,241,255,0.65);
  z-index: 9;
}
.cam-meta .cam-pulse { color: var(--muted); }
.cam-meta .cam-pulse::before { content: '● '; opacity: 0.4; }
.cam-meta .cam-pulse.on { color: var(--purple-2); }
.cam-meta .cam-pulse.on::before { opacity: 1; animation: pulse 1.4s ease-in-out infinite; }

/* sweeping scan line layer (between scan-pattern and reticle) */
.cam-sweep {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: none; z-index: 3; pointer-events: none;
  mix-blend-mode: screen;
}
.cam-shell.holographic .cam-sweep { display: block; }

/* loading spinner overlay (visible while requesting getUserMedia) */
.cam-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; z-index: 12;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.cam-loading[hidden] { display: none; }
.cam-loading-ring {
  width: 48px; height: 48px; border-radius: 50%;
  border: 2px solid rgba(167,139,250,0.18);
  border-top-color: var(--purple-2);
  animation: cam-spin 0.9s linear infinite;
}
.cam-loading-text {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--purple-2);
  text-shadow: 0 0 10px rgba(167,139,250,0.4);
}
@keyframes cam-spin { to { transform: rotate(360deg); } }

/* error banner with RETRY */
.cam-error {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; z-index: 13;
  padding: 20px 26px;
  border: 1px solid rgba(239,68,88,0.45);
  background: rgba(8,4,20,0.85);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 0 24px rgba(239,68,88,0.25), 0 18px 60px rgba(0,0,0,0.6);
  max-width: 80%;
  text-align: center;
}
.cam-error[hidden] { display: none; }
.cam-error-title {
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.36em; color: var(--crimson);
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(239,68,88,0.45);
}
.cam-error-msg {
  font-family: var(--sans); font-size: 13px;
  color: var(--ink-soft); line-height: 1.55;
  max-width: 380px;
}
.cam-error .cam-btn.primary {
  background: rgba(167,139,250,0.20); color: #fff;
  border-color: var(--purple-2);
  font-size: 11px; padding: 10px 22px;
  letter-spacing: 0.28em;
}
.cam-error .cam-btn.primary:hover { background: rgba(167,139,250,0.32); }

/* device picker inside controls */
.cam-select {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(167,139,250,0.45);
  color: var(--ink);
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 7px 10px; border-radius: 4px; cursor: pointer;
  max-width: 180px;
}
.cam-select:focus { outline: none; border-color: var(--cyan); }

/* ----- volumetric mode · parallax cards -------------------------- */
.vol-shell { width: 100%; height: 100%; display: flex; flex-direction: column; background: #000; }
.vol-stage {
  flex: 1; perspective: 1200px;
  display: grid; place-items: center;
  background:
    radial-gradient(45% 45% at 50% 60%, rgba(255,138,101,0.14), transparent 75%),
    #000;
  touch-action: none; user-select: none; cursor: grab;
}
.vol-stage:active { cursor: grabbing; }
.vol-ring { position: relative; transform-style: preserve-3d; width: 1px; height: 1px; }
.vol-card {
  position: absolute; transform-style: preserve-3d;
  width: 160px; height: 160px;
  margin-left: -80px; margin-top: -80px;
  border-radius: 10px; overflow: hidden;
  border: 1px solid rgba(255,138,101,0.55);
  box-shadow: 0 0 20px rgba(255,138,101,0.30);
  background: #000;
  opacity: 0; animation: vol-card-in 380ms ease-out forwards;
}
@keyframes vol-card-in {
  from { opacity: 0; transform: scale(0.6) translateZ(0); }
  to   { opacity: 1; }
}
.vol-card img { width: 100%; height: 100%; display: block; }
.vol-rail { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line-2); align-items: center; background: rgba(0,0,0,0.55); }
.vol-chip { font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em; color: var(--muted); text-transform: uppercase; }
.vol-chip#volMeter { color: var(--orange); }
.vol-btn  { margin-left: auto; font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em; color: var(--orange); background: transparent; border: 1px solid var(--orange); padding: 6px 12px; border-radius: 4px; cursor: pointer; }
.vol-btn.on { background: rgba(255,138,101,0.18); color: #fff; }
.vol-btn + .vol-btn { margin-left: 8px; }
.vol-btn:hover { background: rgba(255,138,101,0.10); color: #fff; }


/* ----- responsive tightening ------------------------------------- */
@media (max-width: 1024px) {
  body { padding-top: 130px; }
  .matrix-banner { height: 130px; }
  .matrix-banner .banner-title { font-size: 10px; letter-spacing: 0.36em; padding: 5px 14px; top: 10px; }
  .matrix-banner .banner-rail { font-size: 8px; letter-spacing: 0.34em; padding: 0 16px; bottom: 18px; }
}

@media (max-width: 768px) {
  body { padding-top: 110px; }
  .matrix-banner { height: 110px; }
  .matrix-banner .banner-title span:not(.pin) { display: none; }
  .matrix-banner .banner-title { gap: 10px; padding: 5px 10px; }
  .matrix-banner .banner-rail { display: none; }
  .crumbs { padding: 10px 14px; font-size: 9px; letter-spacing: 0.22em; gap: 6px; }
  .crumbs .here { font-size: 9px; }
  header.section { padding: 18px 14px 6px; }
  header.section h1 { font-size: clamp(24px, 7vw, 38px); }
  header.section p { font-size: 13px; line-height: 1.55; }
  .shell { padding: 12px 14px 60px; gap: 12px; }
  .stage-wrap { min-height: 380px; aspect-ratio: 4/5; }
  /* horizontal-scroll chip rail on small screens */
  .modes .chips {
    flex-wrap: nowrap; overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .chip { scroll-snap-align: start; flex-shrink: 0; }
  .modes::-webkit-scrollbar { display: none; }
  /* larger touch targets */
  .chat .btn, .bt-btn, .cam-btn, .lg-btn, .xr-btn, .vol-btn { min-height: 44px; padding: 8px 14px; }
  .chat textarea { min-height: 56px; font-size: 14px; }
  .live-orb { top: 10px; right: 10px; padding: 5px 10px 5px 7px; }
  .live-state { font-size: 9px; letter-spacing: 0.22em; }
  .zoom-btn { top: 10px; right: 132px; width: 32px; height: 32px; }
  /* devices grid: 2-up on phones */
  .dev-grid { grid-template-columns: 1fr 1fr; }
  /* project actions stack */
  .project-card .project-actions { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  body { padding-top: 96px; }
  .matrix-banner { height: 96px; }
  header.section { padding: 14px 12px 4px; }
  header.section h1 { font-size: clamp(22px, 8vw, 32px); }
  .shell { padding: 10px 12px 50px; }
  .stage-wrap { min-height: 340px; aspect-ratio: 3/4; }
  .crumb-status { display: none; }
  .equation { font-size: 10px; padding: 6px 10px; }
  .dev-grid { grid-template-columns: 1fr; }
  .modes-head .mode-now { font-size: 9px; }
  .zoom-btn { right: 110px; }
  .live-orb { padding: 4px 8px 4px 6px; gap: 6px; }
  .live-state { font-size: 8px; letter-spacing: 0.18em; }
}

/* ----- crumb status pill ----------------------------------------- */
.crumb-spacer { flex: 1; }
.crumb-status {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.24em; color: var(--purple-2);
  text-shadow: 0 0 8px rgba(167,139,250,0.4);
  text-transform: uppercase;
}
.crumbs { display: flex; align-items: center; gap: 10px; }

/* ----- live conversation orb on the stage ------------------------ */
.live-orb {
  position: absolute; top: 16px; right: 16px;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
}
.live-ring {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 0 rgba(0,229,255,0);
}
.live-state {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--ink-d);
}
.live-orb.idle      .live-ring { background: var(--muted); }
.live-orb.listening .live-ring { background: var(--cyan);    box-shadow: 0 0 0 6px rgba(0,229,255,0.20);  animation: live-pulse 1.2s ease-in-out infinite; }
.live-orb.thinking  .live-ring { background: var(--purple-2); box-shadow: 0 0 0 6px rgba(167,139,250,0.25); animation: live-pulse 1.0s ease-in-out infinite; }
.live-orb.speaking  .live-ring { background: var(--amber);   box-shadow: 0 0 0 6px rgba(255,181,71,0.25);  animation: live-pulse 0.7s ease-in-out infinite; }
.live-orb.idle      .live-state { color: var(--muted);   }
.live-orb.listening .live-state { color: var(--cyan);    }
.live-orb.thinking  .live-state { color: var(--purple-2); }
.live-orb.speaking  .live-state { color: var(--amber);   }
@keyframes live-pulse {
  0%, 100% { transform: scale(1);   }
  50%      { transform: scale(1.18);}
}

/* ----- Mind of MAX card (front and centre) ----------------------- */
.mind-card { padding: 18px 16px 14px; }
.mind-orb {
  position: relative; width: 120px; height: 120px; margin: 6px auto 14px;
}
.mind-orb-core {
  position: absolute; inset: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--purple-2) 0%, var(--purple) 40%, var(--purple-deep) 80%, transparent 100%);
  box-shadow: 0 0 32px rgba(167,139,250,0.55), inset 0 0 16px rgba(255,255,255,0.18);
  animation: orb-breath 3.4s ease-in-out infinite;
}
.mind-orb-ring,
.mind-orb-ring.r2,
.mind-orb-ring.r3 {
  position: absolute; inset: 0;
  border-radius: 50%; border: 1px solid rgba(167,139,250,0.4);
  animation: orb-spin 16s linear infinite;
}
.mind-orb-ring.r2 { inset: 14px; border-color: rgba(195,167,255,0.35); animation-duration: 22s; animation-direction: reverse; }
.mind-orb-ring.r3 { inset: 28px; border-color: rgba(167,139,250,0.25); animation-duration: 11s; }
@keyframes orb-spin {
  to { transform: rotate(360deg); }
}
@keyframes orb-breath {
  0%,100% { transform: scale(1.00); }
  50%     { transform: scale(1.08); }
}
.mind-card.gate-open  .mind-orb-core { background: radial-gradient(circle at 50% 50%, var(--green) 0%, #2ec56b 45%, #134b2a 85%, transparent 100%); box-shadow: 0 0 36px rgba(91,226,154,0.55), inset 0 0 16px rgba(255,255,255,0.2); }
.mind-card.gate-ask   .mind-orb-core { background: radial-gradient(circle at 50% 50%, var(--amber) 0%, #c87b1a 50%, #4b2a06 90%, transparent 100%); box-shadow: 0 0 32px rgba(255,181,71,0.55), inset 0 0 16px rgba(255,255,255,0.18); }

/* ----- chakra spine row ----------------------------------------- */
.chakra-spine {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed rgba(167,139,250,0.18);
  display: flex; justify-content: space-between; gap: 6px;
}
.chk {
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  transition: background 200ms, box-shadow 200ms, transform 200ms;
  cursor: help;
}
.chk.lit { transform: scale(1.15); }
.chk.lit.c-crown  { background: var(--purple);  box-shadow: 0 0 14px var(--purple); }
.chk.lit.c-brow   { background: #6f8dff;        box-shadow: 0 0 14px #6f8dff; }
.chk.lit.c-throat { background: var(--cyan);    box-shadow: 0 0 14px var(--cyan); }
.chk.lit.c-heart  { background: var(--green);   box-shadow: 0 0 14px var(--green); }
.chk.lit.c-plexus { background: var(--amber);   box-shadow: 0 0 14px var(--amber); }
.chk.lit.c-sacral { background: var(--orange);  box-shadow: 0 0 14px var(--orange); }
.chk.lit.c-root   { background: var(--crimson); box-shadow: 0 0 14px var(--crimson); }

/* ----- chat head ------------------------------------------------- */
.chat-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 8px;
}
.chat-head h2 {
  margin: 0; font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.4em; text-transform: uppercase; color: var(--amber);
}
.chat-hint {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.18em; color: var(--muted);
}
.chat-hint code, .chat-hint kbd {
  color: var(--purple-2);
  background: rgba(167,139,250,0.10);
  padding: 1px 6px; border-radius: 3px;
  border: 1px solid rgba(167,139,250,0.22);
  font-family: var(--mono); font-size: 10px;
}

/* ----- project (camera/upload → mode) ---------------------------- */
.project-card .project-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px;
}
.project-card .project-actions .bt-btn,
.project-card .project-actions label.bt-btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  cursor: pointer;
}
.project-thumb {
  display: flex; align-items: center; gap: 10px;
  min-height: 0;
}
.project-thumb img {
  width: 56px; height: 56px; object-fit: cover; border-radius: 8px;
  border: 1px solid rgba(167,139,250,0.45);
  box-shadow: 0 0 14px rgba(167,139,250,0.30);
}
.project-thumb-label {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.2em; color: var(--purple-2);
  text-transform: uppercase;
}
.project-note {
  margin-top: 8px;
  font-size: 11px; color: var(--ink-d); line-height: 1.55;
}

/* ----- hands-free button row ------------------------------------- */
.chat-row-2 { margin-top: 8px; }
.btn.ghost {
  flex: 1; background: transparent;
  border: 1px solid var(--purple);
  color: var(--purple-2);
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  padding: 9px 12px;
  border-radius: var(--r-2); cursor: pointer;
  text-shadow: 0 0 8px rgba(167,139,250,0.5);
}
.btn.ghost:hover { background: rgba(167,139,250,0.10); color: #fff; }
.btn.ghost.on    { background: rgba(167,139,250,0.20); color: #fff;
  box-shadow: 0 0 16px rgba(167,139,250,0.40); }

/* ----- talk-with-MAX suggest chips ------------------------------- */
.chat-suggests {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 10px 0 12px;
}
.suggest-chip {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase;
  background: rgba(0,229,255,0.06);
  border: 1px solid rgba(0,229,255,0.28);
  color: var(--cyan);
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.suggest-chip:hover {
  background: rgba(0,229,255,0.18); color: #fff;
  box-shadow: 0 0 14px rgba(0,229,255,0.32);
  transform: translateY(-1px);
}
.suggest-chip:active { transform: translateY(0); }

/* ----- talk-with-MAX mind-card readout --------------------------- */
.mind-card {
  margin-top: 10px;
  border: 1px solid rgba(167,139,250,0.22);
  background: linear-gradient(180deg, rgba(167,139,250,0.06), rgba(0,229,255,0.03));
  border-radius: var(--r-2, 10px);
  padding: 10px 12px;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.mind-card.gate-open { border-color: rgba(91,226,154,0.5); box-shadow: 0 0 18px rgba(91,226,154,0.18); }
.mind-card.gate-ask  { border-color: rgba(255,181,71,0.5); box-shadow: 0 0 18px rgba(255,181,71,0.16); }
.mind-card .mind-head {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.36em;
  color: var(--purple-2); text-transform: uppercase;
  margin-bottom: 6px;
}
.mind-card .mind-body:empty::before {
  content: 'awaiting first turn — MAX will show what it understood here';
  color: var(--muted); font-style: italic; font-size: 11px;
}

/* ----- chat-row-2 layout (hands-free + lang) --------------------- */
.chat-row-2 { display: flex; gap: 8px; align-items: stretch; margin-top: 8px; }
.lang-picker {
  appearance: none; -webkit-appearance: none;
  background: transparent;
  border: 1px solid rgba(0,229,255,0.32);
  color: var(--cyan);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 9px 30px 9px 12px; border-radius: var(--r-2, 10px);
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--cyan) 50%),
                    linear-gradient(135deg, var(--cyan) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.lang-picker:hover  { background-color: rgba(0,229,255,0.08); color: #fff; }
.lang-picker:focus  { outline: none; box-shadow: 0 0 14px rgba(0,229,255,0.32); }
.lang-picker option { background: #0a0a18; color: var(--ink); }

/* ----- creations gallery ----------------------------------------- */
.creations-wrap {
  margin-top: 14px;
  padding: 12px 12px 14px;
  border: 1px solid rgba(167,139,250,0.22);
  border-radius: var(--r-2, 10px);
  background: linear-gradient(180deg, rgba(167,139,250,0.05), rgba(0,229,255,0.025));
}
.creations-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.creations-head h3 {
  margin: 0;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.36em;
  text-transform: uppercase; color: var(--amber);
}
.creations-head .btn.primary {
  background: linear-gradient(135deg, rgba(0,229,255,0.18), rgba(167,139,250,0.18));
  border: 1px solid rgba(0,229,255,0.45);
  color: #fff;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.32em;
  text-transform: uppercase;
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  box-shadow: 0 0 12px rgba(0,229,255,0.22);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.creations-head .btn.primary:hover { transform: translateY(-1px); box-shadow: 0 0 18px rgba(0,229,255,0.35); }
.creations-gallery {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px;
  scroll-snap-type: x mandatory;
}
.creations-gallery::-webkit-scrollbar { height: 6px; }
.creations-gallery::-webkit-scrollbar-thumb { background: rgba(0,229,255,0.25); border-radius: 999px; }
.creation-card {
  flex: 0 0 110px; min-width: 110px;
  background: transparent; border: 1px solid rgba(167,139,250,0.35);
  border-radius: 12px; padding: 0; overflow: hidden;
  cursor: pointer; display: block;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  scroll-snap-align: start;
}
.creation-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0,229,255,0.6);
  box-shadow: 0 0 18px rgba(0,229,255,0.32);
}
.creation-card:active { transform: translateY(0) scale(0.98); }
.creation-card.projecting {
  border-color: rgba(91,226,154,0.95);
  box-shadow: 0 0 28px rgba(91,226,154,0.55);
  animation: creation-pulse 600ms ease-out;
}
@keyframes creation-pulse {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.creations-head .btn.primary[disabled] {
  opacity: 0.72; cursor: progress; filter: saturate(0.7);
}
.creations-head .btn.primary .spin {
  display: inline-block; animation: spin-rot 0.8s linear infinite;
}
@keyframes spin-rot { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.creation-card img {
  display: block; width: 100%; height: 110px; object-fit: cover; background: #000;
}
.creation-card .creation-label {
  display: block; padding: 5px 8px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--purple-2);
  text-align: center; background: rgba(0,0,0,0.55);
}
.creation-empty {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  padding: 18px 8px; text-align: center;
}
.creation-empty b { color: var(--cyan); }
.creations-hint {
  margin-top: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  color: var(--muted);
}
.creations-hint b { color: var(--cyan); }

/* ----- tool-call toast (transient feedback) ---------------------- */
.tool-toast {
  position: fixed; bottom: 16px; left: 50%; transform: translate(-50%, 8px);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, rgba(0,229,255,0.85), rgba(167,139,250,0.85));
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 0 24px rgba(0,229,255,0.35);
  opacity: 0; pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
  z-index: 1000;
}
.tool-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ----- View Transitions on hologram-mode swap -------------------- */
/* Lets Chrome/Edge/Safari animate the stage cleanly between modes. */
/* Only ONE element may carry a given view-transition-name at a time, else the
   browser throws "duplicate view-transition-name". Target the mode-swap stage. */
#modeStage {
  view-transition-name: holo-stage;
}
@supports (view-transition-name: x) {
  ::view-transition-old(holo-stage),
  ::view-transition-new(holo-stage) {
    animation-duration: 380ms;
    animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  ::view-transition-old(holo-stage) {
    animation-name: holo-stage-out;
    mix-blend-mode: screen;
  }
  ::view-transition-new(holo-stage) {
    animation-name: holo-stage-in;
    mix-blend-mode: normal;
  }
}
@keyframes holo-stage-out {
  to { opacity: 0; transform: scale(0.96); filter: blur(4px) hue-rotate(35deg); }
}
@keyframes holo-stage-in {
  from { opacity: 0; transform: scale(1.04); filter: blur(4px) hue-rotate(-35deg); }
}

/* ----- Houdini chakra-grid paint worklet (with SVG fallback) ----- */
.bg-houdini {
  position: absolute; inset: 0; pointer-events: none;
  /* Fallback gradient if paint() not supported — preserves the look. */
  background:
    radial-gradient(circle at 22% 18%, rgba(167,139,250,0.18), transparent 38%),
    radial-gradient(circle at 78% 70%, rgba(0,229,255,0.16), transparent 42%);
  opacity: 0.55;
  z-index: 1;
}
@supports (background: paint(chakra-grid)) {
  .bg-houdini {
    background: paint(chakra-grid);
    --chakra-grid-spacing: 48;
    --chakra-grid-intensity: 0.42;
  }
}

/* ----- a11y: respect reduced motion ------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .bg-scan, .stage-meta .pulse::before { animation: none; }
  .suggest-chip:hover, .creation-card:hover, .creations-head .btn.primary:hover { transform: none; }
}
