/* =============================================
   RESET & ROOT VARIABLES
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --border: #e4e0d8;
  --text: #1a1916;
  --muted: #6b6760;
  --accent: #1a5c3a;
  --accent-light: #e8f5ee;
  --accent2: #c0392b;
  --tag-bg: #f0ede6;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
}

/* =============================================
   BASE STYLES
   ============================================= */
html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

/* =============================================
   NAVIGATION
   ============================================= */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 246, 242, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}

.nav-inner {
  max-width: 1100px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.15rem;
  color: var(--accent);
  letter-spacing: 0.01em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.8rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

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

/* =============================================
   HERO SECTION
   ============================================= */
.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 2rem 4rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
  animation: fadeUp 0.6s ease both;
}

.hero-text h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.12;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.hero-text h1 em {
  color: var(--accent);
  font-style: italic;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 1.5rem;
}

.hero-summary {
  font-size: 0.95rem;
  color: var(--text);
  max-width: 560px;
  line-height: 1.75;
  margin-bottom: 2rem;
}

.hero-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Contact chips */
.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  background: var(--surface);
  transition: all 0.2s;
}

.contact-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.contact-chip svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Hero profile image */
.hero-img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

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

/* =============================================
   MAIN CONTENT
   ============================================= */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
}

/* =============================================
   SECTIONS
   ============================================= */
.section {
  margin-bottom: 4rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}

.section-header h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.65rem;
  color: var(--text);
}

.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
  background: var(--accent-light);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* =============================================
   EXPERIENCE CARDS
   ============================================= */
.exp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.exp-card:hover {
  box-shadow: var(--shadow);
  border-color: #c8c4bc;
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  gap: 1rem;
}

.exp-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.exp-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  padding: 0.2rem 0.5rem;
  background: var(--tag-bg);
  border-radius: 4px;
}

.exp-role {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.1rem;
}

.exp-loc {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.exp-card ul {
  padding-left: 1.1rem;
}

.exp-card li {
  font-size: 0.875rem;
  color: #3a3834;
  line-height: 1.7;
  margin-bottom: 0.3rem;
}

.exp-card li strong {
  color: var(--text);
}

/* =============================================
   SKILLS GRID
   ============================================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.skill-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-tag {
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  background: var(--tag-bg);
  border-radius: 6px;
  color: var(--text);
  font-weight: 500;
}

/* =============================================
   PROJECTS GRID
   ============================================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.proj-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.proj-card:hover {
  box-shadow: var(--shadow);
  border-color: #c8c4bc;
}

.proj-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.3;
}

.proj-desc {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
}

.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.proj-tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 5px;
  font-weight: 600;
}

/* =============================================
   RESEARCH CARDS
   ============================================= */
.research-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem;
  margin-bottom: 1rem;
}

.research-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 0.5rem;
}

.research-desc {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.65;
}

.research-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.research-link:hover {
  text-decoration: underline;
}

/* =============================================
   EDUCATION GRID
   ============================================= */
.edu-grid {
  display: grid;
  gap: 1rem;
}

.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.edu-info .edu-degree {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.edu-info .edu-school {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.edu-info .edu-loc {
  font-size: 0.8rem;
  color: var(--muted);
}

.edu-right {
  text-align: right;
  flex-shrink: 0;
}

.edu-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--tag-bg);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.edu-gpa {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.4rem;
}

/* =============================================
   ACHIEVEMENTS
   ============================================= */
.ach-columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.ach-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.ach-group-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 1rem;
}

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

.ach-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ach-list li {
  font-size: 0.82rem;
  color: #3a3834;
  line-height: 1.5;
  padding-left: 0.9rem;
  position: relative;
}

.ach-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* Achievement badges */
.ach-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.3rem;
  vertical-align: middle;
}

.ach-badge.first   { background: #fff3cd; color: #856404; }
.ach-badge.second  { background: #e2e3e5; color: #41464b; }
.ach-badge.third   { background: #fde8d8; color: #7d3a1a; }
.ach-badge.champion { background: #d4edda; color: #155724; }
.ach-badge.runner  { background: #d1ecf1; color: #0c5460; }

/* =============================================
   FOOTER
   ============================================= */
footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

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

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =============================================
   HAMBURGER BUTTON
   ============================================= */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.2s;
}

.nav-toggle:hover {
  background: var(--accent-light);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =============================================
   RESPONSIVE - TABLET (max 900px)
   ============================================= */
@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr 1fr;
  }

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

/* =============================================
   RESPONSIVE - MOBILE (max 700px)
   ============================================= */
@media (max-width: 700px) {

  /* Navigation */
  nav {
    padding: 0 1.25rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(247, 246, 242, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    z-index: 200;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    color: var(--text);
  }

  .nav-links a:hover {
    background: var(--accent-light);
    color: var(--accent);
  }

  /* Hero */
  .hero {
    grid-template-columns: 1fr;
    padding: 3rem 1.25rem 2.5rem;
    gap: 1.5rem;
    text-align: center;
  }

  .hero-img {
    width: 140px;
    height: 140px;
    justify-self: center;
    order: -1;
  }

  .hero-summary {
    max-width: 100%;
  }

  .hero-contacts {
    justify-content: center;
  }

  /* Main */
  main {
    padding: 0 1.25rem 3rem;
  }

  /* Section headers */
  .section-header h2 {
    font-size: 1.4rem;
  }

  /* Experience cards — stack date below title */
  .exp-header {
    flex-direction: column;
    gap: 0.4rem;
  }

  .exp-date {
    align-self: flex-start;
  }

  /* Skills — 2 columns */
  .skills-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Projects — 1 column */
  .projects-grid {
    grid-template-columns: 1fr;
  }

  /* Education — stack vertically */
  .edu-card {
    flex-direction: column;
    gap: 0.5rem;
  }

  .edu-right {
    text-align: left;
  }

  /* Achievements — 1 column */
  .ach-columns {
    grid-template-columns: 1fr;
  }

  /* Contact chips */
  .contact-chip {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
  }
}