/* ==========================================================================
   Ali Beikmohammadi — personal site
   Single stylesheet. Change the tokens below to restyle the whole site.
   ========================================================================== */

:root {
  /* Brand — a deep academic blue with a warm accent */
  --brand:        #0b3d63;
  --brand-soft:   #14598f;
  --accent:       #c8792a;

  --bg:           #ffffff;
  --bg-alt:       #f5f7fa;
  --bg-band:      #ffffff;
  --surface:      #ffffff;
  --border:       #e2e8f0;
  --text:         #16202b;
  --text-muted:   #5a6b7c;
  --text-faint:   #8595a5;

  --radius:       10px;
  --radius-lg:    16px;
  --shadow:       0 1px 2px rgba(16,32,48,.06), 0 4px 16px rgba(16,32,48,.05);
  --shadow-lift:  0 4px 8px rgba(16,32,48,.08), 0 12px 32px rgba(16,32,48,.10);

  --wrap:         1080px;
  --font: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --brand:        #6ab4ec;
  --brand-soft:   #8ec8f5;
  --accent:       #e8a55c;

  --bg:           #0f1519;
  --bg-alt:       #151d23;
  --bg-band:      #0f1519;
  --surface:      #172029;
  --border:       #26333d;
  --text:         #e6edf3;
  --text-muted:   #9fb0be;
  --text-faint:   #74899a;

  --shadow:       0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  --shadow-lift:  0 4px 8px rgba(0,0,0,.45), 0 12px 32px rgba(0,0,0,.4);
}

/* -------------------------------------------------------------- reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration-color: color-mix(in srgb, var(--brand) 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { line-height: 1.22; letter-spacing: -0.015em; margin: 0 0 .5em; font-weight: 650; }
h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.8rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1rem; }
code { font-family: var(--font-mono); font-size: .88em; background: var(--bg-alt); padding: .12em .38em; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

/* ------------------------------------------------------------- header --- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 62px; }
.brand { font-weight: 680; text-decoration: none; color: var(--text); letter-spacing: -.02em; margin-right: auto; }
.brand:hover { color: var(--brand); }

.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 7px 12px; border-radius: 7px;
  color: var(--text-muted); text-decoration: none; font-size: .93rem; font-weight: 500;
}
.site-nav a:hover { color: var(--text); background: var(--bg-alt); }
.site-nav a[aria-current="page"] { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; transition: .2s; }

.theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: 7px;
  width: 34px; height: 34px; display: grid; place-items: center;
  cursor: pointer; color: var(--text-muted);
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-faint); }
.theme-toggle svg { grid-area: 1 / 1; }
[data-theme="light"] .icon-moon, [data-theme="dark"] .icon-sun { display: none; }

/* ----------------------------------------------------------- announce --- */
.announce {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  font-size: .92rem; padding: 9px 0;
}
.announce .wrap { display: flex; align-items: center; gap: 10px; }
.announce-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .announce-dot { animation: none; } html { scroll-behavior: auto; } }

/* --------------------------------------------------------------- hero --- */
.hero { padding: 72px 0 56px; }
.hero-inner { display: grid; grid-template-columns: 1fr 260px; gap: 56px; align-items: start; }
.hero h1 { margin-bottom: 22px; }

.dual-role { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 26px; }
.role-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; border-top: 3px solid var(--brand);
}
.role-card.role-academic { border-top-color: var(--accent); }
.role-tag {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--brand); margin-bottom: 6px;
}
.role-academic .role-tag { color: var(--accent); }
.role-title { margin: 0 0 2px; font-weight: 600; font-size: .96rem; line-height: 1.35; }
.role-org { margin: 0; color: var(--text-muted); font-size: .88rem; }

