/* ==========================================================================
   Портфолио — тёмная тема, акцентный градиент, анимации на CSS + IntersectionObserver
   ========================================================================== */

:root {
  --bg: #07070b;
  --bg-soft: #0b0b12;
  --card: #101018;
  --card-2: #15151f;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f4f8;
  --muted: #9aa0b2;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-3: #ff5c8a;
  --grad: linear-gradient(120deg, #7c5cff 0%, #22d3ee 55%, #ff5c8a 100%);
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 30px 80px -40px rgba(124, 92, 255, 0.55);
  --font: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
  --ease: cubic-bezier(0.22, 0.7, 0.22, 1);
}

* { box-sizing: border-box; }

/* Атрибут hidden должен побеждать любой display из наших правил */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.is-locked { overflow: hidden; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* отступ для якорей: шапка фиксированная */
section[id],
main[id] { scroll-margin-top: 88px; }

h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; margin: 0; font-weight: 700; }
p { margin: 0; }

::selection { background: rgba(124, 92, 255, 0.4); }

/* ------------------------------- разметка ------------------------------- */

.container {
  width: min(1180px, 100% - 48px);
  margin-inline: auto;
}

.container--narrow { width: min(820px, 100% - 48px); }

.section {
  padding: 110px 0;
  position: relative;
}

.section--soft {
  background:
    radial-gradient(900px 420px at 15% 0%, rgba(124, 92, 255, 0.12), transparent 60%),
    var(--bg-soft);
  border-block: 1px solid var(--line);
}

.section__head {
  max-width: 640px;
  margin-bottom: 56px;
}

.section__kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 14px;
}

.section__title {
  font-size: clamp(29px, 4.4vw, 46px);
  margin-bottom: 16px;
}

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

.gradient-text {
  background: var(--grad);
  background-size: 220% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 9s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* -------------------------------- кнопки -------------------------------- */

.btn {
  --btn-bg: rgba(255, 255, 255, 0.06);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--btn-bg);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.35s, background 0.25s;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.99); }
.btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }

/* блик, пробегающий по кнопке */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.35) 45%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease);
}

.btn:hover::after { transform: translateX(120%); }

.btn--accent {
  background: var(--grad);
  background-size: 160% 160%;
  border-color: transparent;
  color: #0b0716;
  font-weight: 700;
  box-shadow: 0 18px 40px -18px rgba(124, 92, 255, 0.9);
  animation: gradientShift 8s ease infinite;
}

.btn--accent:hover { box-shadow: 0 22px 54px -16px rgba(124, 92, 255, 0.95); }

.btn--ghost { background: rgba(255, 255, 255, 0.04); }

.btn--sm { padding: 9px 16px; font-size: 14px; }
.btn--lg { padding: 16px 30px; font-size: 16px; }
.btn--block { width: 100%; }

.btn__arrow { transition: transform 0.3s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(5px); }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(11, 7, 22, 0.25);
  border-top-color: #0b0716;
  border-radius: 50%;
  display: none;
  animation: spin 0.7s linear infinite;
}

.btn.is-loading .spinner { display: block; }
.btn.is-loading .btn__label { opacity: 0.6; }
.btn.is-loading { pointer-events: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------- служебное ------------------------------ */

.scroll-progress {
  position: fixed;
  inset: 0 auto auto 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--grad);
  z-index: 120;
  will-change: transform;
}

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 420px;
  height: 420px;
  margin: -210px 0 0 -210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.16), transparent 62%);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s;
  will-change: transform;
}

.cursor-glow.is-active { opacity: 1; }

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* -------------------------------- шапка --------------------------------- */

.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(7, 7, 11, 0.55);
  border-bottom: 1px solid transparent;
  transition: background 0.35s, border-color 0.35s, padding 0.35s;
}

.header.is-scrolled {
  background: rgba(7, 7, 11, 0.9);
  border-bottom-color: var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  transition: padding 0.35s var(--ease);
}

.header.is-scrolled .header__inner { padding: 11px 0; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 17px;
}

.logo__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--grad);
  color: #0b0716;
  font-size: 15px;
  animation: pulseMark 4s ease-in-out infinite;
}

@keyframes pulseMark {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(12deg) scale(1.06); }
}

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

.nav__link {
  position: relative;
  padding: 9px 13px;
  border-radius: 999px;
  font-size: 15px;
  color: var(--muted);
  transition: color 0.25s, background 0.25s;
}

