/* Премиальный слой: плавный скролл, типографика, глубина, микровзаимодействия. */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

/* глубина: зерно, виньетка, свет за курсором, полоса прогресса */
.fx-grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 95;
  opacity: 0.055;
  will-change: transform;
  animation: fx-grain 1.2s steps(6) infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes fx-grain {
  0% {
    transform: translate(0, 0);
  }

  20% {
    transform: translate(-4%, 3%);
  }

  40% {
    transform: translate(3%, -5%);
  }

  60% {
    transform: translate(-5%, -2%);
  }

  80% {
    transform: translate(4%, 4%);
  }

  100% {
    transform: translate(0, 0);
  }
}

.fx-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 94;
  background: radial-gradient(ellipse at 50% 42%, transparent 55%, rgb(2 4 10 / 36%) 100%);
}

.fx-light {
  position: fixed;
  left: 0;
  top: 0;
  width: 640px;
  height: 640px;
  margin: -320px 0 0 -320px;
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s;
  background: radial-gradient(circle, rgb(110 160 255 / 13%), transparent 62%);
  will-change: transform;
}

.fx-light.on {
  opacity: 1;
}

.fx-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, #8bb5ff, #d4e3ff);
  z-index: 96;
  pointer-events: none;
}

/* появление заголовков по словам */
.fx-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}

.fx-word > span {
  display: inline-block;
  transform: translateY(108%) rotate(3deg);
  transform-origin: 0 100%;
  transition: transform 1s cubic-bezier(0.2, 0.75, 0.25, 1);
  transition-delay: calc(var(--i, 0) * 60ms);
}

.fx-split.in .fx-word > span {
  transform: none;
}

/* появление блоков */
.fx-up {
  opacity: 0;
  transform: translateY(34px);
  transition:
    opacity 0.9s ease,
    transform 1s cubic-bezier(0.2, 0.75, 0.25, 1),
    background 0.25s;
  transition-delay: var(--d, 0ms);
}

.fx-up.in {
  opacity: 1;
  transform: none;
}

/* подсветка карточек за курсором */
.service,
.panel,
.step {
  position: relative;
}

.service::before,
.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.35s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgb(139 181 255 / 12%), transparent 60%);
}

.service:hover::before,
.panel:hover::before {
  opacity: 1;
}

.service > *,
.panel > * {
  position: relative;
}

/* кнопки */
.btn,
.header-cta {
  will-change: transform;
}

.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 55%), transparent);
  transition: left 0.7s ease;
}

.btn-primary:hover::after {
  left: 130%;
}

/* бегущая строка */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 26px 0;
  margin: 0 calc(50% - 50vw + var(--sbw, 0px) / 2);
  user-select: none;
}

.marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.marquee-track span {
  font-size: clamp(56px, 9vw, 150px);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgb(170 190 230 / 38%);
  padding: 0 0.28em;
  white-space: nowrap;
  transition:
    color 0.4s,
    -webkit-text-stroke-color 0.4s;
}

.marquee-track span:nth-child(4n + 3) {
  color: var(--blue);
  -webkit-text-stroke: 0;
}

.marquee-track i {
  align-self: center;
  color: var(--blue);
  font-style: normal;
  font-size: clamp(24px, 3vw, 44px);
}

