/* ============================================================
   Сергей Крапивин · Портфолио — общие стили
   ============================================================ */

:root {
  /* Цвета — светлая тема v2: приглушённая мята + лаванда */
  --bg-0: #e4f2eb;            /* мягкий мятный фон */
  --bg-1: #d9ebe3;            /* нижняя часть градиента фона */
  --bg-2: #ebe6f4;            /* плашки/карточки */
  --bg-3: #f4f1fa;            /* внутренний фон (чипы, плеер) */
  --card-end: #e2dcf0;        /* низ градиента плашек */
  --header-bg: rgba(228, 242, 235, 0.88);
  --header-bg-scrolled: rgba(228, 242, 235, 0.96);
  --border: rgba(61, 53, 80, 0.1);
  --border-strong: rgba(61, 53, 80, 0.18);

  --text: #1a1330;
  --text-dim: #1a1330;
  --text-muted: #6a6278;

  --accent: #d45f0f;          /* оранжевый — кнопки и hover */
  --accent-bright: #ff9f43;     /* более чистый оранжевый для кнопок */
  --accent-btn: color-mix(in srgb, var(--accent) 46%, var(--accent-bright));
  --accent-btn-hover: color-mix(in srgb, var(--accent) 58%, var(--accent-bright));
  --accent-soft: rgba(212, 95, 15, 0.1);
  --accent-glow: rgba(212, 95, 15, 0.22);
  --accent-glow-strong: rgba(212, 95, 15, 0.38);
  --tag-bg: rgba(255, 255, 255, 0.72);
  --tag-text: #443d5c;

  /* Радиусы */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;

  /* Тени — мягкие, для светлой темы */
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.65) inset, 0 16px 36px -24px rgba(50, 40, 80, 0.14);
  --shadow-hover: 0 1px 0 rgba(255, 255, 255, 0.7) inset,
                  0 0 0 1px var(--accent),
                  0 20px 60px -10px var(--accent-glow),
                  0 30px 80px -30px var(--accent-glow-strong);

  /* Анимации */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 180ms;
  --dur-base: 320ms;
  --dur-slow: 600ms;

  --feature-panel-min-height: clamp(520px, 40vh, 600px);
}

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

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Фоновый glow — едва заметный, не нагружает */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 80% -10%, rgba(210, 200, 230, 0.28), transparent 60%),
    radial-gradient(ellipse 50% 35% at 0% 100%, rgba(190, 220, 205, 0.28), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ============================================================
   Шапка
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}

.header.is-scrolled {
  background: var(--header-bg-scrolled);
  border-bottom-color: var(--border-strong);
}

.header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo__img {
  display: block;
  height: 56px;
  width: auto;
  transition: transform var(--dur-base) var(--ease-out);
}

.logo:hover .logo__img {
  transform: scale(1.03);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  margin-left: auto;
  min-width: 0;
}

.nav-toggle,
.btn.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-toggle__icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 22px;
}

.nav-toggle__bar {
  display: block;
  height: 2px;
  width: 22px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}

.nav-toggle.is-active .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-active .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

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

.nav .btn.nav__link {
  position: relative;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
}

.nav .btn.nav__link:hover {
  transform: none;
  box-shadow: none;
}

.btn.nav-toggle:hover {
  transform: none;
  box-shadow: none;
}

.nav__link.is-active {
  border-color: var(--border-strong);
  background: var(--bg-3);
  color: var(--text);
}

.nav__link.is-active::after {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 6px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

@media (max-width: 1180px) {
  .nav .btn.nav__link {
    padding: 8px 12px;
    font-size: 13px;
  }

  .nav__link.is-active::after {
    left: 12px;
    right: 12px;
  }
}

@media (max-width: 920px) {
  .nav-toggle,
  .btn.nav-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 60;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-left: 0;
    padding: 12px 18px 16px;
    background: var(--header-bg-scrolled);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 32px rgba(11, 18, 32, 0.12);
  }

  .nav.is-mobile-open {
    display: flex;
  }

  .nav .btn.nav__link {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 14px;
  }

  .nav__link.is-active::after {
    left: 16px;
    right: 16px;
  }
}

/* ============================================================
   Hero — split: портрет + текст
   ============================================================ */
.hero {
  padding: 40px 0 36px;
}

