/* =====================================================
   ROOT VARIABLES
   ===================================================== */
:root {
  --primary: #0b3c5d;
  --accent: #0266c8;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg-light: #f8fafc;
}

/* =====================================================
   RESET / BASE
   ===================================================== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background: #ffffff;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
}

/* =====================================================
   LEFT SIDEBAR
   ===================================================== */
.sidebar {
  width: 270px;
  height: 100vh;
  overflow-y: auto;
  padding-top: 14px;
  padding-left: 24px;
  padding-right: 20px;
  padding-bottom: 24px;
  position: sticky;
  top: 0;
  background: #f4f6f9;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-family: inherit;
}

.contact-emails a {
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.25;
}

.contact-emails {
  margin: 0px 0 0;
  padding: 0;
}

.sidebar-block {
  margin-bottom: 18px;
}

.sidebar-block:first-child {
  margin-top: 0;
}

.sidebar h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 4px;
}

.sidebar ul {
  padding-left: 18px;
  margin-top: 4px;
}

.sidebar li {
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.sidebar p {
  margin-top: 4px;
  line-height: 1.35;
  font-size: 0.9rem;
  color: var(--text);
}

.sidebar p a {
  display: inline;
  margin: 0;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.sidebar p a:hover {
  text-decoration: underline;
}

.sidebar > .sidebar-block a {
  display: block;
  margin-top: 6px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.sidebar > .sidebar-block a:hover {
  text-decoration: underline;
}

.sidebar-block i.fa-solid {
  font-weight: 900;
}

.sidebar-block a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--accent);
  text-decoration: none;
  margin-top: 6px;
}

.sidebar-block i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
  color: var(--accent);
}

/* =====================================================
   MAIN CONTENT WRAPPER
   ===================================================== */
.main-content {
  flex: 1;
  min-width: 0;
  padding-top: 20px;
}

/* =====================================================
   HEADER / NAV
   ===================================================== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

nav {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
}

nav a:hover {
  text-decoration: underline;
}

/* =====================================================
   HERO
   ===================================================== */
.hero {
  max-width: 900px;
  margin: 60px auto 80px;
  padding: 0 24px;
  text-align: center;
}

.hero img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  object-position: center top;
  background: #ffffff;
  border-radius: 50%;
  border: 4px solid var(--primary);
  margin-bottom: 10px;
}

.hero h1 {
  margin: 0;
  font-size: 2.4rem;
  color: var(--primary);
}

.hero p {
  margin-top: 6px;
  font-size: 1.05rem;
  color: var(--muted);
}

.contact a {
  font-size: 0.95rem;
  color: var(--accent);
  text-decoration: none;
}

/* =====================================================
   SECTIONS
   ===================================================== */
section {
  max-width: 900px;
  margin: 70px auto;
  padding: 0 24px;
  scroll-margin-top: 120px;
  position: relative;
  z-index: 1;
}

section h2 {
  font-size: 1.7rem;
  color: var(--accent);
  border-bottom: 3px solid var(--accent);
  display: inline-block;
  padding-bottom: 6px;
  margin-bottom: 26px;
}

/* =====================================================
   ABOUT SUMMARY
   ===================================================== */
#about-summary {
  margin-top: 1rem;
}

#about-summary p {
  margin: 0.6rem auto;
  max-width: 820px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  text-align: justify;
  opacity: 0.95;
}

#phd-line,
#current-line {
  margin-top: 0.4rem;
  font-size: 1rem;
  text-align: center;
  color: var(--muted);
  line-height: 1.5;
}

#phd-line strong,
#current-line strong {
  color: var(--text);
  font-weight: 600;
}

/* =====================================================
   ANNOUNCEMENTS
   ===================================================== */
#announcements {
  position: relative;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px 20px 18px 48px;
  margin-top: 18px;
}

#announcements::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 20px;
  bottom: 20px;
  width: 2px;
  background: var(--border);
}

.announce-item {
  position: relative;
  display: flex;
  gap: 22px;
  margin-bottom: 22px;
  transition: opacity 0.6s ease;
}

.announce-dot {
  position: absolute;
  left: 14px;
  top: 22px;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.announce-icon {
  font-size: 11px;
  color: #ffffff;
}

.announce-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 14px 16px;
  margin-left: 22px;
  width: 100%;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.announce-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.14);
  border: 1px solid transparent;
  border-color: var(--accent);
  background: #fdfefe;
}

.announce-date {
  font-size: 0.8rem;
  color: var(--muted);
}

.announce-rotator {
  position: relative;
  min-height: 120px;
}

.announce-item.hidden {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
}

/* =====================================================
   EXPERIENCE
   ===================================================== */
#experience h2 {
  display: inline-block;
  visibility: visible;
  opacity: 1;
}

#experience .item strong {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
}

#experience .item em {
  display: block;
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--muted);
}

.experience-points {
  margin: 10px 0 6px 18px;
  padding: 0;
}

.experience-points li {
  font-size: 0.95rem;
  line-height: 1.45;
  margin-bottom: 6px;
  color: var(--text);
}

.experience-note {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

/* =====================================================
   EDUCATION
   ===================================================== */
#education .education-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#education .edu-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

#education .edu-degree {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.4;
}

#education .edu-period {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

