/* BIO: Implementation note for this section. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:       #020408;
  --cyan:     #00f5ff;
  --pink:     #ff006e;
  --green:    #00ff88;
  --purple:   #bf00ff;
  --yellow:   #ffee00;
  --node-bg:  rgba(2,4,8,0.93);
  --tb-bg:    rgba(2,4,8,0.65);
  --tb-border:rgba(0,245,255,0.2);
}
body.light {
  --bg:       #eef2ff;
  --cyan:     #0055bb;
  --pink:     #cc0055;
  --green:    #007744;
  --purple:   #7700bb;
  --yellow:   #886600;
  --node-bg:  rgba(240,245,255,0.97);
  --tb-bg:    rgba(235,240,255,0.88);
  --tb-border:rgba(0,85,187,0.25);
}
body.light::before {
  background-image:
    linear-gradient(rgba(0,80,180,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,80,180,0.06) 1px, transparent 1px);
}
body.light::after { display: none; }
html, body {
  width: 100%;
  /* BIO: iOS Safari's 100% can collapse around the address bar; 100dvh hugs the *current* visual viewport, so fullscreen overlays don't get clipped or leave a band of background showing through. */
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  font-family: 'Share Tech Mono', monospace;
  cursor: none;
  user-select: none;
}

/* BIO: Implementation note for this section. */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(0,100,255,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,100,255,0.07) 1px, transparent 1px);
  background-size: 55px 55px;
  pointer-events: none;
  z-index: 0;
}

/* BIO: Implementation note for this section. */
body::after {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 2px,
    rgba(0,0,0,0.07) 2px, rgba(0,0,0,0.07) 4px
  );
  pointer-events: none;
  z-index: 300;
}

/* BIO: Implementation note for this section. */
#cur {
  position: fixed;
  width: 18px; height: 18px;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px var(--cyan), 0 0 18px rgba(0,245,255,0.2);
  transition: width .18s, height .18s, background .18s, border-color .25s, box-shadow .25s;
  will-change: left, top;
}
#cur.hov {
  width: 32px; height: 32px;
  background: rgba(0,245,255,0.06);
  box-shadow: 0 0 12px var(--cyan), 0 0 28px rgba(0,245,255,0.3);
}

/* BIO: Implementation note for this section. */
#grid-trail {
  position: fixed; inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* BIO: Implementation note for this section. */
#pc {
  position: fixed; inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* BIO: Implementation note for this section. */
#cursor-trail {
  position: fixed; inset: 0;
  z-index: 9998;
  pointer-events: none;
}

/* BIO: Implementation note for this section. */
.cor {
  position: fixed;
  width: 48px; height: 48px;
  z-index: 10;
  pointer-events: none;
}
.cor::before, .cor::after {
  content: '';
  position: absolute;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}
.cor::before { top: 0; left: 0; width: 100%; height: 2px; }
.cor::after  { top: 0; left: 0; width: 2px; height: 100%; }
.tl { top: 18px; left: 18px; }
.tr { top: 18px; right: 18px; transform: scaleX(-1); }
.bl { bottom: 18px; left: 18px; transform: scaleY(-1); }
.br { bottom: 18px; right: 18px; transform: scale(-1); }

/* BIO: Extra corner dots */
.cor-dot {
  position: fixed;
  width: 4px; height: 4px;
  background: var(--cyan);
  border-radius: 50%;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 0 6px var(--cyan);
}
.dot-tl { top: 16px; left: 16px; }
.dot-tr { top: 16px; right: 16px; }
.dot-bl { bottom: 16px; left: 16px; }
.dot-br { bottom: 16px; right: 16px; }

/* BIO: Implementation note for this section. */
#main-vol {
  position: fixed;
  top: 40px; left: 70px;
  z-index: 55;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  opacity: 0;
  pointer-events: auto;
}
#main-vol-icon {
  font-size: 14px;
  opacity: 0.6;
  line-height: 1;
  cursor: pointer;
}
#main-vol-blocks {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 18px;
  cursor: pointer;
  padding: 2px 0;
}
#main-vol-blocks .vb {
  width: 5px;
  border-radius: 1px;
  background: rgba(0,245,255,0.06);
  border: 1px solid rgba(0,245,255,0.1);
  transition: background 0.1s, box-shadow 0.1s, border-color 0.1s;
}
#main-vol-blocks .vb.active {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 4px rgba(0,245,255,0.3);
}
#main-vol-blocks .vb.active.hot {
  background: #00c8ff;
  border-color: #00c8ff;
  box-shadow: 0 0 6px rgba(0,200,255,0.5);
}
#main-vol-pct {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(0,245,255,0.4);
  min-width: 28px;
  line-height: 1;
}

/* BIO: Implementation note for this section. */
#main-vol .mv-sep {
  width: 1px;
  height: 22px;
  background: rgba(0,245,255,0.22);
  margin: 0 8px 2px;
  flex-shrink: 0;
}
#mini-player {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
  max-width: 230px;
  line-height: 1;
}
.mp-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.mp-controls {
  justify-content: center;
  gap: 10px;
  padding: 2px 0;
}
.mp-btn {
  background: transparent;
  border: 1px solid rgba(0,245,255,0.22);
  color: var(--cyan);
  width: 26px; height: 26px;
  padding: 0;
  cursor: none;
  opacity: 0.55;
  transition: opacity .2s, background .2s, border-color .2s, box-shadow .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mp-btn:hover {
  opacity: 1;
  background: rgba(0,245,255,0.08);
  border-color: rgba(0,245,255,0.55);
  box-shadow: 0 0 8px rgba(0,245,255,0.2);
}
.mp-btn-lg {
  width: 32px; height: 32px;
  border-color: rgba(0,245,255,0.4);
  opacity: 0.85;
}
.mp-btn svg { display: block; width: 14px; height: 14px; }
.mp-btn-lg svg { width: 16px; height: 16px; }

#mini-player.mp-playing .mp-btn-lg {
  background: rgba(0,245,255,0.15);
  border-color: var(--cyan);
  opacity: 1;
  box-shadow: 0 0 10px rgba(0,245,255,0.35);
}

.mp-progress-row { gap: 6px; }
.mp-time {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.5px;
  color: rgba(0,245,255,0.38);
  min-width: 22px;
  flex-shrink: 0;
}
#mp-dur { text-align: right; }

