/* ==========================================================================
   Self-hosted type: Newsreader (serif) and Archivo (sans).
   Subsetted woff2 with the upstream unicode-range gating, so a visitor only
   downloads the ranges their content actually needs.
   ========================================================================== */

/* Archivo normal 400 — vietnamese */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url('../fonts/archivo-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* Archivo normal 400 — latin-ext */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url('../fonts/archivo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Archivo normal 400 — latin */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url('../fonts/archivo-latin.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;
}

/* Archivo normal 500 — vietnamese */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url('../fonts/archivo-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* Archivo normal 500 — latin-ext */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url('../fonts/archivo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Archivo normal 500 — latin */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url('../fonts/archivo-latin.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;
}

/* Archivo normal 600 — vietnamese */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url('../fonts/archivo-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* Archivo normal 600 — latin-ext */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url('../fonts/archivo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Archivo normal 600 — latin */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url('../fonts/archivo-latin.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;
}

/* Newsreader italic 300 600 — vietnamese */
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 300 600;
  font-display: swap;
  src: url('../fonts/newsreader-italic-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* Newsreader italic 300 600 — latin-ext */
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 300 600;
  font-display: swap;
  src: url('../fonts/newsreader-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Newsreader italic 300 600 — latin */
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 300 600;
  font-display: swap;
  src: url('../fonts/newsreader-italic-latin.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;
}

/* Newsreader normal 300 600 — vietnamese */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('../fonts/newsreader-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* Newsreader normal 300 600 — latin-ext */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('../fonts/newsreader-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Newsreader normal 300 600 — latin */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('../fonts/newsreader-latin.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;
}

/* ==========================================================================
   Design tokens — warm paper ground, claret accent, hairline rules.
   The historic variable names (--bg, --text, --border …) are kept so every
   existing component rule inherits the new palette; the semantic aliases
   below (--ground, --ink, --body, --muted, --rule) are used by newer rules.
   ========================================================================== */

:root {
  color-scheme: light;

  --ground: #faf8f4;
  --panel: #f4f1ea;
  --ink: #191817;
  --body: #3a3733;
  --muted: #6f6a63;
  --rule: #e2ddd3;
  --accent: #8a2f33;

  /* Legacy aliases retained for existing component rules. */
  --bg: var(--ground);
  --text: var(--ink);
  --text-muted: var(--muted);
  --border: var(--rule);

  --accent-soft: rgba(25, 24, 23, 0.035);
  --accent-strong: rgba(25, 24, 23, 0.07);

  --card-radius: 0;
  --shadow-soft: none;

  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-sans: 'Archivo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Shell geometry — a centred 992px composition with a 232px rail. */
  --shell-width: 992px;
  --rail-width: 232px;
  --rail-gutter: max(0px, calc((100vw - var(--shell-width)) / 2));
}

[data-theme="dark"] {
  color-scheme: dark;

  --ground: #161513;
  --panel: #1e1c19;
  --ink: #f1eee8;
  --body: #d6d1c8;
  --muted: #9d968b;
  --rule: #2c2925;
  --accent: #e0938a;

  --accent-soft: rgba(241, 238, 232, 0.05);
  --accent-strong: rgba(241, 238, 232, 0.10);
  --shadow-soft: none;
}

* {
  box-sizing: border-box;
}

.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 10000;
  padding: 0.7rem 1rem;
  border-radius: 0 0 6px 6px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
}

.skip-link:focus {
  top: 0;
  text-decoration: none;
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Reading Progress Bar */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.1s ease;
}

/* Dark Mode Toggle — styled as a nav link */
.theme-toggle {
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.875em;
}

.theme-toggle svg {
  transition: transform 0.3s ease;
}

.theme-toggle-label {
  pointer-events: none;
}


/* ==========================================================================
   Research guide — a right-hand panel, opened from the rail.
   There is no floating bubble: the rail's "Ask about my research" control is
   the single entry point, so the reading column is never obstructed.
   ========================================================================== */

#chat-widget {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(372px, 100vw);
  max-height: none;
  background: var(--panel);
  border: 0;
  border-left: 1px solid var(--rule);
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  z-index: 20;
  overflow: hidden;
}

#chat-widget.minimized {
  display: none;
}

#chat-widget.minimized #chat-panel {
  display: none;
}

#chat-header {
  width: 100%;
  min-height: 0;
  padding: 26px 26px 18px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: none;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  text-align: left;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1em;
}

#chat-header:hover,
#chat-header:focus-visible {
  filter: none;
}

