/* =============================================
   VIVARIUM — STANDALONE SITE CSS
   Migrated from Squarespace Custom CSS.
   Squarespace wrapper overrides (.sqs-*, #page,
   [data-section-id], etc.) removed — no longer needed.
   ============================================= */

/* =============================================
   CUSTOM FONT
   ============================================= */

@font-face {
  font-family: 'Neue Montreal Medium';
  src: url('https://static1.squarespace.com/static/67438c176e00d7308e22ca12/t/675cb72cb4f3ee31d93ea382/1734129452305/PPNeueMontreal-Medium.otf');
  font-display: swap;
}

p {
  font-family: 'Neue Montreal Medium', 'Manrope', sans-serif;
  letter-spacing: 0.01em;
}

/* =============================================
   BASE
   ============================================= */

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-color: #011c15;
}

/* =============================================
   CSS VARIABLES
   ============================================= */

:root {
  --vivarium-font-serif: 'Crimson Text', serif;
  --vivarium-font-sans: 'Manrope', sans-serif;
  --vivarium-bg-dark: #011c15;
  --vivarium-bg-darker: #001510;
  --vivarium-emerald: #10B981;
  --vivarium-amber: #F59E0B;
}

/* =============================================
   SITE HEADER (replaces Squarespace header)
   ============================================= */

.vivarium-site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, backdrop-filter 0.3s ease,
              opacity 0.4s ease, transform 0.4s ease;
}

