/* ==========================================================================
   Riool — лендинг Вениамина Семерикова
   Тёмно-зелёная тема, адаптив, анимации появления при скролле
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Токены темы
   -------------------------------------------------------------------------- */
:root {
  /* Фон */
  --bg-deep: #061f1a;
  --bg-0: #0a3d2e;
  --bg-1: #0e4635;
  --bg-2: #14513f;
  --bg-3: #1a5f4f;

  /* Акценты */
  --accent: #34d399;
  --accent-light: #7df0c4;
  --accent-bright: #5eead4;
  --accent-soft: rgba(52, 211, 153, 0.14);
  --accent-soft-2: rgba(94, 234, 212, 0.10);

  /* Текст */
  --text: #f2f7f5;
  --text-muted: #a9c4bb;
  --text-dim: #7e9a91;

  /* Поверхности */
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --border: rgba(125, 240, 196, 0.16);
  --border-strong: rgba(125, 240, 196, 0.32);

  /* Эффекты */
  --shadow-lg: 0 32px 80px -32px rgba(0, 0, 0, 0.75);
  --shadow-md: 0 18px 44px -22px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 0 1px rgba(52, 211, 153, 0.25), 0 18px 50px -18px rgba(52, 211, 153, 0.45);

  /* Геометрия */
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  /* Типографика */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Анимации */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.3s;

  /* Раскладка */
  --container: 1200px;
  --gutter: 24px;
  --header-h: 76px;
}

/* --------------------------------------------------------------------------
   2. Сброс и базовая типографика
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  scroll-behavior: smooth;
  /* якорные ссылки не должны заезжать под фиксированную шапку */
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

body.is-locked { overflow: hidden; }

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

img { height: auto; }

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color var(--dur) ease;
}

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

h1, h2, h3 {
  line-height: 1.14;
  letter-spacing: -0.025em;
  font-weight: 700;
  text-wrap: balance;
}

p { text-wrap: pretty; }

ul { padding: 0; list-style: none; }

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

::selection {
  background: var(--accent);
  color: #04160f;
}

/* Ссылка для клавиатурной навигации */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 999;
  padding: 12px 20px;
  background: var(--accent);
  color: #04160f;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top 0.2s ease;
}

.skip-link:focus { top: 0; color: #04160f; }

/* --------------------------------------------------------------------------
   3. Контейнер и утилиты
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: clamp(72px, 10vw, 140px);
}

.section__head {
  max-width: 720px;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.section__head--center {
  margin-inline: auto;
  text-align: center;
}

.section__eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.section__title {
  font-size: clamp(28px, 4.2vw, 46px);
  color: var(--text);
}

.section__subtitle {
  margin-top: 18px;
  font-size: clamp(16px, 1.6vw, 18px);
  color: var(--text-muted);
}

/* Появление при скролле (управляется из JS: .is-visible) */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

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

/* Если JS отключён — всё видно сразу */
.no-js .reveal { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   4. Кнопки
   -------------------------------------------------------------------------- */
.btn {
  --btn-py: 15px;
  --btn-px: 28px;

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: var(--btn-py) var(--btn-px);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: center;
  white-space: nowrap;
  transition:
    transform var(--dur) ease,
    background-color var(--dur) ease,
    border-color var(--dur) ease,
    box-shadow var(--dur) ease,
    color var(--dur) ease;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  transition: transform var(--dur) ease;
}

.btn:hover .btn__icon { transform: translateX(3px); }

.btn--primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 100%);
  color: #04231a;
  box-shadow: 0 14px 34px -14px rgba(52, 211, 153, 0.75);
}

.btn--primary:hover {
  color: #04231a;
  box-shadow: 0 20px 44px -14px rgba(52, 211, 153, 0.9);
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  background: var(--surface-strong);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn--outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--accent-light);
}

.btn--outline:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-bright);
}

.btn--sm { --btn-py: 11px; --btn-px: 20px; font-size: 15px; }
.btn--lg { --btn-py: 18px; --btn-px: 36px; font-size: 17px; }
.btn--block { width: 100%; }

