/* ==========================================================================
   simon_schaefer — site stylesheet
   Hand-written, no build step. Sections:
   1 fonts · 2 tokens · 3 base · 4 nav · 5 hero · 6 scene · 7 sections
   8 about · 9 research · 10 publications · 11 software · 12 rows
   13 contact · 14 footer · 15 legal page · 16 print
   ========================================================================== */

/* 1 — fonts (self-hosted, no third-party requests) ----------------------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/Inter-Italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/Inter-Medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/Inter-Bold.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/JetBrainsMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/JetBrainsMono-Medium.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/JetBrainsMono-Bold.woff2") format("woff2"); }

/* 2 — tokens ------------------------------------------------------------- */
/* Light theme: datasheet paper. Dark theme: solder mask and copper. */
:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --maxw: 70rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 10px;

  --bg: #f5f3ec;
  --bg-raised: #fffdf8;
  --bg-sunken: #ebe8dd;
  --ink: #16201b;
  --ink-2: #45514b;
  --ink-3: #5c6761;
  --line: #d9d4c5;
  --line-strong: #bcb6a3;
  --copper: #a04e16;
  --on-copper: #fffaf4;
  --mask: #0b7446;
  --signal: #1c5bb8;
  --amber: #946000;
  --dot: rgba(22, 32, 27, 0.075);
  --chip: #1c211f;
  --chip-ink: #cfd7d2;
  --pin: #b9bec2;
  --pin-dark: #8b9196;

  --scene-bg: #fbfaf5;
  --scene-grid: #ece8db;
  --scene-road: #e9e5d8;
  --scene-mark: #a8a18c;
  --scene-body: #7f8a84;
  --c-track: #0b7446;
  --c-lidar: #b07400;
  --c-ssl: #b4551a;
  --c-v2x: #1c5bb8;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1410;
    --bg-raised: #101d18;
    --bg-sunken: #070e0b;
    --ink: #e7efe9;
    --ink-2: #b6c4bc;
    --ink-3: #8b9b92;
    --line: #1c3129;
    --line-strong: #2c4a3f;
    --copper: #e59d5e;
    --on-copper: #1b0f05;
    --mask: #3ecf8e;
    --signal: #74abff;
    --amber: #f0b84a;
    --dot: rgba(231, 239, 233, 0.055);
    --chip: #050908;
    --chip-ink: #aebbb4;
    --pin: #aab2ae;
    --pin-dark: #6f7975;

    --scene-bg: #07100d;
    --scene-grid: #10201a;
    --scene-road: #12221c;
    --scene-mark: #3d5c50;
    --scene-body: #6b8177;
    --c-track: #3ecf8e;
    --c-lidar: #f0b84a;
    --c-ssl: #e59d5e;
    --c-v2x: #74abff;
  }
}

:root[data-theme="dark"] {
  --bg: #0a1410;
  --bg-raised: #101d18;
  --bg-sunken: #070e0b;
  --ink: #e7efe9;
  --ink-2: #b6c4bc;
  --ink-3: #8b9b92;
  --line: #1c3129;
  --line-strong: #2c4a3f;
  --copper: #e59d5e;
  --on-copper: #1b0f05;
  --mask: #3ecf8e;
  --signal: #74abff;
  --amber: #f0b84a;
  --dot: rgba(231, 239, 233, 0.055);
  --chip: #050908;
  --chip-ink: #aebbb4;
  --pin: #aab2ae;
  --pin-dark: #6f7975;

  --scene-bg: #07100d;
  --scene-grid: #10201a;
  --scene-road: #12221c;
  --scene-mark: #3d5c50;
  --scene-body: #6b8177;
  --c-track: #3ecf8e;
  --c-lidar: #f0b84a;
  --c-ssl: #e59d5e;
  --c-v2x: #74abff;
}

/* 3 — base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font: 400 1.0625rem/1.65 var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

[hidden] { display: none !important; }

h1, h2, h3, h4 { margin: 0; line-height: 1.2; text-wrap: balance; }
p { margin: 0 0 1em; }
img, svg, canvas { max-width: 100%; }
ul, ol { margin: 0; padding: 0; }

a {
  color: var(--copper);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 2px; }

/* A link that leaves the site says so with an arrow. Every absolute address counts, so
   the links themselves need nothing. The narrow no-break space keeps the arrow on the
   line of the last word, and the empty text after the slash keeps screen readers from
   reading it out. Contact pins carry it on their label, in front of the pin number. */
