/* ==========================================================================
   Владимир Миргородский — портфолио
   Дизайн-система: тёмная тема, акценты cyan → violet
   ========================================================================== */

/* ---------- Токены ---------- */
:root {
  --bg:            #080b12;
  --bg-soft:       #0c1119;
  --bg-elev:       #111827;
  --surface:       rgba(255, 255, 255, .032);
  --surface-hi:    rgba(255, 255, 255, .06);
  --line:          rgba(255, 255, 255, .09);
  --line-hi:       rgba(255, 255, 255, .18);

  --text:          #e8edf7;
  --text-soft:     #a8b3c7;
  --text-dim:      #6f7c93;

  --accent:        #22d3ee;
  --accent-2:      #818cf8;
  --accent-3:      #c084fc;
  --grad:          linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 50%, var(--accent-3) 100%);

  --radius:        18px;
  --radius-sm:     12px;
  --radius-xs:     9px;

  --shadow:        0 24px 60px -22px rgba(0, 0, 0, .85);
  --shadow-glow:   0 0 0 1px rgba(129, 140, 248, .3), 0 18px 50px -18px rgba(99, 102, 241, .55);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --container: 1180px;
  --nav-h: 68px;

  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Сброс ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.68;
  font-weight: 400;
  letter-spacing: .1px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
p { margin: 0; }
strong { color: #fff; font-weight: 650; }
em { font-style: normal; }

::selection { background: rgba(129, 140, 248, .35); color: #fff; }

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

/* ---------- Скроллбар ---------- */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: #05070c; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #1e293b, #334155);
  border-radius: 99px;
  border: 2px solid #05070c;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #334155, #475569); }

/* ---------- Служебное ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 22px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--accent);
  color: #04121a;
  padding: 10px 18px;
  border-radius: 0 0 10px 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Индикатор прокрутки */
.scroll-progress {
  position: fixed;
  inset: 0 auto auto 0;
  height: 3px;
  width: 0;
  z-index: 120;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(129, 140, 248, .8);
  transition: width .1s linear;
}

/* Фоновые декорации */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.bg-decor__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .5;
}
.bg-decor__glow--1 {
  width: 620px; height: 620px;
  top: -220px; left: -160px;
  background: radial-gradient(circle, rgba(34, 211, 238, .30), transparent 68%);
  animation: float1 22s ease-in-out infinite;
}
.bg-decor__glow--2 {
  width: 680px; height: 680px;
  top: 12%; right: -240px;
  background: radial-gradient(circle, rgba(168, 85, 247, .26), transparent 68%);
  animation: float2 26s ease-in-out infinite;
}
.bg-decor__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 78%);
}
@keyframes float1 { 50% { transform: translate3d(90px, 70px, 0) scale(1.12); } }
@keyframes float2 { 50% { transform: translate3d(-100px, 60px, 0) scale(1.08); } }