#chat-header:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}

/* The decorative "AI" chip belongs to the old floating bubble. */
.chat-header-icon {
  display: none;
}

.chat-header-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  line-height: 1.3;
}

.chat-header-copy strong {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 400;
  color: var(--ink);
}

.chat-header-copy small {
  margin-top: 4px;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--muted);
}

.chat-kicker {
  display: none;
}

.ask-research-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: none;
}

#chat-toggle {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
}

#chat-panel {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

#chat-messages {
  display: flex;
  flex: 1;
  padding: 22px 26px;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  min-height: 0;
  max-height: none;
  font-family: var(--font-serif);
  font-size: 15.5px;
}

.chat-message {
  margin: 0;
  padding: 0;
  border-radius: 0;
  max-width: 100%;
  line-height: 1.55;
}

.chat-message.bot {
  background: none;
  color: var(--body);
  align-self: stretch;
}

.chat-message.user {
  padding-left: 14px;
  border-left: 1px solid var(--accent);
  background: none;
  color: var(--ink);
  align-self: stretch;
  margin-left: 0;
}

/* Suggested questions read as a row of quiet links, not chips. */
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 4px 0 0;
}

.chat-suggestions button {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chat-suggestions button:hover,
.chat-suggestions button:focus-visible {
  background: none;
  color: var(--ink);
}

.chat-sources {
  margin-top: 0.7rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-sans);
  font-size: 12px;
}

.chat-sources strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chat-sources ul {
  margin: 0;
  padding-left: 1rem;
}

.chat-sources li + li {
  margin-top: 0.2rem;
}

.chat-sources a {
  overflow-wrap: anywhere;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

#chat-input-container {
  order: 1;
  padding: 0 26px 16px;
  border-top: 0;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

#chat-input {
  flex: 1;
  min-width: 0;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13.5px;
  outline: none;
}

#chat-input::placeholder {
  color: var(--muted);
}

#chat-send {
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
}

#chat-send:disabled {
  cursor: wait;
  opacity: 0.6;
}

.chat-privacy-row {
  order: 2;
  display: flex;
  padding: 0 26px 22px;
  border-top: 0;
  align-items: flex-start;
  gap: 12px;
  background: none;
}

#chat-privacy {
  flex: 1;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

#chat-clear {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#chat-clear:hover,
#chat-clear:focus-visible {
  color: var(--accent);
}

#chat-clear:disabled {
  cursor: wait;
  opacity: 0.55;
}

/* The rail control that opens the guide. */
.ask-research-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 400;
}

.ask-research-link:hover,
.ask-research-link:focus {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--ground);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

hr {
  height: 1px;
  margin: 42px 0;
  border: 0;
  background-color: var(--rule);
}

/* ==========================================================================
   The rail — a fixed 232px column beside a centred 992px composition.
   ========================================================================== */

aside {
  background: var(--ground);
  border-right: 1px solid var(--rule);
}

aside div#user_meta {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 44px 30px 32px 48px;
  text-align: left;
}

aside div#user_meta h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0;
}

aside div#user_meta p {
  margin: 5px 0 0;
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

#author_info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}

#author_info img {
  display: block;
  width: 154px;
  height: 154px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 22%;
  box-shadow: none;
}

aside div#user_meta nav {
  display: flex;
  flex: 1;
  min-height: 0;
}

aside div#user_meta ul {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  margin: 22px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--rule);
  font-family: var(--font-sans);
  font-size: 13.5px;
  list-style-type: none;
}

aside div#user_meta ul li {
  display: block;
  width: 100%;
}

/* The last two entries — the guide and the theme switch — sit at the foot
   of the rail, separated by a hairline, as a quiet utility group. */
aside div#user_meta ul li:nth-last-child(2) {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}

