/* ── THEME TOKENS ── */
[data-theme="dark"] {
  --bg:          #17242f;
  --bg-surface:  #1e2f3c;
  --bg-raised:   #26394a;
  --border:      rgba(255,255,255,0.07);
  --border-mid:  rgba(255,255,255,0.12);
  --text:        #e0ecf5;
  --text-muted:  #6a8a9a;
  --text-faint:  #3d5a6a;
  --rust:        #c45c30;
  --rust-light:  #d97245;
  --amber:       #c49a30;
  --nav-bg:      rgba(23,36,47,0.9);
}
[data-theme="light"] {
  --bg:          #f0e6d3;
  --bg-surface:  #e8d9c4;
  --bg-raised:   #deccb0;
  --border:      rgba(100,70,40,0.10);
  --border-mid:  rgba(100,70,40,0.18);
  --text:        #1c1410;
  --text-muted:  #5a4535;
  --text-faint:  #c8b09a;
  --rust:        #a84822;
  --rust-light:  #c45c30;
  --amber:       #8a6010;
  --nav-bg:      rgba(240,230,211,0.97);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; transition: background 0.3s, color 0.3s; }

/* ── NAV ── */
nav#site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 62px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 2.5rem; background: var(--nav-bg); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-mid); transition: background 0.3s;
}
.nav-brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.2; }
.nav-brand-top { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 900; color: var(--text); letter-spacing: 0.01em; }
.nav-brand-top span { color: var(--rust); }
.nav-brand-sub { font-family: 'DM Mono', monospace; font-size: 0.58rem; color: var(--text-muted); letter-spacing: 0.12em; text-transform: uppercase; }
.nav-right { display: flex; align-items: center; gap: 2rem; }
.nav-links { display: flex; gap: 1.75rem; list-style: none; }
.nav-links a { font-size: 0.78rem; font-weight: 500; text-decoration: none; color: var(--text-muted); letter-spacing: 0.07em; text-transform: uppercase; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--rust); }
.theme-toggle { background: none; border: 1px solid var(--border-mid); border-radius: 2px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); font-size: 0.85rem; transition: all 0.2s; }
.theme-toggle:hover { border-color: var(--rust); color: var(--rust); }

/* ── HERO ── */
#home { min-height: 100vh; display: flex; align-items: center; position: relative; overflow: hidden; padding: 5rem 0 4rem; }
.hero-grid { position: absolute; inset: 0; background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 64px 64px; mask-image: radial-gradient(ellipse 75% 80% at 65% 45%, black 10%, transparent 70%); }
.hero-glow { position: absolute; right: 5%; top: 40%; transform: translateY(-50%); width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(ellipse, rgba(196,92,48,0.07) 0%, transparent 70%); pointer-events: none; }
.hero-inner { position: relative; z-index: 2; max-width: 1100px; margin: 0 auto; padding: 0 2.5rem; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.hero-rule { width: 40px; height: 2px; background: var(--rust); margin-bottom: 1.5rem; }
.hero-title { font-family: 'Playfair Display', serif; font-size: clamp(2.6rem,5.5vw,4.4rem); font-weight: 900; line-height: 1.05; color: var(--text); margin-bottom: 1.5rem; }
.hero-title em { font-style: italic; color: var(--rust); }
.hero-desc { font-size: 1rem; font-weight: 300; color: var(--text-muted); line-height: 1.8; max-width: 460px; margin-bottom: 2rem; }
.hero-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; max-width: 560px; }
.hero-btns .btn { text-align: center; width: 100%; display: flex; align-items: center; justify-content: center; min-height: 2.75rem; }
.hero-graph-wrap { display: flex; align-items: center; justify-content: center; opacity: 1; min-height: 400px; width: 100%; flex: 1; overflow: hidden; }
[data-theme="light"] .hero-graph-wrap { display: flex; align-items: center; justify-content: center; opacity: 1; min-height: 400px; width: 100%; flex: 1; overflow: hidden; }
.hero-graph-wrap canvas { display: block; width: 100%; height: 400px; background: transparent; }
.hero-graph-wrap svg { width: 100%; max-width: 380px; }
.hero-scroll { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.4rem; color: var(--text-faint); font-size: 0.65rem; letter-spacing: 0.14em; text-transform: uppercase; font-family: 'DM Mono', monospace; }
.scroll-line { width: 1px; height: 44px; background: linear-gradient(to bottom, var(--rust), transparent); animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:0.3} 50%{opacity:1} }