/* ---------- Хедер ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background .3s var(--ease), border-color .3s var(--ease), backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.header.is-scrolled {
  background: rgba(8, 11, 18, .78);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom-color: var(--line);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.logo__mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--grad);
  color: #05080e;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 22px -8px rgba(129, 140, 248, .9);
}
.logo__text em { color: var(--accent); font-style: normal; }
.logo__text { color: var(--text-soft); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav__link {
  position: relative;
  padding: 9px 14px;
  border-radius: 99px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-soft);
  transition: color .22s, background .22s;
}
.nav__link:hover { color: #fff; background: var(--surface-hi); }
.nav__link.is-active { color: #fff; }
.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 3px;
  transform: translateX(-50%);
  width: 18px; height: 2px;
  border-radius: 2px;
  background: var(--grad);
}
.nav__link--cta {
  color: #04121a;
  background: var(--grad);
  font-weight: 600;
  margin-left: 8px;
  padding-inline: 18px;
  box-shadow: 0 10px 26px -12px rgba(34, 211, 238, .95);
}
.nav__link--cta:hover { background: var(--grad); color: #04121a; filter: brightness(1.08); }
.nav__link--cta.is-active::after { display: none; }

.burger {
  display: none;
  width: 42px; height: 42px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 12px 11px;
  flex-direction: column;
  justify-content: space-between;
}
.burger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform .3s var(--ease), opacity .2s;
}
.burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 99px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform .22s var(--ease), box-shadow .22s, background .22s, border-color .22s, color .22s;
}
.btn svg { flex: none; transition: transform .25s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn--primary {
  background: var(--grad);
  color: #04121a;
  box-shadow: 0 14px 34px -14px rgba(99, 102, 241, .95);
}
.btn--primary:hover { box-shadow: 0 20px 42px -14px rgba(99, 102, 241, 1); }
.btn--primary:hover svg { transform: translateX(4px); }
.btn--ghost {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover { border-color: var(--line-hi); background: var(--surface-hi); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(48px, 8vw, 96px) 0 clamp(60px, 9vw, 110px);
}
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px 7px 12px;
  border-radius: 99px;
  border: 1px solid rgba(52, 211, 153, .3);
  background: rgba(52, 211, 153, .07);
  color: #6ee7b7;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 26px;
  animation: fadeUp .8s var(--ease) both;
}
.badge__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .7);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, .65); }
  70%  { box-shadow: 0 0 0 11px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero__title {
  font-size: clamp(2.4rem, 6.4vw, 4.3rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.04;
  margin-bottom: 18px;
  animation: fadeUp .8s .06s var(--ease) both;
}

.hero__role {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--mono);
  font-size: clamp(.95rem, 2vw, 1.12rem);
  color: var(--text-soft);
  margin-bottom: 22px;
  min-height: 1.6em;
  animation: fadeUp .8s .12s var(--ease) both;
}
.hero__role-static { color: var(--text-dim); }
.typewriter { color: var(--accent); font-weight: 500; }
.caret {
  display: inline-block;
  width: 9px; height: 1.15em;
  translate: 0 2px;
  background: var(--accent);
  border-radius: 1px;
  animation: blink 1.05s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__lead {
  font-size: clamp(1rem, 1.6vw, 1.075rem);
  color: var(--text-soft);
  max-width: 62ch;
  margin-bottom: 32px;
  animation: fadeUp .8s .18s var(--ease) both;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 34px;
  animation: fadeUp .8s .24s var(--ease) both;
}

.hero__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  animation: fadeUp .8s .3s var(--ease) both;
}
.hero__contacts a, .hero__contacts span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-dim);
  transition: color .22s;
}
.hero__contacts a:hover { color: var(--accent); }
.hero__contacts svg { flex: none; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

/* Код-карточка */
.hero__card { animation: fadeUp .9s .2s var(--ease) both; }