#mp-progress {
  flex: 1;
  height: 6px;
  background: rgba(0,245,255,0.12);
  border: 1px solid rgba(0,245,255,0.1);
  border-radius: 3px;
  cursor: none;
  position: relative;
  min-width: 0;
  transition: height .15s;
}
#mp-progress:hover { height: 8px; }
#mp-progress-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: var(--cyan);
  box-shadow: 0 0 6px rgba(0,245,255,0.45);
  border-radius: 3px;
}
#mp-progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translate(50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(0,245,255,0.7), 0 0 14px rgba(0,245,255,0.25);
  transition: width .15s, height .15s, box-shadow .15s;
}
#mp-progress:hover #mp-progress-fill::after {
  width: 14px;
  height: 14px;
  box-shadow: 0 0 12px rgba(0,245,255,0.95), 0 0 22px rgba(0,245,255,0.35);
}

/* BIO: Implementation note for this section. */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 18px;
  pointer-events: none;
}
#bc {
  font-size: 11px;
  letter-spacing: 3px;
  color: rgba(0,245,255,0.55);
  text-shadow: 0 0 10px rgba(0,245,255,0.35);
  transition: color .3s;
}
#bb {
  pointer-events: all;
  display: none;
  background: transparent;
  border: 1px solid rgba(0,245,255,0.45);
  color: var(--cyan);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  padding: 5px 18px;
  cursor: none;
  transition: background .2s, box-shadow .2s, border-color .2s;
}
#bb:hover {
  background: rgba(0,245,255,0.08);
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(0,245,255,0.25);
}

/* BIO: Implementation note for this section. */
#status {
  position: fixed;
  bottom: 32px;
  right: 30px;
  font-size: 15px;
  letter-spacing: 2px;
  color: rgba(0,245,255,0.4);
  z-index: 10;
  pointer-events: none;
}
#footer-label {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  letter-spacing: 5px;
  color: rgba(0, 247, 255, 0.404);
  z-index: 10;
  pointer-events: none;
}
#status-left {
  position: fixed;
  bottom: 32px;
  left: 30px;
  font-size: 15px;
  letter-spacing: 2px;
  color: rgba(0,245,255,0.4);
  z-index: 10;
  pointer-events: none;
}

/* BIO: Implementation note for this section. */
#svg {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  height: 100dvh;
  z-index: 2;
}
/* BIO: Critical for GSAP scale animations on SVG groups */
.ng {
  transform-box: fill-box;
  transform-origin: center;
  cursor: none;
}

/* BIO: Hologram panel behavior and rendering note. */
#ray-svg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 1;       /* BIO: behind #svg (z-index:2) so node circles cover the beams */
  pointer-events: none;
  overflow: visible;
}

/* BIO: Hologram panel behavior and rendering note. */
@keyframes holo-flicker {
  0%,100% { opacity: 1; }
  43%     { opacity: 0.97; }
  45%     { opacity: 0.88; }
  47%     { opacity: 0.97; }
  83%     { opacity: 0.93; }
  85%     { opacity: 1; }
}
@keyframes holo-scanmove {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

#holo {
  position: fixed;
  width: 400px;
  display: none;
  z-index: 500;
  background: rgba(0,255,255,0.04);
  border: 1px solid rgba(0,255,255,0.55);
  box-shadow: 0 0 30px rgba(0,255,255,0.28), inset 0 0 60px rgba(0,255,255,0.05);
  overflow: hidden;
  transform-origin: center top;
  animation: holo-flicker 3.2s ease-in-out infinite;
  pointer-events: all;
}
/* BIO: Scanlines overlay */
#holo::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px, transparent 2px,
    rgba(0,255,255,0.03) 2px, rgba(0,255,255,0.03) 4px
  );
  pointer-events: none;
  z-index: 1;
}
/* BIO: Moving scan sweep */
#holo-scan {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, rgba(0,255,255,0.18), transparent);
  pointer-events: none;
  z-index: 2;
  animation: holo-scanmove 4s linear infinite;
}
/* BIO: Cyberpunk corner brackets */
/* BIO: Implementation note for this section. */
.holo-corner {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(0,255,255,0.85);
  box-shadow: 0 0 6px rgba(0,255,255,0.7);
  z-index: 5;
  pointer-events: none;
}
.holo-corner[data-corner="tl"] { top: 0;    left: 0;  }
.holo-corner[data-corner="tr"] { top: 0;    right: 0; }
.holo-corner[data-corner="bl"] { bottom: 0; left: 0;  }
.holo-corner[data-corner="br"] { bottom: 0; right: 0; }
#holo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px 10px;
  border-bottom: 1px solid rgba(0,255,255,0.18);
  position: relative; z-index: 4;
  gap: 10px;
}
#holo-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 3px;
  color: #FFE400;
  text-shadow: 0 0 10px #FFE400, 0 0 22px rgba(255,228,0,0.35);
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}
#holo-close {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid rgba(0,255,255,0.38);
  color: #00FFFF;
  width: 22px; height: 22px;
  font-size: 11px;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
}
#holo-close:hover { background: rgba(0,255,255,0.1); border-color: #00FFFF; }
#holo-body {
  padding: 13px 16px 18px;
  max-height: 340px;
  overflow-y: auto;
  position: relative; z-index: 4;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,255,255,0.2) transparent;
}
#holo-body::-webkit-scrollbar { width: 2px; }
#holo-body::-webkit-scrollbar-thumb { background: rgba(0,255,255,0.3); border-radius: 1px; }
#holo-body p {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  line-height: 1.9;
  color: rgba(0,255,255,0.75);
  margin-bottom: 6px;
}
#holo-body strong { color: #00FFFF; }
#holo-body ul { list-style: none; margin-bottom: 8px; }
#holo-body ul li {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  line-height: 1.85;
  color: rgba(0,255,255,0.65);
  padding-left: 14px;
  position: relative;
}
#holo-body ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #FFE400;
  opacity: 0.85;
}
#holo-body a { color: #FFE400; text-decoration: none; text-shadow: 0 0 8px rgba(255,228,0,0.35); transition: opacity .2s; }
#holo-body a:hover { opacity: 0.8; }
#holo-body .divider { border: none; border-top: 1px solid rgba(0,255,255,0.12); margin: 10px 0; }

