@font-face {
  font-family: 'DotMatrix-Text';
  src: url('fonts/dotmatrix.woff2') format('woff2'),
       url('fonts/dotmatrix.otf')   format('opentype');
  font-weight: normal; font-style: normal;
}

@font-face {
  font-family: 'Gotham';
  src: url('fonts/Gotham-Light.otf') format('opentype');
  font-weight: 300; font-style: normal;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #000; overflow: hidden; cursor: none;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}

body.cursor-active       { cursor: default; }
.in-iframe body          { cursor: default; }
.in-iframe #info-panel   { display: none; }

canvas { display: block; position: relative; z-index: 1; }

#scene-overlay {
  position: fixed; inset: 0;
  background: #000;
  opacity: 1;
  transition: opacity 6s ease;
  pointer-events: none;
  z-index: 2;
}

#loading {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
}

#loading-title {
  color: #fff;
  font-family: 'DotMatrix-Text', monospace;
  white-space: normal;
  word-break: break-word;
  letter-spacing: 0;
  text-align: center;
  line-height: var(--intro-lh, 1.3);
  opacity: 1;
  transition: opacity 2s ease;
}

#fps {
  position: fixed; bottom: 10px; left: 10px;
  color: rgba(255,255,255,0.7); font: 300 14px 'Gotham', sans-serif;
  pointer-events: none; display: none; z-index: 9999;
  transform: translateZ(0);
}

/* ── Info panel ───────────────────────────────────────────── */
#info-panel {
  --panel-w: 320px;
  cursor: default;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: flex-end;
  transform: translateX(calc(-1 * var(--panel-w)));
  transition: transform 0.4s ease;
  z-index: 60;
}

#info-panel.open {
  transform: translateX(0);
}

#info-tab {
  flex-shrink: 0;
  background: #000;
  color: #fff;
  font: 11px 'DotMatrix-Text', monospace;
  line-height: 1.3;
  text-align: center;
  padding: 10px 8px;
  border: 1px solid #00ff41;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  user-select: none;
  margin-bottom: 70px;
}

#info-tab::after {
  content: '→';
  display: block;
  color: #00ff41;
  /* color: #fff; */
  font-size: 16px;
  line-height: 1;
  margin-top: 4px;
}

#info-content {
  width: var(--panel-w);
  height: 100%;
  align-self: stretch;
  background: #000;
  color: rgba(255,255,255,0.82);
  font: 13px/1.65 Georgia, serif;
  padding: 32px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-right: 1px solid rgba(255,255,255,0.12);
  user-select: none;
}

@media (max-width: 600px) {
  #info-panel { --panel-w: min(300px, 88vw); }
  #info-tab {
    align-self: flex-end;
    font-size: 9px;
    padding: 10px 6px;
    margin-bottom: 83px;
    border-width: 0.5px;
	margin-bottom: 100px;
  }
  #info-content {
    font-size: 12px;
    padding: 24px 18px;
  }
  #fps { left: auto; right: 10px; }
}

#info-content .info-title {
  font: 16px/1.3 'DotMatrix-Text', monospace;
  white-space: nowrap;
  font-kerning: none;
  color: #fff;
  letter-spacing: 0;
  margin-bottom: 4px;
}

#info-content .info-name {
  font: 13px/1 Georgia, serif;
  color: rgba(255,255,255,0.45);
  margin-bottom: 0;
  display: block;
}
#info-content .info-name a {
  color: #00ff41;
  text-decoration: none;
  border-bottom: 1px solid rgba(0,255,65,0.3);
}
#info-content .info-name a:hover {
  border-bottom-color: #00ff41;
}

#info-content .info-year {
  font: 12px/1 Georgia, serif;
  color: #fff;
  display: block;
  margin-top: 4px;
  margin-bottom: 22px;
}

#info-content .info-specs {
  font: 11px/1.5 Georgia, serif;
  color: rgba(255,255,255,0.45);
  margin-bottom: 22px;
}

#info-content p { margin-bottom: 14px; }
#info-content p a {
  color: #00cc35;
  text-decoration: none;
  border-bottom: 1px solid rgba(0,204,53,0.3);
}
#info-content p a:hover { border-bottom-color: #00cc35; }
#info-content em { font-style: italic; }

#info-content h3 {
  font: 11px/1 Georgia, serif;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  margin: 22px 0 8px;
}

#info-content ul {
  padding-left: 16px;
  margin-bottom: 14px;
}

#info-content li { margin-bottom: 6px; }

/* ── Biblio overlay ───────────────────────────────────────── */
#biblio-overlay {
  position: fixed;
  bottom: 10px; right: 10px;
  width: 400px;
  padding: 14px 18px 16px;
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 50;
}
#biblio-overlay.visible { opacity: 1; }
@media (max-width: 600px) {
  #biblio-overlay { bottom: 5px; left: 5px; right: 5px; width: calc(100vw - 6px); }
}

#biblio-overlay .bib-title {
  display: block;
  font: 300 13px/1.4 'Gotham', sans-serif;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 6px;
}
#biblio-overlay .bib-desc {
  display: block;
  font: 300 11px/1.55 'Gotham', sans-serif;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 7px;
}
#biblio-overlay .bib-source {
  display: block;
  font: 300 10px/1.3 'Gotham', sans-serif;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.02em;
}

/* ── Voice subtitle ───────────────────────────────────────── */
#voice-subtitle {
  position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%) translateZ(0);
  color: rgba(255,255,255,0.75); font: 300 20px 'Gotham', sans-serif;
  pointer-events: none; text-align: center; max-width: 80%;
  letter-spacing: 0.02em; opacity: 0; z-index: 9999;
  transition: opacity 0.4s ease;
}