/* ── BUTTONS ── */
.btn { display: inline-block; padding: 0.7rem 1.6rem; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; text-decoration: none; border-radius: 2px; transition: all 0.2s; cursor: pointer; border: none; font-family: 'DM Sans', sans-serif; }
.btn-primary { background: var(--rust); color: #fff; }
.btn-primary:hover { background: var(--rust-light); }
.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border-mid); }
.btn-outline:hover { border-color: var(--rust); color: var(--rust); }

/* ── DIVIDER ── */
.rust-bar { height: 3px; background: linear-gradient(90deg, var(--rust), var(--rust-light) 40%, transparent); }

/* ── SECTIONS ── */
section { padding: 6rem 0; }
.section-inner { max-width: 1100px; margin: 0 auto; padding: 0 2.5rem; }
.section-head { display: flex; align-items: baseline; gap: 1.25rem; margin-bottom: 3rem; border-bottom: 1px solid var(--border); padding-bottom: 1.25rem; }
.section-num { font-family: 'DM Mono', monospace; font-size: 0.75rem; color: var(--rust); letter-spacing: 0.1em; flex-shrink: 0; }
.section-title { font-family: 'Playfair Display', serif; font-size: clamp(1.7rem,3.5vw,2.5rem); font-weight: 700; color: var(--text); line-height: 1.1; }

/* ── ABOUT ── */
#about { background: var(--bg-surface); }
#recent_activities { background: var(--bg-surface); }
.about-layout { display: grid; grid-template-columns: 300px 1fr; gap: 4rem; align-items: start; }
.about-photo { width: 100%; aspect-ratio: 4/5; background: var(--bg-raised); border: 1px solid var(--border-mid); border-radius: 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem; color: var(--text-muted); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; position: relative; }
.about-photo::after { content: ''; position: absolute; bottom: -10px; right: -10px; width: calc(100% - 16px); height: calc(100% - 16px); border: 1px solid var(--rust); border-radius: 2px; z-index: -1; }
.photo-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--bg-surface); border: 1px solid var(--border-mid); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.about-name { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; color: var(--text); margin-top: 1.5rem; margin-bottom: 0.2rem; }
.about-role { font-family: 'DM Mono', monospace; font-size: 0.68rem; color: var(--rust); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 1rem; }
.about-affil { display: flex; align-items: flex-start; gap: 0.55rem; padding: 0.5rem 0.8rem; background: rgba(196,92,48,0.07); border: 1px solid rgba(196,92,48,0.18); border-radius: 2px; font-size: 0.76rem; color: var(--rust-light); line-height: 1.4; margin-bottom: 1rem; }
.about-ext-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.about-ext-link { font-family: 'DM Mono', monospace; font-size: 0.67rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-muted); text-decoration: none; padding: 0.3rem 0.75rem; border: 1px solid var(--border-mid); border-radius: 2px; transition: all 0.2s; }
.about-ext-link:hover { color: var(--rust); border-color: var(--rust); }

/* ── TABS ── */
.tab-bar { display: flex; border-bottom: 1px solid var(--border-mid); margin-bottom: 2rem; }
.tab-btn { font-family: 'DM Mono', monospace; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 0.7rem 1.4rem; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.2s; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--rust); border-bottom-color: var(--rust); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.2s ease; }
@keyframes fadeUp { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:none} }

/* ── BIO ── */
.bio-text p { font-size: 0.97rem; font-weight: 300; color: var(--text-muted); line-height: 1.85; margin-bottom: 1.1rem; }
.bio-text strong { color: var(--text); font-weight: 500; }

