/* ========================================
   CSS Variables & Reset
   ======================================== */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --accent: #4f6ef7;
  --accent-glow: #4f6ef780;
  --text-primary: #e8e8ec;
  --text-secondary: #8888a0;
  --text-heading: #ffffff;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --nav-height: 72px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: #fff;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text-heading);
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ========================================
   Noise Overlay
   ======================================== */

.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ========================================
   Container
   ======================================== */

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========================================
   Navbar
   ======================================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  transition: background 0.35s, box-shadow 0.35s, backdrop-filter 0.35s;
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border-subtle);
}

.nav-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 36px;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.25s;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-heading);
}

.nav-link.active::after {
  width: 100%;
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ========================================
   Sections
   ======================================== */

.section {
  padding: 120px 0;
  scroll-margin-top: var(--nav-height);
}

.section-alt {
  background: var(--bg-secondary);
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 20px;
}

.section-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.8;
}

/* Center text in sections */
#about .container,
#research .container,
#founders .container {
  text-align: center;
}

#about .section-text,
#research .section-text {
  margin-left: auto;
  margin-right: auto;
}

/* ========================================
   Hero
   ======================================== */

.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  scroll-margin-top: 0;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0a0a1a 0%, #0f1029 25%, #0a0a1a 50%, #121230 75%, #0a0a1a 100%);
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
}

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

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 0 24px;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.8;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 14px 36px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.3s, background 0.3s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 32px var(--accent-glow), 0 8px 24px rgba(0, 0, 0, 0.4);
}

.btn-lg {
  padding: 18px 48px;
  font-size: 1.0625rem;
}

/* ========================================
   Stats Grid
   ======================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 60px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 36px 20px;
  text-align: center;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
  border-color: rgba(79, 110, 247, 0.2);
  box-shadow: 0 0 24px rgba(79, 110, 247, 0.08);
}

.stat-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--text-heading);
}

.stat-suffix {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  display: block;
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ========================================
   Services Grid
   ======================================== */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 60px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 44px 32px;
  text-align: left;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.service-card:hover {
  border-color: rgba(79, 110, 247, 0.25);
  box-shadow: 0 0 32px rgba(79, 110, 247, 0.1);
  transform: translateY(-4px);
}

.service-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(79, 110, 247, 0.1);
  border-radius: 12px;
  color: var(--accent);
  margin-bottom: 24px;
}

.service-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.service-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========================================
   Publications
   ======================================== */

.publications-section {
  margin-top: 80px;
}

.publications-heading {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 32px;
}

.publications-list {
  list-style: none;
  text-align: left;
  max-width: 800px;
  margin: 0 auto;
}

.publication-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.publication-item:last-child {
  border-bottom: none;
}

.pub-venue {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pub-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-heading);
  transition: color 0.25s;
  line-height: 1.4;
}

.pub-title:hover {
  color: var(--accent);
}

.pub-authors {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ========================================
   Founders Grid
   ======================================== */

.founders-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px;
  margin-top: 60px;
}

.founder-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 48px 36px;
  text-align: center;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.founder-card:hover {
  border-color: rgba(79, 110, 247, 0.2);
  box-shadow: 0 0 32px rgba(79, 110, 247, 0.08);
}

.founder-image-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 28px;
}

.founder-glow {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  filter: blur(20px);
  opacity: 0.6;
}

.founder-image {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-subtle);
}

.founder-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.founder-title {
  display: block;
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 16px;
}

.founder-bio {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 400px;
  margin: 0 auto 20px;
}

.founder-socials {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}

.social-link:hover {
  color: var(--accent);
  border-color: rgba(79, 110, 247, 0.3);
  background: rgba(79, 110, 247, 0.08);
}

/* ========================================
   Contact CTA
   ======================================== */

.contact-section {
  background: var(--bg-primary);
}

.contact-container {
  text-align: center;
}

.contact-container .section-text {
  margin: 0 auto 40px;
}

/* ========================================
   Footer
   ======================================== */

.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* ========================================
   Scroll Reveal Animations
   ======================================== */

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal][data-reveal-direction="left"] {
  transform: translateX(-40px);
}

[data-reveal][data-reveal-direction="right"] {
  transform: translateX(40px);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translate(0, 0);
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 768px) {
  .section {
    padding: 80px 0;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-subtle);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s, opacity 0.35s;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-link {
    display: block;
    padding: 14px 0;
    font-size: 1rem;
  }

  .nav-link::after {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .founders-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .founder-card {
    padding: 36px 24px;
  }
}

@media (max-width: 480px) {
  .section {
    padding: 64px 0;
  }

  .hero-title {
    font-size: 2rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .stat-card {
    padding: 24px 16px;
  }

  .founder-image-wrap {
    width: 140px;
    height: 140px;
  }

  .founder-image {
    width: 140px;
    height: 140px;
  }
}