.hero__panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(300px, 1.05fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  padding: clamp(24px, 4vw, 40px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, rgba(244, 241, 250, 0.85) 48%, rgba(235, 230, 244, 0.95) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  isolation: isolate;
  transition: border-color var(--dur-slow) var(--ease-out), box-shadow var(--dur-slow) var(--ease-out);
}

.hero__panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 60% at 18% 42%, rgba(212, 95, 15, 0.16), transparent 58%),
    radial-gradient(ellipse 60% 50% at 88% 18%, rgba(160, 185, 230, 0.32), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.hero__panel::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0.42;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 160px 160px;
}

.hero__panel:hover {
  border-color: rgba(212, 95, 15, 0.35);
  box-shadow: var(--shadow-hover);
}

.hero__visual {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: end center;
  min-height: 320px;
}

.hero__glow {
  position: absolute;
  width: min(98%, 440px);
  aspect-ratio: 1;
  bottom: 4%;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 35%, rgba(255, 255, 255, 1) 0%, transparent 38%),
    radial-gradient(circle at 50% 62%, rgba(212, 95, 15, 0.34) 0%, transparent 56%),
    radial-gradient(circle at 62% 38%, rgba(170, 150, 210, 0.5) 0%, transparent 60%);
  filter: blur(18px);
  animation: hero-glow-pulse 5s var(--ease-in-out) infinite alternate;
}

.hero__portrait {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  height: auto;
  max-height: min(72vh, 560px);
  object-fit: contain;
  object-position: bottom center;
  filter:
    drop-shadow(0 32px 48px rgba(212, 95, 15, 0.14))
    drop-shadow(0 24px 36px rgba(40, 30, 60, 0.2));
  animation: hero-float 5s var(--ease-in-out) infinite alternate;
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(8px, 2vw, 16px) 0;
}

.hero__title {
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--text);
  max-width: 22em;
}

.hero__title-line {
  display: block;
}

.hero__quote {
  margin: 0;
  font-size: clamp(1.0625rem, 1.9vw, 1.25rem);
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-dim);
  max-width: 36ch;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
}

.hero__quote p {
  margin: 0;
}

