/* Two themes borrowed from the microscope:
   light = brightfield (an H&E-stained slide), dark = fluorescence (a confocal image). */

/* Fonts are self-hosted (latin subset) so visitors make no third-party requests.
   IBM Plex and Newsreader are under the SIL Open Font License; see assets/fonts/. */

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-400.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-500.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-var.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-var.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-var.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/newsreader-italic-var.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/newsreader-italic-var.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/newsreader-var.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/newsreader-var.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font-display: "Newsreader", Georgia, "Times New Roman", 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;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
}

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f1ea;
  --bg-elev: #fbf9f4;
  --ink: #1d1a24;
  --muted: #5d5768;
  --faint: #706a78;
  --line: #ddd5c8;
  --accent: #5a2e8c;        /* hematoxylin */
  --accent-2: #b64274;      /* eosin */
  --accent-ink: #fbf9f4;
  --glow: rgba(192, 69, 122, 0.25);
  --grid: rgba(29, 26, 36, 0.05);
  /* hero palette */
  --slide-bg: #fbf7f1;
  --cell: #f2c9d6;
  --cell-edge: #d99ab2;
  --nucleus: #5a2e8c;
  --driver-1: #e0701b;
  --driver-2: #c4471a;
  --driver-3: #d98a00;
  --protect-1: #2f8f86;
  --protect-2: #1f7a5c;
  --protect-3: #4aa596;
  --passenger: #ffffff;
  --passenger-edge: #1d1a24;
  --injury: #8c2a3c;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07090d;
  --bg-elev: #0d1118;
  --ink: #e7ebf1;
  --muted: #9aa4b4;
  --faint: #757f8e;
  --line: #1d2532;
  --accent: #4fe0a8;        /* GFP */
  --accent-2: #ff5fa6;      /* mCherry */
  --accent-ink: #07090d;
  --glow: rgba(79, 224, 168, 0.3);
  --grid: rgba(231, 235, 241, 0.035);
  --slide-bg: #05070a;
  --cell: #121c26;
  --cell-edge: #1e3342;
  --nucleus: #4d8dff;       /* DAPI */
  --driver-1: #ff8a3d;
  --driver-2: #ff6a2b;
  --driver-3: #ffb054;
  --protect-1: #4fe0a8;     /* GFP */
  --protect-2: #3fd6c0;
  --protect-3: #8be08f;
  --passenger: #f2d14b;     /* YFP */
  --passenger-edge: #05070a;
  --injury: #ff4d6d;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
}

img { display: block; max-width: 100%; height: auto; }

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px;
}
a:hover { color: var(--accent); }

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

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

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; padding: 8px 12px; background: var(--bg-elev); }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner { display: flex; align-items: center; gap: 20px; height: 64px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  white-space: nowrap;
  text-decoration: none;
}

.brand__cell,
.theme-toggle__icon {
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 42%, var(--nucleus) 0 34%, var(--cell) 38% 100%);
  box-shadow: 0 0 0 1px var(--cell-edge), 0 0 10px var(--glow);
}
.brand__cell { width: 16px; height: 16px; }

.nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
  font: 500 0.78rem/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--muted);
  font: 500 0.74rem/1 var(--font-mono);
  letter-spacing: 0.05em;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }
.theme-toggle__icon { width: 14px; height: 14px; }

@media (max-width: 720px) {
  .nav { display: none; }
  .theme-toggle { margin-left: auto; }
}

@media (max-width: 400px) {
  .theme-toggle__label { display: none; }
  .theme-toggle { padding: 8px; }
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  gap: clamp(36px, 5vw, 64px);
  align-items: center;
  padding-block: clamp(40px, 7vw, 96px) clamp(56px, 8vw, 104px);
}

@media (min-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
}

.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--muted);
  font: 500 0.76rem/1.6 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kicker__dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 18%, transparent);
}

.hero__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 7.4vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.hero__bio {
  max-width: 32ch;
  margin: 24px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.3vw, 1.62rem);
  line-height: 1.42;
}
.hero__bio em { color: var(--accent); font-style: italic; }

.hero__role {
  margin: 22px 0 0;
  color: var(--muted);
  font: 500 0.84rem/1.5 var(--font-mono);
}

.links { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 0; padding: 0; list-style: none; }