a[href^="http://"]:not(.pin)::after,
a[href^="https://"]:not(.pin)::after,
a.pin[href^="http"] .pin__label::after {
  content: "\202F\2197";
  content: "\202F\2197" / "";
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--copper); color: var(--on-copper); }

code, pre, kbd { font-family: var(--font-mono); }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 0.9rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: 600 0.95rem/1.2 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--copper); color: var(--copper); }
.btn--primary {
  background: var(--copper);
  border-color: var(--copper);
  color: var(--on-copper);
}
.btn--primary:hover { color: var(--on-copper); filter: brightness(1.08); }

.kw { color: var(--copper); }

/* 4 — nav ---------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 0.5rem 1rem;
  min-height: 3.25rem;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font: 500 0.875rem/1 var(--font-mono);
  text-decoration: none;
  white-space: nowrap;
}

.led {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--mask);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mask) 22%, transparent);
}

.nav__links {
  display: flex;
  gap: 0.1rem;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav__links::-webkit-scrollbar { display: none; }
/* Where the links do not fit they scroll sideways. site.js notes in data-more on which
   side more of them wait, and that edge fades out. The scroll padding keeps a link that
   gets the keyboard focus out of the faded part. */
.nav__links {
  --fade: 2.25rem;
  scroll-padding-inline: var(--fade);
}
.nav__links[data-more="left"] {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade));
  mask-image: linear-gradient(to right, transparent, #000 var(--fade));
}
.nav__links[data-more="right"] {
  -webkit-mask-image: linear-gradient(to left, transparent, #000 var(--fade));
  mask-image: linear-gradient(to left, transparent, #000 var(--fade));
}
.nav__links[data-more="left right"] {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
}

.nav__links a {
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  color: var(--ink-2);
  font: 400 0.8125rem/1 var(--font-mono);
  text-decoration: none;
  white-space: nowrap;
}
.nav__links a:hover { color: var(--ink); background: var(--bg-sunken); }
.nav__links a[aria-current="true"] { color: var(--copper); }

/* theme toggle, built like a DIP switch */
.dip-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.35rem;
  border: 0;
  background: none;
  color: var(--ink-3);
  font: 500 0.6875rem/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.dip-switch__track {
  position: relative;
  width: 2.1rem;
  height: 1.15rem;
  border-radius: 3px;
  background: var(--chip);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.dip-switch__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 0.8rem;
  height: calc(100% - 6px);
  border-radius: 2px;
  background: #f1f1ec;
  transition: translate 0.15s ease;
}
.dip-switch[aria-pressed="true"] .dip-switch__knob { translate: 0.95rem 0; background: var(--copper); }

@media (max-width: 52rem) {
  .nav__inner { flex-wrap: wrap; padding-block: 0.5rem 0.35rem; }
  .dip-switch { margin-left: auto; }
  .nav__links {
    order: 3;
    flex-basis: 100%;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: calc(var(--gutter) - 0.55rem);
  }
}

/* 5 — hero --------------------------------------------------------------- */
.hero {
  position: relative;
  padding: clamp(2.25rem, 7vw, 5rem) 0 clamp(2.5rem, 6vw, 4rem);
  background-image: radial-gradient(circle at 1px 1px, var(--dot) 1.2px, transparent 1.6px);
  background-size: 22px 22px;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 7rem;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2rem clamp(2rem, 6vw, 5rem);
}

.prompt {
  margin: 0 0 1rem;
  color: var(--ink-3);
  font: 400 0.875rem/1.4 var(--font-mono);
}
.prompt__sigil { color: var(--copper); font-weight: 700; margin-right: 0.35em; }

.hero h1 {
  font-size: clamp(2.9rem, 8vw, 5.25rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero__role {
  margin: 1.1rem 0 0;
  color: var(--ink-2);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.45;
}

.hero__lede {
  margin: 1.4rem 0 0;
  max-width: 34em;
  font-size: clamp(1.15rem, 2.1vw, 1.375rem);
  line-height: 1.5;
}

.nodeinfo {
  margin: 1.75rem 0 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 2px solid var(--line-strong);
  font: 400 0.8125rem/1.9 var(--font-mono);
}
.nodeinfo > div { display: grid; grid-template-columns: 7.2rem minmax(0, 1fr); }
.nodeinfo dt { color: var(--ink-3); }
.nodeinfo dd { margin: 0; display: flex; flex-wrap: wrap; gap: 0 1rem; color: var(--ink-2); }
.nodeinfo a { text-decoration: none; }
.nodeinfo a:hover { text-decoration: underline; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 2rem 0 0; }

/* portrait, packaged as an IC */
.chip-portrait { margin: 0; text-align: center; }
.chip-portrait__pkg {
  position: relative;
  width: clamp(11.5rem, 25vw, 17.5rem);
  aspect-ratio: 1;
  margin-inline: auto;
  isolation: isolate;
}
.chip-portrait__pkg::before,
.chip-portrait__pkg::after {
  content: "";
  position: absolute;
  z-index: 0;
}
.chip-portrait__pkg::before {
  inset: 13% -0.6rem;
  /* one pin per tile, tiles rounded to a whole number so no pin is cut off */
  background: linear-gradient(to bottom, transparent 29%, var(--pin) 29% 71%, transparent 71%) 0 0 / 100% 1rem round;
}
.chip-portrait__pkg::after {
  inset: -0.6rem 13%;
  background: linear-gradient(to right, transparent 29%, var(--pin) 29% 71%, transparent 71%) 0 0 / 1rem 100% round;
}
.chip-portrait__body {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 0.8rem;
  border-radius: 12px;
  background: var(--chip);
  box-shadow: 0 0 0 1px var(--line-strong), 0 18px 40px -18px rgba(0, 0, 0, 0.55);
}
.chip-portrait__body::before {
  content: "";
  position: absolute;
  top: 0.27rem;
  left: 0.27rem;
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 50%;
  background: var(--chip-ink);
  opacity: 0.7;
}
.chip-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.chip-portrait figcaption {
  margin-top: 1.35rem;
  color: var(--ink-3);
  font: 500 0.6875rem/1 var(--font-mono);
  letter-spacing: 0.1em;
}

@media (max-width: 46rem) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .chip-portrait { order: -1; justify-self: start; margin-left: 0.6rem; }
  .chip-portrait__pkg { width: 8.5rem; margin-inline: 0; }
  .chip-portrait__body { padding: 0.5rem; border-radius: 9px; }
  .chip-portrait figcaption { text-align: left; }
  .nodeinfo > div { grid-template-columns: minmax(0, 1fr); margin-bottom: 0.35rem; line-height: 1.6; }
  /* Where the links wrap, the lines are 24 px apart, far enough for a finger. */
  .nodeinfo dd { row-gap: 0.25rem; }
}

/* 6 — scene (the "rviz" panel) ------------------------------------------- */
.scene {
  margin: clamp(2.25rem, 6vw, 3.75rem) 0 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--scene-bg);
  overflow: hidden;
}
.scene__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--ink-3);
  font: 400 0.75rem/1.5 var(--font-mono);
}
.scene__bar b { color: var(--ink-2); font-weight: 500; }
.scene__ctl { display: inline-flex; align-items: center; gap: 0.9rem; margin-left: auto; }
.scene__btn {
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  cursor: pointer;
}
.scene__btn:hover { border-color: var(--copper); color: var(--copper); }
.scene__canvas {
  display: block;
  width: 100%;
  height: clamp(230px, 30vw, 340px);
}
.scene__cap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 1.75rem;
  padding: 0.7rem 0.85rem 0.8rem;
  border-top: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--ink-2);
  font-size: 0.875rem;
  line-height: 1.5;
}
.scene__cap p { margin: 0; flex: 1 1 24rem; }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  list-style: none;
  font: 400 0.75rem/1.6 var(--font-mono);
}
.key {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.4rem;
  vertical-align: -0.06rem;
  border-radius: 2px;
}
.key--track { border: 2px solid var(--c-track); }
.key--lidar { background: var(--c-lidar); border-radius: 50%; }
.key--ssl { background: var(--c-ssl); }
.key--v2x { border: 2px solid var(--c-v2x); border-radius: 50%; }

