/* ==========================================================================
   FLOW ROOTS - Editorial Brutalist / Ambient Mesh Design System
   ========================================================================== */

:root {
  --font-heading: 'Syne', sans-serif;
  --font-body: 'Space Grotesk', 'Inter', sans-serif;
  
  --bg-dark: #0d0d0f;
  --text-light: #f4f4f6;
  --text-muted: #a1a1aa;
  
  --accent-neon-green: #ccff00;
  --accent-electric-blue: #2563eb;
  --accent-hot-pink: #ff2a85;
  --accent-purple: #8b5cf6;
  
  --border-glass: rgba(255, 255, 255, 0.12);
  --card-bg: rgba(20, 20, 25, 0.65);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* --------------------------------------------------------------------------
   1. Dynamic Ambient Mesh Gradient & Background Video Overlay
   -------------------------------------------------------------------------- */
.ambient-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  background: radial-gradient(circle at 20% 20%, #2e0854, transparent 50%),
              radial-gradient(circle at 80% 30%, #ff2a85, transparent 40%),
              radial-gradient(circle at 50% 80%, #004b49, transparent 50%),
              radial-gradient(circle at 10% 85%, #ccff00, transparent 35%);
  background-size: 200% 200%;
  animation: meshGradient 18s ease infinite alternate;
  filter: blur(60px);
  opacity: 0.65;
}

@keyframes meshGradient {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
  100% { background-position: 0% 100%; }
}

.video-background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.22;
  mix-blend-mode: overlay;
}

.bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   2. Header & Branding
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(13, 13, 15, 0.4);
  border-bottom: 1px solid var(--border-glass);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-light);
  font-family: var(--font-heading);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.brand-logo {
  height: 38px;
  width: auto;
}

.nav-toggle {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.8rem;
  cursor: pointer;
  display: none;
}

.main-nav {
  display: flex;
  gap: 2rem;
}

.main-nav a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 600;
  text-transform: lowercase;
  font-size: 1.1rem;
  transition: color 0.2s ease;
}

.main-nav a:hover {
  color: var(--accent-neon-green);
}

/* --------------------------------------------------------------------------
   3. Hero Section
   -------------------------------------------------------------------------- */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 1.5rem 4rem;
  text-align: center;
  position: relative;
}

