*, *::before, *::after {
  box-sizing: border-box;
}

html * {
  line-height: 1.5em;
}

body {
  margin: 2.5rem;
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  color: #111827;
}

/* ── Typography ── */

.name {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #111827;
  line-height: 1.1;
}

.tagline {
  font-size: 1rem;
  color: #6b7280;
  margin-top: 0.3rem;
}

.tagline a {
  color: #2563eb;
  text-decoration: none;
}

.bio {
  font-size: 1rem;
  color: #374151;
  margin-top: 0.6rem;
  line-height: 1.65;
  max-width: 680px;
}

/* ── Header ── */

.resume-header {
  border-bottom: 2.5px solid #2563eb;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

/* ── Section ── */

.section {
  margin-top: 1.75rem;
}

.section > header {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #2563eb;
  margin-bottom: 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #e5e7eb;
}

.section > ul {
  margin-bottom: 0;
}

.section > .subsection {
  margin-top: 0.9rem;
}

.subsection ul {
  margin-top: 0.25rem;
  margin-bottom: 0;
}

/* ── Subsection (job / edu entries) ── */

.subsection > header {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

.subsection > header a {
  color: #111827;
  text-decoration: none;
}

.dates {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-top: 0.1rem;
}

.job-sub {
  font-size: 0.8rem;
  color: #6b7280;
  font-style: italic;
  margin-top: 0.05rem;
}

.subsection > .description {
  margin-top: 0.5rem;
}

ul {
  padding-inline-start: 1.25rem;
}

ul li {
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.5;
  margin-bottom: 0.1rem;
}

/* ── Contacts ── */

.contacts {
  margin: 0;
  list-style: none;
  padding-inline-start: 0;
}

.contacts li {
  font-size: 0.9rem;
  color: #374151;
  margin-bottom: 0.45rem;
}

/* ── Skill tags ── */

.skill-group {
  margin-bottom: 0.75rem;
}

.skill-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #9ca3af;
  margin-bottom: 0.35rem;
}

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

.tag {
  font-size: 0.8rem;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  font-weight: 500;
}

.tag-blue {
  background: #eff6ff;
  color: #2563eb;
}

.tag-gray {
  background: #f3f4f6;
  color: #374151;
}

/* ── Certifications ── */

.cert-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cert-item {
  font-size: 0.9rem;
  color: #374151;
  padding: 0.3rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.cert-item:last-child {
  border-bottom: none;
}

/* ── Achievements ── */

.achievement-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #374151;
  padding: 0.3rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.achievement-item:last-child {
  border-bottom: none;
}

.achievement-year {
  color: #9ca3af;
  font-size: 0.82rem;
  white-space: nowrap;
  margin-left: 0.5rem;
}

/* ── Project cards ── */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.project-card {
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 0.75rem;
  background: #fafafa;
  break-inside: avoid;
}

.project-card h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.2rem;
}

.project-meta {
  font-size: 0.82rem;
  color: #9ca3af;
  margin-bottom: 0.4rem;
}

.project-card p {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.55;
  margin: 0;
}

.metric {
  display: inline-block;
  background: #eff6ff;
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
  margin-top: 0.4rem;
  margin-right: 0.25rem;
}

/* ── Interests ── */

.interests-line {
  font-size: 0.95rem;
  color: #6b7280;
  line-height: 1.6;
}

/* ── Full-width below fold ── */

.full-width-sections {
  border-top: 1.5px solid #e5e7eb;
  margin-top: 0.25rem;
}

/* ── Layout ── */

@media print {
  html {
    font-size: 9px;
  }

  .subsection {
    break-inside: avoid;
  }

  .project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@page {
  margin: 1rem;
  margin-top: 2rem;
}

@media screen {
  html {
    font-size: 16px;
  }
}

@media screen and (min-width: 1200px) {
  body {
    width: calc(1200px - 5rem);
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

@media print, screen and (min-width: 1000px) {
  .desktop.layout {
    display: block;
  }

  .two-col {
    display: flex;
    flex-direction: row;
    gap: 3rem;
  }

  .col-left {
    flex: 2;
    min-width: 0;
  }

  .col-right {
    flex: 1;
    min-width: 200px;
  }

  .mobile.layout {
    display: none;
  }
}

@media screen and (max-width: 1000px) {
  .desktop.layout {
    display: none;
  }

  .mobile.layout {
    display: block;
  }

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

a:link,
a:visited,
a:hover,
a:active {
  color: #2563eb;
}
