:root {
  --bg: #eef2f7;
  --paper: #ffffff;
  --ink: #172033;
  --muted: #5b6474;
  --line: #d9e1ec;
  --soft: #f6f8fb;
  --accent: #1f4fd6;
  --accent-2: #0f172a;
  --chip-bg: #eaf0ff;
  --chip-text: #1f3f95;
  --sidebar: #0f172a;
  --sidebar-text: #e5ecf6;
  --sidebar-muted: #b7c3d8;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

body {
  margin: 0;
  padding: 28px;
  background: linear-gradient(180deg, #f3f6fb 0%, #e8eef7 100%);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

.print-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  border: 1px solid #cdd8ea;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.14);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.print-btn:hover {
  background: #f8fbff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.17);
  transform: translateY(-1px);
}

.print-btn:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

.cv {
  max-width: 1080px;
  margin: 0 auto;
  background: var(--paper);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.sidebar {
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.20), transparent 28%),
    linear-gradient(180deg, #13203a 0%, #0f172a 100%);
  color: var(--sidebar-text);
  padding: 34px 28px;
}

.identity {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.photo-wrap {
  position: relative;
  width: 158px;
  height: 158px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 16px;
  border: 3px solid rgba(255,255,255,0.30);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.38);
}

.photo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #eaf0ff;
  background: linear-gradient(145deg, rgba(59,130,246,0.35), rgba(30,64,175,0.35));
}

.photo-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.name {
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.role {
  margin: 12px 0 0;
  color: var(--sidebar-muted);
  font-size: 15px;
  line-height: 1.45;
}

.side-section {
  margin-bottom: 26px;
}

.side-section h2 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #ffffff;
}

.contact-list,
.side-list {
  display: grid;
  gap: 10px;
}

.contact-item,
.side-item {
  font-size: 14px;
  color: var(--sidebar-text);
}

.contact-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--sidebar-muted);
  margin-bottom: 2px;
}

.sidebar a {
  color: #dbe8ff;
  text-decoration: none;
  word-break: break-word;
}

.sidebar a:hover {
  text-decoration: underline;
}

.lang-grid {
  display: grid;
  gap: 10px;
}

.lang-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  font-size: 14px;
}

.lang-level {
  color: var(--sidebar-muted);
  font-size: 13px;
  white-space: nowrap;
}

.main {
  padding: 34px 36px 30px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
}

.top-band {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.summary-tag {
  display: inline-block;
  padding: 7px 12px;
  background: var(--chip-bg);
  color: var(--chip-text);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 12px;
}

.intro h1 {
  margin: 0 0 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: var(--accent);
}

.profile {
  margin: 0;
  font-size: 15px;
  color: #1f2937;
  max-width: 100%;
}

.section {
  margin-bottom: 24px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 18px;
  color: var(--accent-2);
}

.section-title::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent) 0%, #6aa5ff 100%);
  box-shadow: 0 2px 6px rgba(31, 79, 214, 0.25);
}

.card {
  background: var(--soft);
  border: 1px solid #e8edf5;
  border-radius: 16px;
  padding: 16px 18px;
}

.item {
  padding: 0 0 16px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 3px;
}

.title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #111827;
}

.date {
  font-size: 13px;
  white-space: nowrap;
  color: var(--muted);
}

.org {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--muted);
}

ul {
  margin: 0;
  padding-left: 18px;
}

li {
  margin-bottom: 5px;
  color: #1f2937;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips span {
  background: var(--chip-bg);
  color: var(--chip-text);
  border: 1px solid #d7e4ff;
  border-radius: 999px;
  font-size: 13px;
  padding: 6px 11px;
  font-weight: 600;
}

.small-list p {
  margin: 0 0 10px;
  font-size: 14px;
  color: #1f2937;
}

.small-list p:last-child {
  margin-bottom: 0;
}

.note {
  color: var(--muted);
}

@media (max-width: 920px) {
  .print-btn {
    top: 10px;
    right: 10px;
    font-size: 12px;
    padding: 8px 12px;
  }

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

  .main {
    padding-top: 28px;
  }
}

@media print {
  /* Ink-friendly print palette */
.sidebar {
  background: #ffffff !important;
  color: #111827 !important;
  border-right: 1px solid #d1d5db;
}

.sidebar .role,
.sidebar .contact-label,
.sidebar .lang-level {
  color: #1a509b !important;
}

.sidebar a {
  color: #1f2937 !important;
}

.photo-wrap {
  border-color: #cbd5e1 !important;
  box-shadow: none !important;
}

/* Optional: remove card tint for lower ink use */
.card {
  background: #ffffff !important;
  border-color: #dbe2ea !important;
}

/* Prefer economical color usage */
html {
  -webkit-print-color-adjust: economy;
  print-color-adjust: economy;
}
  .print-btn {
    display: none !important;
  }

  @page {
    size: A4;
    margin: 10mm;
  }

  body {
    padding: 0;
    background: #fff;
    font-size: 10.3pt;
    line-height: 1.25;
  }

  .cv {
    max-width: none;
    border-radius: 0;
    box-shadow: none;
    min-height: auto;
    display: grid;
    grid-template-columns: 230px 1fr;
  }

  .sidebar {
    padding: 12px 11px;
  }

  .main {
    padding: 12px 12px 8px;
  }

  .photo-wrap {
    width: 82px;
    height: 82px;
    margin-bottom: 8px;
    border-radius: 50%;
  }

  .name {
    font-size: 23px;
  }

  .role {
    font-size: 10.5px;
    margin-top: 6px;
  }

  .side-section h2 {
    font-size: 10px;
    margin-bottom: 5px;
  }

  .contact-item,
  .side-item,
  .lang-row,
  .small-list p,
  .org,
  li,
  .profile {
    font-size: 10.2px;
  }

  .contact-list,
  .side-list,
  .lang-grid {
    gap: 5px;
  }

  .side-section {
    margin-bottom: 12px;
  }

  .contact-label {
    margin-bottom: 1px;
    font-size: 9px;
  }

  .section {
    margin-bottom: 8px;
    break-inside: auto;
    page-break-inside: auto;
  }

  .section-title {
    font-size: 12.5px;
    margin: 0 0 5px;
    page-break-after: avoid;
  }

  .card {
    padding: 7px 8px;
    border-radius: 8px;
    break-inside: auto;
    page-break-inside: auto;
  }

  .item {
    margin: 0 0 6px;
    padding: 0 0 6px;
    break-inside: auto;
    page-break-inside: auto;
  }

  .top-band {
    margin-bottom: 8px;
    padding-bottom: 7px;
  }

  .intro h1 {
    font-size: 11.5px;
    margin-bottom: 4px;
  }

  .title {
    font-size: 11px;
  }

  .date {
    font-size: 9.8px;
  }

  ul {
    padding-left: 14px;
  }

  li {
    margin-bottom: 2px;
  }

  p {
    orphans: 2;
    widows: 2;
  }

  .title-row {
    break-after: avoid-page;
  }

  .chips {
    gap: 4px;
  }

  .chips span {
    font-size: 9px;
    padding: 3px 6px;
  }

  .grid-two {
    gap: 7px;
  }

  a {
    text-decoration: none;
  }
}
