/* ==========================================================================
   Portfolio — style.css
   Single-file stylesheet: reset, tokens, typography, layout, components
   ========================================================================== */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ---------- 2. Design Tokens (Light default) ---------- */
:root {
  /* Colors */
  --bg-primary: #fafaf8;
  --bg-card: #ffffff;
  --bg-card-border: rgba(0,0,0,.06);
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a5a;
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.1);
  --nav-bg: rgba(250,250,248,.85);
  --nav-border: rgba(0,0,0,.06);
  --hero-overlay: rgba(250,250,248,.6);
  --tag-bg: #f0f0f5;
  --tag-color: #4a4a5a;
  --timeline-line: #e0e0e8;
  --print-bar-bg: #f3f3f5;
  --footer-bg: #f3f3f5;

  /* Typography */
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-heading: 'JetBrains Mono', 'Fira Code', monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.563rem;
  --fs-2xl: 1.953rem;
  --fs-3xl: 2.441rem;
  --fs-4xl: 3.052rem;

  /* Spacing */
  --container-max: 1100px;
  --section-pad: 5rem 1.25rem;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: .3s ease;
}

/* ---------- 3. Dark Theme ---------- */
[data-theme="dark"] {
  --bg-primary: #0a0a0f;
  --bg-card: #1a1a24;
  --bg-card-border: rgba(255,255,255,.08);
  --text-primary: #e4e4e7;
  --text-secondary: #a1a1aa;
  --accent-primary: #818cf8;
  --accent-secondary: #a78bfa;
  --accent-gradient: linear-gradient(135deg, #818cf8, #a78bfa);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.5);
  --nav-bg: rgba(10,10,15,.8);
  --nav-border: rgba(255,255,255,.06);
  --hero-overlay: rgba(10,10,15,.6);
  --tag-bg: rgba(129,140,248,.12);
  --tag-color: #a78bfa;
  --timeline-line: #2a2a3a;
  --print-bar-bg: #1a1a24;
  --footer-bg: #0f0f18;
}

/* ---------- 4. Base ---------- */
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: background var(--transition), color var(--transition);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { color: var(--text-secondary); max-width: 65ch; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- 5. Navbar ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--nav-border);
  transition: box-shadow var(--transition), background var(--transition);
}
.navbar.scrolled {
  box-shadow: var(--shadow-md);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-primary);
}
.nav-logo .brace { color: var(--accent-primary); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-links a {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--accent-primary);
  transition: width var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-primary);
}
.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: 2px solid var(--bg-card-border);
  border-radius: 50%;
  width: 40px; height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.theme-toggle:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px; height: 32px;
  position: relative;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-primary);
  transition: all var(--transition);
  border-radius: 2px;
}
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-mobile {
  display: none;
  position: absolute;
  top: 64px; left: 0; right: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--nav-border);
  padding: 1rem 1.25rem;
  flex-direction: column;
  gap: 0.75rem;
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  transition: color var(--transition);
}
.nav-mobile a:hover,
.nav-mobile a.active { color: var(--accent-primary); }

/* ---------- 6. Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.25rem 4rem;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99,102,241,.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(139,92,246,.08) 0%, transparent 50%);
  animation: heroFloat 20s ease-in-out infinite alternate;
}
@keyframes heroFloat {
  from { transform: translateY(0) scale(1); }
  to   { transform: translateY(-20px) scale(1.05); }
}
.hero-content { position: relative; z-index: 1; }
.hero-greeting {
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  color: var(--accent-primary);
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}
.hero-photo {
  width: 140px; height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.5rem;
  border: 3px solid var(--accent-primary);
  box-shadow: 0 0 0 6px rgba(99,102,241,.15);
}
.hero h1 {
  font-size: var(--fs-3xl);
  margin-bottom: 0.5rem;
}
.hero-title {
  font-size: var(--fs-lg);
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.hero-tagline {
  font-size: var(--fs-base);
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
/* Blinking cursor in dark mode */
[data-theme="dark"] .hero-tagline::after {
  content: '|';
  color: var(--accent-primary);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}
