/* ---------- Fonts (self-hosted, SIL OFL; see /fonts) ---------- */
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
/* Arial scaled to Inter's metrics so the swap barely moves the layout */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
  size-adjust: 107.12%;
}

/* ---------- Reset & base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

:root {
  --bg: #070b12;
  --bg-alt: #0a101a;
  --surface: #0f1622;
  --surface-hover: #131c2b;
  --border: #1c2733;
  --border-soft: #151f2b;
  --text: #e8eef6;
  --text-dim: #93a3b8;
  --text-faint: #5c6b80;
  --accent: #22d3ee;
  --accent-2: #38bdf8;
  --accent-soft: rgba(34, 211, 238, 0.1);
  --green: #34d399;
  --warn: #f2b84b;
  --warn-soft: rgba(242, 184, 75, 0.12);
  --radius: 14px;
  --wrap: 1120px;
  --font-sans: 'Inter', 'Inter Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 700; line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); max-width: 40ch; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; color: var(--text-dim); }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #04121a;
  padding: 10px 16px;
  z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.text-accent { color: var(--accent); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
  font-weight: 500;
}

/* ---------- Background grid ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black 40%, transparent 100%);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(7, 11, 18, 0.75);
  border-bottom: 1px solid var(--border-soft);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.brand-mark { color: var(--accent); flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-weight: 800; letter-spacing: 0.03em; font-size: 0.95rem; }
.brand-sub { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.22em; color: var(--text-faint); }

.main-nav {
  display: flex;
  gap: 32px;
}
.main-nav a {
  font-size: 0.92rem;
  color: var(--text-dim);
  font-weight: 500;
  transition: color 0.15s ease;
}
.main-nav a:hover { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 14px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 16px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.94rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: var(--accent);
  color: #04121a;
  box-shadow: 0 0 0 0 rgba(34,211,238,0.4);
}
.btn-primary:hover { box-shadow: 0 0 24px rgba(34,211,238,0.35); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 9px 16px; font-size: 0.85rem; }

/* ---------- Hero ---------- */
.hero { padding: 130px 0 100px; }
.hero-inner { max-width: 780px; }
.hero .eyebrow { margin-bottom: 26px; }
.hero h1 { margin-bottom: 28px; }
.hero-lede { font-size: 1.15rem; max-width: 58ch; margin-bottom: 0; }
.hero-actions { display: flex; gap: 14px; margin-top: 40px; flex-wrap: wrap; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; border-top: 1px solid var(--border-soft); }
.section-alt { background: linear-gradient(180deg, var(--bg-alt), var(--bg)); }
.section-lede { font-size: 1.05rem; max-width: 68ch; }
.section-emphasis {
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 500;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  max-width: 68ch;
  margin-bottom: 40px;
}

/* ---------- Cards ---------- */
.card-grid { display: grid; gap: 22px; margin-top: 8px; }
.card-grid-1 { grid-template-columns: 1fr; }
.card-grid-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: #2a3a4a; transform: translateY(-2px); }
.card p:last-child { margin-bottom: 0; }

.card-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 18px;
}

.project-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.project-card-top h3 { margin: 0; }

.badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-active { background: rgba(52, 211, 153, 0.12); color: var(--green); border: 1px solid rgba(52,211,153,0.3); }
.badge-forthcoming { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(242,184,75,0.3); }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 18px; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.tag-outline {
  display: inline-block;
  margin-bottom: 14px;
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
}

.card-link-disabled {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-faint);
  background: none;
  border: none;
  padding: 0;
  cursor: not-allowed;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  transform: none;
}

.todo-flag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid rgba(242,184,75,0.3);
  border-radius: 6px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
  white-space: nowrap;
}

/* ---------- Page header (inner pages) ---------- */
.page-header { padding: 72px 0 48px; }
.page-header .eyebrow { margin-bottom: 18px; }
.page-header h1 { margin-bottom: 18px; }
.page-header-lede { font-size: 1.05rem; max-width: 68ch; color: var(--text-dim); margin: 0; }

.profile-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* ---------- Credentials ---------- */
.credential-group { margin-bottom: 44px; }
.credential-group:last-child { margin-bottom: 0; }
.credential-group h3 { margin-bottom: 4px; }
.credential-group-note { font-size: 0.9rem; margin-bottom: 20px; }

.credential-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--border-soft);
}
.credential-row:first-child { border-top: none; padding-top: 0; }
.credential-main { min-width: 0; }
.credential-name { font-weight: 600; color: var(--text); }
.credential-meta { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-faint); margin-top: 4px; }
.credential-sub {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-soft);
  font-size: 0.88rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.credential-sub-main { min-width: 0; }
