@import url("https://fonts.googleapis.com/css2?family=VT323&family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --accent: #ff1018;
  --accent-soft: rgba(255, 16, 24, .35);
  --white: #f5f5f5;
  --black: #050505;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--black);
}

body {
  font-family: Inter, Arial, sans-serif;
  color: var(--white);
}

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  background: #050505;
}

.background-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #050505;
  z-index: -3;
}

.shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(0, 0, 0, .04) 15%, rgba(0, 0, 0, .40) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .14), rgba(0, 0, 0, .20));
}

.grain {
  position: absolute;
  inset: -50%;
  z-index: -1;
  pointer-events: none;
  opacity: .075;
  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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  animation: grain-shift .22s steps(2) infinite;
}

@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(1%, -1%); }
  50% { transform: translate(-1%, 1%); }
  75% { transform: translate(1%, 1%); }
  100% { transform: translate(-1%, -1%); }
}

/* Стартовая кнопка */
.intro {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: rgba(0, 0, 0, .20);
  transition: opacity .75s ease, visibility .75s ease;
}

.intro.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.play-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  min-width: 178px;
  padding: 10px 28px 13px;
  border: 1px solid rgba(255, 16, 24, .9);
  border-radius: 2px;
  color: var(--accent);
  background: rgba(5, 5, 5, .34);
  box-shadow: 0 0 18px rgba(255, 16, 24, .16), inset 0 0 18px rgba(255, 16, 24, .06);
  font-family: VT323, monospace;
  font-size: clamp(35px, 5vw, 47px);
  line-height: 1;
  letter-spacing: 5px;
  cursor: pointer;
  text-shadow: 0 0 12px var(--accent-soft);
  transition: color .25s ease, background .25s ease, transform .25s ease,
              box-shadow .25s ease, border-color .25s ease;
  animation: play-pulse 2.2s ease-in-out infinite;
}

.play-button::before,
.play-button::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-color: var(--accent);
  border-style: solid;
  opacity: .85;
}

.play-button::before {
  top: -5px;
  left: -5px;
  border-width: 1px 0 0 1px;
}

.play-button::after {
  right: -5px;
  bottom: -5px;
  border-width: 0 1px 1px 0;
}

.play-button:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 35px rgba(255, 16, 24, .48);
  transform: translateY(-3px);
  text-shadow: none;
}

.play-button:active {
  transform: translateY(0) scale(.98);
}

.play-button:disabled {
  opacity: .55;
  cursor: wait;
}

.play-triangle {
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 13px solid currentColor;
  filter: drop-shadow(0 0 5px currentColor);
}

@keyframes play-pulse {
  0%, 100% { box-shadow: 0 0 15px rgba(255, 16, 24, .12), inset 0 0 12px rgba(255, 16, 24, .04); }
  50% { box-shadow: 0 0 29px rgba(255, 16, 24, .28), inset 0 0 18px rgba(255, 16, 24, .08); }
}

.error-message {
  max-width: min(88vw, 460px);
  margin: 0;
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  text-shadow: 0 2px 10px #000;
}

/* Имя и социальные сети */
.identity {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: min(92vw, 900px);
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -43%);
  pointer-events: none;
  text-align: center;
}

.name {
  min-height: 1em;
  margin: 0;
  color: var(--accent);
  font-family: VT323, monospace;
  font-size: clamp(76px, 13vw, 166px);
  font-weight: 400;
  line-height: .9;
  letter-spacing: .035em;
  text-shadow: 0 0 8px rgba(255, 0, 18, .48), 0 0 28px rgba(255, 0, 18, .28);
  opacity: 0;
  transform: scale(.82);
  filter: blur(9px);
  transition: opacity .7s ease, transform .8s cubic-bezier(.16, 1, .3, 1), filter .8s ease;
  white-space: nowrap;
}

.identity.is-visible .name {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

.socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 17px;
  margin-top: clamp(23px, 4vh, 39px);
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .75s ease, transform .75s cubic-bezier(.16, 1, .3, 1);
  pointer-events: none;
}

.identity.socials-visible .socials {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 154px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 16, 24, .62);
  border-radius: 2px;
  color: var(--accent);
  background: rgba(0, 0, 0, .30);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: VT323, monospace;
  font-size: 25px;
  letter-spacing: 2px;
  text-decoration: none;
  text-shadow: 0 0 8px var(--accent-soft);
  box-shadow: 0 0 16px rgba(255, 16, 24, .09);
  transition: color .25s ease, background .25s ease, transform .25s ease,
              box-shadow .25s ease, border-color .25s ease;
}

.social-link svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
  flex: 0 0 auto;
}

.social-link:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 25px rgba(255, 16, 24, .36);
  transform: translateY(-5px);
  text-shadow: none;
}

.corner-mark,
.sound-mark {
  position: absolute;
  z-index: 4;
  bottom: 22px;
  color: rgba(255, 255, 255, .48);
  font-family: VT323, monospace;
  font-size: 16px;
  letter-spacing: 2px;
  pointer-events: none;
  text-shadow: 0 1px 5px #000;
}

.corner-mark {
  left: 24px;
}

.sound-mark {
  right: 24px;
  opacity: 0;
  transition: opacity .6s ease;
}

.scene.is-playing .sound-mark {
  opacity: .8;
}

[hidden] {
  display: none !important;
}

@media (max-width: 600px) {
  .background-video {
    object-position: center;
  }

  .identity {
    width: 94vw;
    transform: translate(-50%, -45%);
  }

  .name {
    font-size: clamp(66px, 18vw, 110px);
  }

  .socials {
    flex-direction: column;
    gap: 11px;
    width: min(72vw, 250px);
    margin-top: 27px;
  }

  .social-link {
    width: 100%;
    min-width: 0;
    padding: 10px 16px;
    font-size: 23px;
  }

  .corner-mark {
    left: 14px;
    bottom: 14px;
    font-size: 13px;
  }

  .sound-mark {
    right: 14px;
    bottom: 14px;
    font-size: 13px;
  }
}

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