/* Layout: one narrow column like a datasheet; header block, research areas, project entries with a spec line, member roster. */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --fg: #14202e;
  --muted: #56657a;
  --line: #d9e1ec;
  --chip: #0d4c8f;        /* package blue from the logo */
  --chip-soft: #e6eef8;
  --segment: #d8262f;     /* seven segment red from the logo, used sparingly */
  --font-display: "Chakra Petch", "IBM Plex Sans", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d141d; --surface: #131c28; --fg: #e3e9f2; --muted: #93a2b7;
    --line: #243246; --chip: #7fb0ea; --chip-soft: #18283c; --segment: #ff5a5f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d141d; --surface: #131c28; --fg: #e3e9f2; --muted: #93a2b7;
  --line: #243246; --chip: #7fb0ea; --chip-soft: #18283c; --segment: #ff5a5f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
}
.wrap {
  max-width: 52rem;
  margin: 0 auto;
  padding-inline: 1.25rem;
  padding-block: 3rem 2rem;
  display: grid;
  gap: 3.5rem;
}
a { color: var(--chip); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--segment); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; text-wrap: balance; margin: 0; }
p { margin: 0; }

/* Header */
header { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: center; }
header img { width: 6.5rem; height: 6.5rem; }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); color: var(--chip); }
h1 span { color: var(--segment); }
.lead { margin-top: 0.75rem; max-width: 40rem; color: var(--fg); }
@media (max-width: 34rem) {
  header { grid-template-columns: 1fr; }
  header img { width: 5rem; height: 5rem; }
}

/* Section headings with a pin row, echoing the chip package in the logo */
section { display: grid; gap: 1.25rem; }
h2 {
  font-size: 1.35rem; display: flex; align-items: center; gap: 0.75rem;
}
h2::after {
  content: ""; flex: 1; height: 6px;
  background: repeating-linear-gradient(90deg, var(--line) 0 10px, transparent 10px 18px);
}

/* Research areas */
.areas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.area { border-top: 3px solid var(--chip); padding-top: 0.75rem; display: grid; gap: 0.35rem; align-content: start; }
.area h3 { font-size: 1rem; }
.area p { color: var(--muted); font-size: 0.93rem; }
@media (max-width: 40rem) { .areas { grid-template-columns: 1fr; } }

/* Projects */
.projects { display: grid; gap: 1rem; }
.project {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 1.25rem 1.35rem; display: grid; gap: 0.7rem; min-width: 0;
}
.project-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; }
.project h3 { font-size: 1.15rem; }
.people { font-size: 0.93rem; color: var(--muted); }
.people a { font-weight: 500; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em;
  padding: 0.12rem 0.5rem; border-radius: 3px; background: var(--chip-soft); color: var(--chip);
}
.tag.kind { background: transparent; border: 1px solid var(--segment); color: var(--segment); }
.project p { max-width: 65ch; }
.result { font-size: 0.93rem; color: var(--muted); }
.result strong { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.spec {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1rem;
  border-top: 1px dashed var(--line); padding-top: 0.7rem;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted);
}
.spec .stack { min-width: 0; overflow-wrap: anywhere; }
.repo { font-weight: 500; white-space: nowrap; }

/* Members */
.roster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.25rem 2rem; list-style: none; margin: 0; padding: 0; }
.roster li { display: flex; justify-content: space-between; gap: 1rem; padding-block: 0.45rem; border-bottom: 1px solid var(--line); }
.roster .handle { font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); white-space: nowrap; }
.roster-label { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.members { display: grid; gap: 1.5rem; }
.members > div { display: grid; gap: 0.5rem; }
@media (max-width: 40rem) { .roster { grid-template-columns: 1fr; } }

footer {
  border-top: 1px solid var(--line); padding-top: 1.25rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem;
  font-size: 0.88rem; color: var(--muted);
}

/* Site navigation */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-weight: 600; color: var(--chip); text-decoration: none; }
.brand img { width: 2rem; height: 2rem; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: 0.95rem; }
.topbar nav a { text-decoration: none; color: var(--muted); padding-block: 0.2rem; border-bottom: 2px solid transparent; }
.topbar nav a:hover { color: var(--fg); }
.topbar nav a[aria-current="page"] { color: var(--chip); border-bottom-color: var(--segment); }
.wrap > .topbar + * { margin-top: -1.5rem; }

