html {
  scroll-behavior: smooth;
}
:root {
  --bg: #050507;               
  --surface: rgba(255, 255, 255, 0.03); 
  --border: rgba(255, 255, 255, 0.08);
  --text: #f3f4f6;             
  --muted: #9ca3af;            
  --accent: #FF4500;           
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Helvetica Neue", "Inter", sans-serif;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.noise-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)" opacity="0.04"/%3E%3C/svg%3E');
  pointer-events: none; z-index: 999;
}

/* --- HERO SECTION WITH VIDEO --- */
#hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  background: #050507;
  overflow: hidden;
}

#hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to bottom, rgba(5, 5, 7, 0.35) 0%, rgba(5, 5, 7, 1) 100%);
  pointer-events: none;
}

.hero-video-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #050507;
}

.hero-video-bg iframe,
#hero-player {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 100vw !important;
  height: 56.25vw !important;
  min-width: 177.78vh !important;
  min-height: 100vh !important;
  /* THE FIX: Added scale(1.2) to push the title off the top of the screen! */
  transform: translate(-50%, -50%) scale(1.2) !important;
  pointer-events: none;
}

.hero-video-bg iframe {
  border: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-content h2 {
  font-size: 2.5rem; 
  margin-bottom: 24px;
}

.hero-content p {
  font-size: 1.5rem; 
  line-height: 1.6;
  color: var(--text); 
  max-width: 800px; 
  text-align:center;
}

/* --- CONTEXT SECTION (Question & Dataset) --- */
#context-section {
  max-width: 1400px;
  margin: 10vh auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  position: relative;
  z-index: 10;
}

#context-section .glass-card {
  max-width: 100%; 
  margin: 0;
}

#context-section strong {
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 1000px) {
  #context-section {
    grid-template-columns: 1fr; 
    padding: 0 20px;
  }
}

.scroll-indicator {
  position: absolute;
  z-index: 2;
  bottom: 40px;
  text-align: center;
  font-size: 0.9rem;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* --- SCROLLYTELLING LAYOUT --- */
#scrolly {
  display: flex;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
}

.scroll-text {
  flex: 1;
  padding: 10vh 0 50vh 0; 
  max-width: 450px;
  z-index: 10;
}

.step {
  min-height: 80vh; 
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0.2; 
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.step.is-active {
  opacity: 1; 
  transform: translateY(0);
}

.sticky-dashboard {
  flex: 2;
  position: sticky;
  top: 5vh; 
  height: 90vh; 
  margin: 0 0 0 40px;
  z-index: 5;
}

.dashboard-wrapper {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

#team-logos { 
  display: flex !important; 
  flex-direction: row !important; 
  flex-wrap: wrap; 
  justify-content: flex-end; 
  align-items: center;
  gap: 12px; /* Gives the larger pills more breathing room */
  width: auto; 
  max-width: 65%; /* Allows more room in the header for the names */
}

/* Transforms the tiny circle into a sleek glass pill */
#team-logos .logo-chip { 
  position: relative !important; 
  flex-shrink: 0; 
  height: auto; 
  padding: 6px 16px 6px 6px; /* Pill shape padding */
  border-radius: 30px; 
  background: rgba(255, 255, 255, 0.05); 
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15); 
  display: flex; 
  align-items: center; 
  gap: 10px; /* Space between the logo and the text */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); 
  transition: all 0.3s ease;
}

/* Larger, cleaner logo */
#team-logos img { 
  width: 32px; 
  height: 32px; 
  border-radius: 50%;
  background: #fff; /* Keeps white backgrounds clean */
  padding: 2px;
  object-fit: contain; 
}

/* New style for the team name text */
.team-name-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap; /* Prevents long names from stacking weirdly */
}

/* Fallback for teams without a logo image */
.fallback-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: bold;
}

@media (max-width: 1000px) {
  #dashboard { 
    flex-direction: column; 
  }
  #map, #chart { 
    min-height: 420px; 
  }
}

