:root {
  --blue:      #2563A8;
  --blue-pale: #EAF2FB;
  --ink:       #17191C;
  --mid:       #4A4F55;
  --line:      #17191C;
  --rule:      #DADDE2;

  --sans: 'Inter', Arial, Helvetica, sans-serif;

  --max-width: 1000px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: #EFF2F5;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.cv-actions {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem 0;
  display: flex;
  justify-content: flex-end;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.85rem 1.75rem;
  cursor: pointer;
  border: none;
  border-radius: 2px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  transition: background 0.3s ease;
}
.btn-download:hover { background: var(--blue); }

.page {
  max-width: var(--max-width);
  margin: 1.5rem auto 3rem;
  background: #fff;
  box-shadow: 0 2px 24px rgba(23,25,28,0.08);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  position: relative;
  overflow: hidden;
}

.page > * { position: relative; z-index: 1; }

/* ── HEADER ──────────────────────────────────────────────── */
header.cv-header {
  margin-bottom: 1.25rem;
  position: relative;
}
header.cv-header::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: -2.5rem;
  right: -2.5rem;
  width: min(48%, 410px);
  height: 180px;
  opacity: 0.58;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='98' height='85' viewBox='0 0 98 85'%3E%3Cg fill='none' stroke='%23cfd4d9' stroke-width='1.35'%3E%3Cpath d='M24.5 1 48 14.5v27L24.5 55 1 41.5v-27zM73.5 29 97 42.5v27L73.5 83 50 69.5v-27zM73.5-27 97-13.5v27L73.5 27 50 13.5v-27z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 98px 85px;
  pointer-events: none;
}
.cv-name {
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cv-role {
  font-size: 1rem;
  font-weight: 600;
  color: var(--blue);
  margin-top: 0.2rem;
  margin-bottom: 0.6rem;
}
.cv-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.15rem 2rem;
  font-size: 0.82rem;
  color: var(--mid);
}
.cv-contact-grid > span { display: inline-flex; align-items: center; gap: 0.45rem; min-width: 0; }
.cv-contact-grid .ico {
  flex: 0 0 0.9rem;
  width: 0.9rem;
  height: 0.9rem;
  background: var(--blue);
  display: inline-block;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}
.cv-contact-grid .ico-mail {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 5h18v14H3V5Zm2 2v.5l7 4.5 7-4.5V7l-7 4.5L5 7Zm14 10V9.9l-7 4.5-7-4.5V17h14Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 5h18v14H3V5Zm2 2v.5l7 4.5 7-4.5V7l-7 4.5L5 7Zm14 10V9.9l-7 4.5-7-4.5V17h14Z'/%3E%3C/svg%3E");
}
.cv-contact-grid .ico-web {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm6.9 9h-3.1a15.8 15.8 0 0 0-1.2-5 8.1 8.1 0 0 1 4.3 5ZM12 4c.9 1.3 1.6 3.5 1.8 7h-3.6c.2-3.5.9-5.7 1.8-7ZM9.4 6a15.8 15.8 0 0 0-1.2 5H5.1a8.1 8.1 0 0 1 4.3-5ZM5.1 13h3.1a15.8 15.8 0 0 0 1.2 5 8.1 8.1 0 0 1-4.3-5Zm6.9 7c-.9-1.3-1.6-3.5-1.8-7h3.6c-.2 3.5-.9 5.7-1.8 7Zm2.6-2a15.8 15.8 0 0 0 1.2-5h3.1a8.1 8.1 0 0 1-4.3 5Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm6.9 9h-3.1a15.8 15.8 0 0 0-1.2-5 8.1 8.1 0 0 1 4.3 5ZM12 4c.9 1.3 1.6 3.5 1.8 7h-3.6c.2-3.5.9-5.7 1.8-7ZM9.4 6a15.8 15.8 0 0 0-1.2 5H5.1a8.1 8.1 0 0 1 4.3-5ZM5.1 13h3.1a15.8 15.8 0 0 0 1.2 5 8.1 8.1 0 0 1-4.3-5Zm6.9 7c-.9-1.3-1.6-3.5-1.8-7h3.6c-.2 3.5-.9 5.7-1.8 7Zm2.6-2a15.8 15.8 0 0 0 1.2-5h3.1a8.1 8.1 0 0 1-4.3 5Z'/%3E%3C/svg%3E");
}
.cv-contact-grid .ico-location { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); width: 0.68rem; height: 0.68rem; margin-left: 0.08rem; margin-right: 0.14rem; }
.cv-contact-grid .ico-gdc { border-radius: 50%; }
.cv-contact-grid a { color: var(--mid); text-decoration: none; }
.cv-contact-grid a:hover { color: var(--blue); }
.cv-contact-grid a:focus-visible, .btn-download:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ── LAYOUT ──────────────────────────────────────────────── */
.cv-body {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 2rem;
}
.col-main, .col-side { min-width: 0; }

/* ── SECTION HEADINGS ────────────────────────────────────── */
.main-block, .side-block { margin-bottom: 1.1rem; }
.main-block h2, .side-block h2 {
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink);
  padding-bottom: 0.3rem;
  margin-bottom: 0.55rem;
  border-bottom: 3px solid var(--line);
}

.cv-summary { font-size: 0.85rem; color: var(--mid); line-height: 1.6; }