/* BIO: Implementation note for this section. */
#toolbar {
  position: fixed;
  top: 18px;
  left: 75%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  z-index: 50;
  background: var(--tb-bg);
  border: 1px solid var(--tb-border);
  padding: 7px 14px;
  backdrop-filter: blur(8px);
  transition: background .3s, border-color .3s;
}
.tb-btn {
  background: transparent;
  border: none;
  color: var(--cyan);
  opacity: 0.55;
  font-size: 16px;
  padding: 4px 7px;
  cursor: none;
  transition: opacity .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1;
}
.tb-btn:hover { opacity: 1; }
#tb-theme { font-size: 17px; }
.tb-sep {
  width: 1px; height: 16px;
  background: var(--tb-border);
  flex-shrink: 0;
  margin: 0 2px;
}
.tb-lang {
  background: transparent;
  border: 1px solid var(--tb-border);
  color: var(--cyan);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  padding: 4px 10px;
  cursor: none;
  opacity: 0.45;
  transition: opacity .2s, background .2s, border-color .2s;
}
.tb-lang:hover { opacity: 0.8; }
.tb-lang.active {
  opacity: 1;
  background: rgba(0,245,255,0.1);
  border-color: var(--cyan);
}
body.light .tb-lang.active { background: rgba(0,85,187,0.1); }

.tb-toggle {
  background: transparent;
  border: 1px solid var(--tb-border);
  color: var(--cyan);
  padding: 4px 7px;
  cursor: none;
  opacity: 0.3;
  transition: opacity .2s, background .2s, border-color .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.tb-toggle:hover { opacity: 0.7; }
.tb-toggle.active {
  opacity: 1;
  background: rgba(0,228,237,0.1);
  border-color: var(--cyan);
}

/* BIO: Mode switcher (DEFAULT / PRO) */
.tb-mode {
  background: transparent;
  border: 1px solid var(--tb-border);
  color: var(--cyan);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  padding: 4px 11px;
  cursor: none;
  opacity: 0.45;
  transition: opacity .2s, background .2s, border-color .2s, box-shadow .2s, color .2s;
  /* BIO: Pro Mode integration note. */
  white-space: nowrap;
  writing-mode: horizontal-tb;
  flex-shrink: 0;
}
.tb-mode:hover { opacity: 0.85; }
.tb-mode.active {
  opacity: 1;
  background: rgba(0,245,255,0.12);
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0,245,255,0.28), inset 0 0 10px rgba(0,245,255,0.08);
}
body.light .tb-mode.active { background: rgba(0,85,187,0.1); }

/* BIO: Pro Mode integration note. */
@keyframes pro-rainbow-flow {
  0%   { background-position:   0% 50%; }
  100% { background-position: 300% 50%; }
}
@keyframes pro-glow-pulse {
  0%, 100% {
    box-shadow:
      0 0 6px  rgba(255,0,110,0.35),
      0 0 14px rgba(0,245,255,0.25),
      0 0 22px rgba(191,0,255,0.18);
  }
  50% {
    box-shadow:
      0 0 12px rgba(255,0,110,0.70),
      0 0 22px rgba(0,245,255,0.55),
      0 0 34px rgba(191,0,255,0.40);
  }
}

.tb-mode[data-mode="pro"] {
  position: relative;
  border: 1px solid transparent;
  opacity: 0.6;
  background: linear-gradient(90deg,
    #ff006e, #ff7b00, #ffee00, #00ff88, #00f5ff, #bf00ff, #ff006e);
  background-size: 300% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: none;
  transition: opacity .25s ease;
  animation:
    pro-rainbow-flow 3.5s linear infinite,
    pro-glow-pulse  2.0s ease-in-out infinite;
  isolation: isolate;
}
.tb-mode[data-mode="pro"]::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(90deg,
    #ff006e, #ff7b00, #ffee00, #00ff88, #00f5ff, #bf00ff, #ff006e);
  background-size: 300% 100%;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
          mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: pro-rainbow-flow 3.5s linear infinite;
  pointer-events: none;
  z-index: -1;
}
.tb-mode[data-mode="pro"]:hover {
  opacity: 1;
  animation:
    pro-rainbow-flow 1.4s linear infinite,
    pro-glow-pulse  1.0s ease-in-out infinite;
}
.tb-mode[data-mode="pro"]:hover::before {
  animation: pro-rainbow-flow 1.4s linear infinite;
}
.tb-mode[data-mode="pro"].active {
  opacity: 1;
  animation:
    pro-rainbow-flow 2.0s linear infinite,
    pro-glow-pulse  1.2s ease-in-out infinite;
}
.tb-mode[data-mode="pro"].active::before {
  padding: 2px;
  animation: pro-rainbow-flow 2.0s linear infinite;
}

/* BIO: Implementation note for this section. */
@media (prefers-reduced-motion: reduce) {
  .tb-mode[data-mode="pro"],
  .tb-mode[data-mode="pro"]::before,
  .tb-mode[data-mode="pro"]:hover,
  .tb-mode[data-mode="pro"]:hover::before,
  .tb-mode[data-mode="pro"].active,
  .tb-mode[data-mode="pro"].active::before {
    animation: none;
  }
}

/* BIO: Default Mode integration note. */
html.returning-from-pro #intro,
html.returning-from-pro #splash {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* BIO: Implementation note for this section. */
#intro {
  position: fixed; inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  flex-direction: column;
  gap: 12px;
}
#intro-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 900;
  color: var(--cyan);
  text-shadow: 0 0 30px var(--cyan), 0 0 60px rgba(0,245,255,0.3);
  letter-spacing: 6px;
}
#intro-sub {
  font-size: 11px;
  letter-spacing: 4px;
  color: rgba(0,245,255,0.45);
}
#intro-bar {
  width: 220px;
  height: 2px;
  background: rgba(0,245,255,0.1);
  margin-top: 10px;
  position: relative;
  overflow: hidden;
}
#intro-fill {
  height: 100%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  width: 0%;
  transition: width .8s ease;
}

/* BIO: Audio, SFX, and mini-player behavior note. */
#audio-viz {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
#audio-viz.active {
  opacity: 1;
}

#viz-hit {
  position: fixed;
  left: 0;
  right: 0;
  top: 50%;
  height: 50vh;
  transform: translateY(-50%);
  z-index: 501;
  pointer-events: none;
  cursor: ns-resize;
  touch-action: none;
}
#viz-hit.active {
  pointer-events: auto;
}

/* BIO: Implementation note for this section. */
#splash {
  position: fixed; inset: 0;
  z-index: 499;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}
#splash::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(0,245,255,0.03) 0%, transparent 70%),
    linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,245,255,0.015) 50%, rgba(0,0,0,0) 100%);
  pointer-events: none;
}