.links a {
  display: inline-block;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  font: 500 0.78rem/1 var(--font-mono);
  text-decoration: none;
}
.links a:hover { border-color: var(--accent); color: var(--accent); }
.links li:first-child a { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.links li:first-child a:hover { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }

.hero__figure { margin: 0; }

.slide {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--slide-bg);
  box-shadow: 0 40px 70px -50px color-mix(in srgb, var(--accent) 60%, transparent);
}

/* Soft field-of-view vignette, like looking down an eyepiece. */
.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 60%, color-mix(in srgb, var(--slide-bg) 55%, #000 45%) 120%);
  opacity: 0.35;
}

#mosaic { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: manipulation; }

.caption {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font: 0.78rem/1.6 var(--font-mono);
}
.caption__stat { color: var(--ink); font-weight: 500; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.legend__item { display: inline-flex; align-items: center; gap: 8px; }
.legend__item b { color: var(--ink); font-weight: 500; }

.swatch { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.swatch--normal { background: radial-gradient(circle, var(--nucleus) 0 32%, var(--cell) 38% 100%); box-shadow: 0 0 0 1px var(--cell-edge); }
.swatch--driver { background: var(--driver-1); }
.swatch--protective { background: var(--protect-1); }
.swatch--passenger { width: 7px; height: 7px; margin: 1.5px; background: var(--passenger); box-shadow: 0 0 0 1.5px var(--passenger-edge); }
.caption__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.caption__hint { color: var(--faint); }

.textbtn {
  padding: 0;
  border: 0;
  border-bottom: 1px dashed var(--muted);
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.textbtn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Sections ---------- */

.section { padding-block: clamp(56px, 8vw, 104px); border-top: 1px solid var(--line); }

.section__head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 18px; }

.section__num { flex: none; color: var(--accent-2); font: 500 0.85rem/1 var(--font-mono); letter-spacing: 0.08em; }

.section h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.section__intro { max-width: 62ch; margin: 0 0 36px; color: var(--muted); font-size: 1.05rem; }

/* ---------- Cards ---------- */

.cards { display: grid; gap: 16px; }

@media (min-width: 760px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  transition: border-color 0.2s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

.card__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: var(--accent);
  font: 500 0.72rem/1.3 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.card__meta span:last-child { color: var(--faint); white-space: nowrap; }

.card h3 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 1.22rem; line-height: 1.3; }
.card p { margin: 0; color: var(--muted); font-size: 0.96rem; }
.card .card__meta { color: var(--accent); font-size: 0.72rem; }

.card__link { margin-top: auto; padding-top: 6px; font: 500 0.78rem/1 var(--font-mono); text-decoration: none; }


.more { margin: 24px 0 0; font: 500 0.82rem/1.5 var(--font-mono); }

/* ---------- About ---------- */

.about { display: grid; gap: 44px; }

@media (min-width: 960px) {
  .about { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 72px; }
}

.about__text p { margin: 0 0 1.1em; font-size: 1.05rem; }
.about__text p:first-child { font-family: var(--font-display); font-size: clamp(1.3rem, 2.2vw, 1.55rem); line-height: 1.4; }

.portrait {
  width: 132px;
  height: 132px;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 30%;
  filter: grayscale(1) contrast(1.05);
}

.minihead {
  margin: 0 0 16px;
  color: var(--muted);
  font: 500 0.74rem/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  padding: 0 0 16px 26px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
}

.timeline li:last-child::before {
  border-color: var(--accent-2);
  background: var(--accent-2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 20%, transparent);
}

.timeline__when { color: var(--accent); font: 500 0.78rem/1.6 var(--font-mono); }
.timeline__what { color: var(--muted); }
.timeline__what strong { color: var(--ink); font-weight: 600; }

/* ---------- Writing / recognition lists ---------- */

.entries { margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }

.entries li {
  display: grid;
  grid-template-columns: 84px 150px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.entries__when { color: var(--faint); font: 500 0.8rem/1.4 var(--font-mono); }
.entries__kind { color: var(--accent); font: 500 0.72rem/1.4 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; }
.entries__what { display: grid; gap: 2px; font-family: var(--font-display); font-size: 1.14rem; line-height: 1.35; }
.entries__what a { text-decoration: none; }
.entries__what a:hover { text-decoration: underline; }
.entries__note { color: var(--muted); font-family: var(--font-body); font-size: 0.88rem; }

@media (max-width: 620px) {
  .entries li { grid-template-columns: 72px minmax(0, 1fr); gap: 6px 12px; }
  .entries__what { grid-column: 1 / -1; }
}

/* ---------- Contact & footer ---------- */

.contact h2 { max-width: 18ch; margin-bottom: 18px; font-size: clamp(2rem, 5vw, 3.4rem); }

.contact__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font: 500 0.84rem/1 var(--font-mono);
  text-decoration: none;
}
.btn--solid { background: var(--ink); color: var(--bg); }
.btn--solid:hover { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.footer { border-top: 1px solid var(--line); color: var(--faint); font: 0.74rem/1.6 var(--font-mono); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 28px 44px; }

/* ---------- Figures: illustrative panels in the work sections ---------- */

.fig { margin: 0 0 36px; }

.fig__frame {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-elev);
}

@media (min-width: 760px) {
  .fig__frame { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
}

.fig__visual {
  position: relative;
  min-height: 280px;
  border-bottom: 1px solid var(--line);
  background: var(--slide-bg);
}

@media (min-width: 760px) {
  .fig__visual { min-height: 330px; border-right: 1px solid var(--line); border-bottom: 0; }
}

/* Medical scans are dark in both themes, as on a reading-room monitor. */
.fig__visual--scan { background: #08090b; }

.fig__visual > svg,
.fig__visual > canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

.fig__side { display: flex; flex-direction: column; gap: 12px; padding: 22px 24px 24px; }

.fig__kicker {
  margin: 0;
  color: var(--accent);
  font: 500 0.7rem/1.4 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.fig__title { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 1.28rem; line-height: 1.3; }

.fig__list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }

.fig__item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.93rem;
  line-height: 1.45;
  text-align: left;
  transition: background-color 0.2s, color 0.2s;
}
button.fig__item { cursor: pointer; }
.fig__item.is-active { background: color-mix(in srgb, var(--accent) 11%, transparent); color: var(--ink); }
.fig__item[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--c); }

.fig__swatch { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--accent)); transform: translateY(1px); }