/* Fades back when scrolling down; returns on scroll up */
.vivarium-site-header.header-faded {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.vivarium-site-header.scrolled {
  background: rgba(1, 28, 21, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.vivarium-site-header .header-logo img {
  height: 46px;
  width: auto;
  display: block;
}

.vivarium-site-header .header-logo .logo-fallback {
  display: none;
  font-family: 'Crimson Text', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.02em;
}


@media (max-width: 767px) {
  .vivarium-site-header { padding: 1.1rem; }
  .vivarium-site-header .header-logo img { height: 36px; }
}

/* =============================================
   SITE FOOTER (replaces Squarespace footer)
   ============================================= */

.vivarium-site-footer {
  background-color: #011c15;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-family: 'Manrope', sans-serif;
}

.vivarium-site-footer a {
  color: #10B981;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0.75rem;
  transition: color 0.2s ease;
}

.vivarium-site-footer a:hover {
  color: #F59E0B;
}

.vivarium-site-footer .footer-copyright {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: rgba(236, 253, 245, 0.4);
}

/* =============================================
   VIVARIUM CONTAINER
   ============================================= */

.vivarium-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background-color: #011c15;
  color: #e2e8f0;
  font-family: 'Manrope', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.vivarium-container *,
.vivarium-container *::before,
.vivarium-container *::after {
  box-sizing: border-box;
}

/* =============================================
   INNER CONTENT CONSTRAINTS
   ============================================= */

.vivarium-container .max-w-7xl {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  width: 100%;
}

.vivarium-container .max-w-4xl {
  max-width: 896px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  width: 100%;
}

/* =============================================
   TYPOGRAPHY RESETS
   ============================================= */

.vivarium-container h1,
.vivarium-container h2,
.vivarium-container h3 {
  font-family: var(--vivarium-font-serif);
  margin: 0;
  padding: 0;
}

.vivarium-container ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.vivarium-container a {
  text-decoration: none;
}

.vivarium-container p {
  margin: 0;
}

/* =============================================
   ANIMATIONS
   ============================================= */

@keyframes fade-in-up {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-slow {
  0%, 100% { opacity: 0.1; transform: scale(1); }
  50% { opacity: 0.2; transform: scale(1.1); }
}

@media (prefers-reduced-motion: no-preference) {
  .animate-fade-in-up { animation: fade-in-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
  .animate-pulse-slow { animation: pulse-slow 4s ease-in-out infinite; }
}

@media (prefers-reduced-motion: reduce) {
  .animate-fade-in-up, .animate-pulse-slow { animation: none; }
}

/* =============================================
   COMPONENT STYLES
   ============================================= */

.network-overlay {
  background: radial-gradient(circle at center, transparent 20%, var(--vivarium-bg-dark) 80%);
  pointer-events: none;
}

.tooltip-connector {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.2), transparent);
  margin-top: -5px;
}

/* =============================================
   SOLVE CARDS
   ============================================= */

.solve-card {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.solve-card:hover,
.solve-card:focus-visible,
.solve-card.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(245, 158, 11, 0.5);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
}

@media (hover: none) {
  .solve-card:hover { transform: none; }
  .solve-card.active { transform: translateY(-4px); }
}

.solve-icon-wrapper {
  transition: all 0.3s ease;
  background: rgba(16, 185, 129, 0.1);
  color: var(--vivarium-emerald);
}

.solve-card:hover .solve-icon-wrapper,
.solve-card.active .solve-icon-wrapper {
  background: var(--vivarium-amber);
  color: var(--vivarium-bg-dark);
  transform: scale(1.05);
}

/* =============================================
   UI OVERLAYS
   ============================================= */

.canvas-ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  z-index: 50;
}

.hud-panel {
  background: rgba(1, 28, 21, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* =============================================
   CHAT BUBBLES
   ============================================= */

.chat-bubble {
  position: absolute;
  padding: 8px 12px;
  border-radius: 12px;
  font-family: var(--vivarium-font-sans);
  font-size: 11px;
  line-height: 1.4;
  max-width: 180px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
  transform: translate(-50%, 20px) scale(0.9);
  pointer-events: none;
}

.chat-bubble.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.bubble-ai {
  background: rgba(6, 78, 59, 0.95);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #fff;
  border-bottom-left-radius: 4px;
  text-align: left;
}

.bubble-user {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #e2e8f0;
  border-bottom-right-radius: 4px;
  text-align: right;
}

.bubble-insight {
  background: linear-gradient(135deg, rgba(69, 26, 3, 0.95), rgba(120, 53, 15, 0.95));
  border: 1px solid rgba(245, 158, 11, 0.6);
  color: #fbbf24;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 9px;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.2);
  text-align: center;
}

/* =============================================
   CANVAS
   ============================================= */

.vivarium-container canvas {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* =============================================
   RESPONSIVE SECTION SPACING
   ============================================= */

.vivarium-section-hero {
  padding: 2rem 0 2.5rem 0;
}

.vivarium-section-method {
  padding: 2.5rem 0;
}

.vivarium-section-cta {
  padding: 2.5rem 0 2rem 0;
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .vivarium-section-hero { padding: 3rem 0 4rem 0; }
  .vivarium-section-method { padding: 4rem 0; }
  .vivarium-section-cta { padding: 4rem 0 3rem 0; }
}

@media (min-width: 1024px) {
  .vivarium-section-hero { padding: 4rem 0 5rem 0; }
  .vivarium-section-method { padding: 5rem 0; }
  .vivarium-section-cta { padding: 5rem 0 4rem 0; }
}

/* =============================================
   RESPONSIVE VISUALIZATION HEIGHTS
   ============================================= */

.globe-container {
  height: 300px;
  min-height: 300px;
}

.solves-viz-container {
  height: 350px;
  min-height: 350px;
}

@media (min-width: 768px) {
  .globe-container { height: 400px; min-height: 400px; }
  .solves-viz-container { height: 450px; min-height: 450px; }
}

@media (min-width: 1024px) {
  .globe-container { height: 480px; min-height: 480px; }
  .solves-viz-container { height: 500px; min-height: 500px; }
}

/* =============================================
   ADDITIONAL FIXES
   ============================================= */

.vivarium-container img,
.vivarium-container svg {
  max-width: 100%;
  height: auto;
}

.vivarium-container h1,
.vivarium-container h2,
.vivarium-container h3,
.vivarium-container p {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* =============================================
   CUSTOM SPACING ADJUSTMENTS
   ============================================= */

.vivarium-section-hero h1 {
  margin-bottom: 1.5rem !important;
}

.vivarium-section-method h2 {
  margin-bottom: 1.5rem !important;
}

.vivarium-section-cta h2 {
  margin-bottom: 1.5rem !important;
}

.vivarium-section-cta p {
  margin-bottom: 2.5rem !important;
}

.vivarium-section-hero p {
  margin-bottom: 2rem !important;
}

.solve-card p {
  margin-bottom: 1rem !important;
}

/* =============================================
   TEXT ALIGNMENT - CENTER
   ============================================= */

.vivarium-section-method > div > div:first-child p {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.vivarium-section-cta p {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* =============================================
   ANALYTICS CAROUSEL
   ============================================= */

@keyframes scroll-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.animate-scroll {
  animation: scroll-left 50s linear infinite !important;
  will-change: transform;
}

.animate-scroll:hover {
  animation-play-state: paused !important;
}

.vivarium-section-analytics {
  padding: 2.5rem 0 1rem 0 !important;
  overflow: visible !important;
  margin-bottom: 0 !important;
  position: relative;
  z-index: 10;
}

@media (min-width: 768px) {
  .vivarium-section-analytics {
    padding: 4rem 0 1rem 0 !important;
  }
}

@media (min-width: 1024px) {
  .vivarium-section-analytics {
    padding: 5rem 0 1rem 0 !important;
  }
}

.vivarium-section-analytics > div:first-child {
  margin-bottom: 2.5rem !important;
}

@media (min-width: 768px) {
  .vivarium-section-analytics > div:first-child {
    margin-bottom: 3rem !important;
  }
}

.vivarium-section-analytics > div:first-child p {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.vivarium-section-analytics h3 {
  margin-bottom: 1rem !important;
}

@media (min-width: 768px) {
  .vivarium-section-analytics h3 {
    margin-bottom: 1.5rem !important;
  }
}

.analytics-carousel-wrapper {
  padding-bottom: 3rem !important;
  margin-bottom: 0 !important;
  overflow: visible !important;
  position: relative;
  z-index: 10;
}

.analytic-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 1.25rem 2rem;
  border-radius: 50px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  position: relative;
  overflow: visible;
  cursor: default;
  flex-shrink: 0;
}

.analytic-card .flex {
  justify-content: center !important;
}

.analytic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s;
  border-radius: 50px;
}

.analytic-card:hover::before {
  left: 100%;
}

.analytic-card:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-5px);
  box-shadow: 0 15px 40px -5px rgba(16, 185, 129, 0.3);
  color: white;
  z-index: 50;
}

.analytic-tooltip {
  position: absolute;
  top: 100%;
  left: 50% !important;
  transform: translateX(-50%) translateY(-10px) !important;
  width: 280px !important;
  margin-top: 15px;
  padding: 1rem 1.25rem;
  background: rgba(0, 20, 16, 0.98);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #e2e8f0;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  white-space: normal;
  text-align: center;
  z-index: 1000 !important;
}

.analytic-card:hover .analytic-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0) !important;
}

/* =============================================
   SERIF HEADING WEIGHTS (matches previous site)
   - h2 / h3 / other serif elements: Regular 400
   - h1 (hero, contact, etc.): Semi-bold 600
   ============================================= */

.vivarium-container h2,
.vivarium-container h3,
.vivarium-container .font-serif {
  font-weight: 400 !important;
}

h1,
.vivarium-container h1,
.vivarium-container h1.font-serif,
.vivarium-contact-container h1,
#vivarium-root h1,
#vivarium-contact-root h1 {
  font-weight: 600 !important;
  letter-spacing: -0.02em; /* ≈ -1.4px at 72px, per previous site spec */
}

/* =============================================
   FONT-SERIF = CRIMSON TEXT, ALWAYS
   The Tailwind CDN injects its own .font-serif
   (ui-serif/Georgia) at runtime, after page CSS.
   This override ensures Crimson Text wins
   site-wide (contact heading, HUD stats, etc.)
   ============================================= */

.font-serif,
.vivarium-container .font-serif,
.vivarium-contact-container .font-serif {
  font-family: 'Crimson Text', serif !important;
}

/* =============================================
   HERO TOP SPACING - PUSH BELOW FIXED HEADER
   ============================================= */

.vivarium-section-hero {
  padding-top: 120px !important;
}

@media (max-width: 767px) {
  .vivarium-section-hero {
    padding-top: 100px !important;
  }
}

/* =============================================
   MOBILE
   ============================================= */

@media (max-width: 767px) {

  .vivarium-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    background-color: #011c15 !important;
  }

  .vivarium-section-hero,
  .vivarium-section-method,
  .vivarium-section-analytics,
  .vivarium-section-cta {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    background-color: #011c15 !important;
  }

  .vivarium-section-method {
    background-color: #001510 !important;
  }

  .vivarium-container .max-w-7xl,
  .vivarium-container .max-w-4xl,
  .vivarium-container .max-w-3xl {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .vivarium-section-hero .grid,
  .vivarium-section-method .grid {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .globe-container {
    height: 250px !important;
    min-height: 250px !important;
    margin-bottom: 1rem !important;
  }

  .analytic-card {
    min-width: 220px;
    padding: 1rem 1.5rem;
  }

  .analytic-card span {
    font-size: 0.9rem !important;
  }

  .analytic-tooltip {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }

  .analytics-carousel-wrapper {
    padding-bottom: 2rem !important;
  }

  .vivarium-section-analytics {
    margin-bottom: 0 !important;
    padding-bottom: 1rem !important;
  }

  /* Hide solves visualization on mobile */
  .solves-viz-container,
  #solvesContainer {
    display: none !important;
  }

  /* Keep carousel running, no interaction on mobile */
  .animate-scroll,
  .animate-scroll:hover,
  .animate-scroll:active,
  .animate-scroll:focus {
    animation: scroll-left 50s linear infinite !important;
    animation-play-state: running !important;
  }

  .analytic-card {
    pointer-events: none !important;
  }

  .analytic-card:hover,
  .analytic-card:active,
  .analytic-card:focus {
    transform: none !important;
    background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2) !important;
  }
}