.nav__link:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.nav__link.is-active { color: var(--text); }

.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

.nav__cta { margin-left: 8px; }

.burger {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  padding: 0;
  place-items: center;
  gap: 5px;
}

.burger span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}

.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* -------------------------------- герой --------------------------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 130px 0 90px;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}

.orb--1 {
  width: 520px; height: 520px;
  top: -120px; left: -80px;
  background: radial-gradient(circle, #7c5cff, transparent 65%);
  animation: float1 18s ease-in-out infinite;
}

.orb--2 {
  width: 460px; height: 460px;
  right: -60px; top: 120px;
  background: radial-gradient(circle, #22d3ee, transparent 65%);
  animation: float2 22s ease-in-out infinite;
}

.orb--3 {
  width: 380px; height: 380px;
  bottom: -140px; left: 40%;
  background: radial-gradient(circle, #ff5c8a, transparent 65%);
  opacity: 0.35;
  animation: float1 26s ease-in-out infinite reverse;
}

@keyframes float1 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(60px, 50px, 0) scale(1.1); }
}

@keyframes float2 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-70px, 40px, 0) scale(1.08); }
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 40%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 20%, transparent 78%);
}

.hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 60px;
  align-items: center;
}

.hero__title {
  font-size: clamp(38px, 6.2vw, 72px);
  letter-spacing: -0.035em;
  margin-bottom: 22px;
}

.hero__lead {
  color: var(--muted);
  font-size: 18px;
  max-width: 52ch;
  margin-bottom: 34px;
}

.hero__lead strong { color: var(--text); font-weight: 600; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  margin-bottom: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 13.5px;
  color: #cfd3e0;
}

.pulse-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ee08a;
}

.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid #3ee08a;
  animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
  0% { transform: scale(0.7); opacity: 0.9; }
  100% { transform: scale(2.1); opacity: 0; }
}

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

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