.code-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 24, 39, .92), rgba(9, 12, 20, .92));
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(10px);
}
.code-card__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .022);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot--red { background: #ff5f57; }
.dot--yellow { background: #febc2e; }
.dot--green { background: #28c840; }
.code-card__file {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}
.code-card__body {
  margin: 0;
  padding: 18px 18px 20px;
  font-family: var(--mono);
  font-size: clamp(11.5px, 1.35vw, 13px);
  line-height: 1.75;
  overflow-x: auto;
  color: #cbd5e1;
}
.c-key  { color: #f472b6; }
.c-cls  { color: #fbbf24; }
.c-attr { color: #7dd3fc; }
.c-str  { color: #86efac; }
.c-fn   { color: #a5b4fc; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.stat {
  padding: 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: center;
  transition: border-color .25s, background .25s, transform .25s var(--ease);
}
.stat:hover { border-color: var(--line-hi); background: var(--surface-hi); transform: translateY(-3px); }
.stat__value {
  display: block;
  font-family: var(--mono);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.1;
  color: #eaf2ff;
  text-shadow: 0 0 22px rgba(129, 140, 248, .75);
}
.stat__label { display: block; margin-top: 5px; font-size: 12.5px; color: var(--text-dim); }

/* ---------- Секции ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; position: relative; }
.section--alt {
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .017) 18%, rgba(255, 255, 255, .017) 82%, transparent);
  border-block: 1px solid rgba(255, 255, 255, .05);
}

.section__head { max-width: 780px; margin-bottom: clamp(34px, 5vw, 56px); }
.section__kicker {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.section__title {
  font-size: clamp(1.7rem, 3.9vw, 2.6rem);
  font-weight: 750;
  letter-spacing: -.03em;
}
.section__sub {
  margin-top: 14px;
  color: var(--text-soft);
  font-size: 1.02rem;
  max-width: 68ch;
}

/* ---------- Обо мне ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 52px);
  align-items: start;
}
.about__text p + p { margin-top: 16px; }
.about__text p { color: var(--text-soft); font-size: 1.02rem; }

.about__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.pillar {
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: transform .3s var(--ease), border-color .3s, background .3s;
}
.pillar:hover {
  transform: translateY(-5px);
  border-color: rgba(129, 140, 248, .42);
  background: var(--surface-hi);
}
.pillar__icon {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  margin-bottom: 14px;
  color: var(--accent);
  background: rgba(34, 211, 238, .09);
  border: 1px solid rgba(34, 211, 238, .22);
}
.pillar h3 { font-size: 1.02rem; margin-bottom: 8px; font-weight: 650; }
.pillar p { font-size: 14px; color: var(--text-dim); line-height: 1.62; }

.quote {
  margin-top: 34px;
  padding: 22px 26px;
  border-left: 3px solid transparent;
  border-image: var(--grad) 1;
  background: linear-gradient(90deg, rgba(129, 140, 248, .09), transparent 70%);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.quote__text { color: var(--text-soft); font-size: 15px; }

/* ---------- Навыки ---------- */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
}
.skill-card {
  padding: 24px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform .3s var(--ease), border-color .3s, background .3s;
}
.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-hi);
  background: var(--surface-hi);
}
.skill-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.skill-card__head h3 { font-size: 1rem; font-weight: 650; }
.skill-card__dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--dot, var(--accent));
  box-shadow: 0 0 12px 1px var(--dot, var(--accent));
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  font-size: 12.8px;
  font-weight: 500;
  color: var(--text-soft);
  transition: color .2s, border-color .2s, background .2s, transform .2s var(--ease);
}
.chip:hover {
  color: #fff;
  border-color: rgba(34, 211, 238, .5);
  background: rgba(34, 211, 238, .1);
  transform: translateY(-2px);
}
.chip--core {
  color: #d8f6ff;
  border-color: rgba(34, 211, 238, .34);
  background: linear-gradient(180deg, rgba(34, 211, 238, .16), rgba(129, 140, 248, .12));
  font-weight: 600;
}
.chips--sm .chip { font-size: 12px; padding: 4px 10px; }

.langs { display: grid; gap: 18px; }
.lang { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; }
.lang__name { font-size: 14.5px; font-weight: 550; }
.lang__level { font-size: 12.5px; color: var(--text-dim); }
.lang__bar {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .07);
  overflow: hidden;
}
.lang__bar i {
  display: block;
  height: 100%;
  width: var(--w, 0);
  border-radius: 99px;
  background: var(--grad);
  transform-origin: left;
}

/* ---------- Таймлайн ---------- */
.timeline { position: relative; display: grid; gap: 26px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 11px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, rgba(34, 211, 238, .65), rgba(192, 132, 252, .45), transparent);
  border-radius: 2px;
}
.tl-item { position: relative; padding-left: 46px; }
.tl-item__marker {
  position: absolute;
  left: 2px; top: 22px;
  width: 20px; height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid rgba(129, 140, 248, .55);
  box-shadow: 0 0 0 4px rgba(129, 140, 248, .09);
}
.tl-item__marker span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--grad);
}
.tl-item__body {
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .038), rgba(255, 255, 255, .014));
  transition: border-color .3s, transform .3s var(--ease), box-shadow .3s;
}
.tl-item__body:hover {
  border-color: rgba(129, 140, 248, .38);
  transform: translateX(5px);
  box-shadow: -8px 0 40px -26px rgba(129, 140, 248, .9);
}
.tl-item__top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tl-item__role { font-size: 1.14rem; font-weight: 700; color: #fff; }
.tl-item__company { font-size: 14.5px; color: var(--accent); font-weight: 550; margin-top: 5px; }
.tl-item__place { display: block; color: var(--text-dim); font-weight: 400; font-size: 13px; margin-top: 2px; }
.tl-item__date {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-soft);
  text-align: right;
  white-space: nowrap;
  padding: 6px 13px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  height: fit-content;
}
.tl-item__date span { display: block; color: var(--text-dim); font-size: 11.5px; margin-top: 3px; }