/* 7 — sections ----------------------------------------------------------- */
.section {
  padding: clamp(3.25rem, 8vw, 6rem) 0;
  border-top: 1px solid var(--line);
}

.ns {
  margin: 0 0 0.6rem;
  color: var(--ink-3);
  font: 400 0.8125rem/1.5 var(--font-mono);
}
.ns--close { margin: clamp(2.25rem, 5vw, 3.25rem) 0 0; }

.section h2 {
  margin-bottom: 1.25rem;
  font-size: clamp(2rem, 4.6vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.lede {
  max-width: 40em;
  margin-bottom: 0;
  color: var(--ink-2);
  font-size: clamp(1.1rem, 1.8vw, 1.25rem);
  line-height: 1.55;
}

/* sub-heading: a solder pad with a trace running off to the right */
.sub {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: clamp(2.5rem, 6vw, 3.5rem) 0 1.5rem;
  color: var(--ink-2);
  font: 500 0.8125rem/1.3 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.sub::before {
  content: "";
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  border: 2.5px solid var(--copper);
  border-radius: 50%;
}
.sub::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}

.prose p { max-width: 40em; }
.prose p:last-child { margin-bottom: 0; }

/* timeline: a copper trace with vias */
.trace { list-style: none; }
.trace__item {
  display: grid;
  grid-template-columns: 7.5rem 1.25rem minmax(0, 1fr);
  column-gap: 1.1rem;
  padding-bottom: 1.85rem;
}
.trace__item:last-child { padding-bottom: 0; }
.trace__when {
  padding-top: 0.14rem;
  color: var(--ink-3);
  font: 500 0.8125rem/1.5 var(--font-mono);
  text-align: right;
}
.trace__via { position: relative; }
.trace__via::before {
  content: "";
  position: absolute;
  top: 0.4rem;
  bottom: -2.25rem;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: color-mix(in srgb, var(--copper) 45%, var(--line));
}
.trace__item:last-child .trace__via::before { display: none; }
.trace__via::after {
  content: "";
  position: absolute;
  top: 0.3rem;
  left: 50%;
  width: 0.85rem;
  height: 0.85rem;
  margin-left: -0.425rem;
  border: 2.5px solid var(--copper);
  border-radius: 50%;
  background: var(--bg);
}
.trace__what h4 { font-size: 1.0625rem; font-weight: 600; line-height: 1.4; }
.trace__where { margin: 0.1rem 0 0; color: var(--ink-2); font-size: 0.9375rem; }
.trace__what p:not(.trace__where) {
  max-width: 42em;
  margin: 0.45rem 0 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.6;
}

@media (max-width: 40rem) {
  .trace__item { grid-template-columns: 1.1rem minmax(0, 1fr); column-gap: 0.85rem; }
  .trace__when { grid-column: 2; grid-row: 1; padding-top: 0; text-align: left; }
  .trace__via { grid-column: 1; grid-row: 1 / span 2; }
  .trace__what { grid-column: 2; grid-row: 2; }
}

/* 8 — about -------------------------------------------------------------- */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: start;
  gap: 2rem clamp(2rem, 5vw, 4rem);
}
@media (max-width: 56rem) { .about__grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 26rem) { .term { font-size: 0.75rem; } }

.term {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-sunken);
  overflow: hidden;
  font: 400 0.8125rem/1.65 var(--font-mono);
}
.term__bar {
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--ink-3);
}
.term__body {
  margin: 0;
  padding: 0.9rem;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.term .k { color: var(--signal); }
.term .v { color: var(--ink); }
.term .c { color: var(--ink-3); font-style: normal; }
.term .n { color: var(--mask); }

.refs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  list-style: none;
}
.ref {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
}
.ref h4 { font-size: 1rem; font-weight: 600; }
.ref p { margin: 0.3rem 0 0; color: var(--ink-2); font-size: 0.9rem; line-height: 1.5; }
.ref__rel { color: var(--ink-3); font: 400 0.75rem/1.5 var(--font-mono); }