/* ── PUBLICATION LIST ── */
.ppub-controls { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; gap: 0.75rem; flex-wrap: wrap; }
.ppub-search { flex: 1; min-width: 180px; max-width: 320px; display: flex; align-items: center; gap: 0.45rem; background: var(--bg-raised); border: 1px solid var(--border-mid); border-radius: 2px; padding: 0.5rem 0.8rem; transition: border-color 0.2s; }
.ppub-search:focus-within { border-color: var(--rust); }
.ppub-search svg { color: var(--text-muted); flex-shrink: 0; }
.ppub-search input { background: none; border: none; outline: none; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 0.85rem; width: 100%; }
.ppub-search input::placeholder { color: var(--text-muted); }
.yr-filters { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.yr-btn { font-family: 'DM Mono', monospace; font-size: 0.66rem; letter-spacing: 0.07em; padding: 0.35rem 0.75rem; border-radius: 2px; border: 1px solid var(--border-mid); background: transparent; color: var(--text-muted); cursor: pointer; transition: all 0.2s; }
.yr-btn.active, .yr-btn:hover { border-color: var(--rust); color: var(--rust); }
.pub-list { list-style: none; }
.pub-item { padding: 0.75rem 0; border-bottom: 1px solid var(--border); display: none; }
.pub-item:first-child { border-top: 1px solid var(--border); }
.pub-item.visible { display: block; animation: fadeUp 0.22s ease; }
.pub-ref { font-size: 0.88rem; line-height: 1.7; color: var(--text-muted); margin: 0; padding-left: 1.5em; text-indent: -1.5em; }
.pub-title { font-weight: 600; color: var(--text); text-decoration: none; transition: color 0.2s; }
.pub-title:hover { color: var(--rust); text-decoration: underline; }
.pub-title-plain { font-weight: 600; color: var(--text); }
.pub-ref em { font-style: italic; }
.pub-link { font-size: 0.78rem; color: var(--rust); text-decoration: none; white-space: nowrap; }
.pub-link:hover { text-decoration: underline; }
.pub-year { font-family: 'DM Mono', monospace; font-size: 0.7rem; color: var(--amber); font-style: normal; }
.pub-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pub-action { font-family: 'DM Mono', monospace; font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); text-decoration: none; padding: 0.18rem 0.55rem; border: 1px solid var(--border-mid); border-radius: 2px; transition: all 0.2s; }
.pub-action:hover { color: var(--rust); border-color: var(--rust); }
.pub-pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 1.75rem; }
.page-info { font-family: 'DM Mono', monospace; font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.07em; }
.page-btns { display: flex; gap: 0.4rem; }
.page-btn { font-family: 'DM Mono', monospace; font-size: 0.7rem; padding: 0.35rem 0.9rem; border: 1px solid var(--border-mid); background: transparent; color: var(--text-muted); border-radius: 2px; cursor: pointer; transition: all 0.2s; }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-btn:not(:disabled):hover { border-color: var(--rust); color: var(--rust); }

/* ── RESEARCH ── */
#research { background: var(--bg); }
.research-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.25rem; }
.research-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 2px; padding: 2rem; transition: border-color 0.25s, transform 0.25s; }
.research-card:hover { border-color: rgba(196,92,48,0.4); transform: translateY(-2px); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.card-num { font-family: 'DM Mono', monospace; font-size: 0.65rem; color: var(--rust); letter-spacing: 0.15em; }
.card-status { font-family: 'DM Mono', monospace; font-size: 0.62rem; color: var(--text-faint); letter-spacing: 0.1em; text-transform: uppercase; }
.card-title { font-family: 'Playfair Display', serif; font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: 0.75rem; line-height: 1.3; }
.card-body { font-size: 0.87rem; color: var(--text-muted); line-height: 1.75; font-weight: 300; }
.card-tags { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag { font-family: 'DM Mono', monospace; font-size: 0.65rem; color: var(--text-muted); border: 1px solid var(--border-mid); padding: 0.18rem 0.5rem; border-radius: 2px; letter-spacing: 0.06em; }

/* ── PEOPLE ── */
#people { background: var(--bg-surface); }
.pi-card { display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: center; background: var(--bg-raised); border: 1px solid var(--border-mid); border-radius: 2px; padding: 2rem; margin-bottom: 3rem; }
.pi-avatar { width: 80px; height: 80px; border-radius: 50%; background: var(--bg-surface); border: 2px solid var(--rust); display: flex; align-items: center; justify-content: center; font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; color: var(--rust); }
.pi-name { font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 700; color: var(--text); margin-bottom: 0.2rem; }
.pi-role { font-family: 'DM Mono', monospace; font-size: 0.7rem; color: var(--rust); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.5rem; }
.pi-area { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }
.students-label { font-family: 'DM Mono', monospace; font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.students-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.student-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 2px; padding: 1.25rem; display: flex; align-items: center; gap: 1rem; transition: border-color 0.2s; }
.student-card:hover { border-color: rgba(196,92,48,0.35); }
.student-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--bg-surface); border: 1px solid var(--border-mid); display: flex; align-items: center; justify-content: center; font-family: 'Playfair Display', serif; font-size: 0.9rem; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }
.student-name { font-size: 0.88rem; font-weight: 500; color: var(--text); margin-bottom: 0.2rem; }
.student-role { font-size: 0.75rem; color: var(--text-muted); }
.student-area { font-size: 0.73rem; color: var(--rust); font-style: italic; margin-top: 0.15rem; }

