/* ==========================================================================
   cv.hudami.top — Scholarly Academic Homepage Stylesheet
   Cool Slate & Oxford Navy Palette · Zero Flashy Animations · Print-Ready CV
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --surface-tint: #eff6ff;
  --ink: #0f172a;
  --ink-secondary: #334155;
  --ink-muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #1e40af;
  --accent-hover: #1e3a8a;
  --accent-soft: #eff6ff;
  --accent-border: #bfdbfe;
  --award: #9f1239;
  --award-soft: #fff1f2;
  --award-border: #fecdd3;
  --code-bg: #0f172a;
  --code-ink: #e2e8f0;

  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", "Book Antiqua", Georgia, "Songti SC", "Noto Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, ui-monospace, monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --shadow-subtle: 0 1px 2px rgba(15, 23, 42, 0.04);
  --topbar-h: 56px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1120;
  --surface: #111827;
  --surface-subtle: #1e293b;
  --surface-tint: #172554;
  --ink: #f1f5f9;
  --ink-secondary: #cbd5e1;
  --ink-muted: #94a3b8;
  --border: #1e293b;
  --border-strong: #334155;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-soft: #172554;
  --accent-border: #1e3a8a;
  --award: #fda4af;
  --award-soft: #3b0d1c;
  --award-border: #881337;
  --code-bg: #090d16;
  --code-ink: #e2e8f0;
  --shadow-subtle: none;
}

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

html {
  scroll-padding-top: calc(var(--topbar-h) + 24px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 200;
  padding: 8px 14px;
  background: var(--accent);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.skip-link:focus {
  left: 12px;
}

.container {
  width: min(1140px, calc(100% - 48px));
  margin: 0 auto;
}

/* ---------- Top Navigation Bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.site-brand:hover {
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  color: var(--accent);
  font-weight: 400;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  overflow-x: auto;
  scrollbar-width: none;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.main-nav a {
  position: relative;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--ink-secondary);
  white-space: nowrap;
  transition: color 0.14s ease;
}

.main-nav a:hover {
  color: var(--ink);
  text-decoration: none;
}

.main-nav a.is-active {
  color: var(--accent);
  font-weight: 500;
}

.main-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.util-btn,
.util-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 31px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  font-family: var(--sans);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.util-btn:hover,
.util-link:hover {
  border-color: var(--border-strong);
  color: var(--ink);
  text-decoration: none;
}

.util-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.util-btn.icon-only {
  width: 31px;
  padding: 0;
  justify-content: center;
}

.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

/* ---------- Main Asymmetric Grid ---------- */

.page-shell {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  gap: 50px;
  padding: 40px 0 68px;
  align-items: start;
}

/* ---------- Left Profile Sidebar ---------- */

.sidebar-sticky {
  position: sticky;
  top: calc(var(--topbar-h) + 28px);
}

.portrait-frame {
  margin: 0 0 20px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
}

.portrait-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 320 / 360;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.identity-block {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.profile-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.profile-native {
  display: inline-block;
  margin-left: 8px;
  font-size: 18px;
  font-weight: 400;
  color: var(--ink-muted);
}

.profile-title {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.profile-affiliation {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.contact-list {
  margin: 14px 0;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: 13px;
  color: var(--ink-secondary);
}

.contact-row dt {
  padding-top: 2px;
  color: var(--ink-muted);
}

.contact-row dt svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-row dd {
  margin: 0;
  line-height: 1.45;
}

.email-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.email-code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  word-break: break-all;
}

.inline-copy {
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-secondary);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease;
}

.inline-copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.profile-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 16px;
}

.profile-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 12px;
  white-space: nowrap;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.profile-link-chip:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.profile-link-chip svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

.metric-item {
  padding: 10px 6px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.metric-item:last-child {
  border-right: none;
}

.metric-val {
  display: block;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  color: var(--ink);
}

.metric-lbl {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ---------- Sections & Editorial Hierarchy ---------- */

.content {
  min-width: 0;
}

.section {
  padding-bottom: 44px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--border);
}

.section:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}

.section-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.25px;
  color: var(--ink);
}

.section-meta {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-muted);
}

