/* ───────────────────────────────────────────────────────────────
   xinrui zhong · personal site
   white canvas · Geist / Geist Mono · one cobalt accent · hairlines
   ─────────────────────────────────────────────────────────────── */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --ink: #0a0a0a;
  --ink-2: #4d4d4d;
  --ink-3: #8f8f8f;
  --dim: #a3a3a3;
  --line: #ebebeb;
  --line-2: #d9d9d9;
  --grid: #f2f2f2;
  --accent: #2450e6;
  --accent-ink: #ffffff;
  --accent-soft: #eef2ff;
  --amber: #d08a0f;
  --green: #16a34a;
  --tier-1: #f5f5f5;
  --tier-2: #ededed;
  --tier-3: #e3e3e3;
  --dot: rgba(10, 10, 10, 0.08);
  --code-bg: #0a0a0a;
  --code-ink: #ededed;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 16px 40px -20px rgba(0, 0, 0, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1100px;
  --gutter: 28px;
  --radius: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #0a0a0a;
    --surface-2: #111111;
    --ink: #ededed;
    --ink-2: #a1a1a1;
    --ink-3: #737373;
    --dim: #5c5c5c;
    --line: #1f1f1f;
    --line-2: #2e2e2e;
    --grid: #111111;
    --accent: #6f8cff;
    --accent-ink: #000000;
    --accent-soft: #10172e;
    --amber: #e6a83a;
    --green: #3ccf7a;
    --tier-1: #141414;
    --tier-2: #1a1a1a;
    --tier-3: #232323;
    --dot: rgba(237, 237, 237, 0.07);
    --code-bg: #111111;
    --code-ink: #ededed;
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.02), 0 16px 40px -20px rgba(0, 0, 0, 0.9);
    --shadow-sm: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #0a0a0a;
  --surface-2: #111111;
  --ink: #ededed;
  --ink-2: #a1a1a1;
  --ink-3: #737373;
  --dim: #5c5c5c;
  --line: #1f1f1f;
  --line-2: #2e2e2e;
  --grid: #111111;
  --accent: #6f8cff;
  --accent-ink: #000000;
  --accent-soft: #10172e;
  --amber: #e6a83a;
  --green: #3ccf7a;
  --tier-1: #141414;
  --tier-2: #1a1a1a;
  --tier-3: #232323;
  --dot: rgba(237, 237, 237, 0.07);
  --code-bg: #111111;
  --code-ink: #ededed;
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.02), 0 16px 40px -20px rgba(0, 0, 0, 0.9);
  --shadow-sm: none;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color 0.15s ease, text-decoration-color 0.15s ease; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

b, strong { font-weight: 600; color: var(--ink); }
em { font-style: normal; font-weight: 500; color: var(--ink); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.03em; line-height: 1.12; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--ink-3); }
.dim { color: var(--dim); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 6px 10px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}
.kicker .num { color: var(--accent); margin-right: 0.5em; }
.kicker .num::after { content: " /"; color: var(--line-2); }

/* ─────────── nav ─────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.8) blur(12px);
  -webkit-backdrop-filter: saturate(1.8) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; gap: 24px; height: 60px; }

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand__mark { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; transition: transform 0.6s cubic-bezier(.2,.7,.2,1), stroke 0.2s; }
.brand:hover .brand__mark { transform: rotate(60deg); stroke: var(--accent); }
.brand__dot { color: var(--accent); }

.nav__links { display: flex; gap: 4px; margin-left: auto; font-size: 14px; }
.nav__links a { color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: 8px; transition: background 0.15s, color 0.15s; }
.nav__links a:hover { color: var(--ink); background: var(--surface-2); }
.nav__links a.is-active { color: var(--ink); background: var(--tier-1); }

.theme {
  display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  color: var(--ink-2); cursor: pointer; transition: border-color 0.2s, color 0.2s;
}
.theme:hover { color: var(--ink); border-color: var(--line-2); }
.theme svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; grid-area: 1 / 1; }
.theme__moon { display: none; }
:root[data-theme="dark"] .theme__sun { display: none; }
:root[data-theme="dark"] .theme__moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme__sun { display: none; }
  :root:not([data-theme="light"]) .theme__moon { display: block; }
}

/* ─────────── hero ─────────── */
.hero-band { position: relative; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-band::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 35%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 75% 70% at 50% 35%, #000 30%, transparent 100%);
  pointer-events: none;
}
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr);
  gap: 56px;
  align-items: center;
  padding-top: 88px;
  padding-bottom: 96px;
}