/* ── SELECT PAPERS ── */
#select-papers { background: var(--bg); }
.papers-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(320px,1fr)); gap: 1.5rem; }
.paper-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 2px; padding: 1.75rem; display: flex; flex-direction: column; gap: 0.85rem; transition: border-color 0.25s, transform 0.25s; position: relative; }
.paper-card:hover { border-color: rgba(196,92,48,0.4); transform: translateY(-2px); }
.paper-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg,var(--rust),var(--rust-light)); opacity: 0; transition: opacity 0.25s; }
.paper-card:hover::before { opacity: 1; }
.paper-meta { display: flex; align-items: center; justify-content: space-between; }
.paper-year { font-family: 'DM Mono', monospace; font-size: 0.72rem; color: var(--amber); letter-spacing: 0.08em; }
.paper-venue-tag { font-family: 'DM Mono', monospace; font-size: 0.65rem; color: var(--text-muted); background: var(--bg-raised); border: 1px solid var(--border-mid); padding: 0.15rem 0.5rem; border-radius: 2px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paper-title { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 700; color: var(--text); line-height: 1.35; text-decoration: none; display: block; transition: color 0.2s; }
.paper-title:hover { color: var(--rust); }
.paper-authors { font-size: 0.79rem; color: var(--text-muted); line-height: 1.4; }
.paper-authors strong { color: var(--rust-light); font-weight: 600; }
.paper-abstract { font-size: 0.84rem; color: var(--text-muted); line-height: 1.75; font-weight: 300; flex: 1; }
.paper-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; padding-top: 0.5rem; border-top: 1px solid var(--border); margin-top: auto; }
.paper-action { font-family: 'DM Mono', monospace; font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); text-decoration: none; padding: 0.2rem 0.6rem; border: 1px solid var(--border-mid); border-radius: 2px; transition: all 0.2s; }
.paper-action:hover { color: var(--rust); border-color: var(--rust); }

/* ── CONTACT ── */
#contact { background: var(--bg-surface); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 5rem; align-items: start; }
.contact-intro { font-size: 0.97rem; color: var(--text-muted); line-height: 1.85; font-weight: 300; margin-bottom: 2rem; }
.contact-items { display: flex; flex-direction: column; gap: 0.85rem; }
.contact-item { display: flex; align-items: center; gap: 0.85rem; font-size: 0.87rem; color: var(--text-muted); }
.contact-icon { width: 34px; height: 34px; border-radius: 2px; background: rgba(196,92,48,0.08); border: 1px solid rgba(196,92,48,0.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--rust); }
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label { font-family: 'DM Mono', monospace; font-size: 0.66rem; color: var(--text-muted); letter-spacing: 0.12em; text-transform: uppercase; }
.form-group input, .form-group textarea { background: var(--bg-raised); border: 1px solid var(--border-mid); border-radius: 2px; padding: 0.65rem 0.9rem; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 0.88rem; outline: none; transition: border-color 0.2s; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--rust); }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }
.form-group textarea { min-height: 110px; resize: vertical; }

/* ── FOOTER ── */
footer { background: var(--bg); border-top: 1px solid var(--border-mid); padding: 1.75rem 0; }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 0 2.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-name { font-family: 'Playfair Display', serif; font-size: 0.95rem; font-weight: 700; color: var(--text-muted); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-family: 'DM Mono', monospace; font-size: 0.68rem; color: var(--text-muted); text-decoration: none; letter-spacing: 0.06em; transition: color 0.2s; }
.footer-links a:hover { color: var(--rust); }
.footer-group { font-family: 'DM Mono', monospace; font-size: 0.68rem; color: var(--text-muted); letter-spacing: 0.06em; }

