:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1a2332;
  --text-muted: #5c667a;
  --accent: #1d4ed8;
  --accent-soft: #dbeafe;
  --border: #e2e8f0;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --radius: 16px;
  --sidebar-width: 340px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(29, 78, 216, 0.08), transparent 28%),
    var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page {
  max-width: 1120px;
  margin: 32px auto 48px;
  padding: 0 20px;
}

.resume {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 28px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 24px;
}

.profile-card,
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.profile-card {
  display: flex;
  flex-direction: column;
  padding: 22px 22px 24px;
  overflow: visible;
}

.photo-wrap {
  width: 148px;
  height: 148px;
  margin: 0 auto 18px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--accent-soft);
  background: var(--accent-soft);
  flex-shrink: 0;
}

.photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

.profile-body {
  padding: 0;
}

.profile-body h1 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: center;
}

.role {
  margin: 0 0 18px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.contact-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.contact-list strong {
  color: var(--text);
  min-width: 72px;
  font-weight: 600;
}

.sidebar-block {
  margin-top: 18px;
  padding: 22px;
}

.sidebar-block h2,
.main-section h2,
.career-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.sidebar-block h2::before,
.main-section h2::before,
.career-heading::before {
  content: "";
  width: 4px;
  height: 1em;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

.main-section--career .career-heading--experience {
  margin-top: 22px;
}

.summary--secondary {
  margin-top: 12px;
}

.career-heading--achievements {
  margin-top: 22px;
}

.highlights-list,
.competency-list,
.project-list {
  margin: 0;
  padding-left: 20px;
  color: #243044;
}

.highlights-list {
  display: grid;
  gap: 8px;
}

.competency-list {
  display: grid;
  gap: 7px;
  font-size: 0.9rem;
}

.competency-list li::marker,
.highlights-list li::marker,
.project-list li::marker {
  color: var(--accent);
}

.skill-group + .skill-group {
  margin-top: 16px;
}

.skill-group h3 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--text);
}

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

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #1e3a8a;
  font-size: 0.82rem;
  font-weight: 500;
}

.languages {
  display: grid;
  gap: 10px;
}

.lang-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
}

.lang-item span:last-child {
  color: var(--text-muted);
}

.main {
  display: grid;
  gap: 18px;
}

.main-section {
  padding: 26px 28px;
}

.summary {
  font-size: 1rem;
  color: #243044;
}

