/* ─── Variables ─────────────────────────────────── */
:root {
  --ink:        #1a1a2e;
  --ink-soft:   #4a4a6a;
  --muted:      #8888aa;
  --accent:     #c0392b;
  --accent2:    #1a6b8a;
  --sidebar-bg: #f4f3f0;
  --border:     #dddbd5;
  --page-w:     210mm;
  --page-h:     297mm;
  --col-l:      80mm;
  --pad:        5mm;
}

/* ─── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

/* ─── Body / Font ────────────────────────────────── */
body {
  font-family: 'Noto Sans Georgian', 'Segoe UI', sans-serif;
  font-size: 9.5pt;
  color: var(--ink);
  background: #e8e6e0;
  line-height: 1.45;
}
body.geo {
  font-family: 'Noto Sans Georgian', sans-serif;
  font-size: 9.5pt;
}

/* ─── Control Bar ────────────────────────────────── */
.control-bar {
  position: fixed;
  top: 16px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 100;
}
.lang-toggle {
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 4px;
  gap: 2px;
}
.lang-btn {
  background: none;
  border: none;
  padding: 4px 9px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 4px;
  transition: all 0.2s;
  letter-spacing: 0.03em;
}
.lang-btn.active { background: var(--ink); color: white; }
.lang-divider { color: var(--border); font-size: 0.8rem; }
.print-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: white;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: opacity 0.2s;
}
.print-btn:hover { opacity: 0.85; }

/* ─── CV Wrapper ─────────────────────────────────── */
.cv-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 40px;
  gap: 16px;
}

/* ─── Page ───────────────────────────────────────── */
.page {
  width: var(--page-w);
  height: var(--page-h);
  background: white;
  display: grid;
  grid-template-columns: var(--col-l) 1fr;
  gap: 0;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

/* ─── Sidebar ────────────────────────────────────── */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: var(--pad) calc(var(--pad) + 1mm);
  display: flex;
  flex-direction: column;
  gap: 3.5mm;
  overflow: hidden;
}

