:root {
  --primary: #004f90;
  --primary-dark: #003e72;
  --primary-soft: #e7f0f8;
  --sidebar-bg: #005a9f;
  --text: #1f2430;
  --muted: #566274;
  --paper: #ffffff;
  --line: #d7e1ea;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(
    circle at top,
    #e9edf2 0%,
    #dce3ea 55%,
    #cfd7e0 100%
  );
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
}

.actions {
  width: min(100%, 980px);
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.download-btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 8px 20px rgba(0, 79, 144, 0.28);
}

.download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 79, 144, 0.35);
}

.resume {
  width: min(100%, 980px);
  background: var(--paper);
  display: grid;
  grid-template-columns: 64% 36%;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.main {
  padding: 30px 26px 24px 30px;
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, #004b87 100%);
  color: #fff;
  padding: 24px 20px 20px;
}

.name {
  margin: 0;
  color: var(--text);
  font-family: Calibri, Arial, sans-serif;
  font-size: 2.2rem;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.role {
  color: var(--primary);
  font-weight: 600;
  margin-top: 4px;
  margin-bottom: 8px;
  font-size: 1rem;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.contact-item a {
  color: inherit;
  text-decoration: none;
}

.section {
  margin-top: 12px;
}

.section-title {
  margin: 0 0 7px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.24rem;
  line-height: 1;
  color: var(--primary);
  font-family: Calibri, Arial, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
}

.section-line {
  height: 2px;
  background: linear-gradient(90deg, var(--primary) 0%, #8db4d6 100%);
  margin-bottom: 8px;
}

p {
  margin: 0;
  font-size: 0.87rem;
  line-height: 1.32;
}

.entry {
  margin-bottom: 8px;
  break-inside: avoid;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 3px;
}

.entry-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #1d2734;
}

.entry-meta {
  text-align: right;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: pre-line;
}

.entry-subtitle {
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 500;
  margin-bottom: 3px;
}

ul {
  margin: 3px 0 0 15px;
  padding: 0;
}

li {
  margin-bottom: 1px;
  font-size: 0.84rem;
  line-height: 1.28;
}

.project-link {
  margin-top: 1px;
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.78rem;
}

.sidebar-top {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.avatar {
  width: 124px;
  height: 124px;
  border: 5px solid #a8d4fb;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.sb-section {
  margin-top: 12px;
  break-inside: avoid;
}

.sb-title {
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-family: Calibri, Arial, sans-serif;
  font-size: 1.16rem;
  text-transform: uppercase;
  font-weight: 700;
}

.sb-line {
  height: 2px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #d6ebfc 0%, #6faad8 100%);
}

.skill {
  margin-bottom: 7px;
}

.skill-label {
  font-size: 0.82rem;
  margin-bottom: 3px;
}

.bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 50px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: #f2f8ff;
  border-radius: 50px;
}

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

.strength-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.strength-tag {
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: #fff;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 0.74rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.strength-tag i {
  font-size: 0.72rem;
}

.interest-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.interest-list li {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  font-size: 0.82rem;
  line-height: 1.22;
}

.interest-list i {
  width: 14px;
  text-align: center;
}

.reference-text {
  margin: 0;
  font-size: 0.82rem;
  color: #fff;
  line-height: 1.22;
}

.chip {
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: #fff;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 0.77rem;
}

.sb-list {
  margin: 0;
  padding-left: 16px;
}

.sb-list li {
  margin-bottom: 3px;
  font-size: 0.82rem;
  line-height: 1.24;
}

@media (max-width: 900px) {
  .resume {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: -1;
  }

  .main,
  .sidebar {
    padding: 22px;
  }

  .name {
    font-size: 1.85rem;
  }
}

@media print {
  @page {
    size: A4;
    margin: 8mm;
  }

  html,
  body {
    width: 210mm;
    background: #fff;
  }

  body {
    padding: 0;
    display: block;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .actions {
    display: none;
  }

  .resume {
    width: 100%;
    max-width: none;
    box-shadow: none;
    overflow: visible;
    grid-template-columns: 64% 36% !important;
  }

  .sidebar {
    order: 0 !important;
  }

  .main {
    padding: 20px 16px 14px 20px;
  }

  .sidebar {
    padding: 18px 14px 14px;
  }

  .name {
    font-size: 1.85rem;
  }

  .role {
    margin-bottom: 6px;
    font-size: 0.92rem;
  }

  .contact-row {
    font-size: 0.72rem;
    gap: 4px 8px;
    margin-bottom: 8px;
  }

  .section {
    margin-top: 9px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .section-title {
    font-size: 1.08rem;
    margin-bottom: 5px;
  }

  .section-line {
    margin-bottom: 6px;
  }

  p,
  li,
  .entry-title,
  .entry-subtitle,
  .project-link,
  .entry-meta,
  .skill-label,
  .sb-list li,
  .chip {
    line-height: 1.2;
  }

  p {
    font-size: 0.75rem;
  }

  li {
    font-size: 0.73rem;
  }

  .entry-title {
    font-size: 0.87rem;
  }

  .entry-subtitle,
  .project-link,
  .entry-meta {
    font-size: 0.7rem;
  }

  .sb-title {
    font-size: 0.98rem;
  }

  .skill {
    margin-bottom: 5px;
  }

  .bar {
    height: 6px;
  }

  .chip {
    padding: 2px 6px;
    font-size: 0.66rem;
  }

  .strength-grid {
    gap: 4px;
  }

  .strength-tag {
    padding: 2px 5px;
    font-size: 0.62rem;
    gap: 4px;
  }

  .strength-tag i {
    font-size: 0.6rem;
  }

  .interest-list li {
    font-size: 0.68rem;
    margin-bottom: 3px;
    gap: 6px;
  }

  .interest-list i {
    width: 11px;
  }

  .reference-text {
    font-size: 0.68rem;
  }

  .avatar {
    width: 100px;
    height: 100px;
    border: 3px solid #a8d4fb;
    border-radius: 50%;
  }

  .resume,
  .main,
  .sidebar {
    page-break-inside: avoid;
  }
}
