/* ========================================
   COGNATE - Modern Biotech Website
   Mobile-first, scroll-driven animations
   ======================================== */

/* CSS Custom Properties */
:root {
  /* Colors - Biotech Theme (Tech + Biological) */
  --color-bg: #0a0b12;
  --color-bg-light: #12141f;
  --color-bg-card: rgba(138, 180, 248, 0.03);
  --color-primary: #64b5f6;
  --color-primary-light: #90caf9;
  --color-primary-dark: #42a5f5;
  --color-secondary: #ce93d8;
  --color-accent: #80cbc4;
  --color-text: #e8eaf6;
  --color-text-muted: #9fa8da;
  --color-text-dim: #5c6bc0;
  --color-border: rgba(138, 180, 248, 0.12);
  --color-glow: rgba(100, 181, 246, 0.15);
  --color-glow-bio: rgba(206, 147, 216, 0.1);

  /* Typography */
  --font-main: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s cubic-bezier(0.16, 1, 0.3, 1);

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
}

/* ========================================
   GLOBAL BACKGROUND & PARTICLES
   ======================================== */
.global-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 50% 20%, var(--color-glow), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, var(--color-glow-bio), transparent),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(128, 203, 196, 0.08), transparent);
  pointer-events: none;
}

.global-particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.global-particle {
  position: absolute;
  background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,255,255,0.5) 40%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  will-change: transform;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ========================================
   MOBILE NAVIGATION
   ======================================== */
.mobile-menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  position: fixed;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 1001;
  width: 44px;
  height: 44px;
  background: rgba(10, 15, 22, 0.9);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: var(--transition-base);
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: var(--space-md) 0;
  background: transparent;
  transition: var(--transition-base);
}

.site-header.scrolled {
  background: rgba(10, 15, 22, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: calc(var(--space-xs) / 2);
  text-decoration: none;
  z-index: 1002;
}

.logo-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.logo-text::after {
  content: '.';
  color: var(--color-primary);
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--space-lg);
  background: rgba(10, 15, 22, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-base);
}

.nav.active {
  opacity: 1;
  visibility: visible;
}

.nav a {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: var(--transition-fast);
  transform: translateY(20px);
  opacity: 0;
}

.nav.active a {
  transform: translateY(0);
  opacity: 1;
}

.nav.active a:nth-child(1) { transition-delay: 0.1s; }
.nav.active a:nth-child(2) { transition-delay: 0.15s; }
.nav.active a:nth-child(3) { transition-delay: 0.2s; }
.nav.active a:nth-child(4) { transition-delay: 0.25s; }

.nav a:hover {
  color: var(--color-primary);
}

.nav-cta {
  padding: var(--space-xs) var(--space-md) !important;
  background: var(--color-primary) !important;
  color: var(--color-bg) !important;
  border-radius: var(--radius-full);
  font-weight: 600 !important;
}

/* ========================================
   SCROLL REVEAL ANIMATIONS
   ======================================== */
.scroll-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal.delay-1 { transition-delay: 0.1s; }
.scroll-reveal.delay-2 { transition-delay: 0.2s; }
.scroll-reveal.delay-3 { transition-delay: 0.3s; }
.scroll-reveal.delay-4 { transition-delay: 0.4s; }
.scroll-reveal.delay-5 { transition-delay: 0.5s; }

/* Slide from left */
.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Slide from right */
.scroll-reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scale up animation */
.scroll-reveal-scale {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Rotate in animation */
.scroll-reveal-rotate {
  opacity: 0;
  transform: rotate(-5deg) 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);
}

.scroll-reveal-rotate.visible {
  opacity: 1;
  transform: rotate(0) translateY(0);
}

/* Blur in animation */
.scroll-reveal-blur {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(20px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal-blur.visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

/* Title line animation */
.section-title .title-line {
  display: block;
  overflow: hidden;
}

/* Scroll-driven title animation */
.scroll-title {
  --scroll-progress: 0;
  opacity: calc(0.3 + var(--scroll-progress) * 0.7);
  transform: translateY(calc((1 - var(--scroll-progress)) * 30px));
  transition: opacity 0.1s ease-out, transform 0.1s ease-out;
}

/* Parallax effect class */
.parallax-slow {
  will-change: transform;
}

.parallax-fast {
  will-change: transform;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-2xl) 0;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--color-glow), transparent),
    radial-gradient(ellipse 50% 40% at 80% 70%, var(--color-glow-bio), transparent),
    radial-gradient(ellipse 40% 30% at 20% 80%, rgba(128, 203, 196, 0.08), transparent);
  pointer-events: none;
}

.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,255,255,0.5) 40%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  will-change: transform;
}

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

.hero-title {
  font-size: clamp(2.5rem, 10vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-md);
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-lead {
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  color: var(--color-text-muted);
  max-width: 540px;
  margin-bottom: var(--space-lg);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-dim);
  font-size: 0.8rem;
  animation: float 2s ease-in-out infinite;
}

.mouse {
  width: 24px;
  height: 38px;
  border: 2px solid var(--color-text-dim);
  border-radius: 12px;
  position: relative;
}

.mouse::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 2px;
  animation: scroll-dot 1.5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

