/* Custom styling for Miranda Lu's Academic & Professional Website */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Newsreader:ital,opsz,wght@0,6..72,300..700;1,6..72,300..700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --font-serif: 'Newsreader', Georgia, Cambria, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Light Theme */
  --bg-primary: #fcfbf9;
  --bg-secondary: #f4f1ea;
  --bg-card: #ffffff;
  --bg-card-hover: #faf9f6;
  --border-color: #e5e0d6;
  --border-light: #ece7dd;
  
  --text-primary: #1e1e1e;
  --text-secondary: #57534e;
  --text-muted: #78716c;
  
  --accent-primary: #1b365d; /* Royal Academic Navy */
  --accent-secondary: #8b3a2b; /* Oxford Terracotta / Brick */
  --accent-light: #eef2f6;
  --accent-border: #cbd5e1;
  
  --tag-bg: #ece7de;
  --tag-text: #3c3836;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.03);
  --shadow-lg: 0 12px 28px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
}

.dark {
  /* Dark Theme */
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2128;
  --bg-card-hover: #22272e;
  --border-color: #30363d;
  --border-light: #252c35;
  
  --text-primary: #f0f6fc;
  --text-secondary: #adbac7;
  --text-muted: #768390;
  
  --accent-primary: #58a6ff;
  --accent-secondary: #f78166;
  --accent-light: #17263c;
  --accent-border: #388bfd40;
  
  --tag-bg: #262c36;
  --tag-text: #cdd9e5;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.4);
  --shadow-lg: 0 14px 32px rgba(0,0,0,0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Typography Helpers */
.font-serif {
  font-family: var(--font-serif);
}

.font-mono {
  font-family: var(--font-mono);
}

h1, h2, h3, .heading-serif {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  line-height: 1.25;
}

h3 {
  font-size: 1.35rem;
  line-height: 1.35;
}

p {
  color: var(--text-secondary);
}

/* Custom Selection */
::selection {
  background-color: #3b82f633;
  color: inherit;
}

/* Academic Paper Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--border-light);
}

/* Academic Paper Card */
.paper-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.75rem;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.paper-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-primary);
}

/* CV Section Styling */
.timeline-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 2.25rem;
  border-left: 1.5px solid var(--border-color);
}

.timeline-item:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

.timeline-dot {
  position: absolute;
  left: -0.42rem;
  top: 0.3rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid var(--bg-primary);
}

/* Button & Nav Styles */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.65rem 1.3rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.925rem;
  transition: all 0.2s ease;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.925rem;
  transition: all 0.2s ease;
  text-decoration: none;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--text-muted);
}

/* Modal styling */
.cv-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.cv-modal.active {
  display: flex;
}

/* Toast alert */
#toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 200;
}

#toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Print Styles */
@media print {
  header, footer, .no-print, #theme-toggle, .btn-primary, .btn-secondary {
    display: none !important;
  }
  body {
    background: white !important;
    color: black !important;
  }
  .paper-card, .timeline-item {
    break-inside: avoid;
    border-color: #ddd !important;
  }
}