/* Research page */
.prose { display: grid; gap: 0.9rem; max-width: 65ch; }
.layers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.layers > div { border-top: 3px solid var(--chip); padding-top: 0.75rem; display: grid; gap: 0.35rem; align-content: start; }
.layers h3 { font-size: 1rem; }
.layers p { font-size: 0.93rem; color: var(--muted); }
@media (max-width: 40rem) { .layers { grid-template-columns: 1fr; } }
.method { display: grid; gap: 1rem; }
.method > div { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1.1rem 1.25rem; display: grid; gap: 0.5rem; min-width: 0; }
.method h3 { font-size: 1.05rem; }
.method ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.3rem; }
.notation { background: var(--chip-soft); border-radius: 6px; padding: 0.9rem 1.1rem; font-size: 0.95rem; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.15rem; display: grid; gap: 0.45rem; align-content: start; min-width: 0; }
.metric-head { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.metric-head .abbr { font-family: var(--font-mono); font-weight: 500; color: var(--segment); }
.metric-head h3 { font-size: 0.98rem; }
.metric .eq { overflow-x: auto; overflow-y: hidden; padding-block: 0.15rem; }
.metric p { font-size: 0.9rem; color: var(--muted); }
@media (max-width: 44rem) { .metrics { grid-template-columns: 1fr; } }
mjx-container { color: var(--fg); }


/* Research page, extended */
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2.5rem; }
.two-col h3 { font-size: 1.02rem; }
.plain { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.25rem; }
@media (max-width: 44rem) { .two-col { grid-template-columns: 1fr; } }
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.steps li { counter-increment: step; display: block; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 0.85rem 1rem 1rem; font-size: 0.95rem; line-height: 1.5; }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; margin-bottom: 0.35rem; font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; letter-spacing: 0.06em; color: var(--segment); }
.steps strong { color: var(--chip); font-weight: 600; }
@media (max-width: 52rem) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 34rem) { .steps { grid-template-columns: 1fr; } }
.caption { font-size: 0.88rem; color: var(--muted); max-width: 65ch; }
.stack { display: grid; gap: 0.6rem; }
.layer { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.1rem; }
.layer-name { font-family: var(--font-display); font-weight: 600; color: var(--chip); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips li { font-size: 0.86rem; padding: 0.2rem 0.6rem; border-radius: 3px; background: var(--chip-soft); }
@media (max-width: 40rem) { .layer { grid-template-columns: 1fr; gap: 0.5rem; } }
.examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.example { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.1rem; display: grid; gap: 0.55rem; align-content: start; min-width: 0; }
.example h3 { font-size: 1.02rem; }
.ex-kind { font-size: 0.88rem; color: var(--muted); }
.ex-step { display: grid; gap: 0.25rem; min-width: 0; }
.ex-label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ex-label.ax { color: var(--segment); }
.example pre { margin: 0; overflow-x: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 0.55rem 0.7rem; font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.5; }
.ex-note { font-size: 0.88rem; }
.cores { display: grid; gap: 4px; width: max-content; }
.cores.c4 { grid-template-columns: repeat(4, 1.1rem); }
.cores.c3 { grid-template-columns: repeat(3, 1.1rem); }
.cores i { display: block; width: 1.1rem; height: 1.1rem; border-radius: 2px; background: var(--chip); }
.cores.c3 i { opacity: 0.6; }
@media (max-width: 44rem) { .examples { grid-template-columns: 1fr; } }
.fronts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 2rem; }
.fronts article { display: grid; gap: 0.35rem; align-content: start; border-top: 3px solid var(--chip); padding-top: 0.75rem; }
.fronts h3 { font-size: 1.02rem; }
.fronts p { font-size: 0.95rem; }
@media (max-width: 44rem) { .fronts { grid-template-columns: 1fr; } }
.map { margin: 0; display: grid; gap: 0.5rem; overflow-x: auto; }
.map svg { width: 100%; max-width: 40rem; min-width: 30rem; height: auto; justify-self: center; }
.map .nodes rect { fill: var(--surface); stroke: var(--chip); stroke-width: 1.2; }
.map .nt { fill: var(--fg); font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.map .ns { fill: var(--muted); font-family: var(--font-body); font-size: 11.5px; }
.map .e { fill: none; stroke: var(--chip); stroke-width: 1.6; }
.map .e.d { stroke: var(--muted); stroke-dasharray: 5 4; }
.map .el { fill: var(--muted); font-family: var(--font-mono); font-size: 10.5px; }
.map figcaption { font-size: 0.85rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; justify-content: center; }
.key { display: inline-block; width: 1.8rem; height: 0; border-top: 2px solid var(--chip); margin-left: 0.6rem; }
.key.dashed { border-top: 2px dashed var(--muted); }
.refs { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.45rem; font-size: 0.92rem; max-width: 70ch; }

/* Faculty roles stay readable and wrap on narrow screens */
.roster.faculty .handle { white-space: normal; text-align: right; }

/* Simulators page */
.glance { overflow-x: auto; }
.glance table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.glance th { text-align: left; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 0.4rem 0.75rem 0.4rem 0; border-bottom: 2px solid var(--line); }
.glance td { padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.glance td:first-child a { font-weight: 600; white-space: nowrap; }
.glance td:last-child { white-space: nowrap; color: var(--muted); font-family: var(--font-mono); font-size: 0.82rem; }
.sim { scroll-margin-top: 1rem; }
.shot { margin: 0; border: 1px solid var(--line); border-radius: 4px; background: #ffffff; padding: 0.5rem; }
.shot img { display: block; width: 100%; height: auto; }
.sim .plain { font-size: 0.95rem; max-width: 65ch; }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.btn-open { font-family: var(--font-body); font-weight: 600; font-size: 0.85rem; text-decoration: none; color: #ffffff; background: var(--chip); border-radius: 4px; padding: 0.3rem 0.8rem; white-space: nowrap; }
.btn-open:hover { background: var(--segment); }
:root[data-theme="dark"] .btn-open { color: #0d141d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-open { color: #0d141d; } }
.teaser { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1.1rem 1.35rem; display: grid; gap: 0.6rem; }
.teaser ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.2rem; }
.project { scroll-margin-top: 1rem; }
