/* =========================================================
   Austin Katz — site styles
   Tokens first; everything else reads from them.
   ========================================================= */
:root {
  --paper: #faf8f4;
  --surface: #ffffff;
  --surface-2: #f2eee6;
  --ink: #14213d;
  --text: #1f2633;
  --muted: #5a6273;
  --line: #e3ddd1;
  --accent: #b4532a;        /* terracotta */
  --accent-ink: #ffffff;
  --accent-soft: #f6e4da;
  --navy: #14213d;
  --navy-text: #eef1f7;
  --curve-prior: #8a94a8;
  --curve-advice: #b4532a;
  --curve-post: #14213d;

  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 33, 61, .05), 0 8px 28px rgba(20, 33, 61, .07);
  --max: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}
:root[data-theme="light"] { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1626;
    --surface: #161f33;
    --surface-2: #1b2640;
    --ink: #f3efe7;
    --text: #dde2ec;
    --muted: #9aa4b8;
    --line: #2a3654;
    --accent: #e48a5f;
    --accent-ink: #1a0f08;
    --accent-soft: #3a2519;
    --navy: #0a101d;
    --navy-text: #eef1f7;
    --curve-prior: #7b86a0;
    --curve-advice: #e48a5f;
    --curve-post: #f3efe7;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --paper: #0f1626;
    --surface: #161f33;
    --surface-2: #1b2640;
    --ink: #f3efe7;
    --text: #dde2ec;
    --muted: #9aa4b8;
    --line: #2a3654;
    --accent: #e48a5f;
    --accent-ink: #1a0f08;
    --accent-soft: #3a2519;
    --navy: #0a101d;
    --navy-text: #eef1f7;
    --curve-prior: #7b86a0;
    --curve-advice: #e48a5f;
    --curve-post: #f3efe7;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
    color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 17px/1.65 var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, iframe { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-serif); color: var(--ink); font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 3.6rem); font-variation-settings: "opsz" 144; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-variation-settings: "opsz" 96; }
h3 { font-size: 1.3rem; font-family: var(--font-serif); }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }
li { margin-bottom: .4em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 12px; }

.eyebrow {
  display: inline-block; font: 600 .78rem/1 var(--font-sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1rem;
}
.lede { font-size: clamp(1.08rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 40em; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em; justify-content: center;
  background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600;
  padding: .85em 1.4em; border-radius: 999px; border: 2px solid var(--accent);
  transition: transform .15s ease, box-shadow .15s ease, background .15s;
  cursor: pointer; font-size: 1rem; font-family: var(--font-sans);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(180, 83, 42, .25); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); box-shadow: none; }
.btn-small { padding: .5em 1.1em; font-size: .92rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.8rem; }
.arrow-link { font-weight: 600; text-decoration: none; }
.arrow-link::after { content: " →"; transition: margin .15s; }
.arrow-link:hover::after { margin-left: 4px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px; background: var(--ink); color: var(--paper);
  display: grid; place-items: center; font: 600 .95rem/1 var(--font-serif); letter-spacing: .02em; flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font: 600 1.1rem/1.1 var(--font-serif); }
.brand-sub { font-size: .74rem; color: var(--muted); letter-spacing: .02em; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 500; font-size: .97rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"]:not(.btn) { border-bottom-color: var(--accent); color: var(--ink); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; width: 44px; height: 44px; cursor: pointer; position: relative; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  position: absolute; left: 11px; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; content: ""; transition: transform .2s, top .2s;
}
.nav-toggle-bar { top: 20px; }
.nav-toggle-bar::before { left: 0; top: -6px; }
.nav-toggle-bar::after { left: 0; top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 900px) {   /* menu collapses before the 8-item header runs out of room */
  .nav-toggle { display: block; }
  .brand-sub { display: none; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 20px;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .site-nav a[aria-current="page"]:not(.btn) { border-bottom-color: var(--line); color: var(--accent); }
  .site-nav .btn { margin-top: 16px; }
}

/* ---------- sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-tight { padding: clamp(40px, 6vw, 72px) 0; }
.section-alt { background: var(--surface-2); }
.section-dark { background: var(--navy); color: var(--navy-text); }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .muted { color: #b7c0d3; }
.section-head { max-width: 680px; margin-bottom: 48px; }
.page-hero { padding: clamp(56px, 8vw, 96px) 0 clamp(32px, 5vw, 56px); }
.page-hero h1 { max-width: 18em; }

/* ---------- hero ---------- */
.hero { padding: clamp(56px, 8vw, 104px) 0 clamp(56px, 8vw, 96px); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-figure {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px 24px 18px; box-shadow: var(--shadow);
}
.hero-figure figcaption { font-size: .85rem; color: var(--muted); margin-top: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--muted); margin-top: 8px; }
.legend span::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: currentColor; }
.legend .l-prior { color: var(--curve-prior); }
.legend .l-advice { color: var(--curve-advice); }
.legend .l-post { color: var(--curve-post); }
.legend span { color: var(--muted); }
.legend .l-prior::before { background: var(--curve-prior); }
.legend .l-advice::before { background: var(--curve-advice); }
.legend .l-post::before { background: var(--curve-post); }
.curve-prior { stroke: var(--curve-prior); }
.curve-advice { stroke: var(--curve-advice); }
.curve-post { stroke: var(--curve-post); }
.fill-post { fill: var(--curve-post); opacity: .08; }
.axis { stroke: var(--line); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero-figure { max-width: 520px; } }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 28px 20px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat-num { display: block; font: 500 clamp(1.9rem, 3.4vw, 2.6rem)/1 var(--font-serif); color: var(--ink); margin-bottom: 8px; }
.stat-label { font-size: .9rem; color: var(--muted); line-height: 1.45; }
@media (max-width: 820px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(-n+2) { border-top: 0; }
  .stat:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--line); }
}

