@import url("./tokens/tokens.css");
@import url("./typography.css");
@import url("./layout.css");
@import url("./animations.css");
@import url("./components/button.css");
@import url("./components/case.css");
@import url("./components/copy-email.css");
@import url("./components/link.css");
@import url("./components/play-button.css");
@import url("./components/header.css");
@import url("./components/footer.css");

@font-face {
  font-family: 'Inter Variable';
  src: url('../assets/fonts/InterVariable.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --site-header-height: 72px;
}

html {
  font-size: 16px;
  overflow-x: clip;
}

body {
  background-color: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-family-body);
  font-size: var(--font-size-16);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-title);
  font-weight: var(--font-weight-semibold);
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}

.page-main {
  width: 100%;
  padding-inline: var(--page-shell-gutter);
}

.hero-intro__flow-anchor {
  display: block;
  width: 100%;
  height: 0;
  visibility: hidden;
  pointer-events: none;
}

.hero-intro {
  --hero-left-column-width: clamp(385px, 26.5625vw, 510px);
  --hero-right-column-width: 330px;
  --hero-media-side-clearance: max(
    var(--hero-left-column-width),
    var(--hero-right-column-width)
  );
  --hero-scroll-opacity: 1;
  --hero-scroll-scale: 1;
  --hero-scroll-blur: 0px;
  --hero-photo-scroll-scale: 1;
  --hero-photo-dark-opacity: 0;
  --hero-title-scroll-opacity: 1;
  --hero-description-scroll-opacity: 1;
  --hero-experience-scroll-opacity: 1;
  --hero-stats-scroll-opacity: 1;
  --hero-video-scroll-opacity: 1;
  --hero-video-scroll-blur: 0px;
  --hero-video-scroll-scale: 1;
  --hero-video-playback-scale: 1;
  --hero-video-magnet-x: 0px;
  --hero-video-magnet-y: 0px;
  --hero-scroll-sticky-top: 0px;
  --hero-scroll-viewport-offset: var(--site-header-height);

  position: relative;
  height: calc(100svh - var(--site-header-height));
}

.hero-intro.container {
  max-width: none;
}

.hero-intro.hero-scroll--ready {
  position: sticky;
  top: var(--hero-scroll-sticky-top);
  height: calc(100svh - var(--hero-scroll-viewport-offset));
}

.hero-intro__reveal {
  width: 100%;
  height: 100%;
}

.hero-intro.hero-scroll--ready .hero-media__photo-scroll {
  opacity: var(--hero-scroll-opacity);
  transform: scale(var(--hero-scroll-scale));
  transform-origin: center bottom;
  filter: blur(var(--hero-scroll-blur));
  will-change: opacity, transform, filter;
}

.hero-intro.hero-scroll--hidden {
  visibility: hidden;
  pointer-events: none;
}

.hero-intro__content {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns:
    minmax(0, var(--hero-left-column-width))
    minmax(0, var(--hero-right-column-width));
  justify-content: space-between;
  width: 100%;
  height: 100%;
  padding-block:
    clamp(64px, 12svh, 140px)
    var(--spacing-40);
  pointer-events: none;
}

.hero-content__column {
  display: flex;
  min-width: 0;
}

.hero-content__column--left {
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  width: min(100%, var(--hero-left-column-width));
}

.hero-content__column--right {
  align-items: flex-end;
  justify-content: flex-end;
  width: min(100%, var(--hero-right-column-width));
  margin-left: auto;
  text-align: right;
}

.hero-intro__title {
  width: 100%;
  opacity: var(--hero-title-scroll-opacity);
}

.hero-intro__title,
.hero-content__top {
  color: var(--text-primary);
}

.hero-content__top {
  width: 100%;
  pointer-events: auto;
}

.hero-content__description {
  width: 100%;
  color: var(--text-secondary);
  opacity: var(--hero-description-scroll-opacity);
}

.hero-content__description-reveal {
  width: 100%;
  margin-top: var(--spacing-40);
}

.hero-content__stats-reveal {
  pointer-events: auto;
}