.tagline {
  font-family: var(--font-serif); font-size: 1.22rem; line-height: 1.55;
  color: var(--text); border-left: 3px solid var(--border); padding-left: 18px; margin: 0 0 26px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.btn {
  display: inline-block; padding: 9px 18px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  text-decoration: none; font-size: .93rem; font-weight: 550; cursor: pointer;
  font-family: inherit; transition: .16s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-soft); border-color: var(--brand-soft); color: #fff; }
[data-theme="dark"] .btn-primary { color: #0f1519; }
[data-theme="dark"] .btn-primary:hover { color: #0f1519; }

.hero-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 0; font-size: .9rem; }
.hero-links a { color: var(--text-muted); text-decoration: none; }
.hero-links a:hover { color: var(--brand); text-decoration: underline; }
.hero-links a::before { content: "↗ "; color: var(--text-faint); font-size: .85em; }
.hero-links a[href^="mailto"]::before { content: "✉ "; }

.hero-aside { text-align: center; }
.photo-frame {
  position: relative; width: 180px; height: 180px; margin: 0 auto 14px;
  border-radius: 50%; overflow: hidden; border: 3px solid var(--surface);
  box-shadow: var(--shadow-lift); background: var(--brand);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-initials {
  position: absolute; inset: 0; display: none; place-items: center;
  font-size: 3.6rem; font-weight: 300; color: #fff; letter-spacing: .04em;
}
.photo-frame.no-photo .photo-initials { display: grid; }
.hero-location { color: var(--text-muted); font-size: .9rem; margin-bottom: 20px; }

.metrics { display: flex; gap: 8px; justify-content: center; }
.metrics-inline { justify-content: flex-start; margin: 18px 0 6px; }
.metric {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; min-width: 74px; display: flex; flex-direction: column; align-items: center;
}
.metric-value { font-size: 1.3rem; font-weight: 680; color: var(--brand); line-height: 1.1; }
.metric-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.metrics-source { font-size: .78rem; color: var(--text-faint); margin: 8px 0 0; }

/* -------------------------------------------------------------- bands --- */
.band { padding: 54px 0; background: var(--bg-band); border-top: 1px solid var(--border); }
.band-alt { background: var(--bg-alt); }
.band-cta { background: var(--bg-alt); text-align: center; }
.cta-inner h2 { margin-bottom: .3em; }
.cta-inner .hero-actions { justify-content: center; margin-bottom: 0; }

.page-head { padding: 56px 0 8px; }
.section-title { margin-bottom: .6em; }
.section-lead { color: var(--text-muted); max-width: 66ch; }
.bio { max-width: 74ch; font-size: 1.03rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
.clean-list { list-style: none; padding: 0; margin: 0 0 16px; }
.clean-list li { padding: 7px 0; border-bottom: 1px solid var(--border); font-size: .95rem; }
.clean-list li:last-child { border-bottom: 0; }

.link-arrow { font-weight: 550; font-size: .93rem; text-decoration: none; }
.link-arrow::after { content: " →"; transition: .16s; display: inline-block; }
.link-arrow:hover::after { transform: translateX(3px); }

/* -------------------------------------------------------------- cards --- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.theme-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow);
}
.theme-card h2 { font-size: 1.14rem; margin-bottom: .35em; }
.theme-card p { font-size: .94rem; color: var(--text-muted); }
.card-org { font-size: .82rem !important; color: var(--accent) !important; font-weight: 600; margin-bottom: .6em !important; }
.theme-links { display: flex; flex-wrap: wrap; gap: 14px; font-size: .87rem; margin-bottom: 0; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 12px 0; }
.tags li {
  font-size: .75rem; padding: 3px 9px; border-radius: 999px;
  background: var(--bg-alt); border: 1px solid var(--border); color: var(--text-muted);
}
[data-theme="dark"] .tags li { background: #1d2831; }

.simple-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.simple-cards li {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px;
}
.simple-cards strong { display: block; margin-bottom: 2px; }
.simple-cards span { color: var(--text-muted); font-size: .92rem; }

.repo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.repo-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; transition: .16s;
}
.repo-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.repo-card h3 { font-family: var(--font-mono); font-size: .95rem; color: var(--brand); margin-bottom: .3em; }
.repo-card p { font-size: .88rem; color: var(--text-muted); margin-bottom: .5em; }
.repo-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: .78rem; color: var(--text-faint); margin: 0 !important; }
.repo-meta .lang::before { content: "● "; color: var(--accent); }

.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.skill-group h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); }

.cert-list { list-style: none; padding: 0; margin: 0; }
.cert-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.cert-name { margin: 0; font-weight: 550; }
.cert-issuer { margin: 0; font-size: .87rem; color: var(--text-muted); }
.cert-date { font-size: .85rem; color: var(--text-faint); white-space: nowrap; }
.cert-id {
  font-family: var(--font-mono); font-size: .74rem; color: var(--text-faint);
  margin-left: 8px;
}
.tags-sm { margin: 6px 0 0; }
.tags-sm li { font-size: .7rem; padding: 2px 7px; }

.cert-group {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); margin-bottom: 12px;
}
.cert-group > summary {
  cursor: pointer; list-style: none; padding: 13px 18px;
  display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: .96rem;
}
.cert-group > summary::-webkit-details-marker { display: none; }
.cert-group > summary::after {
  content: "▸"; color: var(--text-faint); margin-left: auto; font-size: .85em;
}
.cert-group[open] > summary::after { content: "▾"; }
.cert-group[open] > summary { border-bottom: 1px solid var(--border); }
.cert-group-count {
  font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand);
}
.cert-group .cert-list { padding: 4px 18px 10px; }
.cert-group .cert-list li:last-child { border-bottom: 0; }

/* ------------------------------------------- collapsible page sections --- */
/* A whole section folds to its heading. The count tells the reader what
   they'd get by opening it, so folding never hides the scale of the work. */
.section-collapse { margin: 0; }
.section-collapse > summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: baseline; gap: 12px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.section-collapse > summary::-webkit-details-marker { display: none; }
.section-collapse > summary::after {
  content: "▸"; color: var(--text-faint); margin-left: auto;
  font-size: .8em; transition: transform .15s;
}
.section-collapse[open] > summary::after { content: "▾"; }
.section-collapse > summary:hover .section-title { color: var(--brand); }
.section-collapse > summary .section-title { margin: 0; transition: color .15s; }
.section-collapse-count {
  font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand);
  white-space: nowrap;
}
.section-collapse > summary .section-lead { margin: 0; font-size: .85rem; }
.section-collapse-body { padding-top: 18px; }

/* Each job on the Engineering page folds to its title row. */
.exp-collapse { margin-bottom: 14px; }
.exp-collapse > summary {
  cursor: pointer; list-style: none; padding: 2px 0;
}
.exp-collapse > summary::-webkit-details-marker { display: none; }
.exp-collapse > summary .cv-entry-head::after {
  content: "▸"; color: var(--text-faint); font-size: .8em; margin-left: 8px;
}
.exp-collapse[open] > summary .cv-entry-head::after { content: "▾"; }
.exp-collapse > summary:hover .cv-entry-title { color: var(--brand); }
.exp-collapse .cv-entry-title { transition: color .15s; }
.exp-collapse-body { padding-top: 8px; }

@media print {
  /* Never fold anything in the PDF or a printed page. */
  .section-collapse > summary::after,
  .exp-collapse > summary .cv-entry-head::after { content: "" !important; }
  .section-collapse[open] > summary::after { content: "" !important; }
  details.section-collapse, details.exp-collapse, details.cert-group,
  details.collapse { display: block; }
  details:not([open]) > *:not(summary) { display: revert !important; }
}

/* ------------------------------------------------------- publications --- */
.pub-controls { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 26px; }
#pub-filter {
  flex: 1 1 280px; padding: 9px 14px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); color: var(--text);
  font-family: inherit; font-size: .93rem;
}
.pub-tabs { display: flex; gap: 4px; background: var(--bg-alt); padding: 3px; border-radius: 8px; }
.pub-tabs button {
  border: 0; background: none; padding: 6px 14px; border-radius: 6px;
  cursor: pointer; font-family: inherit; font-size: .88rem; color: var(--text-muted);
}
.pub-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.year-head {
  font-size: .82rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-faint); border-bottom: 1px solid var(--border);
  padding-bottom: 6px; margin: 34px 0 6px;
}
.pub-list { list-style: none; padding: 0; margin: 0; counter-reset: pub; }
.pub { padding: 15px 0; border-bottom: 1px solid var(--border); }
.pub:last-child { border-bottom: 0; }
.pub-title { margin: 0 0 3px; font-weight: 600; font-size: 1rem; line-height: 1.4; }
.pub-title a { text-decoration: none; color: var(--text); }
.pub-title a:hover { color: var(--brand); text-decoration: underline; }
.pub-authors { margin: 0 0 3px; font-size: .87rem; color: var(--text-muted); }
.pub-meta { margin: 0; font-size: .83rem; color: var(--text-faint); display: flex; flex-wrap: wrap; gap: 10px; }
.pub-venue { font-style: italic; color: var(--text-muted); }
.pub-note { color: var(--accent); font-weight: 550; }
.pub-actions { margin: 5px 0 0; display: flex; gap: 12px; font-size: .8rem; }
.pub-actions a {
  text-decoration: none; padding: 1px 8px; border: 1px solid var(--border);
  border-radius: 999px; color: var(--text-muted);
}
.pub-actions a:hover { border-color: var(--brand); color: var(--brand); }
.pub-actions:empty { display: none; }