/* Navigation: quiet sans-serif text links. */
.nav-link {
  padding: 0;
  border: none;
  border-radius: 0;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13.5px;
  text-transform: none;
  letter-spacing: 0;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  background-color: transparent;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--ink);
  text-decoration: underline;
}

.nav-link.current {
  color: var(--ink);
  font-weight: 600;
  box-shadow: none;
}

.theme-toggle svg {
  display: none;
}

/* ==========================================================================
   The measure — a 760px reading column beside the rail.
   ========================================================================== */

main {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 760px;
  margin: 0;
  padding: 58px 64px 96px 56px;
}

/* Each page brings its own closing note (a verified date, a copyright line).
   Contact is the last thing worth acting on, so it sits above that note
   without every page having to be rewritten. */
main > .site-contact {
  order: 1;
}

main > footer {
  order: 2;
}

main header {
  border-top: none;
  border-bottom: none;
  padding: 0;
  background-color: transparent;
}

main header p {
  margin: 0 0 10px;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 12.5px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}

main article {
  max-width: 760px;
  padding: 0;
  background-color: transparent;
  border: none;
  border-top: none;
  border-radius: 0;
  box-shadow: none;
}

#article_title h1 {
  margin: 0 0 22px;
  max-width: 24ch;
  font-family: var(--font-serif);
  font-size: clamp(29px, 4.2vw, 43px);
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
}

main article div#article_text {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.62;
  color: var(--body);
}

main article div#article_text h2 {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--ink);
}

main article div#article_text h3 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
}

.lead {
  max-width: 60ch;
  font-size: 19.5px;
  line-height: 1.58;
  color: var(--body);
}

main article div#article_text ul {
  padding-left: 1.2em;
}

main article div#article_text li {
  margin-bottom: 0.45em;
}

main article div#article_text a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

main footer a {
  text-decoration: underline;
}

main article div#article_text blockquote {
  margin: 26px 0;
  padding-left: 22px;
  color: var(--muted);
  font-style: italic;
  border-left: 1px solid var(--rule);
}

main article div#article_meta {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--muted);
}

main footer {
  border: 0;
  padding: 0;
  display: flex;
  justify-content: flex-start;
  background-color: transparent;
  margin-top: 24px;
  border-radius: 0;
  box-shadow: none;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--muted);
}

main footer p {
  margin: 0;
}

.button_accent {
  padding: 8px 16px;
  border: 1px solid var(--rule);
  border-radius: 0;
  text-transform: none;
  color: var(--ink);
  font-size: 0.9em;
  letter-spacing: 0.01em;
  background-color: transparent;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
}

.button_accent:hover,
.button_accent:focus {
  color: var(--accent);
  border-color: var(--accent);
  background-color: var(--accent-soft);
  text-decoration: none;
}

main div#ending_message {
  padding: 0 0 40px;
  color: var(--text-muted);
  font-size: 0.8em;
  text-align: center;
}

.status-section {
  margin: 2.6em 0;
}

.status-section h2 {
  font-size: 1.35em;
  margin-bottom: 0.6em;
  font-weight: 600;
}

.status-section p,
.status-section ul {
  font-size: 1.02rem;
  line-height: 1.7;
}

.status-section ul {
  padding-left: 1.4em;
}

.status-section li {
  margin-bottom: 0.45em;
}

.research-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  margin-top: 1em;
}

.research-step {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.research-step:hover,
.research-step:focus-visible,
.research-step.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.research-step:hover {
  transform: translateY(-2px);
}

.research-step:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.research-step-number {
  display: inline-flex;
  width: 1.7em;
  height: 1.7em;
  margin-bottom: 0.7em;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.8em;
  font-weight: 600;
}

.research-step strong,
.research-step small {
  display: block;
}

.research-step small {
  margin-top: 0.25em;
  color: var(--text-muted);
  line-height: 1.4;
}

.research-arrow {
  align-self: center;
  color: var(--text-muted);
  font-size: 1.2em;
}

.research-detail {
  min-height: 3.5em;
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.public-projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 1em;
}

main article div#article_text .public-project-card {
  display: flex;
  min-width: 0;
  min-height: 150px;
  padding: 16px;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

main article div#article_text .public-project-card:hover,
main article div#article_text .public-project-card:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
  transform: translateY(-2px);
}

