:root {
  --bg: #f6f5f2;
  --bg-glow-a: rgba(124, 92, 255, 0.18);
  --bg-glow-b: rgba(0, 184, 169, 0.16);
  --ink: #15141a;
  --ink-soft: #5b5966;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(20, 20, 30, 0.08);
  --shadow: 0 20px 60px -20px rgba(30, 20, 60, 0.25), 0 2px 6px rgba(30, 20, 60, 0.06);
  --accent: #6d4aff;
  --accent-2: #00a396;
  --node: 109, 74, 255;
  --pulse: 0, 163, 150;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0a10;
    --bg-glow-a: rgba(124, 92, 255, 0.22);
    --bg-glow-b: rgba(0, 184, 169, 0.14);
    --ink: #f1eff7;
    --ink-soft: #a19eb0;
    --glass: rgba(26, 24, 36, 0.55);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.4);
    --accent: #a08bff;
    --accent-2: #3fe0cf;
    --node: 160, 139, 255;
    --pulse: 63, 224, 207;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0a10;
  --bg-glow-a: rgba(124, 92, 255, 0.22);
  --bg-glow-b: rgba(0, 184, 169, 0.14);
  --ink: #f1eff7;
  --ink-soft: #a19eb0;
  --glass: rgba(26, 24, 36, 0.55);
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.4);
  --accent: #a08bff;
  --accent-2: #3fe0cf;
  --node: 160, 139, 255;
  --pulse: 63, 224, 207;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background: soft glows + neural network canvas */
.glow {
  position: fixed; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: 0;
  animation: drift 22s ease-in-out infinite alternate;
}
.glow.a { width: 520px; height: 520px; background: var(--bg-glow-a); top: -120px; left: -100px; }
.glow.b { width: 460px; height: 460px; background: var(--bg-glow-b); bottom: -140px; right: -80px; animation-delay: -8s; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(60px, 40px) scale(1.12); }
}
canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* Floating nav */
nav {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 10; width: min(720px, calc(100% - 32px));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 12px 10px 20px;
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 999px;
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 500; letter-spacing: -0.01em; }
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--accent);
}
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  color: var(--ink-soft); text-decoration: none; font-size: 14px;
  padding: 8px 14px; border-radius: 999px; transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--ink); background: var(--glass-border); }
.nav-links a.cta { color: var(--bg); background: var(--ink); }
.nav-links a.cta:hover { opacity: .85; background: var(--ink); color: var(--bg); }
@media (max-width: 560px) { .nav-links a:not(.cta) { display: none; } }

/* Hero */
main {
  position: relative; z-index: 1;
  min-height: 100vh; display: grid; place-items: center;
  padding: 120px 16px 80px;
}
.mission {
  position: relative; max-width: 860px; text-align: center;
  padding: clamp(36px, 6vw, 72px) clamp(24px, 5vw, 64px);
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 32px;
  backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: var(--shadow);
  animation: float 7s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 28px;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 25%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 8px transparent; } }
