/* ============================================================
   Miao Liu — Academic Personal Website
   Palette: BC Maroon #8B0000 · Gold #C8A951 · Near-white #FAFAFA
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --maroon:      #8B0000;
  --maroon-dark: #6a0000;
  --maroon-bg:   #fdf5f5;
  --gold:        #C8A951;
  --gold-light:  #f5edcf;
  --text:        #1a1a1a;
  --text-muted:  #555;
  --text-light:  #888;
  --bg:          #FAFAFA;
  --bg-alt:      #f2f2f2;
  --border:      #e0e0e0;
  --white:       #ffffff;
  --radius:      8px;
  --shadow:      0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg:   0 6px 30px rgba(0,0,0,0.12);
  --nav-h:       64px;
  --font-serif:  'Crimson Pro', 'Georgia', 'Times New Roman', serif;
  --font-sans:   'Inter', system-ui, -apple-system, sans-serif;
  --transition:  0.25s ease;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--maroon); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--maroon-dark); text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.3; }

img { max-width: 100%; display: block; }

ul { list-style: none; }

/* ---------- Utility ---------- */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  color: var(--maroon);
  margin-bottom: 32px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gold);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title i { font-size: 1.4rem; color: var(--gold); }

section { padding: 72px 0; }
section:nth-child(even) { background: var(--bg-alt); }

/* ---------- Navigation ---------- */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  z-index: 1000;
  transition: border-color var(--transition), box-shadow var(--transition);
}

#navbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a3564;
  letter-spacing: 0.02em;
}
.nav-brand:hover { text-decoration: none; color: #0f2040; }

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background var(--transition), color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--maroon-bg);
  color: var(--maroon);
  text-decoration: none;
}

/* hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
#about {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #fff 0%, var(--maroon-bg) 60%, #fef9ec 100%);
  padding: 0;
  position: relative;
  overflow: hidden;
}

#about::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,169,81,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 80px 24px 60px;
  display: flex;
  align-items: center;
  gap: 56px;
}

.hero-photo {
  flex-shrink: 0;
  width: 180px; height: 180px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--white);
  box-shadow: var(--shadow-lg);
  background: var(--maroon);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.hero-initials {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 700;
  color: var(--white);
  user-select: none;
}

.hero-text h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: #1a3564;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.hero-title {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.hero-institution {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

.hero-bio {
  margin-bottom: 24px;
}

.hero-bio p {
  font-size: 0.97rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.75;
}

.hero-bio a { color: var(--maroon); }

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--maroon);
  color: var(--white);
}
.btn-primary:hover { background: var(--maroon-dark); color: var(--white); text-decoration: none; }

.btn-outline {
  background: transparent;
  color: var(--maroon);
  border: 1.5px solid var(--maroon);
}
.btn-outline:hover { background: var(--maroon); color: var(--white); text-decoration: none; }

/* ---------- CV Section ---------- */
.cv-section { text-align: center; }
.cv-blurb { color: var(--text-muted); margin-bottom: 20px; font-size: 0.97rem; }
.btn-cv { font-size: 0.95rem; padding: 12px 28px; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
}

.about-bio p {
  font-size: 1.02rem;
  color: var(--text);
  margin-bottom: 14px;
}

.about-info {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.about-info h4 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 14px;
}

.info-item {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: flex-start;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.info-item i { color: var(--gold); margin-top: 3px; flex-shrink: 0; width: 16px; }
.info-item a { color: var(--maroon); }

/* ---------- Research Interests ---------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.tag {
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition);
}

.tag:hover {
  border-color: var(--gold);
  background: var(--gold-light);
  color: var(--text);
}

/* ---------- Paper Cards ---------- */
.paper-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 16px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--maroon);
  border-color: var(--maroon);
  color: var(--white);
}

.papers-list { display: flex; flex-direction: column; gap: 16px; }

.paper-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  border-left: 4px solid transparent;
}