#education .edu-institution {
  font-size: 0.95rem;
  font-style: italic;
  color: #374151;
}

#education .edu-details {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.6;
}

#education .edu-details li {
  margin-bottom: 2px;
}

/* =====================================================
   GRANTS, FELLOWSHIPS & AWARDS
   ===================================================== */
#grants .grant-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

#grants .grant-header strong {
  font-size: 1.05rem;
  color: var(--primary);
}

#grants .grant-period {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

#grants .grant-sponsor {
  font-size: 0.95rem;
  font-style: italic;
  color: #374151;
  margin-top: 4px;
}

#grants .grant-description {
  font-size: 0.92rem;
  color: var(--text);
  margin-top: 6px;
  line-height: 1.6;
}

/* =====================================================
   CONTENT CARDS (shared base)
   ===================================================== */
.pub-item,
.item,
.ref {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 18px;
  transition: border-color 0.25s ease,
              background 0.25s ease,
              box-shadow 0.25s ease,
              transform 0.25s ease;
}

.pub-item:hover,
.item:hover,
.ref:hover {
  border-color: var(--accent);
  background: #fdfefe;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.item {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}

.pub-item strong,
.item strong {
  font-size: 1.05rem;
}

/* =====================================================
   PUBLICATIONS
   ===================================================== */
.pub-item {
  margin-bottom: 22px;
  cursor: default;
}

.pub-links {
  margin-top: 6px;
}

.pub-links a {
  display: inline-block;
  margin-right: 14px;
  font-size: 0.9rem;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}

.pub-links a:hover {
  text-decoration: underline;
}

.bibtex {
  margin-top: 10px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-x: auto;
}

.bibtex[hidden] {
  display: none;
}

/* =====================================================
   RANK BADGES — uses your CSS variables throughout
   ===================================================== */
.rank-badge {
  display: inline-block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 6px;
  vertical-align: middle;
  margin-left: 8px;
  white-space: nowrap;
  line-height: 1.7;
  position: relative;
  top: -1px;
  cursor: default;
}

/* Q1 — deep green, distinct from primary/accent */
.rank-q1 {
  background: #1a6b3c;
  color: #fff;
  border: 1px solid #155a32;
}

/* Q2 — muted teal, one step down from the Q1 green, still reads as "good" */
.rank-q2 {
  background: #0f766e;
  color: #fff;
  border: 1px solid #0b5c56;
}

/* CORE A — your --primary navy */
.rank-core-a {
  background: var(--primary);
  color: #fff;
  border: 1px solid #092e48;
}

/* CORE B — your --accent blue */
.rank-core-b {
  background: var(--accent);
  color: #fff;
  border: 1px solid #0257aa;
}

/* Under Review / Preprint — outline only, non-distracting */
.rank-under-review {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--muted);
}

/* Tooltip cursor hint */
.rank-badge[title] {
  cursor: help;
}

/* =====================================================
   RESEARCH
   ===================================================== */
/* card box + hover come from the shared .item rule */

/* =====================================================
   PROJECTS
   ===================================================== */
/* card box + hover come from the shared .item rule */

.projects-repo-link {
  margin: -18px 0 26px;
}

.projects-repo-link a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.projects-repo-link a:hover {
  text-decoration: underline;
}

.project-links {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.project-links a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.project-links a:hover {
  text-decoration: underline;
}

/* =====================================================
   ACADEMIC SERVICE
   ===================================================== */
.service-line {
  margin: 0 0 14px;
  padding: 0;
  line-height: 1.7;
  color: var(--text);
}

/* =====================================================
   TEACHING
   ===================================================== */
#teaching {
  position: relative;
}

.teaching-header {
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.45;
  color: var(--text);
}

.teaching-item ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.teaching-item li {
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 4px;
}

.teaching-groups {
  margin-top: 6px;
}

.teaching-group-line {
  margin: 0 0 8px;
  font-size: 0.93rem;
  line-height: 1.65;
  color: var(--text);
}

.teaching-group-line strong {
  color: var(--primary);
}

/* =====================================================
   SKILLS
   ===================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skills-grid li {
  font-size: 0.95rem;
  color: var(--text);
  padding-left: 14px;
  position: relative;
  transition: color 0.2s ease, transform 0.2s ease;
}

.skills-grid li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--muted);
}

.skills-grid li:hover {
  color: var(--primary);
  transform: translateX(4px);
}

.skills-grid li:hover::before {
  color: var(--accent);
}

/* =====================================================
   ACHIEVEMENTS
   ===================================================== */
/* card box, typography, and hover come from the shared .item rule */

/* =====================================================
   TALKS & PRESENTATIONS
   ===================================================== */
/* card box, typography, and hover come from the shared .item rule */

/* =====================================================
   ACTIVITIES
   ===================================================== */
/* card box, typography, and hover come from the shared .item rule */

/* =====================================================
   REFERENCES
   ===================================================== */
/* card box, typography, and hover come from the shared .ref rule above */

/* =====================================================
   SCROLL REVEAL
   ===================================================== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
  body {
    flex-direction: column;
  }

  .main-content {
    order: 1;
  }

  .sidebar {
    order: 2;
    width: 100%;
    height: auto;
    max-height: none;
    overflow-y: visible;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  nav {
    justify-content: center;
  }
}

/* =====================================================
   ACCESSIBILITY
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
