/* =========================================================
   ANDREIKO — Agency / hero screen
   Макет: 1920 × 961.5. Все размеры считаются от ширины
   вьюпорта через --u (1u = 1px при 1920).
   ========================================================= */

@font-face {
  font-family: "Benzin";
  src: url("../assets/benzin-bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sonko";
  src: url("../assets/sonko-medium.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sonko";
  src: url("../assets/sonko-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ded9cd;
  --accent: #ff4500;
  --black: #000;
  --u: calc(100vw / 1920);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--black);
}

body {
  color: var(--paper);
  font-family: "Sonko", Arial, sans-serif;
  font-weight: 600;
  font-size: calc(16 * var(--u));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

::selection {
  background: var(--accent);
  color: var(--black);
}

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 6px;
}

/* -------------------------------- hero -------------------------------- */

.hero {
  position: relative;
  width: 100%;
  height: max(100svh, calc(961.5 * var(--u)));
  min-height: 560px;
  overflow: hidden;
  background: var(--black);
}

.stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.stage img {
  position: absolute;
  top: calc(58 * var(--u));
  left: 50%;
  width: 92%;
  height: calc(884 * var(--u));
  max-width: none;
  object-fit: fill;
  transform: translateX(-50%);
}

/* ------------------------------- brand -------------------------------- */

.brand {
  position: absolute;
  top: calc(50 * var(--u));
  left: 2.60417%;
  right: 2.60417%;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  color: var(--paper);
}

.brand__word {
  margin: 0;
  font-family: "Benzin", "Arial Black", Arial, sans-serif;
  font-weight: 700;
  font-size: calc(97 * var(--u));
  line-height: 0.83;
  letter-spacing: calc(-5 * var(--u));
  text-transform: uppercase;
  text-box-trim: trim-both;
  text-box-edge: cap alphabetic;
}

/* ------------------------------- intro -------------------------------- */

.intro {
  position: absolute;
  top: calc(217 * var(--u));
  left: 2.60417%;
  width: calc(301 * var(--u));
  margin: 0;
  z-index: 2;
  font-size: calc(16 * var(--u));
  font-weight: 600;
  line-height: 1.02;
  text-transform: uppercase;
}

/* ------------------------------ services ------------------------------ */

.services {
  position: absolute;
  top: calc(215 * var(--u));
  right: 2.60417%;
  width: calc(277 * var(--u));
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: calc(15.5 * var(--u));
  padding-top: calc(6 * var(--u));
}

.services__rule {
  width: 100%;
  height: 1px;
  background: rgba(222, 217, 205, 0.38);
}

.services__item {
  font-size: calc(12 * var(--u));
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
  text-align: right;
  transition: color 0.2s var(--ease);
}

.services__item:hover {
  color: var(--accent);
}

/* -------------------------------- nav --------------------------------- */

.nav {
  position: absolute;
  left: 2.60417%;
  bottom: calc(214 * var(--u));
  z-index: 3;
  display: flex;
  gap: calc(32 * var(--u));
  white-space: nowrap;
  font-size: calc(16 * var(--u));
  font-weight: 600;
  text-transform: uppercase;
  text-box-trim: trim-both;
  text-box-edge: cap alphabetic;
}

.nav__link {
  transition: color 0.2s var(--ease);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--accent);
}

/* ------------------------------- works -------------------------------- */

.works {
  position: absolute;
  left: calc(625 * var(--u));
  bottom: calc(60.5 * var(--u));
  z-index: 3;
  display: flex;
  gap: calc(16 * var(--u));
}

.work {
  position: relative;
  width: calc(121 * var(--u));
  height: calc(80 * var(--u));
  overflow: hidden;
  transition: transform 0.25s var(--ease);
}

.work img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  transition: filter 0.25s var(--ease);
}

.work:hover {
  transform: translateY(calc(-6 * var(--u)));
}

.work:hover img {
  filter: brightness(1.15);
}

.work.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 2px var(--accent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

body.is-ready .work.is-active::after {
  opacity: 1;
}

/* ---------------------------- feature card ---------------------------- */

.feature {
  position: absolute;
  right: 2.60417%;
  bottom: calc(60.5 * var(--u));
  z-index: 3;
  width: calc(277 * var(--u));
  height: calc(168 * var(--u));
  overflow: hidden;
}

.feature img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  transition: filter 0.3s var(--ease), transform 0.6s var(--ease);
}

.feature:hover img {
  filter: brightness(1.15);
  transform: scale(1.03);
}

/* -------------------------------- foot -------------------------------- */