.hero-content__stats {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-40);
  opacity: var(--hero-stats-scroll-opacity);
}

.hero-content__stat {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
}

.hero-content__stat--enthusiasm {
  align-items: flex-start;
}

.hero-content__stat-value {
  color: var(--text-primary);
  font-size: var(--font-size-48);
}

.hero-content__stat-wave {
  display: inline-flex;
}

.hero-content__stat-wave-character {
  display: inline-block;
  transform-origin: center bottom;
}

.hero-content__stat-wave-character:nth-child(1) {
  --hero-stat-wave-delay: 0ms;
}

.hero-content__stat-wave-character:nth-child(2) {
  --hero-stat-wave-delay: 90ms;
}

.hero-content__stat-wave-character:nth-child(3) {
  --hero-stat-wave-delay: 180ms;
}

.hero-content__stat-wave-character:nth-child(4) {
  --hero-stat-wave-delay: 270ms;
}

.hero-content__stat-label {
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .hero-content__stat--enthusiasm .hero-content__stat-value:hover .hero-content__stat-wave-character {
    animation: hero-stat-number-wave 600ms linear infinite;
    animation-delay: var(--hero-stat-wave-delay);
  }
}

@keyframes hero-stat-number-wave {
  0%, 100% {
    transform: translateY(0) scaleY(1);
  }

  28% {
    transform: translateY(-0.18em) scaleY(1.06);
  }

  58% {
    transform: translateY(0.06em) scaleY(0.97);
  }
}

.hero-content__experience {
  color: var(--text-tertiary);
  opacity: var(--hero-experience-scroll-opacity);
  pointer-events: auto;
}

.hero-content__experience-reveal {
  width: 100%;
}

.hero-intro__links {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--spacing-32);
  margin-top: var(--spacing-48);
  pointer-events: auto;
}

.hero-intro__links > * {
  opacity: var(--hero-description-scroll-opacity);
}

