/* ============================================
   Menglin Liu Academic Portfolio
   Elegant Academic — Deep Navy & Gold
   ============================================ */

/* ---------- Design Tokens ---------- */
:root {
  --navy-900: #0a192f;
  --navy-800: #112240;
  --navy-700: #1d3557;
  --navy-100: #ccd6e0;
  --gold-500: #c9a959;
  --gold-400: #d4b96a;
  --gold-100: #f5f0e1;
  --off-white: #f8f9fa;
  --gray-50:  #f1f3f5;
  --text-dark: #1a202c;
  --text-body: #4a5568;
  --text-muted: #718096;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 14px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.12);
  --radius: 10px;
  --transition: .3s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.7;
  color: var(--text-body);
  background-color: var(--off-white);
  font-size: 16px;
  overflow-x: hidden;
}

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

a { color: var(--navy-700); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-500); }

h1,h2,h3,h4 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--text-dark);
  line-height: 1.25;
}

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

.section { padding: 80px 0; }
.section--alt { background-color: var(--gray-50); }

.section-heading {
  font-size: 2rem;
  margin-bottom: 12px;
  color: var(--navy-700);
}

.section-heading::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--gold-500);
  margin-top: 12px;
  border-radius: 2px;
}

.section-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 40px;
  max-width: 640px;
}

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Sticky Navigation ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(10,25,47,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: box-shadow var(--transition);
}

.site-header.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,.25);
}

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

.nav-logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: .02em;
}
.nav-logo .dot { color: var(--gold-500); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 8px;
}

.nav-links a {
  color: var(--navy-100);
  font-size: .92rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
  position: relative;
}

.nav-links a:hover {
  color: var(--gold-400);
}

.nav-links a.active {
  color: var(--gold-500);
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--gold-500);
  border-radius: 1px;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy-100);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.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); }

/* ---------- Hero (homepage) ---------- */
.hero {
  background: var(--navy-900);
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 64px; /* header height */
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 60px;
  align-items: center;
  max-width: 1140px;
  margin: 0 auto;
  padding: 60px 24px;
}

.hero-text { max-width: 600px; }

.hero-greeting {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--gold-500);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 20px;
  line-height: 1.15;
}

.hero-titles {
  list-style: none;
  margin-bottom: 32px;
}
.hero-titles li {
  color: var(--navy-100);
  font-size: 1.05rem;
  line-height: 1.8;
  padding-left: 16px;
  position: relative;
}
.hero-titles li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  background: var(--gold-500);
  border-radius: 50%;
  transform: translateY(-50%);
}

.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  font-size: .95rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-gold {
  background: var(--gold-500);
  color: var(--navy-900);
  border-color: var(--gold-500);
}
.btn-gold:hover {
  background: var(--gold-400);
  border-color: var(--gold-400);
  color: var(--navy-900);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(201,169,89,.35);
}

.btn-outline {
  background: transparent;
  color: var(--navy-100);
  border-color: var(--navy-100);
}
.btn-outline:hover {
  border-color: var(--gold-400);
  color: var(--gold-400);
  transform: translateY(-2px);
}

.hero-photo {
  width: 340px;
  height: 340px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--gold-500);
  box-shadow: 0 0 0 8px rgba(201,169,89,.15);
}

/* ---------- Page Banner (sub-pages) ---------- */
.page-banner {
  background: var(--navy-900);
  padding-top: calc(64px + 60px); /* header + spacing */
  padding-bottom: 60px;
}

.page-banner h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.8rem;
  color: var(--white);
  margin-bottom: 8px;
}

.page-banner p {
  color: var(--navy-100);
  font-size: 1.1rem;
  max-width: 600px;
}

.page-banner .banner-logo {
  width: 120px;
  margin-bottom: 20px;
  border-radius: 10px;
}

/* ---------- Highlight Cards (homepage) ---------- */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.highlight-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  border-top: 3px solid var(--gold-500);
}
.highlight-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.highlight-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--navy-700);
}

.highlight-card p {
  font-size: .95rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ---------- Research Cards ---------- */
.research-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--gold-500);
  transition: transform var(--transition), box-shadow var(--transition);
}
.research-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.research-card h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy-700);
  margin-bottom: 6px;
  line-height: 1.45;
}

.research-card h3 a {
  color: var(--navy-700);
}
.research-card h3 a:hover {
  color: var(--gold-500);
}

.research-card .authors {
  font-family: 'Merriweather', Georgia, serif;
  font-style: italic;
  color: var(--text-muted);
  font-size: .92rem;
  margin-bottom: 10px;
}

.journal-badge {
  display: inline-block;
  background: var(--gold-100);
  color: var(--navy-700);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.research-card details {
  margin-top: 14px;
  border-top: 1px solid #e8ecf1;
  padding-top: 14px;
}

.research-card details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: .9rem;
  color: var(--navy-700);
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.research-card details summary::-webkit-details-marker { display: none; }

.research-card details summary::before {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold-100);
  color: var(--navy-700);
  font-size: .85rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.research-card details[open] summary::before {
  content: '\2212';
  transform: rotate(0deg);
}

.research-card details .abstract-text {
  margin-top: 12px;
  font-size: .93rem;
  color: var(--text-body);
  line-height: 1.8;
}

.research-card .extra-link {
  display: inline-block;
  margin-top: 12px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--gold-500);
}
.research-card .extra-link:hover {
  color: var(--gold-400);
}

/* ---------- Teaching Cards ---------- */
.teaching-group { margin-bottom: 48px; }

.teaching-group-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  color: var(--navy-700);
  margin-bottom: 24px;
}

.teaching-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.teaching-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--gold-500);
  transition: transform var(--transition), box-shadow var(--transition);
}
.teaching-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.teaching-card h4 {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy-700);
  margin-bottom: 6px;
}