.foot {
  position: absolute;
  left: 2.60417%;
  right: 2.60417%;
  bottom: calc(24 * var(--u));
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: calc(16 * var(--u));
  font-weight: 600;
  text-transform: uppercase;
  text-box-trim: trim-both;
  text-box-edge: cap alphabetic;
}

.foot__meta {
  display: flex;
  gap: calc(19 * var(--u));
  margin: 0;
}

.foot__socials {
  display: flex;
  gap: calc(17 * var(--u));
  margin: 0;
}

.foot__socials a {
  transition: color 0.2s var(--ease);
}

.foot__socials a:hover {
  color: var(--accent);
}

/* ----------------------------- адаптив ------------------------------- */

@media (max-width: 1100px) {
  .brand__word {
    font-size: calc(97 * var(--u));
  }
}

@media (max-width: 900px) {
  :root {
    --u: calc(100vw / 750);
  }

  .hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "brand brand"
      "intro services"
      "stage stage"
      "nav nav"
      "works works"
      "foot foot";
    gap: 20px 16px;
    align-content: space-between;
    height: auto;
    min-height: 100svh;
    padding: 22px 18px 20px;
  }

  .brand {
    grid-area: brand;
    position: static;
  }

  .brand__word {
    font-size: clamp(22px, 6.5vw, 40px);
    letter-spacing: -0.04em;
  }

  .intro {
    grid-area: intro;
    position: static;
    width: auto;
    font-size: 11px;
    line-height: 1.2;
    align-self: start;
    padding-right: 8px;
  }

  .services {
    grid-area: services;
    position: static;
    width: auto;
    gap: 10px;
    padding-top: 2px;
    align-self: start;
  }

  .services__rule {
    background: rgba(222, 217, 205, 0.3);
  }

  .services__item {
    font-size: 10px;
    line-height: 1.1;
  }

  .stage {
    grid-area: stage;
    position: relative;
    inset: auto;
    width: 100%;
    aspect-ratio: 1.62;
  }

  .stage img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 48% 60%;
    transform: none;
  }

  .nav {
    grid-area: nav;
    position: static;
    gap: 10px 16px;
    flex-wrap: wrap;
    font-size: 11px;
  }

  .works {
    grid-area: works;
    position: static;
    gap: 8px;
  }

  .work {
    flex: 1;
    width: auto;
    height: 54px;
  }

  .feature {
    display: none;
  }

  .foot {
    grid-area: foot;
    position: static;
    font-size: 9px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .foot__meta,
  .foot__socials {
    gap: 10px;
  }
}

@media (max-width: 420px) {
  .hero {
    gap: 16px;
  }

  .stage {
    aspect-ratio: 1.7;
  }
}

/* =========================================================
   Прелоадер / зерно / курсор / шлейф / пиксели / тексты
   ========================================================= */

body.is-loading {
  overflow: hidden;
}

/* ------------------------------ прелоадер ------------------------------ */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background: #000;
  color: var(--paper);
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}

.preloader.is-done {
  opacity: 0;
  visibility: hidden;
}

.preloader__inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: fit-content;
  min-width: min(520px, 80vw);
  max-width: 86vw;
}

.preloader__brand {
  font-family: "Benzin", "Arial Black", Arial, sans-serif;
  font-size: clamp(40px, 7.6vw, 132px);
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

.preloader__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(222, 217, 205, 0.72);
}

.preloader__pct {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.preloader__track {
  position: relative;
  display: block;
  height: 1px;
  background: rgba(222, 217, 205, 0.18);
  overflow: hidden;
}

.preloader__fill {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* -------------------------------- зерно -------------------------------- */

.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.075;
  mix-blend-mode: screen;
}

/* ------------------------------- курсор -------------------------------- */

@media (hover: hover) and (pointer: fine) {
  html,
  body,
  body * {
    cursor: url("../assets/cursor.svg") 0 0, auto !important;
  }
}

.trail {
  position: fixed;
  inset: 0;
  z-index: 200;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* текст: SplitType + скрэмбл */
.word {
  white-space: nowrap;
}

.measure-w {
  display: inline-block;
}

.intro__line {
  display: block;
  white-space: nowrap;
}


/* линии услуг «собираются» вместе с блоком */
.services__rule {
  transform-origin: 100% 50%;
  transition: transform 0.9s var(--ease) 0.1s;
}

.js .services:not(.is-revealed) .services__rule {
  transform: scaleX(0);
}

/* --------------------------- пиксельные слои --------------------------- */

.px-canvas {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  image-rendering: pixelated;
}

@media (prefers-reduced-motion: reduce) {
  .grain {
    opacity: 0.05;
  }

  .trail {
    display: none;
  }

  .preloader {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}