/* --------------------------------------------------------------------------
   5. Шапка
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition:
    background-color var(--dur) ease,
    box-shadow var(--dur) ease,
    backdrop-filter var(--dur) ease,
    border-color var(--dur) ease;
  border-bottom: 1px solid transparent;
}

.site-header.is-stuck {
  background: rgba(6, 31, 26, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
  box-shadow: 0 12px 40px -24px rgba(0, 0, 0, 0.9);
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo:hover { color: var(--text); }

.logo__img {
  display: block;
  height: 44px;
  width: auto;
}

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

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

.nav__link {
  position: relative;
  display: block;
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--dur) ease, background-color var(--dur) ease;
}

.nav__link::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--text);
  background: var(--surface);
}

.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); }

.nav__cta { display: none; }

/* Бургер (мобильное меню) */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background-color var(--dur) ease;
}

.burger:hover { background: var(--surface-strong); }

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

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

/* --------------------------------------------------------------------------
   6. HERO
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--header-h) + 40px);
  padding-bottom: 96px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 12% 0%, var(--bg-3) 0%, var(--bg-1) 42%, var(--bg-0) 72%, var(--bg-deep) 100%);
}

/* Декоративный фон */
.hero__bg {
  position: absolute;
  inset: -12% -4%;
  pointer-events: none;
  z-index: 0;
}

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

.orb--1 {
  width: 44vw;
  height: 44vw;
  min-width: 380px;
  min-height: 380px;
  top: -8%;
  right: -6%;
  background: radial-gradient(circle at 35% 35%, rgba(52, 211, 153, 0.42), rgba(52, 211, 153, 0) 70%);
}

.orb--2 {
  width: 34vw;
  height: 34vw;
  min-width: 280px;
  min-height: 280px;
  bottom: -14%;
  left: -8%;
  background: radial-gradient(circle at 50% 50%, rgba(94, 234, 212, 0.28), rgba(94, 234, 212, 0) 70%);
}

.orb--3 {
  width: 22vw;
  height: 22vw;
  min-width: 200px;
  min-height: 200px;
  top: 46%;
  left: 44%;
  background: radial-gradient(circle at 50% 50%, rgba(26, 95, 79, 0.85), rgba(26, 95, 79, 0) 72%);
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(125, 240, 196, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 240, 196, 0.055) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(80% 60% at 50% 40%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(80% 60% at 50% 40%, #000 0%, transparent 78%);
  will-change: transform;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(36px, 5vw, 72px);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-light);
}

.hero__eyebrow-sep { color: var(--text-dim); }

.hero__title {
  font-size: clamp(34px, 5.4vw, 62px);
  font-weight: 800;
  letter-spacing: -0.035em;
  max-width: 15ch;
}

/* Анимация: слово за словом (класс ставит JS) */
.hero__title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.55em) rotate(1.5deg);
  filter: blur(6px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease),
    filter 0.7s var(--ease);
  transition-delay: var(--word-delay, 0ms);
  margin-right: 0.28em;
}

.hero__title.is-animated .word {
  opacity: 1;
  transform: none;
  filter: none;
}

.hero__lead {
  margin-top: 26px;
  max-width: 60ch;
  font-size: clamp(16px, 1.7vw, 19px);
  color: var(--text-muted);
}

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

.hero__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 52px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

.hero__fact-num {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.hero__fact-label {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-dim);
}

/* Фото */
.hero__media { position: relative; justify-self: end; width: 100%; max-width: 420px; }

.hero__photo-frame {
  position: relative;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: clamp(24px, 4vw, 40px);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.hero__photo {
  display: block;
  width: 100%;
  aspect-ratio: 864 / 1184;
  object-fit: cover;
  border-radius: calc(clamp(24px, 4vw, 40px) - 12px);
  filter: saturate(1.02) contrast(1.02);
  /* лёгкий zoom, чтобы фото не «прилипало» к рамке */
  transform: scale(1.02);
  transition: transform 0.5s var(--ease);
}

.hero__photo-glow {
  position: absolute;
  inset: auto -20% -30% -20%;
  height: 60%;
  background: radial-gradient(circle at 50% 100%, rgba(52, 211, 153, 0.35), transparent 70%);
  pointer-events: none;
}

.hero__badge {
  position: absolute;
  left: -14px;
  bottom: 26px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: rgba(8, 40, 32, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow-md);
}

.hero__badge-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16); }
  50%      { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0.05); }
}