.tl-item__list { display: grid; gap: 9px; margin-bottom: 14px; }
.tl-item__list li {
  position: relative;
  padding-left: 20px;
  font-size: 14.6px;
  color: var(--text-soft);
  line-height: 1.65;
}
.tl-item__list li::before {
  content: "";
  position: absolute;
  left: 4px; top: .66em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .8;
}
.tl-item__result {
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(52, 211, 153, .26);
  background: rgba(52, 211, 153, .07);
  color: #a7f3d0;
  font-size: 14.2px;
  margin-bottom: 14px;
}
.tl-item__result strong { color: #d1fae5; }

/* ---------- Фильтры проектов ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 30px;
}
.filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  font-weight: 550;
  color: var(--text-soft);
  transition: color .22s, border-color .22s, background .22s, transform .22s var(--ease);
}
.filter:hover { color: #fff; border-color: var(--line-hi); transform: translateY(-2px); }
.filter.is-active {
  color: #04121a;
  background: var(--grad);
  border-color: transparent;
  box-shadow: 0 10px 26px -14px rgba(34, 211, 238, .95);
}
.filter__count {
  padding: 1px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .1);
  font-size: 11.5px;
  font-family: var(--mono);
}
.filter.is-active .filter__count { background: rgba(4, 18, 26, .22); }

/* ---------- Проекты ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}
.project {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px 23px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .012));
  overflow: hidden;
  transition: transform .32s var(--ease), border-color .32s, box-shadow .32s;
}
.project::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent-line, var(--accent));
  opacity: .75;
}
.project:hover {
  transform: translateY(-7px);
  border-color: var(--line-hi);
  box-shadow: 0 26px 60px -30px rgba(0, 0, 0, .95), 0 0 0 1px rgba(129, 140, 248, .18);
}
.project__glow {
  position: absolute;
  width: 240px; height: 240px;
  top: -130px; right: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-line, var(--accent)), transparent 68%);
  opacity: .16;
  filter: blur(38px);
  transition: opacity .35s;
  pointer-events: none;
}
.project:hover .project__glow { opacity: .34; }

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

.project__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}
.project__icon {
  font-size: 22px;
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
}
.project__year {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 11px;
  border-radius: 99px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.project__title {
  font-size: 1.1rem;
  font-weight: 680;
  line-height: 1.35;
  margin-bottom: 11px;
  color: #fff;
}
.project__desc {
  font-size: 14.4px;
  color: var(--text-soft);
  margin-bottom: 14px;
}
.project__metric {
  display: inline-block;
  align-self: flex-start;
  padding: 7px 13px;
  margin-bottom: 16px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(34, 211, 238, .24);
  background: rgba(34, 211, 238, .075);
  font-size: 13.2px;
  color: #a5f3fc;
}
.project__metric strong { color: #fff; }

.project__more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  transition: gap .25s var(--ease), color .2s;
  align-self: flex-start;
}
.project__more:hover { gap: 12px; color: #fff; }

.projects__empty {
  margin-top: 30px;
  text-align: center;
  color: var(--text-dim);
  font-size: 15px;
}

/* ---------- Образование ---------- */
.edu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.edu__card {
  position: relative;
  padding: 28px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform .3s var(--ease), border-color .3s, background .3s;
}
.edu__card:hover { transform: translateY(-5px); border-color: rgba(129, 140, 248, .4); background: var(--surface-hi); }
.edu__badge {
  display: inline-block;
  margin-bottom: 15px;
  padding: 5px 13px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #ddd6fe;
  background: rgba(139, 92, 246, .16);
  border: 1px solid rgba(139, 92, 246, .34);
}
.edu__card h3 { font-size: 1.1rem; line-height: 1.4; margin-bottom: 10px; }
.edu__meta { font-size: 14.4px; color: var(--text-soft); }
.edu__year { margin-top: 12px; font-family: var(--mono); font-size: 13px; color: var(--accent); }

/* ---------- Контакты ---------- */
.contact {
  position: relative;
  padding: clamp(32px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(17, 24, 39, .72), rgba(9, 12, 20, .72));
  overflow: hidden;
  text-align: center;
}
.contact__glow {
  position: absolute;
  width: 620px; height: 320px;
  top: -180px; left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(129, 140, 248, .28), transparent 70%);
  filter: blur(58px);
  pointer-events: none;
}
.contact .section__kicker { margin-bottom: 12px; }
.contact .section__title { margin-bottom: 16px; }
.contact__lead {
  max-width: 74ch;
  margin: 0 auto clamp(28px, 4vw, 42px);
  color: var(--text-soft);
  font-size: 1.02rem;
}
.contact__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(288px, 1fr));
  gap: 13px;
  text-align: left;
}
.contact__card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 15px 14px 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  width: 100%;
  transition: transform .28s var(--ease), border-color .28s, background .28s;
}
.contact__card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, .45);
  background: var(--surface-hi);
}
.contact__card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.contact__card-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px; height: 38px;
  border-radius: 11px;
  color: var(--accent);
  background: rgba(34, 211, 238, .09);
  border: 1px solid rgba(34, 211, 238, .2);
}
.contact__card-body { display: grid; gap: 3px; min-width: 0; }
.contact__card-label {
  font-size: 11.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.contact__card-value {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
  overflow-wrap: anywhere;
}

.contact__copy {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  color: var(--text-dim);
  transition: color .2s, border-color .2s, background .2s;
}
.contact__copy:hover {
  color: var(--accent);
  border-color: rgba(34, 211, 238, .5);
  background: rgba(34, 211, 238, .1);
}

/* ---------- Футер ---------- */
.footer {
  padding: 34px 0;
  border-top: 1px solid var(--line);
  background: rgba(5, 7, 12, .6);
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13.6px;
  color: var(--text-dim);
}
.footer__note a { color: var(--accent); }
.footer__note a:hover { text-decoration: underline; }

/* ---------- Наверх ---------- */
.to-top {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 90;
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--line-hi);
  background: rgba(17, 24, 39, .9);
  color: var(--text);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .3s, transform .3s var(--ease), visibility .3s, border-color .25s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Модальное окно ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 22px;
}
.modal[hidden] { display: none; }
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 10, .78);
  backdrop-filter: blur(7px);
  animation: fadeIn .25s ease both;
}
@keyframes fadeIn { from { opacity: 0; } }

