:root {
  /* 🎨 Цветовые переменные светлой темы */
  --bg-color: #f4f6f8;
  --section-bg: #fff;
  --button-bg: #fff;
  --button-color: #121212;
  --accent-color: #0077b6;
  --text-color: #333;

  /* 💨 Универсальный переход */
  --transition: 0.3s ease;

  --shadow-hover: 0 0 10px rgba(0, 0, 0, 0.4);

  --card-bg-light: #fff;
}

body.dark-theme {
  /* 🎨 Цветовые переменные для тёмной темы */
  --bg-color: #121212;
  --section-bg: #1e1e1e;
  --button-bg: #333;
  --button-color: #f4f6f8;
  --accent-color: #0a84ff;
  --text-color: #e0e0e0;

  --shadow-hover: 0 0 10px rgba(255, 255, 255, 0.6);

  --card-bg-light: #262626;
}

body {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  margin: 0;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

.container {
  max-width: 900px;
  margin: 2.5rem auto;
  background: var(--section-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

/* --- Header --- */
header {
  background: var(--accent-color);
  color: #fff;
  padding: 2rem;
  display: flex;
  justify-content: center;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  max-width: 800px;
}

.profile-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
  object-position: center;
  flex-shrink: 0;
  background-color: #ddd;
}

.header-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  max-width: 600px;
}

header h1 {
  margin: 0;
  font-size: 2rem;
}

header p {
  font-size: 1.125rem;
  margin: 0;
}

.contacts {
  margin-top: 10px;
}

.contacts a {
  color: #fff;
  text-decoration: underline;
}

.contacts a[href$=".pdf"] {
  text-decoration: underline dotted currentColor;
  text-underline-offset: 4px;
  /* отступ линии от текста */
  font-weight: 600;
}

.contacts a[href$=".pdf"]:hover {
  text-decoration-style: solid;
}

.profession {
  font-size: 1.5em;
}

/* --- Общие стили кнопок --- */
button {
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

/* --- Кнопка переключения темы --- */
#theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--button-bg);
  color: var(--button-color);
  border: 1px solid var(--button-color);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  z-index: 1000;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

#theme-toggle:hover {
  transform: scale(1.05);
  background: var(--button-color);
  color: var(--button-bg);
}

/* Анимация вращения при смене темы */
#theme-toggle.animate {
  animation: spin 0.6s ease;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* --- Основная часть --- */
main {
  padding: 2rem;
}

section {
  margin-bottom: 2rem;
}

section h2 {
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 0.4rem;
  color: var(--accent-color);
  font-size: 1.375rem;
  margin-bottom: 1rem;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  text-decoration: underline;
}

ul {
  list-style: none;
  padding-left: 0;
}

ul li {
  margin-bottom: 0.625rem;
}

/* Навыки */
.skills span {
  display: inline-block;
  background: rgba(0, 0, 0, 0.05);
  color: var(--accent-color);
  padding: 4px 10px;
  border-radius: 4px;
  margin: 3px;
  font-size: 0.875rem;
  transition: background var(--transition);
}

body.dark-theme .skills span {
  background: #2d2d2d;
}

/* --- Проекты --- */
.project {
  margin-bottom: 1rem;
}

.project h3 {
  margin: 0;
  font-size: 1.125rem;
  color: var(--accent-color);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  align-items: stretch;
  /* все карточки одинаковой высоты в ряду */
}

.project-card {
  display: flex;
  /* делаем карточку флекс-контейнером */
  flex-direction: column;
  /* элементы вертикально */
  justify-content: flex-start;
  background: var(--card-bg-light);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 0.8rem 1.5rem 1.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

/* Эмодзи */
.project-card .emoji {
  font-size: clamp(3.5rem, 6vw, 4.5rem);
  margin-bottom: 1rem;
  transition: transform 0.4s ease;
}

/* Название проекта */
.project-card h3 {
  margin: 0 0 0.5rem;
  color: var(--accent-color);
  font-size: 1.125rem;
  line-height: 1.3;
  min-height: 3.6em;
  /* удерживает высоту под 2 строки названия */
}

/* Краткое описание */
.project-card p {
  font-size: 0.95rem;
  line-height: 1.4;
  margin: 0 0 1rem;
  flex-grow: 0;
  min-height: 3.6em;
  /* одинаковая высота блока описания (≈2 строки) */
}

/* Ссылка снизу */
.project-card a {
  margin-top: auto;
  /* "прилипает" к нижнему краю карточки */
  display: inline-block;
  align-self: center;
  color: var(--accent-color);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s ease;
}

.project-card a:hover {
  text-decoration: underline;
}

/* --- Footer --- */
footer {
  background: var(--accent-color);
  padding: 1rem 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: #fff;
  /* 💡 повышен контраст */
}

/* Кнопка "Наверх" */
footer button.to-top {
  background: var(--card-bg-light);
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  border-radius: 5px;
  padding: 0.5rem 1rem;
  margin-top: 10px;
  margin-bottom: 10px;
}

footer button.to-top:hover {
  box-shadow: var(--shadow-hover);
}

/* при нажатии (тапе) – убираем тень */
footer button.to-top:active,
footer button.to-top:focus {
  box-shadow: none;
  outline: none;
  /* можно убрать контур, если не нужен */
}

/* Для тёмной темы */
.dark-theme .to-top {
  color: #fff;
  /* белый текст на кнопке */
}

/* --- Разделитель --- */
.divider {
  display: inline-block;
}

/* --- Достижения --- */
.job-details {
  margin-top: 0.8rem;
  margin-bottom: 1rem;
  padding-left: 1.2rem;
  list-style: none;
}

.job-details li {
  position: relative;
  margin: 0.4rem 0;
  padding-left: 0.25rem;
  font-size: 0.95rem;
  color: var(--text-color);
  line-height: 1.4;
}

.job-details li::before {
  /*content: "⭐";*/
  position: absolute;
  left: -1.2rem;
  color: var(--accent-color);
  font-size: 1rem;
}

.dark-theme .job-details li::before {
  color: var(--accent-color);
}

section ul > li {
  margin-top: 1.5rem;
}

/* --- Мобильная адаптация --- */
@media screen and (max-width: 600px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }

  .profile-photo {
    margin-bottom: 10px;
  }

  /* ⛔ Скрываем разделители наверняка */
  .divider {
    display: none !important;
    visibility: hidden !important;
    content: none !important;
  }

  /* Добавляем отступ снизу под ФИО */
  .header-text h1 {
    margin-bottom: 1rem;
    /* 👉 можно увеличить до 1.5‑2rem при необходимости */

    white-space: nowrap;
    /* не переносить текст */
    font-size: clamp(1rem, 10vw, 1.5rem);
    /* автоматически подстраивать размер */
  }

  /* Контакты вертикально */
  .contacts {
    display: block;
    text-align: center;
    line-height: 1.4;
  }

  .contacts span {
    display: block;
    margin: 6px 0;
  }

  br.mobile-hide {
    display: none;
  }

  .footer-text span {
    display: block;
  }
}

@media (hover: none) and (pointer: coarse) {

  /* ⚙️ Отключаем hover‑эффекты */
  .project-card {
    transform: none !important;
    transition: none !important;
  }

  /* 💫 Лёгкий отклик при тапе */
  .project-card:active {
    transform: scale(0.98);
  }

  /* Немного визуального отклика */
  body:not(.dark-theme) .project-card:active {
    background: rgba(0, 0, 0, 0.05);
  }

  body.dark-theme .project-card:active {
    background: rgba(255, 255, 255, 0.05);
  }

  /* 🔗 Ссылка растянута на всю карточку и прозрачна */
  .project-card a {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: block;
    background: transparent;
    color: transparent;
    /* делает текст невидимым */
    text-decoration: none;
    font-size: 0;
    /* предотвращает вывод текста */
    line-height: 0;
  }

  /* Убираем возможное подчёркивание */
  .project-card a:hover,
  .project-card a:active {
    text-decoration: none;
  }

  /* Весь видимый контент поверх ссылки (чтобы его видно было) */
  .project-card .emoji,
  .project-card h3,
  .project-card p {
    position: relative;
    z-index: 10;
  }
}