/* гигантская надпись в подвале */
.mega {
  font-size: clamp(120px, 27vw, 430px);
  font-weight: 800;
  letter-spacing: -0.085em;
  line-height: 0.78;
  text-align: center;
  margin: 30px 0 -0.1em;
  padding-bottom: 0.08em;
  user-select: none;
  pointer-events: none;
  background: linear-gradient(180deg, rgb(139 181 255 / 42%), rgb(139 181 255 / 4%) 82%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  overflow: hidden;
}

@media (width <= 760px) {
  .marquee {
    padding: 16px 0;
  }

  .fx-light {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fx-grain {
    animation: none;
  }

  .fx-word > span {
    transform: none;
    transition: none;
  }

  .fx-up {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .fx-light,
  .fx-progress {
    display: none;
  }
}

body {
  overflow-x: clip;
}

/* типографическая система: гротеск Manrope + курсивный засечный акцент */
:root {
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
}

h1 em,
h2 em,
.contact h2 span,
.about h2 span {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.025em;
  font-size: 1.14em;
  line-height: 0.9;
}

.hero h1,
.page-hero h1 {
  text-wrap: balance;
}

.section-heading h2,
.about h2,
.contact h2 {
  text-wrap: balance;
}

.mono {
  font-feature-settings: 'zero' 1;
}

/* визуалы концептов Lumen и Pulse */
.lumen {
  background: radial-gradient(ellipse at 70% 30%, #2a1b10, #0d0a0c 70%);
  color: #f3e6d3;
}

.lumen .mockup-browser {
  background: #ffffff0a;
}

.lumen-body {
  position: relative;
  padding: 22px 26px;
  height: calc(100% - 29px);
  overflow: hidden;
}

.lumen-nav {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 0.14em;
}

.lumen-body h3 {
  font-size: 40px;
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.05em;
  margin-top: 34px;
}

.lumen-body h3 em {
  font-family: var(--serif);
  font-weight: 500;
  color: #ffc27a;
  font-size: 1.12em;
}

.lamp {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff6e0, #ffc27a 45%, #d9822b 100%);
  box-shadow:
    0 0 60px 20px #ffb35a66,
    0 0 160px 60px #ff9a3a33;
}

.l1 {
  width: 84px;
  height: 84px;
  right: 12%;
  top: 12%;
}

.l2 {
  width: 46px;
  height: 46px;
  right: 36%;
  top: 52%;
  opacity: 0.9;
}

.l3 {
  width: 30px;
  height: 30px;
  right: 8%;
  bottom: 14%;
  opacity: 0.8;
}

.pulse {
  background: linear-gradient(135deg, #ff2d7a, #ff8a3d 55%, #ffd23d);
  color: #150a1c;
}

.pulse .mockup-browser {
  background: #0000001a;
  border-color: #00000018;
}

.pulse .mockup-browser i {
  background: #0006;
}

.pulse-body {
  position: relative;
  padding: 22px 26px;
  height: calc(100% - 29px);
  overflow: hidden;
}

.pulse-nav {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.pulse-title {
  font-size: min(30vw, 138px);
  font-weight: 800;
  letter-spacing: -0.08em;
  line-height: 0.9;
  margin-top: 22px;
}

.wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 92px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 0 26px;
}

.wave i {
  flex: 1;
  background: #150a1c;
  border-radius: 4px 4px 0 0;
  height: 30%;
  animation: wave 1.6s ease-in-out infinite;
}

.wave i:nth-child(3n) {
  animation-delay: -0.4s;
}

.wave i:nth-child(3n + 1) {
  animation-delay: -0.9s;
}

.wave i:nth-child(2n) {
  animation-duration: 1.2s;
}

@keyframes wave {
  50% {
    height: 92%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wave i {
    animation: none;
  }
}

/* горизонтальная галерея: закреплённый экран, лента едет по скроллу */
.hscroll {
  position: relative;
  height: calc(var(--n, 4) * 62vh + 100vh);
  border-top: 1px solid var(--line);
  margin: 0 calc(50% - 50vw + var(--sbw, 0px) / 2);

  --gut: max(56px, calc((100vw - var(--sbw, 0px) - 1320px) / 2));
}

.hsticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 34px;
}

.hhead {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 40px;
  padding-top: 10px;
  padding-left: var(--gut);
  padding-right: var(--gut);
}

.hhead h2 {
  font-size: clamp(36px, 4.5vw, 64px);
  line-height: 1.12;
  letter-spacing: -0.05em;
  font-weight: 500;
  margin-top: 18px;
}

.hhead p {
  max-width: 300px;
  color: var(--muted);
  font-size: 13px;
}

.hcount {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.htrack {
  display: flex;
  gap: 30px;
  will-change: transform;
  padding-right: 8vw;
  padding-left: var(--gut);
}

.work {
  flex: none;
  width: min(540px, 78vw);
  display: block;
}

.work .mockup {
  height: min(46vh, 360px);
}

.work-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.work-meta h3 {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.work-meta p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.work-go {
  align-self: center;
  font-size: 11px;
  color: var(--blue);
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.work:hover .mockup {
  transform: translateY(-6px);
}

.hbar {
  height: 2px;
  background: var(--line);
  position: relative;
  margin-top: 2px;
}

.hbar i {
  position: absolute;
  inset: 0;
  background: var(--blue);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

@media (width <= 760px) {
  .hscroll {
    height: auto;
  }

  .hsticky {
    position: static;
    height: auto;
    overflow: visible;
    padding: 56px 0;
  }

  .hhead {
    display: block;
  }

  .htrack {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0 20px 14px;
    margin: 0 -20px;
    transform: none !important;
  }

  .work {
    scroll-snap-align: start;
  }

  .hbar {
    display: none;
  }
}

/* страницы кейсов */
.case-hero {
  padding: 90px 0 40px;
}

.case-hero h1 {
  font-size: clamp(64px, 11vw, 170px);
  line-height: 0.95;
  letter-spacing: -0.07em;
  font-weight: 600;
  margin: 24px 0 18px;
}

.case-hero .lead {
  max-width: 560px;
  color: #bcc5d8;
  font-size: 16px;
  line-height: 1.8;
}

.case-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 34px 0 0;
}

.case-meta b {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.case-visual {
  margin: 50px 0;
}

.case-visual .mockup {
  height: min(70vh, 560px);
}

.case-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
}

.case-grid h2 {
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.045em;
  font-weight: 500;
  margin-top: 18px;
}

.case-grid p {
  color: #b2bccf;
  font-size: 15px;
  line-height: 1.85;
}

.next-case {
  display: block;
  border-top: 1px solid var(--line);
  padding: 70px 0;
  text-align: left;
}

.next-case small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.next-case span {
  display: block;
  font-size: clamp(48px, 9vw, 140px);
  font-weight: 600;
  letter-spacing: -0.07em;
  line-height: 1;
  margin-top: 16px;
  transition:
    color 0.3s,
    transform 0.5s cubic-bezier(0.2, 0.75, 0.25, 1);
}

.next-case:hover span {
  color: var(--blue);
  transform: translateX(18px);
}

@media (width <= 760px) {
  .case-meta {
    grid-template-columns: 1fr;
  }

  .case-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .case-hero {
    padding: 56px 0 20px;
  }
}

.hfoot {
  padding: 0 var(--gut);
  display: flex;
  align-items: center;
  gap: 20px;
}

.hfoot .hbar {
  flex: 1;
}

@media (width <= 760px) {
  .hscroll {
    --gut: 20px;
  }

  .hfoot {
    display: none;
  }
}
