:root {
  color-scheme: light;
  --bg: #f3efea;
  --text: #15171a;
  --muted: #5c6470;
  --panel: #0b0f17;
  --on-panel: #f4f8ff;
  --on-panel-muted: #aab4c6;
  --accent: #0b6b78;
  --accent-on-panel: #6de5ff;
  --border: rgba(21, 23, 26, 0.1);
  --border-on-panel: rgba(244, 248, 255, 0.14);
  --gutter: 1.5rem;
  --radius: 20px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.panel :focus-visible {
  outline-color: var(--accent-on-panel);
}

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

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 180ms ease;
}

.nav.scrolled {
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.9rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav-icons {
  display: flex;
  gap: 0.5rem;
}

.icon-link {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  text-decoration: none;
}

.icon-link:hover {
  background: rgba(21, 23, 26, 0.05);
}

.icon-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ── Panels ── */
.panel-wrap {
  padding: 0 var(--gutter);
}

.panel {
  max-width: 1100px;
  margin: 0 auto;
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--on-panel);
  position: relative;
  overflow: hidden;
}

/* ── Hero ── */
.hero {
  min-height: min(82vh, 760px);
  display: flex;
  align-items: flex-end;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url('/synapses.jpg') center / cover no-repeat;
  opacity: 0.3;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 15, 23, 0.95) 0%, rgba(11, 15, 23, 0.35) 60%, rgba(11, 15, 23, 0.1) 100%);
}

.hero-content {
  position: relative;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1.5rem, 5vw, 4.5rem);
  max-width: 960px;
}

.label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.panel .label {
  color: var(--accent-on-panel);
}

h1 {
  font-size: clamp(2.3rem, 5.5vw, 4rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.hero-lede {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--on-panel-muted);
  max-width: 60ch;
  line-height: 1.6;
  margin-bottom: 2.25rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 180ms ease, border-color 180ms ease;
}

.panel .btn-primary {
  color: var(--panel);
  background: var(--accent-on-panel);
}

.panel .btn-primary:hover {
  background: #9df0ff;
}

.panel .btn-ghost {
  color: var(--on-panel);
  border-color: var(--border-on-panel);
}

.panel .btn-ghost:hover {
  background: rgba(244, 248, 255, 0.06);
}

/* ── Sections ── */
.section {
  padding: clamp(4rem, 8vw, 7rem) var(--gutter);
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.statement {
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  max-width: 60ch;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--muted);
  max-width: 60ch;
  margin-bottom: 3.5rem;
}

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 3rem 2.5rem;
}

.column h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.column p {
  color: var(--muted);
  max-width: 40ch;
}

.column .tag {
  display: block;
  margin-top: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.divider {
  border: 0;
  border-top: 1px solid var(--border);
  max-width: 1100px;
  margin: 0 auto;
}

/* ── Signal panel ── */
.signal {
  padding: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 5vw, 4.5rem);
}

.trace {
  width: 100%;
  height: clamp(120px, 20vw, 240px);
  display: block;
}

.trace-line {
  fill: none;
  stroke: var(--accent-on-panel);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.trace-mark {
  fill: var(--panel);
  stroke: var(--on-panel);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.signal-caption {
  margin-top: 1.5rem;
  color: var(--on-panel-muted);
  font-size: 1.05rem;
}

/* ── Contact ── */
.contact {
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1.5rem, 5vw, 4.5rem);
}

.contact p {
  color: var(--on-panel-muted);
  max-width: 60ch;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  margin-bottom: 2.25rem;
}

.contact-address {
  display: inline-block;
  font-size: clamp(1.5rem, 3.4vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--on-panel);
  text-decoration: none;
  border-bottom: 2px solid var(--accent-on-panel);
  padding-bottom: 0.15rem;
  word-break: break-all;
}

.contact-address:hover {
  color: var(--accent-on-panel);
}

/* ── Footer ── */
footer {
  padding: 3rem var(--gutter) 2.5rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 2rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 600;
}

.footer-brand img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.footer-brand small {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-bottom {
  width: 100%;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-bottom a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-bottom a:hover {
  color: var(--text);
}

/* ── Current page in the nav ── */
.nav-links a[aria-current="page"] {
  color: var(--text);
}

.text-link {
  display: inline-block;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.text-link:hover {
  color: var(--text);
}

/* ── Our work so far (home) ── */
.work h3 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  max-width: 28ch;
}

/* ── Team teaser (home) ── */
.teaser p {
  color: var(--muted);
  max-width: 60ch;
  margin-bottom: 1.5rem;
}

/* ── Page head (inner pages) ── */
.page-head {
  padding-bottom: clamp(2rem, 4vw, 3.5rem);
}

.page-head h1 {
  max-width: 22ch;
}

.page-head .statement {
  font-weight: 400;
  color: var(--muted);
}

.page-head + .section {
  padding-top: 0;
}

.post-meta {
  color: var(--muted);
}

/* ── People (/team/) ── */
.person {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 2rem 3.5rem;
  align-items: start;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}

.person:last-child {
  border-bottom: 1px solid var(--border);
}

.portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 12px;
}

.person h2 {
  margin-bottom: 0.25rem;
}

.person-role {
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.person-bio {
  color: var(--muted);
  line-height: 1.75;
  max-width: 60ch;
  margin-bottom: 1.25rem;
}

.person-bio strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Open roles (/team/) ── */
.openings {
  list-style: none;
  border-top: 1px solid var(--border);
  max-width: 60ch;
}

.openings li {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.opening-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.opening-head h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

.opening-head span {
  color: var(--muted);
  white-space: nowrap;
}

.openings p {
  color: var(--muted);
  margin-bottom: 0.75rem;
}

/* ── Entry lists (/publications/, /blog/) ── */
.entries {
  list-style: none;
  border-top: 1px solid var(--border);
}

.entries li {
  padding: 2.25rem 0;
  border-bottom: 1px solid var(--border);
  max-width: 70ch;
}

.entries .label {
  margin-bottom: 0.75rem;
}

.entries h2 {
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

.entries h2 a {
  color: var(--text);
  text-decoration: none;
}

.entries h2 a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.entries p {
  color: var(--muted);
  max-width: 60ch;
  margin-bottom: 0.75rem;
}

.entries .institutions {
  color: var(--text);
}

/* ── Post body (/blog/<slug>/) ── */
.prose {
  max-width: 62ch;
}

.prose > * + * {
  margin-top: 1.25rem;
}

.prose h2 {
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.3;
  margin-top: 2.5rem;
}

.prose h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2rem;
}

.prose ul,
.prose ol {
  padding-left: 1.5rem;
}

.prose li + li {
  margin-top: 0.4rem;
}

.prose blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
  color: var(--muted);
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: rgba(21, 23, 26, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.prose pre {
  background: var(--panel);
  color: var(--on-panel);
  padding: 1.25rem;
  border-radius: 12px;
  overflow-x: auto;
}

.prose pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.prose img {
  border-radius: 12px;
}

.prose strong {
  font-weight: 600;
}

.post-end {
  margin-top: 3rem;
}

/* ── Phone ── */
@media (max-width: 640px) {
  :root { --gutter: 1.25rem; --radius: 16px; }
  .nav-inner { flex-wrap: wrap; }
  .nav-links { width: 100%; order: 3; flex-wrap: wrap; gap: 0.4rem 1rem; padding-bottom: 0.35rem; }
  .nav-links a { font-size: 0.85rem; }
  .hero { min-height: min(78vh, 640px); }
  .portrait { max-width: 220px; }
  .actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  .person { grid-template-columns: 1fr; }
  .opening-head { flex-direction: column; gap: 0.1rem; }
}