/* ─── Name Block ─────────────────────────────────── */
.name-block {
  padding-bottom: 3mm;
  border-bottom: 2px solid var(--accent);
}
.name-block h1 {
  font-size: 15pt;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
body.geo .name-block h1 { font-size: 13pt; }
.occupation {
  margin-top: 2px;
  font-size: 8.5pt;
  color: var(--muted);
  font-style: italic;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.3;
}
body.geo .occupation {
  font-style: normal;
  font-size: 8pt;
  text-transform: none;
}

/* ─── Section Titles ─────────────────────────────── */
.section { overflow: hidden; }
.section-title {
  font-family: 'Noto Sans Georgian', sans-serif;
  font-size: 7pt;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  margin-bottom: 2.5mm;
}
body.geo .section-title {
  font-family: 'Noto Sans Georgian', sans-serif;
  font-size: 7pt;
  letter-spacing: 0.04em;
}

/* ─── Contact ────────────────────────────────────── */
.contact-list { display: flex; flex-direction: column; gap: 2px; }
.contact-list li {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 9.5pt;
  color: var(--ink-soft);
  line-height: 1.35;
}
.contact-icon { color: var(--accent); font-size: 7pt; flex-shrink: 0; }
.contact-list a { color: var(--accent2); }

/* ─── Languages ──────────────────────────────────── */
.lang-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.lang-name { font-size: 10pt; color: var(--ink); }
.lang-badge {
  font-family: 'DM Mono', monospace;
  font-size: 7pt;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 20px;
  color: white;
}
.proficiency-c1, .proficiency-c2 { background: #2e7d52; }
.proficiency-b1, .proficiency-b2 { background: #a87019; }
.proficiency-a1, .proficiency-a2 { background: #8b4513; }

/* ─── Soft Skills ────────────────────────────────── */
.soft-skill {
  font-size: 9.5pt;
  color: var(--ink-soft);
  padding: 2px 0;
  border-bottom: 1px dotted var(--border);
  line-height: 1.3;
}
.soft-skill:last-child { border-bottom: none; }

/* ─── Main Column ────────────────────────────────── */
.main-col {
  padding: var(--pad) calc(var(--pad) + 1mm);
  display: flex;
  flex-direction: column;
  gap: 3.5mm;
  overflow: hidden;
}

/* ─── Skills — truly inline: label + tags wrap together ── */
.skill-category {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1px 3px;
  margin-bottom: 1mm;
  line-height: 1.4;
}
.skill-cat-label {
  font-family: 'DM Mono', monospace;
  font-size: 6.5pt;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-right: 2px;
  font-weight: 600;
}
body.geo .skill-cat-label {
  font-family: 'Noto Sans Georgian', sans-serif;
  text-transform: uppercase;
}
.skill-cat-label::after { content: ' ·'; color: #bbb; margin-right: 2px; }
/* tags sit inline in the same flex row, wrapping naturally */
.skill-tags { display: contents; }
.skill-tag {
  background: #e2e6ea;
  color: #2d3748;
  font-size: 7pt;
  padding: 0px 5px;
  border-radius: 3px;
  font-family: 'DM Mono', monospace;
  line-height: 1.5;
  border: 1px solid #c8d0d8;
}

/* ─── Work ───────────────────────────────────────── */
.work-item {
  padding-bottom: 2.5mm;
  border-bottom: 1px solid var(--border);
}
.work-item:last-child { border-bottom: none; padding-bottom: 0; }
.work-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 5px;
  margin-bottom: 1px;
}
.company-name {
  font-weight: 600;
  font-size: 10.5pt;
  color: var(--ink);
}
.company-desc {
  font-style: italic;
  font-size: 9pt;
  color: var(--muted);
}
.work-location {
  font-size: 8.5pt;
  color: var(--muted);
  margin-left: auto;
}
.position-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 1px 0;
}
.pos-title {
  font-size: 10pt;
  font-weight: 600;
  color: var(--ink-soft);
}
.pos-dur {
  font-family: 'DM Mono', monospace;
  font-size: 8pt;
  color: var(--accent2);
  flex-shrink: 0;
  margin-left: 6px;
}
.resp-list { padding-left: 0; margin-top: 1px; }
.resp-list li {
  font-size: 9pt;
  color: var(--ink-soft);
  padding-left: 9px;
  position: relative;
  line-height: 1.3;
}
.resp-list li::before {
  content: '›';
  position: absolute;
  left: 1px;
  color: var(--accent);
  font-weight: bold;
}

/* ─── Certificates ───────────────────────────────── */
.cert-group {
  padding-bottom: 2mm;
  border-bottom: 1px dotted var(--border);
  margin-bottom: 2mm;
}
.cert-group:last-child { border-bottom: none; margin-bottom: 0; }
.cert-issuer {
  font-size: 9pt;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1.5mm;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cert-item {
  padding-bottom: 1.5mm;
  margin-bottom: 0.5mm;
}
.cert-item:last-child { padding-bottom: 0; }
.cert-name {
  font-size: 8.5pt;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}
.cert-meta {
  font-size: 7pt;
  color: var(--muted);
  margin-top: 1px;
  line-height: 1.3;
}
.cert-id {
  font-family: 'DM Mono', monospace;
  font-size: 6.5pt;
}

/* ─── Education ──────────────────────────────────── */
.edu-item {
  border-left: 3px solid var(--accent2);
  padding-left: 5px;
  margin-bottom: 2.5mm;
}
.edu-item:last-child { margin-bottom: 0; }
.edu-school {
  font-size: 10.5pt;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}
.edu-location {
  font-size: 8.5pt;
  color: var(--muted);
  margin-bottom: 1px;
}
.edu-degree-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
}
.edu-degree {
  font-size: 9.5pt;
  color: var(--ink-soft);
  flex: 1;
  line-height: 1.25;
}
.edu-year {
  font-family: 'DM Mono', monospace;
  font-size: 8pt;
  color: var(--accent2);
  flex-shrink: 0;
}
.edu-modifier {
  font-size: 8pt;
  color: white;
  background: var(--accent);
  display: inline-block;
  padding: 1px 5px;
  border-radius: 2px;
  margin-top: 1px;
}

/* ─── Projects ───────────────────────────────────── */
.proj-item {
  padding-bottom: 2mm;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5mm;
}
.proj-item:last-child { border-bottom: none; }
.proj-header {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 1px;
}
.proj-type {
  font-family: 'DM Mono', monospace;
  font-size: 7pt;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: white;
  background: var(--accent);
  padding: 1px 4px;
  border-radius: 2px;
  white-space: nowrap;
}
body.geo .proj-type {
  font-family: 'Noto Sans Georgian', sans-serif;
  text-transform: none;
  letter-spacing: 0;
  font-size: 7.5pt;
}
.proj-agency {
  font-size: 9.5pt;
  font-weight: 600;
  color: var(--ink);
}
.proj-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}
.proj-title {
  font-size: 9pt;
  color: var(--ink-soft);
  line-height: 1.25;
}
.proj-meta {
  font-size: 8pt;
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.proj-date {
  font-family: 'DM Mono', monospace;
  font-size: 7.5pt;
  color: var(--muted);
}
.proj-link {
  color: var(--accent2);
  font-size: 8pt;
  margin-left: 3px;
}



/* ─── Russian button — disabled state ───────────── */
.lang-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.lang-btn:disabled:hover {
  background: none;
  color: var(--muted);
}
/* ─── Georgian: main-col text slightly smaller than EN ── */
body.geo .skill-cat-label { font-size: 6pt; }
body.geo .skill-tag { font-size: 6.5pt; }
body.geo .company-name { font-size: 10pt; }
body.geo .company-desc { font-size: 8.5pt; }
body.geo .work-location { font-size: 8pt; }
body.geo .pos-title { font-size: 9.5pt; }
body.geo .pos-dur { font-size: 7.5pt; }
body.geo .resp-list li { font-size: 8.5pt; }
body.geo .edu-school { font-size: 10pt; }
body.geo .edu-location { font-size: 8pt; }
body.geo .edu-degree { font-size: 9pt; }
body.geo .edu-year { font-size: 7.5pt; }
body.geo .edu-modifier { font-size: 7.5pt; }
body.geo .proj-agency { font-size: 9pt; }
body.geo .proj-title { font-size: 8.5pt; }
body.geo .proj-meta { font-size: 7.5pt; }
body.geo .proj-date { font-size: 7pt; }
body.geo .proj-link { font-size: 7.5pt; }
/* ═══════════════════════════════════════════════════
   MOBILE — single-column scrollable layout
════════════════════════════════════════════════════ */
@media screen and (max-width: 700px) {
  body {
    font-size: 11pt;
    background: #e8e6e0;
  }

  .control-bar {
    position: sticky;
    top: 0;
    right: auto;
    width: 100%;
    padding: 10px 14px;
    background: white;
    border-bottom: 1px solid var(--border);
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 100;
  }

  .cv-wrap {
    padding: 12px 12px 32px;
    gap: 12px;
  }

  .page {
    width: 100%;
    height: auto;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .sidebar {
    border-right: none;
    border-bottom: 2px solid var(--border);
    padding: 16px;
    gap: 12px;
  }

  .main-col {
    padding: 16px;
    gap: 12px;
    overflow: visible;
  }

  .name-block h1 { font-size: 18pt; }
  .occupation    { font-size: 10pt; }
  .section-title { font-size: 8.5pt; margin-bottom: 6px; }

  .contact-list li { font-size: 11pt; }
  .lang-name       { font-size: 12pt; }
  .lang-badge      { font-size: 8.5pt; }
  .soft-skill      { font-size: 11pt; }

  .skill-cat-label { font-size: 8pt; }
  .skill-tag       { font-size: 8.5pt; }

  .company-name  { font-size: 13pt; }
  .company-desc  { font-size: 10.5pt; }
  .work-location { font-size: 10pt; }
  .pos-title     { font-size: 12pt; }
  .pos-dur       { font-size: 9.5pt; }
  .resp-list li  { font-size: 10.5pt; }

  .cert-name { font-size: 10pt; }
  .cert-meta { font-size: 8.5pt; }

  .edu-school  { font-size: 13pt; }
  .edu-location{ font-size: 10pt; }
  .edu-degree  { font-size: 11pt; }
  .edu-year    { font-size: 9.5pt; }

  .proj-agency { font-size: 11pt; }
  .proj-title  { font-size: 10.5pt; }
  .proj-meta   { font-size: 9.5pt; }
  .proj-date   { font-size: 9pt; }
}

/* ═══════════════════════════════════════════════════
   PRINT — exactly two A4 pages, no overflow
════════════════════════════════════════════════════ */
@media print {
  @page { size: A4; margin: 0; }

  body {
    background: white;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .control-bar { display: none !important; }

  .cv-wrap {
    padding: 0;
    gap: 0;
    background: white;
  }

  .page {
    width: 210mm;
    height: 297mm;
    box-shadow: none;
    page-break-after: always;
    break-after: page;
    overflow: hidden;
  }

  .page-2 { page-break-after: auto; break-after: auto; }

  /* Force colours */
  .sidebar { background: #f4f3f0 !important; }
  .skill-tag { background: #e2e6ea !important; color: #2d3748 !important; border: 1px solid #c8d0d8 !important; }
  .proficiency-c1, .proficiency-c2 { background: #2e7d52 !important; color: white !important; }
  .proficiency-b1, .proficiency-b2 { background: #a87019 !important; color: white !important; }
  .proficiency-a1, .proficiency-a2 { background: #8b4513 !important; color: white !important; }
  .proj-type { background: var(--accent) !important; color: white !important; }
  .edu-modifier { background: var(--accent) !important; color: white !important; }
}
