/* ==========================================================
   CSS Custom Properties (Variables) — Color Schemes
   ========================================================== */
:root {
  /* Light theme (default) */
  --color-primary: #1a2a4a;
  --color-primary-light: #2c4a7a;
  --color-accent: #c8a84e;
  --color-accent-light: #e0c878;
  --color-bg: #f8f9fb;
  --color-bg-alt: #eef1f5;
  --color-card-bg: #ffffff;
  --color-text: #2c3e50;
  --color-text-light: #6c7a8a;
  --color-border: #dce1e8;
  --color-shadow: rgba(26, 42, 74, 0.08);
  --color-shadow-hover: rgba(26, 42, 74, 0.16);
  --color-success: #27ae60;
  --header-bg: rgba(255, 255, 255, 0.95);
  --header-shadow: 0 2px 20px rgba(26, 42, 74, 0.08);
  --footer-bg: #1a2a4a;
  --footer-text: #eef1f5;
  --timeline-line: var(--color-accent);
  --skill-bar-bg: #dce1e8;
  --skill-fill-bg: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

/* Dark theme */
[data-theme="dark"] {
  --color-primary: #e0e6f0;
  --color-primary-light: #b0c4e0;
  --color-accent: #e0c878;
  --color-accent-light: #f0d890;
  --color-bg: #121620;
  --color-bg-alt: #1a2030;
  --color-card-bg: #1e2638;
  --color-text: #e0e6f0;
  --color-text-light: #a0aaba;
  --color-border: #2a3450;
  --color-shadow: rgba(0, 0, 0, 0.3);
  --color-shadow-hover: rgba(0, 0, 0, 0.5);
  --header-bg: rgba(18, 22, 32, 0.95);
  --header-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  --footer-bg: #0a0e16;
  --footer-text: #c0c8d8;
  --timeline-line: var(--color-accent);
  --skill-bar-bg: #2a3450;
  --skill-fill-bg: linear-gradient(90deg, var(--color-accent), var(--color-primary-light));
}

/* Auto dark mode based on system preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --color-primary: #e0e6f0;
    --color-primary-light: #b0c4e0;
    --color-accent: #e0c878;
    --color-accent-light: #f0d890;
    --color-bg: #121620;
    --color-bg-alt: #1a2030;
    --color-card-bg: #1e2638;
    --color-text: #e0e6f0;
    --color-text-light: #a0aaba;
    --color-border: #2a3450;
    --color-shadow: rgba(0, 0, 0, 0.3);
    --color-shadow-hover: rgba(0, 0, 0, 0.5);
    --header-bg: rgba(18, 22, 32, 0.95);
    --header-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    --footer-bg: #0a0e16;
    --footer-text: #c0c8d8;
    --timeline-line: var(--color-accent);
    --skill-bar-bg: #2a3450;
    --skill-fill-bg: linear-gradient(90deg, var(--color-accent), var(--color-primary-light));
  }
}

/* ==========================================================
   Reset & Base
   ========================================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Base heading styles */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-primary);
  transition: color 0.3s ease;
}

/* Base button reset */
button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* Base paragraph spacing */
p {
  margin-bottom: 0.5rem;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary-light);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-accent);
}

ul {
  list-style: none;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================
   Container
   ========================================================== */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================
   Section
   ========================================================== */
.section {
  padding: 80px 0;
}

.section__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 48px;
  position: relative;
  display: inline-block;
  transition: color 0.3s ease;
}

.section__title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
}

/* ==========================================================
   Header
   ========================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--header-shadow);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.header__name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.3;
  transition: color 0.3s ease;
}

.header__title {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-top: 2px;
}

.header__meta {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-top: 4px;
}

.header__meta-item i {
  margin-right: 4px;
  color: var(--color-accent);
}

/* Navigation */
.header__nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-list__link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  padding: 4px 0;
  position: relative;
  transition: color 0.2s ease;
}

.nav-list__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.3s ease;
}

.nav-list__link:hover::after,
.nav-list__link:focus-visible::after {
  width: 100%;
}

/* Burger (mobile) */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.burger__line {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.burger.active .burger__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger.active .burger__line:nth-child(2) {
  opacity: 0;
}

.burger.active .burger__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================
   About Section
   ========================================================== */
.about__inner {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
}

.about__figure {
  text-align: center;
}

.about__photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 24px var(--color-shadow);
  border: 4px solid var(--color-accent);
  outline: 2px solid var(--color-card-bg);
  outline-offset: -6px;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease, filter 0.4s ease;
  /* Улучшенное сглаживание для WebP/PNG */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
}

