@font-face {
  font-family: 'Share Tech Mono';
  src: url('assets/ShareTechMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

/* ─── LIGHT MODE (DEFAULT) ─── */
:root {
  --bg: #E0E5EC;
  --accent: #00ff9f;
  --accent2: #ff6b35;
  --text-main: rgba(26,26,46,0.8);
  --text-muted: rgba(26,26,46,0.55);
  --mono: 'Share Tech Mono', monospace;
}

/* ─── DARK MODE ─── */
body.dark-mode {
  --bg: #0b0b0e;
  --text-main: #c8c8d4;
  --text-muted: rgba(200,200,212,0.4);
}

html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  color: var(--text-main);
  font-family: var(--mono);
  overflow: hidden;
  transition: background 0.3s ease;
}

#container {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#hero-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#ascii-canvas {
  display: block;
  flex-shrink: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

#gl-canvas {
  display: none;
  flex-shrink: 0;
}

#ui-modes {
  position: absolute;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: calc(28px + env(safe-area-inset-left, 0px));
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 20;
  opacity: 0;
  animation: fadeIn 1s 1.5s forwards;
  flex-wrap: wrap;
}

#ui-debug {
  position: absolute;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  right: calc(28px + env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 20;
  opacity: 0;
  animation: fadeIn 1s 1.5s forwards;
}
#debug-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

#ui-top-right {
  position: absolute;
  top: 24px;
  right: 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 20;
  opacity: 0;
  animation: fadeIn 1s 1.5s forwards;
}

@keyframes fadeIn { to { opacity: 1; } }

.btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(0,255,159,0.3);
  background: rgba(0,255,159,0.05);
  padding: 7px 16px;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}
.btn:hover {
  background: rgba(0,255,159,0.12);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0,255,159,0.2);
}
.btn.active {
  background: rgba(0,255,159,0.15);
  border-color: var(--accent);
  color: #fff;
}

.btn.action-btn {
  color: var(--accent2);
  border-color: rgba(255,107,53,0.3);
  background: rgba(255,107,53,0.05);
}
.btn.action-btn:hover {
  background: rgba(255,107,53,0.12);
  border-color: var(--accent2);
  box-shadow: 0 0 12px rgba(255,107,53,0.2);
}

#fps {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  min-width: 60px;
  text-align: right;
}

#label {
  position: absolute;
  top: 24px;
  left: 28px;
  z-index: 20;
  opacity: 0;
  animation: fadeIn 1s 0.5s forwards;
}
#label h1 {
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
}
#label p {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}

#loading-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0.85;
  z-index: 50;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}
#loading-overlay.visible { display: flex; }
#loading-overlay .spinner {
  font-size: 14px;
  color: var(--accent2);
  letter-spacing: 0.2em;
  animation: pulse 1s infinite;
}
#loading-overlay .status {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

#container.dragover::before {
  content: 'DROP .PLY FILE';
  position: absolute;
  inset: 0;
  background: rgba(255,107,53,0.08);
  border: 2px dashed rgba(255,107,53,0.4);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  letter-spacing: 0.3em;
  color: var(--accent2);
  pointer-events: none;
}

/* ─── PORTFOLIO OVERLAY ─── */
.portfolio #label h1 {
  color: #E44E3D;
}
.portfolio #gl-canvas,
.portfolio #ascii-canvas {
}
#portfolio-footer {
  position: absolute;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 28px;
  z-index: 20;
  opacity: 0;
  animation: fadeIn 1s 1.5s forwards;
}
#portfolio-footer a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
#portfolio-footer a:hover {
  color: #E44E3D;
}