/* 9 — research ----------------------------------------------------------- */
.graph {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 5.5rem minmax(0, 1fr) 4.5rem minmax(0, 1.1fr);
  align-items: center;
  margin: clamp(2rem, 5vw, 3rem) 0 0;
  padding: clamp(1rem, 3vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-raised);
}
.graph__col { display: grid; gap: 0.6rem; }
.node {
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--node, var(--line-strong));
  border-radius: 999px;
  background: var(--bg);
  text-align: center;
}
.node__name { display: block; color: var(--ink); font: 500 0.8125rem/1.35 var(--font-mono); }
.node__desc { display: block; margin-top: 0.1rem; color: var(--ink-2); font-size: 0.78rem; line-height: 1.35; }
.node--ssl { --node: var(--c-ssl); }
.node--lidar { --node: var(--c-lidar); }
.node--v2x { --node: var(--c-v2x); }
.node--fusion { --node: var(--c-track); border-width: 2px; border-radius: 16px; padding-block: 1.1rem; }
.node--out { border-radius: 16px; padding-block: 1.1rem; }

.graph__wire {
  position: relative;
  align-self: stretch;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font: 400 0.6875rem/1.3 var(--font-mono);
  text-align: center;
}
.graph__wire span { position: relative; z-index: 1; padding: 0.1rem 0.25rem; background: var(--bg-raised); }
.graph__wire::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 5px;
  left: 0;
  height: 1.5px;
  background: var(--ink-3);
}
.graph__wire::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 0;
  height: 0;
  margin-top: -4px;
  border: 4.5px solid transparent;
  border-left: 7px solid var(--ink-3);
  border-right: 0;
}
.graph figcaption {
  grid-column: 1 / -1;
  margin-top: 1.1rem;
  color: var(--ink-3);
  font-size: 0.85rem;
  line-height: 1.5;
}

