:root {
  --sidebar-bg: #2b3245;
  --sidebar-text: #ffffff;
  --sidebar-muted: #c7cbd3;
  --main-text: #2b3245;
  --main-muted: #6b7280;
  --accent-orange: #f5a623;
  --accent-red: #e8443b;
  --bg: #e8eaee;
  --paper: #ffffff;
  --shadow: 0 8px 30px rgba(0,0,0,0.15);
  --control-shadow: 0 2px 8px rgba(0,0,0,0.12);
  --control-active-bg: var(--sidebar-bg);
  --accent-text: #2b3245;
  --sidebar-heading: var(--sidebar-text);
  --section-heading: var(--main-text);
  --entry-title: var(--main-text);
  --entry-subtitle: var(--main-muted);
  --date-text: #9ca3af;
  --detail-text: var(--main-text);
  --comment-text: #7b8490;
  --summary-strong: var(--sidebar-text);
}

[data-theme="code"] {
  --sidebar-bg: #21252b;
  --sidebar-text: #abb2bf;
  --sidebar-muted: #7f848e;
  --main-text: #abb2bf;
  --main-muted: #7f848e;
  --accent-orange: #d19a66;
  --accent-red: #e06c75;
  --bg: #1e2127;
  --paper: #282c34;
  --shadow: 0 8px 30px rgba(0,0,0,0.4);
  --control-shadow: 0 2px 8px rgba(0,0,0,0.35);
  --control-active-bg: #3e4451;
  --accent-text: #282c34;
  --sidebar-heading: #e5c07b;
  --section-heading: #e5c07b;
  --entry-title: #98c379;
  --entry-subtitle: #c678dd;
  --date-text: #c678dd;
  --detail-text: #7dd3df;
  --comment-text: #7f848e;
  --summary-strong: #98c379;
}

[data-theme="dark"] {
  --sidebar-bg: #1f2937;
  --sidebar-text: #ffffff;
  --sidebar-muted: #ffffff;
  --main-text: #ffffff;
  --main-muted: #ffffff;
  --accent-orange: #f59e0b;
  --accent-red: #f92672;
  --bg: #111827;
  --paper: #1f2937;
  --shadow: 0 8px 30px rgba(0,0,0,0.4);
  --control-shadow: 0 2px 8px rgba(0,0,0,0.35);
  --control-active-bg: #374151;
  --accent-text: #111827;
  --sidebar-heading: #ffffff;
  --section-heading: #ffffff;
  --entry-title: #ffffff;
  --entry-subtitle: #ffffff;
  --date-text: #ffffff;
  --detail-text: #ffffff;
  --comment-text: #ffffff;
  --summary-strong: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 15px;
}

body {
  margin: 0;
  font-family: "Open Sans", "Inter", sans-serif;
  background: var(--bg);
  color: var(--main-text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.controls {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  gap: 12px;
  align-items: center;
}

.lang-switcher {
  display: flex;
  background: var(--paper);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--control-shadow);
}

.lang-switcher button,
.print-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 14px;
  color: var(--main-text);
}

.lang-switcher button.active {
  background: var(--control-active-bg);
  color: var(--sidebar-text);
}

.theme-switcher {
  display: flex;
  background: var(--paper);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--control-shadow);
}

.theme-switcher button {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--main-text);
}

[data-theme="pro"] .theme-switcher button:not(.active) {
  color: #2b3245;
}

[data-theme="code"] .theme-switcher button:not(.active) {
  color: #7f848e;
}

[data-theme="dark"] .theme-switcher button:not(.active) {
  color: #ffffff;
}

.theme-switcher button.active {
  background: var(--control-active-bg);
  color: var(--sidebar-text);
}

.theme-switcher button svg {
  width: 18px;
  height: 18px;
  color: inherit;
  stroke-width: 2;
  opacity: 1;
}

.theme-switcher button svg,
.theme-switcher button svg * {
  stroke: currentColor;
  fill: none;
}

.print-btn {
  background: var(--accent-orange);
  color: var(--accent-text);
  border-radius: 6px;
  box-shadow: var(--control-shadow);
}

.page-frame {
  margin: 60px auto 40px;
  overflow: hidden;
}

.page {
  width: 210mm;
  height: 297mm;
  margin: 0;
  transform: scale(var(--cv-scale, 1));
  transform-origin: top left;
  background: var(--paper);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 35% 65%;
  overflow: hidden;
}

.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 34px 24px 30px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
  min-height: 0;
}

.photo-wrap {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  border: 4px solid var(--paper);
  overflow: hidden;
  margin: 0 auto;
  flex-shrink: 0;
}

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

.contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--sidebar-muted);
}