.subsection-title {
  margin: 26px 0 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ---------- Section 01: Biography ---------- */

.prose p {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 15.25px;
  line-height: 1.75;
}

.prose p:last-child {
  margin-bottom: 0;
}

.callout-box {
  margin-top: 20px;
  padding: 13px 16px;
  border: 1px solid var(--accent-border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.callout-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  flex-shrink: 0;
}

.callout-box p {
  margin: 0;
  font-size: 13.75px;
  color: var(--ink-secondary);
  line-height: 1.6;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.research-card {
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-subtle);
}

.research-card-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.research-roman {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--accent);
}

.research-card h4 {
  margin: 0;
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
}

.research-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-secondary);
  line-height: 1.55;
}

/* ---------- Section 02: News ---------- */

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

.news-item {
  display: grid;
  grid-template-columns: 74px 76px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.news-item.is-hidden {
  display: none;
}

.news-date {
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}

.news-tag {
  display: inline-block;
  text-align: center;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.news-tag[data-tag="Paper"] {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

.news-tag[data-tag="Award"] {
  border-color: var(--award-border);
  background: var(--award-soft);
  color: var(--award);
}

.news-text {
  color: var(--ink);
  line-height: 1.58;
}

.news-actions {
  margin-top: 12px;
}

.text-toggle-btn {
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.text-toggle-btn:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

/* ---------- Section 03: Publications ---------- */

.pub-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

.seg-btn {
  padding: 6px 12px;
  border: none;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.seg-btn:last-child {
  border-right: none;
}

.seg-btn.is-active {
  background: var(--accent);
  color: #ffffff;
}

.filter-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-btn {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-secondary);
  font-family: var(--mono);
  font-size: 11.5px;
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.pill-btn:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.pill-btn.is-active {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

.pub-search {
  margin-left: auto;
  flex: 1 1 200px;
  max-width: 250px;
}

.pub-search input {
  width: 100%;
  height: 31px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
}

.pub-search input::placeholder {
  color: var(--ink-muted);
}

.pub-status {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-muted);
}

.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pub-card {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-subtle);
  transition: border-color 0.14s ease;
}

.pub-card:hover {
  border-color: var(--border-strong);
}

.pub-visual {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pub-thumb {
  width: 100%;
  aspect-ratio: 16 / 11;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.pub-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pub-thumb svg {
  width: 100%;
  height: 100%;
  display: block;
}

.venue-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 1.35;
}

.pub-body {
  min-width: 0;
}

.pub-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}

.pub-authors {
  margin: 6px 0 0;
  font-size: 13.75px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.author-self {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

.pub-venue-line {
  margin: 5px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-muted);
  font-style: italic;
}

.award-badge {
  font-style: normal;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--award-border);
  background: var(--award-soft);
  color: var(--award);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

.pub-tldr {
  margin: 9px 0 0;
  font-size: 13.5px;
  color: var(--ink-secondary);
  line-height: 1.55;
}

.pub-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pub-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink-secondary);
  font-family: var(--mono);
  font-size: 11.5px;
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.pub-btn:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.pub-btn.is-open {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.pub-drawer {
  margin-top: 12px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-secondary);
}

.pub-drawer[hidden] {
  display: none;
}

.pub-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.pub-drawer p {
  margin: 0;
}

.bibtex-box {
  padding: 0;
  overflow: hidden;
  border-color: #1e293b;
  background: var(--code-bg);
}

.bibtex-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-bottom: 1px solid #1e293b;
  font-family: var(--mono);
  font-size: 11px;
  color: #94a3b8;
}

.bibtex-copy {
  padding: 3px 9px;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  background: #1e293b;
  color: #f1f5f9;
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
}

.bibtex-copy:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.bibtex-box pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--code-ink);
}

.pub-empty {
  padding: 28px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--ink-muted);
  font-size: 14px;
}

/* ---------- Section 04: Projects ---------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-subtle);
  transition: border-color 0.14s ease;
}

.project-card:hover {
  border-color: var(--border-strong);
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.project-status {
  padding: 2px 8px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.project-period {
  font-family: var(--mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}

.project-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.project-role {
  margin: 3px 0 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-muted);
}

.project-summary {
  margin: 10px 0 0;
  font-size: 13.75px;
  color: var(--ink-secondary);
  line-height: 1.58;
}

.project-highlights {
  margin: 10px 0 0;
  padding-left: 17px;
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.55;
}

.project-highlights li {
  margin-bottom: 3px;
}

.project-tags {
  margin: 12px 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-secondary);
}

.project-links {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--mono);
  font-size: 12px;
}

/* ---------- Section 05: Education & Experience ---------- */