.credential-sub .credential-name { font-size: 0.92rem; display: block; }
.credential-sub .credential-meta { display: block; margin-top: 2px; }
.credential-action { flex-shrink: 0; padding-top: 2px; }

.affiliation-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid var(--border-soft);
  font-size: 0.94rem;
  color: var(--text-dim);
}

/* ---------- Small utilities (replace former inline styles) ---------- */
.inline-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.founder-bio { margin-top: 20px; }
.founder-line { margin-top: 40px; margin-bottom: 0; }
.credential-all-link { margin-top: 18px; }
.section-more { margin-top: 32px; }
.stat-value { color: var(--accent); font-size: 2rem; margin-bottom: 8px; }
.stat-footnote { margin-top: 20px; font-size: 0.9rem; color: var(--text-faint); }
.pub-doi { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint); margin: 6px 0 14px; word-break: break-all; }
.pub-doi a { color: var(--text-dim); text-decoration: underline; text-underline-offset: 2px; }
.pub-note { font-size: 0.85rem; color: var(--text-faint); margin-top: 8px; }

/* ---------- Q&A ---------- */
.qa-list { display: grid; gap: 14px; margin-top: 8px; max-width: 820px; }
.qa-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
}
.qa-item h3 { margin-bottom: 8px; }
.qa-item p { margin: 0; }

/* ---------- Footer extras ---------- */
.footer-updated { color: var(--text-faint); font-size: 0.8rem; margin: 0; }
.footer-meta-group { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
@media (max-width: 600px) {
  .footer-meta-group { align-items: flex-start; }
}

.pub-card h3 { font-size: 1.02rem; max-width: none; }
.pub-card h3 a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; transition: text-decoration-color 0.15s ease; }
.pub-card h3 a:hover { text-decoration-color: var(--accent); }
.pub-meta { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-faint); margin-bottom: 4px; }
.pub-authors { font-size: 0.88rem; margin-bottom: 0; }
.todo-title { color: var(--text-faint); font-style: italic; }
.cited-in { font-size: 0.82rem; margin-top: 4px; margin-bottom: 0; }
.cited-in a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 60px;
  align-items: start;
}
.founder-title { color: var(--accent); font-weight: 600; margin-bottom: 22px; }
.credential-list li {
  padding: 12px 0;
  border-top: 1px solid var(--border-soft);
  font-size: 0.94rem;
  color: var(--text-dim);
}
.credential-list li:first-child { border-top: none; padding-top: 0; }

.about-mission h3 { margin-bottom: 18px; }
.mission-close { color: var(--text); font-weight: 600; font-size: 1.05rem; margin-bottom: 0; }

/* ---------- Contact ---------- */
.contact-section { text-align: center; }
.contact-wrap { max-width: 640px; }
.contact-section .eyebrow,
.contact-section h2,
.contact-section .section-lede { margin-left: auto; margin-right: auto; }
.contact-email {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  padding: 14px 26px;
  border: 1px solid var(--border);
  border-radius: 9px;
  margin: 8px 0 40px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.contact-email:hover { border-color: var(--accent); background: var(--accent-soft); }

.contact-form { text-align: left; }
.hp-field { position: absolute; left: -9999px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-field { margin-bottom: 18px; }
.form-field label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-weight: 500;
}
.form-field input,
.form-field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  resize: vertical;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-note { margin-top: 14px; color: var(--green); font-size: 0.9rem; }
.form-note-error { color: var(--warn); }
.form-note-error a { color: var(--accent); text-decoration: underline; }
.contact-form .btn { width: 100%; justify-content: center; }
@media (min-width: 560px) {
  .contact-form .btn { width: auto; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border-soft); padding: 40px 0; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand { color: var(--text-dim); font-size: 0.9rem; font-weight: 600; }
.footer-meta { color: var(--text-faint); font-size: 0.85rem; margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .card-grid-3, .card-grid-2 { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 760px) {
  .main-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border-soft);
    flex-direction: column;
    padding: 12px 24px 20px;
    gap: 4px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
  .nav-toggle { display: flex; }
  .header-actions .btn-sm { display: none; }
  .hero { padding: 70px 0 60px; }
  .page-header { padding: 56px 0 36px; }
  .section { padding: 64px 0; }
  .form-row { grid-template-columns: 1fr; }
  .credential-row { flex-direction: column; gap: 10px; }
  .credential-sub { flex-direction: column; gap: 8px; }
  .footer-meta-group { align-items: flex-start; }
}