.hero__byline {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.hero__socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.btn:focus-visible,
.nav__link:focus-visible,
.footer__social:focus-visible,
.nav-toggle:focus-visible,
.logo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@keyframes hero-float {
  from { transform: translateY(0); }
  to   { transform: translateY(-8px); }
}

@keyframes hero-glow-pulse {
  from { opacity: 0.9; transform: translateX(-50%) scale(1); }
  to   { opacity: 1; transform: translateX(-50%) scale(1.09); }
}

@media (max-width: 920px) {
  .hero__panel {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 24px 20px 28px;
  }

  .hero__visual {
    min-height: 280px;
  }

  .hero__portrait {
    max-height: 420px;
  }
}

@media (max-width: 560px) {
  .hero {
    padding: 24px 0 20px;
  }

  .hero__panel {
    padding: 18px 16px 22px;
  }

  .hero__visual {
    min-height: 240px;
  }

  .hero__portrait {
    max-height: 360px;
  }

  .hero__actions {
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   Проекты — плашки в стиле hero
   ============================================================ */
.projects {
  padding: 8px 0 48px;
}

.projects__title {
  margin: 0 0 28px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.projects__list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.project-panel {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  padding: clamp(24px, 4vw, 40px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, rgba(244, 241, 250, 0.85) 48%, rgba(235, 230, 244, 0.95) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  isolation: isolate;
  transition: border-color var(--dur-slow) var(--ease-out), box-shadow var(--dur-slow) var(--ease-out);
}

.project-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 60% at 18% 42%, rgba(212, 95, 15, 0.16), transparent 58%),
    radial-gradient(ellipse 60% 50% at 88% 18%, rgba(160, 185, 230, 0.32), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.project-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0.42;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 160px 160px;
}

.project-panel:hover {
  border-color: rgba(212, 95, 15, 0.35);
  box-shadow: var(--shadow-hover);
}

.project-panel__media {
  position: relative;
  z-index: 1;
  min-width: 0;
  width: 100%;
  aspect-ratio: 16 / 10;
  align-self: center;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #18181b;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.project-panel__media video,
.project-panel__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-panel__media img {
  object-position: top center;
}

/* Скриншот сайта — без тёмной подложки, обложка по центру карточки */
.project-panel__media--screenshot:not(.project-panel__media--screenshot-agro) {
  aspect-ratio: unset;
  height: auto;
  align-self: center;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  transition: transform var(--dur-slow) var(--ease-out);
}

.project-panel__media--screenshot:not(.project-panel__media--screenshot-agro)::before,
.project-panel__media--screenshot:not(.project-panel__media--screenshot-agro)::after {
  display: none;
}

.project-panel__media--screenshot:not(.project-panel__media--screenshot-agro) img {
  position: relative;
  z-index: 0;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
  padding: 0;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-slow) var(--ease-out),
              border-color var(--dur-slow) var(--ease-out),
              box-shadow var(--dur-slow) var(--ease-out);
}

/* Презентация АгроБоты — тёмная подложка под скрин */
.project-panel__media--screenshot {
  aspect-ratio: unset;
  height: auto;
  transition: box-shadow var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}

.project-panel__media--screenshot-agro {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0d1a12 0%, #142a1a 55%, #0f1f14 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.project-panel__media--screenshot-agro::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 70% 55% at 18% 12%, rgba(120, 200, 140, 0.16), transparent 58%),
    radial-gradient(ellipse 55% 45% at 82% 88%, rgba(80, 160, 100, 0.12), transparent 55%);
  opacity: 0.75;
  transition: opacity var(--dur-slow) var(--ease-out);
  pointer-events: none;
}

.project-panel__media--screenshot-agro::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    115deg,
    transparent 38%,
    rgba(255, 255, 255, 0.14) 50%,
    transparent 62%
  );
  transform: translateX(-130%);
  transition: transform 0.75s var(--ease-out);
  pointer-events: none;
}

.project-panel__media--screenshot-agro img {
  position: relative;
  z-index: 0;
  width: auto;
  max-width: calc(100% - clamp(8px, 1.6vw, 16px));
  max-height: calc(100% - clamp(8px, 1.6vw, 16px));
  height: auto;
  object-fit: contain;
  object-position: center;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  transition: transform var(--dur-slow) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .project-panel__media--screenshot:not(.project-panel__media--screenshot-agro):hover img {
    transform: scale(1.02);
    border-color: rgba(212, 95, 15, 0.35);
    box-shadow: var(--shadow-hover);
  }

  .project-panel__media--screenshot-agro:hover {
    box-shadow:
      inset 0 0 0 1px rgba(212, 95, 15, 0.28),
      0 16px 42px rgba(11, 18, 32, 0.42);
  }

  .project-panel__media--screenshot-agro:hover::before {
    opacity: 1;
  }

  .project-panel__media--screenshot-agro:hover::after {
    transform: translateX(130%);
  }

  .project-panel__media--screenshot-agro:hover img {
    transform: scale(1.025);
  }
}

.project-panel__hint {
  display: none;
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 2;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(8px);
  padding: 6px 10px;
  border-radius: 100px;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out);
}

.project-panel__media.is-playing .project-panel__hint {
  opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
  .project-panel__hint {
    display: block;
  }
}

.project-panel__body {
  position: relative;
  z-index: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(4px, 1vw, 8px) 0;
}

.project-panel__details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
}

.project-panel__tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 6px 12px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-panel__tag::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}

.project-panel__title {
  margin: 0;
  font-size: clamp(1.0625rem, 2vw, 1.375rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}

.project-panel__block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-panel__label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.project-panel__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-dim);
}

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

.project-panel__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  padding-top: 4px;
}

@media (min-width: 921px) {
  .hero__panel,
  .project-panel {
    grid-template-columns: minmax(260px, 0.95fr) minmax(300px, 1.05fr);
    align-items: stretch;
    min-height: var(--feature-panel-min-height);
  }

  .hero__visual {
    min-height: 400px;
    height: 100%;
    align-self: stretch;
  }

  .hero__content {
    align-self: center;
  }

  .project-panel__media {
    min-height: 400px;
    height: 100%;
    aspect-ratio: unset;
    align-self: stretch;
  }

  .project-panel__media--screenshot {
    min-height: unset;
    height: auto;
    align-self: center;
  }

  .project-panel__media--screenshot-agro {
    align-self: stretch;
    height: 100%;
    min-height: 400px;
  }

  .project-panel__body {
    flex: 1;
    gap: 16px;
    padding: clamp(8px, 2vw, 16px) 0;
    justify-content: flex-start;
    align-self: stretch;
  }

  .project-panel__details {
    gap: 14px 28px;
    flex: 1;
    align-content: start;
  }

  .project-panel__title {
    font-size: clamp(1.1875rem, 2.25vw, 1.5625rem);
  }

  .project-panel__label {
    font-size: 13.5px;
  }

  .project-panel__text {
    font-size: 15px;
    line-height: 1.55;
  }

  .project-panel__block {
    gap: 6px;
  }

  .project-panel__footer {
    margin-top: auto;
    padding-top: 10px;
  }
}