/* --- GLASSMORPHISM COMPONENTS --- */
/* Custom Call-out Box for Key Insights */
.takeaway-box {
    margin-top: 24px;
    padding: 16px 20px;
    background: rgba(255, 69, 0, 0.08); /* Faint glow using your neon orange accent */
    border-left: 4px solid var(--accent);
    border-radius: 0 8px 8px 0;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text);
}

.takeaway-box strong {
    display: block;
    color: var(--accent);
    margin-bottom: 6px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.glass-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.badge { font-size: 0.8rem; letter-spacing: 2px; color: var(--accent); margin-bottom: 24px; font-weight: 600; }
h1 { font-size: 4rem; font-weight: 800; margin: 0 0 16px; letter-spacing: -2px; background: linear-gradient(135deg, #fff 0%, #a1a1aa 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
h2 { font-size: 2rem; font-weight: 300; margin: 0 0 24px; letter-spacing: -0.5px; }
p { font-size: 1.15rem; line-height: 1.8; color: var(--muted); font-weight: 300; }
h4.sub-heading {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    margin: 24px 0 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 4px;
}

/* --- DASHBOARD SPECIFICS --- */
.glass-controls { margin-bottom: 24px; display: flex; gap: 24px; background: rgba(0,0,0,0.4); padding: 16px 24px; border-radius: 16px; border: 1px solid var(--border); }
#metric-toggle input[type="radio"] { accent-color: var(--accent); }
#dashboard-wrap { 
  position: relative; 
  flex-grow: 1; 
  min-height: 600px; 
}

#dashboard { 
  display: flex; 
  flex-direction: column; 
  align-items: stretch; 
  gap: 24px; 
  height: 100%; 
}

#map { 
  background: rgba(0,0,0,0.2); 
  border-radius: 16px; 
  border: 1px solid var(--border); 
  flex: 1.5; 
  min-height: 0;
  overflow: hidden;
  position: relative;
}

#chart { 
  background: rgba(0,0,0,0.2); 
  border-radius: 16px; 
  border: 1px solid var(--border); 
  flex: 1; 
  min-height: 0;
  overflow: hidden;
}

/* NEW GLASS BUTTON */
.glass-button {
  position: absolute;
  bottom: 16px;
  left: 16px; /* Placed over the map */
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  z-index: 10;
}

.glass-button:hover {
  background: rgba(255, 69, 0, 0.2); 
  border-color: var(--accent);
  color: var(--accent);
}

svg text { fill: var(--muted) !important; }
.grid line { stroke: rgba(255,255,255,0.05); }
.domain { stroke: rgba(255,255,255,0.1); }

/* --- Tooltip Styles --- */
.map-tooltip {
  position: absolute;
  pointer-events: none; 
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  color: var(--text);
  z-index: 1000;
  opacity: 0; 
}

.map-tooltip img {
  width: 45px;
  height: 45px;
  object-fit: contain;
}

.map-tooltip h4 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* --- WRITEUP SECTION --- */
#writeup-section {
  max-width: 1000px;
  margin: 10vh auto 20vh auto;
  padding: 0 40px;
}

#writeup-section h3 { margin-top: 32px; font-size: 1.4rem; }

@media (max-width: 1000px) {
  #scrolly { flex-direction: column; padding: 0 20px; }
  .sticky-dashboard { position: relative; top: 0; height: 80vh; margin: 40px 0; }
  .scroll-text { max-width: 100%; padding: 5vh 0; }
  .step { min-height: auto; margin-bottom: 5vh; opacity: 1; transform: none; }
}

/* --- NEW MAP SECTION --- */
#map-section {
  max-width: 1400px;
  margin: 5vh auto 10vh auto;
  padding: 0 40px;
  position: relative;
  z-index: 10;
}

#map-section .glass-card {
  max-width: 100%;
}

#dashboard { 
  display: flex; 
  flex-direction: column; 
  align-items: stretch; 
  height: 100%; 
  width: 100%;
}
/* Active state for filter buttons */
.glass-button.active-toggle {
    background: rgba(255, 69, 0, 0.4); /* Stronger orange for active state */
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}


#evolution-controls .glass-button {
  position: static;
  bottom: unset;
  left: unset;
}

.glass-card .side-gif{
  width: 100%;
  height: auto;
}
