* {
  box-sizing: border-box;
}

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

a {
  color: #6f2d91;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 1px;
}

.top-controls {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-switch,
.photo-toggle {
  padding: 6px 8px;
  border: 1px solid rgba(45, 23, 59, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 6px 18px rgba(45, 23, 59, 0.12);
  backdrop-filter: blur(8px);
}

.photo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2d173b;
  font: inherit;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.photo-toggle:focus-within {
  outline: 2px solid #6f2d91;
  outline-offset: 3px;
}

.photo-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.photo-toggle-track {
  position: relative;
  display: inline-flex;
  width: 24px;
  height: 14px;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  background: #b7adb9;
  transition: background 0.18s ease;
}

.photo-toggle-thumb {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 1px 2px rgba(45, 23, 59, 0.22);
  transform: translateX(0);
  transition: transform 0.18s ease;
}

.photo-toggle.is-active .photo-toggle-track {
  background: #6f2d91;
}

.photo-toggle.is-active .photo-toggle-thumb {
  transform: translateX(10px);
}

.lang-switch-link {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.lang-switch-link:hover,
.lang-switch-link:focus-visible,
.lang-switch-link.is-active {
  opacity: 1;
}

.lang-switch-link:hover {
  transform: translateY(-1px);
}

.lang-switch-link:focus-visible {
  outline: 2px solid #6f2d91;
  outline-offset: 3px;
}

.lang-switch-flag {
  display: block;
  width: 28px;
  height: 20px;
  object-fit: cover;
}

.cv-page {
  width: 210mm;
  min-height: 297mm;
}

.cv-header-avatar {
  width: 22mm;
  height: 22mm;
  border: 0.5mm solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  object-fit: cover;
  object-position: 50% 38%;
  box-shadow: 0 1mm 2.5mm rgba(20, 8, 28, 0.28);
}

.cv-photo-hidden .cv-header-avatar {
  display: none;
}

.cv-photo-hidden main > header {
  grid-template-columns: minmax(0, 1fr) max-content;
}

.cv-contact a,
.cv-showcase a {
  color: #6f2d91;
  text-decoration: underline;
  text-underline-offset: 1px;
}

.cv-contact a {
  color: white;
}

.cv-portfolio-link {
  color: #6f2d91;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 1px;
}

.cv-section-title::before {
  content: "";
  width: 3.2mm;
  flex: 0 0 3.2mm;
  margin-right: 3.1mm;
  background: #6f2d91;
}

.cv-section-title > span {
  padding: 2mm 0 2.15mm;
}

.cv-expertise-item:nth-child(odd) {
  border-right: 1px solid #ebe3ef;
}

.cv-expertise-item strong {
  display: block;
  margin-bottom: 0.7mm;
  color: #2d173b;
  font-size: 9.1pt;
  line-height: 1.18;
}

.cv-expertise-item span {
  display: block;
  font-size: 8.25pt;
  line-height: 1.3;
}

.cv-list {
  margin: 0;
  padding-left: 5.2mm;
}

.cv-list li {
  margin: 0 0 1.2mm;
  padding-left: 0.7mm;
}

.cv-list li::marker {
  color: #6f2d91;
}

.cv-tech-cell {
  border-bottom: 1px solid #eee8f1;
}

.cv-tech-cell:nth-child(odd) {
  background-color: #f5f0f8;
}

.cv-simple-list li {
  margin-bottom: 1.35mm;
}

.cv-showcase strong {
  color: #2d173b;
}

.cv-page--compact {
  font-size: 8.95pt;
}

.cv-page--compact .cv-section {
  margin-top: 5.2mm;
}

.cv-page--compact .cv-section--tight {
  margin-top: 4.3mm;
}

.cv-page--compact .cv-section-title {
  margin-bottom: 2.5mm;
  font-size: 11.8pt;
}

.cv-page--compact .cv-section-title > span {
  padding: 1.55mm 0 1.7mm;
}

.cv-page--compact .cv-role {
  margin-bottom: 3.7mm;
}

.cv-page--compact .cv-list li {
  margin-bottom: 0.85mm;
}

.cv-page--compact .cv-tech {
  margin-top: 0.8mm;
}

.cv-page--compact .cv-tech-cell {
  padding: 1mm 1.8mm;
}

.cv-page--compact .cv-simple-list li {
  margin-bottom: 0.8mm;
}

.cv-page--compact .cv-showcase {
  gap: 1mm 4mm;
  font-size: 8.15pt;
}

@media screen {
  .cv-page {
    margin: 10mm auto;
    box-shadow: 0 10px 35px rgba(45, 23, 59, 0.12);
  }
}

@media screen and (max-width: 720px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .cv-page {
    width: 100%;
    min-height: auto;
    margin: 0 0 12px;
    padding: 15mm 7mm 9mm !important;
    box-shadow: none;
  }

  .top-controls {
    top: 8px;
    right: 8px;
    gap: 4px;
  }

  .lang-switch,
  .photo-toggle {
    padding: 5px 6px;
  }

  .photo-toggle {
    font-size: 10px;
  }

  .lang-switch-flag {
    width: 24px;
    height: 17px;
  }

  .cv-page main > header {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    gap: 3mm;
    padding: 4mm !important;
  }

  .cv-photo-hidden .cv-page main > header {
    grid-template-columns: minmax(0, 1fr);
  }

  .cv-header-avatar {
    position: absolute;
    top: -10mm;
    left: 50%;
    width: 20mm;
    height: 20mm;
    transform: translateX(-50%);
  }

  .cv-header-copy {
    grid-column: 1 / -1;
    min-width: 0;
    padding-top: 10mm;
  }

  .cv-photo-hidden .cv-page main > header .cv-header-copy {
    grid-column: 1 / -1;
    padding-top: 0;
  }

  .cv-page main > header h1 {
    font-size: 20pt;
  }

  .cv-page main > header .cv-contact {
    grid-column: 1 / -1;
    width: 100%;
    padding-top: 3mm;
    border-top: 1px solid rgba(255, 255, 255, 0.28);
    text-align: left;
    white-space: normal;
  }

  .cv-page main > header .cv-contact a {
    overflow-wrap: anywhere;
  }

  .cv-section-title > span {
    padding-top: 1.7mm;
    padding-bottom: 1.85mm;
  }

  .cv-expertise-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .cv-expertise-item:nth-child(odd) {
    border-right: 0;
  }

  .cv-expertise-item:not(:last-child) {
    border-bottom: 1px solid #ebe3ef;
  }

  .cv-role > div {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3mm;
  }

  .cv-showcase {
    grid-template-columns: 1fr;
    gap: 1.5mm;
  }

  .cv-showcase > div:nth-child(odd):not(:first-child) {
    margin-top: 2mm;
  }

  .cv-tech-cell {
    font-size: 8.2pt;
  }

  .cv-technology-grid {
    grid-template-columns: 34mm minmax(0, 1fr);
  }
}