.fig__note { margin: 4px 0 0; color: var(--muted); font-size: 0.88rem; }

.fig__toggle {
  align-self: flex-start;
  margin-top: 2px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font: 500 0.75rem/1 var(--font-mono);
  cursor: pointer;
}
.fig__toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

.fig figcaption { margin-top: 10px; color: var(--faint); font: 0.74rem/1.55 var(--font-mono); }

/* Per-item colours shared by the list swatches and the drawings. */
/* Fixed bright colours: the scan panels are dark in both themes. */
[data-finding="1"] { --c: #ff8a3d; }
[data-finding="2"] { --c: #4fe0a8; }
[data-finding="3"] { --c: #ff5fa6; }
[data-organ="bladder"] { --c: #f2d14b; }
[data-organ="prostate"] { --c: #ff5fa6; }
[data-organ="rectum"] { --c: #4fe0a8; }
[data-organ="femur"] { --c: #6aa8ff; }

/* Chest X-ray: finding boxes. */
.xr-box { fill: none; stroke: var(--c); stroke-width: 2; opacity: 0.5; transition: opacity 0.25s, stroke-width 0.25s; }
.xr-box.is-active { opacity: 1; stroke-width: 3; }

/* CT: organ contours trace themselves. */
.ct-contour { fill: none; stroke: var(--c); stroke-width: 2.2; stroke-dasharray: var(--len, none); stroke-dashoffset: var(--len, 0); }
.ct-contour.is-drawn { stroke-dashoffset: 0; transition: stroke-dashoffset 1.1s ease-in-out; }

/* Agent loop. */
.ag-ring { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 4 6; }
.ag-node { fill: var(--bg-elev); stroke: var(--muted); stroke-width: 1.5; transition: fill 0.2s, stroke 0.2s; }
.ag-node.is-active { fill: var(--accent); stroke: var(--accent); }
.ag-label { fill: var(--ink); font: 500 13px var(--font-mono); }
.ag-exit { fill: var(--bg-elev); stroke: var(--line); transition: stroke 0.2s, fill 0.2s; }
.ag-exit.is-active { stroke: var(--accent-2); fill: color-mix(in srgb, var(--accent-2) 14%, var(--bg-elev)); }
.ag-path { fill: none; stroke: var(--line); stroke-width: 1.5; }
.ag-dot { fill: var(--accent-2); }
.ag-center { fill: var(--muted); font: 500 12px var(--font-mono); letter-spacing: 0.08em; }

@media (prefers-reduced-motion: reduce) {
  .ct-contour.is-drawn, .xr-box, .ag-node, .ag-exit { transition: none; }
}
