/* ---------- Базовые настройки ---------- */
:root {
  /* Тёмная тема (по умолчанию) */
  --bg: #0f172a;
  --bg-alt: #111c33;
  --surface: #1e293b;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-dark: #0ea5e9;
  --border: rgba(148, 163, 184, .15);
  --header-bg: rgba(15, 23, 42, .85);

  --radius: 14px;
  --container: 1100px;
  --transition: .25s ease;
}

/* Светлая тема */
[data-theme="light"] {
  --bg: #f8fafc;
  --bg-alt: #eef2f7;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --accent: #0284c7;
  --accent-dark: #0369a1;
  --border: rgba(15, 23, 42, .1);
  --header-bg: rgba(248, 250, 252, .85);
}

* {
  box-sizing: border-box;
}

body,
.header,
.card,
.section--alt,
.contacts__item,
.skills li,
.footer {
  transition: background-color var(--transition),
    color var(--transition),
    border-color var(--transition);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  border-radius: 25px;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Шапка ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header {}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent);
}

.nav__list {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  color: var(--text-muted);
  font-size: .95rem;
  transition: color var(--transition);
}

.nav__link:hover {
  color: var(--accent);
}

/* Бургер (по умолчанию скрыт) */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}

.burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform var(--transition), opacity var(--transition);
}

/* ---------- Девиз ---------- */
.tagline {
  padding: 28px 0;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.tagline__text {
  max-width: 760px;
  margin: 0 auto;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  /* чуть крупнее для заголовка */
  /*font-weight: 600;*/
  line-height: 1.45;
  color: var(--text);
  letter-spacing: .01em;
  position: relative;
  padding: 0 8px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 40px 0 40px;
}

.hero__inner {
  /*display: flex;*/
  align-items: center;
  gap: 48px;
}

.hero__text {
  flex: 1;
}

.hero__greeting {
  color: var(--accent);
  letter-spacing: .05em;
  text-transform: uppercase;
  font-size: .85rem;
  margin: 0 0 12px;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 2rem);
  line-height: 1.15;
  margin: 12px 0 12px;
}

.hero__subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin: 0 0 20px;
}

.hero__desc {
  max-width: 560px;
  color: var(--text-muted);
  margin: 0 0 28px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero__photo {
  flex-shrink: 0;
  width: 320px;
}

.hero__photo img {
  width: 100%;
  border-radius: 50px;
  border: 4px solid var(--surface);
  box-shadow: 0 20px 50px rgba(56, 189, 248, .25);
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  transition: background var(--transition), transform var(--transition),
    color var(--transition);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

[data-theme="light"] .btn--primary {
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-dark);
}

.btn--ghost {
  border: 1px solid rgba(148, 163, 184, .4);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}


/* ---------- Работы ---------- */
.work {
  display: inline-block;
  width: 100%;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  transition: background var(--transition), transform var(--transition),
    color var(--transition);
}

.work:active {
  transform: translateY(1px);
}

.work--primary {
  background: var(--accent);
  color: #fff;
}

[data-theme="light"] .work--primary {
  color: #fff;
}

.work--primary:hover {
  background: var(--accent-dark);
}

.work--ghost {
  border: 1px solid rgba(148, 163, 184, .4);
  color: var(--text);
}

.work--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Секции ---------- */
.section {
  padding: 30px 0;
}

.section--alt {
  background: var(--bg-alt);
}

.section__title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  margin: 0 0 32px;
  position: relative;
  padding-bottom: 12px;
}

.section__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
}

/* ---------- Обо мне ---------- */
.about p {
  color: var(--text-muted);
  /*max-width: 720px;*/
  margin: 0 0 24px;
  text-align: justify;
}

.skills {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skills li {
  background: var(--surface);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .85rem;
  color: var(--text);
}

/* ---------- Карточки ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 26px 22px;
  border: 1px solid rgba(148, 163, 184, .12);
  transition: transform var(--transition), border-color var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.card__title {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: .95rem;
}

.card__thumb {
  height: 150px;
  border-radius: 10px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #1e293b, #0ea5e9);
  opacity: .7;
}

/* ---------- Контакты ---------- */
.contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.contacts__item {
  background: var(--surface);
  padding: 14px 22px;
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, .15);
  transition: border-color var(--transition), color var(--transition);
}

.contacts__item:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Подвал ---------- */
.footer {
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: .875rem;
  border-top: 1px solid rgba(148, 163, 184, .12);
}

/* ---------- Адаптивность ---------- */
@media (max-width: 900px) {
  .hero__inner {
    flex-direction: column-reverse;
    text-align: center;
  }

  .hero__desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__photo {
    width: 220px;
  }

  .hero {
    padding: 40px 0 40px;
  }

  .section {
    padding: 30px 0;
  }

  .section__title::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .section__title {
    text-align: center;
  }
}

@media (max-width: 640px) {

  /* Мобильное меню */
  .burger {
    display: flex;
  }

  .nav {
    position: fixed;
    inset: 32px 0 auto 0;
    background: var(--bg-alt);
    border-bottom: 1px solid rgba(148, 163, 184, .15);
    transform: translateY(-120%);
    transition: transform var(--transition);
    padding: 20px;
  }

  .nav.is-open {
    transform: translateY(0);
    inset: 64px 0 auto 0;
  }

  .nav__list {
    flex-direction: column;
    gap: 4px;
  }

  .nav__link {
    display: block;
    padding: 12px 8px;
    font-size: 1.05rem;
  }

  /* Бургер в крестик */
  .burger.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

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

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

  .hero__title {
    font-size: 1.2rem;
  }

  .hero__photo {
    width: 180px;
  }

  .card {
    padding: 20px 18px;
  }

  .contacts {
    flex-direction: column;
  }

  .contacts__item {
    text-align: center;
  }
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition),
    color var(--transition), transform var(--transition);
}

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

.theme-toggle:active {
  transform: scale(.95);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* По умолчанию (тёмная тема) показываем солнце, скрываем луну */
.theme-toggle__icon--moon {
  display: none;
}

/* В светлой теме — наоборот */
[data-theme="light"] .theme-toggle__icon--sun {
  display: none;
}

[data-theme="light"] .theme-toggle__icon--moon {
  display: block;
}

/* ---------- Анимация появления ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  opacity: 0;
  /* стартовое состояние */
  animation: fadeInUp .8s ease-out .15s forwards;
  will-change: opacity, transform;
  /* подсказка браузеру для плавности */
}

/* Уважаем настройку «уменьшить движение» */
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

.my-pre-class {
  text-align: justify;
  white-space: break-spaces;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif
}