.stat__num {
  display: block;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat__label {
  font-size: 13.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* карточка с кодом */

.hero__visual {
  position: relative;
  perspective: 1100px;
  /* отступы сверху и снизу, чтобы плашки не перекрывали саму карточку */
  padding: 46px 0;
}

.code-card {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: linear-gradient(160deg, #16161f, #0c0c13);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: rotateY(-9deg) rotateX(4deg);
  transition: transform 0.6s var(--ease);
  animation: cardFloat 7s ease-in-out infinite;
}

.code-card:hover { transform: rotateY(0) rotateX(0) translateY(-4px); }

@keyframes cardFloat {
  0%, 100% { transform: rotateY(-9deg) rotateX(4deg) translateY(0); }
  50% { transform: rotateY(-9deg) rotateX(4deg) translateY(-12px); }
}

.code-card__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot--r { background: #ff6058; }
.dot--y { background: #ffbd2e; }
.dot--g { background: #27c93f; }

.code-card__name {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

.code-card__body {
  margin: 0;
  padding: 20px 22px 26px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.85;
  color: #cdd3e6;
  overflow-x: auto;
}

.c-key { color: #c792ea; }
.c-prop { color: #82aaff; }
.c-str { color: #7ee7c7; }
.c-com { color: #5f6577; font-style: italic; }

.float-chip {
  position: absolute;
  padding: 9px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(18, 18, 27, 0.92);
  backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.9);
}

/* плашки стоят по краям карточки и не перекрывают код */
.float-chip--1 { top: 0; left: 4%; animation: chipFloat 5s ease-in-out infinite; }
.float-chip--2 { bottom: 4px; left: 2%; animation: chipFloat 6.5s ease-in-out infinite 0.6s; }
.float-chip--3 { bottom: 4px; right: 2%; animation: chipFloat 5.8s ease-in-out infinite 1.2s; }

@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.scroll-hint {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}

.scroll-hint__mouse {
  display: block;
  width: 24px;
  height: 38px;
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  position: relative;
}

.scroll-hint__mouse::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 3px;
  height: 8px;
  margin-left: -1.5px;
  border-radius: 3px;
  background: var(--text);
  animation: wheel 1.8s ease-in-out infinite;
}

@keyframes wheel {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(12px); opacity: 0; }
  100% { opacity: 0; }
}

/* ------------------------------ бегущая строка -------------------------- */

.marquee {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding: 18px 0;
  background: rgba(255, 255, 255, 0.02);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee__track {
  display: flex;
  gap: 26px;
  width: max-content;
  animation: marquee 34s linear infinite;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8b90a3;
}

.marquee:hover .marquee__track { animation-play-state: paused; }

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* -------------------------------- работы -------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 38px;
}

.chip {
  padding: 9px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.25s, background 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}

.chip:hover { color: var(--text); transform: translateY(-2px); }

.chip.is-active {
  color: #0b0716;
  background: var(--grad);
  border-color: transparent;
}

.works {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.works__skeleton {
  aspect-ratio: 3 / 2;
  border-radius: var(--radius);
  background: linear-gradient(100deg, #101018 30%, #191924 50%, #101018 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  to { background-position: -120% 0; }
}

.works__empty {
  padding: 40px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.work {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.55s var(--ease), border-color 0.4s, box-shadow 0.5s;
  display: flex;
  flex-direction: column;
}

.work:hover {
  transform: translateY(-8px);
  border-color: rgba(124, 92, 255, 0.55);
  box-shadow: 0 34px 70px -40px rgba(124, 92, 255, 0.8);
}

.work.is-hidden { display: none; }

.work__media {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #0d0d14;
}

.work__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease), filter 0.5s;
}

.work:hover .work__media img { transform: scale(1.07); }

.work__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(7, 7, 11, 0.85));
  opacity: 0.75;
  transition: opacity 0.4s;
}

.work:hover .work__media::after { opacity: 0.95; }

.work__cat {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(7, 7, 11, 0.72);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(6px);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d6dae7;
}

.work__zoom {
  position: absolute;
  inset: auto 16px 16px auto;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--grad);
  color: #0b0716;
  font-weight: 800;
  transform: scale(0.6) rotate(-25deg);
  opacity: 0;
  transition: transform 0.45s var(--ease), opacity 0.35s;
}

.work:hover .work__zoom { transform: scale(1) rotate(0); opacity: 1; }

.work__body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.work__title {
  font-size: 19px;
  letter-spacing: -0.015em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.work__desc {
  color: var(--muted);
  font-size: 14.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.work__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: auto 0 0;
}

.work__stack li {
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.25);
  color: #bfc1ff;
  font-size: 12px;
  font-weight: 600;
}

/* -------------------------------- о себе --------------------------------- */

.about {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 64px;
  align-items: start;
}

.photo-frame {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--card);
  box-shadow: var(--shadow);
}

.photo-frame img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform 1s var(--ease);
}

.photo-frame:hover img { transform: scale(1.04); }

.photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(124, 92, 255, 0.25));
  pointer-events: none;
}

.photo-frame__badge {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(7, 7, 11, 0.8);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 600;
}

.photo-frame__badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ee08a;
  box-shadow: 0 0 12px #3ee08a;
}

.about__text > p {
  color: var(--muted);
  margin-bottom: 18px;
}

.about__text strong { color: var(--text); }

.about__text .section__title { margin-bottom: 22px; }

.skills {
  display: grid;
  gap: 18px;
  margin: 34px 0;
}

.skill__top {
  display: flex;
  justify-content: space-between;
  font-size: 14.5px;
  margin-bottom: 8px;
}

.skill__val { color: var(--accent-2); font-weight: 700; }

.skill__bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.skill__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--grad);
  transition: width 1.3s var(--ease);
}

.about__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.about__tags span {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13.5px;
  color: #ccd1de;
}

/* -------------------------------- шаги ---------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 26px 22px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent);
  transition: transform 0.45s var(--ease), border-color 0.35s;
}

.step:hover { transform: translateY(-6px); border-color: rgba(34, 211, 238, 0.4); }

.step__num {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-2);
  margin-bottom: 14px;
}

.step h3 { font-size: 18px; margin-bottom: 10px; }

.step p { color: var(--muted); font-size: 14.5px; }

/* -------------------------------- цены ---------------------------------- */

.prices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.price {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 32px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  transition: transform 0.45s var(--ease), border-color 0.35s, box-shadow 0.45s;
}

.price:hover {
  transform: translateY(-8px);
  border-color: rgba(124, 92, 255, 0.45);
  box-shadow: 0 34px 70px -46px rgba(124, 92, 255, 0.9);
}