#splash-vol-wrap {
  position: absolute;
  top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  z-index: 2;
}
#splash-vol-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}
#splash-vol-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  letter-spacing: 3px;
  color: rgba(255,255,255,0.55);
  margin: 0;
}
#splash-vol-test {
  background: transparent;
  border: 1px solid rgba(0,245,255,0.25);
  color: rgba(0,245,255,0.6);
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  padding: 6px 18px;
  cursor: pointer;
  transition: all 0.3s ease;
}
#splash-vol-test:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 12px rgba(0,245,255,0.15);
}
#splash-vol-test.playing {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 12px rgba(0,245,255,0.25);
}
#splash-vol-icon {
  font-size: 30px;
  opacity: 0.7;
  cursor: pointer;
}
#splash-vol-pct {
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  letter-spacing: 2px;
  color: rgba(0,245,255,0.5);
  min-width: 42px;
}
#splash-vol-blocks {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 32px;
  cursor: pointer;
  padding: 4px 0;
}
#splash-vol-blocks .vb {
  width: 9px;
  border-radius: 1px;
  background: rgba(0,245,255,0.06);
  border: 1px solid rgba(0,245,255,0.1);
  transition: background 0.1s, box-shadow 0.1s, border-color 0.1s;
}
#splash-vol-blocks .vb.active {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 6px rgba(0,245,255,0.4);
}
#splash-vol-blocks .vb.active.hot {
  background: #00c8ff;
  border-color: #00c8ff;
  box-shadow: 0 0 8px rgba(0,200,255,0.6), 0 0 16px rgba(0,200,255,0.2);
}

#splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  z-index: 2;
}
#splash-line, #splash-line2 {
  width: 280px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,245,255,0.25), transparent);
}
#splash-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 100;
  letter-spacing: clamp(8px, 2vw, 20px);
  color: rgba(255,255,255,0.92);
  text-align: center;
  line-height: 1.2;
  margin: 0;
  transition: color 0.6s ease, text-shadow 0.6s ease;
}
#splash-title.viz-active {
  color: #ffee00;
  text-shadow: 0 0 18px rgba(255,238,0,0.45), 0 0 40px rgba(255,238,0,0.15);
}
#splash-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(10px, 1.2vw, 13px);
  letter-spacing: 6px;
  color: rgba(0,245,255,0.4);
  margin: 0;
}
#splash-pro-mobile-note {
  display: none;
  position: absolute;
  left: 50%;
  top: calc(50% + 105px);
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 48px));
  margin: 0;
  color: rgba(255,238,0,0.72);
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 2px;
  text-align: center;
  text-shadow: 0 0 12px rgba(255,238,0,0.2);
}

#splash-start-wrap {
  position: absolute;
  bottom: 80px;
  display: flex;
  gap: 14px;
  align-items: center;
  z-index: 2;
}
#splash-start,
#splash-start-fs {
  background: transparent;
  border: 1px solid rgba(0,245,255,0.25);
  color: rgba(255,255,255,0.7);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 3px;
  padding: 14px 36px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
}
#splash-start:hover,
#splash-start-fs:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 20px rgba(0,245,255,0.15), inset 0 0 20px rgba(0,245,255,0.05);
  text-shadow: 0 0 10px rgba(0,245,255,0.5);
}

/* BIO: Implementation note for this section. */
#intro-video {
  position: fixed; inset: 0;
  z-index: 498;
  display: none;
  align-items: center;
  justify-content: center;
  background: #000;
}
#intro-vid {
  width: 100%; height: 100%;
  object-fit: cover;
}
#intro-skip,
.anim-skip {
  position: absolute;
  bottom: 32px; right: 30px;
  background: rgba(2,4,8,0.6);
  border: 1px solid rgba(0,245,255,0.35);
  color: var(--cyan);
  font-family: 'Share Tech Mono', monospace;
  font-size: 15px;
  letter-spacing: 2.5px;
  padding: 12px 28px;
  cursor: none;
  z-index: 10;
  opacity: 0;
  transition: background .2s, box-shadow .2s, border-color .2s, opacity .4s;
  backdrop-filter: blur(4px);
}
#intro-skip:hover,
.anim-skip:hover {
  background: rgba(0,245,255,0.08);
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(0,245,255,0.25);
}
.anim-skip {
  position: fixed;
  pointer-events: auto;
}
#intro-sound {
  position: absolute;
  bottom: 32px; left: 30px;
  background: rgba(2,4,8,0.6);
  border: 1px solid rgba(0,245,255,0.35);
  color: var(--cyan);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  padding: 8px 20px;
  cursor: none;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: background .2s, box-shadow .2s, border-color .2s, opacity .4s;
  backdrop-filter: blur(4px);
}
#intro-sound:hover {
  background: rgba(0,245,255,0.08);
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(0,245,255,0.25);
}

/* BIO: Photo and gallery behavior note. */
.photo-link {
  color: #00ff88;
  text-decoration: none;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  letter-spacing: 2px;
  border: 1px solid rgba(0,255,136,0.3);
  padding: 5px 14px;
  cursor: none;
  transition: background .2s, box-shadow .2s;
}
.photo-link:hover {
  background: rgba(0,255,136,0.1);
  box-shadow: 0 0 12px rgba(0,255,136,0.25);
}

/* BIO: Photo and gallery behavior note. */
#photo-viewer {
  position: fixed; inset: 0; z-index: 7000;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.82);
  cursor: none;
}
#photo-viewer.active { display: flex; }

#photo-viewer-close {
  position: absolute; top: -18px; right: -18px;
  background: rgba(6,14,20,0.95); border: 1px solid rgba(0,255,136,0.4);
  color: #00ff88; font-size: 18px; width: 36px; height: 36px;
  cursor: none; z-index: 7002; display: flex;
  align-items: center; justify-content: center;
  transition: background .2s, box-shadow .2s;
}
#photo-viewer-close:hover {
  background: rgba(0,255,136,0.12);
  box-shadow: 0 0 10px rgba(0,255,136,0.25);
}

#photo-viewer-inner {
  position: relative;
  background: rgba(6,14,20,0.95);
  border: 1px solid rgba(0,255,136,0.3);
  padding: 10px 10px 36px;
  max-width: 500px; width: 90vw;
  box-shadow: 0 0 30px rgba(0,255,136,0.12), 0 0 60px rgba(0,255,136,0.05);
  cursor: none;
}
#photo-viewer-img {
  width: 100%; display: block;
  filter: brightness(1.05);
}
#photo-viewer-caption {
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: rgba(0,255,136,0.6);
  margin-top: 10px;
  letter-spacing: 1px;
}