.modal__dialog {
  position: relative;
  width: min(820px, 100%);
  max-height: min(86vh, 900px);
  overflow-y: auto;
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid var(--line-hi);
  border-radius: 22px;
  background: linear-gradient(180deg, #0f1622, #0a0e16);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 1);
  animation: modalIn .38s var(--ease) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(26px) scale(.97); }
}
.modal__dialog:focus { outline: none; }
.modal__accent {
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--modal-accent, var(--grad));
  border-radius: 22px 22px 0 0;
}
.modal__close {
  position: absolute;
  right: 16px; top: 16px;
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--text-soft);
  transition: color .2s, border-color .2s, background .2s;
}
.modal__close:hover { color: #fff; border-color: var(--line-hi); background: rgba(255, 255, 255, .09); }

.modal__title {
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  line-height: 1.3;
  margin: 8px 44px 22px 0;
  color: #fff;
}
.modal__content { color: var(--text-soft); font-size: 15px; }
.modal__content h4 {
  margin: 24px 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
}
.modal__content h4:first-child { margin-top: 0; }
.modal__content p { margin-bottom: 10px; }
.modal__content .p-role {
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  font-size: 14px;
}
.modal__content ul:not(.chips) { display: grid; gap: 9px; }
.modal__content ul:not(.chips) li {
  position: relative;
  padding-left: 20px;
  line-height: 1.65;
  font-size: 14.6px;
}
.modal__content ul:not(.chips) li::before {
  content: "";
  position: absolute;
  left: 4px; top: .66em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Тост ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 300;
  transform: translate(-50%, 18px);
  padding: 12px 22px;
  border-radius: 99px;
  border: 1px solid rgba(52, 211, 153, .35);
  background: rgba(11, 26, 22, .95);
  color: #a7f3d0;
  font-size: 14px;
  font-weight: 550;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .9);
  opacity: 0;
  transition: opacity .28s, transform .28s var(--ease);
  backdrop-filter: blur(8px);
}
.toast[hidden] { display: none; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Анимации появления ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Адаптив ---------- */
@media (max-width: 1180px) {
  .nav__link { padding: 9px 10px; font-size: 13.8px; }
  .nav__link--cta { padding-inline: 14px; margin-left: 4px; }
  .logo__text { display: none; }
}

@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__card { max-width: 560px; }
  .about { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .burger { display: flex; }
  .nav {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px 20px 24px;
    background: rgba(8, 11, 18, .97);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s, transform .28s var(--ease), visibility .28s;
  }
  .nav.is-open { opacity: 1; transform: none; visibility: visible; }
  .nav__link { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 16px; }
  .nav__link.is-active::after { display: none; }
  .nav__link.is-active { background: rgba(255, 255, 255, .06); }
  .nav__link--cta { margin: 8px 0 0; justify-content: center; display: flex; }
}

@media (max-width: 620px) {
  body { font-size: 15.5px; }
  .container { padding-inline: 17px; }
  .about__grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 13px 8px; }
  .stat__value { font-size: 1.35rem; }
  .stat__label { font-size: 11px; }
  .projects { grid-template-columns: 1fr; }
  .tl-item { padding-left: 34px; }
  .timeline::before { left: 8px; }
  .tl-item__marker { left: 0; width: 17px; height: 17px; }
  .tl-item__body { padding: 20px 18px; }
  .tl-item__date { text-align: left; }
  .hero__actions .btn { flex: 1 1 auto; justify-content: center; }
  .contact { padding: 28px 18px; }
  .contact__copy { position: absolute; right: 10px; top: 10px; width: 28px; height: 28px; }
  .modal { padding: 12px; }
  .modal__dialog { max-height: 88vh; border-radius: 18px; }
  .to-top { right: 14px; bottom: 14px; }
  .footer__inner { flex-direction: column; text-align: center; }
}

/* ---------- Доступность: уменьшенная анимация ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .caret { animation: none; }
}

/* ---------- Печать ---------- */
@media print {
  .header, .to-top, .bg-decor, .scroll-progress, .modal, .toast, .filters, .project__more { display: none !important; }
  body { background: #fff; color: #111; }
  .project__full[hidden] { display: block !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .section { padding: 18px 0; page-break-inside: avoid; }
  .contact, .tl-item__body, .project, .skill-card, .pillar, .edu__card {
    background: #fff !important;
    border-color: #ccc !important;
    box-shadow: none !important;
  }
  .gradient-text, .stat__value {
    -webkit-text-fill-color: #111 !important;
    color: #111 !important;
    background: none !important;
  }
}