@media (max-width: 50rem) {
  .graph { grid-template-columns: minmax(0, 1fr); }
  .graph__wire { height: 3rem; }
  .graph__wire::before {
    top: 0;
    right: auto;
    bottom: 5px;
    left: 50%;
    width: 1.5px;
    height: auto;
    margin-left: -0.75px;
    background: var(--ink-3);
  }
  .graph__wire::after {
    top: auto;
    right: auto;
    bottom: 0;
    left: 50%;
    margin: 0 0 0 -4.5px;
    border: 4.5px solid transparent;
    border-top: 7px solid var(--ink-3);
    border-bottom: 0;
  }
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 1rem;
  list-style: none;
}
.card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.25rem 1.1rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--node, var(--line-strong));
  border-radius: var(--radius);
  background: var(--bg-raised);
}
.card--ssl { --node: var(--c-ssl); }
.card--lidar { --node: var(--c-lidar); }
.card--fusion { --node: var(--c-track); }
.card h4 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }
.card p { margin: 0.6rem 0 0; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.6; }
.card__refs {
  margin-top: auto !important;
  padding-top: 1rem;
  color: var(--ink-3) !important;
  font: 400 0.75rem/1.7 var(--font-mono) !important;
}
.card__refs a { white-space: nowrap; }

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1rem;
  list-style: none;
}
.project {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.project__kind { margin: 0 0 0.4rem; color: var(--ink-3); font: 400 0.75rem/1.5 var(--font-mono); }
.project h4 { font-size: 1.125rem; font-weight: 600; }
.project p:not(.project__kind) { margin: 0.55rem 0 0; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.6; }

/* 10 — publications ------------------------------------------------------ */
.pubs__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin: 2rem 0 0.5rem;
}
.filter { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.filter button {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: 500 0.78rem/1 var(--font-mono);
  cursor: pointer;
}
.filter button:hover { border-color: var(--copper); color: var(--copper); }
.filter button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.filter sup { margin-left: 0.3em; font-size: 0.85em; vertical-align: 0.1em; }
.pubs__profiles { margin: 0; color: var(--ink-3); font: 400 0.78rem/1.6 var(--font-mono); }

.pubs__year {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  column-gap: 3.45rem;
  border-top: 1px solid var(--line);
}
.pubs__year[hidden] { display: none; }
.pubs__year > h3 {
  position: sticky;
  top: 4.5rem;
  align-self: start;
  padding-top: 1.2rem;
  color: var(--ink-3);
  font: 700 1.5rem/1 var(--font-mono);
  letter-spacing: -0.02em;
  text-align: right;
}
.pubs__list { list-style: none; }
.pub { padding: 1.25rem 0; }
.pub + .pub { border-top: 1px dashed var(--line); }
.pub[hidden] { display: none; }

.tag {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.22rem 0.45rem;
  border: 1px solid currentColor;
  border-radius: 4px;
  font: 500 0.6563rem/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tag--journal { color: var(--mask); }
.tag--conference { color: var(--signal); }
.tag--preprint { color: var(--amber); }
.tag--thesis { color: var(--copper); }
.tag--data { color: var(--ink-3); }

.pub__title { font-size: 1.0938rem; font-weight: 600; line-height: 1.4; letter-spacing: -0.005em; }
.pub__title a { color: var(--ink); text-decoration: none; }
.pub__title a:hover { color: var(--copper); text-decoration: underline; }
.pub__authors, .pub__venue {
  max-width: 48em;
  margin: 0.35rem 0 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.55;
}
.pub__authors b { color: var(--ink); font-weight: 600; }
.pub__actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.4rem; margin-top: 0.75rem; }
.pub__actions > a,
.bib > summary {
  display: block;
  width: fit-content;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink-2);
  font: 500 0.75rem/1 var(--font-mono);
  text-decoration: none;
  cursor: pointer;
  list-style: none;
}
.bib > summary::-webkit-details-marker { display: none; }
.pub__actions > a:hover,
.bib > summary:hover { border-color: var(--copper); color: var(--copper); }
.bib[open] { order: 9; flex-basis: 100%; }
.bib[open] > summary { border-color: var(--copper); color: var(--copper); }
.bib__box { position: relative; margin-top: 0.5rem; }
.bib pre {
  margin: 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-sunken);
  color: var(--ink-2);
  font-size: 0.75rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}
