/*  Colors and stuff  */
:root {
  --bg: #f5f7fa;
  --paper: #fffff2;
  --text: #0f172a;
  --muted: #475569;
  --accent: #0c7489;
  --accent-ink: #1f2937;
  --shadow: 0 10px 30px rgba(0, 0, 0, .08);
  --gap: 28px;
  --doc-print-scale: 0.7;
  --doc-print-source-width: 1120px;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: clamp(14px, 0.45vw + 12px, 17px);
}

h1,
h2,
h3 {
  margin: 0 0 8px 0;
  line-height: 1.25;
}

/*  Layout  */
.resume {
  display: grid;
  grid-template-columns: 1fr;
  margin: 32px auto;
  background: var(--paper);
  box-shadow: var(--shadow);
  border-radius: 14px;
  overflow: hidden;
  width: min(100% - 32px, 1180px);
}

.sidebar {
  background: var(--accent);
  color: #fff;
  padding: 28px;
}

.content {
  padding: 40px;
}

@media (min-width: 900px) {
  .resume {
    grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  }

  .sidebar {
    padding: 32px;
  }

  .content {
    padding: 44px;
  }
}

/*  Sidebar  */
.sidebar_title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 6px 0 12px 0;
}

.block + .block {
  margin-top: 24px;
}

.skill_groups {
  display: grid;
  gap: 12px;
}

.skill_group,
.sidebar_panel {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
}

address.sidebar_panel {
  font-style: normal;
}

.skill_group_title {
  margin-bottom: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
}

.skill_tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Pill: shared by skill tags, language level tags, and contact value chips */
.skill_tags span,
.level_tag,
.sidebar_row_value {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #1f2937;
  background: rgba(255, 255, 255, 0.72);
}

.skill_tags span {
  display: inline-block;
  white-space: nowrap;
}

.sidebar_row_value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar_row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 6px 0;
}

.sidebar_row + .sidebar_row {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.sidebar_row_label {
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.1;
  color: rgba(255, 255, 255, 0.9);
}

.contact_row {
  color: inherit;
  text-decoration: none;

  display: grid;
  grid-template-columns: 16px auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;

  min-height: 28px;
}

.contact_row .sidebar_row_label {
  line-height: 1;
}

.contact_row .sidebar_row_value {
  justify-self: end;
}
.contact_row:hover .sidebar_row_value {
  text-decoration: underline;
}

.contact_icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 16px;
  height: 16px;

  font-size: 0.95rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
}

.contact_icon::before {
  line-height: 1;
}

.skills_list,
.certs_list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.skills_list li {
  margin: 4px 0;
  color: #fff;
}

.certs_list li {
  margin: 4px 0;
}

/*  Main content  */
.name {
  font-size: clamp(32px, 2.5vw + 12px, 48px);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.role {
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin: 0 0 6px 0;
}

.summary {
  margin: 0 0 14px 0;
  color: var(--muted);
}

.section {
  margin-top: 28px;
}

.section:first-of-type {
  margin-top: 0;
}

.section_title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.item + .item {
  margin-top: 16px;
}

.item_header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
}

.item_title {
  font-size: 1.05rem;
  font-weight: 700;
}

.meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.divider {
  margin: 0 8px;
  color: var(--muted);
}

.bullets {
  margin: 8px 0 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.item_summary,
.edu_line {
  color: var(--muted);
  margin: 6px 0 0 0;
}

/*  Links  */
a {
  color: var(--accent);
}

.projects_link,
.cert_link {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 2px;
  word-break: break-all;
}

.projects_link:hover,
.cert_link:hover {
  text-decoration: underline;
}

/*  Helpers  */
.avoid-break {
  break-inside: avoid;
  page-break-inside: avoid;
}

/*  Print  */
@page {
  size: A4;
  margin: 0;
}

@media print {
  html,
  body {
    width: 210mm;
    height: 297mm;
    margin: 0;
    overflow: hidden;
    background: #fff;
  }

  body {
    font-size: 17px;
  }

  .name {
    font-size: 48px;
  }

  .resume {
    width: var(--doc-print-source-width);
    max-width: none;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
    grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
    zoom: var(--doc-print-scale);
  }

  .sidebar {
    padding: 32px;
  }

  .content {
    padding: 44px;
  }

  .sidebar,
  .skill_group,
  .sidebar_panel,
  .skill_tags span,
  .level_tag,
  .sidebar_row_value {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .item,
  .section,
  .block {
    break-inside: avoid;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}

.resume.print_measure {
  position: absolute;
  left: -100000px;
  top: 0;
  width: var(--doc-print-source-width);
  max-width: none;
  margin: 0;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  font-size: 17px;
  line-height: 1.6;
  visibility: hidden;
  pointer-events: none;
}

.resume.print_measure .sidebar {
  padding: 32px;
}

.resume.print_measure .content {
  padding: 44px;
}

.resume.print_measure .name {
  font-size: 48px;
}