.cv-block + .cv-block {
  margin-top: 28px;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.timeline-period {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  padding-top: 2px;
}

.timeline-heading {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.timeline-org {
  margin: 2px 0 0;
  font-size: 13.75px;
  font-weight: 500;
  color: var(--accent);
}

.timeline-details {
  margin: 5px 0 0;
  font-size: 13.5px;
  color: var(--ink-secondary);
  line-height: 1.58;
}

/* ---------- Section 06: Honors, Teaching & Service ---------- */

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

.compact-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.compact-year {
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}

.compact-title {
  font-weight: 600;
  color: var(--ink);
}

.compact-org {
  color: var(--ink-secondary);
}

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

.teaching-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.teaching-term {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
  padding-top: 2px;
}

.teaching-course {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
}

.teaching-role {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
}

.teaching-note {
  margin: 3px 0 0;
  font-size: 13.25px;
  color: var(--ink-secondary);
}

.service-dl {
  margin: 0;
  border-top: 1px solid var(--border);
}

.service-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.75px;
}

.service-row dt {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.service-row dd {
  margin: 0;
  color: var(--ink-secondary);
  line-height: 1.58;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-sep {
  margin: 0 8px;
  color: var(--border-strong);
}

/* ---------- Responsive Breakpoints ---------- */

@media (max-width: 960px) {
  .page-shell {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-top: 28px;
  }

  .sidebar-sticky {
    position: static;
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 16px 24px;
    align-items: start;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
  }

  .portrait-frame {
    margin: 0;
    grid-row: span 3;
  }

  .profile-links,
  .quick-metrics {
    grid-column: 1 / -1;
  }

  .profile-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 4px;
  }
}

@media (max-width: 720px) {
  .container {
    width: calc(100% - 28px);
  }

  .main-nav {
    display: none;
  }

  .sidebar-sticky {
    grid-template-columns: 1fr;
  }

  .portrait-frame {
    max-width: 180px;
    grid-row: auto;
  }

  .profile-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .pub-card {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .pub-visual {
    flex-direction: row;
    align-items: center;
  }

  .pub-thumb {
    width: 120px;
    flex-shrink: 0;
  }

  .news-item {
    grid-template-columns: 64px 70px minmax(0, 1fr);
    gap: 8px;
  }

  .timeline-item,
  .teaching-row,
  .service-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .section-head {
    flex-wrap: wrap;
  }

  .section-meta {
    margin-left: 0;
    width: 100%;
  }

  .pub-search {
    max-width: none;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Print-Ready Academic CV Stylesheet ---------- */

@media print {
  @page {
    margin: 15mm;
  }

  body {
    background: #ffffff !important;
    color: #111111 !important;
    font-size: 10.5pt;
    line-height: 1.45;
  }

  .topbar,
  .pub-toolbar,
  .pub-status,
  .pub-actions,
  .news-actions,
  .inline-copy,
  .site-footer,
  .quick-metrics {
    display: none !important;
  }

  .container {
    width: 100%;
    max-width: none;
  }

  .page-shell {
    display: block;
    padding: 0;
  }

  .sidebar-sticky {
    position: static;
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 16px;
    padding: 0 0 14px;
    margin-bottom: 18px;
    border: none;
    border-bottom: 1.5pt solid #111111;
    background: transparent;
  }

  .portrait-frame {
    padding: 0;
    border: 1px solid #cccccc;
    box-shadow: none;
    margin: 0;
  }

  .identity-block,
  .contact-list {
    border-bottom: none;
    padding-bottom: 0;
    margin: 4px 0;
  }

  .profile-links {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 0;
  }

  .profile-link-chip {
    border: none;
    padding: 0;
    background: transparent;
    font-size: 9pt;
  }

  .section {
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: none;
  }

  .section-head {
    margin-bottom: 10px;
    padding-bottom: 4px;
    border-bottom: 1pt solid #111111;
  }

  .section-head h2 {
    font-size: 14pt;
  }

  .pub-card,
  .project-card,
  .research-card {
    border: 1px solid #dddddd;
    box-shadow: none;
    break-inside: avoid;
    padding: 10px 12px;
  }

  .pub-card {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .pub-thumb {
    display: none;
  }

  .news-item.is-hidden {
    display: grid !important;
  }

  a {
    color: #111111;
    text-decoration: none;
  }
}