.copy {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--bg-raised);
  color: var(--ink-2);
  font: 500 0.6875rem/1 var(--font-mono);
  cursor: pointer;
}
.copy:hover { border-color: var(--copper); color: var(--copper); }

@media (max-width: 46rem) {
  .pubs__year { grid-template-columns: minmax(0, 1fr); }
  .pubs__year > h3 { position: static; padding-top: 1.5rem; text-align: left; }
}

/* 11 — software ---------------------------------------------------------- */
.pkg-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 1.5rem clamp(1.5rem, 4vw, 3rem);
  margin-top: 2rem;
  padding: clamp(1.25rem, 3.5vw, 2rem);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--c-track);
  border-radius: 12px;
  background: var(--bg-raised);
}
@media (max-width: 52rem) { .pkg-featured { grid-template-columns: minmax(0, 1fr); } }
.pkg-featured h3 { font: 700 1.75rem/1.1 var(--font-mono); letter-spacing: -0.02em; }
.pkg-featured__sub { margin: 0.35rem 0 0; color: var(--ink-2); font-weight: 500; }
.pkg-featured p { color: var(--ink-2); font-size: 0.975rem; line-height: 1.6; }
.pkg-featured__sub + p { margin-top: 0.9rem; }
.pkg-featured .pkg__meta { margin-top: 1rem; }

.cmd { position: relative; }
.cmd pre {
  margin: 0;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-sunken);
  color: var(--ink);
  font-size: 0.8125rem;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.cmd .c { color: var(--ink-3); }

.pkgs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
  gap: 1rem;
  list-style: none;
}
.pkg {
  display: flex;
  flex-direction: column;
  padding: 1.15rem 1.2rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
}
.pkg h4 { font: 700 1rem/1.3 var(--font-mono); }
.pkg p { margin: 0.5rem 0 0; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.55; }
.pkg__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.85rem 0 0;
  list-style: none;
}
.pkg__meta li {
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-sunken);
  color: var(--ink-2);
  font: 500 0.6875rem/1.2 var(--font-mono);
}
.pkg__links {
  margin: auto 0 -0.3rem !important;
  padding-top: 0.6rem;
  font: 500 0.78rem/1.6 var(--font-mono) !important;
}
/* The padding makes each link tall enough for a finger, also where the row wraps and two
   of them end up above each other. The row gives the same amount back above and below. */
.pkg__links a { display: inline-block; margin-right: 0.9rem; padding-block: 0.3rem; white-space: nowrap; }

/* 12 — rows (teaching) --------------------------------------------------- */
.rows { margin-top: 2rem; border-top: 1px solid var(--line); list-style: none; }
.row {
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 1fr);
  gap: 0.35rem 2rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
}
.row__meta { color: var(--ink-3); font: 400 0.78rem/1.6 var(--font-mono); }
.row__meta b { display: block; color: var(--ink); font-weight: 500; }
.row h3 { font-size: 1.0938rem; font-weight: 600; line-height: 1.4; }
.row p { max-width: 44em; margin: 0.4rem 0 0; color: var(--ink-2); font-size: 0.9563rem; line-height: 1.6; }
@media (max-width: 46rem) { .row { grid-template-columns: minmax(0, 1fr); } }