/* ── PUBLICATION SINGLE PAGE ── */
.pub-single-bg { background: var(--bg-surface); min-height: 100vh; }
.pub-single-wrap { padding-top: 5.5rem; padding-bottom: 5rem; }
.pub-back-link { display: inline-flex; align-items: center; gap: 0.4rem; font-family: 'DM Mono', monospace; font-size: 0.7rem; color: var(--text-muted); text-decoration: none; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 2rem; transition: color 0.2s; }
.pub-back-link:hover { color: var(--rust); }
.pub-type-badge { font-family: 'DM Mono', monospace; font-size: 0.65rem; color: var(--rust); letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 1rem; }
.pub-single-title { font-family: 'Playfair Display', serif; font-size: clamp(1.5rem,3vw,2.2rem); font-weight: 700; color: var(--text); line-height: 1.15; margin-bottom: 1rem; }
.pub-single-authors { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.pub-single-authors strong { color: var(--rust-light); font-weight: 600; }
.pub-single-meta { display: flex; gap: 0.75rem; align-items: baseline; margin-bottom: 2rem; }
.pub-single-venue { font-size: 0.9rem; color: var(--text-muted); font-style: italic; }
.pub-single-year { font-family: 'DM Mono', monospace; font-size: 0.78rem; color: var(--amber); }
.pub-single-abstract { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 2px; padding: 1.75rem; margin-bottom: 2rem; }
.pub-abstract-label { font-family: 'DM Mono', monospace; font-size: 0.68rem; color: var(--rust); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 1rem; }
.pub-single-abstract p { font-size: 0.95rem; color: var(--text-muted); line-height: 1.85; font-weight: 300; }
.pub-single-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ── PAGEFIND SEARCH WIDGET ── */
.search-overlay { display: none; position: fixed; inset: 0; z-index: 200; background: rgba(10,18,26,0.85); backdrop-filter: blur(8px); align-items: flex-start; justify-content: center; padding-top: 8vh; }
.search-overlay.open { display: flex; }
.search-box { background: var(--bg-surface); border: 1px solid var(--border-mid); border-radius: 4px; padding: 2rem; width: 100%; max-width: 680px; }
.search-close { float: right; background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; margin-top: -0.5rem; }
.search-close:hover { color: var(--rust); }
.search-box .pagefind-ui { margin-top: 1rem; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  nav#site-nav { padding: 0 1.25rem; }
  .nav-links { display: none; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-graph-wrap { display: flex; align-items: center; justify-content: center; opacity: 1; min-height: 400px; width: 100%; flex: 1; overflow: hidden; }
  .about-layout { grid-template-columns: 1fr; }
  .about-left { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
  .about-photo { aspect-ratio: 1/1; }
  .research-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .form-row { grid-template-columns: 1fr; }
  .form-group input, .form-group textarea, .form-group select { box-sizing: border-box; max-width: 100%; width: 100%; }
  .contact-form { width: 100%; box-sizing: border-box; }
  .section-inner { padding: 0 1.25rem; }
  .hero-inner { padding: 0 1.25rem; }
}

/* ── PEOPLE PHOTOS ── */
.pi-photo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--rust); }
.student-photo { width: 90px; height: 90px; border-radius: 3px; object-fit: cover; object-position: center top; border: 1px solid var(--border-mid); flex-shrink: 0; }

/* ── HAMBURGER ── */
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; margin-right: 0.25rem; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text-muted); border-radius: 2px; transition: all 0.25s; }
.hamburger:hover span { background: var(--rust); }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu { display: none; position: fixed; top: 62px; left: 0; right: 0; background: var(--nav-bg); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border-mid); z-index: 99; padding: 0.5rem 0; }
.mobile-menu.open { display: block; }
.mobile-menu a { display: block; padding: 0.8rem 2rem; font-size: 0.82rem; font-weight: 500; text-decoration: none; color: var(--text-muted); letter-spacing: 0.07em; text-transform: uppercase; transition: color 0.2s, background 0.2s; }
.mobile-menu a:hover { color: var(--rust); background: var(--bg-surface); }
.pub-all-link { font-family: 'DM Mono', monospace; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rust); text-decoration: none; white-space: nowrap; }
.pub-all-link:hover { opacity: 0.75; }