.hero-media {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.hero-media__composition {
  position: absolute;
  bottom: 0;
  left: var(--hero-media-side-clearance);
  right: var(--hero-media-side-clearance);
  height: 64%;
  perspective: 1200px;
  perspective-origin: center center;
}

.hero-media__photo-scroll {
  position: absolute;
  inset: 0;
  transform-origin: center bottom;
}

.hero-media__video-reveal {
  --hero-video-reveal-duration: 4000ms;
  --hero-video-reveal-start-lead: 2200ms;
  --reveal-delay: calc(
    var(--reveal-duration-slow) + var(--reveal-delay-step) * 4 -
      var(--hero-video-reveal-start-lead)
  );

  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-media__video-reveal.reveal {
  opacity: 0;
  transform: none;
  filter: blur(12px);
  transition: none;
}

.hero-media__video-reveal.reveal.is-visible {
  animation: hero-video-bubble-visibility var(--hero-video-reveal-duration)
    var(--reveal-ease-standard) var(--reveal-delay) both;
}

.hero-media__video-reveal.reveal.reveal--settled {
  opacity: 1;
  filter: none;
  animation: none;
}

.hero-intro__photo {
  position: absolute;
  inset: 0;
  perspective: 1200px;
  perspective-origin: center center;
}

.hero-intro__photo-image {
  --hero-photo-rotate-y: 0deg;
  --hero-photo-translate-x: 0px;
  --hero-photo-scale: 1;

  position: absolute;
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  height: auto;
  width: auto;
  max-height: 100%;
  max-width: 100%;
  margin-inline: auto;
  background-color: var(--color-grey-900);
  object-fit: contain;
  object-position: center bottom;
  -webkit-mask: url("../assets/icons/mask.svg") center / contain no-repeat;
  mask: url("../assets/icons/mask.svg") center / contain no-repeat;
  mask-mode: alpha;
  transform: translate3d(var(--hero-photo-translate-x), 0, 0)
    rotateY(var(--hero-photo-rotate-y))
    scale(var(--hero-photo-scroll-scale))
    scale(var(--hero-photo-scale));
  transform-origin: center bottom;
  backface-visibility: hidden;
}

.hero-intro__photo-image--light {
  opacity: calc(1 - var(--hero-photo-dark-opacity));
}

.hero-intro__photo-image--dark {
  opacity: var(--hero-photo-dark-opacity);
  pointer-events: none;
}

.hero-media__video {
  --hero-video-anchor-y: -50%;

  position: absolute;
  top: var(--hero-video-top, 0px);
  left: var(--hero-video-left, 100%);
  width: min(clamp(144px, 30svh, 340px), 46%);
  aspect-ratio: 1 / 1;
  opacity: var(--hero-video-scroll-opacity);
  filter: blur(var(--hero-video-scroll-blur));
  transform: translateY(var(--hero-video-anchor-y)) scale(var(--hero-video-scroll-scale));
  transform-origin: center center;
}

.hero-media__video-playback {
  position: absolute;
  inset: 0;
  transform: scale(var(--hero-video-playback-scale));
  transform-origin: center center;
  transition: transform 900ms var(--reveal-ease-standard);
}

.hero-media__video-magnet {
  position: absolute;
  inset: 0;
  transform: translate3d(
    var(--hero-video-magnet-x),
    var(--hero-video-magnet-y),
    0
  );
}

.hero-media__video-magnet--active {
  will-change: transform;
}

.hero-intro--video-playing {
  --hero-video-playback-scale: 1.5;
}

.hero-media__video-frame {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  border-radius: 50%;
}

.hero-media__video-caption {
  --hero-video-caption-offset: 20px;

  position: absolute;
  z-index: 2;
  inset: calc(var(--hero-video-caption-offset) * -1);
  opacity: 1;
  transition: opacity 400ms ease;
  pointer-events: none;
}

.hero-media__video--active .hero-media__video-caption {
  opacity: 0;
  transition: none;
}

.hero-media__video-caption-text {
  --hero-video-caption-text-counter-scale: 1;

  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.hero-media__video-caption-label.text-body-sm {
  fill: var(--text-tertiary);
  font-size: calc(
    var(--font-size-16) * var(--hero-video-caption-text-counter-scale)
  );
}

.hero-media__video-reveal.reveal.is-visible .hero-media__video {
  animation: hero-video-bubble-scale var(--hero-video-reveal-duration)
    var(--reveal-ease-standard) var(--reveal-delay) both;
}

.hero-media__video-reveal.reveal.reveal--settled .hero-media__video {
  animation: none;
}

@keyframes hero-video-bubble-visibility {
  0% {
    opacity: 0;
    filter: blur(12px);
  }

  7%,
  100% {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes hero-video-bubble-scale {
  0% {
    transform: translateY(var(--hero-video-anchor-y)) scale(1.2);
  }

  100% {
    transform: translateY(var(--hero-video-anchor-y)) scale(1);
  }
}

.hero-media__video-element,
.hero-media__video-poster {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 400ms ease;
}

.hero-media__video-element {
  opacity: 0;
}

.hero-media__video-poster {
  opacity: 1;
  pointer-events: none;
}

.hero-media__video--active .hero-media__video-element {
  opacity: 1;
}

.hero-media__video--active .hero-media__video-poster {
  opacity: 0;
}

.hero-media__play-button {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: auto;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-intro.hero-scroll--ready .hero-intro__title,
  .hero-intro.hero-scroll--ready .hero-content__description,
  .hero-intro.hero-scroll--ready .hero-content__stats,
  .hero-intro.hero-scroll--ready .hero-content__experience,
  .hero-intro.hero-scroll--ready .hero-intro__links > * {
    will-change: opacity;
  }

  .hero-intro.hero-scroll--ready .hero-intro__photo-image {
    will-change: opacity, transform;
  }

  .hero-intro.hero-scroll--ready .hero-media__video {
    will-change: opacity, transform, filter;
  }
}

@media (width > 1440px) {
  .hero-content__description {
    max-width: 410px;
  }
}

@media (max-width: 1440px) {
  .hero-intro {
    --hero-left-column-width: 385px;
  }

  .hero-content__description {
    font-size: var(--font-size-20);
  }
}

@media (max-width: 1359px) {
  .hero-content__column--right {
    display: none;
  }

  .hero-media__video-playback {
    transform-origin: right top;
  }
}

@media (width > 1024px) and (max-width: 1359px) {
  .hero-intro {
    --hero-media-gap: clamp(24px, 5vw, 80px);
  }

  .hero-content {
    grid-template-columns: minmax(0, var(--hero-left-column-width));
  }

  .hero-media__composition {
    --hero-video-size: clamp(144px, 15vw, 240px);

    left: auto;
    right: var(--hero-video-size);
    width: min(
      clamp(360px, 48vw, 760px),
      calc(
        100% - var(--hero-left-column-width) - var(--hero-media-gap) -
          var(--hero-video-size)
      )
    );
  }

  .hero-intro__photo-image {
    margin-right: 0;
    margin-left: auto;
    object-position: right bottom;
  }

  .hero-media__video {
    right: auto;
    left: 100%;
    width: var(--hero-video-size);
  }
}

@media (width <= 1024px) {
  .hero-intro,
  .hero-intro.hero-scroll--ready {
    position: relative;
    top: auto;
    height: auto;
  }

  .hero-intro__content {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    column-gap: var(--spacing-64);
    row-gap: var(--spacing-64);
    height: auto;
    padding-top: var(--spacing-80);
  }

  .hero-content {
    flex: 0 0 min(100%, var(--hero-left-column-width));
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, var(--hero-left-column-width));
    height: auto;
    padding-block: 0;
  }

  .hero-content__column--left {
    gap: var(--spacing-64);
  }

  .hero-media {
    flex: 1 0 240px;
    position: relative;
    inset: auto;
    min-width: 0;
  }

  .hero-media__composition {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    width: min(100%, 620px);
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .hero-intro__photo {
    position: absolute;
    inset: 0;
    overflow: hidden;
  }

  .hero-intro__photo-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    max-width: none;
    margin-inline: 0;
    object-fit: cover;
    object-position: center;
  }

  .hero-media__video-reveal {
    display: none;
  }
}

/* мобилка */
@media (max-width: 768px) {
  .hero-intro__content {
    gap: var(--spacing-40);
  }

  .hero-content__column--left {
    gap: var(--spacing-48);
  }
}

@media (width < 700px) {
  .hero-intro__content {
    row-gap: var(--spacing-48);
  }

  .hero-media {
    order: -1;
  }

  .hero-media__composition {
    width: min(100%, 160px);
  }

  .hero-content,
  .hero-content__column--left {
    width: 100%;
  }

  .hero-content {
    flex-basis: 100%;
  }

  .hero-intro__title,
  .hero-content__description {
    max-width: 450px;
  }

  .hero-content__column--left {
    gap: var(--spacing-40);
  }

  .hero-content__description-reveal {
    margin-top: var(--spacing-32);
  }

  .hero-intro__links {
    margin-top: var(--spacing-40);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-media__video-magnet {
    transform: none;
    will-change: auto;
  }

  .hero-media__video-playback {
    transform: none;
    transition: none;
  }

  .hero-media__video-caption {
    transition: none;
  }

  .hero-media__video-reveal.reveal,
  .hero-media__video-reveal.reveal.is-visible,
  .hero-media__video-reveal.reveal.reveal--settled {
    visibility: visible;
    opacity: 1;
    transform: none;
    filter: none;
    animation: none;
    transition: none;
    will-change: auto;
  }

  .hero-media__video-reveal.reveal .hero-media__video,
  .hero-media__video-reveal.reveal.is-visible .hero-media__video,
  .hero-media__video-reveal.reveal.reveal--settled .hero-media__video {
    animation: none;
    will-change: auto;
  }

  .hero-media__video-element,
  .hero-media__video-poster {
    transition: none;
  }

  .hero-intro.hero-scroll--ready {
    position: static;
  }

  .hero-intro.hero-scroll--ready .hero-media__photo-scroll {
    opacity: 1;
    transform: none;
    filter: none;
    will-change: auto;
  }

  .hero-intro__photo-image {
    transform: none;
    will-change: auto;
  }
}
