:root {
  color-scheme: dark;
  --red: #ff0434;
  --red-soft: rgba(255, 4, 52, 0.45);
  --red-faint: rgba(255, 4, 52, 0.14);
  --red-panel: rgba(64, 0, 12, 0.24);
  --red-border: rgba(255, 4, 52, 0.2);
  --text: #ff0434;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  overflow: hidden;
  background: #000000;
  color: var(--text);
  font-family: "Segoe UI", "Onest", Arial, sans-serif;
  letter-spacing: 0;
}

button {
  border: 0;
  font: inherit;
}

.background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 4, 52, 0.16), transparent 34%),
    radial-gradient(circle at 15% 20%, rgba(255, 4, 52, 0.18), transparent 28%),
    linear-gradient(145deg, #070000 0%, #170006 42%, #000000 72%);
}

.background::before,
.background::after {
  content: "";
  position: absolute;
  inset: -22%;
  pointer-events: none;
  background:
    linear-gradient(105deg, transparent 0 22%, rgba(255, 4, 52, 0.12) 40%, transparent 62% 100%),
    linear-gradient(250deg, transparent 0 25%, rgba(255, 4, 52, 0.08) 52%, transparent 75% 100%);
  filter: blur(30px);
  opacity: 0.78;
  animation: drift 16s ease-in-out infinite alternate;
}

.background::after {
  animation-duration: 24s;
  animation-direction: alternate-reverse;
  opacity: 0.45;
  transform: rotate(18deg);
}

.red-wash {
  position: absolute;
  width: 58vw;
  height: 42vh;
  background: linear-gradient(90deg, transparent, rgba(255, 4, 52, 0.2), transparent);
  filter: blur(36px);
  opacity: 0.46;
  transform: rotate(-12deg);
  animation: redSlide 12s ease-in-out infinite alternate;
}

.red-wash-one {
  top: 7%;
  left: -10%;
}

.red-wash-two {
  right: -15%;
  bottom: 5%;
  animation-duration: 15s;
  animation-direction: alternate-reverse;
}

.scan {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 4px;
  mix-blend-mode: screen;
  opacity: 0.1;
}

.particle-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
  opacity: 0;
  animation: particleRise var(--duration) linear infinite;
  animation-delay: var(--delay);
}

.enter-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  width: 100%;
  min-height: 100%;
  padding: 24px;
  place-items: center;
  color: var(--red);
  background: #000000;
  cursor: pointer;
  transition: opacity 520ms ease, visibility 520ms ease;
}

.enter-screen span {
  font-size: clamp(24px, 5vw, 30px);
  font-weight: 700;
  text-shadow: 0 0 15px var(--red);
  animation: pulseText 1.8s ease-in-out infinite;
}

.enter-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.stage {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100svh;
  padding: 22px;
  place-items: center;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 600ms ease, transform 600ms ease;
}

.stage.visible {
  opacity: 1;
  transform: scale(1);
}

.profile-shell {
  width: fit-content;
  max-width: calc(100vw - 32px);
  transform-style: preserve-3d;
  transition: transform 170ms ease-out;
}

.profile-main {
  display: grid;
  grid-template-columns: 158px minmax(180px, 1fr);
  align-items: center;
  gap: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.avatar-frame {
  width: 158px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 16px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.avatar-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 63%;
}

.profile-copy {
  min-width: 0;
}

.identity-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

h1 {
  margin: 0;
  color: var(--red);
  font-size: clamp(34px, 6vw, 46px);
  font-weight: 700;
  line-height: 1.05;
  text-shadow: 0 0 15px rgba(255, 4, 52, 0.44);
}

.badge {
  position: relative;
  display: inline-grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--red);
  background: rgba(255, 4, 52, 0.16);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.badge:hover {
  background: rgba(255, 4, 52, 0.26);
  transform: translateY(-1px);
}

.badge svg,
.profile-icon svg,
.audio-toggle svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.badge svg {
  width: 18px;
  height: 18px;
}

.role-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  padding: 5px 10px 6px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(14, 8, 9, 0.88);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 150ms ease, transform 150ms ease;
  white-space: nowrap;
}

.role-badge:hover .role-tooltip,
.role-badge.role-visible .role-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.typewriter {
  min-height: 28px;
  margin: 10px 0 0;
  color: var(--red);
  font-size: clamp(15px, 2vw, 17px);
  font-weight: 570;
  line-height: 1.5;
  text-shadow: 0 0 8px rgba(255, 4, 52, 0.5);
}

.typewriter::after {
  content: "|";
  margin-left: 2px;
  animation: caret 760ms steps(1) infinite;
}

.profile-icons {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 18px;
  color: var(--red);
}

.profile-icon {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--red);
  text-decoration: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.profile-icon:hover {
  opacity: 0.78;
  transform: translateY(-1px);
}

.audio-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid rgba(255, 4, 52, 0.16);
  border-radius: 12px;
  color: var(--red);
  background: rgba(255, 4, 52, 0.18);
  box-shadow: 0 0 18px rgba(255, 4, 52, 0.12);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 260ms ease, transform 260ms ease, background 180ms ease, border-color 180ms ease;
}

.audio-toggle.ready {
  opacity: 1;
  transform: translateY(0);
}

.audio-toggle:hover {
  border-color: rgba(255, 4, 52, 0.28);
  background: rgba(255, 4, 52, 0.28);
}

.audio-toggle svg {
  width: 20px;
  height: 20px;
}

.audio-toggle .icon-pause {
  display: none;
}

.audio-toggle.playing .icon-play {
  display: none;
}

.audio-toggle.playing .icon-pause {
  display: block;
}

@media (max-width: 700px) {
  .profile-main {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 18px;
    min-height: 0;
    padding: 24px;
    text-align: center;
  }

  .identity-row {
    justify-content: center;
  }

  .avatar-frame {
    width: min(158px, 46vw);
  }

  .profile-icons {
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .stage {
    padding: 16px;
  }

  .profile-shell {
    max-width: calc(100vw - 24px);
  }

  .profile-main {
    padding: 0;
  }
}

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

@keyframes drift {
  from {
    transform: translate3d(-3%, -2%, 0) rotate(-4deg);
  }
  to {
    transform: translate3d(4%, 3%, 0) rotate(5deg);
  }
}

@keyframes redSlide {
  from {
    transform: translateX(-4%) rotate(-12deg);
  }
  to {
    transform: translateX(9%) rotate(-7deg);
  }
}

@keyframes pulseText {
  0%,
  100% {
    opacity: 0.76;
  }
  50% {
    opacity: 1;
  }
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

@keyframes particleRise {
  0% {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }
  14% {
    opacity: 0.75;
  }
  80% {
    opacity: 0.35;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--travel), -110vh, 0);
  }
}