.public-project-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.public-project-card span {
  margin-top: 0.5em;
  color: var(--text-muted);
  line-height: 1.5;
}

.public-project-card small {
  margin-top: auto;
  padding-top: 1em;
  color: var(--text);
  font-weight: 600;
}

.paper-authors {
  margin: 0.2em 0 0;
  color: var(--text-muted);
  font-size: 0.95em;
}

.paper-meta {
  margin: 0.2em 0 0;
  font-size: 0.9em;
  color: var(--text-muted);
}

/* Timeline removed for consistency */
.timeline {
  margin-left: 0;
  padding-left: 0;
  display: grid;
  gap: 1.8em;
}

.timeline-entry {
  position: relative;
}

.timeline-entry h3 {
  margin: 0 0 0.2em;
  font-size: 1.15em;
  font-weight: 600;
}

.timeline-entry p.timeline-meta {
  margin: 0 0 0.5em 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.progress-bar {
  background-color: rgba(17, 17, 17, 0.08);
  border-radius: 999px;
  overflow: hidden;
  height: 8px;
  width: 100%;
  position: relative;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #4b5563 100%);
}

.progress-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82em;
  color: var(--text-muted);
}

.progress-value {
  font-variant-numeric: tabular-nums;
}

.tagcloud {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tagcloud li {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  background-color: rgba(17, 17, 17, 0.06);
  color: var(--accent);
}

.tag-1 { font-size: 200%; }
.tag-2 { font-size: 160%; }
.tag-3 { font-size: 120%; }
.tag-4 { font-size: 90%; }
.tag-5 { font-size: 70%; }

#papers-list {
  list-style: none;
  padding: 0;
  margin: 2.4em 0 0;
}

#papers-list li {
  list-style: none;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

#papers-list li:last-child {
  border-bottom: none;
}

#papers-list h3 {
  margin: 0;
  font-size: 1.15em;
}

.blog-list {
  list-style: none;
  padding: 0;
  margin: 2.4em 0 0;
}