h1 {
  font-family: "Fraunces", Georgia, serif; font-weight: 300;
  font-size: clamp(28px, 4.6vw, 52px); line-height: 1.18; letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 em {
  font-style: normal; font-weight: 400;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Floating chips around the mission card */
.chip {
  position: absolute; z-index: 2; white-space: nowrap;
  font-size: 13px; color: var(--ink-soft);
  padding: 8px 14px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  animation: float 6s ease-in-out infinite;
}
.chip b { color: var(--ink); font-weight: 500; }
.chip.c1 { top: -18px; left: 8%;  animation-delay: -1s; }
.chip.c2 { top: 22%;  right: -28px; animation-delay: -3s; animation-duration: 8s; }
.chip.c3 { bottom: -18px; right: 12%; animation-delay: -2s; animation-duration: 7s; }
.chip.c4 { bottom: 24%; left: -32px; animation-delay: -4s; animation-duration: 9s; }
@media (max-width: 760px) {
  .chip.c2, .chip.c4 { display: none; }
  .chip.c1 { left: 50%; transform: translateX(-50%); animation: none; }
  .chip.c3 { right: 50%; transform: translateX(50%); animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}

.nav-links a.active { color: var(--ink); background: var(--glass-border); }
.brand { color: var(--ink); text-decoration: none; }

/* Team page */
.team { position: relative; z-index: 1; width: min(860px, 100%); text-align: center; }
.team h1 { margin-bottom: 48px; }
.members { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; }
.member {
  width: min(320px, 100%); padding: 36px 28px;
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 28px;
  backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: var(--shadow);
  animation: float 7s ease-in-out infinite;
}
.avatar {
  width: 88px; height: 88px; margin: 0 auto 20px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: "Fraunces", Georgia, serif; font-size: 32px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px -8px var(--accent);
}
.member h2 { font-family: "Fraunces", Georgia, serif; font-weight: 400; font-size: 24px; letter-spacing: -0.01em; }
.role { color: var(--ink-soft); font-size: 14px; margin-top: 6px; }
.linkedin {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 22px;
  color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--glass-border);
  transition: background .2s;
}
.linkedin:hover { background: var(--glass-border); }
.linkedin svg { width: 16px; height: 16px; fill: currentColor; }

/* Home: two stacked cards */
main { gap: 48px; align-content: center; }
.mission { width: 100%; }
.mission + .mission { animation-delay: -3.5s; }
.mission h2 {
  font-family: "Fraunces", Georgia, serif; font-weight: 300;
  font-size: clamp(28px, 4.6vw, 52px); line-height: 1.18; letter-spacing: -0.02em;
  text-wrap: balance;
}
.mission h2 em {
  font-style: normal; font-weight: 400;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.eyebrow.section-label {
  font-family: "Inter", system-ui, sans-serif; font-size: clamp(18px, 2vw, 22px); line-height: 1;
  gap: 12px; margin-bottom: -8px; color: var(--ink);
}
.eyebrow.section-label::before { width: 8px; height: 8px; }

/* Contact page */
.mission.contact { max-width: 640px; text-align: left; animation: none; }
.mission.contact h1 { margin-bottom: 36px; }
#contact-form { display: grid; gap: 20px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 8px; border: 0; min-width: 0; }
.field > span, .field legend { font-size: 13px; font-weight: 500; color: var(--ink); padding: 0; margin-bottom: 8px; }
.field > span { margin-bottom: 0; }
.field small { color: var(--ink-soft); font-weight: 400; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  padding: 12px 16px; border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  border: 1px solid var(--glass-border);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.touched .field input:invalid, .touched .field textarea:invalid { border-color: #e5484d; }
.choices { display: flex; gap: 10px; flex-wrap: wrap; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-radius: 999px; font-size: 14px; color: var(--ink-soft);
  border: 1px solid var(--glass-border);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  transition: all .2s;
}
.choice span::before {
  content: ""; width: 14px; height: 14px; border-radius: 4px;
  border: 1.5px solid var(--ink-soft); transition: all .2s;
}
.choice input:checked + span { color: var(--ink); border-color: var(--accent); }
.choice input:checked + span::before {
  border-color: var(--accent);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}
.choice input:focus-visible + span { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.touched .choices:has(input:invalid) .choice span { border-color: #e5484d; }
.submit {
  justify-self: start; font: inherit; font-size: 15px; font-weight: 500;
  padding: 12px 28px; border-radius: 999px; border: 0; cursor: pointer;
  color: var(--bg); background: var(--ink); transition: opacity .2s, transform .2s;
}
.submit:hover { opacity: .85; transform: translateY(-1px); }
.form-status { font-size: 14px; color: var(--ink-soft); min-height: 1.4em; }

/* Research page */
.research { position: relative; z-index: 1; width: min(720px, 100%); text-align: center; }
.research .section-label { margin-bottom: 32px; }
.papers { display: grid; gap: 16px; text-align: left; }
.paper {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 28px 32px; border-radius: 24px; color: var(--ink); text-decoration: none;
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: var(--shadow);
  animation: float 7s ease-in-out infinite;
  transition: border-color .2s;
}
.paper:hover { border-color: var(--accent); }
.paper h2 { font-family: "Fraunces", Georgia, serif; font-weight: 400; font-size: clamp(22px, 3vw, 28px); letter-spacing: -0.01em; }
.paper-arrow { font-size: 22px; color: var(--accent); transition: transform .2s; }
.paper:hover .paper-arrow { transform: translateX(4px); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.submit:disabled { opacity: .6; cursor: wait; transform: none; }