.award {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 44rem;
  margin: 2rem 0 0;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  background: var(--bg-raised);
}
.award__badge {
  flex: none;
  color: var(--amber);
  font: 700 1.5rem/1 var(--font-mono);
}
.award p { margin: 0; font-size: 0.975rem; line-height: 1.5; }
.award p + p { color: var(--ink-2); font-size: 0.9rem; }

/* 13 — contact ----------------------------------------------------------- */
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 2.5rem clamp(2rem, 6vw, 5rem);
  margin-top: 2rem;
}
@media (max-width: 56rem) { .contact__grid { grid-template-columns: minmax(0, 1fr); } }
.contact__mail { margin: 1.5rem 0 0; }
.contact__mail .btn { font-family: var(--font-mono); font-weight: 500; }
.contact__note { margin: 1.25rem 0 0; color: var(--ink-3); font-size: 0.9rem; }

/* the contact options, wired up as a DIP-8 package */
.dip {
  --row: 2.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(6.5rem, 20vw, 9.5rem) minmax(0, 1fr);
  grid-template-rows: repeat(4, var(--row));
  max-width: 31rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dip__pin { display: flex; align-items: center; min-width: 0; }
.dip__pin:nth-child(1) { grid-area: 1 / 1; }
.dip__pin:nth-child(2) { grid-area: 2 / 1; }
.dip__pin:nth-child(3) { grid-area: 3 / 1; }
.dip__pin:nth-child(4) { grid-area: 4 / 1; }
.dip__pin:nth-child(5) { grid-area: 4 / 3; }
.dip__pin:nth-child(6) { grid-area: 3 / 3; }
.dip__pin:nth-child(7) { grid-area: 2 / 3; }
.dip__pin:nth-child(8) { grid-area: 1 / 3; }

.pin {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
  color: var(--ink);
  font: 500 0.8125rem/1.2 var(--font-mono);
  letter-spacing: 0.03em;
  text-decoration: none;
}
.dip__pin:nth-child(-n + 4) .pin { justify-content: flex-end; text-align: right; }
.pin__label { min-width: 0; overflow-wrap: anywhere; }
.pin__label small { display: block; color: var(--ink-3); font-size: 0.6875rem; font-weight: 400; letter-spacing: 0; }
.pin__no { flex: none; color: var(--ink-3); font-size: 0.6875rem; }
.pin__leg {
  flex: none;
  width: 1.5rem;
  height: 0.7rem;
  background: linear-gradient(var(--pin), var(--pin-dark));
  transition: background 0.15s;
}
.dip__pin:nth-child(-n + 4) .pin__leg { border-radius: 2px 0 0 2px; }
.dip__pin:nth-child(n + 5) .pin__leg { order: -2; border-radius: 0 2px 2px 0; }
.dip__pin:nth-child(n + 5) .pin__no { order: -1; }
a.pin:hover { color: var(--copper); }
a.pin:hover .pin__leg { background: var(--copper); }

.dip__body {
  grid-area: 1 / 2 / 5 / 3;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--chip);
  box-shadow: 0 0 0 1px var(--line-strong), 0 14px 30px -16px rgba(0, 0, 0, 0.6);
  color: var(--chip-ink);
  font: 500 0.6875rem/1.7 var(--font-mono);
  letter-spacing: 0.12em;
  text-align: center;
}
.dip__body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1.5rem;
  height: 0.75rem;
  margin-left: -0.75rem;
  border-radius: 0 0 0.75rem 0.75rem;
  background: var(--bg);
  box-shadow: inset 0 -1px 0 var(--line-strong);
}
.dip__body::after {
  content: "";
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--chip-ink);
  opacity: 0.55;
}
.dip-caption { margin: 1rem 0 0; color: var(--ink-3); font: 400 0.75rem/1.5 var(--font-mono); }

/* 14 — footer ------------------------------------------------------------ */
.footer {
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.875rem;
}
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
.footer p { margin: 0; }
.footer__log { font: 400 0.75rem/1.7 var(--font-mono); }
.footer__log .n { color: var(--mask); }