.price--featured {
  border-color: rgba(124, 92, 255, 0.6);
  background:
    radial-gradient(500px 200px at 50% 0%, rgba(124, 92, 255, 0.22), transparent 70%),
    var(--card-2);
  box-shadow: 0 30px 80px -50px rgba(124, 92, 255, 0.9);
}

.price__flag {
  position: absolute;
  top: -13px;
  left: 26px;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--grad);
  color: #0b0716;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.price h3 { font-size: 20px; }

.price__value {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 6px;
}

.price__value span {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  margin-right: 6px;
}

.price__note { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

.price ul {
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
  display: grid;
  gap: 10px;
  font-size: 14.5px;
  color: #ccd1de;
}

.price li { display: flex; gap: 9px; align-items: flex-start; }

.price li::before {
  content: "✓";
  flex: none;
  color: var(--accent-2);
  font-weight: 800;
}

.price .btn { margin-top: auto; }

.prices__foot {
  margin-top: 30px;
  color: var(--muted);
  font-size: 15px;
  max-width: 70ch;
}

/* --------------------------------- FAQ ---------------------------------- */

.faq { display: grid; gap: 12px; }

.faq__item {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  overflow: hidden;
  transition: border-color 0.3s, background 0.3s;
}

.faq__item.is-open { border-color: rgba(124, 92, 255, 0.45); background: var(--card-2); }

.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 20px 22px;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 16.5px;
  font-weight: 600;
  cursor: pointer;
}

.faq__icon {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
}

.faq__icon::before,
.faq__icon::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-2);
  transition: transform 0.35s var(--ease);
}

.faq__icon::after { transform: rotate(90deg); }
.faq__item.is-open .faq__icon::after { transform: rotate(0deg); }

.faq__a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.42s var(--ease);
}

.faq__a > p {
  overflow: hidden;
  padding: 0 22px;
  color: var(--muted);
  font-size: 15.5px;
  opacity: 0;
  transition: opacity 0.3s, padding 0.42s var(--ease);
}

.faq__item.is-open .faq__a { grid-template-rows: 1fr; }
.faq__item.is-open .faq__a > p { opacity: 1; padding-bottom: 22px; }

/* ------------------------------- контакты -------------------------------- */

.section--contact {
  background:
    radial-gradient(700px 400px at 80% 20%, rgba(34, 211, 238, 0.12), transparent 65%),
    radial-gradient(600px 400px at 10% 80%, rgba(124, 92, 255, 0.18), transparent 65%);
}

.contact {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 60px;
  align-items: start;
}

.contact__info > p { color: var(--muted); margin-bottom: 14px; }

.contact__list {
  list-style: none;
  padding: 0;
  margin: 30px 0 22px;
  display: grid;
  gap: 14px;
  font-size: 16px;
}

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

.contact__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-2);
  font-size: 15px;
}

.contact__list a {
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, color 0.25s;
}

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