.hero-inner {
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.hero-logo {
  max-width: 320px;
  width: 80%;
  filter: drop-shadow(0 0 20px rgba(204, 255, 0, 0.3));
}

.hero-sub {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 3.5rem);
  font-weight: 800;
  line-height: 1.05;
  text-transform: lowercase;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 30%, var(--accent-neon-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  padding: 0.85rem 2rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  text-decoration: none;
  color: var(--bg-dark);
  background-color: var(--accent-neon-green);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-transform: lowercase;
}

.btn:hover {
  transform: scale(1.05) rotate(-1deg);
  box-shadow: 0 0 25px var(--accent-neon-green);
}

.btn-ghost {
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  border-color: var(--text-light);
  box-shadow: none;
  background: rgba(255, 255, 255, 0.1);
}

/* --------------------------------------------------------------------------
   4. Editorial Layouts & Asymmetric Utilities
   -------------------------------------------------------------------------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

.text-left {
  text-align: left !important;
}

.text-right {
  text-align: right !important;
}

.split-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: start;
}

.stagger-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.stagger-right .lead {
  margin-left: auto;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  text-transform: lowercase;
  margin-bottom: 1.5rem;
  letter-spacing: -0.04em;
  position: relative;
  display: inline-block;
}

.blob-badge {
  display: inline-block;
  background: var(--accent-hot-pink);
  color: var(--text-light);
  font-family: var(--font-heading);
  font-weight: 800;
  padding: 0.4rem 1.2rem;
  border-radius: 60% 40% 70% 30% / 40% 50% 60% 50%;
  transform: rotate(-3deg);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  text-transform: lowercase;
}

.blob-badge.badge-right {
  transform: rotate(4deg);
  margin-left: auto;
}

.lead {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 750px;
}

/* --------------------------------------------------------------------------
   5. Cards Grid & Asymmetrical Layouts
   -------------------------------------------------------------------------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 2rem;
  backdrop-filter: blur(16px);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:nth-child(even) {
  transform: translateY(16px);
}

.card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--accent-neon-green);
}

.card h3 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
  text-transform: lowercase;
}

.card p {
  color: var(--text-muted);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   6. Team Grid
   -------------------------------------------------------------------------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.team-card {
  background: var(--card-bg);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 1.5rem;
  text-align: center;
  backdrop-filter: blur(12px);
}

.avatar {
  width: 110px;
  height: 110px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent-neon-green);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-silhouette {
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.silhouette-icon {
  width: 50%;
  height: 50%;
}

figcaption h4 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

figcaption p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   7. Reveal Animations & Footer
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.site-footer {
  border-top: 1px solid var(--border-glass);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  backdrop-filter: blur(10px);
  margin-top: 4rem;
}

/* Responsive Rules */
@media (max-width: 768px) {
  .split-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .stagger-right {
    align-items: flex-start;
    text-align: left;
  }

  .stagger-right .lead {
    margin-left: 0;
  }

  .blob-badge.badge-right {
    margin-left: 0;
  }

  .nav-toggle {
    display: block;
  }

  .main-nav {
    position: fixed;
    top: 65px;
    right: -100%;
    width: 100%;
    height: calc(100vh - 65px);
    background: rgba(13, 13, 15, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: right 0.3s ease;
  }

  .main-nav.open {
    right: 0;
  }

  .card:nth-child(even) {
    transform: none;
  }

  /* Prevent giant title text at 100% zoom */
  .section-title {
    font-size: clamp(1.4rem, 6vw, 2rem) !important;
    line-height: 1.1 !important;
  }

  .lead {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
  }

  .blob-badge {
    font-size: 0.65rem !important;
    padding: 4px 10px !important;
  }

  .section {
    padding: 2.5rem 1rem !important;
  }
}

/* Landscape Mode Adjustments (Mobile & Foldables) */
@media (max-height: 550px) and (orientation: landscape) {
  /* Un-fix sticky header so map gets full viewport height */
  .site-header {
    position: absolute !important;
  }

  .header-inner {
    padding: 0.4rem 1rem !important;
  }

  .brand-logo {
    height: 28px !important;
  }

  /* Scrollable Nav Menu Drawer for Short Viewports */
  .main-nav {
    top: 50px !important;
    height: calc(100vh - 50px) !important;
    gap: 0.75rem !important;
    padding: 1rem 0 !important;
    overflow-y: auto !important;
  }

  .main-nav a {
    font-size: 0.95rem !important;
  }

  /* Compact Map & Section Padding */
  .section {
    padding: 1.5rem 1rem !important;
  }

  #tracker {
    scroll-margin-top: 0px !important;
  }

  .map-embed-wrapper iframe {
    height: 85vh !important;
    min-height: 330px !important;
  }

  .hero {
    min-height: auto !important;
    padding: 3rem 1rem !important;
  }
}

/* --------------------------------------------------------------------------
   8. Flow Tracker Embed Container Styling
   -------------------------------------------------------------------------- */
.map-embed-wrapper iframe {
  transition: height 0.3s ease;
}

@media (max-width: 1024px) {
  .map-embed-wrapper iframe {
    height: 520px !important;
  }
}

/* Prevent sticky navbar overlay on anchor scroll */
#tracker {
  scroll-margin-top: 80px;
}

/* Ensure touchscreen gestures pass cleanly into Leaflet iframe */
.map-embed-wrapper iframe {
  touch-action: pan-x pan-y pinch-zoom;
}


/* Tracker Pop-out Launch Button */
.tracker-header-actions {
  margin-top: 1.2rem;
  display: flex;
  justify-content: flex-end;
}

.hud-btn-launch {
  display: inline-block;
  padding: 0.64rem 1.25rem;
  background: rgba(9, 164, 199, 0.12);
  border: 1px solid #09a4c7; /* Explicit HUD Cyan */
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(9, 164, 199, 0.25);
}

.hud-btn-launch:hover {
  background: #09a4c7;
  color: #040a12;
  box-shadow: 0 0 22px rgba(9, 164, 199, 0.7);
}

@media (max-width: 768px) {
  .tracker-header-actions {
    justify-content: center; /* Center button on mobile screens */
  }
  
  .hud-btn-launch {
    width: 100%;
    text-align: center;
  }
}