/* Индикатор скролла */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  width: 24px;
  height: 40px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  display: grid;
  place-items: start center;
  padding-top: 8px;
  transition: border-color var(--dur) ease;
}

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

.scroll-hint__line {
  width: 3px;
  height: 8px;
  border-radius: 3px;
  background: var(--accent);
  animation: scrollDown 1.8s var(--ease) infinite;
}

@keyframes scrollDown {
  0%       { transform: translateY(0); opacity: 0; }
  30%      { opacity: 1; }
  100%     { transform: translateY(16px); opacity: 0; }
}

/* --------------------------------------------------------------------------
   7. ABOUT
   -------------------------------------------------------------------------- */
.about {
  background:
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-0) 22%, var(--bg-0) 100%);
}

.about__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(36px, 6vw, 88px);
}

.about__media { position: relative; }

.about__photo-frame {
  position: relative;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow-lg);
  max-width: 460px;
}

.about__photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: calc(var(--radius-lg) - 12px);
  filter: saturate(1.02);
}

.about__card {
  position: relative;
  max-width: 320px;
  margin-top: -46px;
  margin-left: 24px;
  padding: 20px 22px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: rgba(9, 46, 36, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
}

.about__card-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-light);
}

.about__card-text {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
}

.about__text {
  margin-top: 24px;
  display: grid;
  gap: 18px;
  color: var(--text-muted);
}

.about__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.about__skill {
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: background-color var(--dur) ease, border-color var(--dur) ease, transform var(--dur) ease;
}

.about__skill:hover {
  background: var(--accent-soft);
  border-color: var(--border-strong);
  color: var(--accent-light);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   8. PORTFOLIO
   -------------------------------------------------------------------------- */
.portfolio {
  background:
    radial-gradient(90% 60% at 80% 0%, rgba(26, 95, 79, 0.55) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 60%, var(--bg-0) 100%);
}

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

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  overflow: hidden;
  transition:
    transform var(--dur) ease,
    border-color var(--dur) ease,
    box-shadow var(--dur) ease;
}

.card:hover,
.card:focus-within {
  transform: translateY(-8px) scale(1.015);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-glow);
}

.card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
}

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 0.6s var(--ease), filter 0.6s var(--ease);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}

.card:hover .card__img { transform: scale(1.06); }

/* Доп. информация появляется на hover */
.card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(6, 31, 26, 0.35) 0%, rgba(6, 31, 26, 0.94) 62%);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.card:hover .card__overlay,
.card:focus-within .card__overlay {
  opacity: 1;
  transform: none;
}

.card__overlay-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.card__overlay-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}

.card__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.card__stack li {
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: var(--text-muted);
}

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 14px;
  padding: 24px;
}

.card__title {
  font-size: 21px;
  color: var(--text);
}

.card__text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.tag {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-light);
}

.card__btn { align-self: flex-start; }

.portfolio__more {
  display: flex;
  justify-content: center;
  margin-top: clamp(40px, 5vw, 60px);
}

/* --------------------------------------------------------------------------
   9. CONTACTS
   -------------------------------------------------------------------------- */
.contacts {
  background:
    radial-gradient(70% 55% at 50% 100%, rgba(26, 95, 79, 0.6) 0%, transparent 70%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-deep) 100%);
}

.contacts__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 30px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition:
    transform var(--dur) ease,
    border-color var(--dur) ease,
    background-color var(--dur) ease,
    box-shadow var(--dur) ease;
}

.contact-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: var(--shadow-md);
}

.contact-card__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-light);
  transition: background-color var(--dur) ease, color var(--dur) ease;
}

.contact-card:hover .contact-card__icon {
  background: var(--accent);
  color: #04231a;
}

.contact-card__icon svg { width: 22px; height: 22px; }

.contact-card__label {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.contact-card__value {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  word-break: break-word;
}

.contacts__cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 44px;
  text-align: center;
}

.contacts__note {
  font-size: 14px;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   10. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 30px;
}

.footer__copy {
  font-size: 14px;
  color: var(--text-dim);
}

.footer__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 14px;
}

.footer__contacts a { color: var(--text-muted); }
.footer__contacts a:hover { color: var(--accent-light); }

