/* HELIX — site styles. Light by default, dark via prefers-color-scheme. */
:root {
  --bg: #f6f5f1;
  --ink: #161614;
  --muted: #6b6a65;
  --line: rgba(22, 22, 20, .12);
  --panel: #efede7;
  --accent: #2f5bd3;
  --on-accent: #fff;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --wrap: 1280px;
  --pad: clamp(20px, 4vw, 48px);
  --gap-section: clamp(96px, 12vw, 160px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0e;
    --ink: #ecebe6;
    --muted: #9a9993;
    --line: rgba(236, 235, 230, .12);
    --panel: #1a1a18;
    --accent: #6f8ff0;
    --on-accent: #0f0f0e;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; height: auto; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 999px; }
.skip:focus { left: 8px; }

/* Nav */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 22px; height: 22px; flex: none; }
.brand-name { font-weight: 500; font-size: 16px; letter-spacing: .18em; line-height: 1; }
.brand-sub { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); line-height: 1; padding-left: 12px; border-left: 1px solid var(--line); }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 28px); font-size: 14px; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--ink); }
.nav-links a.pill { color: var(--bg); background: var(--ink); padding: 7px 14px; border-radius: 999px; font-weight: 500; }
.nav-links a.pill:hover { color: var(--bg); opacity: .88; }
@media (max-width: 760px) { .nav-links a:not(.pill) { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font-size: 15px; font-weight: 500; white-space: nowrap; }
.btn-solid { background: var(--ink); color: var(--bg); }
.btn-solid:hover { color: var(--bg); opacity: .88; }
.btn-line { border: 1px solid var(--line); }
.btn-line:hover { color: var(--ink); background: var(--panel); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { color: var(--on-accent); opacity: .9; }

/* Hero */
.hero { padding-top: clamp(64px, 10vw, 136px); }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.display { font-family: var(--serif); font-weight: 300; font-size: clamp(40px, 6.4vw, 88px); line-height: 1.02; letter-spacing: -.025em; text-wrap: balance; }
.hero h1 { margin-top: 28px; max-width: 14ch; }
.hero-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 32px 64px; margin-top: 48px; align-items: end; }
.lede { font-size: clamp(17px, 1.4vw, 19px); color: var(--muted); max-width: 560px; text-wrap: pretty; }
.lede strong { color: var(--ink); font-weight: 400; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.field { margin-top: clamp(48px, 6vw, 80px); position: relative; border-radius: 4px; overflow: hidden; background: var(--panel); height: clamp(320px, 42vw, 520px); }
.field canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* Sections */
.section { padding-top: var(--gap-section); }
.section-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 24px 64px; align-items: start; }
.section-head > :last-child { grid-column: span 2; }
@media (max-width: 900px) { .section-head > :last-child { grid-column: auto; } }
.kicker { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .04em; padding-top: 10px; }
.h2 { font-weight: 400; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.1; letter-spacing: -.02em; text-wrap: balance; max-width: 24ch; }
.section-intro { margin-top: 20px; color: var(--muted); font-size: 17px; max-width: 560px; text-wrap: pretty; }
.list { margin: 64px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }

/* Rows (research + news) */
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 8px 64px; padding: 28px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 760px) { .row { grid-template-columns: 1fr; } }
.row-n { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.row-date { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.row-body { display: flex; flex-wrap: wrap; gap: 8px 64px; }
.row-title { flex: 1 1 260px; font-size: 21px; font-weight: 500; letter-spacing: -.01em; text-wrap: balance; }
.row-text { flex: 1 1 260px; color: var(--muted); text-wrap: pretty; }
.news-body { display: flex; flex-direction: column; gap: 10px; }
.news-body .row-title { flex: none; }
.news-body p { color: var(--muted); max-width: 680px; text-wrap: pretty; }
.news-body a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.news-body a:hover { text-decoration-color: currentColor; }
.news-body pre { margin: 0; padding: 12px 14px; background: var(--panel); border-radius: 4px; overflow-x: auto; font: 13px/1.5 var(--mono); }
.news-body code { font-family: var(--mono); font-size: .9em; }
.news-media { margin: 6px 0; max-width: 680px; }
.news-media img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; background: var(--panel); }

/* Libraries */
.libs { margin-top: 64px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.lib { background: var(--bg); padding: 28px; display: flex; flex-direction: column; gap: 16px; min-height: 300px; transition: background .2s; }
.lib:hover { background: var(--panel); color: var(--ink); }
.lib-media { display: block; margin: -28px -28px 4px; aspect-ratio: 16 / 9; overflow: hidden; background: var(--panel); border-bottom: 1px solid var(--line); }
.lib-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.lib-media svg { display: block; width: 100%; height: 100%; color: var(--ink); transition: transform .4s ease; }
.lib:hover .lib-media img, .lib:hover .lib-media svg { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .lib-media img, .lib-media svg { transition: none; } .lib:hover .lib-media img, .lib:hover .lib-media svg { transform: none; } }
.lib-media-text { display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: clamp(28px, 3vw, 40px); font-weight: 500; letter-spacing: -.02em; color: var(--ink); }
.libs:has(> .lib:only-child) { max-width: 440px; }
.lib-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.lib-name { font-family: var(--mono); font-size: 20px; font-weight: 500; letter-spacing: -.01em; }
.lib-tag { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.lib p { color: var(--muted); font-size: 15px; text-wrap: pretty; flex: 1; }
.lib-path { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* Grants */
.grants { margin-top: 64px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 24px; }
.grant { background: var(--panel); border-radius: 4px; padding: clamp(28px, 3vw, 40px); display: flex; flex-direction: column; gap: 20px; min-height: 280px; outline: 1px solid transparent; transition: outline-color .2s; }
a.grant:hover { color: var(--ink); outline-color: var(--line); }
.grant-top { display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 12px; }
.grant-top span:first-child { color: var(--accent); }
.grant-title { font-family: var(--serif); font-weight: 300; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2; letter-spacing: -.01em; flex: 1; text-wrap: pretty; }
.grant-ref { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* Team */
.team { margin: 64px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); border-top: 1px solid var(--line); }
.team li { padding: 22px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.team-name { font-size: 18px; font-weight: 500; }
.team-role { font-size: 14px; color: var(--muted); }

/* Publications band */
.pubs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; gap: 16px 64px; align-items: center; padding: 40px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (max-width: 760px) { .pubs { grid-template-columns: 1fr; } }
.pubs-text { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.015em; }
.pubs-arrow { font-size: 28px; }

/* Contact */
.contact { padding-bottom: clamp(96px, 10vw, 140px); }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 48px 64px; align-items: end; }
.contact-grid h2 { margin-top: 24px; font-size: clamp(40px, 5vw, 72px); }
.contact .section-intro { margin-top: 28px; max-width: 540px; }
.contact .btn { margin-top: 36px; }
.partners { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.partners li { padding: 18px 0; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.partners li.head { padding: 16px 0; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* Footer */
.footer { border-top: 1px solid var(--line); }
.footer .wrap { padding-top: 32px; padding-bottom: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 24px; font-size: 14px; color: var(--muted); }
.footer-col { display: flex; flex-direction: column; gap: 6px; }
.footer-id { flex-direction: row; align-items: flex-start; gap: 18px; }
.footer-logos { display: flex; align-items: center; gap: 14px; flex: none; padding-top: 2px; }
.footer-logo-sep { width: 1px; height: 32px; background: var(--line); }
.footer-agh { color: var(--ink); opacity: .85; line-height: 0; }
.footer-agh:hover { color: var(--ink); opacity: 1; }
.agh-sign { display: block; height: 40px; width: auto; }
.footer-brand { color: var(--ink); font-weight: 500; letter-spacing: .18em; }
.footer-mark { display: block; width: 33px; height: 33px; flex: none; }
.footer-copy { font-family: var(--mono); font-size: 12px; align-self: end; justify-self: end; }
@media (max-width: 760px) { .footer-copy { justify-self: start; } }

/* Subpage (opus25) */
.page-hero { padding-top: clamp(56px, 8vw, 112px); }
.page-hero h1 { margin-top: 28px; max-width: 20ch; font-size: clamp(36px, 5.2vw, 72px); }
.meta-list { margin: 48px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.meta-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 8px 64px; padding: 18px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 760px) { .meta-list li { grid-template-columns: 1fr; } }
.meta-list .k { font-family: var(--mono); font-size: 13px; color: var(--muted); }