.blog-list li {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.blog-list li:last-child {
  border-bottom: none;
}

.blog-list h3 {
  margin: 0 0 0.3em;
  font-size: 1.2em;
}

.blog-meta {
  margin: 0 0 0.6em;
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.papers-meta {
  margin-top: 1.2em;
  font-size: 0.92em;
  color: var(--text-muted);
}

.papers-error {
  margin-top: 1em;
  font-size: 0.92em;
  color: #c62828;
}

.demo-note {
  margin-top: 0.8em;
  font-size: 0.9em;
  color: var(--text-muted);
}

.highlighttable {
  margin: 24px auto;
  color: #000000;
  border: 1px solid #cbcbcb;
  font-family: var(--font-mono);
  background: #f9f9f9;
  line-height: 1.25em;
  overflow-x: auto;
}

.highlighttable .linenos {
  color: darkgrey;
  border-right: 2px solid lightgray;
  padding: 4px;
}

.highlighttable pre {
  margin: 0;
}

.highlighttable .code {
  padding: 0 10px 0 4px;
}

img,
div.figure {
  max-width: 100%;
  height: auto;
}

sup {
  vertical-align: baseline;
  position: relative;
  top: -0.4em;
}

.MathJax {
  overflow-x: auto;
  overflow-y: hidden;
}

.archive-container {
  position: relative;
}

.archive-container .archive-link {
  position: absolute;
  display: none;
  top: -1.5em;
  right: -2em;
  background: white;
  margin: 2px;
  color: grey;
  font-size: 80%;
}

.archive-container:hover .archive-link {
  display: inline-block;
}

@media screen and (min-width: 1024px) {
  body {
    display: block;
    margin-left: 0;
  }

  aside {
    position: fixed;
    top: 0;
    bottom: 0;
    left: var(--rail-gutter);
    width: var(--rail-width);
    overflow-y: auto;
    border-right: 1px solid var(--rule);
    z-index: 5;
  }

  main {
    margin-left: calc(var(--rail-width) + var(--rail-gutter));
    word-break: break-word;
    text-align: left;
  }
}

/* ==========================================================================
   Demonstrations — every control is a real button or slider on the page, so
   the whole set is operable from the keyboard without a canvas fallback.
   ========================================================================== */

.demo-section {
  margin-top: 44px;
  padding-top: 30px;
  border-top: 1px solid var(--ink);
}

.demo-section h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.demo-ordinal {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.demo-intro {
  max-width: 62ch;
}

.demo-lookfor {
  max-width: 64ch;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.demo-lookfor strong {
  color: var(--ink);
  font-weight: 600;
}

.demo-split {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  margin: 22px 0;
}

.demo-aside {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.demo-status {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  color: var(--ink);
}

.demo-detail {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 0;
}

.demo-button {
  padding: 7px 12px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 12.5px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.demo-button:hover,
.demo-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.demo-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 18px;
  margin: 20px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.demo-stat-value {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.demo-stat-value.is-alert {
  color: var(--accent);
}

.demo-stat-label {
  margin: 3px 0 0;
  font-family: var(--font-sans);
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted);
}

/* 01 — planner board */

.tt-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.tt-cell {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: var(--ground);
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
}

.tt-cell[disabled] {
  cursor: default;
}

.tt-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--accent-soft);
  transition: height 0.2s ease;
}

.tt-cell.is-chosen .tt-share {
  color: var(--accent);
  font-weight: 600;
}

.tt-share {
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--muted);
}

.tt-mark {
  position: relative;
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1;
}

/* 02 — bandit arms */

.bandit-arms {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 0;
}

.bandit-arm {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.bandit-track {
  height: 96px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: flex-end;
}

.bandit-fill {
  width: 100%;
  background: var(--accent);
  transition: height 0.2s ease;
}

.bandit-meta {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

/* 03 — prunable tree */

.tree-levels {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 22px 0;
}

.tree-mid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tree-leaves {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
}

.tree-node,
.tree-leaf {
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, opacity 0.15s ease;
}

.tree-node.is-best {
  border-color: var(--accent);
}

.tree-node.is-cut,
.tree-leaf.is-cut {
  opacity: 0.4;
}

.tree-leaf.is-hot {
  border-color: var(--accent);
}

.tree-node-label {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--muted);
}

.tree-node-value {
  margin: 3px 0 0;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.tree-node-visits,
.tree-leaf-visits {
  margin: 2px 0 0;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--muted);
}

.tree-leaf {
  padding: 8px 4px;
  text-align: center;
}

.tree-leaf-value {
  margin: 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* 04 — objective weights and the chosen schedule */

.weight-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 22px 0;
}

.weight-row {
  display: grid;
  grid-template-columns: minmax(0, 160px) minmax(0, 1fr) 28px;
  align-items: center;
  gap: 14px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--muted);
}

.weight-value {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.demo-slider {
  width: 100%;
  min-width: 0;
  accent-color: var(--accent);
}

.schedule-strip {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 4px;
  margin: 22px 0 8px;
}

.schedule-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.schedule-track {
  height: 92px;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--rule);
}

.schedule-fill {
  width: 100%;
  background: color-mix(in srgb, var(--ink) 45%, var(--ground));
  transition: height 0.2s ease;
}

.schedule-heater {
  height: 8px;
  border: 1px solid var(--rule);
}

.schedule-heater.is-on {
  background: var(--accent);
  border-color: var(--accent);
}

.schedule-time {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 9px;
  line-height: 1.2;
  color: var(--muted);
  text-align: center;
}

.schedule-time.is-deadline {
  color: var(--accent);
}

/* 05 — grid world */

.ql-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.ql-cell {
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: var(--ground);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1;
}

.ql-cell.is-wall {
  background: var(--ink);
}

.ql-cell.is-goal {
  background: var(--panel);
  color: var(--accent);
}

.ql-cell.is-start {
  color: var(--ink);
}

/* 06 — seed variance */

.seed-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 22px 0 0;
}

.seed-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 62px;
  align-items: center;
  gap: 12px;
}

.seed-label,
.seed-final {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--muted);
}