.contact__note { font-size: 14px; color: #7f8598; max-width: 44ch; }

.form {
  display: grid;
  gap: 18px;
  padding: 30px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(16, 16, 24, 0.72);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field { display: grid; gap: 8px; font-size: 14px; }

.field > span { color: #c3c8d6; font-weight: 600; }

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: rgba(7, 7, 11, 0.66);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.field textarea { resize: vertical; min-height: 120px; }

.field input::placeholder,
.field textarea::placeholder { color: #5f6578; }

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(7, 7, 11, 0.9);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
}

.field input:user-invalid,
.field textarea:user-invalid { border-color: #ff6b81; }

.field select {
  appearance: none;
  cursor: pointer;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239aa0b2' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
}

.form__hint { font-size: 12.5px; color: #6f7488; text-align: center; }

.form__error {
  padding: 12px 14px;
  border: 1px solid rgba(255, 107, 129, 0.4);
  border-radius: 12px;
  background: rgba(255, 107, 129, 0.1);
  color: #ffb3be;
  font-size: 14px;
}

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

.footer {
  border-top: 1px solid var(--line);
  padding: 46px 0 38px;
  background: var(--bg-soft);
}

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

.footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.footer__brand small {
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
  margin-left: 4px;
}

.footer__nav { display: flex; gap: 8px; flex-wrap: wrap; }

.footer__nav a {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.25s, background 0.25s;
}

.footer__nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.footer__copy { font-size: 13.5px; color: #6f7488; }

/* ------------------------------- лайтбокс -------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}

.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox[hidden] { display: none; }

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 8, 0.82);
  backdrop-filter: blur(10px);
}

.lightbox__panel {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  width: min(1000px, 100%);
  max-height: 88vh;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: var(--card);
  transform: translateY(26px) scale(0.97);
  opacity: 0;
  transition: transform 0.45s var(--ease), opacity 0.35s;
  box-shadow: 0 60px 120px -50px #000;
}

.lightbox.is-open .lightbox__panel { transform: none; opacity: 1; }

.lightbox__media { background: #0a0a10; overflow: hidden; }

.lightbox__media img {
  width: 100%;
  height: 100%;
  max-height: 88vh;
  object-fit: cover;
}

.lightbox__info {
  padding: 34px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.lightbox__info h3 { font-size: 24px; }

.lightbox__info p { color: var(--muted); font-size: 15.5px; }

.lightbox__info .work__stack { margin-top: 4px; }

.lightbox__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(7, 7, 11, 0.7);
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
}

.lightbox__close:hover { background: rgba(255, 92, 138, 0.25); transform: rotate(90deg); }

/* --------------------------------- чат ----------------------------------- */

.chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 210;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--grad);
  color: #0b0716;
  cursor: pointer;
  box-shadow: 0 18px 40px -16px rgba(124, 92, 255, 0.9);
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}

.chat-launcher:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 24px 50px -16px rgba(124, 92, 255, 1);
}

.chat-launcher svg { width: 26px; height: 26px; }

.chat-launcher__dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5c8a;
  border: 2px solid #0b0716;
}

.chat {
  position: fixed;
  right: 22px;
  bottom: 96px;
  z-index: 211;
  width: min(372px, calc(100vw - 32px));
  height: min(566px, calc(100vh - 130px));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: rgba(13, 13, 20, 0.97);
  backdrop-filter: blur(18px);
  box-shadow: 0 40px 90px -40px #000;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.28s, transform 0.32s var(--ease);
}

.chat.is-open { opacity: 1; transform: none; }

.chat__head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent);
}

.chat__ava {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--grad);
  color: #0b0716;
  font-weight: 800;
  font-size: 13px;
  flex: none;
}

.chat__who { display: grid; gap: 2px; min-width: 0; }
.chat__who b { font-size: 14.5px; letter-spacing: -0.01em; }

.chat__who span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.chat__status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3ee08a;
  box-shadow: 0 0 10px #3ee08a;
  flex: none;
}

.chat__close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s, color 0.2s;
}

.chat__close:hover { background: rgba(255, 92, 138, 0.18); color: #ffb3c1; }

.chat__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.chat__body::-webkit-scrollbar { width: 6px; }
.chat__body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 3px; }

/* ---- вступление ---- */

.chat__intro { display: grid; gap: 11px; }

.chat__hello {
  font-size: 14px;
  color: #ccd1de;
  line-height: 1.5;
  margin-bottom: 2px;
}

.chat__field { display: grid; gap: 5px; font-size: 12px; }
.chat__field > span { color: #a7aec1; font-weight: 600; }
.chat__field em { font-style: normal; color: #6f7488; font-weight: 400; }

.chat__field input,
.chat__field textarea,
.chat__form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(7, 7, 11, 0.7);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  resize: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat__field input:focus,
.chat__field textarea:focus,
.chat__form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.16);
}

.chat__field input::placeholder,
.chat__field textarea::placeholder,
.chat__form textarea::placeholder { color: #5f6578; }

.chat__start {
  margin-top: 3px;
  padding: 12px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--grad);
  color: #0b0716;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s var(--ease), opacity 0.2s;
}

.chat__start:hover { transform: translateY(-1px); }
.chat__start:disabled { opacity: 0.6; cursor: default; transform: none; }

.chat__hint { font-size: 11px; color: #6f7488; text-align: center; }

.chat__error {
  padding: 9px 11px;
  border: 1px solid rgba(255, 107, 129, 0.4);
  border-radius: 10px;
  background: rgba(255, 107, 129, 0.1);
  color: #ffb3be;
  font-size: 12.5px;
}

/* ---- переписка ---- */

.chat__thread { display: flex; flex-direction: column; gap: 10px; }

.chat__msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 86%;
}