/* ── EXPERIENCE ──────────────────────────────────────────── */
.cv-job { margin-bottom: 0.85rem; break-inside: avoid; }
.cv-job:last-child { margin-bottom: 0; }
.cv-job-compact { margin-bottom: 0.6rem; }
.cv-job-title { font-weight: 700; font-size: 0.92rem; color: var(--ink); }
.cv-job-org { color: var(--blue); font-weight: 600; font-size: 0.88rem; }
.cv-job-meta {
  display: flex;
  gap: 0.9rem;
  font-size: 0.75rem;
  color: var(--mid);
  margin: 0.1rem 0 0.35rem;
}
.cv-job-meta span { display: inline-flex; align-items: center; gap: 0.3rem; }
.cv-job-meta .ico { color: var(--blue); font-size: 0.7rem; }

.cv-list { list-style: none; }
.cv-list li {
  position: relative;
  padding-left: 0.9rem;
  margin-bottom: 0.2rem;
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.45;
}
.cv-list li::before { content: '\2022'; position: absolute; left: 0; color: var(--mid); }

.cv-job-note { font-size: 0.82rem; color: var(--mid); line-height: 1.5; }

.cv-subsection-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
  margin: 0.7rem 0 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--rule);
}

/* ── EDUCATION ───────────────────────────────────────────── */
.cv-education strong { display: block; font-weight: 700; font-size: 0.9rem; color: var(--ink); }
.cv-education span { display: block; color: var(--mid); font-size: 0.78rem; margin-top: 0.1rem; }

/* ── SIDEBAR: KEY HIGHLIGHTS ─────────────────────────────── */
.highlight-item { display: flex; gap: 0.7rem; margin-bottom: 0.75rem; padding-bottom: 0.7rem; border-bottom: 1px dashed var(--rule); }
.highlight-item:last-child { margin-bottom: 0; }
.highlight-ico {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 0;
  background: transparent;
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
}
.highlight-text strong { display: block; font-size: 0.84rem; font-weight: 700; color: var(--ink); margin-bottom: 0.1rem; }
.highlight-text { min-width: 0; }
.highlight-text span { font-size: 0.78rem; color: var(--mid); line-height: 1.45; overflow-wrap: anywhere; }

/* ── SIDEBAR: SKILLS GRID ────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.1rem 1rem;
}
.skills-grid span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  padding: 0.35rem 0;
  border-bottom: 1px dotted var(--rule);
}

.side-list { list-style: none; }
.side-list li {
  font-size: 0.8rem;
  color: var(--mid);
  margin-bottom: 0.35rem;
  padding-left: 0.8rem;
  position: relative;
}
.side-list li::before { content: "\2013"; position: absolute; left: 0; color: var(--blue); }

.course-item { margin-bottom: 0.65rem; }
.course-item:last-child { margin-bottom: 0; }
.course-item strong { display: block; color: var(--blue); font-size: 0.82rem; font-weight: 700; margin-bottom: 0.1rem; }
.course-item span { display: block; font-size: 0.76rem; color: var(--mid); line-height: 1.45; }

footer.cv-footer {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
  font-size: 0.72rem;
  color: var(--mid);
}

.cv-contact-grid a { word-break: break-word; }

@media (max-width: 900px) {
  .cv-body { grid-template-columns: 1fr; }
  .cv-contact-grid { grid-template-columns: 1fr; }
  header.cv-header::after { width: 42%; opacity: 0.35; }
}

@media (max-width: 480px) {
  html, body { font-size: 14px; }
  .cv-actions { justify-content: center; padding-top: 1rem; }
  .btn-download { width: 100%; justify-content: center; padding: 0.9rem 1rem; }
  .page { padding: 1.25rem; }
  .cv-name { font-size: clamp(1.6rem, 9vw, 2rem); }
  .cv-role { font-size: 0.92rem; padding-right: 0.5rem; }
  .cv-job-meta { flex-wrap: wrap; row-gap: 0.15rem; }
  .highlight-item { gap: 0.55rem; }
  header.cv-header::after { display: none; }
}

/* ── PRINT: fit one A4 page ───────────────────────────────── */
@page { size: A4; margin: 0; }

@media print {
  html, body { background: white; font-size: 11px; line-height: 1.45; }
  .cv-actions { display: none; }
  .page {
    box-shadow: none;
    margin: 0;
    max-width: 100%;
    padding: 4mm 7mm;
    overflow: visible;
  }
  .cv-body {
    display: grid !important;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) !important;
    gap: 2rem !important;
  }
  .cv-contact-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
  }
  footer.cv-footer { margin-top: 0.7rem; padding-top: 0.45rem; }
  .main-block, .side-block { margin-bottom: 0.65rem; }
  .main-block h2, .side-block h2 { margin-bottom: 0.4rem; }
  .cv-summary { line-height: 1.45; }
  .cv-job { margin-bottom: 0.55rem; }
  .cv-job-compact { margin-bottom: 0.4rem; }
  .cv-list li { margin-bottom: 0.1rem; line-height: 1.35; }
  .cv-subsection-label { margin: 0.45rem 0 0.35rem; padding-top: 0.35rem; }
  .highlight-item { margin-bottom: 0.4rem; padding-bottom: 0.4rem; }
  .course-item { margin-bottom: 0.4rem; }
  .side-list li { margin-bottom: 0.2rem; }
  .page, .highlight-ico { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cv-job, .side-block, .main-block, .course-item, .highlight-item { break-inside: avoid; }
  .highlight-ico { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
