:root {
  color-scheme: dark;
  --logo-x: 0px;
  --logo-y: 0px;
  --pointer-x: 0px;
  --pointer-y: 0px;
  --paper: #f5f7f2;
  --red: #ff4053;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  width: 100%;
  overflow: hidden;
  background: #08090b;
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  isolation: isolate;
  display: grid;
  width: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.06), transparent 24rem),
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.025), transparent 66%),
    #050505;
}

.stage::before,
.stage::after {
  position: absolute;
  inset: 0;
  content: '';
  pointer-events: none;
}

.stage::before {
  z-index: -2;
  inset: -28%;
  background: radial-gradient(ellipse at 50% 50%, transparent 18%, rgba(255, 255, 255, 0.05) 18.3%, transparent 19%);
  filter: blur(38px);
}

.stage::after {
  z-index: 3;
  border: 0;
  box-shadow: none;
}

.hero-art,
.grain,
.grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-art {
  z-index: -1;
  overflow: hidden;
  background: #050506;
  transform: none;
}

.hero-art::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0 39%, rgba(0, 0, 0, 0.22) 48%, rgba(0, 0, 0, 0.04) 56% 100%),
    radial-gradient(ellipse at center, transparent 38%, rgba(0, 0, 0, 0.42) 100%);
  content: '';
}

.hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.08) contrast(1.08) brightness(0.78);
}

.motion-canvas {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.84;
}

.grid {
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-position: center;
  background-size: 5rem 5rem;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 72%);
  animation: grid-shift 24s linear infinite;
}

.grain {
  z-index: 4;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.hero {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 100svh;
  min-height: 100dvh;
  height: 100%;
  padding: 2rem;
}

.brand-lockup {
  position: relative;
  width: max-content;
  max-width: 92vw;
}

.brand-lockup::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 58%;
  height: 34%;
  border-radius: 50%;
  background: rgba(255, 75, 62, 0.12);
  content: '';
  filter: blur(4rem);
  opacity: 0.45;
  transform: translate(-50%, -40%);
}

.logo-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(0.55rem, 1.5vw, 1.5rem);
}

.avito-mark {
  display: block;
  width: min(38vw, 30rem);
  height: auto;
}

.pr-mark {
  display: block;
  color: var(--red);
  font-family: Arial Black, Arial, Helvetica, sans-serif;
  font-size: clamp(1.4rem, 3.5vw, 2.25rem);
  font-weight: 900;
  letter-spacing: -0.09em;
  line-height: 0.78;
  transform: translateY(0);
}

@keyframes chaos-scramble {
  0% { transform: translateX(-10px) skewX(-1deg); opacity: 0.46; }
  100% { transform: translateX(10px) skewX(1deg); opacity: 0.9; }
}

@keyframes transformation-flow {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -260; }
}

@keyframes order-align {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -104; }
}

@keyframes points-breathe {
  0%, 100% { opacity: 0.32; transform: scale(0.9); }
  50% { opacity: 0.86; transform: scale(1.08); }
}

@keyframes grid-shift {
  from { background-position: center; }
  to { background-position: 5rem 5rem; }
}

@media (max-width: 640px) {
  html,
  body,
  .stage,
  .hero,
  .hero-art {
    min-height: 100lvh;
    height: 100lvh;
  }

  .hero {
    padding: 0;
  }

  .brand-lockup {
    max-width: 100vw;
  }

  .avito-mark {
    width: 38vw;
  }

  .pr-mark {
    font-size: 3.5vw;
  }

  .grid {
    background-size: 3rem 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