/* BIO: Button layout and interaction note. */
.pv-nav {
  position: absolute;
  bottom: 12px;
  z-index: 7003;
  width: 42px; height: 42px;
  border: 2px solid rgba(0,229,255,0.5);
  background: rgba(6,14,20,0.75);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: none;
  transition: background .25s, border-color .25s, box-shadow .25s, transform .15s;
}
.pv-nav svg {
  width: 20px; height: 20px;
  stroke: rgba(0,229,255,0.85);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  filter: drop-shadow(0 0 4px rgba(0,229,255,0.3));
  transition: stroke .25s, filter .25s;
}
.pv-nav:hover {
  background: rgba(0,229,255,0.15);
  border-color: rgba(0,229,255,0.9);
  box-shadow: 0 0 18px rgba(0,229,255,0.35), inset 0 0 10px rgba(0,229,255,0.1);
}
.pv-nav:hover svg {
  stroke: #00e5ff;
  filter: drop-shadow(0 0 8px rgba(0,229,255,0.6));
}
.pv-nav:active {
  transform: scale(0.88);
}
.pv-nav.hidden {
  opacity: 0;
  pointer-events: none;
}
#pv-prev { left: 12px; }
#pv-next { right: 12px; }

#pv-counter {
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: rgba(0,229,255,0.5);
  margin-top: 6px;
  letter-spacing: 2px;
}
#pv-counter.hidden { display: none; }

/* BIO: Hologram panel behavior and rendering note. */
.tl-wrap { position: relative; padding-left: 18px; margin: 6px 0; }
.tl-wrap::before {
  content: ''; position: absolute; left: 4px; top: 0; bottom: 0;
  width: 2px; background: linear-gradient(180deg, rgba(0,245,255,0.5), rgba(0,245,255,0.08));
}
.tl-item { position: relative; padding: 0 0 14px 14px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -18px; top: 5px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan, #00f5ff);
  box-shadow: 0 0 8px var(--cyan, #00f5ff);
}
.tl-item.active::before {
  background: #00ff88;
  box-shadow: 0 0 10px #00ff88, 0 0 20px rgba(0,255,136,0.3);
  animation: tl-pulse 1.5s ease-in-out infinite;
}
@keyframes tl-pulse {
  0%, 100% { box-shadow: 0 0 8px #00ff88; }
  50%      { box-shadow: 0 0 16px #00ff88, 0 0 28px rgba(0,255,136,0.4); }
}
.tl-year {
  font-family: 'Orbitron', monospace; font-size: 12px; font-weight: 700;
  color: var(--cyan, #00f5ff); letter-spacing: 1px; margin-bottom: 2px;
}
.tl-title { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.88); }
.tl-desc { font-size: 11.5px; color: rgba(255,255,255,0.45); margin-top: 1px; }
.tl-cert { margin-top: 4px; }
.tl-cert a {
  font-size: 11px; display: block; margin: 3px 0;
  color: rgba(0,245,255,0.7); text-decoration: none;
  border-left: 2px solid rgba(0,245,255,0.25); padding-left: 8px;
  transition: color .2s, border-color .2s;
}
.tl-cert a:hover { color: #00f5ff; border-color: #00f5ff; }
.tl-section-title {
  font-family: 'Orbitron', monospace; font-size: 11px; font-weight: 700;
  color: var(--cyan, #00f5ff); letter-spacing: 2px;
  margin: 6px 0 4px;
}

/* BIO: Pro Mode integration note. */
#pro-escape {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: none;
  pointer-events: none;
}
#pro-escape.active {
  display: block;
  pointer-events: all;    /* BIO: swallow all clicks during the escape */
  cursor: none;
}
.pe-item {
  position: absolute;
  user-select: none;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,0.5));
}
.pe-ufo   { top: 18%; left: 58%; width: 260px; }
.pe-astro { top: 38%; left: 50%; width: 300px; }
.pe-frame { top: 64%; left: 44%; width: 280px; }

@media (max-width: 900px) {
  .pe-ufo   { width: 180px; }
  .pe-astro { width: 215px; }
  .pe-frame { width: 200px; }
}

/* BIO: Pro Mode integration note. */
#meteor-hit {
  position: fixed;
  inset: 0;
  z-index: 960;
  display: none;
  pointer-events: none;
  overflow: hidden;
}
#meteor-hit.active {
  display: block;
  pointer-events: all;   /* BIO: swallow stray clicks during impact */
  cursor: none;
}

#meteor-predark {
  position: absolute;
  inset: 0;
  /* BIO: darkness creeps in from the top-right where the meteor comes from */
  background: radial-gradient(
    circle at 85% 12%,
    rgba(0,0,0,0.88) 0%,
    rgba(0,0,0,0.62) 22%,
    rgba(0,0,0,0.35) 48%,
    rgba(0,0,0,0.12) 72%,
    rgba(0,0,0,0)    95%
  );
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
  mix-blend-mode: multiply;
}

#meteor-dust {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.md-p {
  position: absolute;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
  transform: translate3d(0, 0, 0);
}

#meteor-img {
  position: absolute;
  top: 0; left: 0;
  width: 900px;
  height: auto;
  opacity: 0;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
  user-select: none;
  filter:
    drop-shadow(0 0 28px rgba(255,140,40,0.8))
    drop-shadow(0 0 60px rgba(255,70,20,0.55))
    drop-shadow(0 0 120px rgba(255,200,80,0.35));
}

#meteor-flash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 52%,
      rgba(255,250,220,1)  0%,
      rgba(255,200,130,0.9) 12%,
      rgba(255,130,60,0.55) 28%,
      rgba(255,60,20,0.15) 48%,
      rgba(255,0,0,0)      65%);
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  transform: scale(0.4);
  will-change: transform, opacity;
}

#screen-crack {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}
#screen-crack path {
  fill: none;
  stroke: #ffffff;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter:
    drop-shadow(0 0 3px rgba(255,255,255,0.9))
    drop-shadow(0 0 8px rgba(200,230,255,0.55));
}

#screen-black {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

@media (max-width: 900px) {
  #meteor-img { width: 420px; }
}

/* BIO: Audio, SFX, and mini-player behavior note. */
#intro2-video {
  position: fixed;
  inset: 0;
  z-index: 970;
  display: none;
  align-items: center;
  justify-content: center;
  background: #000;
}
#intro2-video.active { display: flex; }
#intro2-vid {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#intro2-skip {
  opacity: 0;
}

/* BIO: Hologram panel behavior and rendering note. */
#pro-confirm {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#pro-confirm.open {
  display: flex;
  pointer-events: all;
}

#pc-backdrop {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center,
              rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.88) 60%, rgba(0,0,0,0.96) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .4s ease;
}
#pro-confirm.open #pc-backdrop { opacity: 1; }

#pc-edge-glitch {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease;
}
#pro-confirm[data-stage="3"] #pc-edge-glitch { opacity: 1; }