/* Контакты */
.contact {
  padding: 8px 0 80px;
}

/* Чем могу помочь */
.services {
  padding: 8px 0 48px;
}

.services__panel.project-panel {
  display: block;
  min-height: auto;
}

.services__grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 28px) clamp(24px, 4vw, 40px);
}

.services__item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.services__heading {
  margin: 0;
  font-size: clamp(1rem, 1.8vw, 1.125rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
}

.services__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-dim);
}

@media (min-width: 921px) {
  .services__panel.project-panel {
    padding: clamp(28px, 4vw, 40px);
    min-height: auto;
  }

  .services__text {
    font-size: 15px;
    line-height: 1.55;
  }

  .services__item {
    gap: 10px;
  }
}

@media (max-width: 920px) {
  .services__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Инженерный подход */
.approach {
  padding: 8px 0 48px;
}

.approach__panel.project-panel {
  display: block;
  min-height: auto;
}

.approach__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 72ch;
}

.approach__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
}

.approach__text--lead {
  font-size: clamp(1rem, 1.85vw, 1.125rem);
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

@media (min-width: 921px) {
  .approach__panel.project-panel {
    padding: clamp(28px, 4vw, 40px);
    min-height: auto;
  }

  .approach__content {
    gap: 18px;
  }

  .approach__text {
    font-size: 15px;
    line-height: 1.6;
  }
}

/* Основные инструменты */
.toolkit {
  padding: 8px 0 48px;
}

.toolkit__panel.project-panel {
  display: block;
  min-height: auto;
}

.toolkit__chips {
  position: relative;
  z-index: 2;
  gap: 12px;
}

.toolkit__chips .chip {
  padding: 8px 16px;
  font-size: 18px;
  font-weight: 500;
}

@media (min-width: 921px) {
  .toolkit__panel.project-panel {
    padding: clamp(28px, 4vw, 40px);
    min-height: auto;
  }
}

.contact__panel.project-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
  min-height: auto;
}

.contact__copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact__lead {
  position: relative;
  z-index: 2;
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dim);
}

.contact__links {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (min-width: 921px) {
  .contact__panel.project-panel {
    padding: clamp(28px, 4vw, 40px);
    min-height: auto;
  }

  .contact__lead {
    font-size: clamp(14px, 1.05vw, 16px);
  }
}

@media (max-width: 560px) {
  .contact__links {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }

  .contact__links .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 920px) {
  .projects__list {
    gap: 32px;
  }

  .project-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 16px;
    padding: 24px 20px 28px;
  }

  .project-panel__media {
    max-height: none;
    aspect-ratio: 16 / 10;
  }

  .project-panel__media--screenshot {
    aspect-ratio: unset;
    height: auto;
  }

  .project-panel__details {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 560px) {
  .project-panel__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .project-panel__footer .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   Сетка главных кейсов (HIB + devyourint) — плашки одна под другой
   ============================================================ */
.case-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.case-grid .section {
  text-decoration: none;
  color: inherit;
}

.case-grid .section__media {
  aspect-ratio: 16 / 10;
  background: var(--bg-3);
  overflow: hidden;
}

.section__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.case-grid .section:hover .section__img {
  transform: scale(1.05);
}

/* ============================================================
   Плашки категорий (Видео / Презентации / Музыка)
   ============================================================ */
.sections {
  padding: 24px 0 80px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.section {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--card-end) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-slow) var(--ease-out),
              box-shadow var(--dur-slow) var(--ease-out),
              border-color var(--dur-slow) var(--ease-out);
}

.section:nth-child(even) {
  grid-template-columns: 1fr 1.1fr;
}

.section:nth-child(even) .section__media {
  order: 2;
}

.section__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-3);
  overflow: hidden;
}

.section__media video,
.section__media .svg-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.section:hover .section__media video {
  transform: scale(1.05);
}

.section__body {
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.section__tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 6px 12px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section__tag::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}

.section__title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.section__desc {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.65;
  max-width: 480px;
}

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

.chip {
  padding: 5px 11px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-dim);
}