.footer__to-top {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  transition: transform var(--dur) ease, border-color var(--dur) ease, color var(--dur) ease, background-color var(--dur) ease;
}

.footer__to-top:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--accent-soft);
  color: var(--accent-light);
}

.footer__to-top svg { width: 19px; height: 19px; }

/* --------------------------------------------------------------------------
   11. MODAL
   -------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 20, 16, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.is-open .modal__backdrop { opacity: 1; }

.modal__dialog {
  position: relative;
  width: min(680px, 100%);
  max-height: min(88vh, 900px);
  overflow-y: auto;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(170deg, var(--bg-2), var(--bg-0) 70%);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  transition: opacity 0.32s var(--ease), transform 0.32s var(--ease);
}

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

.modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  transition: transform var(--dur) ease, background-color var(--dur) ease, color var(--dur) ease;
}

.modal__close:hover {
  transform: rotate(90deg);
  background: var(--surface-strong);
  color: var(--text);
}

.modal__close svg { width: 18px; height: 18px; }

.modal__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.modal__title {
  margin-top: 10px;
  font-size: clamp(24px, 3.4vw, 32px);
  color: var(--text);
}

.modal__text {
  margin-top: 12px;
  font-size: 15px;
  color: var(--text-muted);
}

/* Форма */
.form { margin-top: 28px; }

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

.form__field { margin-bottom: 18px; }

.form__label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

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

.form__input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(4, 26, 20, 0.55);
  color: var(--text);
  font-size: 15px;
  transition: border-color var(--dur) ease, background-color var(--dur) ease, box-shadow var(--dur) ease;
}

.form__input::placeholder { color: var(--text-dim); }

.form__input:hover { border-color: var(--border-strong); }

.form__input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(4, 26, 20, 0.8);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}

.form__input--area {
  min-height: 130px;
  resize: vertical;
  line-height: 1.6;
}

.form__field.has-error .form__input {
  border-color: #ff8080;
  box-shadow: 0 0 0 3px rgba(255, 128, 128, 0.14);
}

.form__error {
  min-height: 0;
  margin-top: 6px;
  font-size: 13px;
  color: #ff9d9d;
}

.form__error:empty { display: none; }

.form__actions {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.form__status {
  min-height: 0;
  font-size: 14px;
  text-align: center;
  color: var(--text-muted);
}

.form__status:empty { display: none; }
.form__status.is-error { color: #ff9d9d; }
.form__status.is-ok { color: var(--accent-light); }

.form__privacy {
  margin-top: 18px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-dim);
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.75;
}

.btn.is-loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(4, 35, 26, 0.3);
  border-top-color: #04231a;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Honeypot: скрыт от людей, но доступен ботам */
.form__hp {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Экран успеха */
.modal__body--success[hidden] { display: none; }

.success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 12px 0 4px;
  text-align: center;
}

.success__icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  animation: popIn 0.45s var(--ease);
}

.success__icon svg { width: 30px; height: 30px; }

@keyframes popIn {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.success__title { font-size: 24px; color: var(--text); }

.success__text {
  color: var(--text-muted);
  max-width: 42ch;
}

/* --------------------------------------------------------------------------
   12. HI-TECH: анимации и микровзаимодействия
   -------------------------------------------------------------------------- */

/* Регистрируем кастомное свойство угла — для вращающегося контура рамки */
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* Медленный «проход» декоративной сетки в hero */
.grid-lines { animation: gridPan 22s linear infinite; }

@keyframes gridPan {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 64px 64px, 64px 64px; }
}

/* Дрейф светящихся орбов.
   Используем свойство translate — оно складывается с parallax-трансформом из JS,
   поэтому анимация и параллакс не конфликтуют. */
.orb { animation: orbFloat 16s ease-in-out infinite; }
.orb--2 { animation-duration: 20s; animation-delay: -5s; }
.orb--3 { animation-duration: 24s; animation-delay: -9s; }

@keyframes orbFloat {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -30px; }
}

/* Сканирующая световая полоса по hero */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(52, 211, 153, 0.05) 46%,
    rgba(94, 234, 212, 0.13) 50%,
    rgba(52, 211, 153, 0.05) 54%,
    transparent 100%);
  background-size: 100% 260%;
  background-repeat: no-repeat;
  mix-blend-mode: screen;
  animation: heroScan 9s linear infinite;
}