.about__photo:hover {
  transform: scale(1.08) rotate(2deg);
  box-shadow: 0 12px 48px var(--color-shadow-hover);
  border-color: var(--color-accent-light);
  filter: brightness(1.05);
}

.about__photo:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 4px;
}

.about__caption {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.about__text {
  margin-bottom: 16px;
  font-size: 1rem;
  line-height: 1.7;
}

.about__details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.about__details li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.about__details li i {
  width: 20px;
  color: var(--color-accent);
  text-align: center;
}

.about__details li span {
  font-weight: 500;
}

/* ==========================================================
   Education Section (Cards)
   ========================================================== */
.education {
  background-color: var(--color-bg-alt);
  transition: background-color 0.3s ease;
}

.education__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.edu-card {
  background: var(--color-card-bg);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 2px 12px var(--color-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.edu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px var(--color-shadow-hover);
}

.edu-card__icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  background: var(--color-bg-alt);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--color-accent);
  transition: background 0.3s ease;
}

.edu-card__body {
  flex: 1;
}

.edu-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.edu-card__institution {
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.edu-card__faculty,
.edu-card__specialty {
  font-size: 0.88rem;
  color: var(--color-text-light);
  margin-bottom: 2px;
}

.edu-card__years {
  font-size: 0.82rem;
  color: var(--color-accent);
  font-weight: 500;
  margin-top: 8px;
}

/* ==========================================================
   Experience Section (Timeline)
   ========================================================== */
.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 16px;
  width: 3px;
  height: calc(100% - 16px);
  background: var(--timeline-line);
  border-radius: 2px;
  opacity: 0.4;
}

.timeline__item {
  position: relative;
  margin-bottom: 40px;
  padding-left: 20px;
}

.timeline__item:last-child {
  margin-bottom: 0;
}

.timeline__marker {
  position: absolute;
  left: -36px;
  top: 8px;
  width: 14px;
  height: 14px;
  background: var(--color-accent);
  border: 3px solid var(--color-card-bg);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--color-accent);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  z-index: 1;
}

.timeline__item:hover .timeline__marker {
  transform: scale(1.4);
  box-shadow: 0 0 0 6px var(--color-accent), 0 0 20px rgba(200, 168, 78, 0.3);
  background: var(--color-accent-light);
}

/* Pulse animation for timeline marker on hover */
.timeline__item:hover .timeline__marker::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  transform: translate(-50%, -50%) scale(1);
  animation: timelinePulse 1.2s ease-out infinite;
}

@keyframes timelinePulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.2);
    opacity: 0;
  }
}

.timeline__content {
  background: var(--color-card-bg);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: 0 2px 12px var(--color-shadow);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease, background 0.3s ease;
}

.timeline__item:hover .timeline__content {
  transform: translateX(8px) translateY(-4px);
  box-shadow: 0 12px 40px var(--color-shadow-hover);
}

/* Highlight the timeline line near the hovered item */
.timeline__item:hover ~ .timeline__item .timeline__marker {
  /* subtle effect on subsequent items */
}

.timeline__item:hover .timeline__duties li {
  color: var(--color-primary);
  transition: color 0.3s ease;
}

.timeline__period {
  margin-bottom: 8px;
}

.timeline__date {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-bg-alt);
  padding: 4px 14px;
  border-radius: 20px;
  transition: background 0.3s ease;
}

.timeline__position {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 4px;
  transition: color 0.3s ease;
}

.timeline__place {
  font-size: 0.95rem;
  color: var(--color-text-light);
  margin-bottom: 12px;
}

.timeline__duties {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline__duties li {
  position: relative;
  padding-left: 20px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text);
}

.timeline__duties li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: 600;
}

/* ==========================================================
   Skills Section
   ========================================================== */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

.skill-category {
  background: var(--color-card-bg);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 2px 12px var(--color-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.skill-category:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px var(--color-shadow-hover);
}

.skill-category__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.3s ease;
}

.skill-category__title i {
  color: var(--color-accent);
  font-size: 1.1rem;
}

.skill-category__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skill-category__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-category__name {
  font-size: 0.88rem;
  font-weight: 500;
}

.skill-category__bar {
  height: 8px;
  background: var(--skill-bar-bg);
  border-radius: 4px;
  overflow: hidden;
}

.skill-category__fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--skill-fill-bg);
  transition: width 0.8s ease;
  width: 0;
}

