:root {
  --techblue: #003366;
  --techblue-light: #004d99;
  --text: #1a1a1a;
  --text-muted: #444;
  --bg: #f5f7fa;
  --paper: #ffffff;
  --rule: #ccd6e0;
  --link: #003366;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 10pt;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.cv {
  max-width: 210mm;
  margin: 1.5rem auto;
  padding: 0.5in;
  background: var(--paper);
  box-shadow: 0 2px 24px rgba(0, 51, 102, 0.08);
}

/* Header */
.cv-header {
  text-align: center;
  margin-bottom: 0.75rem;
}

.cv-header h1 {
  margin: 0 0 0.25rem;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  text-transform: uppercase;
}

.cv-contact {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.cv-contact .sep {
  color: var(--rule);
}

.cv-contact a {
  color: var(--link);
}

/* Summary */
.cv-summary {
  margin-bottom: 0.5rem;
}

.cv-summary p {
  margin: 0;
  text-align: justify;
}

/* Sections */
section {
  margin-top: 0.6rem;
}

section h2 {
  margin: 0 0 0.35rem;
  padding-bottom: 0.2rem;
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--techblue);
  border-bottom: 1.5px solid var(--techblue);
  letter-spacing: 0.04em;
}

section > p {
  margin: 0;
}

section > ul {
  margin: 0;
  padding-left: 1.5em;
}

section > ul > li {
  margin-bottom: 0.15rem;
}

/* Skills description list */
.skills {
  margin: 0;
}

.skills > div {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.25rem 1rem;
  margin-bottom: 0.15rem;
}

.skills dt {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.skills dd {
  margin: 0;
  font-size: 0.9rem;
}

/* Roles */
.role {
  margin-bottom: 0.5rem;
}

.role:last-child {
  margin-bottom: 0;
}

.role-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.role-header strong {
  display: block;
}

.role-title {
  display: block;
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.role-meta {
  text-align: right;
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.role-dates {
  display: block;
  font-style: italic;
}

.role ul {
  margin: 0.15rem 0 0;
  padding-left: 1.5em;
}

.role li {
  margin-bottom: 0.1rem;
}

/* Projects */
.projects {
  list-style: disc;
  padding-left: 1.5em;
}

.projects > li {
  margin-bottom: 0.35rem;
}

.projects > li:last-child {
  margin-bottom: 0;
}

.project-tech {
  font-style: italic;
  color: var(--text-muted);
  font-weight: 400;
}

.projects p {
  margin: 0.1rem 0 0;
}

/* Responsive */
@media (max-width: 640px) {
  .cv {
    margin: 0;
    padding: 1.25rem;
    box-shadow: none;
  }

  .cv-header h1 {
    font-size: 1.5rem;
  }

  .role-header {
    flex-direction: column;
  }

  .role-meta {
    text-align: left;
  }

  .skills > div {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .skills dt {
    margin-top: 0.25rem;
  }
}

/* Print — A4 layout matching LaTeX PDF */
@media print {
  body {
    background: white;
  }

  .cv {
    max-width: none;
    margin: 0;
    padding: 0.5in;
    box-shadow: none;
  }

  a {
    color: var(--techblue);
    text-decoration: none;
  }

  a[href^="http"]::after,
  a[href^="mailto"]::after {
    content: none;
  }

  section {
    break-inside: avoid;
  }

  .role {
    break-inside: avoid;
  }
}