.seed-label.is-collapsed {
  color: var(--accent);
}

.seed-final {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.seed-cells {
  display: grid;
  grid-template-columns: repeat(60, minmax(0, 1fr));
  gap: 1px;
  min-width: 0;
}

.seed-cell {
  height: 13px;
  min-width: 0;
}

.seed-claim {
  display: grid;
  grid-template-columns: minmax(0, 92px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--body);
}

.seed-claim p {
  margin: 0;
}

.seed-claim-label {
  color: var(--muted);
}

/* 07 — sparse identification */

.sindy-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
}

.sindy-term {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 12.5px;
}

.sindy-term.is-on {
  border-color: var(--accent);
}

.sindy-tick {
  color: var(--accent);
  font-size: 10px;
}

.sindy-coef {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.sindy-equation {
  margin: 0 0 4px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

#sindy-equation {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}

@media screen and (max-width: 760px) {
  .demo-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .weight-row {
    grid-template-columns: minmax(0, 1fr) 28px;
  }

  .weight-row label {
    grid-column: 1 / -1;
  }

  .tree-leaves {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .seed-row {
    grid-template-columns: 52px minmax(0, 1fr) 56px;
    gap: 8px;
  }

  .schedule-time {
    font-size: 0;
  }

  .schedule-time.is-deadline::after {
    content: '↑';
    font-size: 10px;
  }
}

@media screen and (max-width: 640px) {
  #chat-widget {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  #chat-messages {
    min-height: 220px;
    max-height: calc(100vh - 250px);
  }

  .chat-header-copy small {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .research-flow {
    grid-template-columns: 1fr;
  }

  .research-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }

  .public-projects {
    grid-template-columns: 1fr;
  }

  .demo-side-by-side {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  #chat-widget {
    animation: none;
    transition: none;
  }

  #chat-widget.minimized #chat-header {
    animation: none;
  }

  .research-step,
  main article div#article_text .public-project-card {
    transition: none;
  }

  .research-step:hover,
  main article div#article_text .public-project-card:hover {
    transform: none;
  }
}

@media screen and (max-width: 1024px) {
  body {
    display: block;
    margin-left: 0;
  }

  aside {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  aside div#user_meta {
    min-height: 0;
    padding: 18px 24px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 26px;
  }

  #author_info {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  #author_info img {
    width: 88px;
    height: 88px;
  }

  aside div#user_meta nav {
    flex: 0 1 auto;
    min-width: 0;
  }

  aside div#user_meta ul {
    flex: 0 1 auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 22px;
    margin: 0;
    padding: 0;
    border-top: 0;
  }

  aside div#user_meta ul li {
    width: auto;
  }

  aside div#user_meta ul li:nth-last-child(2) {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  main {
    margin-left: 0;
    max-width: 100%;
    padding: 36px 28px 72px;
  }
}
/* Structured profile homepage */
.profile-hero {
  padding-bottom: 1.8rem;
  border-bottom: 1px solid var(--border);
}

.profile-hero .lead {
  max-width: 680px;
  margin: 0;
  color: var(--text-muted);
  font-size: clamp(1.08rem, 2.4vw, 1.25rem);
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  font-family: var(--font-sans);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.4rem;
}

main article .button-primary,
main article .button-secondary {
  display: inline-flex;
  min-height: 42px;
  padding: 0.65rem 0.9rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  border-radius: 0;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  font-family: var(--font-sans);
}

main article .button-primary {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

main article .button-secondary {
  background: transparent;
  color: var(--ink);
}

main article .button-primary:hover,
main article .button-primary:focus-visible,
main article .button-secondary:hover,
main article .button-secondary:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h2,
.section-heading p {
  margin-bottom: 0;
}

.profile-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.profile-card {
  min-width: 0;
  padding: 1.05rem;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: transparent;
}

.profile-card h3,
.profile-list-item h3,
.skill-groups h3 {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
}

.profile-card p {
  margin: 0.4rem 0 0;
}

.profile-card .card-meta {
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.profile-list {
  border-top: 1px solid var(--border);
}

.profile-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.3rem 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}

.profile-list-item > p:last-child,
.profile-list-item > ul {
  grid-column: 1 / -1;
  margin: 0.35rem 0 0;
}

.profile-card-grid--compact {
  margin-top: 1rem;
}

.date-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.recognition-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}