@keyframes scroll-dot {
  0%, 100% { opacity: 1; top: 8px; }
  50% { opacity: 0.3; top: 18px; }
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-base);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-bg);
  box-shadow: 0 4px 20px var(--color-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--color-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.btn-ghost:hover {
  background: var(--color-bg-card);
  color: var(--color-text);
  border-color: var(--color-text-dim);
}

.btn-large {
  padding: var(--space-md) var(--space-lg);
  font-size: 1.1rem;
}

/* ========================================
   SECTIONS
   ======================================== */
.section {
  padding: var(--space-2xl) 0;
}

.section-header {
  margin-bottom: var(--space-xl);
}

.section-header.centered {
  text-align: center;
}

.section-tag {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
}

.section-title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-title .highlight {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   ABOUT SECTION
   ======================================== */
.section-about {
  background: transparent;
}

.about-content {
  display: grid;
  gap: var(--space-xl);
}

.about-text .large-text {
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.about-text p {
  color: var(--color-text-muted);
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
}

.stat {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: var(--transition-base);
}

.stat:hover {
  border-color: var(--color-primary);
  background: rgba(0, 217, 165, 0.05);
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--color-glow);
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  flex-shrink: 0;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--color-text);
  white-space: nowrap;
}

/* ========================================
   IMMUNE SECTION
   ======================================== */
.section-immune {
  background: transparent;
  overflow: hidden;
}

.immune-content {
  display: grid;
  gap: var(--space-xl);
  align-items: center;
}

.immune-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.immune-image {
  width: 100%;
  max-width: 600px;
  height: auto;
  opacity: 1.0;
  border-radius: var(--radius-lg);
}

.dna-helix {
  position: relative;
  width: 200px;
  height: 200px;
}

.helix-strand {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-radius: 50%;
  border-top-color: var(--color-primary);
  border-bottom-color: var(--color-primary-dark);
  animation: rotate 3s linear infinite;
}

.helix-strand:nth-child(2) {
  transform: rotateX(60deg);
  animation-delay: -1.5s;
}

.helix-particles {
  position: absolute;
  inset: 20%;
  background: radial-gradient(circle, var(--color-glow), transparent 70%);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes rotate {
  to { transform: rotateY(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.immune-text {
  max-width: 560px;
}

.immune-text p {
  color: var(--color-text-muted);
  margin-top: var(--space-md);
}

/* ========================================
   APPROACH/FEATURES SECTION
   ======================================== */
.section-approach {
  background: transparent;
}

.features-grid {
  display: grid;
  gap: var(--space-md);
}

.feature-card {
  padding: var(--space-lg);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: var(--transition-base);
}

.feature-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--color-glow), transparent);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.feature-card p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.feature-tag {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-bg);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-dim);
}

/* ========================================
   TEAM SECTION
   ======================================== */
.section-team {
  background: transparent;
}

.team-grid {
  display: grid;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.team-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition-base);
}

.team-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-4px);
}

.team-image-wrapper {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
}

.team-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.team-card:hover .team-image {
  transform: scale(1.05);
}

.team-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--color-bg) 0%, transparent 50%);
  pointer-events: none;
}

.team-info {
  padding: var(--space-lg);
}

.team-info h3 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.team-role {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.team-bio {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* ========================================
   CONTACT SECTION
   ======================================== */
.section-contact {
  background: transparent;
  padding: var(--space-2xl) 0;
}

.contact-wrapper {
  display: grid;
  gap: var(--space-xl);
  align-items: center;
}

.contact-content p {
  color: var(--color-text-muted);
  margin: var(--space-md) 0;
  max-width: 480px;
}

.contact-actions {
  margin-top: var(--space-lg);
}

.contact-visual {
  display: none;
}

.contact-shape {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 30% 30%, var(--color-glow), transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(0, 100, 200, 0.1), transparent 50%);
  border-radius: 50%;
  animation: float 4s ease-in-out infinite;
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
  background: transparent;
  border-top: 1px solid var(--color-border);
  padding: var(--space-xl) 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  text-align: center;
}

.footer-brand p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-top: var(--space-xs);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
}

.footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  color: var(--color-text-dim);
  font-size: 0.85rem;
}

/* ========================================
   TABLET BREAKPOINT (768px+)
   ======================================== */
@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }

  .nav {
    position: static;
    flex-direction: row;
    gap: var(--space-md);
    background: transparent;
    backdrop-filter: none;
    opacity: 1;
    visibility: visible;
  }

  .nav a {
    font-size: 0.95rem;
    transform: none;
    opacity: 1;
  }

  .nav-cta {
    margin-left: var(--space-sm);
  }

  .about-content {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }

  .immune-content {
    grid-template-columns: 1fr 1.5fr;
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-wrapper {
    grid-template-columns: 1fr 1fr;
  }

  .contact-visual {
    display: flex;
    justify-content: center;
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }

  .footer-bottom {
    order: -1;
  }
}

/* ========================================
   DESKTOP BREAKPOINT (1024px+)
   ======================================== */
@media (min-width: 1024px) {
  .container {
    padding: 0 var(--space-lg);
  }

  .nav a {
    font-size: 1rem;
  }

  .hero-title {
    font-size: clamp(3.5rem, 8vw, 5.5rem);
  }

  .section {
    padding: var(--space-2xl) 0 calc(var(--space-2xl) * 1.5);
  }

  .feature-card {
    padding: var(--space-xl);
  }

  .team-card {
    flex-direction: row;
  }

  .team-image-wrapper {
    width: 150%;
    aspect-ratio: auto;
    min-height: 350px;
  }

  .team-info {
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  .scroll-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .helix-strand,
  .helix-particles,
  .scroll-indicator,
  .mouse::before,
  .contact-shape {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}