.experience-item + .experience-item {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.exp-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.exp-header h3 {
  margin: 0 0 4px;
  font-size: 1.08rem;
}

.company {
  color: var(--accent);
  font-weight: 600;
}

.exp-meta {
  flex-shrink: 0;
  text-align: right;
  color: var(--text-muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.exp-subtitle {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.exp-list {
  margin: 0;
  padding-left: 18px;
  color: #243044;
}

.exp-list li + li {
  margin-top: 8px;
}

.tech-stack {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.tech-stack strong {
  color: var(--text);
}

.project-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.project-header h3 {
  margin: 0 0 4px;
  font-size: 1.12rem;
  color: var(--accent);
}

.project-header p,
.project-description {
  margin: 0;
  color: var(--text-muted);
}

.project-link {
  flex-shrink: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.project-description {
  margin-top: 14px;
  color: #243044;
}

.project-list {
  margin-top: 12px;
}

.project-list li + li {
  margin-top: 7px;
}

.project-stack {
  margin-top: 16px;
}

.education-item + .education-item {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.education-item h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.education-item p {
  margin: 0;
  color: var(--text-muted);
}

.education-item .year {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.education-item .year + .certificate-badge {
  margin-left: 8px;
  margin-top: 6px;
}

.certificate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.82rem;
  font-weight: 600;
}

.sidebar-block--skills + .sidebar-block--skills > h2 {
  display: none;
}

.exp-chunk + .exp-chunk {
  margin-top: 6px;
}

.exp-list--continued {
  margin-top: 0;
}

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

  .sidebar {
    position: static;
  }

  .exp-header {
    flex-direction: column;
  }

  .project-header {
    flex-direction: column;
  }

  .exp-meta {
    text-align: left;
    white-space: normal;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 12mm;
  }

  html {
    font-size: 10pt;
  }

  body {
    background: #fff !important;
    color: #111827;
    line-height: 1.38;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .page {
    margin: 0;
    padding: 0;
    max-width: none;
  }

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

  .resume {
    display: grid;
    grid-template-columns: 82mm 1fr;
    gap: 12px;
    align-items: start;
  }

  .sidebar {
    position: static;
  }

  .profile-card,
  .section-card {
    box-shadow: none;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
  }

  .profile-card,
  .sidebar-block,
  .main-section:not(.main-section--career),
  .project-section,
  .experience-item:not(.experience-item--long),
  .exp-chunk,
  .education-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .main-section--career,
  .experience-item--long {
    break-inside: auto;
    page-break-inside: auto;
  }

  .skill-group,
  .exp-header,
  .exp-list li {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .photo-wrap {
    width: 34mm;
    height: 34mm;
    margin: 0 auto 10px;
    border-width: 2px;
  }

  .profile-card {
    padding: 14px 16px 16px;
  }

  .profile-body {
    padding: 0;
  }

  .profile-body h1 {
    font-size: 14pt;
    margin-bottom: 4px;
  }

  .role {
    font-size: 9.5pt;
    margin-bottom: 10px;
  }

  .contact-list {
    gap: 4px;
  }

  .contact-list li {
    font-size: 8.5pt;
  }

  .contact-list strong {
    min-width: 62px;
  }

  .sidebar-block {
    margin-top: 10px;
    padding: 12px 14px;
  }

  .sidebar-block h2,
  .main-section h2,
  .career-heading {
    margin-bottom: 8px;
    padding-bottom: 6px;
    font-size: 7.5pt;
    border-bottom-width: 1.5px;
  }

  .summary--secondary {
    margin-top: 8px;
  }

  .skill-group + .skill-group {
    margin-top: 8px;
  }

  .skill-group h3 {
    font-size: 8.5pt;
    margin-bottom: 4px;
  }

  .tags {
    gap: 4px;
  }

  .tag {
    padding: 2px 7px;
    font-size: 7.5pt;
  }

  .lang-item {
    font-size: 8.5pt;
  }

  .main {
    gap: 10px;
  }

  .main-section {
    padding: 14px 16px;
  }

  .main-section--career .career-heading--experience {
    margin-top: 12px;
  }

  .career-heading--achievements {
    margin-top: 12px;
  }

  .summary {
    font-size: 9.5pt;
    margin: 0;
  }

  .experience-item + .experience-item {
    margin-top: 12px;
    padding-top: 12px;
  }

  .exp-header h3 {
    font-size: 10pt;
  }

  .exp-subtitle {
    font-size: 8.5pt;
    margin-bottom: 6px;
  }

  .exp-meta {
    font-size: 8.5pt;
  }

  .exp-list {
    padding-left: 15px;
  }

  .exp-list li {
    font-size: 9pt;
  }

  .exp-list li + li {
    margin-top: 3px;
  }

  .highlights-list,
  .project-list {
    padding-left: 16px;
  }

  .highlights-list {
    gap: 3px;
  }

  .highlights-list li,
  .project-list li,
  .competency-list {
    font-size: 8.5pt;
  }

  .project-header h3 {
    font-size: 10pt;
  }

  .project-header p,
  .project-description,
  .project-link,
  .tech-stack {
    font-size: 8.5pt;
  }

  .project-description {
    margin-top: 8px;
  }

  .project-list {
    margin-top: 8px;
  }

  .project-list li + li {
    margin-top: 3px;
  }

  .project-stack {
    margin-top: 10px;
  }

  .tech-stack {
    margin-top: 8px;
    padding-top: 7px;
  }

  .exp-chunk + .exp-chunk {
    margin-top: 4px;
  }

  .education-item + .education-item {
    margin-top: 10px;
    padding-top: 10px;
  }

  .education-item h3 {
    font-size: 9.5pt;
  }

  .education-item p {
    font-size: 8.5pt;
  }

  .education-item .year,
  .certificate-badge {
    font-size: 7.5pt;
    margin-top: 4px;
    padding: 2px 8px;
  }
}