/* ---------- cards ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
.card .arrow-link { margin-top: auto; padding-top: 12px; }
.card-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 18px; }
.card-icon svg { width: 22px; height: 22px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 14px 0 0; }
.tag-list li { margin: 0; font-size: .8rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* ---------- proof / case ---------- */
.case { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.case-num { font: 500 clamp(4rem, 10vw, 7rem)/0.9 var(--font-serif); color: var(--accent); margin: 0 0 8px; }
.case-list { list-style: none; padding: 0; margin: 0; }
.case-list li { padding: 16px 0 16px 34px; border-top: 1px solid rgba(255,255,255,.14); position: relative; margin: 0; }
.case-list li::before { content: ""; position: absolute; left: 0; top: 24px; width: 18px; height: 2px; background: var(--accent); }
.case-list strong { color: #fff; }
@media (max-width: 820px) { .case { grid-template-columns: 1fr; } }

/* case study facts strip */
.case-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 32px 0 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.case-facts > div { padding: 16px 20px; border-left: 1px solid var(--line); }
.case-facts > div:first-child { border-left: 0; }
.case-facts dt { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.case-facts dd { margin: 0; color: var(--ink); font-size: .95rem; }
.case-facts strong { color: var(--accent); }
@media (max-width: 820px) {
  .case-facts { grid-template-columns: 1fr 1fr; }
  .case-facts > div:nth-child(3) { border-left: 0; }
  .case-facts > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; margin: 0; padding-top: 18px; border-top: 2px solid var(--ink); }
.steps li::before { content: "0" counter(step); display: block; font: 500 .9rem/1 var(--font-sans); letter-spacing: .1em; color: var(--accent); margin-bottom: 12px; }
.steps h3 { font-size: 1.15rem; }
.steps p { font-size: .95rem; color: var(--muted); margin: 0; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* ---------- service detail ---------- */
.service { display: grid; grid-template-columns: 280px 1fr; gap: clamp(24px, 5vw, 64px); padding: 48px 0; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.service:first-of-type { border-top: 0; padding-top: 0; }
.service-num { font: 500 .85rem/1 var(--font-sans); letter-spacing: .12em; color: var(--accent); text-transform: uppercase; display: block; margin-bottom: 12px; }
.service h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.service h3 { font-size: 1rem; font-family: var(--font-sans); font-weight: 600; color: var(--ink); margin: 1.4em 0 .5em; text-transform: uppercase; letter-spacing: .06em; }
.service ul { margin: 0; }
@media (max-width: 820px) { .service { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- faq ---------- */
.faq { border-top: 1px solid var(--line); padding: 4px 0; }
.faq:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 36px 18px 0; font: 500 1.12rem/1.35 var(--font-serif); color: var(--ink); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font: 400 1.6rem/1 var(--font-sans); color: var(--accent); transition: transform .2s; }
.faq[open] summary::after { transform: rotate(45deg); }
.faq > div { padding: 0 0 18px; color: var(--muted); max-width: 44em; }

/* ---------- research ---------- */
.interest { padding: 26px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 300px 1fr; gap: 24px; }
.interest h3 { margin: 0; font-size: 1.2rem; }
.interest p { margin: 0; color: var(--muted); }
@media (max-width: 760px) { .interest { grid-template-columns: 1fr; gap: 6px; } }
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 32px; }
.tool-body { padding: clamp(22px, 4vw, 36px); display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px; align-items: start; }
.tool-body h3 { font-size: 1.5rem; }
.tool-meta { font-size: .92rem; color: var(--muted); }
.tool-meta dt { font-weight: 600; color: var(--ink); margin-top: 10px; }
.tool-meta dd { margin: 2px 0 0; }
.tool-frame-wrap { border-top: 1px solid var(--line); background: var(--surface-2); }
.tool-frame-wrap iframe { width: 100%; height: 820px; border: 0; background: #fff; }
.tool-frame-wrap:empty { display: none; }
@media (max-width: 820px) { .tool-body { grid-template-columns: 1fr; } .tool-frame-wrap iframe { height: 700px; } }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 320px 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.portrait {
  aspect-ratio: 4 / 5; border-radius: 20px; background: linear-gradient(150deg, var(--ink), #2b3d66);
  display: grid; place-items: center; color: var(--paper); font: 500 5rem/1 var(--font-serif); box-shadow: var(--shadow);
  position: sticky; top: 100px; overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .portrait { background: linear-gradient(150deg, #2b3d66, #14213d); color: #f3efe7; } }
:root[data-theme="dark"] .portrait { background: linear-gradient(150deg, #2b3d66, #14213d); color: #f3efe7; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } .portrait { position: static; max-width: 260px; } }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); margin: 0; }
.timeline .when { color: var(--muted); font-size: .9rem; padding-top: 2px; }
.timeline strong { color: var(--ink); display: block; }
.timeline span.org { color: var(--muted); font-size: .95rem; }
@media (max-width: 560px) { .timeline li { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(32px, 6vw, 72px); align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 600; font-size: .92rem; color: var(--ink); margin-bottom: 6px; }
.field .opt { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hp { position: absolute; left: -9999px; }
.form-status { min-height: 1.5em; font-weight: 500; margin: 0; }
.form-status.ok { color: #2f7d4f; }
.form-status.err { color: #b3261e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .form-status.ok { color: #7bd19c; } :root:not([data-theme="light"]) .form-status.err { color: #ff8a80; } }
:root[data-theme="dark"] .form-status.ok { color: #7bd19c; } :root[data-theme="dark"] .form-status.err { color: #ff8a80; }
.aside-card { background: var(--surface-2); border-radius: var(--radius); padding: 28px; border: 1px solid var(--line); }
.aside-card h2 { font-size: 1.4rem; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { padding-left: 28px; position: relative; }
.check-list li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band .lede { margin-left: auto; margin-right: auto; }
.cta-band .btn-row { justify-content: center; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 40px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-name { font: 600 1.15rem/1.2 var(--font-serif); color: var(--ink); margin-bottom: .4em; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links a, .site-footer a { color: var(--text); text-decoration: none; }
.footer-links a:hover, .site-footer a:hover { color: var(--accent); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 20px; } }

/* ---------- 404 ---------- */
.not-found { min-height: 50vh; display: grid; align-content: center; }

/* =========================================================
   Work page: results, portfolio, history · About: goals
   ========================================================= */
.section-dark .arrow-link, .section-dark a:not(.btn) { color: #f0a47f; }
@media (max-width: 1000px) and (min-width: 821px) { .brand-sub { display: none; } .site-nav { gap: 20px; } }
.stats-more { margin: 18px 0 0; text-align: right; }

.jump-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.jump-links a {
  text-decoration: none; color: var(--ink); font-weight: 500; font-size: .92rem;
  padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.jump-links a:hover { border-color: var(--accent); color: var(--accent); }
#results, #portfolio, #before-after, #teaching-impact, #evaluations, #goals, #upcoming, #side-projects, #presentations, #publications, #simulators, #projects, #writing, #challenge, #result { scroll-margin-top: 80px; }

/* metrics */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.metric {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 26px 22px; display: flex; flex-direction: column; box-shadow: var(--shadow);
  border-top: 4px solid var(--accent);
}
.metric-num { font: 500 clamp(2.4rem, 4.4vw, 3.2rem)/1 var(--font-serif); color: var(--ink); margin-bottom: 12px; }
.metric-label { color: var(--text); line-height: 1.45; margin-bottom: 16px; }
.metric-ctx { margin-top: auto; font-size: .8rem; color: var(--muted); letter-spacing: .02em; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .metrics { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .metrics { grid-template-columns: 1fr; } }

/* portfolio filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter {
  font: 500 .92rem/1 var(--font-sans); color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.filter:hover { border-color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* project cards */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 820px) { .projects { grid-template-columns: 1fr; } }

/* upcoming projects & research */
.upcoming-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.upcoming { margin: 0; display: flex; flex-direction: column; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.upcoming-status { align-self: flex-start; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; margin-bottom: 14px; }
.upcoming h3 { font-size: 1.15rem; margin: 0 0 4px; }
.upcoming-org { font-size: .82rem; color: var(--muted); margin: 0 0 10px; }
.upcoming p:last-of-type { margin-bottom: 0; }
.upcoming .arrow-link { margin-top: auto; padding-top: 12px; }
.project {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.project[hidden] { display: none; }
.project-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; font-size: .8rem; }
.project-cat { font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.project-when { color: var(--muted); }
.project h3 { font-size: 1.35rem; margin-bottom: .25em; }
.project-org { color: var(--muted); font-size: .92rem; margin-bottom: 18px; }
.project-gao { margin: 0 0 4px; display: grid; gap: 14px; }
.project-gao > div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; }
.project-gao dt { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); padding-top: 4px; }
.project-gao dd { margin: 0; font-size: .96rem; line-height: 1.55; }
.project-gao > div:last-child dd { color: var(--ink); font-weight: 500; }
.project .tag-list { margin-top: 18px; }
.project .arrow-link { margin-top: auto; padding-top: 16px; }
@media (max-width: 480px) { .project { padding: 22px; } .project-gao > div { grid-template-columns: 1fr; gap: 2px; } }

/* organizations */
.org-names {
  list-style: none; padding: 0; margin: 0 0 40px; display: flex; flex-wrap: wrap; gap: 10px;
}
.org-names li {
  margin: 0; font: 500 1rem/1.2 var(--font-serif); color: var(--ink);
  padding: 12px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.org-history .note { display: block; color: var(--muted); font-size: .88rem; margin-top: 2px; }
.org-history li:last-child { border-bottom: 1px solid var(--line); }

/* goals */
.goals { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; counter-reset: goal; }
.goal {
  counter-increment: goal; margin: 0; position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 26px 22px 74px;
}
.goal::before {
  content: counter(goal); position: absolute; left: 24px; top: 24px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 600 .95rem/1 var(--font-sans);
}
.goal-for { display: block; font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.goal h3 { font-size: 1.2rem; margin-bottom: .35em; }
.goal p { margin: 0; color: var(--muted); font-size: .96rem; }
.goal:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 760px) { .goals { grid-template-columns: 1fr; } .goal { padding-left: 66px; } .goal::before { left: 18px; } }

/* =========================================================
   Dynamic layer: header actions, theme toggle, progress,
   reveal-on-scroll, hover motion, live hero model
   ========================================================= */
html, body { transition: background-color .3s ease, color .3s ease; }

/* header layout: brand | nav | actions */
.site-nav { order: 2; margin-left: auto; }
.header-actions { order: 3; display: flex; align-items: center; gap: 8px; }
.site-header { transition: box-shadow .25s ease, background-color .3s ease; }
.site-header.scrolled { box-shadow: 0 6px 24px rgba(20, 33, 61, .08); }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: border-color .15s, transform .2s;
}
.theme-toggle:hover { border-color: var(--ink); transform: rotate(-12deg); }
.theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; grid-area: 1 / 1; transition: opacity .25s, transform .35s; }
.theme-toggle .i-moon { opacity: 0; transform: rotate(-60deg) scale(.6); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { opacity: 0; transform: rotate(60deg) scale(.6); }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { opacity: 1; transform: none; }
}
:root[data-theme="dark"] .theme-toggle .i-sun { opacity: 0; transform: rotate(60deg) scale(.6); }
:root[data-theme="dark"] .theme-toggle .i-moon { opacity: 1; transform: none; }
@media (max-width: 820px) { .site-nav { margin-left: 0; } }

.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 60; pointer-events: none;
  background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--progress, 0));
}

/* reveal on scroll: only when JS is running and motion is OK */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0ms); }
  .js .reveal.in { opacity: 1; transform: none; }
  [data-cat].pop { animation: pop .45s cubic-bezier(.2, .7, .2, 1) both; animation-delay: var(--d, 0ms); }
  @keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
}

/* hover motion */
.card, .project, .metric, .goal, .tool { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
@media (hover: hover) {
  .card:hover, .project:hover, .metric:hover, .goal:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(20,33,61,.06), 0 18px 40px rgba(20,33,61,.12); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
  .card:hover .card-icon { transform: scale(1.08) rotate(-4deg); }
}
.card-icon { transition: transform .3s ease; }
.btn:active { transform: translateY(1px) scale(.98); }

/* live hero model */
.woa-control { margin: 14px 0 4px; }
.woa-control label { display: flex; justify-content: space-between; align-items: baseline; font-size: .85rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.woa-control output { font: 500 1.15rem/1 var(--font-serif); color: var(--accent); font-variant-numeric: tabular-nums; }
.woa-control input[type="range"] { width: 100%; accent-color: var(--accent); cursor: pointer; height: 24px; }
.woa-verdict { font-size: .85rem; margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--text); transition: background-color .25s, color .25s; }
.woa-verdict::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: currentColor; }
.woa-verdict[data-zone="under"] { color: #8a5a00; background: #fbf1dc; }
.woa-verdict[data-zone="cal"]   { color: #1f6b45; background: #e2f3e9; }
.woa-verdict[data-zone="over"]  { color: #a2321f; background: #fbe4df; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .woa-verdict[data-zone="under"] { color: #f3c66b; background: #3a2e12; }
  :root:not([data-theme="light"]) .woa-verdict[data-zone="cal"]   { color: #86d9aa; background: #143224; }
  :root:not([data-theme="light"]) .woa-verdict[data-zone="over"]  { color: #ff9b85; background: #3d1a14; }
}
:root[data-theme="dark"] .woa-verdict[data-zone="under"] { color: #f3c66b; background: #3a2e12; }
:root[data-theme="dark"] .woa-verdict[data-zone="cal"]   { color: #86d9aa; background: #143224; }
:root[data-theme="dark"] .woa-verdict[data-zone="over"]  { color: #ff9b85; background: #3d1a14; }
.woa-marker { stroke: var(--curve-post); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: .7; }
.woa-opt { fill: var(--accent); }
.hero-figure { transition: box-shadow .3s ease, transform .3s ease; }
.hero-figure:hover { box-shadow: 0 2px 4px rgba(20,33,61,.06), 0 22px 48px rgba(20,33,61,.14); }

/* count-up numbers keep their width steady */
.stat-num, .metric-num, .case-num { font-variant-numeric: tabular-nums; }

/* =========================================================
   Bento homepage
   ========================================================= */
.bento-wrap { padding: clamp(24px, 4vw, 48px) 0 clamp(56px, 8vw, 96px); }
.bento {
  display: grid; gap: 16px;
  grid-template-columns: repeat(4, 1fr);
  grid-template-areas:
    "intro    intro    intro    intro"
    "model    model    case     case"
    "model    model    grant    team"
    "teach    services services services"
    "research research open     open"
    "orgs     orgs     orgs     where"
    "cta      cta      cta      cta";
}
.tile-intro    { grid-area: intro; }
.tile-model    { grid-area: model; }
.tile-case     { grid-area: case; }
.tile-grant    { grid-area: grant; }
.tile-team     { grid-area: team; }
.tile-teach    { grid-area: teach; }
.tile-services { grid-area: services; }
.tile-research { grid-area: research; }
.tile-open     { grid-area: open; }
.tile-orgs     { grid-area: orgs; }
.tile-where    { grid-area: where; }
.tile-cta      { grid-area: cta; }

.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: clamp(20px, 2.4vw, 30px); box-shadow: var(--shadow);
  display: flex; flex-direction: column; min-width: 0; margin: 0;
  color: var(--text); text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.tile p:last-child { margin-bottom: 0; }
.tile .arrow-link { margin-top: auto; padding-top: 14px; color: var(--accent); }
.tile-label { font: 600 .72rem/1 var(--font-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.tile-title { font-size: clamp(1.25rem, 1.9vw, 1.55rem); margin-bottom: .45em; }
.tile-quote { font: 500 clamp(1.1rem, 1.5vw, 1.3rem)/1.35 var(--font-serif); color: var(--ink); margin: 0 0 .5em; }
.tile .stat-num { font: 500 clamp(2.2rem, 3.6vw, 3rem)/1 var(--font-serif); color: var(--ink); margin-bottom: 12px; display: block; }
.tile-stat p { font-size: .92rem; color: var(--muted); line-height: 1.45; }
@media (hover: hover) {
  .tile-link:hover, .tile-stat:hover, .tile-services:hover, .tile-orgs:hover {
    transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
    box-shadow: 0 2px 4px rgba(20,33,61,.06), 0 18px 40px rgba(20,33,61,.12);
  }
}

/* intro */
.tile-intro { flex-direction: row; align-items: center; gap: clamp(24px, 4vw, 56px); padding: clamp(28px, 4.5vw, 60px); }
.intro-main { flex: 1 1 0; min-width: 0; }
.intro-photo { flex: 0 0 clamp(220px, 30%, 380px); margin: 0; position: relative; }
.intro-photo::before { content: ""; position: absolute; inset: 14px -14px -14px 14px; border-radius: 26px; background: var(--accent-soft); z-index: 0; }
.intro-photo img { position: relative; z-index: 1; display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 22px; box-shadow: 0 18px 40px rgba(20, 33, 61, .18); }
@media (max-width: 820px) {
  .tile-intro { flex-direction: column; align-items: stretch; gap: 0; }
  .intro-main { display: contents; }
  .hero-brand { order: 1; }
  .intro-photo { order: 2; flex-basis: auto; width: min(240px, 64%); margin: 0 0 34px 0; }
  .home-intro-rest { order: 3; }
}
.tile-intro h1 { font-size: clamp(2.2rem, 4.4vw, 3.3rem); }
.tile-intro h1 em { font-style: italic; color: var(--accent); }
.tile-intro .lede { font-size: clamp(1.02rem, 1.4vw, 1.15rem); }

/* model */
.tile-model { justify-content: center; }
.tile-model figcaption { font-size: .82rem; color: var(--muted); margin-top: 10px; }

/* variants */
.tile-dark { background: var(--navy); border-color: var(--navy); color: var(--navy-text); }
.tile-dark .tile-title, .tile-dark .stat-num { color: #fff; }
.tile-dark p { color: #c3cbdc; }
.tile-dark .tile-label, .tile-dark .arrow-link { color: #f0a47f; }
.tile-case .tile-big { font-size: clamp(3.6rem, 7vw, 5.4rem); color: #f0a47f; }
.tile-accent { background: var(--accent); border-color: var(--accent); }
.tile-accent .stat-num { color: var(--accent-ink); }
.tile-accent p { color: color-mix(in srgb, var(--accent-ink) 82%, transparent); }
.tile-soft { background: var(--surface-2); box-shadow: none; }
.tile-link .tile-title { transition: color .2s; }
.tile-link:hover .tile-title { color: var(--accent); }
.tile-dark.tile-link:hover .tile-title { color: #f0a47f; }

/* services list */
.tile-services { justify-content: space-between; }
.tile-services-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tile-services-list li { margin: 0; }
.tile-services-list a {
  display: flex; flex-direction: column; gap: 4px; height: 100%; text-decoration: none;
  padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid transparent; transition: border-color .2s;
}
.tile-services-list a:hover { border-color: var(--accent); }
.tile-services-list strong { color: var(--ink); font: 500 1.05rem/1.25 var(--font-serif); }
.tile-services-list strong::after { content: " →"; color: var(--accent); }
.tile-services-list span { color: var(--muted); font-size: .88rem; line-height: 1.45; }

/* organizations */
.tile-org-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tile-org-list li { margin: 0; font: 500 .92rem/1.2 var(--font-serif); color: var(--ink); padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }

/* call to action */
.tile-cta { flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(26px, 4vw, 44px); }
.tile-cta .btn { flex: none; }

/* tablet: two columns */
@media (max-width: 980px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas:
      "intro    intro"
      "model    model"
      "case     grant"
      "case     team"
      "teach    where"
      "services services"
      "research research"
      "open     open"
      "orgs     orgs"
      "cta      cta";
  }
  .tile-model { max-width: none; }
}
/* phone: one column, stats side by side */
@media (max-width: 600px) {
  .bento {
    grid-template-columns: 1fr 1fr; gap: 12px;
    grid-template-areas:
      "intro    intro"
      "model    model"
      "case     case"
      "grant    team"
      "teach    where"
      "services services"
      "research research"
      "open     open"
      "orgs     orgs"
      "cta      cta";
  }
  .tile .stat-num { font-size: 1.9rem; }
  .tile-stat p, .tile-where p { font-size: .82rem; }
  .tile-services-list { grid-template-columns: 1fr; }
  .tile-cta { flex-direction: column; align-items: flex-start; }
}

/* ---------- social profile links ---------- */
.social-icons { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.social-icons li { margin: 0; }
.social-icons a {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  transition: color .15s, border-color .15s, transform .2s;
}
.social-icons a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.social-icons svg, .social-list svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile-where .social-icons { margin-top: auto; padding-top: 14px; }
.social-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; }
.social-list li { margin: 0; }
.social-list a {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; text-decoration: none;
  color: var(--ink); font-weight: 500; background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, color .15s;
}
.social-list a:hover { border-color: var(--accent); color: var(--accent); }
.social-list a::after { content: "↗"; margin-left: auto; color: var(--muted); }

/* ---------- affiliations ---------- */
.affils { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.affils li { margin: 0; }
.affil {
  display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 18px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; position: relative;
  transition: border-color .2s, transform .2s;
}
a.affil::after { content: "↗"; position: absolute; top: 16px; right: 18px; color: var(--muted); transition: color .2s; }
a.affil:hover { border-color: var(--accent); transform: translateY(-2px); }
a.affil:hover::after, a.affil:hover .affil-name { color: var(--accent); }
.affil-name { font: 500 1.1rem/1.25 var(--font-serif); color: var(--ink); padding-right: 22px; transition: color .2s; }
.affil-org { color: var(--muted); font-size: .92rem; }
.affil-role { margin-top: 8px; font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.affils-more { margin: 18px 0 0; }

/* ---------- publications ---------- */
.pubs { list-style: none; padding: 0; margin: 0; }
.pub { display: grid; grid-template-columns: 140px 1fr; gap: 20px; padding: 22px 0; border-top: 1px solid var(--line); margin: 0; }
.pub:last-child { border-bottom: 1px solid var(--line); }
.pub-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.pub-year { font: 500 1.05rem/1 var(--font-serif); color: var(--ink); }
.pub-status { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 4px 8px; border-radius: 999px; }
.pub-cite { margin: 0; line-height: 1.55; }
.pub-cite strong { color: var(--ink); }
.pub-cite cite { font-style: normal; font-weight: 500; color: var(--ink); }
.pub-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pub-links a {
  font-size: .82rem; font-weight: 600; text-decoration: none; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); transition: border-color .15s, color .15s;
}
.pub-links a::after { content: " ↗"; color: var(--muted); }
.pub-links a:hover { border-color: var(--accent); color: var(--accent); }
.pubs-more { margin-top: 24px; }
@media (max-width: 600px) { .pub { grid-template-columns: 1fr; gap: 8px; } .pub-meta { flex-direction: row; align-items: center; } }

/* ---------- open to roles ---------- */
.tile-accent-soft { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.open-to-roles { list-style: none; padding: 0; margin: 4px 0 12px; display: grid; gap: 8px; }
.open-to-roles li { margin: 0; padding-left: 22px; position: relative; color: var(--text); font-size: .95rem; line-height: 1.45; }
.open-to-roles li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tile-open .muted { margin-bottom: 0; }
.open-to-band {
  display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(24px, 5vw, 56px); align-items: start;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 20px; padding: clamp(24px, 4vw, 44px);
}
.open-to-band h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.open-to-band .btn-row { margin-top: 18px; }
@media (max-width: 820px) { .open-to-band { grid-template-columns: 1fr; } }
.tile-cta .btn-row { margin-top: 0; flex: none; }
.tile-dark .btn-ghost, .section-dark .btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.tile-dark .btn-ghost:hover, .section-dark .btn-ghost:hover { border-color: #fff; }
.section-dark .btn-row { justify-content: center; }

/* ---------- CV ---------- */
.cv-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.cv-head h1 { margin-bottom: .2em; }
.cv-head .lede { margin-bottom: .6em; }
.cv-contact { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); margin: 0; }
.cv-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.cv-block { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 32px 0; border-top: 1px solid var(--line); }
.cv-block h2 { font-size: 1.3rem; margin: 0; }
.cv-block > :not(h2) { grid-column: 2; }
.cv-block > .cv-sub { margin-top: 6px; margin-bottom: -12px; }
.cv-block .timeline li:first-child { border-top: 0; padding-top: 0; }
.cv-points { margin: 8px 0 0; padding-left: 1.1em; color: var(--text); font-size: .95rem; }
.timeline .cv-points li { display: list-item; padding: 0; border: 0; margin: 0 0 .3em; }
.cv-list { margin: 0; padding-left: 1.1em; }
.cv-skills { margin: 0; display: grid; gap: 12px; }
.cv-skills > div { display: grid; grid-template-columns: 160px 1fr; gap: 12px; }
.cv-skills dt { font-weight: 600; color: var(--ink); }
.cv-skills dd { margin: 0; }
.cv .pubs .pub:first-child { border-top: 0; padding-top: 0; }
.cv-note { margin: 12px 0 0; }
@media (max-width: 760px) {
  .cv-block { grid-template-columns: 1fr; gap: 12px; }
  .cv-block > * { grid-column: 1 !important; }
  .cv-skills > div { grid-template-columns: 1fr; gap: 2px; }
}

@media print {
  .site-header, .site-footer, .scroll-progress, .skip-link, .cv-actions, .theme-toggle { display: none !important; }
  :root, :root[data-theme="dark"] {
    --paper: #fff; --surface: #fff; --surface-2: #fff; --ink: #000; --text: #111; --muted: #444; --line: #ccc;
    --accent: #000; --accent-soft: #eee; color-scheme: light;
  }
  body { font-size: 10.5pt; line-height: 1.45; background: #fff; color: #111; }
  a { color: inherit; text-decoration: none; }
  .page-hero, .section { padding: 0 !important; }
  .cv-hero { margin-bottom: 12pt; }
  .cv-head h1 { font-size: 22pt; }
  .eyebrow { margin-bottom: 4pt; }
  .cv-block { padding: 10pt 0; grid-template-columns: 1.4in 1fr; gap: 12pt; }
  .cv-block h2 { break-after: avoid; }
  .timeline > li, .pub, .pres li, .cv-list li, .cv-skills > div { break-inside: avoid; }
  .cv-block > h2 { grid-column: 1 !important; }
  .cv-block > :not(h2) { grid-column: 2 !important; }
  .cv-block h2 { font-size: 12pt; }
  .timeline li { padding: 6pt 0; grid-template-columns: 1.1in 1fr; }
  .pub { grid-template-columns: 1fr; gap: 2pt; padding: 6pt 0; }
  .pub-links, .pub-status { display: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
  @page { margin: 0.6in; }
}

/* ---------- teaching ---------- */
#teaching { scroll-margin-top: 80px; }
.teach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.teach-sub { font: 600 .8rem/1.2 var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); margin: 28px 0 12px; }
.teach-mentoring { font-size: .95rem; }
.courses { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.course {
  margin: 0; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow);
}
.course-when { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.course h3 { font-size: 1.2rem; margin: 6px 0 2px; }
.course-role { color: var(--accent); font-size: .88rem; font-weight: 600; margin: 0 0 6px; }
.course-note { color: var(--muted); font-size: .94rem; margin: 0; }
.teach-quote { margin: 18px 0; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; }
.teach-quote p { font: 500 1.05rem/1.45 var(--font-serif); color: var(--ink); margin: 0 0 6px; }
.teach-quote cite { font-style: normal; font-size: .82rem; color: var(--muted); }
.cv-sub { font: 600 .8rem/1.2 var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); margin: 18px 0 8px; }
.tile-accent.tile-link:hover { border-color: var(--accent); }
@media (max-width: 820px) { .teach-grid { grid-template-columns: 1fr; } }

/* ---------- teaching & FAQ pages ---------- */
.courses-wide { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .courses-wide { grid-template-columns: 1fr; } }
.teach-teaser {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(22px, 3.5vw, 36px); box-shadow: var(--shadow);
  transition: border-color .2s, transform .2s;
}
.teach-teaser h2 { margin-bottom: .3em; }
.teach-teaser p { margin: 0; max-width: 40em; }
.teach-teaser:hover { border-color: var(--accent); transform: translateY(-2px); }
.faq-group { scroll-margin-top: 90px; margin-bottom: 48px; }
.faq-group:last-child { margin-bottom: 0; }
.faq-group h2 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); margin-bottom: 12px; }
.faq > div ul { margin: 0 0 .8em; }
.faq-pointer h2 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); }
@media (max-width: 1100px) and (min-width: 821px) { .site-nav { gap: 16px; } .site-nav a:not(.btn) { font-size: .92rem; } }

/* ---------- presentations, media, CV extras ---------- */
#presentations, #writing, #publications { scroll-margin-top: 80px; }
.pres { list-style: none; padding: 0; margin: 0; }
.pres li { display: grid; grid-template-columns: 90px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); margin: 0; }
.pres li:last-child { border-bottom: 1px solid var(--line); }
.pres p { margin: 0; font-size: .95rem; line-height: 1.55; }
.pres cite { font-style: italic; color: var(--ink); }
.pres strong { color: var(--ink); }
.pres-year { font: 500 1rem/1.4 var(--font-serif); color: var(--ink); }
.cv .pres li:first-child { border-top: 0; padding-top: 0; }
.cv-lead { margin: 0 0 12px; font-size: .95rem; }
.course-lead { border-left-color: var(--ink); background: var(--accent-soft); }
@media (max-width: 600px) { .pres li { grid-template-columns: 1fr; gap: 2px; } }
@media print { .pres li { padding: 4pt 0; grid-template-columns: .6in 1fr; } .pres p { font-size: 9.5pt; } }

/* ---------- filterable lists (publications, presentations, projects) ---------- */
.filter-n { display: inline-block; min-width: 1.5em; margin-left: 4px; padding: 2px 6px; border-radius: 999px; font-size: .75rem; background: var(--line); color: var(--text); }
.filter[aria-pressed="true"] .filter-n { background: color-mix(in srgb, var(--paper) 22%, transparent); color: var(--paper); }
.filter-group .filters { margin-bottom: 20px; }
.show-all { margin-top: 20px; }
.pres-grouped li > div { min-width: 0; }
.pres-venues { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 2px; font-size: .85rem; color: var(--muted); }
.pres-venues li { display: block; padding: 0; border: 0; margin: 0; }
.pres-grouped li:last-child .pres-venues li:last-child { border-bottom: 0; }
.pres-topic { display: inline-block; margin-top: 10px; font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 4px 8px; border-radius: 999px; }
[data-cat]:focus { outline: none; }
[data-cat]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* ---------- teaching timeline grid ---------- */
.tl-block { margin: 0 0 40px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); }
.tl-summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; margin-bottom: 18px; }
.tl-summary p { margin: 0; color: var(--muted); }
.tl-summary strong { font: 500 1.35rem/1 var(--font-serif); color: var(--ink); }
.tl-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; font-size: .85rem; color: var(--muted); }
.tl-legend li { display: flex; align-items: center; gap: 8px; margin: 0; }
.tl-swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.tl-block { overflow: clip; overflow-clip-margin: 8px; }   /* stop the sticky column widening the page on phones */
.tl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tl-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.tl { border-collapse: separate; border-spacing: 4px; width: 100%; min-width: 760px; table-layout: fixed; }
.tl th, .tl td { padding: 0; font-weight: 500; }
.tl-corner, .tl-course-h, .tl-course { width: 210px; }
.tl-year { font: 500 .85rem/1.2 var(--font-serif); color: var(--ink); text-align: left; padding: 0 0 2px 2px; border-left: 1px solid var(--line); }
.tl-term { font-size: .68rem; color: var(--muted); text-align: center; letter-spacing: .04em; }
.tl-course-h { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: left; }
.tl-course { text-align: left; font-size: .88rem; color: var(--ink); line-height: 1.25; padding-right: 10px; }
.tl-code { display: block; font-size: .68rem; letter-spacing: .06em; color: var(--muted); }
.tl-cell { height: 30px; border-radius: 6px; background: color-mix(in srgb, var(--line) 45%, transparent); }
.tl-lead { background: var(--accent); }
.tl-assist { background: color-mix(in srgb, var(--ink) 62%, var(--paper)); }
.tl-on { cursor: default; transition: transform .15s ease, box-shadow .15s ease; }
.tl-on:hover { transform: scale(1.12); box-shadow: 0 4px 12px rgba(20, 33, 61, .18); }
.tl-detail { margin: 14px 0 0; min-height: 1.5em; font-size: .9rem; color: var(--muted); }
.tl-detail.on { color: var(--ink); font-weight: 500; }
@media (prefers-reduced-motion: no-preference) {
  .js .tl-block.reveal .tl-on { opacity: 0; transform: scale(.4); }
  .js .tl-block.reveal.in .tl-on { opacity: 1; transform: none; transition: opacity .4s ease, transform .45s cubic-bezier(.2, .7, .2, 1.3); transition-delay: calc(250ms + var(--i, 0) * 45ms); }
  .js .tl-block.reveal.in .tl-on:hover { transform: scale(1.12); transition-delay: 0ms; }
}
@media (hover: none) { .tl-detail { display: none; } }
@media print { .tl-block { break-inside: avoid; } .tl-detail { display: none; } }

/* ---------- CV section menu ---------- */
.cv-toc { position: sticky; top: 72px; z-index: 40; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.cv-toc ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 10px 0; overflow-x: auto; scrollbar-width: none; }
.cv-toc ul::-webkit-scrollbar { display: none; }
.cv-toc li { margin: 0; flex: none; }
.cv-toc a { display: block; padding: 7px 12px; border-radius: 999px; font-size: .85rem; color: var(--muted); text-decoration: none; white-space: nowrap; transition: background .15s, color .15s; }
.cv-toc a:hover { color: var(--ink); background: var(--surface); }
.cv-toc a[aria-current="true"] { color: var(--paper); background: var(--ink); }
.cv-block h2[id] { scroll-margin-top: 140px; }
@media print { .cv-toc { display: none !important; } }
.tl-corner, .tl-course-h, .tl-course { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 4px 0 0 var(--surface); }
@media (max-width: 700px) {
  .tl { min-width: 620px; border-spacing: 3px; }
  .tl-corner, .tl-course-h, .tl-course { width: 118px; }
  .tl-course { font-size: .78rem; }
  .tl-cell { height: 26px; }
}

/* ---------- research profile cards (Google Scholar, ResearchGate) ---------- */
.profiles { list-style: none; padding: 0; margin: 0 0 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.profiles li { margin: 0; }
.profile-card {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon body" "icon go"; gap: 4px 16px; height: 100%;
  padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); text-decoration: none; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.profile-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 28px rgba(20, 33, 61, .10); }
.profile-icon { grid-area: icon; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.profile-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.profile-body { grid-area: body; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.profile-name { font: 500 1.2rem/1.2 var(--font-serif); color: var(--ink); }
.profile-blurb { font-size: .9rem; color: var(--muted); line-height: 1.45; }
.profile-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: .85rem; color: var(--muted); }
.profile-stats strong { font: 500 1.15rem/1 var(--font-serif); color: var(--ink); margin-right: 2px; }
.profile-asof { font-size: .75rem; color: var(--muted); }
.profile-go { grid-area: go; margin-top: 10px; font-size: .9rem; font-weight: 500; color: var(--accent); }
.profile-go::after { content: " ↗"; }
@media print { .profiles { display: none; } }

/* ---------- testimonials & references ---------- */
#references { scroll-margin-top: 80px; }
.quotes { list-style: none; padding: 0; margin: 0 0 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.quotes li { margin: 0; }
.quote-card { margin: 0; height: 100%; display: flex; flex-direction: column; gap: 18px; padding: 26px 26px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.quote-card blockquote { margin: 0; padding: 0; border: 0; position: relative; }
.quote-card blockquote::before { content: "“"; display: block; font: 500 3rem/0.6 var(--font-serif); color: var(--accent); margin-bottom: 10px; }
.quote-card blockquote p { margin: 0; font: 400 1.08rem/1.55 var(--font-serif); color: var(--ink); }
.quote-card figcaption, .refs li { display: flex; flex-direction: column; gap: 2px; font-size: .9rem; color: var(--muted); }
.quote-card figcaption { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.quote-card figcaption strong, .refs strong { color: var(--ink); font-weight: 600; }
.quote-rel { font-size: .8rem; }
.refs { list-style: none; padding: 0; margin: 0 0 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.refs li { margin: 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.refs-ask { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; padding: 22px 26px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface-2, var(--surface)); }
.refs-ask p { margin: 0; max-width: 60ch; color: var(--text); }

/* ---------- KatzLabs logo ---------- */
.lm { width: 40px; height: 40px; flex: none; display: block; }
.lm-bg { fill: var(--ink); }
.lm-base { stroke: var(--paper); stroke-opacity: .35; stroke-width: 2.5; stroke-linecap: round; fill: none; }
.lm-prior { stroke: var(--paper); stroke-opacity: .7; stroke-width: 3.2; stroke-linecap: round; fill: none; }
.lm-fill { fill: var(--logo-accent); fill-opacity: .28; }
.lm-post { stroke: var(--logo-accent); stroke-width: 3.6; stroke-linecap: round; fill: none; }
:root { --logo-accent: #e48a5f; }
:root[data-theme="dark"] { --logo-accent: #c4572b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --logo-accent: #c4572b; } }
.wordmark { font: 600 1.32rem/1 var(--font-serif); letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.wordmark span { font-weight: 400; color: var(--accent); }
.brand-text { display: flex; flex-direction: column; gap: 4px; }

/* big logo on the homepage */
.hero-brand { display: flex; align-items: center; gap: clamp(14px, 2vw, 22px); margin: 0 0 clamp(22px, 3vw, 34px); }
.lm-hero { width: clamp(64px, 8vw, 104px); height: clamp(64px, 8vw, 104px); }
.wordmark-hero { font-size: clamp(2.9rem, 7.2vw, 5.4rem); letter-spacing: -.025em; }
@media (prefers-reduced-motion: no-preference) {
  .lm-hero .lm-prior, .lm-hero .lm-post { stroke-dasharray: 1; stroke-dashoffset: 1; animation: lm-draw 1.1s cubic-bezier(.55, .1, .3, 1) .15s forwards; }
  .lm-hero .lm-post { animation-delay: .6s; animation-duration: 1.2s; }
  .lm-hero .lm-fill { opacity: 0; animation: lm-fade .7s ease 1.5s forwards; }
  .lm-hero .lm-bg { transform-origin: 50% 50%; animation: lm-pop .6s cubic-bezier(.2, .8, .2, 1.2) both; }
  .wordmark-hero { animation: lm-rise .8s cubic-bezier(.2, .7, .2, 1) .25s both; }
  .home-intro-rest { animation: lm-rise .8s cubic-bezier(.2, .7, .2, 1) .55s both; }
  .intro-photo { animation: lm-rise .9s cubic-bezier(.2, .7, .2, 1) .4s both; }
  @keyframes lm-draw { to { stroke-dashoffset: 0; } }
  @keyframes lm-fade { to { opacity: 1; } }
  @keyframes lm-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes lm-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
}

/* =========================================================
   Charts (teaching evaluations, before/after results)
   Colors validated for color-vision deficiency, light and dark.
   ========================================================= */
:root {
  --lk-poor: #a0401c; --lk-fair: #e0835a; --lk-good: #d6d1c7; --lk-vg: #6f9ad6; --lk-exc: #1f4f9a;
  --db-before: #9aa0ab; --db-after: var(--accent); --chart-grid: #e7e2d8;
}
:root[data-theme="dark"] { --lk-poor: #f08a5a; --lk-fair: #a85434; --lk-good: #2c3343; --lk-vg: #3f6aa8; --lk-exc: #7fb0f0; --db-before: #6b7385; --chart-grid: #26314a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --lk-poor: #f08a5a; --lk-fair: #a85434; --lk-good: #2c3343; --lk-vg: #3f6aa8; --lk-exc: #7fb0f0; --db-before: #6b7385; --chart-grid: #26314a; }
}
.chart { margin: 0 0 28px; padding: clamp(18px, 3vw, 30px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.chart figcaption { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.chart figcaption strong { font: 500 1.2rem/1.25 var(--font-serif); color: var(--ink); }
.chart figcaption span { font-size: .88rem; color: var(--muted); max-width: 70ch; }
.chart-source { margin: 14px 0 0; font-size: .78rem; color: var(--muted); }
.chart-table { margin-top: 16px; font-size: .88rem; }
.chart-table summary { cursor: pointer; color: var(--accent); font-weight: 500; }
.chart-table table { width: 100%; margin-top: 10px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.chart-table th[scope="row"], .chart-table thead th:first-child, .chart-table td:nth-child(2):not(:last-child) { text-align: left; }
.chart-table thead th { color: var(--muted); font-weight: 500; }
@media (max-width: 640px) {
  .chart-table table { display: block; overflow-x: auto; white-space: nowrap; font-size: .8rem; }
  .chart-table th[scope="row"] { white-space: normal; min-width: 150px; }
}
.chart-tip { position: fixed; z-index: 90; pointer-events: none; padding: 6px 10px; border-radius: 8px; background: var(--ink); color: var(--paper); font-size: .8rem; line-height: 1.3; box-shadow: 0 6px 18px rgba(0,0,0,.18); transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; }

/* stat tiles */
.eval-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.eval-stat { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.eval-num { font: 600 clamp(1.8rem, 3vw, 2.3rem)/1 var(--font-sans); color: var(--ink); letter-spacing: -.01em; }
.eval-num small { font-size: .5em; font-weight: 500; color: var(--muted); }
.eval-label { font-size: .85rem; color: var(--muted); line-height: 1.4; }
@media (max-width: 820px) { .eval-stats { grid-template-columns: 1fr 1fr; } }

/* diverging stacked bar */
.lk-legend, .db-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 14px; padding: 0; font-size: .82rem; color: var(--text); }
.lk-legend li, .db-legend li { display: flex; align-items: center; gap: 6px; margin: 0; }
.lk-sw, .db-sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lk-head, .lk-row { display: grid; grid-template-columns: minmax(150px, 30%) 1fr 52px; gap: 14px; align-items: center; }
.lk-axis { position: relative; height: 16px; font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lk-axis span { position: absolute; transform: translateX(-50%); }
.lk-mean-h { font-size: .7rem; color: var(--muted); text-align: right; }
.lk-rows { list-style: none; margin: 0; padding: 0; }
.lk-row { margin: 0; padding: 7px 0; }
.lk-first { padding-bottom: 12px; margin-bottom: 5px; border-bottom: 1px solid var(--line); }
.lk-first .lk-label { font-weight: 600; color: var(--ink); }
.lk-label { font-size: .86rem; color: var(--text); line-height: 1.3; }
.lk-track { position: relative; height: 22px; background:
  linear-gradient(var(--chart-grid), var(--chart-grid)) calc(20% - .5px) 0 / 1px 100% no-repeat; }
.lk-seg { position: absolute; top: 0; bottom: 0; border-right: 2px solid var(--surface); }
.lk-seg:first-child { border-radius: 4px 0 0 4px; }
.lk-seg:nth-last-child(2) { border-radius: 0 4px 4px 0; border-right: 0; }
.lk-end { position: absolute; top: 50%; transform: translate(6px, -50%); font-size: .76rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.lk-mean { text-align: right; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.lk-poor { background: var(--lk-poor); } .lk-fair { background: var(--lk-fair); } .lk-good { background: var(--lk-good); }
.lk-vg { background: var(--lk-vg); } .lk-exc { background: var(--lk-exc); }
.lk-seg:hover, .db-dot:hover { filter: brightness(1.08); }
@media (max-width: 640px) {
  .lk-head, .lk-row { grid-template-columns: 1fr 44px; gap: 4px 10px; }
  .lk-label { grid-column: 1 / -1; }
  .lk-head > span:first-child { display: none; }
}

/* dumbbell */
.db-rows { list-style: none; margin: 0; padding: 0; }
.db-row { display: grid; grid-template-columns: minmax(170px, 30%) 1fr; gap: 4px 18px; align-items: center; margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); }
.db-text { display: flex; flex-direction: column; gap: 2px; }
.db-text strong { color: var(--ink); font-size: .95rem; }
.db-text span, .db-note { font-size: .8rem; color: var(--muted); }
.db-note { grid-column: 2; margin: 0; }
.db-track { position: relative; height: 50px; }   /* value label sits above the dot so it never runs off the edge */
.db-base { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--chart-grid); }
.db-bar { position: absolute; top: 66%; height: 2px; margin-top: -1px; background: color-mix(in srgb, var(--db-after) 55%, var(--db-before)); }
.db-dot { position: absolute; top: 66%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); }
.db-dot::after { content: ""; position: absolute; inset: -8px; }       /* bigger hover target */
.db-before, .db-sw.db-before { background: var(--db-before); }
.db-after, .db-sw.db-after { background: var(--db-after); }
.db-val { position: absolute; top: 0; transform: translateX(-50%); font-size: .82rem; font-weight: 600; color: var(--ink); white-space: nowrap; }
.db-val-end { transform: translateX(calc(-100% + 7px)); }
.db-axis { display: grid; grid-template-columns: minmax(170px, 30%) 1fr; gap: 18px; margin-top: 6px; }
.db-ticks { position: relative; height: 16px; font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.db-ticks span { position: absolute; transform: translateX(-50%); }
@media (max-width: 640px) {
  .db-row, .db-axis { grid-template-columns: 1fr; }
  .db-note { grid-column: 1; }
  .db-axis > span:first-child { display: none; }
}

/* student comments */
.eval-quotes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.eval-quotes li { margin: 0; display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.eval-quotes blockquote { margin: 0; padding: 0; border: 0; }
.eval-quotes blockquote p { margin: 0; font: 400 1rem/1.55 var(--font-serif); color: var(--ink); }
.eval-quotes blockquote p::before { content: "“"; color: var(--accent); }
.eval-quotes blockquote p::after { content: "”"; color: var(--accent); }
.eval-quotes li > span { margin-top: auto; font-size: .78rem; color: var(--muted); }
@media print { .chart-tip { display: none; } .chart, .eval-stat, .eval-quotes li { break-inside: avoid; } }

/* ---------- "Up next" link at the end of each page ---------- */
.next-page { border-top: 1px solid var(--line); }
.next-page a { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "label title arrow" "label blurb arrow"; align-items: center; gap: 2px 24px; padding: clamp(22px, 3vw, 34px) 0; text-decoration: none; color: var(--text); }
.next-page a::after { grid-area: arrow; content: "→"; font: 400 clamp(1.6rem, 3vw, 2.2rem)/1 var(--font-serif); color: var(--accent); transition: transform .2s ease; }
.next-page a:hover::after { transform: translateX(6px); }
.next-label { grid-area: label; font: 600 .72rem/1 var(--font-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.next-title { grid-area: title; font: 500 clamp(1.3rem, 2.4vw, 1.7rem)/1.2 var(--font-serif); color: var(--ink); }
.next-blurb { grid-area: blurb; font-size: .9rem; color: var(--muted); }
.next-page a:hover .next-title { color: var(--accent); }
@media (max-width: 560px) { .next-page a { grid-template-columns: 1fr auto; grid-template-areas: "label arrow" "title arrow" "blurb arrow"; gap: 4px 16px; } }
@media print { .next-page { display: none; } }
.footer-sub { margin: -2px 0 .6em; font-size: .85rem; color: var(--muted); }
.site-footer .wordmark { font-size: 1.3rem; }