@keyframes blink {
  50% { opacity: 0; }
}
.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--fs-sm);
  transition: all var(--transition);
  border: none;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99,102,241,.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99,102,241,.4);
}
.btn-outline {
  background: transparent;
  color: var(--accent-primary);
  border: 2px solid var(--accent-primary);
}
.btn-outline:hover {
  background: var(--accent-primary);
  color: #fff;
  transform: translateY(-2px);
}

/* ---------- 7. Section ---------- */
.section {
  padding: var(--section-pad);
}
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-header h2 {
  margin-bottom: 0.5rem;
}
.section-header p {
  margin: 0 auto;
  font-size: var(--fs-md);
}
.section-label {
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}

/* ---------- 8. Highlights / Stat Cards ---------- */
.highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-align: center;
  transition: all var(--transition);
}
[data-theme="dark"] .stat-card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(26,26,36,.6);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.stat-card .stat-value {
  font-family: var(--font-heading);
  font-size: var(--fs-2xl);
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-card .stat-label {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ---------- 9. Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
.skill-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.skill-info {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-sm);
  font-weight: 500;
}
.skill-info span:last-child {
  color: var(--accent-primary);
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
}
.skill-bar {
  height: 8px;
  background: var(--tag-bg);
  border-radius: 4px;
  overflow: hidden;
}
.skill-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 4px;
  width: 0;
  transition: width 1s ease;
}

/* ---------- 10. About Page ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}
.about-photo-wrap {
  text-align: center;
}
.about-photo {
  width: 260px;
  height: 260px;
  border-radius: var(--radius);
  object-fit: cover;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}
.about-text h2 { margin-bottom: 1rem; }
.about-text p { margin-bottom: 1rem; font-size: var(--fs-md); }
.about-terminal {
  background: #1e1e2e;
  color: #a6e3a1;
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  margin-top: 1.5rem;
  line-height: 1.8;
}
.about-terminal .prompt { color: #89b4fa; }
.about-terminal .comment { color: #6c7086; }

/* Cards grid for education / awards / research / teaching */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: all var(--transition);
}
[data-theme="dark"] .card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(26,26,36,.6);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.card h4 { margin-bottom: 0.5rem; }
.card .card-meta {
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  color: var(--accent-primary);
  margin-bottom: 0.75rem;
}
.card p { font-size: var(--fs-sm); }
.card a.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--accent-primary);
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-top: 0.75rem;
  transition: gap var(--transition);
}
.card a.card-link:hover { gap: 0.5rem; }

/* ---------- 11. Experience Timeline (horizontal zigzag) ---------- */
.timeline-wrap {
  position: relative;
}

/* Scroll hint arrows */
.timeline-hint {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: var(--accent-primary);
  transition: all var(--transition);
}
.timeline-hint:hover {
  background: var(--accent-primary);
  color: #fff;
}
.timeline-hint svg { width: 20px; height: 20px; }
.timeline-hint-left { left: 0.5rem; }
.timeline-hint-right { right: 0.5rem; }
.timeline-hint.hidden { opacity: 0; pointer-events: none; }

/* Fade edges to hint at more content */
.timeline-wrap::before,
.timeline-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 60px;
  z-index: 5;
  pointer-events: none;
}
.timeline-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-primary), transparent);
}
.timeline-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-primary), transparent);
}

.timeline {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary) transparent;
}
.timeline::-webkit-scrollbar { height: 6px; }
.timeline::-webkit-scrollbar-track { background: transparent; }
.timeline::-webkit-scrollbar-thumb { background: var(--accent-primary); border-radius: 3px; }

.timeline-track {
  display: grid;
  grid-template-columns: repeat(8, 280px);
  grid-template-rows: 1fr 2px 1fr;
  align-items: end;
  min-width: max-content;
  padding: 1.5rem 4rem;
  position: relative;
  max-height: calc(100vh - 200px);
}

/* Horizontal line (middle row) */
.timeline-track::before {
  content: '';
  grid-column: 1 / -1;
  grid-row: 2;
  height: 2px;
  background: var(--timeline-line);
}