.status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 10px; margin-bottom: 26px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-family: var(--mono); font-size: 12px; color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.status__dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.status__dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green);
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

.hero h1 { font-size: clamp(48px, 7vw, 80px); font-weight: 600; letter-spacing: -0.055em; line-height: 0.98; margin-bottom: 22px; }
.lede { font-size: 18.5px; line-height: 1.6; color: var(--ink-2); max-width: 32em; margin-bottom: 24px; }

.focus { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 28px; }
.focus li {
  font-family: var(--mono); font-size: 12px; color: var(--ink);
  padding: 3px 9px; border-radius: 6px; background: var(--tier-1); border: 1px solid var(--line);
}

.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 9px;
  border: 1px solid var(--line-2); background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.btn:hover { color: var(--ink); border-color: var(--ink-3); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.btn svg.fill { fill: currentColor; stroke: none; }
.btn--primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn--primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); border-color: transparent; color: var(--bg); }

.hero__loc { margin-top: 22px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.hero__loc span { color: var(--ink-3); margin-right: 10px; }

/* window frame around the loop figure */
.window {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.window__bar {
  display: flex; align-items: center; gap: 12px;
  height: 40px; padding: 0 14px;
  border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.window__dots { display: inline-flex; gap: 6px; }
.window__dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.window__title { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.window__tag {
  margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--green);
  border: 1px solid color-mix(in srgb, var(--green) 40%, transparent); padding: 1px 8px; border-radius: 999px;
}
.window__body {
  padding: 26px 22px 10px;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 18px 18px;
  background-position: 9px 9px;
}

.loop { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--mono); }
.tier { stroke: var(--line-2); stroke-width: 1; }
.tier--1 { fill: var(--tier-1); }
.tier--2 { fill: var(--tier-2); }
.tier--3 { fill: var(--tier-3); }
.tier__t { font-size: 12px; letter-spacing: 0.14em; fill: var(--ink); font-weight: 500; }
.stack--acc .tier { fill: var(--accent-soft); stroke: color-mix(in srgb, var(--accent) 45%, transparent); }
.stack--acc .tier__t { fill: var(--accent); }
.loop__label { font-size: 13px; letter-spacing: 0.16em; fill: var(--ink-3); }
.loop__label--acc { fill: var(--accent); }
.loop__sub { font-size: 10px; }
.loop__edge { stroke: var(--ink); stroke-width: 1.5; }
.loop__head { fill: var(--ink); }
.loop__head--acc { fill: var(--accent); }
.agent__hex { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.agent__t { font-size: 12px; letter-spacing: 0.2em; fill: var(--ink); font-weight: 500; }
.agent__bar { fill: var(--tier-3); }
.agent__bar--b { fill: var(--line-2); }
.agent__bar--c { fill: var(--accent); }
.loop__back { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 5; animation: flow 1.6s linear infinite; }
.loop__dot { fill: var(--accent); }
.loop__note { font-family: var(--sans); font-size: 14px; font-weight: 600; fill: var(--accent); }
@keyframes flow { to { stroke-dashoffset: -22; } }

.agent .agent__bar { transform-box: fill-box; transform-origin: left center; animation: think 3.2s ease-in-out infinite; }
.agent .agent__bar--b { animation-delay: 0.4s; }
.agent .agent__bar--c { animation-delay: 0.8s; }
@keyframes think { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(0.55); } }

.loop.is-tick .stack--acc { animation: settle 0.6s ease; }
@keyframes settle { 0% { opacity: 0.35; transform: translateX(-4px); } 100% { opacity: 1; transform: none; } }

.figcap {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-3);
}
.figcap__acc { color: var(--accent); }

/* ─────────── sections ─────────── */
.section { padding-top: 96px; }
.section__head { margin-bottom: 40px; }
.section__head h2 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.04em; }
.section__head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.section__sub { color: var(--ink-2); margin-top: 14px; max-width: 40em; }