.contact-item svg,
.contact-item i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: var(--sidebar-muted);
}

.contact-item a {
  color: var(--sidebar-muted);
  text-decoration: none;
}

.summary {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--sidebar-muted);
}

.summary strong {
  color: var(--summary-strong);
  font-weight: 700;
}

.section h2,
.main-section h2 {
  font-family: "Open Sans", sans-serif;
  font-size: 1.28rem;
  font-weight: 700;
  margin: 0 0 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section h2 {
  color: var(--sidebar-heading);
}

.main-section h2 {
  color: var(--section-heading);
}

.section h2 svg,
.section h2 i {
  width: 18px;
  height: 18px;
  stroke: var(--sidebar-heading);
  fill: none;
}

.main-section h2 svg,
.main-section h2 i,
.tl-header-icon svg,
.tl-header-icon i {
  width: 18px;
  height: 18px;
  stroke: var(--section-heading);
  fill: none;
}

.section ul {
  margin: 0;
  padding-left: 14px;
}

.section li {
  margin-bottom: 7px;
  font-size: 0.86rem;
  color: var(--sidebar-muted);
}

.main {
  padding: 40px 34px 34px 28px;
  position: relative;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.name-header {
  margin-bottom: 28px;
  flex: 0 0 auto;
}

.name-header h1 {
  font-family: "Open Sans", sans-serif;
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0;
  color: var(--main-text);
  line-height: 1.05;
}

.name-header .title {
  font-size: 1.42rem;
  font-weight: 500;
  color: var(--main-text);
  margin: 8px 0 0;
  letter-spacing: 0.3px;
}

.timeline-container {
  position: relative;
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
}

.tl-svg {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  z-index: 1;
}

.tl-text {
  position: relative;
  z-index: 2;
}

.tl-header {
  position: absolute;
  left: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 30px;
}

.tl-header-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  background-color: var(--paper);
  border-radius: 50%;
}

.tl-header-icon svg,
.tl-header-icon i {
  width: 18px;
  height: 18px;
  stroke: var(--section-heading);
  fill: none;
  stroke-width: 2;
}

.tl-header h2 {
  margin: 0;
  font-family: "Open Sans", sans-serif;
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--section-heading);
}

.tl-header.certifications h2 {
  color: var(--section-heading);
}

.tl-header.certifications .tl-header-icon svg,
.tl-header.certifications .tl-header-icon i {
  stroke: var(--section-heading);
}

.tl-entry {
  position: absolute;
  left: 60px;
  right: 0;
}

.item-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--entry-title);
  margin: 0;
  line-height: 24px;
}

.tl-entry.compact-details .item-title,
.tl-entry.minimized .item-title {
  font-size: 0.96rem;
  line-height: 22px;
}

.item-subtitle {
  font-size: 0.86rem;
  font-style: italic;
  color: var(--comment-text);
  margin: 0;
  line-height: 20px;
}

.item-subtitle::before {
  content: "// ";
  font-style: normal;
}

.tl-entry.minimized .item-title {
  display: block;
  font-weight: 700;
  color: var(--entry-title);
}

.tl-entry.minimized .item-subtitle {
  display: block;
  font-size: 0.86rem;
  font-style: italic;
  color: var(--comment-text);
  line-height: 20px;
  margin-left: 0;
}

.tl-entry.certifications .item-title {
  color: var(--entry-title);
  font-size: 1.1rem;
}

.cert-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.cert-list li {
  padding-left: 18px;
  position: relative;
  height: 29px;
  line-height: 29px;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--entry-title);
}

.cert-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9ca3af;
}

.cert-list li.done::before {
  background: var(--accent-orange);
}

.cert-list .secondary {
  font-style: normal;
  color: var(--entry-title);
  font-size: 0.88rem;
  font-weight: 500;
}

.branch-wrap {
  position: relative;
}

.branch-item {
  padding-left: 10px;
  font-size: 0.85rem;
  color: var(--detail-text);
  font-weight: 500;
  display: flex;
  align-items: center;
  transform: translateY(4px);
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  body {
    background: var(--paper);
  }

  .no-print {
    display: none !important;
  }

  .page-frame {
    width: 210mm !important;
    height: 297mm !important;
    margin: 0 !important;
    overflow: visible;
  }

  .page {
    width: 210mm;
    height: 297mm;
    margin: 0;
    transform: none;
    box-shadow: none;
    page-break-after: avoid;
  }

  .page,
  .main {
    background-color: var(--paper) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sidebar {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .timeline::before,
  .timeline-item::before,
  .branch-item::before {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .main-section {
    page-break-inside: avoid;
  }

  .timeline-item {
    page-break-inside: avoid;
  }
}