/* 15 — legal page -------------------------------------------------------- */
.legal { padding: clamp(2.5rem, 7vw, 5rem) 0; }
.legal h1 { margin-bottom: 1.5rem; font-size: clamp(2rem, 5vw, 2.75rem); letter-spacing: -0.03em; }
.legal h2 { margin: 2.5rem 0 0.75rem; font-size: 1.35rem; letter-spacing: -0.01em; }
.legal p, .legal li { max-width: 42em; color: var(--ink-2); }
.legal ul { padding-left: 1.25rem; }
.legal li { margin-bottom: 0.4rem; }
.legal address { font-style: normal; color: var(--ink-2); line-height: 1.7; }
.legal address + p, .legal ul + p { margin-top: 1rem; }
.legal__label {
  display: block;
  margin: 1rem 0 0.15rem;
  color: var(--ink-3);
  font: 500 0.75rem/1.5 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.legal__label:first-child { margin-top: 0; }

/* shell: press "/" on a desktop (built by site.js) ----------------------- */
.shell {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  width: min(44rem, calc(100vw - 2rem));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-sunken);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55), 0 0 0 1px color-mix(in srgb, var(--mask) 18%, transparent);
  color: var(--ink);
  font: 400 0.875rem/1.6 var(--font-mono);
  overflow: hidden;
  visibility: hidden;
  transform: translate(-50%, calc(100% + 2rem));
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s 0.22s;
}
.shell.is-open {
  visibility: visible;
  transform: translate(-50%, 0);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
}
.shell__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--ink-3);
  font-size: 0.75rem;
}
.shell__dots { display: flex; gap: 0.35rem; }
.shell__dots span { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--line-strong); }
.shell__dots span:first-child { background: var(--copper); }
.shell__dots span:last-child { background: var(--mask); }
.shell__title { flex: 1; text-align: center; }
.shell__log {
  max-height: 14rem;
  overflow-y: auto;
  padding: 0.6rem 0.9rem 0;
  white-space: pre-wrap;
}
.shell__log:empty { display: none; }
.shell__log:focus-visible { outline: 2px solid var(--mask); outline-offset: -2px; }
.shell__out { color: var(--ink-2); }
.shell__motd { color: var(--ink-3); }
.shell__err { color: var(--copper); }
.shell__line {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  padding: 0.6rem 0.9rem;
}
.shell__user { color: var(--mask); font-weight: 700; }
.shell__cwd { color: var(--signal); font-weight: 700; }
.shell__field { position: relative; flex: 1; min-width: 0; }
.shell__input, .shell__ghost {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  letter-spacing: inherit;
}
.shell__input {
  position: relative;
  background: transparent;
  color: var(--ink);
  caret-color: var(--mask);
  outline: none;
}
.shell__ghost {
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: var(--ink-3);
  white-space: pre;
  pointer-events: none;
}
.shell__ghost-typed { visibility: hidden; }
.shell__list {
  max-height: 13rem;
  margin: 0;
  padding: 0 0 0.45rem;
  overflow-y: auto;
  list-style: none;
}
.shell__list:empty { display: none; }
.shell__opt {
  display: flex;
  gap: 1.5rem;
  padding: 0.15rem 0.9rem;
  border-left: 2px solid transparent;
  cursor: pointer;
}
.shell__opt[aria-selected="true"] {
  border-left-color: var(--mask);
  background: var(--bg-raised);
}
.shell__path { min-width: 13rem; color: var(--ink); }
.shell__opt[aria-selected="true"] .shell__path { color: var(--mask); font-weight: 700; }
.shell__desc { color: var(--ink-3); }
.shell-hint kbd {
  padding: 0 0.35em;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--bg-raised);
  color: var(--ink);
  font: inherit;
}

/* motion ----------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* 16 — print ------------------------------------------------------------- */
@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --bg: #fff; --bg-raised: #fff; --bg-sunken: #f4f4f4;
    --ink: #000; --ink-2: #222; --ink-3: #555;
    --line: #ccc; --line-strong: #999;
    --copper: #7a3a0e; --mask: #0b5a37; --signal: #17489a; --amber: #7a5000;
  }
  body { font-size: 10.5pt; }
  .nav, .scene, .hero__cta, .filter, .copy, .dip-switch, .skip, .shell, .shell-hint { display: none !important; }
  .hero { background: none; padding-top: 0; }
  .hero::after { display: none; }
  .section { padding: 1.5rem 0; }
  .pubs__year > h3 { position: static; }
  .pub, .row, .trace__item, .card, .pkg { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