.timeline-item {
  position: relative;
  padding: 0 0.75rem;
}

/* Odd items: row 1 (above line) */
.timeline-item:nth-child(odd) {
  grid-row: 1;
  align-self: end;
  padding-bottom: 1.25rem;
}
/* Even items: row 3 (below line) */
.timeline-item:nth-child(even) {
  grid-row: 3;
  align-self: start;
  padding-top: 1.25rem;
}

/* Dots centered on the line */
.timeline-dot {
  position: absolute;
  left: 50%;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 3px var(--accent-primary);
  transform: translateX(-50%);
  z-index: 2;
}
.timeline-item:nth-child(odd) .timeline-dot { bottom: -8px; }
.timeline-item:nth-child(even) .timeline-dot { top: -8px; }

/* Stem connector */
.timeline-item::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 2px;
  height: 12px;
  background: var(--timeline-line);
  transform: translateX(-50%);
}
.timeline-item:nth-child(odd)::after { bottom: 0; }
.timeline-item:nth-child(even)::after { top: 0; }

.timeline-date {
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}
.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: all var(--transition);
  cursor: pointer;
}
[data-theme="dark"] .timeline-card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(26,26,36,.6);
}
.timeline-card:hover {
  box-shadow: var(--shadow-lg);
}
.timeline-card h3 { font-size: var(--fs-sm); margin-bottom: 0.15rem; }
.timeline-card .company {
  font-size: var(--fs-xs);
  color: var(--accent-primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
/* One-line summary always visible */
.timeline-card .card-summary {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Hide full details by default */
.timeline-card .card-details {
  display: none;
  margin-top: 0.5rem;
}
.timeline-card.expanded .card-details {
  display: block;
}
.timeline-card.expanded .card-summary {
  display: none;
}
/* Expanded cards grow wider */
.timeline-card.expanded {
  position: relative;
  z-index: 10;
  width: 420px;
  margin-left: -70px;
  box-shadow: var(--shadow-lg);
}
.timeline-card p {
  font-size: var(--fs-xs);
  margin-bottom: 0.4rem;
}
.timeline-card ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
}
.timeline-card ul li {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
  line-height: 1.4;
}
/* Expand hint */
.timeline-card .expand-hint {
  font-size: var(--fs-xs);
  color: var(--accent-primary);
  font-family: var(--font-heading);
  margin-top: 0.25rem;
}
.timeline-card.expanded .expand-hint { display: none; }
/* Education cards — subtle accent border */
.timeline-card.edu-card {
  border-left: 3px solid var(--accent-secondary);
  cursor: default;
}
.timeline-card.edu-card .company { color: var(--accent-secondary); }
.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.timeline-tags .tag {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
}
.tag {
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  background: var(--tag-bg);
  color: var(--tag-color);
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
}

/* ---------- 12. Resume Page ---------- */
.resume-toolbar {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--print-bar-bg);
  border-bottom: 1px solid var(--bg-card-border);
  margin-top: 64px;
}
.resume-page {
  background: #fff;
  color: #1a1a2e;
  max-width: 850px;
  margin: 2rem auto;
  padding: 3rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-height: 1100px;
}
.resume-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #6366f1;
}
.resume-header h1 {
  font-size: var(--fs-2xl);
  color: #1a1a2e;
  margin-bottom: 0.5rem;
}
.resume-header .resume-contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  font-size: var(--fs-sm);
  color: #4a4a5a;
}
.resume-header .resume-contact a { color: #6366f1; }
.resume-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
.resume-section h2 {
  font-size: var(--fs-lg);
  color: #6366f1;
  border-bottom: 1px solid #e0e0e8;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}
.resume-entry { margin-bottom: 1.25rem; }
.resume-entry h3 {
  font-size: var(--fs-base);
  color: #1a1a2e;
  margin-bottom: 0.15rem;
}
.resume-entry .resume-meta {
  font-size: var(--fs-sm);
  color: #4a4a5a;
  margin-bottom: 0.5rem;
}
.resume-entry ul {
  list-style: disc;
  padding-left: 1.25rem;
}
.resume-entry ul li {
  font-size: var(--fs-sm);
  color: #4a4a5a;
  margin-bottom: 0.25rem;
}
.resume-skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.resume-skills-list .tag {
  background: #f0f0f5;
  color: #4a4a5a;
}

/* ---------- 13. Contact Page ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  transition: all var(--transition);
}
[data-theme="dark"] .contact-card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(26,26,36,.6);
}
.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.contact-icon {
  width: 48px; height: 48px;
  flex-shrink: 0;
  background: var(--tag-bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}
.contact-icon svg { width: 24px; height: 24px; }
.contact-info h4 {
  font-size: var(--fs-base);
  margin-bottom: 0.25rem;
}
.contact-info a {
  font-size: var(--fs-sm);
  color: var(--accent-primary);
  word-break: break-all;
  transition: color var(--transition);
}
.contact-info a:hover { color: var(--accent-secondary); }

/* ---------- 14. Footer ---------- */
.footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--bg-card-border);
  padding: 2rem 1.25rem;
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  transition: background var(--transition);
}

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