.recognition-list > div {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: 0.15rem 0.8rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}

.recognition-list .date-label {
  grid-row: 1 / 4;
}

.recognition-list span:not(.date-label),
.recognition-list small {
  color: var(--text-muted);
}

.skill-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

main article div#article_text .skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

main article div#article_text .skill-chips li {
  margin: 0;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.contact-panel {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: var(--accent-soft);
}

@media screen and (max-width: 640px) {
  .profile-card-grid,
  .skill-groups {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .profile-list-item {
    grid-template-columns: 1fr;
  }

  .profile-list-item > p:last-child,
  .profile-list-item > ul {
    grid-column: 1;
  }

  .date-label {
    white-space: normal;
  }

  main article .button-primary,
  main article .button-secondary {
    width: 100%;
  }
}
/* Keep the closed research guide unobtrusive; the full panel opens on demand. */
#chat-widget.minimized {
  width: 64px;
  max-height: 64px;
  border-radius: 50%;
}

#chat-widget.minimized #chat-header {
  min-height: 64px;
  padding: 10px;
  justify-content: center;
}

#chat-widget.minimized .chat-header-copy,
#chat-widget.minimized #chat-toggle {
  display: none;
}

#chat-widget.minimized .chat-header-icon {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  border-radius: 50%;
}
@media screen and (max-width: 640px) {
  #chat-widget.minimized {
    display: none;
  }
}
.work-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.work-steps > div {
  padding: 1rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.work-steps span {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.work-steps h3 {
  margin: 0.55rem 0 0.35rem;
  font-size: 1.02rem;
}

.work-steps p {
  margin: 0;
  color: var(--text-muted);
}

main article div#article_text .service-list {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

@media screen and (max-width: 640px) {
  .work-steps {
    grid-template-columns: 1fr;
  }
}
.now-status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 1.5rem;
}

main article div#article_text .now-status-strip a {
  display: flex;
  min-width: 0;
  padding: 0.8rem;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  color: var(--text);
  text-decoration: none;
}

main article div#article_text .now-status-strip a:hover,
main article div#article_text .now-status-strip a:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.now-status-strip span {
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  font-family: var(--font-sans);
}

.now-status-strip strong {
  line-height: 1.35;
}

.now-streams {
  display: grid;
  gap: 1rem;
}

.now-card {
  padding: 1.15rem;
  scroll-margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: transparent;
}

.now-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.now-card-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.status-pill {
  flex: 0 0 auto;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

.now-card-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.2rem;
  padding-top: 0.9rem;
}

.now-card-body .now-question {
  grid-column: 1 / -1;
}

.now-card h4 {
  margin: 0 0 0.3rem;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  font-family: var(--font-sans);
}

.now-card-body p {
  margin: 0;
}

.public-note {
  margin: 0.9rem 0 0;
  padding: 0.75rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  font-size: 0.9rem;
}

.now-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.public-boundary {
  padding: 1.1rem;
  border: 1px dashed var(--border);
  border-radius: var(--card-radius);
}

@media screen and (max-width: 640px) {
  .now-status-strip,
  .now-card-body {
    grid-template-columns: 1fr;
  }

  .now-card-body .now-question {
    grid-column: 1;
  }

  .now-card-header {
    flex-direction: column;
  }
}
.publication-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1.5rem 0;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.publication-summary > div {
  display: flex;
  min-width: 0;
  padding: 0.85rem;
  flex-direction: column;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.publication-summary strong {
  font-size: 1.1rem;
}

.publication-summary span {
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.publications-tools {
  margin: 1.2rem 0 0;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: var(--accent-soft);
}

.publications-tools label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.publications-tools > div {
  display: flex;
  gap: 0.5rem;
}

#publication-filter {
  min-width: 0;
  flex: 1;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

#publication-filter:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.publication-list {
  border-top: 1px solid var(--border);
}

#papers-list.publication-list li {
  padding: 1.1rem 0;
}

