/* Base styles */
:root {
  --primary-color: #2b5797;
  --secondary-color: #4a90e2;
  --third-color: #8a9ba8;
  --highlight-color: #d3e5fc;
  --text-color: #2c3e50;
  --light-gray: #f5f6fa;
  --border-color: #cfdce8;
  --spacing-unit: 1rem;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-gray);
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 var(--spacing-unit);
}

/* CV Section */
.cv {
  position: relative;
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 2.5rem;
  margin-bottom: 1rem;
}

/* Header */
.cv-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.3rem;
}

.cv-header h1 {
  font-size: 2rem;
  color: var(--primary-color);
  margin: 0 0 0.75rem 0;
  font-weight: 750;
}

.contact-info {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  color: var(--text-color);
  font-size: 0.8rem;
}

.contact-info a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
  word-break: break-all;
}

.contact-info a:hover {
  color: var(--secondary-color);
}

.separator {
  font-size: 0.75rem;
  margin-inline: 0.35rem;
  color: var(--border-color);
}

.telegram-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.telegram-icon {
  vertical-align: middle;
}

/* Section styles */
.cv-section {
  margin-bottom: 2rem;
}

.cv-section:last-of-type {
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  font-weight: 800;
  position: relative;
  padding-bottom: 0.5rem;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background-color: var(--primary-color);
}

/* Experience section */
.experience-item {
  margin-bottom: 1.25rem;
}

.experience-item:last-child {
  margin-bottom: 0;
}

.experience-header,
.education-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.25rem;
}

.minor-role .experience-header {
  border-bottom: none;
}

.minor-role .position {
  font-size: 0.8rem;
}

.minor-role .company-name {
  font-size: 0.9rem;
}

.minor-role .country-tag {
  margin-left: 0.05rem;
  margin-right: 0.2rem;
  letter-spacing: 0.2px;
}

.company-name {
  font-size: 1rem;
  color: var(--secondary-color);
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
}

.country-tag {
  font-size: 0.4rem;
  background-color: rgba(43, 87, 151, 0.1);
  padding: 0.075rem 0.2rem;
  border-radius: 0.2rem;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  align-self: center;
  margin-left: 0.2rem;
  margin-right: 0.5rem;
}

.education-item {
  margin-bottom: 1.25rem;
}

.education-item:last-child {
  margin-bottom: 0;
}

.position {
  font-size: 0.75rem;
  color: var(--secondary-color);
  font-weight: 500;
  margin-left: 0;
  display: inline;
}

.duration {
  color: var(--text-color);
  font-size: 0.7rem;
  white-space: nowrap;
  align-self: baseline;
  padding-top: 5px;
}

/* Lists */
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.achievements li {
  position: relative;
  margin-left: 0.5rem;
  padding-left: 1rem;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.achievements li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: 600;
}

/* Skills section */
.skills-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.skill-group h3 {
  font-size: 1rem;
  color: var(--secondary-color);
  font-weight: 500;
  margin: 0 0 0.75rem 0;
}

.skills-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  justify-content: start;
}

.skills-list li {
  padding: 0.4rem;
  padding-right: 0.75rem;
  background-color: var(--light-gray);
  border-radius: 0.4rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.github-container {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.github-link {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  background-color: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 0.35rem;
  transition: all 0.2s ease;
  font-size: 0.75rem;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(43, 87, 151, 0.2);
}

.github-link:hover {
  background-color: var(--secondary-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(43, 87, 151, 0.3);
}

.highlight {
  background-color: var(--highlight-color);
  padding: 0.25rem;
  border-radius: 0.4rem;
  font-size: inherit;
}

/* Minor role and skills styling */
.minor-role {
  opacity: 0.85;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.6rem;
  margin: 1rem 0;
  padding: 0.6rem;
  background-color: var(--light-gray);
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
}

.minor-role .experience-item {
  margin-bottom: 0.2rem;
}

.minor-description {
  font-size: 0.75rem;
  color: var(--text-color);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.updated-at {
  text-align: center;
  font-size: 0.75rem;
  color: var(--third-color);
  margin-top: 2rem;
}

/* Locale Toggle */
.locale-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.9rem;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.locale-toggle:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 4px rgba(43, 87, 151, 0.15);
}

.locale-toggle .flag-icon {
  width: 1.5rem;
  height: 1rem;
  border-radius: 2px;
  flex-shrink: 0;
  display: block;
  border: 1px solid var(--border-color);
}

.locale-toggle .locale-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-color);
}

/* Mobile-first responsive design */
@media screen and (max-width: 480px) {
  .container {
    margin: 1rem auto;
    padding: 0 0.5rem;
  }

  .cv {
    padding: 1rem;
    border-radius: 12px;
  }

  .cv-header h1 {
    font-size: 1.25rem;
  }

  .contact-info {
    font-size: 0.7rem;
    flex-direction: column;
  }

  .section-title {
    font-size: 1.2rem;
  }

  .experience-header,
  .education-header {
    gap: 0.1rem;
  }

  .company-name {
    font-size: 0.8rem;
    gap: 0.1rem;
  }

  .country-tag {
    margin-left: 0.075rem;
    margin-right: 0.15rem;
  }

  .position {
    font-size: 0.65rem;
  }

  .duration {
    font-size: 0.5rem;
  }

  .achievements li {
    font-size: 0.6rem;
    margin-left: 0.25rem;
    padding-left: 0.65rem;
    margin-bottom: 0.1rem;
  }

  .skill-group h3 {
    font-size: 0.85rem;
  }

  .skills-list li {
    font-size: 0.6rem;
    padding: 0.3rem;
    margin-bottom: 0.1rem;
  }

  .github-container {
    margin-top: 0.9rem;
  }

  .github-link {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
  }

  .minor-role {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding: 0.4rem;
    margin: 0.6rem 0;
  }

  .minor-role .experience-header {
    margin-bottom: 0.08rem;
  }

  .minor-role .experience-item {
    margin-bottom: 0.15rem;
    padding-bottom: 0;
  }

  .minor-role .company-name {
    font-size: 0.65rem;
    gap: 0.15rem;
  }

  .minor-role .position {
    font-size: 0.6rem;
    margin-left: 0.1rem;
  }

  .minor-description {
    font-size: 0.5rem;
    margin-top: 0.1rem;
  }

  .country-tag {
    font-size: 0.45rem;
    padding: 0.05rem 0.15rem;
  }

  .updated-at {
    font-size: 0.6rem;
  }

  .locale-toggle {
    padding: 0.4rem 0.6rem;
    gap: 0.4rem;
  }

  .locale-toggle .flag-icon {
    width: 1rem;
    height: 0.7rem;
    border: 1px solid var(--border-color);
  }

  .locale-toggle .locale-text {
    font-size: 0.65rem;
  }
}