.section__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--accent-btn);
  color: #0a0a0c;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--accent-btn);
  border-radius: 12px;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.btn:hover {
  transform: translateY(-2px);
  background: var(--accent-btn-hover);
  border-color: var(--accent-btn-hover);
  box-shadow: 0 10px 30px -8px var(--accent-glow-strong);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(212, 95, 15, 0.06);
  box-shadow: none;
}

.btn__arrow {
  transition: transform var(--dur-fast) var(--ease-out);
}

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

/* SVG-обложка презентации */
.svg-cover {
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--bg-3) 0%, var(--card-end) 100%);
}

.svg-cover__inner {
  position: relative;
  width: 78%;
  aspect-ratio: 1 / 1.414;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 25px 60px -20px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 10% 8% 8%;
  color: #111;
  transform: rotate(-4deg) translateY(0);
  transition: transform var(--dur-slow) var(--ease-out);
}

.section:hover .svg-cover__inner {
  transform: rotate(-2deg) translateY(-6px);
}

.svg-cover__title {
  font-size: clamp(7px, 1.1vw, 12px);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 4px;
  color: #0a0a0c;
}

.svg-cover__bar {
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  width: 50%;
  margin-bottom: 8px;
}

.svg-cover__lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.svg-cover__line {
  height: 2px;
  background: #d4d4d8;
  border-radius: 1px;
}

.svg-cover__line--short { width: 60%; }
.svg-cover__line--mid   { width: 80%; }
.svg-cover__line--full  { width: 100%; }

.svg-cover__chart {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 22%;
}

.svg-cover__bar-col {
  flex: 1;
  background: linear-gradient(180deg, var(--accent) 0%, #ff4d00 100%);
  border-radius: 2px 2px 0 0;
  opacity: 0.85;
}

/* Ховер-видео (Lux Jiva) */
.video-card {
  position: relative;
  cursor: pointer;
}

.video-card__overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.0) 0%, rgba(0, 0, 0, 0.4) 100%);
  z-index: 2;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out);
}

.video-card__play {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 40px -8px rgba(0, 0, 0, 0.6);
  transition: transform var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
}

.video-card__play svg {
  width: 22px;
  height: 22px;
  color: #0a0a0c;
  margin-left: 3px;
}

.video-card:hover .video-card__play {
  transform: scale(1.08);
  background: var(--accent);
}

.video-card:hover .video-card__play svg {
  color: #0a0a0c;
}

.video-card.is-playing .video-card__overlay {
  opacity: 0;
}

/* Нативный плеер (video.html) — без overlay-кнопки */
[data-native-player] .video-card__overlay {
  display: none;
}

[data-native-player] video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

[data-native-player] .video-card__hint {
  opacity: 0;
  pointer-events: none;
}

.video-card__hint {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 2;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  padding: 6px 10px;
  border-radius: 100px;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out);
}

.video-card.is-playing .video-card__hint {
  opacity: 0;
}

/* Каталог видео (video.html) */
.video-catalog {
  padding: 0 0 80px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.video-catalog__item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.video-catalog__heading {
  margin: 0;
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

#video-top,
#lux-jiva,
#more-presentations,
#more-websites,
#more-videos {
  scroll-margin-top: 88px;
}

.video-catalog .project-panel {
  min-height: auto;
}

.video-catalog .project-panel__media--player {
  aspect-ratio: unset;
  height: auto;
  align-self: start;
  background: #0a0a0c;
  cursor: default;
}

.video-catalog .project-panel__media--player video {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #000;
}

@media (min-width: 921px) {
  .video-catalog .project-panel__media--player {
    min-height: unset;
  }

  .video-catalog__item--media-vcenter .project-panel {
    align-items: center;
  }

  .video-catalog__item--media-vcenter .project-panel__media--player {
    align-self: center;
  }
}

@media (max-width: 920px) {
  .video-catalog .project-panel__media--player {
    aspect-ratio: unset;
  }
}

/* Аудио-плеер */
.audio-card {
  position: relative;
}

.audio-card__player {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.audio-card__btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #0a0a0c;
  display: grid;
  place-items: center;
  transition: transform var(--dur-fast) var(--ease-out);
}

.audio-card__btn:hover {
  transform: scale(1.06);
}

.audio-card__btn svg {
  width: 16px;
  height: 16px;
}

.audio-card__btn .icon-pause { display: none; }
.audio-card.is-playing .audio-card__btn .icon-play  { display: none; }
.audio-card.is-playing .audio-card__btn .icon-pause { display: block; }

.audio-card__info {
  flex: 1;
  min-width: 0;
}

.audio-card__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-card__artist {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.audio-card__progress {
  flex-basis: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 4px;
  cursor: pointer;
  position: relative;
}

.audio-card__progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 100px;
  transition: width 120ms linear;
}

.audio-card__time {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.audio-card__pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
}

.audio-card.is-playing .audio-card__pulse {
  animation: pulse 1.6s var(--ease-out) infinite;
}

@keyframes pulse {
  0%   { opacity: 0.4; transform: translate(-50%, -50%) scale(0.8); }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(1.8); }
}