.paper-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.paper-card.published    { border-left-color: #2e7d32; }
.paper-card.accepted     { border-left-color: #1565c0; }
.paper-card.rr           { border-left-color: #e65100; }
.paper-card.submitted    { border-left-color: #757575; }
.paper-card.working      { border-left-color: #6a1b9a; }

.paper-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }

.paper-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.paper-title a { color: var(--text); }
.paper-title a:hover { color: var(--maroon); text-decoration: none; }

.badge {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-published  { background: #e8f5e9; color: #2e7d32; }
.badge-accepted   { background: #e3f2fd; color: #1565c0; }
.badge-rr         { background: #fff3e0; color: #e65100; }
.badge-submitted  { background: #f5f5f5; color: #616161; }
.badge-working    { background: #f3e5f5; color: #6a1b9a; }

.paper-journal {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--maroon);
  margin-bottom: 4px;
}

.paper-authors {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 6px;
}

.paper-notes { margin-top: 8px; }

.paper-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: #b8860b;
  background: #fffbea;
  border: 1px solid #f0d870;
  padding: 2px 10px;
  border-radius: 50px;
  margin: 2px 4px 2px 0;
}

.paper-note i { font-size: 0.75rem; }

.paper-presentations {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-top: 8px;
  line-height: 1.5;
}

/* ---------- Teaching ---------- */
.teaching-list { display: flex; flex-direction: column; gap: 20px; }

.course-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  align-items: start;
}

.course-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.course-role {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.course-note {
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.course-year {
  font-size: 0.85rem;
  color: var(--text-light);
  text-align: right;
  padding-top: 3px;
  white-space: nowrap;
}

/* ---------- Awards ---------- */
.awards-list { display: flex; flex-direction: column; gap: 14px; }

.award-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow);
}

.award-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.award-icon i { color: var(--gold); font-size: 1rem; }

.award-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.award-year {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 2px;
}

/* ---------- Press ---------- */
.press-list { display: flex; flex-direction: column; gap: 14px; }

.press-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: box-shadow var(--transition);
}

.press-item:hover { box-shadow: var(--shadow-lg); }

.press-outlet {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--maroon);
  min-width: 180px;
  flex-shrink: 0;
}

.press-outlet-year {
  font-weight: 400;
  color: var(--text-light);
  font-size: 0.82rem;
}

.press-title {
  font-size: 0.95rem;
  color: var(--text);
}

.press-title a { color: var(--text); }
.press-title a:hover { color: var(--maroon); }

/* ---------- Education ---------- */
.edu-list { display: flex; flex-direction: column; gap: 16px; }

.edu-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  border-left: 3px solid var(--gold);
  padding: 12px 0 12px 20px;
}

.edu-school {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
}

.edu-degree {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.edu-year {
  font-size: 0.85rem;
  color: var(--text-light);
  text-align: right;
  white-space: nowrap;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.contact-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 28px;
  box-shadow: var(--shadow);
}

.contact-block h3 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 16px;
}

.contact-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.contact-row i { color: var(--maroon); width: 18px; margin-top: 3px; flex-shrink: 0; }
.contact-row a { color: var(--maroon); }

/* ---------- Footer ---------- */
footer {
  background: var(--maroon);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 28px 24px;
  font-size: 0.85rem;
}

footer a { color: var(--gold); }

/* ---------- Agents Page ---------- */

.agents-hero {
  padding: 100px 0 48px;
}

.agents-hero h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 8px;
}

.agents-hero p {
  color: var(--text-muted);
  font-size: 0.97rem;
}

.agents-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-bottom: 80px;
}

.agent-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}

.agent-card:hover { box-shadow: var(--shadow-lg); }

.agent-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0d1f3c;
  overflow: hidden;
}

.agent-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.agent-body { padding: 28px 28px 24px; }

.agent-name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.agent-subtitle {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.agent-desc {
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 20px;
}

.agent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 480px) {
  .agent-body { padding: 20px; }
  .agent-actions { flex-direction: column; }
  .agent-actions .btn { justify-content: center; }
}

/* ---------- Teaching Page ---------- */