.pc-glitch-bar {
  position: absolute;
  filter: blur(1px);
}
.pc-glitch-bar.top,
.pc-glitch-bar.bottom {
  left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, transparent, rgba(255,40,55,0.85), transparent);
}
.pc-glitch-bar.top    { top: 0;    animation: pc-glitch-h 1.4s ease-in-out infinite; }
.pc-glitch-bar.bottom { bottom: 0; animation: pc-glitch-h 1.8s ease-in-out infinite reverse; }
.pc-glitch-bar.left,
.pc-glitch-bar.right {
  top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, transparent, rgba(255,40,55,0.85), transparent);
}
.pc-glitch-bar.left  { left: 0;  animation: pc-glitch-v 1.2s ease-in-out infinite; }
.pc-glitch-bar.right { right: 0; animation: pc-glitch-v 1.6s ease-in-out infinite reverse; }

#pc-panel {
  position: relative;
  width: min(520px, 88vw);
  padding: 30px 34px 42px;
  background: rgba(0,8,14,0.9);
  border: 1px solid var(--pc-accent, #00f5ff);
  box-shadow:
    0 0 40px var(--pc-glow, rgba(0,245,255,0.35)),
    inset 0 0 80px rgba(0,245,255,0.04);
  color: var(--pc-accent, #00f5ff);
  overflow: hidden;
  transform: scale(0.9);
  opacity: 0;
  transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .4s ease,
              border-color .35s ease, box-shadow .35s ease, color .35s ease;
  font-family: 'Share Tech Mono', monospace;
}
#pro-confirm.open #pc-panel {
  transform: scale(1);
  opacity: 1;
}

/* BIO: Scanlines overlay (colour follows stage) */
#pc-panel::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0 2px,
    rgba(var(--pc-scan-rgb, 0,245,255), 0.05) 2px 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* BIO: Implementation note for this section. */
#pc-panel[data-stage="1"] {
  --pc-accent: #00f5ff;
  --pc-glow:   rgba(0,245,255,0.35);
  --pc-bg:     rgba(0,245,255,0.06);
  --pc-scan-rgb: 0,245,255;
}

/* BIO: Implementation note for this section. */
#pc-panel[data-stage="2"] {
  --pc-accent: #ffee00;
  --pc-glow:   rgba(255,238,0,0.45);
  --pc-bg:     rgba(255,238,0,0.08);
  --pc-scan-rgb: 255,238,0;
  animation: pc-shake-light .45s steps(2) infinite;
}

/* BIO: Implementation note for this section. */
#pc-panel[data-stage="3"] {
  --pc-accent: #ff2a3c;
  --pc-glow:   rgba(255,42,60,0.6);
  --pc-bg:     rgba(255,42,60,0.1);
  --pc-scan-rgb: 255,42,60;
  animation:
    pc-shake-heavy .3s steps(2) infinite,
    pc-alarm       1.2s ease-in-out infinite;
}

.pc-scan {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--pc-accent), transparent);
  opacity: 0.55;
  pointer-events: none;
  z-index: 2;
  animation: pc-scan-sweep 3s linear infinite;
}
#pc-panel[data-stage="2"] .pc-scan { animation-duration: 1.5s; opacity: 0.7; }
#pc-panel[data-stage="3"] .pc-scan { animation-duration: 0.7s; opacity: 0.85; }

.pc-corner {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--pc-accent);
  box-shadow: 0 0 8px var(--pc-accent);
  z-index: 3;
}
.pc-corner.tl { top: 5px;    left: 5px;   }
.pc-corner.tr { top: 5px;    right: 5px;  }
.pc-corner.bl { bottom: 5px; left: 5px;   }
.pc-corner.br { bottom: 5px; right: 5px;  }

#pc-stage-label {
  position: relative;
  z-index: 2;
  font-size: 10px;
  letter-spacing: 4px;
  opacity: 0.78;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--pc-accent);
}

#pc-title {
  position: relative;
  z-index: 2;
  font-family: 'Orbitron', 'Share Tech Mono', monospace;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 2px;
  line-height: 1.3;
  margin-bottom: 12px;
  text-shadow: 0 0 14px var(--pc-glow);
}

#pc-sub {
  position: relative;
  z-index: 2;
  font-size: 12px;
  letter-spacing: 1px;
  opacity: 0.72;
  margin-bottom: 24px;
  line-height: 1.5;
}

#pc-buttons {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 12px;
}

.pc-btn {
  flex: 1;
  padding: 11px 14px;
  background: transparent;
  border: 1px solid var(--pc-accent);
  color: var(--pc-accent);
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  cursor: none;
  transition: background .18s, box-shadow .18s, transform .1s, color .18s, border-color .18s;
}
.pc-btn:hover {
  background: var(--pc-bg);
  box-shadow: 0 0 16px var(--pc-glow), inset 0 0 12px var(--pc-bg);
}
.pc-btn:active { transform: scale(0.97); }

.pc-btn.pc-no {
  opacity: 0.7;
  border-color: rgba(255,255,255,0.28);
  color: rgba(255,255,255,0.78);
}
.pc-btn.pc-no:hover {
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 10px rgba(255,255,255,0.2);
}

#pc-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 2;
}
.pc-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--pc-accent);
  opacity: 0.22;
  box-shadow: 0 0 6px var(--pc-accent);
  transition: opacity .3s;
}
#pc-panel[data-stage="1"] .pc-dot:nth-child(1),
#pc-panel[data-stage="2"] .pc-dot:nth-child(-n+2),
#pc-panel[data-stage="3"] .pc-dot { opacity: 1; }

/* BIO: Implementation note for this section. */
#pc-panel.launching {
  animation: pc-launch-flash .9s ease-out forwards;
}
#pc-panel.launching .pc-btn { pointer-events: none; opacity: 0.35; }