.teaching-card .institution {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.teaching-card .terms {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.teaching-card .terms li {
  background: var(--gray-50);
  color: var(--text-muted);
  font-size: .82rem;
  padding: 3px 10px;
  border-radius: 4px;
}

/* ---------- CV Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 36px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gold-500);
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -32px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold-500);
  border: 3px solid var(--off-white);
  box-shadow: 0 0 0 2px var(--gold-500);
}

.timeline-item .tl-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.timeline-item .tl-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-dark);
}

.timeline-item .tl-date {
  font-size: .9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.timeline-item .tl-org {
  font-family: 'Merriweather', Georgia, serif;
  font-style: italic;
  color: var(--text-muted);
  font-size: .95rem;
  margin-bottom: 10px;
}

.timeline-item ul {
  list-style: disc;
  padding-left: 20px;
}
.timeline-item li {
  font-size: .93rem;
  margin-bottom: 6px;
  color: var(--text-body);
}

/* ---------- Skills Grid ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.skill-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--gold-500);
}

.skill-card h4 {
  font-family: 'Inter', sans-serif;
  font-size: .92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--navy-700);
  margin-bottom: 8px;
}

.skill-card p {
  font-size: .93rem;
  color: var(--text-body);
  line-height: 1.6;
}

/* ---------- Projects (CV) ---------- */
.project-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--navy-700);
}

.project-item .proj-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.project-item .proj-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-dark);
}

.project-item .proj-date {
  font-size: .88rem;
  color: var(--text-muted);
  font-weight: 500;
}

.project-item .proj-tech {
  font-size: .85rem;
  color: var(--gold-500);
  font-weight: 500;
  margin-bottom: 10px;
}

.project-item ul {
  list-style: disc;
  padding-left: 20px;
}
.project-item li {
  font-size: .93rem;
  margin-bottom: 6px;
  color: var(--text-body);
}

/* ---------- PoliPrompt Feature Cards ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px 28px;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--gold-500);
  transition: transform var(--transition), box-shadow var(--transition);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-card h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy-700);
  margin-bottom: 10px;
}

.feature-card p {
  font-size: .93rem;
  color: var(--text-body);
  line-height: 1.7;
  margin-bottom: 16px;
}

.feature-card .btn {
  font-size: .88rem;
  padding: 10px 20px;
}

/* ---------- Banner Buttons (CV, Teaching) ---------- */
.banner-buttons {
  display: flex;
  gap: 14px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.banner-contact {
  color: var(--navy-100);
  font-size: .95rem;
  margin-top: 12px;
}
.banner-contact a {
  color: var(--gold-400);
}
.banner-contact a:hover {
  color: var(--gold-500);
}

/* ---------- Summary Box ---------- */
.summary-box {
  background: var(--white);
  border-left: 4px solid var(--gold-500);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-sm);
  font-size: 1rem;
  color: var(--text-body);
  line-height: 1.8;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-900);
  color: var(--navy-100);
  padding: 60px 0 30px;
  margin-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-col h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  color: var(--gold-500);
  margin-bottom: 16px;
}

.footer-col p {
  font-size: .9rem;
  color: var(--navy-100);
  line-height: 1.7;
}

.footer-col ul {
  list-style: none;
}
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a {
  color: var(--navy-100);
  font-size: .9rem;
  transition: color var(--transition);
}
.footer-col ul li a:hover { color: var(--gold-400); }

.footer-bottom {
  max-width: 1140px;
  margin: 40px auto 0;
  padding: 20px 24px 0;
  border-top: 1px solid rgba(255,255,255,.08);
  text-align: center;
  font-size: .85rem;
  color: rgba(204,214,224,.6);
}

/* ---------- About Section (homepage) ---------- */
.about-text p {
  font-size: 1.05rem;
  color: var(--text-body);
  line-height: 1.85;
  margin-bottom: 1.2em;
}

.about-text em {
  font-family: 'Merriweather', Georgia, serif;
  font-style: italic;
  color: var(--text-dark);
}

.about-text a {
  color: var(--navy-700);
  font-weight: 500;
  border-bottom: 1px solid var(--gold-500);
}
.about-text a:hover { color: var(--gold-500); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-name { font-size: 2.8rem; }
  .hero-photo { width: 280px; height: 280px; }
  .highlights-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  /* Navigation */
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--navy-900);
    flex-direction: column;
    padding: 20px 24px;
    gap: 4px;
    transform: translateY(-120%);
    transition: transform .35s ease;
    box-shadow: 0 8px 20px rgba(0,0,0,.3);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 12px 16px; font-size: 1rem; }
  .hamburger { display: flex; }

  /* Hero */
  .hero { min-height: auto; padding-top: 64px; }
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
    padding: 40px 24px 60px;
  }
  .hero-text { max-width: 100%; }
  .hero-photo {
    width: 240px; height: 240px;
    margin: 0 auto;
    order: -1;
  }
  .hero-name { font-size: 2.2rem; }
  .hero-titles li { text-align: left; }
  .hero-buttons { justify-content: center; }

  /* Page Banner */
  .page-banner { padding-top: calc(64px + 40px); padding-bottom: 40px; }
  .page-banner h1 { font-size: 2rem; }

  /* Grids */
  .highlights-grid { grid-template-columns: 1fr; }
  .teaching-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }

  /* Section */
  .section { padding: 50px 0; }
  .section-heading { font-size: 1.6rem; }
}

@media (max-width: 480px) {
  .hero-name { font-size: 1.8rem; }
  .hero-photo { width: 200px; height: 200px; }
  .btn { padding: 11px 22px; font-size: .88rem; }
  .research-card { padding: 24px 20px; }
  .teaching-card { padding: 22px 18px; }
}