/* ---------- 16. Accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .skill-bar-fill { transition: none; }
}

/* ---------- 17. Responsive ---------- */

/* SM 640px+ */
@media (min-width: 640px) {
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .resume-body { grid-template-columns: 65% 35%; }
}

/* MD 768px+ */
@media (min-width: 768px) {
  h1 { font-size: var(--fs-4xl); }
  .hero h1 { font-size: var(--fs-4xl); }
  .about-grid { grid-template-columns: 280px 1fr; }

  /* Desktop nav */
  .nav-hamburger { display: none !important; }
  .nav-links { display: flex !important; }

}

/* Mobile nav (below 768px) */
@media (max-width: 767px) {
  .nav-links { display: none !important; }
  .nav-hamburger { display: flex !important; }
  /* Mobile: vertical stacked timeline */
  .timeline-wrap::before,
  .timeline-wrap::after { display: none; }
  .timeline-hint { display: none; }
  .timeline { overflow-x: visible; }
  .timeline-track {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    grid-template-rows: none;
    padding: 1rem 0 1rem 2.5rem;
    min-width: auto;
    position: relative;
  }
  .timeline-track::before {
    grid-column: auto; grid-row: auto;
    position: absolute;
    top: 0; bottom: 0;
    left: 20px; right: auto;
    width: 2px; height: auto;
  }
  .timeline-item {
    padding: 0 0 2rem 1.5rem !important;
  }
  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    grid-row: auto;
    align-self: auto;
    padding-top: 0;
    padding-bottom: 2rem;
  }
  .timeline-dot {
    left: -1.5rem !important;
    top: 4px !important;
    bottom: auto !important;
    transform: translateX(-50%);
  }
  .timeline-item::after { display: none; }
  .resume-page { margin: 1rem; padding: 1.5rem; }
}

/* LG 1024px+ */
@media (min-width: 1024px) {
  :root { --section-pad: 6rem 2rem; }
}

/* XL 1280px+ */
@media (min-width: 1280px) {
  :root {
    --container-max: 1100px;
    --fs-3xl: 2.8rem;
    --fs-4xl: 3.5rem;
  }
}

/* ---------- 18. Print ---------- */
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff !important; color: #000 !important; padding: 1.5cm !important; }
  .navbar, .footer, .resume-toolbar, .theme-toggle { display: none !important; }
  .resume-page {
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    min-height: auto !important;
  }
  .resume-body { grid-template-columns: 65% 35% !important; }
  .resume-header { border-bottom-color: #000 !important; }
  .resume-header h1 { color: #000 !important; }
  .resume-section h2 { color: #333 !important; border-bottom-color: #ccc !important; }
  .resume-entry h3 { color: #000 !important; }
  .resume-entry .resume-meta, .resume-entry li { color: #333 !important; }
  .resume-header .resume-contact a { color: #333 !important; }
  .tag { background: #eee !important; color: #333 !important; }
  .resume-entry { break-inside: avoid; }
}
