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

/* THEME
   Color tokens only. Both palettes are defined once here and consumed
   via var() everywhere else so light/dark stays a single source of truth. */
:root {
  --bg: #ffffff;
  --bg-1: #f8f9fa;
  --bg-2: #f1f3f5;
  --text-primary: #1a1a2e;
  --text-secondary: #6c757d;
  --text-muted: #adb5bd;
  --border: #e9ecef;
  --border-strong: #ced4da;
  --accent: #2563eb;
  --accent-bg: #eff6ff;
  --accent-border: #bfdbfe;
  --accent-text: #1d4ed8;
  --success-bg: #f0fdf4;
  --success-text: #15803d;
  --warning-bg: #fffbeb;
  --warning-text: #b45309;
  --btn-secondary-hover-bg: #ffffff;
  --radius: 8px;
}

/* Overrides the tokens above when the OS/browser is in dark mode.
   No dark-mode class needed on <body>; it follows the system setting. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117;
    --bg-1: #161b22;
    --bg-2: #1c2128;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --border: #30363d;
    --border-strong: #484f58;
    --accent: #58a6ff;
    --accent-bg: #0d1117;
    --accent-border: #1f6feb;
    --accent-text: #58a6ff;
    --success-bg: #0d1117;
    --success-text: #3fb950;
    --warning-bg: #0d1117;
    --warning-text: #d29922;
    --btn-secondary-hover-bg: #242b35;
  }
}

body { font-family: 'Inter', sans-serif; color: var(--text-primary); background: var(--bg); line-height: 1.6; }

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

/* NAV */
nav {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 1rem 2rem; border-bottom: 0.5px solid var(--border);
  background: var(--bg); position: sticky; top: 0; z-index: 100;
}
.nav-logo-group { justify-self: start; }
.nav-links { justify-self: center; }
.nav-cta { justify-self: end; }
.nav-logo-group { display: flex; align-items: center; gap: 10px; }
.nav-logo-icon { flex-shrink: 0; border-radius: 10px; }
.nav-logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.nav-logo { font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 600; color: var(--accent-text); }
.nav-logo-sub { font-size: 10px; font-weight: 400; color: var(--text-secondary); letter-spacing: 0.01em; }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { font-size: 14px; color: var(--text-secondary); text-decoration: none; }
.nav-links a:hover { color: var(--text-primary); }
.nav-cta {
  font-size: 13px; padding: 6px 14px;
  border: 0.5px solid var(--accent-border); border-radius: var(--radius);
  color: var(--accent-text); background: var(--accent-bg);
  text-decoration: none; display: flex; align-items: center; gap: 6px;
}

/* HERO */
.hero {
  padding: 6rem 2rem 5rem; text-align: center;
  border-bottom: 0.5px solid var(--border); background: var(--bg-1);
}
.hero-tag {
  font-size: 12px; font-weight: 500; color: var(--accent-text);
  background: var(--accent-bg); border: 0.5px solid var(--accent-border);
  padding: 4px 12px; border-radius: 20px; display: inline-block;
  margin-bottom: 1.5rem; letter-spacing: 0.05em; text-transform: uppercase;
}
.hero h1 {
  font-family: 'Space Grotesk', sans-serif; font-size: 52px; font-weight: 600;
  line-height: 1.12; margin-bottom: 1.25rem; color: var(--text-primary);
  max-width: 720px; margin-left: auto; margin-right: auto;
}
.hero h1 span { color: var(--accent-text); }
.hero-sub {
  font-size: 18px; color: var(--text-secondary);
  max-width: 580px; margin: 0 auto 2.5rem; line-height: 1.65;
}
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-primary {
  padding: 11px 24px; background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius); font-size: 14px; font-weight: 500;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary:hover { background: #1d4ed8; text-decoration: none; color: #fff; }
.btn-secondary {
  padding: 11px 24px; background: transparent; color: var(--text-primary);
  border: 0.5px solid var(--border-strong); border-radius: var(--radius);
  font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-secondary:hover { background: var(--btn-secondary-hover-bg); color: var(--accent-text); text-decoration: none; }

/* UTILITIES */
.mt-3 { margin-top: 1rem; }

/* STATS */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px; background: var(--border);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.stat { background: var(--bg); padding: 1.75rem 2rem; text-align: center; }
.stat-num { font-family: 'Space Grotesk', sans-serif; font-size: 32px; font-weight: 600; color: var(--text-primary); }
.stat-num span { color: var(--accent-text); }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.stat-asof { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.stat-label-link { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--text-muted); }
.stat-label-link:hover { color: var(--accent-text); border-bottom-color: var(--accent-text); text-decoration: none; }
.stats-footnote {
  text-align: center; font-size: 12px; color: var(--text-secondary);
  padding: 0.6rem 2rem; border-bottom: 0.5px solid var(--border); background: var(--bg-1);
}

/* SECTIONS */
section { padding: 5rem 2rem; border-bottom: 0.5px solid var(--border); }
section.alt { background: var(--bg-1); }
.section-inner { max-width: 880px; margin: 0 auto; }
.section-tag {
  font-size: 11px; font-weight: 500; color: var(--accent-text);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.75rem;
}
.section-title {
  font-family: 'Space Grotesk', sans-serif; font-size: 34px; font-weight: 600;
  margin-bottom: 1rem; color: var(--text-primary);
}
.section-sub {
  font-size: 16px; color: var(--text-secondary); line-height: 1.7;
  margin-bottom: 2.5rem;
}

/* PRINCIPLES */
.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.principle-card {
  background: var(--bg); border: 0.5px solid var(--border);
  border-radius: 12px; padding: 1.75rem;
}
.principle-icon { font-size: 24px; color: var(--accent-text); margin-bottom: 0.75rem; display: block; }
.principle-num { font-size: 12px; font-weight: 600; color: var(--accent-text); margin-bottom: 0.75rem; letter-spacing: 0.03em; }
.principle-title { font-size: 16px; font-weight: 500; color: var(--text-primary); margin-bottom: 0.5rem; }
.principle-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* FEATURES */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.feature {
  background: var(--bg); border: 0.5px solid var(--border);
  border-radius: 12px; padding: 1.25rem;
}
.feature.alt {
  background: var(--bg-1);
}
.feature-icon { font-size: 22px; color: var(--accent-text); margin-bottom: 0.75rem; display: block; }
.feature-title { font-size: 14px; font-weight: 500; color: var(--text-primary); margin-bottom: 0.4rem; }
.feature-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }

/* PIPELINES */
.pipeline-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.5rem; }
.pipeline-tag {
  font-size: 12px; font-weight: 500; padding: 4px 12px;
  border: 0.5px solid var(--accent-border); background: var(--accent-bg);
  color: var(--accent-text); border-radius: 20px; font-family: 'Inter', monospace;
  text-decoration: none; display: inline-block; transition: background 0.15s, border-color 0.15s;
}
.pipeline-tag:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }

/* DB */
.db-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
@media (max-width: 600px) { .db-grid { grid-template-columns: 1fr; } }
.db-card {
  background: var(--bg); border: 0.5px solid var(--border);
  border-radius: 12px; padding: 1.5rem;
}
.db-card-icon { font-size: 16px; color: var(--text-muted); display: block; margin-bottom: 0.5rem; }
.db-card-label { font-size: 11px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; }
.db-card-title { font-size: 14px; font-weight: 500; color: var(--text-primary); margin-bottom: 0.25rem; }
.db-card-count { font-family: 'Space Grotesk', sans-serif; font-size: 36px; font-weight: 600; color: var(--accent-text); }
.db-card-desc { font-size: 12px; color: var(--text-secondary); margin-top: 0.4rem; line-height: 1.5; }

/* DEPLOYMENTS */
.deployments-carousel { position: relative; display: flex; align-items: center; gap: 0.75rem; }
.deployments-viewport { flex: 1; min-width: 0; }
.deployments {
  display: flex; gap: 1rem; overflow-x: auto;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  /* Native scrollbar hidden; the prev/next arrows in script.js are the
     intended affordance, but scroll/swipe still works underneath. */
  scrollbar-width: none; -ms-overflow-style: none;
}
.deployments::-webkit-scrollbar { display: none; }
.deployment {
  background: var(--bg); border: 0.5px solid var(--border);
  border-radius: 12px; padding: 1.75rem;
  /* 3 cards per view at full width; the two breakpoints below step
     this down to 2 and then 1 as the viewport shrinks. */
  flex: 0 0 calc((100% - 2rem) / 3); scroll-snap-align: start;
}
.carousel-arrow {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  border: 0.5px solid var(--border-strong); background: var(--bg);
  color: var(--text-primary); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s;
}
.carousel-arrow:hover { background: var(--bg-2); }
.carousel-arrow:disabled { opacity: 0.35; cursor: default; }
.carousel-arrow:disabled:hover { background: var(--bg); }
@media (max-width: 900px) {
  .deployment { flex: 0 0 calc((100% - 1rem) / 2); }
}
@media (max-width: 600px) {
  .deployment { flex: 0 0 100%; }
}
.badge {
  display: inline-block; font-size: 11px; font-weight: 500;
  padding: 3px 10px; border-radius: 20px; margin-bottom: 1rem;
}
.badge-active { background: var(--success-bg); color: var(--success-text); }
.badge-adopting { background: var(--warning-bg); color: var(--warning-text); }
.deployment-title { font-size: 15px; font-weight: 500; color: var(--text-primary); margin-bottom: 0.5rem; }
.deployment-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }

/* CTA */
.cta-section {
  background: var(--bg-1); text-align: center; padding: 5rem 2rem;
  border-bottom: 0.5px solid var(--border);
}
.cta-section .section-title { margin-bottom: 1rem; }
.cta-section p { font-size: 15px; color: var(--text-secondary); margin-bottom: 2rem; max-width: 520px; margin-left: auto; margin-right: auto; }
.cta-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* HOME PAGE EXTRAS */
.home-visual {
  margin-top: 2rem; border: 0.5px solid var(--border); border-radius: 12px;
  overflow: hidden; background: var(--bg);
}
.home-visual img {
  width: 100%; height: auto; display: block; max-width: 600px; margin: 25px auto;
}
.home-info-grid { margin-top: 2.5rem; text-align: left; }
.home-info-list {
  margin-top: 0.4rem; display: grid; gap: 0.5rem;
  font-size: 13px; color: var(--text-secondary); line-height: 1.55;
}

/* CONTACT + PUBLICATIONS */
.contact-card p {
  font-size: 14px; color: var(--text-secondary); margin-top: 0.45rem;
}
.contact-card p:first-of-type { margin-top: 0.25rem; }
.contact-image {
  width: 100%; height: auto; display: block; border-radius: 8px;
}
.map-embed {
  width: 100%; min-height: 320px; border: 0; border-radius: 8px;
}

.publication-list {
  list-style: none; margin-top: 1rem;
  display: grid; gap: 0.8rem; counter-reset: publication;
}
.publication-item {
  counter-increment: publication;
  background: var(--bg); border: 0.5px solid var(--border);
  border-radius: 10px; padding: 0.95rem 1rem 0.95rem 3rem;
  color: var(--text-secondary); line-height: 1.55; font-size: 14px;
  position: relative;
}
.publication-item::before {
  content: counter(publication);
  position: absolute; left: 1rem; top: 0.9rem;
  width: 1.35rem; height: 1.35rem;
  border-radius: 50%; border: 0.5px solid var(--accent-border);
  background: var(--accent-bg); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}

.awards-list {
  list-style: none; display: grid; gap: 0.8rem; margin-top: 1rem;
}
.award-item {
  background: var(--bg); border: 0.5px solid var(--border);
  border-radius: 10px; padding: 0.9rem 1rem;
  color: var(--text-secondary); line-height: 1.55; font-size: 14px;
}

/* TEAM */
.team-profile-grid {
  display: grid; grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 1rem; align-items: start;
}
.team-photo {
  width: 100%; height: auto; border-radius: 10px; display: block;
}
.team-photo-card { text-align: center; max-width: 260px; justify-self: center; }
.team-photo-cta { margin-top: 0.85rem; }
.team-bio-card p {
  color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin-top: 0.7rem;
}
.team-bio-card p:first-child { margin-top: 0; }

.team-member-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem; margin-top: 1rem;
}
.team-member-item {
  background: var(--bg); border: 0.5px solid var(--border);
  border-radius: 10px; padding: 1rem;
}
.team-member-item h3 {
  font-family: 'Space Grotesk', sans-serif; font-size: 18px;
  font-weight: 600; color: var(--text-primary); margin-bottom: 0.35rem;
}
.team-member-item p {
  color: var(--text-secondary); font-size: 14px; line-height: 1.55;
}
@media (max-width: 760px) {
  .team-profile-grid { grid-template-columns: 1fr; }
}

/* PROJECTS */
.project-list {
  display: grid; gap: 1rem; margin-top: 1.4rem;
}
.project-item {
  background: var(--bg); border: 0.5px solid var(--border);
  border-radius: 12px; padding: 1rem;
  display: grid; grid-template-columns: 220px 1fr; gap: 1rem;
}
.project-item-image-wrap {
  border-radius: 10px; overflow: hidden; border: 0.5px solid var(--border);
}
.project-item-image {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.project-item-content h3 {
  font-family: 'Space Grotesk', sans-serif; font-size: 22px;
  font-weight: 600; color: var(--text-primary); margin-bottom: 0.4rem;
}
.project-item-content p {
  color: var(--text-secondary); font-size: 14px; line-height: 1.6;
}
.project-item-actions {
  display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.9rem;
}
.project-item-content-full {
  grid-column: 1 / -1;
}
@media (max-width: 760px) {
  .project-item { grid-template-columns: 1fr; }
  .project-item-image-wrap { max-height: 220px; }
}

/* FOOTER */
footer {
  padding: 2rem; text-align: center; font-size: 13px;
  color: var(--text-muted); background: var(--bg);
}
footer a { color: var(--accent-text); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero h1 { font-size: 36px; }
  .nav-links { display: none; }
  section { padding: 3rem 1.25rem; }
  .hero-tag { font-size: 10px; letter-spacing: 0.03em; padding: 4px 10px; }
}