/* BIO: Implementation note for this section. */
@keyframes pc-scan-sweep {
  0%   { top: 0;    }
  100% { top: 100%; }
}
@keyframes pc-shake-light {
  0%, 100% { transform: translate(0, 0);         }
  25%      { transform: translate(-0.6px, 0.5px); }
  50%      { transform: translate(0.6px, -0.5px); }
  75%      { transform: translate(-0.4px, -0.5px); }
}
@keyframes pc-shake-heavy {
  0%, 100% { transform: translate(0, 0);         }
  20%      { transform: translate(-1.2px, 1px);  }
  40%      { transform: translate(1.4px, -0.6px); }
  60%      { transform: translate(-1px, -1px);   }
  80%      { transform: translate(1px, 1.2px);   }
}
@keyframes pc-alarm {
  0%, 100% {
    box-shadow:
      0 0 30px var(--pc-glow),
      inset 0 0 60px rgba(255,42,60,0.08);
  }
  50% {
    box-shadow:
      0 0 60px rgba(255,42,60,0.9),
      0 0 120px rgba(255,42,60,0.4),
      inset 0 0 80px rgba(255,42,60,0.18);
  }
}
@keyframes pc-glitch-h {
  0%, 100% { transform: translateX(0);    opacity: 0.5; }
  50%      { transform: translateX(3px);  opacity: 1;   }
}
@keyframes pc-glitch-v {
  0%, 100% { transform: translateY(0);    opacity: 0.5; }
  50%      { transform: translateY(-3px); opacity: 1;   }
}
@keyframes pc-launch-flash {
  0%   { filter: brightness(1);    transform: scale(1);    }
  40%  { filter: brightness(2.8);  transform: scale(1.04); }
  100% { filter: brightness(1);    transform: scale(1);    opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #pc-panel[data-stage="2"],
  #pc-panel[data-stage="3"] { animation: none; }
  .pc-glitch-bar { animation: none; }
  .pc-scan { animation: none; }
}

/* BIO: Hologram panel behavior and rendering note. */

/* BIO: Implementation note for this section. */
@media (pointer: coarse) {
  html, body { cursor: auto; }
  body { -webkit-tap-highlight-color: transparent; }

  #cur, #cursor-trail, #grid-trail { display: none !important; }

  .mp-btn, #bb, .tb-btn, .tb-lang, .tb-toggle, .tb-mode,
  #splash-start, #splash-start-fs,
  #intro-skip, .anim-skip, #intro-sound,
  #photo-viewer-close, .pv-nav,
  .photo-link, #holo-close,
  #holo-body a, .ng,
  #main-vol-icon, #splash-vol-icon,
  #main-vol-blocks, #splash-vol-blocks,
  #mp-progress { cursor: pointer; }

  #svg, .ng { touch-action: manipulation; }
}

/* BIO: Pro Mode integration note. */

body.is-mobile::before { background-size: 38px 38px; }

/* BIO: Pro Mode integration note. */
body.is-mobile .tb-mode[data-mode="pro"],
body.is-mobile .tb-mode[data-mode="pro"] + .tb-sep {
  display: none !important;
}

/* BIO: Implementation note for this section. */
body.is-mobile #main-vol { display: none !important; }

/* BIO: Trail / grid / fullscreen toggles are pointless on touch. */
body.is-mobile #tb-fs,
body.is-mobile #tb-trail,
body.is-mobile #tb-grid { display: none; }
body.is-mobile #toolbar .tb-sep:last-of-type { display: none; }

/* BIO: Toolbar: enlarged for thumb-friendly tap targets on mobile. Overrides the narrow-viewport defaults in Group B below. Sizes target a ~46-48 px tap height (Apple HIG / Material), and still fits a single row down to ~360 px. safe-area-inset-top accommodates iPhone notch / Dynamic Island. */
body.is-mobile #toolbar {
  top: max(14px, calc(env(safe-area-inset-top, 0px) + 6px));
  padding: 11px 16px;
  gap: 10px;
  border-radius: 2px;
}
body.is-mobile .tb-lang,
body.is-mobile .tb-mode {
  padding: 11px 16px;
  font-size: 14px;
  letter-spacing: 1.5px;
}
body.is-mobile .tb-btn { padding: 11px; }
body.is-mobile .tb-btn svg,
body.is-mobile .tb-toggle svg { width: 22px; height: 22px; }
body.is-mobile .tb-sep { height: 22px; }

/* BIO: Implementation note for this section. */
body.is-mobile #hud { top: calc(120px + env(safe-area-inset-top, 0px)); }

/* BIO: Implementation note for this section. */
@media (max-width: 400px) {
  body.is-mobile #toolbar { padding: 9px 12px; gap: 8px; top: 12px; }
  body.is-mobile .tb-lang,
  body.is-mobile .tb-mode { padding: 9px 12px; font-size: 12px; letter-spacing: 1.2px; }
  body.is-mobile .tb-btn { padding: 9px; }
  body.is-mobile .tb-btn svg,
  body.is-mobile .tb-toggle svg { width: 19px; height: 19px; }
  body.is-mobile .tb-sep { height: 19px; }
  body.is-mobile #hud { top: calc(104px + env(safe-area-inset-top, 0px)); }
}

/* BIO: Very narrow phones (Galaxy Fold cover, old iPhone SE 1st-gen). */
@media (max-width: 340px) {
  body.is-mobile #toolbar { padding: 7px 9px; gap: 6px; }
  body.is-mobile .tb-lang,
  body.is-mobile .tb-mode { padding: 7px 9px; font-size: 11px; letter-spacing: 1px; }
  body.is-mobile .tb-btn { padding: 7px; }
  body.is-mobile .tb-btn svg,
  body.is-mobile .tb-toggle svg { width: 16px; height: 16px; }
  body.is-mobile #hud { top: calc(90px + env(safe-area-inset-top, 0px)); }
}

/* BIO: HUD breadcrumb + Go-Back: pinned beneath the toolbar so they stay visible when the holo bottom-sheet covers the lower half. */
body.is-mobile #hud {
  top: 50px;
  bottom: auto;
  padding-top: 0;
  gap: 6px;
  z-index: 510;            /* BIO: above the holo (500) */
}
body.is-mobile #bc {
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 4px 10px;
  background: rgba(2,4,8,0.6);
  border: 1px solid rgba(0,245,255,0.2);
  backdrop-filter: blur(6px);
  max-width: calc(100vw - 32px);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* BIO: Implementation note for this section. */
body.is-mobile #bc.at-root { display: none; }
body.is-mobile #bb {
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 6px 14px;
  background: rgba(2,4,8,0.6);
  backdrop-filter: blur(6px);
}

/* BIO: Status / footer text would clash with the HUD on small screens. */
body.is-mobile #status,
body.is-mobile #status-left { display: none; }
body.is-mobile #footer-label {
  font-size: 9px;
  letter-spacing: 3px;
  bottom: max(10px, env(safe-area-inset-bottom, 0px));
  opacity: 0;
  pointer-events: none;
}

/* BIO: Tighter corner decorations. */
body.is-mobile .cor { width: 28px; height: 28px; }
body.is-mobile .tl, body.is-mobile .tr { top: 10px; }
body.is-mobile .bl, body.is-mobile .br { bottom: 10px; }
body.is-mobile .tl, body.is-mobile .bl { left: 10px; }
body.is-mobile .tr, body.is-mobile .br { right: 10px; }
body.is-mobile .dot-tl, body.is-mobile .dot-bl { left: 8px; }
body.is-mobile .dot-tr, body.is-mobile .dot-br { right: 8px; }
body.is-mobile .dot-tl, body.is-mobile .dot-tr { top: 8px; }
body.is-mobile .dot-bl, body.is-mobile .dot-br { bottom: 8px; }