/* ── STANDALONE PAGES ── */
.standalone-page {
  padding-top: 6rem;
  padding-bottom: 5rem;
  min-height: 100vh;
  background: var(--bg-surface);
}
.standalone-inner {
  max-width: 820px;
}
.standalone-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 0.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.standalone-subtitle {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--rust);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}
.standalone-content {
  font-size: 0.97rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.85;
}
.standalone-content h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}
.standalone-content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}
.standalone-content p { margin-bottom: 1.1rem; }
.standalone-content strong { color: var(--text); font-weight: 500; }
.standalone-content a { color: var(--rust); text-decoration: none; }
.standalone-content a:hover { text-decoration: underline; }
.standalone-content ul, .standalone-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.1rem;
}
.standalone-content li { margin-bottom: 0.4rem; }
.standalone-content blockquote {
  border-left: 3px solid var(--rust);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}
.standalone-content code {
  font-family: 'DM Mono', monospace;
  font-size: 0.85em;
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  padding: 0.1em 0.4em;
  border-radius: 2px;
  color: var(--rust);
}
.standalone-content pre {
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  border-radius: 2px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
.standalone-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
}
.standalone-content img {
  max-width: 100%;
  border-radius: 2px;
  margin: 1.5rem 0;
}
  .hamburger { display: flex !important; }
}
@media (min-width: 769px) {
  .hamburger { display: none !important; }
  .mobile-menu { display: none !important; }
}

/* ── HAMBURGER VISIBILITY -- must be last to win ────────────────────────── */
.hamburger { display: none; }
@media (max-width: 768px) {
  .hamburger { display: flex !important; flex-direction: column; }
  .nav-links  { display: none !important; }
}
@media (min-width: 769px) {
  .hamburger   { display: none !important; }
  .mobile-menu { display: none !important; }
}

/* ── Hide section numbers ─────────────────────────────────────────────── */
.section-num { display: none; }
/* ══════════════════════════════════════════════════════════════════════════
   TUFTE MARGINALIA LAYOUT -- site-wide
   ══════════════════════════════════════════════════════════════════════════ */
.tufte-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 0 3rem;
  margin-bottom: 2rem;
  align-items: stretch;
}
.tufte-meta {
  text-align: right;
  border-right: 1px solid var(--border-mid);
  padding-right: 1.5rem;
  padding-top: 0.1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.tufte-meta .t-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin: 0 0 0.4rem 0;
}
.tufte-meta .t-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin: 0 0 0.75rem 0;
}
.tufte-meta .t-status {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  color: var(--rust);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tufte-meta .t-tags {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}
.tufte-meta .t-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}
.tufte-content {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.97rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--text-muted);
  padding-top: 0.1rem;
}
.tufte-content p { margin: 0 0 1rem 0; }
.tufte-content strong { color: var(--text); font-weight: 500; }

/* ══════════════════════════════════════════════════════════════════════════
   JOURNAL COLUMN GRID -- site-wide
   ══════════════════════════════════════════════════════════════════════════ */
.journal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem 3.5rem;
  margin-top: 2.5rem;
}
.journal-item {
  border-top: 2px solid var(--text);
  padding-top: 1rem;
}
.journal-item .j-num {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.journal-item .j-year {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: var(--amber);
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}
.journal-item .j-venue {
  font-family: 'DM Mono', monospace;
  font-size: 0.64rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.journal-item .j-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin: 0 0 0.5rem 0;
}
.journal-item .j-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.journal-item .j-title a:hover { color: var(--rust); }
.journal-item .j-meta {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rust);
  margin-bottom: 0.85rem;
}
.journal-item .j-text {
  font-size: 0.87rem;
  line-height: 1.75;
  color: var(--text-muted);
  font-weight: 300;
  margin: 0 0 1rem 0;
}
.journal-item .j-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.journal-item .j-action {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border-mid);
  padding: 0.18rem 0.55rem;
  border-radius: 2px;
  transition: all 0.2s;
}
.journal-item .j-action:hover { color: var(--rust); border-color: var(--rust); }

/* ══════════════════════════════════════════════════════════════════════════
   RECENT ACTIVITIES
   ══════════════════════════════════════════════════════════════════════════ */