.publication-heading {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: start;
}

.publication-heading h2 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.4;
}

.publication-number {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.9;
}

#papers-list .paper-authors,
#papers-list .paper-meta {
  margin-left: 2.7rem;
}

#publication-empty {
  color: var(--text-muted);
}

@media screen and (max-width: 640px) {
  .publication-summary {
    grid-template-columns: 1fr;
  }

  .publications-tools > div {
    flex-direction: column;
  }

  .publication-heading {
    grid-template-columns: 1.7rem minmax(0, 1fr);
  }

  #papers-list .paper-authors,
  #papers-list .paper-meta {
    margin-left: 2.2rem;
  }
}

/* ==========================================================================
   Home — the index: a statement, what is running now, recent papers, and an
   inline research guide. Hairline rules separate the blocks; the two blocks
   that carry the page (now, and the guide) get an ink rule instead.
   ========================================================================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.home-bio {
  margin: 28px 0 0;
  max-width: 60ch;
}

.home-block {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--rule);
}

.home-block--major {
  margin-top: 44px;
  padding-top: 30px;
  border-top: 1px solid var(--ink);
}

.home-block-label {
  margin: 0 0 18px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.home-stream-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-stream {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
}

.home-stream-number {
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.home-stream a {
  font-size: 19px;
}

.home-stream-status {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--accent);
}

.home-publications {
  display: grid;
  gap: 15px;
}

.home-publication a,
.home-publication-title {
  font-size: 18.5px;
  line-height: 1.35;
}

.home-publication p {
  margin: 3px 0 0;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--muted);
}

.home-block-more {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--accent);
}

#home-ask-heading {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
}

.home-ask-field {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--ink);
}

#home-ask-input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  outline: none;
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.4;
  color: var(--ink);
}

#home-ask-input::placeholder {
  color: var(--muted);
}

#home-ask-send {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

#home-ask-send:disabled {
  cursor: wait;
  opacity: 0.6;
}

.home-ask-state {
  margin: 12px 0 0;
  max-width: 64ch;
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.home-ask-status {
  display: inline-flex;
  align-items: baseline;
}

.home-ask-status .ask-research-dot {
  margin-right: 7px;
}

.home-ask-state button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.home-ask-state button:hover,
.home-ask-state button:focus-visible {
  color: var(--ink);
}

.home-ask-answer {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.home-ask-answer-label {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--muted);
}

.home-ask-answer-text {
  margin: 0;
  max-width: 60ch;
  font-size: 18px;
  line-height: 1.66;
  color: var(--body);
}

/* Contact sits at the foot of every page. The address is the primary action
   on it, so it is set at reading size rather than as fine print. */

.site-contact {
  margin-top: 52px;
  padding-top: 26px;
  border-top: 1px solid var(--ink);
}

.site-contact-label {
  margin: 0 0 10px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.site-contact-email {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1.25;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 3px;
  overflow-wrap: anywhere;
}

.site-contact-email:hover,
.site-contact-email:focus {
  border-bottom-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.site-contact-note {
  margin: 12px 0 0;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--muted);
}

.site-contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 18px;
  font-family: var(--font-sans);
  font-size: 15px;
}

.site-contact-links a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.site-contact-links a:hover,
.site-contact-links a:focus {
  color: var(--accent);
}

@media screen and (max-width: 640px) {
  .site-contact-email {
    font-size: 21px;
  }
}


@media screen and (max-width: 640px) {
  .home-stream,
  .home-ask-answer {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .home-stream-status {
    justify-self: start;
  }

}

/* Index links carry their weight through type and rules, not underlines;
   the underline is the hover affordance, as elsewhere in the design. */
main article div#article_text .home-stream a,
main article div#article_text .home-publication a,
main article div#article_text .home-block-more {
  text-decoration: none;
}

main article div#article_text .home-stream a:hover,
main article div#article_text .home-stream a:focus,
main article div#article_text .home-publication a:hover,
main article div#article_text .home-publication a:focus,
main article div#article_text .home-block-more:hover,
main article div#article_text .home-block-more:focus {
  text-decoration: underline;
  text-underline-offset: 3px;
}
