/* MCS Research Center — site styles */
:root {
  --paper: #f4f6f2;
  --paper-2: #e9eee8;
  --ink: #13201c;
  --ink-2: #3a4a44;
  --muted: #647570;
  --line: #cfd8d1;
  --line-2: #b8c4bc;
  --green: #1e5a44;
  --green-2: #164634;
  --green-soft: #dde9e2;
  --gold: #b8922e;
  --gold-soft: #f1e6c7;
  --white: #ffffff;
  --measure: 66ch;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1160px;
  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
}

a { color: var(--green); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-2); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin: 0; color: var(--ink); }
h1 { font-size: clamp(34px, 5.2vw, 58px); line-height: 1.06; }
h2 { font-size: clamp(26px, 3.4vw, 38px); }
h3 { font-size: 22px; }
p { margin: 0; max-width: var(--measure); }
p + p { margin-top: 1em; }
ul, ol { margin: 0; padding-left: 1.2em; max-width: var(--measure); }
li + li { margin-top: 0.4em; }
strong { font-weight: 600; }
small { font-size: 14px; color: var(--muted); }

.container { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--white); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 19px; line-height: 1.1; }
.brand-sub { font-size: 12.5px; color: var(--muted); letter-spacing: 0.01em; }
.nav-links { display: flex; gap: 26px; margin: 0; padding: 0; list-style: none; }
.nav-links li { margin: 0; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-size: 15.5px; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--green); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-2); border-radius: 6px; padding: 8px 10px; font: inherit; color: var(--ink); cursor: pointer; }

/* Hero */
.hero { padding: clamp(48px, 8vw, 104px) 0 clamp(40px, 6vw, 80px); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero h1 { max-width: 15ch; }
.hero .lede { margin-top: 22px; font-size: 19px; color: var(--ink-2); max-width: 54ch; }
.hero .where { margin-top: 22px; font-size: 15px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 18px; }
.hero .where span { white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 6px; font-weight: 500; font-size: 15.5px; text-decoration: none; border: 1px solid transparent; }
.btn-solid { background: var(--green); color: var(--white); }
.btn-solid:hover { background: var(--green-2); color: var(--white); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--green); color: var(--green-2); }

/* Mesh figure */
.mesh { width: 100%; max-width: 440px; margin-inline: auto; display: block; }
.mesh .link { stroke: var(--line-2); stroke-width: 1.5; }
.mesh .router { fill: var(--paper); stroke: var(--green); stroke-width: 1.75; }
.mesh .core { fill: var(--green-soft); stroke: var(--green); stroke-width: 1; }
.mesh .pad { fill: var(--gold); }
.mesh .hot { fill: var(--gold-soft); stroke: var(--gold); }
.mesh .pkt { fill: var(--green); offset-rotate: 0deg; animation: travel 6s linear infinite; }
.mesh .pkt.b { animation-delay: -2s; }
.mesh .pkt.c { animation-delay: -4s; fill: var(--gold); }
.mesh .pkt.a { offset-path: path("M 60 60 L 170 60 L 170 170 L 280 170 L 280 280 L 390 280"); }
.mesh .pkt.b { offset-path: path("M 390 60 L 280 60 L 280 170 L 170 170 L 170 390"); }
.mesh .pkt.c { offset-path: path("M 60 390 L 60 280 L 170 280 L 280 280 L 280 170 L 390 170"); }
@keyframes travel { from { offset-distance: 0%; } to { offset-distance: 100%; } }
@media (prefers-reduced-motion: reduce) { .mesh .pkt { animation: none; offset-distance: 45%; } }
.die { width: 100%; max-width: 440px; margin-inline: auto; display: block; }
.die .die-body { fill: var(--white); stroke: var(--green); stroke-width: 1.75; }
.die .pins path { stroke: var(--line-2); stroke-width: 2.5; stroke-linecap: round; }
.die .blocks rect { fill: var(--green-soft); stroke: var(--green); stroke-width: 1; }
.die .blocks text { font-family: var(--sans); font-size: 15px; font-weight: 500; fill: var(--green-2); text-anchor: middle; }
.die .blocks text.sub { font-size: 12.5px; font-weight: 400; fill: var(--muted); }
.die .bus path { stroke: var(--gold); stroke-width: 3; stroke-linecap: round; }
.die .bus circle { fill: var(--gold); }
.mesh-caption { margin-top: 10px; font-size: 13.5px; color: var(--muted); text-align: center; }