@keyframes heroScan {
  from { background-position: 0 130%; }
  to   { background-position: 0 -130%; }
}

/* Заголовок hero: градиент с бегущим блеском (только при поддержке) */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero__title {
    background: linear-gradient(100deg,
      #eafff7 0%,
      var(--accent-light) 22%,
      #ffffff 42%,
      var(--accent) 62%,
      #eafff7 82%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: titleShine 9s linear infinite;
  }
}

@keyframes titleShine {
  from { background-position: 220% center; }
  to   { background-position: -20% center; }
}

/* Пульсирующая точка у надписи секций */
.section__eyebrow { position: relative; }

.section__eyebrow::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  vertical-align: middle;
  animation: pulse 2.4s ease-in-out infinite;
}

/* Блик по «пилюле»-надписи hero */
.hero__eyebrow { position: relative; overflow: hidden; }

.hero__eyebrow::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(125, 240, 196, 0.30) 50%, transparent 65%);
  transform: translateX(-130%);
  animation: sheen 5.5s var(--ease) infinite;
}

@keyframes sheen {
  0%        { transform: translateX(-130%); }
  55%, 100% { transform: translateX(130%); }
}

/* Hi-tech рамка фото: вращающийся неоновый контур + луч сканера */
.hero__photo-frame { isolation: isolate; }

.hero__photo-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--angle),
    transparent 0deg,
    rgba(52, 211, 153, 0.9) 40deg,
    transparent 110deg,
    transparent 180deg,
    rgba(94, 234, 212, 0.9) 220deg,
    transparent 290deg,
    transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  animation: spinAngle 7s linear infinite;
}

@keyframes spinAngle { to { --angle: 360deg; } }

.hero__photo-frame::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  z-index: 2;
  height: 26%;
  border-radius: inherit;
  background: linear-gradient(180deg, transparent, rgba(94, 234, 212, 0.18), transparent);
  pointer-events: none;
  animation: photoScan 6s var(--ease) infinite;
}

@keyframes photoScan {
  0%   { transform: translateY(-20%); opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(300%); opacity: 0; }
}

/* Карточки: блик при наведении + подсветка-«glare», следующая за курсором */
.card { --mx: 50%; --my: 50%; }

.card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.22) 50%, transparent 58%);
  transform: translateX(-140%);
  transition: transform 0.75s var(--ease);
}

.card:hover .card__media::after,
.card:focus-within .card__media::after { transform: translateX(140%); }

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  background: radial-gradient(320px circle at var(--mx) var(--my),
    rgba(125, 240, 196, 0.16), transparent 62%);
}

.card:hover::after,
.card:focus-within::after { opacity: 1; }

/* Кнопки: световой блик, пробегающий по элементу при наведении */
.btn { overflow: hidden; }

.btn::before {
  content: '';
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -40%;
  width: 38%;
  pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-18deg);
  transition: left 0.6s var(--ease);
}

.btn:hover::before { left: 130%; }

/* Пилюли навыков: каскадное появление с «всплытием» */
.about__skill {
  opacity: 0;
  transform: translateY(14px) scale(0.96);
}

.about__skills.is-visible .about__skill {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.about__skills.is-visible .about__skill:nth-child(1) { transition-delay: 0.05s; }
.about__skills.is-visible .about__skill:nth-child(2) { transition-delay: 0.12s; }
.about__skills.is-visible .about__skill:nth-child(3) { transition-delay: 0.19s; }
.about__skills.is-visible .about__skill:nth-child(4) { transition-delay: 0.26s; }
.about__skills.is-visible .about__skill:nth-child(5) { transition-delay: 0.33s; }
.about__skills.is-visible .about__skill:nth-child(6) { transition-delay: 0.40s; }

.about__skills.is-visible .about__skill:hover { transform: translateY(-2px); }

/* Контактные карточки: неоновая линия сверху при наведении */
.contact-card { position: relative; overflow: hidden; }

.contact-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-bright), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}

.contact-card:hover::before,
.contact-card:focus-visible::before { transform: scaleX(1); }

