:root {
  --bg-color: #080a0d;
  --bg-alt: #13161c;
  --accent-color: #ffffff;
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.7);
  --font-family: 'Michroma', sans-serif;
}

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

html, body {
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  overflow: hidden;
}

/* --- BACKGROUND MEDIA CONTAINER --- */
#media-bg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#bg-video, #bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-size: cover;
  background-position: center;
  transition: opacity 0.8s ease;
}

#bg-video {
  opacity: 1;
}

#bg-image {
  opacity: 0;
}

.bg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 10, 13, 0.5); /* Slight dark overlay for text readability */
}

/* FLOATING MEDIA TOGGLE SWITCH */
.media-toggle-wrap {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 200;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  padding: 10px 18px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.toggle-label {
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: #ffffff;
  text-transform: uppercase;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: .4s;
  border: 1px solid #ffffff;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: .4s;
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 22px;
}

.slider.round:before {
  border-radius: 50%;
}

/* FIXED NAVBAR */
.spatial-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  padding: 25px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  background: linear-gradient(180deg, rgba(8,10,13,0.8) 0%, rgba(8,10,13,0) 100%);
}

.logo {
  font-weight: 900;
  letter-spacing: 3px;
  color: #ffffff;
  font-size: 1.1rem;
}

.nav-links button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-family);
  font-size: 0.85rem;
  margin-left: 20px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.nav-links button:hover,
.nav-links button.active {
  color: #ffffff;
}

/* SPATIAL WORLD STAGE */
#spatial-world {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  transform-origin: 0 0;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
  z-index: 1;
}

/* NODES */
.spatial-node {
  position: absolute;
  width: 80vw;
  max-width: 1100px;
  min-height: 70vh;
}

/* EXPANDED HERO NODE */
#section-hero {
  top: 0vh;
  left: 0vw;
  width: 90vw;
  max-width: 1500px;
  min-height: 85vh;
}

#section-music     { top: -1100px; left: -1600px; }
#section-lab       { top: -1100px; left: 1600px; }
#section-animation { top: 1100px;  left: -1600px; }
#section-about     { top: 1100px;  left: 1600px; }

/* TRANSPARENT CARD CONTAINERS */
.content-box {
  position: relative;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 60px 50px;
  backdrop-filter: blur(4px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  max-height: 80vh;
  overflow-y: auto;
}

.hero-box {
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 100px 80px;
}

.hero-body {
  text-align: center;
}

/* CORNER HERO LINKS */
.hero-corner-link {
  position: absolute;
  padding: 14px 24px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #ffffff;
  border-radius: 12px;
  font-family: var(--font-family);
  font-size: 0.8rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.hero-corner-link:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  transform: scale(1.05);
  box-shadow: 0 15px 30px rgba(255,255,255,0.3);
}

.corner-tl { top: 30px; left: 30px; }
.corner-tr { top: 30px; right: 30px; }
.corner-bl { bottom: 30px; left: 30px; }
.corner-br { bottom: 30px; right: 30px; }

/* BACK BUTTONS FOR SUBPAGES */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 0.75rem;
  cursor: pointer;
  margin-bottom: 25px;
  transition: all 0.2s ease;
}

.back-link:hover {
  background: #ffffff;
  color: #000000;
  transform: translateY(-2px);
}

.glitch-title {
  font-size: 4rem;
  letter-spacing: 6px;
  color: #ffffff;
  margin-bottom: 15px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 30px;
  line-height: 1.6;
}

.btn {
  padding: 14px 28px;
  background: #ffffff;
  color: #000000;
  border: 1px solid #ffffff;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  background: transparent;
  color: #ffffff;
  transform: translateY(-3px);
}

.section-title {
  font-size: 2rem;
  color: #ffffff;
  margin-bottom: 25px;
}

.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.track-card {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.track-card h4 {
  font-size: 1.05rem;
  color: #ffffff;
  margin-bottom: 8px;
}

.track-card p {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.5;
  margin-bottom: 15px;
}

.spotify-embed-wrap {
  margin-top: 15px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.interactive-stage {
  width: 100%;
  height: 500px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
}

.three-d-frame {
  width: 100%;
  height: 100%;
  border: none;
}