.empty { color: var(--text-muted); background: var(--bg-alt); padding: 20px; border-radius: var(--radius); }
.notice {
  font-size: .85rem; color: var(--text-muted); margin-top: 14px;
  background: color-mix(in srgb, var(--accent) 9%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-radius: var(--radius); padding: 11px 15px; max-width: 72ch;
}

/* ------------------------------------------------ new components (v2) --- */
.sub-title {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-faint); margin: 26px 0 10px;
}
.subtle { color: var(--text-muted); font-size: .86rem; }

.tags-lg li { font-size: .85rem; padding: 5px 13px; }

.dissertation {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 22px 26px;
}
.dissertation h2 { font-family: var(--font-serif); font-size: 1.3rem; margin: 6px 0 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: .87rem; transition: .15s;
}
.chip em { font-style: normal; opacity: .6; margin-left: 5px; font-size: .85em; }
.chip:hover { border-color: var(--text-faint); color: var(--text); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.active em { opacity: .8; }
[data-theme="dark"] .chip.active { color: #0f1519; }

.toggle { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.toggle input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.toggle em { font-style: normal; opacity: .6; }

.result-count { font-size: .82rem; color: var(--text-faint); margin: 0 0 8px; min-height: 1.2em; }

.pub-type {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
  font-weight: 700; padding: 2px 8px; border-radius: 4px;
  background: var(--bg-alt); color: var(--text-muted);
}
.pub-type-journal    { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.pub-type-conference { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.pub-type-book       { background: color-mix(in srgb, #7a5cc4 18%, transparent); color: #7a5cc4; }
.pub-type-preprint   { background: var(--bg-alt); color: var(--text-faint); }
[data-theme="dark"] .pub-type-book { color: #b49ae8; }
.pub-status { font-style: italic; }
.pub-lang { opacity: .8; }

.collapse summary { cursor: pointer; list-style: none; }
.collapse summary::-webkit-details-marker { display: none; }
.collapse summary h2 { display: inline; }
.collapse summary::after { content: " ▸"; color: var(--text-faint); }
.collapse[open] summary::after { content: " ▾"; }
.compact-list { columns: 2; column-gap: 32px; margin-top: 16px; padding-left: 20px; }
.compact-list li { font-size: .9rem; margin-bottom: 6px; break-inside: avoid; }

.course-list, .thesis-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.course-list > li, .thesis-list > li {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 18px;
}
.thesis-list > li.is-main { border-left: 3px solid var(--accent); }
.course-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.course-head h3 { margin: 0; font-size: 1rem; }
.thesis-student { margin: 0 0 2px; font-weight: 600; font-size: .96rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.thesis-title { margin: 0 0 4px; font-size: .93rem; color: var(--text); }
.thesis-date { font-size: .78rem; color: var(--text-faint); font-weight: 400; margin-left: auto; }
.badge {
  font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
  padding: 2px 8px; border-radius: 4px;
}
.timeline .cv-entry { border-left: 2px solid var(--border); padding-left: 20px; margin-bottom: 26px; }

/* Two-level experience: themed sub-headings inside a single job */
.exp-group { margin: 12px 0 0; break-inside: avoid; }
.exp-group-title {
  margin: 0 0 3px; font-size: .84rem; font-weight: 650;
  color: var(--brand); letter-spacing: .01em;
}
.exp-group-note {
  display: block; font-weight: 400; font-size: .8rem;
  color: var(--text-faint); font-style: italic; margin-top: 1px;
}
.exp-group ul { margin: 0; padding-left: 20px; }
.exp-group li { font-size: .91rem; margin-bottom: 4px; }
[data-theme="dark"] .exp-group-title { color: var(--brand); }
@media print {
  .exp-group-title { color: #000; }
  .exp-group { margin-top: 7px; }
}

/* --------------------------------------------------------------- news --- */
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li {
  display: grid; grid-template-columns: 120px 1fr; gap: 20px;
  padding: 11px 0; border-bottom: 1px solid var(--border); font-size: .95rem;
}
.news-list li:last-child { border-bottom: 0; }
.news-list time { color: var(--text-faint); font-size: .84rem; font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------- teaching --- */
.teach-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; }
.teach-list > li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px; }
.teach-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.teach-head h2 { font-size: 1.1rem; margin: 0; }
.teach-years { font-size: .84rem; color: var(--text-faint); white-space: nowrap; }
.teach-role { color: var(--accent); font-size: .88rem; font-weight: 550; margin: 2px 0 8px; }

/* ----------------------------------------------------------------- cv --- */
.cv-sheet { border-top: 0; }
.cv-sheet .wrap { max-width: 820px; }
.cv-header { border-bottom: 2px solid var(--brand); padding-bottom: 14px; margin-bottom: 26px; }
.cv-header h2 { font-size: 1.9rem; margin-bottom: .2em; }
.cv-roles { margin: 0; font-size: .95rem; color: var(--text-muted); }
.cv-contact { margin: 10px 0 0; font-size: .84rem; color: var(--text-faint); }
.cv-section { margin-bottom: 30px; }
.cv-section > h3 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--brand); border-bottom: 1px solid var(--border);
  padding-bottom: 5px; margin-bottom: 14px;
}
.cv-entry { margin-bottom: 18px; break-inside: avoid; }
.cv-entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.cv-entry-title { margin: 0; font-weight: 620; font-size: 1rem; }
.cv-dates { font-size: .82rem; color: var(--text-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cv-entry-org { margin: 1px 0 6px; font-size: .89rem; color: var(--text-muted); font-style: italic; }
.cv-entry ul { margin: 0; padding-left: 20px; }
.cv-entry li { font-size: .91rem; margin-bottom: 4px; color: var(--text); }
.cv-note { font-size: .86rem; color: var(--text-muted); margin: 0; }
.cv-pubs { padding-left: 22px; }
.cv-pubs li { font-size: .89rem; margin-bottom: 8px; }
.cv-certs { padding-left: 20px; margin: 0; }
.cv-certs li { font-size: .9rem; margin-bottom: 4px; }
.cv-skills { display: grid; grid-template-columns: 190px 1fr; gap: 6px 18px; margin: 0; font-size: .89rem; }
.cv-skills dt { font-weight: 600; color: var(--text-muted); }
.cv-skills dd { margin: 0; }

/* ------------------------------------------------------------- footer --- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 34px 0; margin-top: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .88rem; margin-bottom: 14px; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--brand); text-decoration: underline; }
.footer-note, .footer-copy { font-size: .8rem; color: var(--text-faint); margin: 0 0 4px; }

/* ---------------------------------------------------------- responsive --- */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 34px; }
  .hero-aside { text-align: left; }
  .photo-frame { margin-left: 0; width: 130px; height: 130px; }
  .metrics { justify-content: flex-start; }
  .two-col { grid-template-columns: 1fr; gap: 34px; }
  .cv-skills { grid-template-columns: 1fr; gap: 2px; }
  .cv-skills dd { margin-bottom: 10px; }
  .news-list li { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .dual-role { grid-template-columns: 1fr; }
  .nav-toggle { display: block; order: 2; }
  .site-nav { position: static; }
  .site-nav ul {
    display: none; position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 10px 24px 16px; gap: 0;
  }
  .site-nav ul.open { display: flex; }
  .site-nav a { padding: 10px 0; }
  .hero { padding: 40px 0 34px; }
  .band { padding: 38px 0; }
}

/* --------------------------------------------------------------- print --- */
@media print {
  .site-header, .site-footer, .no-print, .announce, .theme-toggle,
  .skip-link, .site-nav { display: none !important; }
  body { font-size: 10.2pt; line-height: 1.42; color: #000; background: #fff; }
  .band { padding: 0; border: 0; background: #fff; }
  .wrap { max-width: none; padding: 0; }
  .cv-section > h3 { color: #000; }
  a { color: #000; text-decoration: none; }
  /* Sections must be allowed to flow across pages — a multi-page Experience
     block with break-inside:avoid strands a heading on its own page. */
  .cv-section, .cv-entry { break-inside: auto; }
  .cv-section > h3, .cv-entry-head, .exp-group-title { break-after: avoid; }
  .exp-group { break-inside: avoid; }
  @page { margin: 13mm 13mm; }
}