.chat__msg--admin { align-self: flex-start; }
.chat__msg--visitor { align-self: flex-end; align-items: flex-end; }

.chat__bubble {
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat__msg--admin .chat__bubble {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line-strong);
  border-bottom-left-radius: 5px;
  color: #e6e9f2;
}

.chat__msg--visitor .chat__bubble {
  background: var(--grad);
  color: #0b0716;
  border-bottom-right-radius: 5px;
  font-weight: 500;
}

.chat__msg time { font-size: 10.5px; color: #6f7488; padding: 0 4px; }

/* ---- поле ввода ---- */

.chat__form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: rgba(7, 7, 11, 0.6);
}

.chat__form textarea { flex: 1; max-height: 96px; min-height: 42px; }

.chat__send {
  width: 42px;
  height: 42px;
  flex: none;
  border: 0;
  border-radius: 12px;
  background: var(--grad);
  color: #0b0716;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s var(--ease);
}

.chat__send:hover { transform: translateY(-1px); }
.chat__send svg { width: 19px; height: 19px; }

@media (max-width: 640px) {
  .chat-launcher { right: 14px; bottom: 14px; width: 54px; height: 54px; }
  .chat { right: 10px; left: 10px; bottom: 78px; width: auto; height: min(70vh, 540px); }
  .toasts { right: 14px; bottom: 80px; }
}

/* -------------------------------- тосты ---------------------------------- */

.toasts {
  position: fixed;
  /* отступ справа — чтобы не наезжать на кнопку чата */
  right: 96px;
  bottom: 22px;
  z-index: 300;
  display: grid;
  gap: 10px;
  max-width: min(380px, calc(100% - 40px));
}

.toast {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(16, 16, 24, 0.96);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px -25px #000;
  font-size: 14.5px;
  animation: toastIn 0.4s var(--ease);
}

.toast.is-out { animation: toastOut 0.35s var(--ease) forwards; }

.toast--ok { border-color: rgba(62, 224, 138, 0.45); }
.toast--err { border-color: rgba(255, 107, 129, 0.5); }

.toast__icon { font-weight: 800; }
.toast--ok .toast__icon { color: #3ee08a; }
.toast--err .toast__icon { color: #ff6b81; }

@keyframes toastIn {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes toastOut {
  to { transform: translateX(30px); opacity: 0; }
}

/* ------------------------- появление при скролле ------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1fr; gap: 54px; }
  .hero__visual { max-width: 520px; }
  .works { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; gap: 40px; }
  .about__photo { max-width: 340px; }
  .contact { grid-template-columns: 1fr; gap: 40px; }
  .prices { grid-template-columns: 1fr; }
  .price--featured { order: -1; }
}

@media (max-width: 860px) {
  .nav {
    position: fixed;
    inset: 68px 16px auto 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px;
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    background: rgba(11, 11, 18, 0.97);
    backdrop-filter: blur(16px);
    box-shadow: 0 40px 90px -40px #000;
    transform: translateY(-14px) scale(0.98);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.32s var(--ease), opacity 0.28s, visibility 0.28s;
  }

  .nav.is-open { transform: none; opacity: 1; visibility: visible; }

  .nav__link { padding: 13px 14px; font-size: 16px; }
  .nav__link.is-active::after { display: none; }
  .nav__cta { margin: 8px 0 0; }

  .burger { display: grid; }

  .section { padding: 80px 0; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }

  .container, .container--narrow { width: calc(100% - 32px); }

  .hero { padding-top: 110px; min-height: auto; }
  .hero__stats { gap: 26px; }
  .stat__num { font-size: 25px; }

  .works { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .form { padding: 22px 18px; }
  .form__row { grid-template-columns: 1fr; }

  .lightbox__panel { grid-template-columns: 1fr; max-height: 92vh; overflow-y: auto; }
  .lightbox__media img { max-height: 46vh; }

  .float-chip--2 { left: 0; }
  .float-chip--3 { right: 4%; }
  .code-card { transform: none; animation: none; }
  .code-card__body { font-size: 12px; }

  .footer__inner { flex-direction: column; align-items: flex-start; }
}

@media (hover: none) {
  .cursor-glow { display: none; }
  .btn:hover::after { transform: translateX(-120%); }
}

/* Уважаем системную настройку «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal { opacity: 1; transform: none; }
}