.course-hero {
  background: linear-gradient(135deg, #0d2b6e 0%, #1a3564 60%, #0a1f4e 100%);
  color: var(--white);
  padding: 120px 0 72px;
  position: relative;
  overflow: hidden;
}

.course-hero::before {
  content: '';
  position: absolute;
  top: -150px; right: -150px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,169,81,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.course-hero-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.course-hero-layout {
  display: flex;
  align-items: center;
  gap: 48px;
}

.course-hero-photo {
  flex-shrink: 0;
  width: 150px; height: 150px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.25);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.course-hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.course-hero-content { flex: 1; }

.course-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 640px) {
  .course-hero-layout { flex-direction: column; gap: 24px; text-align: center; }
  .course-meta { justify-content: center; }
  .course-hero-actions { justify-content: center; }
}

.course-label {
  display: inline-block;
  background: rgba(200,169,81,0.2);
  color: var(--gold);
  border: 1px solid rgba(200,169,81,0.4);
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.course-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 8px;
}

.course-hero h1 em {
  color: var(--gold);
  font-style: normal;
}

.course-subtitle {
  font-size: 1rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 24px;
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 32px;
}

.course-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.8);
}

.course-meta-item i { color: var(--gold); }

.course-hero .btn-outline {
  border-color: rgba(255,255,255,0.5);
  color: var(--white);
}
.course-hero .btn-outline:hover {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  text-decoration: none;
}

/* Unit tabs */
.unit-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 40px;
  overflow-x: auto;
  scrollbar-width: none;
}
.unit-tabs::-webkit-scrollbar { display: none; }

.unit-tab {
  padding: 12px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  font-family: var(--font-sans);
  transition: color var(--transition), border-color var(--transition);
  letter-spacing: 0.02em;
}

.unit-tab:hover { color: var(--text); }
.unit-tab.active { color: #1a3564; border-bottom-color: #1a3564; }

/* Unit panels */
.unit-panel { display: none; }
.unit-panel.active { display: block; }

.unit-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.unit-badge {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 12px;
  background: #1a3564;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
}

.unit-badge.tbd { background: var(--bg-alt); color: var(--text-light); }

.unit-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--text);
}

.unit-desc {
  font-size: 0.97rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  max-width: 680px;
  line-height: 1.75;
}

/* Materials grid */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.material-group { margin-bottom: 32px; }

.material-group-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.material-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}

.material-item:hover {
  box-shadow: var(--shadow);
  border-color: #1a3564;
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--text);
}

.material-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.material-icon.pdf  { background: #fde8e8; color: #c62828; }
.material-icon.xlsx { background: #e8f5e9; color: #2e7d32; }
.material-icon.case { background: #e3f2fd; color: #1565c0; }

.material-name { font-weight: 500; flex: 1; line-height: 1.4; }
.material-type { font-size: 0.75rem; color: var(--text-light); margin-top: 2px; }

.material-item i.fa-arrow-down {
  color: var(--text-light);
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* TBD placeholder */
.tbd-block {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  color: var(--text-light);
}
.tbd-block i { font-size: 2.5rem; margin-bottom: 16px; color: var(--border); }
.tbd-block p { font-size: 0.95rem; }

@media (max-width: 600px) {
  .materials-grid { grid-template-columns: 1fr; }
  .course-hero { padding: 100px 0 48px; }
  .unit-tab { padding: 10px 14px; font-size: 0.8rem; }
}

/* ---------- Back to top ---------- */
#back-top {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--maroon);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--transition), transform var(--transition);
  z-index: 900;
}

#back-top.visible { opacity: 1; transform: translateY(0); }
#back-top:hover { background: var(--maroon-dark); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    gap: 4px;
  }

  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 16px; font-size: 0.9rem; }
  .nav-toggle { display: flex; }

  #about { min-height: auto; }
  .hero-inner { flex-direction: column; gap: 28px; text-align: center; padding-top: 100px; }
  .hero-links { justify-content: center; }
  .hero-photo { width: 140px; height: 140px; }

  .about-grid { grid-template-columns: 1fr; }

  .contact-grid { grid-template-columns: 1fr; }

  .course-card { grid-template-columns: 1fr; }
  .course-year { text-align: left; }

  .edu-item { grid-template-columns: 1fr; }
  .edu-year { text-align: left; }

  .paper-header { flex-direction: column; gap: 8px; }

  section { padding: 52px 0; }

  .press-item { flex-direction: column; gap: 6px; }
  .press-outlet { min-width: unset; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-inner { padding: 100px 16px 48px; }
}