/* Sections */
.section { padding: clamp(48px, 7vw, 96px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(20px, 4vw, 64px); align-items: start; }
.section-head h2 { max-width: 16ch; }
.section-head .lead { font-size: 18px; color: var(--ink-2); }
.stack > * + * { margin-top: 1em; }
.note { border-left: 3px solid var(--gold); padding: 10px 16px; background: var(--white); color: var(--ink-2); font-size: 15.5px; max-width: var(--measure); }

/* Definition rows (research areas, people facts) */
.rows { margin-top: clamp(28px, 4vw, 48px); border-top: 1px solid var(--line-2); }
.row { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(16px, 3vw, 48px); padding: 26px 0; border-bottom: 1px solid var(--line); }
.row h3 { font-size: 21px; }
.row .kw { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.kw span { font-size: 13px; color: var(--green-2); background: var(--green-soft); padding: 3px 9px; border-radius: 4px; }
.row p { color: var(--ink-2); }

/* Projects / manuscripts */
.pubs { list-style: none; padding: 0; margin: clamp(28px, 4vw, 48px) 0 0; max-width: none; border-top: 1px solid var(--line-2); }
.pub { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 20px 32px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.pub .meta { font-size: 14px; color: var(--muted); line-height: 1.5; }
.pub .meta b { display: block; color: var(--ink); font-weight: 600; font-family: var(--serif); font-size: 18px; }
.pub .title { font-weight: 500; font-size: 18px; color: var(--ink); max-width: 72ch; }
.pub .desc { margin-top: 6px; color: var(--ink-2); font-size: 16px; }
.pub .links { margin-top: 8px; font-size: 14.5px; display: flex; flex-wrap: wrap; gap: 16px; }
.status { display: inline-block; font-size: 12.5px; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--white); margin-top: 6px; }
.status.live { border-color: var(--green); color: var(--green-2); background: var(--green-soft); }

/* People */
.person { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(20px, 4vw, 64px); }
.person .card { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
.person .card h3 { font-size: 24px; }
.person .card .role { color: var(--ink-2); margin-top: 4px; }
.person .card dl { margin: 18px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 15px; }
.person .card dt { color: var(--muted); }
.person .card dd { margin: 0; }
.person .card dd a { word-break: break-all; }
.facts { margin-top: 28px; border-top: 1px solid var(--line-2); }
.facts .row { padding: 18px 0; }
.facts .row h3 { font-family: var(--sans); font-weight: 500; font-size: 16px; color: var(--muted); }
.facts ul { list-style: none; padding: 0; }
.facts li + li { margin-top: 10px; }
.facts li span { display: block; font-size: 14.5px; color: var(--muted); }

/* Contact / footer */
.contact { background: var(--green); color: #e8f0eb; }
.contact h2, .contact a { color: var(--white); }
.contact .section-head .lead { color: #cfe0d6; }
.contact .mail { font-family: var(--serif); font-size: clamp(22px, 3vw, 32px); text-decoration-color: var(--gold); }
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; font-size: 14px; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.site-footer a { color: var(--ink-2); }
.site-footer .legal { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }

/* Page header for inner pages */
.page-head { padding: clamp(40px, 6vw, 72px) 0 clamp(28px, 4vw, 48px); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(32px, 4.5vw, 50px); max-width: 18ch; }
.page-head p { margin-top: 16px; font-size: 18px; color: var(--ink-2); }

@media (max-width: 900px) {
  .hero-grid, .section-head, .row, .person, .footer-grid { grid-template-columns: 1fr; }
  .hero-grid { gap: 32px; }
  .mesh { max-width: 360px; }
  .pub { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-links { display: none; position: absolute; left: 0; right: 0; top: 68px; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px; }
  .nav-links a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .nav-links a[aria-current="page"] { border-bottom-color: var(--green); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: inline-block; }
  .btn { width: 100%; justify-content: center; }
}