/* BIO: Splash adjustments. */
body.is-mobile #splash-vol-wrap {
  top: 24px;
  gap: 18px;
  width: calc(100vw - 32px);
  left: 50%;
  transform: translateX(-50%);
}
body.is-mobile #splash-vol-bar { gap: 10px; flex-wrap: wrap; justify-content: center; }
body.is-mobile #splash-vol-icon { font-size: 22px; }
body.is-mobile #splash-vol-pct { font-size: 12px; min-width: 36px; }
body.is-mobile #splash-vol-blocks { gap: 2px; height: 26px; }
body.is-mobile #splash-vol-blocks .vb { width: 6px; }
body.is-mobile #splash-vol-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-align: center;
  padding: 0 12px;
  line-height: 1.5;
}
body.is-mobile #splash-vol-test { font-size: 9px; padding: 6px 14px; letter-spacing: 1.5px; }
body.is-mobile #splash-line,
body.is-mobile #splash-line2 { width: 70vw; }
body.is-mobile #splash-pro-mobile-note { display: block; }
body.is-mobile #splash-start-wrap {
  bottom: 36px;
  flex-direction: column;
  width: calc(100vw - 48px);
  gap: 10px;
}
body.is-mobile #splash-start,
body.is-mobile #splash-start-fs {
  width: 100%;
  padding: 14px 18px;
  font-size: 11px;
  letter-spacing: 2px;
}
/* BIO: Button layout and interaction note. */
body.is-mobile #splash-start-fs { display: none; }

/* BIO: Intro video skip / sound buttons. */
body.is-mobile #intro-skip,
body.is-mobile .anim-skip {
  bottom: 20px;
  right: 16px;
  font-size: 12px;
  padding: 10px 18px;
  letter-spacing: 2px;
}
body.is-mobile #intro-sound {
  bottom: 20px;
  left: 16px;
  font-size: 10px;
  padding: 7px 14px;
}

/* BIO: Hologram panel behavior and rendering note. */
body.is-mobile #holo {
  /* BIO: JS clears inline left/top in the IS_MOBILE branch; CSS then pins the panel to the bottom regardless of node coordinates. */
  left: 0 !important;
  right: 0 !important;
  top: auto !important;
  bottom: 0 !important;
  width: 100vw !important;
  max-height: 62vh;
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-top: 1px solid rgba(0,255,255,0.6);
  background: rgba(2,8,14,0.96);
  box-shadow: 0 -10px 40px rgba(0,255,255,0.18) !important;
  transform-origin: bottom center !important;
  /* BIO: Reserve room for the iPhone home indicator at the bottom. */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body.is-mobile #holo::after {
  /* BIO: Implementation note for this section. */
  content: '';
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 38px; height: 3px;
  border-radius: 2px;
  background: rgba(0,255,255,0.35);
  pointer-events: none;
  z-index: 6;
}
body.is-mobile #holo-head { padding: 18px 14px 10px; }
body.is-mobile #holo-title { font-size: 11px; letter-spacing: 2px; }
body.is-mobile #holo-close { width: 28px; height: 28px; font-size: 13px; }
body.is-mobile #holo-body {
  max-height: calc(62vh - 64px);
  padding: 12px 14px 22px;
}
body.is-mobile #holo-body p,
body.is-mobile #holo-body ul li { font-size: 12px; line-height: 1.7; }
body.is-mobile .tl-title { font-size: 12.5px; }
body.is-mobile .tl-desc { font-size: 11px; }
body.is-mobile .tl-cert a { font-size: 10.5px; }

/* BIO: Hologram panel behavior and rendering note. */
body.is-mobile #ray-svg { display: none !important; }

/* BIO: Pro Mode integration note. */
@media (min-width: 821px) {
  body.is-mobile #holo {
    width: min(560px, 92vw) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    border-left: 1px solid rgba(0,255,255,0.6);
    border-right: 1px solid rgba(0,255,255,0.6);
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
  }
}

/* BIO: Photo and gallery behavior note. */
body.is-mobile #photo-viewer-inner {
  max-width: none;
  width: calc(100vw - 24px);
  padding: 8px 8px 32px;
}
body.is-mobile #photo-viewer-close {
  top: 6px; right: 6px;
  width: 32px; height: 32px;
  font-size: 14px;
}
body.is-mobile .pv-nav { width: 48px; height: 48px; }   /* BIO: Implementation note for this section. */
body.is-mobile #pv-prev { left: 8px; }
body.is-mobile #pv-next { right: 8px; }

/* BIO: Pro Mode integration note. */
body.is-mobile #pc-panel {
  width: calc(100vw - 32px);
  max-width: 380px;
  padding: 22px 18px;
}

/* BIO: Implementation note for this section. */

/* BIO: Toolbar: single row, no wrap, fits comfortably on phones. */
@media (max-width: 820px) {
  #toolbar {
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    max-width: calc(100vw - 12px);
    flex-wrap: nowrap;
    justify-content: center;
    padding: 5px 8px;
    gap: 5px;
  }
  .tb-lang, .tb-mode {
    padding: 4px 7px;
    font-size: 10px;
    letter-spacing: 1px;
    flex-shrink: 0;
  }
  .tb-btn { padding: 5px; flex-shrink: 0; }
  .tb-btn svg, .tb-toggle svg { width: 14px; height: 14px; }
  .tb-sep { margin: 0; flex-shrink: 0; }
}

/* BIO: Implementation note for this section. */
@media (max-width: 480px) {
  body.is-mobile #toolbar { gap: 4px; padding: 5px 8px; }
  body.is-mobile .tb-lang, body.is-mobile .tb-mode { padding: 4px 7px; }
  body.is-mobile #intro-title { font-size: 26px; letter-spacing: 5px; }
  body.is-mobile #splash-title { letter-spacing: 6px; }
}

/* BIO: Landscape phones (very short viewports). */
@media (max-width: 900px) and (max-height: 480px) {
  body.is-mobile #toolbar { top: 6px; padding: 4px 8px; }
  body.is-mobile #splash-vol-wrap { top: 12px; gap: 10px; }
  body.is-mobile #splash-start-wrap { bottom: 16px; }
  body.is-mobile #holo { max-height: 80vh; }
  body.is-mobile #holo-body { max-height: calc(80vh - 60px); }
}
