:root {
  --primary: #1565c0;
  --secondary: #1e88e5;
  --background: #f8fafc;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #2563eb;
  --white: #ffffff;
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 12.6px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  color: var(--text);
  background: var(--background);
  line-height: 1.34;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
ul,
h1,
h2,
h3,
h4 {
  margin-top: 0;
}

.page {
  width: min(210mm, calc(100vw - 32px));
  min-height: 297mm;
  margin: 16px auto;
  padding: 9mm;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 2.08fr);
  gap: 7mm;
  background: var(--white);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
}

.sidebar,
.content {
  min-width: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-card,
.panel,
.section,
.feature-card,
.edu-card,
.stat-card {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 14px;
  background: linear-gradient(180deg, rgba(21, 101, 192, 0.08), rgba(37, 99, 235, 0.03));
}

.profile-photo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 10px;
  border: 4px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 24px rgba(21, 101, 192, 0.2);
}

h1 {
  margin-bottom: 6px;
  font-size: 1.68rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.headline {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.38;
}

.panel,
.section {
  padding: 12px 14px;
}

.section h2,
.panel h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--primary);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.section h2 i,
.panel h2 i {
  color: var(--accent);
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 7px;
}

.contact-list li {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--text);
  font-size: 0.82rem;
}

.contact-list i {
  margin-top: 2px;
  color: var(--accent);
}

.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(30, 136, 229, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
}

.skill-clusters {
  display: grid;
  gap: 7px;
}

.skill-clusters h3 {
  margin-bottom: 3px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.skill-clusters p {
  margin-bottom: 0;
  font-size: 0.78rem;
}

.language-list {
  display: grid;
  gap: 6px;
}

.language-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid var(--line);
  font-size: 0.8rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.stat-card {
  padding: 12px 10px;
  text-align: center;
  background: linear-gradient(180deg, rgba(21, 101, 192, 0.08), rgba(37, 99, 235, 0.02));
}

.stat-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--primary);
  font-size: 1.2rem;
  line-height: 1;
}

.stat-card span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.summary {
  margin-bottom: 0;
  font-size: 0.84rem;
}

.timeline {
  position: relative;
  display: grid;
  gap: 12px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 7px;
  width: 2px;
  background: linear-gradient(var(--secondary), rgba(30, 136, 229, 0.12));
}

.timeline-item {
  position: relative;
  padding-left: 24px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.timeline-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.timeline-header h3,
.feature-top h3,
.edu-card h3 {
  margin-bottom: 2px;
  font-size: 0.92rem;
}

.company,
.project-note,
.edu-card p,
.period {
  color: var(--muted);
}

.period {
  white-space: nowrap;
  font-size: 0.74rem;
  font-weight: 600;
}

.timeline-item ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.8rem;
}

.timeline-item li + li {
  margin-top: 3px;
}

.mini-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-metrics span,
.achievement-list span {
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.95);
  font-size: 0.72rem;
  font-weight: 600;
}

.featured-project {
  padding-bottom: 0;
}

.feature-card {
  padding: 12px;
  margin-top: 2px;
  background: linear-gradient(135deg, rgba(21, 101, 192, 0.06), rgba(37, 99, 235, 0.015));
}

.feature-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.project-highlight {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.project-columns {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
}

.project-columns h4 {
  margin-bottom: 4px;
  color: var(--primary);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.project-columns p {
  margin-bottom: 0;
}

.compact .badge {
  font-size: 0.68rem;
}

.split-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.split-section > div {
  min-width: 0;
}

.split-section > div > h2 {
  margin-bottom: 8px;
}

.edu-card {
  padding: 12px 14px;
}

.edu-card span {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.76rem;
}

.achievement-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 900px) {
  .page {
    width: calc(100vw - 20px);
    min-height: auto;
    margin: 10px auto;
    padding: 18px;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .project-columns,
  .split-section {
    grid-template-columns: 1fr;
  }

  .timeline-header,
  .feature-top {
    flex-direction: column;
  }

  .period,
  .project-highlight {
    white-space: normal;
  }
}

@media print {
  @page {
    size: A4;
    margin: 7mm;
  }

  html,
  body {
    background: var(--white);
  }

  body {
    margin: 0;
    zoom: 0.68;
  }

  .page {
    width: calc(100% / 0.68);
    min-height: auto;
    margin: 0;
    padding: 0;
    box-shadow: none;
    gap: 6mm;
  }

  .hero-card,
  .panel,
  .section,
  .feature-card,
  .edu-card,
  .stat-card {
    box-shadow: none;
  }

  .panel,
  .section,
  .hero-card,
  .feature-card,
  .edu-card,
  .timeline-item,
  .stat-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