/* Stagger animation for skill bars within a category */
.skill-category__item:nth-child(1) .skill-category__fill { transition-delay: 0s; }
.skill-category__item:nth-child(2) .skill-category__fill { transition-delay: 0.1s; }
.skill-category__item:nth-child(3) .skill-category__fill { transition-delay: 0.2s; }
.skill-category__item:nth-child(4) .skill-category__fill { transition-delay: 0.3s; }

.skill-category__fill.animated {
  /* width set inline via style attribute, animated class triggers transition */
}

/* ==========================================================
   Hobbies Section
   ========================================================== */
.hobbies {
  background-color: var(--color-bg-alt);
  transition: background-color 0.3s ease;
}

.hobbies__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.hobby-card {
  background: var(--color-card-bg);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 2px 12px var(--color-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.hobby-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 48px var(--color-shadow-hover);
}

.hobby-card__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--color-bg-alt);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--color-accent);
  transition: transform 0.4s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.hobby-card:hover .hobby-card__icon {
  transform: scale(1.15) rotate(-8deg);
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(200, 168, 78, 0.4);
}

.hobby-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.hobby-card:hover .hobby-card__title {
  color: var(--color-accent);
}

.hobby-card__text {
  font-size: 0.88rem;
  color: var(--color-text-light);
  line-height: 1.6;
}

/* ==========================================================
   Footer
   ========================================================== */
.footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 32px 0;
  position: relative;
  transition: background 0.3s ease, color 0.3s ease;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer__copyright {
  font-size: 0.88rem;
}

.footer__source {
  font-size: 0.82rem;
  opacity: 0.7;
}

.footer__social {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer__social-text {
  font-size: 0.82rem;
  opacity: 0.7;
}

.footer__social-link {
  color: var(--footer-text);
  font-size: 1.2rem;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.footer__social-link:hover {
  opacity: 1;
  transform: scale(1.15);
  color: var(--color-accent);
}

/* ==========================================================
   Scroll to Top Button
   ========================================================== */
.scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(200, 168, 78, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, background 0.3s ease;
  z-index: 999;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--color-accent-light);
  transform: translateY(-2px);
}

/* ==========================================================
   Theme Toggle Button (will be added by JS)
   ========================================================== */
.theme-toggle {
  background: none;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text);
  font-size: 1rem;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  margin-left: 16px;
}

.theme-toggle:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ==========================================================
   Animations — Scroll Reveal
   ========================================================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================
   Print Styles
   ========================================================== */
@media print {
  .header {
    position: static;
    backdrop-filter: none;
    box-shadow: none;
  }

  .header__nav,
  .burger,
  .scroll-top,
  .theme-toggle {
    display: none !important;
  }

  .section {
    padding: 40px 0;
    page-break-inside: avoid;
  }

  .edu-card,
  .timeline__content,
  .skill-category,
  .hobby-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .timeline::before {
    display: none;
  }

  .timeline__marker {
    display: none;
  }

  .timeline__item {
    padding-left: 0;
  }

  .about__photo {
    box-shadow: none;
    border: 2px solid #999;
    border-radius: 50%;
    outline: none;
  }

  .footer {
    background: #f0f0f0 !important;
    color: #333 !important;
  }

  .section__title::after {
    background: #333;
  }
}

/* ==========================================================
   Responsive — Desktop (≥1024px) — full layout
   Навигация горизонтальная, полноценный макет.
   Стили по умолчанию уже рассчитаны на desktop.
   ========================================================== */
/* Убедимся, что на desktop навигация всегда горизонтальная */
@media (min-width: 1024px) {
  .nav-list {
    display: flex !important;
    flex-direction: row;
    gap: 24px;
  }

  .burger {
    display: none !important;
  }

  .header__inner {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }
}

/* ==========================================================
   Responsive — Tablet (768px – 1023px)
   2 колонки, уменьшенные отступы, бургер-меню
   ========================================================== */