/* Варианты появления при скролле (направление задаётся в разметке) */
.reveal { transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), filter 0.7s var(--ease); }
.reveal[data-reveal='left']  { transform: translateX(-36px); }
.reveal[data-reveal='right'] { transform: translateX(36px); }
.reveal[data-reveal='scale'] { transform: translateY(24px) scale(0.95); }
.reveal[data-reveal='blur']  { filter: blur(12px); }

.reveal.is-visible,
.no-js .reveal[data-reveal] {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Полоса прогресса чтения страницы (создаётся из JS) */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 120;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.75);
  pointer-events: none;
  will-change: transform;
}

/* Курсор-подсветка (только desktop, создаётся из JS) */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 560px;
  height: 560px;
  margin: -280px 0 0 -280px;
  border-radius: 50%;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  transition: opacity 0.4s ease;
  will-change: transform;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.12), rgba(52, 211, 153, 0) 62%);
}

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

/* На сенсорных экранах hover-эффекты и подсветка курсора не нужны */
@media (hover: none) {
  .card__media::after,
  .card::after,
  .btn::before,
  .contact-card::before { display: none; }
  .cursor-glow { display: none; }
}

/* Дополнительно отключаем декоративные анимации при reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .grid-lines,
  .orb,
  .hero::after,
  .hero__title,
  .hero__eyebrow::after,
  .hero__photo-frame::before,
  .hero__photo-frame::after,
  .section__eyebrow::before { animation: none !important; }

  .about__skill { opacity: 1 !important; transform: none !important; }
  .reveal[data-reveal] { opacity: 1; transform: none; filter: none; }
  .cursor-glow { display: none; }
}

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

/* Планшет и меньше */
@media (max-width: 1024px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero__title { max-width: 100%; }
  .hero__lead { max-width: 100%; }

  .hero__media {
    justify-self: start;
    max-width: 360px;
  }

  .about__inner { grid-template-columns: 1fr; }

  .about__photo-frame { max-width: 420px; }
  .about__card { margin-left: 0; }
}

/* Мобильное меню */
@media (max-width: 860px) {
  :root { --header-h: 68px; }

  .logo__img { height: 36px; }

  .burger { display: flex; }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 20px var(--gutter) 28px;
    background: rgba(6, 31, 26, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), visibility 0.28s;
  }

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

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

  .nav__link {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 17px;
  }

  .nav__link::after { display: none; }

  .nav__cta { display: inline-flex; }

  .hero__facts { grid-template-columns: 1fr; gap: 14px; }
  .hero__fact { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .hero__fact-label { margin-top: 0; }

  .scroll-hint { display: none; }
}

/* Телефоны */
@media (max-width: 640px) {
  body { font-size: 16px; }

  .hero {
    min-height: auto;
    padding-top: calc(var(--header-h) + 28px);
    padding-bottom: 64px;
  }

  .hero__inner { gap: 36px; }
  .hero__media { max-width: 100%; justify-self: center; }
  .hero__badge { left: 8px; bottom: 14px; padding: 10px 14px; font-size: 13px; }

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

  .form__row { grid-template-columns: 1fr; gap: 0; }

  .modal { padding: 12px; align-items: end; }

  .modal__dialog {
    max-height: 92vh;
    padding: 28px 20px 24px;
    border-radius: var(--radius-lg) var(--radius-lg) 16px 16px;
  }

  .footer__inner { flex-direction: column; align-items: flex-start; }
  .footer__to-top { position: absolute; right: var(--gutter); }

  /* Оверлей не перекрывает превью: текст идёт под картинкой */
  .card__media { aspect-ratio: auto; }
  .card__img { display: block; height: auto; aspect-ratio: 16 / 10; }
  .card__overlay {
    position: static;
    opacity: 1;
    transform: none;
    padding: 16px 18px;
    gap: 7px;
  }
  .card:hover .card__img { transform: none; }
  .card:hover { transform: none; }
}

/* Очень узкие экраны */
@media (max-width: 400px) {
  .hero__title { font-size: 30px; }
  .contact-card { padding: 24px 22px; }
  .contact-card__value { font-size: 17px; }
}

/* --------------------------------------------------------------------------
   14. Доступность: меньше движения — по запросу системы
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::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; }

  .hero__title .word {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* Печать */
@media print {
  .site-header,
  .modal,
  .scroll-hint,
  .hero__bg { display: none; }

  body { background: #fff; color: #000; }
}
