:root {
  --bg: #030505;
  --bg-deep: #07110e;
  --panel: rgba(5, 15, 11, 0.44);
  --line: rgba(126, 255, 199, 0.16);
  --line-soft: rgba(126, 255, 199, 0.08);
  --text: #eef8f3;
  --text-dim: rgba(238, 248, 243, 0.72);
  --accent: #7effc7;
  --accent-soft: rgba(126, 255, 199, 0.18);
  --shadow: rgba(0, 0, 0, 0.7);
  --scene-overscan: max(8vmax, 4rem);
  --content-width: min(92vw, 74rem);
  --hero-height: 100vh;
  --hero-height: 100svh;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(18, 56, 41, 0.32), transparent 34%),
    linear-gradient(180deg, #06100d 0%, #020403 60%, #010201 100%);
  color: var(--text);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
}

body {
  overflow: hidden;
}

.hero {
  position: relative;
  min-height: var(--hero-height);
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: clip;
  padding: clamp(1.25rem, 4vw, 3rem);
  background:
    radial-gradient(circle at 50% 18%, rgba(126, 255, 199, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(2, 8, 6, 0.62), rgba(1, 4, 3, 0.88));
}

.hero__scene,
.matrix-rain,
.hero__content {
  position: absolute;
  inset: 0;
}

.hero__scene {
  z-index: 0;
  overflow: hidden;
}

.hero__background,
.hero__grid,
.hero__glow,
.hero__vignette {
  position: absolute;
}

.hero__background {
  inset: calc(var(--scene-overscan) * -1);
  background-image:
    linear-gradient(115deg, rgba(1, 5, 5, 0.62) 12%, rgba(1, 4, 4, 0.28) 50%, rgba(1, 5, 5, 0.66) 88%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)),
    url("./bg.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  filter: saturate(0.94) brightness(0.62) contrast(1.05);
  transform-origin: center;
  animation: background-breathe 8s ease-in-out infinite;
  will-change: transform, filter;
}

.hero__grid {
  inset: 0;
  z-index: 1;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(126, 255, 199, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 255, 199, 0.04) 1px, transparent 1px);
  background-size: clamp(2.5rem, 6vw, 4.5rem) clamp(2.5rem, 6vw, 4.5rem);
  mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.9) 24%, rgba(0, 0, 0, 0.95) 100%);
}

.hero__glow {
  inset: auto 50% 12%;
  z-index: 1;
  width: min(72vw, 52rem);
  height: min(30vh, 18rem);
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(126, 255, 199, 0.2) 0%, rgba(126, 255, 199, 0.08) 38%, transparent 74%);
  filter: blur(20px);
}

.hero__vignette {
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(circle at center, transparent 22%, rgba(0, 0, 0, 0.2) 60%, rgba(0, 0, 0, 0.84) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.06) 30%, rgba(0, 0, 0, 0.52));
}

.matrix-rain {
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.4s ease;
  mix-blend-mode: screen;
}

.matrix-rain.is-active {
  opacity: 0.28;
}

.hero__content {
  position: relative;
  z-index: 3;
  inset: auto;
  width: var(--content-width);
  display: grid;
  justify-items: center;
  gap: clamp(0.8rem, 1.8vw, 1.2rem);
  padding: clamp(1.25rem, 3vw, 2rem);
  text-align: center;
}

.hero__content::before {
  content: "";
  position: absolute;
  inset: auto 50% 100%;
  width: min(28rem, 58vw);
  height: 1px;
  transform: translate(-50%, -1.2rem);
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.hero__eyebrow {
  margin: 0;
  font-family: "Courier New", monospace;
  font-size: clamp(0.72rem, 1vw, 0.92rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.hero__title {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(0.04em, 0.8vw, 0.16em);
  margin: 0;
  font-size: clamp(4.2rem, 17vw, 12.5rem);
  line-height: 0.86;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow:
    0 0 0.04em rgba(255, 255, 255, 0.9),
    0 0 0.16em rgba(255, 255, 255, 0.28),
    0 0 0.52em rgba(126, 255, 199, 0.26),
    0 0 1.4em rgba(126, 255, 199, 0.12),
    0 0.25em 1.2em var(--shadow);
}

.hero__title::before,
.hero__title::after {
  content: "DVSG";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero__title::before {
  color: rgba(126, 255, 199, 0.22);
  transform: translate(0.012em, 0.014em);
  filter: blur(0.025em);
  animation: title-glow 3.6s ease-in-out infinite alternate;
}

.hero__title::after {
  color: rgba(255, 255, 255, 0.1);
  transform: translate(-0.014em, -0.01em);
  filter: blur(0.018em);
  animation: title-glow 2.8s ease-in-out infinite alternate-reverse;
}

.hero__title span {
  display: inline-block;
  animation: title-lift 3.8s ease-in-out infinite;
}

.hero__title span:nth-child(2) {
  animation-delay: 0.12s;
}

.hero__title span:nth-child(3) {
  animation-delay: 0.24s;
}

.hero__title span:nth-child(4) {
  animation-delay: 0.36s;
}

.hero__subtitle {
  width: min(42rem, 100%);
  margin: 0;
  color: var(--text-dim);
  font-family: "Courier New", monospace;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  line-height: 1.6;
}

@keyframes background-breathe {
  0%,
  100% {
    transform: scale(1.08);
    filter: saturate(0.94) brightness(0.62) contrast(1.05);
  }

  50% {
    transform: scale(1.13);
    filter: saturate(1) brightness(0.7) contrast(1.08);
  }
}

@keyframes title-glow {
  0%,
  100% {
    transform: translate(0, 0);
    opacity: 0.8;
  }

  50% {
    transform: translate(0.012em, -0.014em);
    opacity: 1;
  }
}

@keyframes title-lift {
  0%,
  100% {
    transform: translateY(0);
    filter: brightness(1);
  }

  50% {
    transform: translateY(-0.04em);
    filter: brightness(1.14);
  }
}

@media (max-width: 820px) {
  .hero {
    padding: 1.25rem;
  }

  .hero__content {
    width: min(100%, 34rem);
    gap: 0.9rem;
  }

  .hero__eyebrow {
    letter-spacing: 0.26em;
  }

  .hero__subtitle {
    width: min(28rem, 100%);
    font-size: 0.92rem;
  }
}

@media (max-width: 560px) {
  :root {
    --scene-overscan: max(12vmax, 3rem);
  }

  .hero {
    padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  }

  .hero__content::before {
    width: min(16rem, 70vw);
  }

  .hero__title {
    font-size: clamp(3.2rem, 22vw, 6.4rem);
    letter-spacing: 0.06em;
  }

  .hero__subtitle {
    line-height: 1.5;
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .hero__content {
    gap: 0.65rem;
  }

  .hero__eyebrow {
    font-size: 0.68rem;
  }

  .hero__title {
    font-size: clamp(3rem, 14vw, 6rem);
  }

  .hero__subtitle {
    font-size: 0.84rem;
    max-width: 34rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__background,
  .hero__title::before,
  .hero__title::after,
  .hero__title span,
  .matrix-rain {
    animation: none;
    transition: none;
  }
}
