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

body {
  overflow: hidden;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background: #87ceeb;
}

canvas#webgl {
  display: block;
  position: fixed;
  inset: 0;
}

#ui { position: fixed; inset: 0; pointer-events: none; }

/* ── Loading screen ── */
#loading {
  position: fixed;
  inset: 0;
  background: #0a0a14;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 100;
  pointer-events: all;
  transition: opacity 0.6s ease;
}
#loading.hidden {
  opacity: 0;
  pointer-events: none;
}
.loading-logo {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
}
.loading-sub {
  font-size: 14px;
  color: #8b8ba7;
  letter-spacing: 0.05em;
}
#loading-bar {
  width: 240px;
  height: 4px;
  appearance: none;
  border: none;
  border-radius: 2px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}
#loading-bar::-webkit-progress-bar { background: rgba(255,255,255,0.1); border-radius: 2px; }
#loading-bar::-webkit-progress-value { background: linear-gradient(90deg, #818cf8, #f472b6); border-radius: 2px; }
#loading-bar::-moz-progress-bar { background: linear-gradient(90deg, #818cf8, #f472b6); border-radius: 2px; }

/* ── Back link ── */
.back-link {
  position: fixed;
  top: 16px;
  left: 20px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  pointer-events: all;
  transition: background 0.15s, color 0.15s;
  z-index: 10;
}
.back-link:hover { background: rgba(0,0,0,0.55); color: #fff; }

/* ── Day/night badge (top-left, below the back link) ── */
#time-badge {
  position: fixed;
  top: 58px;
  left: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  padding: 6px 13px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  pointer-events: none;
  z-index: 10;
  opacity: 1;
  transition: background 0.6s ease, border-color 0.6s ease, color 0.6s ease;
}
#time-badge.day   { background: rgba(56,120,180,0.35);  border-color: rgba(160,210,255,0.4); color: #eaf4ff; }
#time-badge.dusk  { background: rgba(150,70,30,0.4);    border-color: rgba(255,160,90,0.4);  color: #ffe6d0; }
#time-badge.night { background: rgba(10,14,30,0.55);    border-color: rgba(120,140,200,0.35); color: #cdd6f5; }

/* ── Controls hint ── */
#controls-hint {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  font-weight: 500;
  transition: opacity 0.8s ease;
  z-index: 10;
}
#controls-hint.faded { opacity: 0; }
.key-group { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.key-row { display: flex; gap: 4px; }
.key-divider { width: 1px; height: 26px; background: rgba(255,255,255,0.2); }
.key {
  width: 30px; height: 30px;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.9);
}
.key-wide { width: auto; padding: 0 10px; }

/* ── Minimap / radar HUD ── */
/* Bottom-left so it isn't covered by the right-side info panel. */
#minimap {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 150px;
  height: 150px;
  background: rgba(10,10,20,0.55);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  backdrop-filter: blur(6px);
  z-index: 10;
  pointer-events: none;
}
@media (max-width: 600px) {
  #minimap { width: 110px; height: 110px; bottom: 14px; left: 12px; }
}

/* ── HUD buttons (mute + camera), top-right ── */
#hud-buttons {
  position: fixed;
  top: 16px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 12;
}
#hud-buttons button {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  color: rgba(255,255,255,0.9);
  font-size: 20px;
  cursor: pointer;
  pointer-events: all;
  backdrop-filter: blur(8px);
  transition: background 0.15s, color 0.15s;
}
#hud-buttons button:hover { background: rgba(0,0,0,0.6); color: #fff; }
#mute-btn.muted { color: #f87171; }
#camera-label,
#map-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 3px 10px;
  border-radius: 12px;
  backdrop-filter: blur(6px);
}

/* ── Collectible counter, top-center ── */
#collectible-counter {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ffd83d;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,216,61,0.35);
  padding: 6px 16px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
  z-index: 11;
}