.activity-feed { margin-top: 0; }
.activity-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  align-items: start;
}
.activity-row:last-child { border-bottom: 1px solid var(--border); }
.activity-when {
  text-align: right;
  padding-right: 1.5rem;
  border-right: 1px solid var(--border-mid);
}
.activity-date {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--rust);
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}
.activity-type {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.activity-desc {
  font-size: 0.93rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--text-muted);
}
.activity-desc strong { color: var(--text); font-weight: 500; }
.activity-desc a { color: var(--rust); text-decoration: none; }
.activity-desc a:hover { text-decoration: underline; }
.activities-more {
  margin-top: 1.75rem;
  text-align: right;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.activities-more a { color: var(--rust); text-decoration: none; }
.activities-more a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════════════════
   STANDALONE BIO PAGE
   ══════════════════════════════════════════════════════════════════════════ */
.bio-page { display: grid; grid-template-columns: 240px 1fr; gap: 4rem; align-items: start; }
.bio-sidebar { position: sticky; top: 80px; }
.bio-photo {
  width: 100%; aspect-ratio: 4/5;
  background: var(--bg-raised); border: 1px solid var(--border-mid);
  border-radius: 2px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.75rem;
  color: var(--text-muted); font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; position: relative; margin-bottom: 1.5rem;
}
.bio-photo::before {
  content: ''; position: absolute; top: -1px; left: -1px;
  width: 32px; height: 32px;
  border-top: 2px solid var(--rust); border-left: 2px solid var(--rust);
}
.bio-photo::after {
  content: ''; position: absolute; bottom: -8px; right: -8px;
  width: calc(100% - 12px); height: calc(100% - 12px);
  border: 1px solid var(--rust); border-radius: 2px; z-index: -1;
}
.bio-name {
  font-family: 'Playfair Display', serif; font-size: 1.3rem;
  font-weight: 700; color: var(--text); margin-bottom: 0.2rem;
}
.bio-role {
  font-family: 'DM Mono', monospace; font-size: 0.65rem;
  color: var(--rust); letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 0.85rem;
}
.bio-affil {
  font-size: 0.78rem; color: var(--text-muted); line-height: 1.5;
  padding: 0.45rem 0.75rem; background: rgba(196,92,48,0.07);
  border: 1px solid rgba(196,92,48,0.18); border-radius: 2px;
}
.bio-main h2 {
  font-family: 'Playfair Display', serif; font-size: 1.4rem;
  font-weight: 700; color: var(--text); margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--border);
}
.bio-main h2:first-child { margin-top: 0; }
.bio-prose {
  font-size: 0.97rem; font-weight: 300; color: var(--text-muted);
  line-height: 1.85;
}
.bio-prose p { margin-bottom: 1.1rem; }
.bio-prose strong { color: var(--text); font-weight: 500; }

/* Mobile stacking */
@media (max-width: 560px) {
  .tufte-row { grid-template-columns: 1fr; gap: 0.6rem; }
  .tufte-meta {
    text-align: left; border-right: none;
    border-left: 3px solid var(--rust);
    padding-right: 0; padding-left: 1rem;
    align-items: flex-start;
  }
  .tufte-meta .t-tags { align-items: flex-start; }
  .activity-row { grid-template-columns: 1fr; gap: 0.4rem; }
  .activity-when {
    text-align: left; border-right: none;
    padding-right: 0; display: flex; gap: 1rem; align-items: baseline;
  }
  .bio-page { grid-template-columns: 1fr; }
  .bio-sidebar { position: static; }
}
@media (max-width: 640px) {
  .hero-btns { grid-template-columns: repeat(2, 1fr); max-width: 100%; }
}
@media (max-width: 400px) {
  .hero-btns { grid-template-columns: 1fr; }
}

/* ── People section links ───────────────────────────────────────────── */
.people-link { text-decoration: none; color: inherit; }
.people-link:hover .pi-name,
.people-link:hover .student-name { color: var(--rust); }

/* ── Square student photos ──────────────────────────────────────────── */
.student-photo-sq {
  border-radius: 3px !important;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* ── PEOPLE SECTION: rectangle photos, no link decoration ─────────────────── */
img.student-photo {
  width: 90px !important;
  height: 90px !important;
  border-radius: 3px !important;
  object-fit: cover !important;
  object-position: center top !important;
}
a.people-link,
a.people-link:link,
a.people-link:visited,
a.people-link:hover,
a.people-link:active {
  text-decoration: none !important;
  color: var(--text) !important;
}
a.people-link:hover .pi-name,
a.people-link:hover .student-name { color: var(--rust) !important; }