@media (max-width: 1023px) {
  .container {
    padding: 0 20px;
  }

  .section {
    padding: 60px 0;
  }

  .section__title {
    font-size: 1.75rem;
    margin-bottom: 36px;
  }

  /* Header — вертикальное расположение с бургером */
  .header__inner {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .header__nav {
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }

  .nav-list {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding: 12px 0;
  }

  .nav-list.open {
    display: flex;
  }

  .nav-list__item {
    width: 100%;
  }

  .nav-list__link {
    display: block;
    padding: 12px 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--color-border);
    min-height: 44px;
  }

  .burger {
    display: flex;
  }

  /* About — 1 колонка центром */
  .about__inner {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
  }

  .about__figure {
    justify-self: center;
  }

  .about__photo {
    width: 180px;
    height: 180px;
  }

  .about__details {
    align-items: center;
  }

  /* Education — 2 колонки */
  .education__cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .edu-card {
    padding: 24px 20px;
    gap: 16px;
  }

  .edu-card__icon {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }

  /* Timeline — уменьшенные отступы */
  .timeline {
    padding-left: 32px;
  }

  .timeline::before {
    left: 12px;
  }

  .timeline__marker {
    left: -30px;
    width: 12px;
    height: 12px;
  }

  .timeline__content {
    padding: 22px 24px;
  }

  .timeline__item {
    margin-bottom: 28px;
  }

  /* Skills — 2 колонки */
  .skills__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .skill-category {
    padding: 24px 20px;
  }

  /* Hobbies — 2 колонки */
  .hobbies__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .hobby-card {
    padding: 24px 20px;
  }

  .hobby-card__icon {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
  }

  /* Footer */
  .footer__inner {
    flex-wrap: wrap;
    gap: 12px;
  }

  .theme-toggle {
    margin-left: 12px;
  }
}

/* ==========================================================
   Responsive — Mobile (320px – 767px)
   1 колонка, бургер-меню, крупные элементы
   ========================================================== */
@media (max-width: 767px) {
  .container {
    padding: 0 16px;
  }

  .section {
    padding: 40px 0;
  }

  .section__title {
    font-size: 1.4rem;
    margin-bottom: 28px;
  }

  .section__title::after {
    width: 48px;
  }

  /* Header */
  .header__name {
    font-size: 1.05rem;
  }

  .header__title {
    font-size: 0.78rem;
  }

  .header__meta {
    font-size: 0.75rem;
  }

  .header__inner {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  /* Крупные элементы навигации */
  .nav-list__link {
    padding: 14px 0;
    font-size: 1.05rem;
    min-height: 48px;
  }

  .burger {
    padding: 10px;
  }

  .burger__line {
    width: 28px;
    height: 3px;
  }

  /* About */
  .about__inner {
    gap: 24px;
  }

  .about__photo {
    width: 170px;
    height: 170px;
  }

  .about__text {
    font-size: 0.95rem;
  }

  .about__details li {
    font-size: 0.9rem;
  }

  /* Education — 1 колонка */
  .education__cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .edu-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 18px;
  }

  .edu-card__title {
    font-size: 1rem;
  }

  .edu-card__institution {
    font-size: 0.9rem;
  }

  /* Timeline */
  .timeline {
    padding-left: 20px;
  }

  .timeline::before {
    left: 6px;
  }

  .timeline__marker {
    left: -20px;
    width: 10px;
    height: 10px;
  }

  .timeline__content {
    padding: 18px 16px;
  }

  .timeline__item {
    margin-bottom: 24px;
    padding-left: 16px;
  }

  .timeline__position {
    font-size: 1rem;
  }

  .timeline__duties li {
    font-size: 0.85rem;
  }

  /* Skills — 1 колонка */
  .skills__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .skill-category {
    padding: 22px 18px;
  }

  .skill-category__name {
    font-size: 0.85rem;
  }

  /* Hobbies — 1 колонка */
  .hobbies__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hobby-card {
    padding: 24px 18px;
  }

  .hobby-card__icon {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
  }

  /* Footer */
  .footer__inner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .footer__social {
    justify-content: center;
  }

  /* Scroll to top — крупнее */
  .scroll-top {
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
  }

  /* Theme toggle – компактнее */
  .theme-toggle {
    width: 36px;
    height: 36px;
    margin-left: 10px;
    font-size: 0.9rem;
  }
}

/* ==========================================================
   Responsive — Extra Small (320px)
   Минимальная ширина, максимальная компактность
   ========================================================== */
@media (max-width: 360px) {
  .container {
    padding: 0 12px;
  }

  .section {
    padding: 32px 0;
  }

  .section__title {
    font-size: 1.25rem;
  }

  .about__photo {
    width: 120px;
    height: 120px;
  }

  .header__name {
    font-size: 0.95rem;
  }

  .edu-card {
    padding: 20px 14px;
  }

  .hobby-card {
    padding: 20px 14px;
  }

  .timeline__content {
    padding: 14px 12px;
  }

  .scroll-top {
    bottom: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    font-size: 0.95rem;
  }
}

/* ==========================================================
   Responsive — Small Mobile (361px – 480px)
   ========================================================== */
@media (min-width: 361px) and (max-width: 480px) {
  .about__photo {
    width: 140px;
    height: 140px;
  }
}