/* ── Speedometer + compass, bottom-right ── */
#hud-dials {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 10;
  pointer-events: none;
}
#compass {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.9);
  background: rgba(10,10,20,0.55);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 4px 12px;
  border-radius: 14px;
  backdrop-filter: blur(6px);
  min-width: 78px;
  text-align: center;
}
#speedometer {
  position: relative;
  width: 92px; height: 92px;
  background: rgba(10,10,20,0.55);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  backdrop-filter: blur(6px);
}
#speedometer svg { transform: rotate(135deg); }
.speedo-track { fill: none; stroke: rgba(255,255,255,0.12); stroke-width: 5; }
#speedo-arc {
  fill: none;
  stroke: #4ade80;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 163.36;
  stroke-dashoffset: 163.36;
  transition: stroke-dashoffset 0.12s linear, stroke 0.2s;
}
.speedo-readout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  pointer-events: none;
}
.speedo-readout span { font-size: 22px; font-weight: 700; line-height: 1; }
.speedo-readout small { font-size: 9px; color: #9aa0b5; letter-spacing: 0.05em; }
@media (max-width: 600px) {
  #hud-dials { bottom: 14px; right: 12px; }
  #speedometer { width: 74px; height: 74px; }
  #speedometer svg { width: 74px; height: 74px; }
}

/* ── Speed FX overlay (vignette + streaks) ── */
#speed-fx {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s linear;
  background:
    radial-gradient(ellipse 60% 60% at 50% 50%, transparent 40%, rgba(0,0,0,0.55) 100%),
    repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,0.05) 0 2px, transparent 2px 22px);
}

/* ── Intro prompt ── */
#intro-prompt {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  background: rgba(10,10,20,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 10px 22px;
  border-radius: 24px;
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 13;
  animation: introPulse 1.8s ease-in-out infinite;
}
#intro-prompt.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@keyframes introPulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

/* ── Zone toast ── */
#zone-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-60px);
  background: rgba(10,10,20,0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 10px 22px;
  border-radius: 30px;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.35s ease;
  opacity: 0;
  z-index: 10;
  pointer-events: none;
  white-space: nowrap;
}
#zone-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Info panel ── */
#info-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: 100%;
  background: rgba(10,10,20,0.88);
  backdrop-filter: blur(14px);
  border-left: 1px solid rgba(255,255,255,0.1);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1);
  overflow-y: auto;
  padding: 28px 24px 40px;
  pointer-events: none;
  z-index: 10;
  color: #e8e8f0;
}
#info-panel.visible {
  transform: translateX(0);
  pointer-events: all;
}
#info-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #e8e8f0;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
#info-close:hover { background: rgba(255,255,255,0.18); }

#info-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #fff;
}
#info-content .zone-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #818cf8;
  margin-bottom: 6px;
  font-weight: 600;
}
#info-content p {
  font-size: 14px;
  line-height: 1.65;
  color: #a5a5c0;
  margin-bottom: 16px;
}
#info-content .avail-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
}
#info-content .avail-badge.open {
  background: rgba(16,185,129,0.18);
  color: #34d399;
  border: 1px solid rgba(16,185,129,0.3);
}
#info-content .avail-badge.closed {
  background: rgba(239,68,68,0.14);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.25);
}
#info-content .avail-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Projects */
.proj-list { display: flex; flex-direction: column; gap: 14px; }
.proj-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 16px;
}
.proj-item h3 { font-size: 15px; font-weight: 600; color: #fff; margin-bottom: 5px; }
.proj-item p { font-size: 13px; color: #9a9ab5; margin: 0 0 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 10px;
  background: rgba(129,140,248,0.15);
  color: #818cf8;
  border: 1px solid rgba(129,140,248,0.25);
}

/* Timeline */
.timeline-summary { margin-bottom: 20px; }
.tl-list { display: flex; flex-direction: column; gap: 0; }
.tl-item {
  display: flex;
  gap: 14px;
  padding-bottom: 18px;
  position: relative;
}
.tl-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: rgba(255,255,255,0.1);
}
.tl-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #818cf8;
  border: 2px solid rgba(129,140,248,0.4);
  flex: none;
  margin-top: 2px;
}
.tl-body { flex: 1; }
.tl-role { font-size: 14px; font-weight: 600; color: #fff; }
.tl-company { font-size: 13px; color: #9a9ab5; margin-bottom: 2px; }
.tl-range { font-size: 11px; color: #6366f1; font-weight: 600; letter-spacing: 0.04em; }

/* Skills */
.skill-cat { margin-bottom: 18px; }
.skill-cat h3 { font-size: 13px; font-weight: 600; color: #a5a5c0; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.skill-tag {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: #c8c8e0;
  border: 1px solid rgba(255,255,255,0.1);
}

/* Contact */
.social-list { display: flex; flex-direction: column; gap: 10px; }
.social-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  text-decoration: none;
  color: #e8e8f0;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}
.social-link:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.2);
}
.social-link i { font-size: 20px; color: #818cf8; }

@media (max-width: 600px) {
  #info-panel { width: 100%; }
}