/* research */
.prose { max-width: 46em; display: grid; gap: 18px; color: var(--ink-2); font-size: 17px; line-height: 1.7; }

.pillars {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 48px;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--line); gap: 1px;
}
.pillar { background: var(--surface); padding: 26px 24px 22px; display: flex; flex-direction: column; gap: 10px; transition: background 0.2s ease; }
.pillar:hover { background: var(--surface-2); }
.pillar__idx { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.pillar h3 { font-size: 21px; letter-spacing: -0.03em; }
.pillar p { color: var(--ink-2); font-size: 15px; line-height: 1.62; }
.pillar__refs { margin-top: auto; padding-top: 12px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-3) !important; }
.pillar__refs a { color: var(--ink-2); }

.principle {
  margin-top: 24px; padding: 18px 22px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2);
  max-width: 54em;
}
.principle .kicker { margin-bottom: 6px; text-transform: none; letter-spacing: 0; color: var(--green); }
.principle p:last-child { color: var(--ink-2); font-size: 15.5px; }

/* papers */
.filters { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); flex-wrap: wrap; }
.chip {
  font-family: var(--mono); font-size: 12px;
  padding: 5px 11px; border-radius: 7px; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: var(--ink-3);
  transition: all 0.15s ease;
}
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }

.pubs { counter-reset: pub; display: grid; }
.pub {
  counter-increment: pub;
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 220px; gap: 24px;
  padding: 30px 0; border-top: 1px solid var(--line);
}
.pub:last-child { border-bottom: 1px solid var(--line); }
.pub::before { content: counter(pub, decimal-leading-zero); font-family: var(--mono); font-size: 13px; color: var(--ink-3); padding-top: 2px; }
.pub.is-hidden { display: none; }
.pub__venue { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.badge {
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface);
}
.badge--accept { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.badge--review { border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); background: var(--accent-soft); }
.pub__status { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.pub__title { font-size: 19px; line-height: 1.32; letter-spacing: -0.02em; margin-bottom: 8px; }
.pub__authors { font-size: 14px; color: var(--ink-3); margin-bottom: 12px; line-height: 1.55; }
.pub__authors b { color: var(--ink); font-weight: 600; }
.pub__tldr { font-size: 15px; color: var(--ink-2); line-height: 1.65; max-width: 45em; }
.pub__links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.pub__links a {
  font-family: var(--mono); font-size: 12px; color: var(--ink); text-decoration: none;
  padding: 3px 10px; border: 1px solid var(--line-2); border-radius: 7px; transition: border-color 0.15s, color 0.15s;
}
.pub__links a:hover { border-color: var(--ink); color: var(--ink); }
.soon { font-family: var(--mono); font-size: 12px; color: var(--ink-3); padding: 3px 4px; }

.plate { margin: 0; align-self: start; }
.plate__box {
  background-color: var(--surface);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 12px 12px;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  transition: border-color 0.2s;
}
.plate__box svg { display: block; width: 100%; height: auto; }
.plate figcaption { margin-top: 8px; font-family: var(--mono); font-size: 10.5px; line-height: 1.45; color: var(--ink-3); }
.plate figcaption b { color: var(--ink-2); font-weight: 500; }
.plate__legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 5px; }
.plate__legend > span { display: inline-flex; align-items: center; gap: 4px; }
.plate__legend svg { flex: none; width: 8px; height: 8px; }
.g0 { fill: transparent; stroke: var(--line-2); stroke-width: 0.8; }
.g1 { fill: var(--tier-3); }
.g2 { fill: var(--accent); }
.g3 { fill: var(--amber); }
.g4 { fill: var(--ink); opacity: 0.85; }
.g5 { fill: var(--accent); opacity: 0.35; }
.gd { fill: transparent; stroke: var(--ink-3); stroke-width: 0.8; stroke-dasharray: 2 1.6; }
.pub:hover .plate__box { border-color: var(--line-2); }

