/* ==========================================================================
   Сергей Пересыпкин — сайт-визитка
   Основа — исходный макет (светлый фон, крупная типографика, индиго-акцент).
   Здесь исправлены контраст, адаптив и поведение слайдера, добавлены
   состояния наведения/фокуса. Без фреймворков и сборки.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #efefef;
  --ink: #0b0b0d;
  --ink-soft: #2c2c33;
  --muted: #5b5b66;
  --accent: #6366f1;
  --accent-dark: #4f46e5;
  --card: #ffffff;
  --line: #dcdce4;
  --radius: 24px;
  --shadow-card: 0 8px 32px #d0d0ed;
  --shadow-photo: 0 20px 54px rgba(22, 22, 45, 0.16);
  --page-x: 5vw;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--ink);
  padding: 0 var(--page-x);
  overflow-x: clip;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main > section {
  max-width: 1440px;
  margin-inline: auto;
}

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

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

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: rgba(99, 102, 241, 0.18);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
  color: #fff;
}

/* ---------- Шапка ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(239, 239, 239, 0.86);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
  margin: 0 calc(var(--page-x) * -1);
  padding: 0 var(--page-x);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2vw;
  min-height: 68px;
  max-width: 1440px;
  margin-inline: auto;
}

.logo {
  font-size: clamp(17px, 1.5vw, 21px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--accent);
}

.nav-list {
  display: flex;
  gap: 1.8vw;
  list-style: none;
  margin-left: auto;
}

.nav-list a {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 0;
  position: relative;
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.nav-list a:hover {
  color: var(--ink);
}

.nav-list a:hover::after {
  transform: scaleX(1);
}

.nav-cta {
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.28);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.nav-cta:hover {
  background: var(--accent-dark);
  color: #fff;
  transform: translateY(-1px);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: 4vw;
  align-items: center;
  padding: clamp(40px, 7vh, 96px) 0 clamp(48px, 8vh, 104px);
}

.circle {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
}

.circle_1 {
  width: 520px;
  height: 520px;
  top: 0;
  left: -14vw;
  background: radial-gradient(circle, rgba(160, 160, 175, 0.5) 0%, rgba(239, 239, 239, 0) 70%);
}

.circle_2 {
  width: 420px;
  height: 420px;
  bottom: -12vh;
  right: -14vw;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, rgba(239, 239, 239, 0) 70%);
}

.hero-split,
.hero-right {
  position: relative;
  z-index: 1;
}

.hero__title {
  font-size: clamp(38px, 5.4vw, 68px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: 14px;
}

.hero__accent {
  color: var(--accent);
}

.hero__role {
  font-size: clamp(15px, 1.25vw, 18px);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
  margin-bottom: 26px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease,
    border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 26px rgba(99, 102, 241, 0.32);
}

.btn--primary:hover {
  background: var(--accent-dark);
  color: #fff;
  transform: translateY(-2px);
}

.btn--ghost {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}

.btn--ghost:hover {
  color: var(--ink);
  border-color: #b9b9c7;
  transform: translateY(-2px);
}

.hero__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  max-width: 520px;
}

.hero__facts dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.hero__facts dd {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
}

.hero__lead {
  font-size: clamp(20px, 1.9vw, 28px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink-soft);
}

.hero__blue {
  color: var(--accent);
}

.hero__note {
  margin-top: 20px;
  font-size: 15px;
  color: var(--muted);
  padding-left: 16px;
  border-left: 2px solid var(--accent);
}

/* ---------- Секции ---------- */

.section__h1 {
  font-size: clamp(28px, 3.4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
  margin-bottom: clamp(24px, 4vh, 48px);
}

/* ---------- Портфолио / слайдер ---------- */

.portfolio {
  padding: clamp(24px, 4vh, 48px) 0;
  scroll-margin-top: 84px;
}

.slider {
  --media-h: clamp(300px, 43vw, 640px);
  display: grid;
  grid-template-columns: minmax(0, 3.35fr) minmax(210px, 1fr);
  gap: 2vw;
  align-items: start;
}

.slider-stage {
  position: relative;
  height: var(--media-h);
  border-radius: 20px;
  overflow: hidden;
  background: #e2e2e8;
  box-shadow: var(--shadow-photo);
}

.slider-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(15, 15, 30, 0.08);
  pointer-events: none;
}

.slider-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: opacity 0.22s ease;
}

.slider-img.is-swapping {
  opacity: 0;
}

.slider-caption {
  margin-top: 18px;
  display: grid;
  gap: 10px;
  min-height: 148px;
}