/* ============================================================
   Футер
   ============================================================ */
.footer {
  padding: 48px 0 64px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}

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

.footer__text {
  color: var(--text-muted);
  font-size: 13px;
}

.footer__socials {
  display: flex;
  gap: 8px;
}

.footer__social {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-dim);
  transition: all var(--dur-fast) var(--ease-out);
}

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

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

/* ============================================================
   Scroll-reveal
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Форма заявки (mailto:)
   ============================================================ */
.form {
  display: grid;
  gap: 16px;
  max-width: 560px;
  margin-top: 4px;
}

.form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.form__input,
.form__textarea,
.form__select {
  font: inherit;
  color: var(--text);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  width: 100%;
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow   var(--dur-fast) var(--ease-out),
              background   var(--dur-fast) var(--ease-out);
}

.form__input::placeholder,
.form__textarea::placeholder {
  color: var(--text-muted);
}

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

.form__input:focus,
.form__textarea:focus,
.form__select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: #fff;
}

.form__textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.form__select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
  cursor: pointer;
}

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

  .hero__portrait,
  .hero__glow,
  .audio-card__pulse {
    animation: none;
  }

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

  .btn:hover,
  .btn:hover .btn__arrow,
  .footer__social:hover,
  .logo:hover .logo__img {
    transform: none;
  }
}

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 920px) {
  .section,
  .section:nth-child(even) {
    grid-template-columns: 1fr;
  }

  .section:nth-child(even) .section__media {
    order: 0;
  }

  .section__media {
    aspect-ratio: 16 / 9;
  }

  .section__body {
    padding: 28px 24px;
  }

  .form { max-width: none; }
}

@media (max-width: 560px) {
  .container { padding: 0 18px; }

  .header__inner { height: 60px; }
  .logo__img { height: 50px; }

  .hero { padding: 24px 0 20px; }

  .hero__panel {
    padding: 18px 16px 22px;
  }

  .sections { gap: 20px; padding: 20px 0 60px; }
  .section__body { padding: 24px 20px; gap: 16px; }
  .section__footer { flex-direction: column; align-items: flex-start; gap: 12px; }
  .btn:not(.nav-toggle) { width: 100%; justify-content: center; }

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

/* ============================================================
   Страницы категорий
   ============================================================ */
.page-header {
  padding: 56px 0 24px;
}

.page-header__title {
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--text);
}

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

.page-header__lead {
  color: var(--text);
  font-size: 16px;
  max-width: 620px;
}

.page-header--wide .page-header__lead {
  max-width: none;
}

.websites-page {
  padding-top: 0;
}

.presentations-page {
  padding-top: 0;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.crumbs a {
  color: var(--text);
}

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

.crumbs__sep {
  color: var(--text);
  opacity: 0.45;
}

.certificates {
  padding: 24px 0 80px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.certificates__heading {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
  color: var(--text);
}

.certificate-item {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 36px;
}

.certificate-item:last-child {
  margin-bottom: 0;
}

.certificate-item__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.certificate-item__img {
  width: 100%;
  max-width: 880px;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-3);
  box-shadow: var(--shadow-card);
}

.works-anchor {
  scroll-margin-top: 88px;
}

.projects__list > .project,
.video-catalog__item {
  position: relative;
}

.project > .works-anchor,
.video-catalog__item > .works-anchor {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.works {
  padding: 24px 0 80px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.work-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--card-end) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.work-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-3);
  overflow: hidden;
}

a.work-card__media {
  display: block;
  text-decoration: none;
  color: inherit;
}

.work-card__media video,
.work-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.work-card:hover .work-card__media img {
  transform: scale(1.05);
}

.work-card__body {
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.work-card__title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.work-card__desc {
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
}

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

@media (max-width: 920px) {
  .work-card { grid-template-columns: 1fr; }
  .work-card__media { aspect-ratio: 16 / 9; }
  .work-card__body { padding: 28px 24px; }
}