.footnote { margin-top: 20px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); }

/* open source */
.repos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.repo {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.repo:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.repo__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.repo__head h3 { font-size: 20px; letter-spacing: -0.03em; }
.repo__head h3 a { color: var(--ink); text-decoration: none; }
.repo__head h3 a:hover { color: var(--accent); }
.repo__stars {
  font-family: var(--mono); font-size: 12px; color: var(--ink-2); white-space: nowrap;
  border: 1px solid var(--line); padding: 2px 9px; border-radius: 999px;
}
.repo__soon {
  font-family: var(--mono); font-size: 11px; white-space: nowrap;
  color: var(--green); border: 1px solid color-mix(in srgb, var(--green) 40%, transparent);
  padding: 2px 9px; border-radius: 999px;
}
.repo__path { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-top: -4px; }
.repo__desc { font-size: 15px; color: var(--ink-2); line-height: 1.62; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); background: var(--tier-1); border: 1px solid var(--line); padding: 1px 8px; border-radius: 6px; }
.repo__cmd {
  margin: 4px 0 0; padding: 11px 14px; border-radius: 9px;
  background: var(--code-bg); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; color: var(--code-ink);
  overflow-x: auto; white-space: pre; scrollbar-width: thin;
}
.repo__cmd .prompt { color: var(--green); margin-right: 8px; user-select: none; }
.repo__meta { margin-top: auto; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); min-height: 1em; }

/* experience */
.timeline { border-top: 1px solid var(--line); }
.tl { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 28px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.tl__when { display: flex; flex-direction: column; gap: 3px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); padding-top: 3px; }
.tl__when span { color: var(--ink-3); font-size: 11.5px; }
.tl__what h3 { font-size: 19px; letter-spacing: -0.025em; }
.tl__lab {
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0;
  color: var(--accent); background: var(--accent-soft); padding: 1px 8px; border-radius: 999px;
  margin-left: 8px; vertical-align: 3px;
}
.tl__role { font-size: 14.5px; color: var(--ink-3); margin-top: 4px; }
.tl__what ul { margin-top: 12px; display: grid; gap: 7px; }
.tl__what li { position: relative; padding-left: 18px; font-size: 15px; color: var(--ink-2); line-height: 1.6; }
.tl__what li::before { content: "›"; position: absolute; left: 2px; top: 0; font-family: var(--mono); color: var(--ink-3); }

/* education & service */
.edu { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.edu__list { border-top: 1px solid var(--line); }
.edu__list li { display: grid; grid-template-columns: 180px 1fr; gap: 28px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.edu__list h3 { font-size: 18px; letter-spacing: -0.025em; }
.service { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.service .kicker { margin-bottom: 10px; text-transform: none; letter-spacing: 0; color: var(--green); }
.service__list { display: grid; }
.service__list li { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 13px; color: var(--ink-3); padding: 9px 0; border-bottom: 1px solid var(--line); }
.service__list li:last-child { border-bottom: 0; }
.service__list span { color: var(--ink); font-weight: 500; }

/* contact */
.contact { padding-bottom: 96px; }
.contact h2 { font-size: clamp(32px, 4.6vw, 52px); letter-spacing: -0.045em; margin-bottom: 16px; }
.contact__lede { color: var(--ink-2); max-width: 38em; margin-bottom: 28px; font-size: 17px; }
.contact__links { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 10px; max-width: 860px; }
.contact__links a {
  display: flex; align-items: baseline; gap: 12px; min-width: 0;
  padding: 13px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  font-family: var(--mono); font-size: 13px; color: var(--ink); text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.contact__links a:hover { border-color: var(--ink-3); background: var(--surface-2); color: var(--ink); }
.contact__k { color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; min-width: 78px; flex: none; }
.contact__v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offclock { margin-top: 32px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); }

/* footer */
.footer { border-top: 1px solid var(--line); }
.footer__inner {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-top: 22px; padding-bottom: 28px;
  font-family: var(--mono); font-size: 12px; color: var(--ink-3);
}
.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--ink); }
.footer__fig { color: var(--accent); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.2,.7,.2,1); }
.reveal.is-in { opacity: 1; transform: none; }