.slider-caption__top {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.slider-caption h3 {
  font-size: clamp(19px, 1.7vw, 24px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.slider-caption__meta {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.slider-caption p {
  font-size: 15.5px;
  color: var(--muted);
  max-width: 74ch;
}

.slider-caption__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.slider-caption__stack li {
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.slider-caption__links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 15px;
  font-weight: 600;
}

.slider-caption__links a {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}

.slider-caption__links a:hover {
  border-bottom-color: currentColor;
}

/* Колонка миниатюр повторяет высоту большого превью:
   миниатюры делят её между собой, стрелки стоят справа по центру. */
.slider-right {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  height: var(--media-h);
  min-width: 0;
  max-width: 100%;
  min-height: 0;
}

.slider-right-imgs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  align-self: stretch;
}

.slider-thumb {
  padding: 0;
  border: 0;
  background: #e2e2e8;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  flex: 1 1 0;
  min-height: 0;
  filter: blur(1.1px) saturate(0.92);
  opacity: 0.82;
  transition: filter 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.slider-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.slider-thumb:hover {
  opacity: 0.92;
  filter: blur(0.6px);
}

.slider-thumb.is-current {
  filter: none;
  opacity: 1;
  box-shadow: 0 0 0 2px var(--accent), 0 8px 20px rgba(99, 102, 241, 0.25);
}

.slider-right-arrows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.slider-arrow {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.slider-arrow img {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.slider-arrow:last-child img {
  transform: rotate(180deg);
}

.slider-arrow:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
}

.slider-arrow:hover img {
  opacity: 1;
}

.slider-arrow:first-child:hover img {
  transform: translateY(-2px);
}

.slider-arrow:last-child:hover img {
  transform: rotate(180deg) translateY(-2px);
}

.slider-hint {
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--muted);
  text-align: center;
}

.slider-hint kbd {
  font-family: inherit;
  font-size: 12px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--card);
}

/* ---------- Опыт ---------- */

.experience {
  padding: clamp(36px, 6vh, 72px) 0 clamp(24px, 4vh, 48px);
  scroll-margin-top: 84px;
}

.experience-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2vw;
}

.experience-block {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: clamp(24px, 2.2vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 264px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.experience-block:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px #c7c7e4;
}

.experience-block h3 {
  font-size: clamp(21px, 1.9vw, 27px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.experience-block p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Обо мне ---------- */

.about-me {
  margin: clamp(24px, 5vh, 64px) 0;
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px #acacb0;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr);
  overflow: hidden;
  scroll-margin-top: 84px;
}

.about-me-block-1 {
  background-color: var(--accent);
  display: grid;
  place-items: center;
  padding: clamp(28px, 4vw, 48px);
  position: relative;
  overflow: hidden;
}

.about-me-block-1::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  right: -90px;
  bottom: -90px;
  background: rgba(255, 255, 255, 0.14);
}

.about-me-block-1 h2 {
  color: #fff;
  font-size: clamp(26px, 3vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
  position: relative;
  z-index: 1;
}

.about-me-block-2 {
  padding: clamp(26px, 3.6vw, 52px);
  display: grid;
  gap: 14px;
  align-content: center;
}

.about-me-block-2 p {
  font-size: clamp(15.5px, 1.25vw, 18px);
  line-height: 1.6;
  color: var(--ink-soft);
}

.about-me__blue {
  color: var(--accent);
  font-weight: 600;
}

.about-me__strong {
  font-weight: 700;
}

.about-me__sign {
  font-weight: 600;
  color: var(--muted) !important;
}

/* ---------- Подвал ---------- */

.footer {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 16px;
  padding: clamp(40px, 7vh, 80px) 0 40px;
  border-top: 1px solid var(--line);
  margin-top: clamp(32px, 6vh, 72px);
  scroll-margin-top: 84px;
}

.footer .section__h1 {
  margin-bottom: 0;
}

.footer__lead {
  font-size: 17px;
  color: var(--muted);
  max-width: 52ch;
}

.footer__mail a {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
  letter-spacing: -0.01em;
  border-bottom: 2px solid rgba(99, 102, 241, 0.35);
  padding-bottom: 2px;
}

.footer__mail a:hover {
  border-bottom-color: var(--accent);
}

.icons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 8px 0 4px;
}

.icons a {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 6px 20px #d5d5e0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.icons a:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px #c9c9dc;
}

.icons img {
  width: 24px;
  height: 24px;
  opacity: 0.8;
}

.icons a:hover img {
  opacity: 1;
}

.footer__copy {
  font-size: 13.5px;
  color: var(--muted);
}

/* ---------- Адаптив ---------- */

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding-bottom: 56px;
  }

  .hero__lead {
    max-width: 46ch;
  }

  .slider {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    --media-h: clamp(220px, 58vw, 460px);
  }

  .slider-right {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    height: auto;
  }

  .slider-right-imgs {
    max-height: none;
  }

  .slider-right-imgs {
    flex-direction: row;
    align-items: stretch;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 4px;
    scrollbar-width: thin;
    min-width: 0;
    height: auto;
  }

  .slider-thumb {
    flex: 0 0 clamp(132px, 24vw, 190px);
    aspect-ratio: 16 / 10;
    min-height: auto;
  }

  .slider-right-arrows {
    flex-direction: column;
    margin-top: 0;
  }

  .experience-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .experience-block:last-child {
    grid-column: 1 / -1;
    min-height: auto;
  }

  .about-me {
    grid-template-columns: minmax(0, 1fr);
  }

  .about-me-block-1 {
    padding: 32px;
  }
}

@media (max-width: 820px) {
  :root {
    --page-x: 22px;
  }

  .nav-list {
    display: none;
  }

  .hero__facts {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  :root {
    --page-x: 18px;
    --radius: 20px;
  }

  .circle {
    opacity: 0.45;
  }

  .hero {
    padding-top: 28px;
  }

  .hero__title {
    font-size: clamp(34px, 10vw, 44px);
  }

  .hero__actions .btn {
    flex: 1 1 100%;
  }

  .hero__facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .experience-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .experience-block {
    min-height: auto;
  }

  .slider-caption {
    min-height: 0;
  }

  .slider-hint {
    text-align: left;
    font-size: 12.5px;
  }

  .footer__lead {
    font-size: 15.5px;
  }

  .icons a {
    width: 48px;
    height: 48px;
  }

  .icons img {
    width: 21px;
    height: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