/* ─────────── responsive ─────────── */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 48px; padding-top: 60px; padding-bottom: 72px; }
  .pillars { grid-template-columns: 1fr; }
  .pub { grid-template-columns: 36px minmax(0, 1fr) 184px; }
  .edu { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .nav__links { display: none; }
  .theme { margin-left: auto; }
  .hero { padding-top: 44px; padding-bottom: 56px; }
  .lede { font-size: 17px; }
  .btn { height: 38px; padding: 0 13px; }
  .window__body { padding: 16px 10px 6px; }
  .figcap { font-size: 10.5px; }
  .pub { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 26px 0; }
  .pub::before { padding-top: 0; }
  .plate { max-width: 300px; }
  .repos { grid-template-columns: 1fr; }
  .tl, .edu__list li { grid-template-columns: 1fr; gap: 8px; }
  .tl__when { flex-direction: row; gap: 10px; }
  .section { padding-top: 72px; }
  .contact__links { grid-template-columns: 1fr; }
  .footer__inner { flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .nav, .theme, .filters, .window, .repo__cmd, .cta { display: none !important; }
  body { background: #fff; color: #000; }
}

/* research areas: model | ml systems (conventional + rsi) */
.areas { margin-top: 48px; }
.areas .pillars { margin-top: 0; }
.areas__groups {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  margin-bottom: 12px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
}
.areas__group { position: relative; margin: 0 12px; padding-top: 9px; border-top: 1px solid var(--line-2); text-align: center; }
.areas__group::before, .areas__group::after { content: ""; position: absolute; top: -1px; width: 1px; height: 7px; background: var(--line-2); }
.areas__group::before { left: 0; }
.areas__group::after { right: 0; }
.areas__group--a { grid-column: 1; }
.areas__group--b { grid-column: 2 / span 2; color: var(--accent); border-top-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.areas__group--b::before, .areas__group--b::after { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.pillar__idx span { color: var(--accent); margin-right: 6px; }
@media (max-width: 960px) { .areas__groups { display: none; } }

/* repo link row */
.repo__links { display: flex; flex-wrap: wrap; gap: 8px; }
.repo__links a {
  font-family: var(--mono); font-size: 12px; color: var(--ink); text-decoration: none;
  padding: 3px 10px; border: 1px solid var(--line-2); border-radius: 7px; transition: border-color 0.15s;
}
.repo__links a:hover { border-color: var(--ink); color: var(--ink); }

/* blog: empty state as a terminal */
.empty {
  max-width: 640px; padding: 18px 20px; border-radius: var(--radius);
  background: var(--code-bg); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 13px; line-height: 1.8; color: var(--code-ink);
}
.empty .prompt { color: var(--green); margin-right: 8px; user-select: none; }
.empty__out { color: #8f8f8f; }
.empty a { color: var(--code-ink); text-decoration-color: #5c5c5c; }
.empty a:hover { color: #8fa6ff; text-decoration-color: currentColor; }
.empty__out:last-child::after {
  content: ""; display: inline-block; width: 7px; height: 14px; margin-left: 6px; vertical-align: -2px;
  background: var(--code-ink); animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
