:root {
  --bg-1: #050816;
  --bg-2: #09142d;
  --bg-3: #12071e;
  --pointer-x: 50%;
  --pointer-y: 50%;
  --glass: rgba(9, 17, 38, 0.55);
  --glass-stroke: rgba(143, 239, 255, 0.18);
  --text-main: #f5fbff;
  --text-soft: rgba(214, 241, 255, 0.76);
  --signal-a: #59f3ff;
  --signal-b: #d9f6ff;
  --signal-c: #8cbcff;
  --signal-d: #245cff;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  background:
    radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(89, 243, 255, 0.14), transparent 18%),
    radial-gradient(circle at 20% 20%, rgba(89, 243, 255, 0.12), transparent 35%),
    radial-gradient(circle at 80% 30%, rgba(36, 92, 255, 0.14), transparent 30%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2) 55%, var(--bg-3));
  color: var(--text-main);
  font-family: "Rajdhani", sans-serif;
}

.scene {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  isolation: isolate;
}

.ambient,
.grid,
.energy,
.noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ambient {
  filter: blur(40px);
  opacity: 0.85;
}

.ambient-a {
  background: radial-gradient(circle at 28% 52%, rgba(36, 92, 255, 0.16), transparent 24%);
  animation: driftA 12s ease-in-out infinite alternate;
}

.ambient-b {
  background: radial-gradient(circle at 73% 30%, rgba(77, 195, 255, 0.16), transparent 22%);
  animation: driftB 14s ease-in-out infinite alternate;
}

.grid {
  background-image:
    linear-gradient(rgba(118, 210, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118, 210, 255, 0.06) 1px, transparent 1px);
  background-size: 78px 78px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 90%);
  opacity: 0.45;
}

.energy {
  opacity: 0.45;
  mix-blend-mode: screen;
}

.energy-a {
  background:
    radial-gradient(circle at 12% 60%, rgba(89, 243, 255, 0.85) 0 2px, transparent 3px),
    linear-gradient(100deg, transparent 20%, rgba(89, 243, 255, 0.08) 40%, transparent 62%),
    linear-gradient(transparent 48%, rgba(89, 243, 255, 0.16) 49%, transparent 51%);
  background-size: 26% 100%, 100% 100%, 100% 25%;
  animation: waveMove 10s linear infinite;
}

.energy-b {
  background:
    radial-gradient(circle at 88% 36%, rgba(36, 92, 255, 0.78) 0 2px, transparent 3px),
    linear-gradient(280deg, transparent 22%, rgba(77, 195, 255, 0.08) 48%, transparent 68%),
    linear-gradient(transparent 64%, rgba(217, 246, 255, 0.16) 65%, transparent 67%);
  background-size: 24% 100%, 100% 100%, 100% 30%;
  animation: waveMoveReverse 12s linear infinite;
}

.noise {
  opacity: 0.06;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.8) 0.7px, transparent 0.7px);
  background-size: 12px 12px;
}

.card-shell {
  position: relative;
  width: min(1140px, 100%);
}

.identity-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1.08fr);
  gap: 28px;
  align-items: center;
  min-height: min(720px, calc(100vh - 64px));
  padding: clamp(28px, 4vw, 46px);
  background: linear-gradient(145deg, rgba(15, 25, 54, 0.72), rgba(7, 12, 28, 0.44));
  border: 1px solid var(--glass-stroke);
  border-radius: 32px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  overflow: hidden;
}

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

.identity-card::before {
  background:
    linear-gradient(120deg, rgba(89, 243, 255, 0.2), transparent 26%),
    linear-gradient(300deg, rgba(36, 92, 255, 0.14), transparent 22%);
  opacity: 0.8;
}

.identity-card::after {
  inset: 10px;
  border: 1px solid rgba(172, 236, 255, 0.08);
  border-radius: 24px;
}

.circuit-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 8%, rgba(89, 243, 255, 0.14) 8.3%, transparent 8.6%) 0 20% / 100% 2px no-repeat,
    linear-gradient(90deg, transparent 18%, rgba(217, 246, 255, 0.12) 18.2%, transparent 18.4%) 0 74% / 100% 2px no-repeat,
    linear-gradient(transparent 0 0) padding-box,
    radial-gradient(circle at 18% 20%, rgba(89, 243, 255, 0.85) 0 1.5px, transparent 2px),
    radial-gradient(circle at 76% 76%, rgba(217, 246, 255, 0.82) 0 1.5px, transparent 2px),
    radial-gradient(circle at 64% 28%, rgba(36, 92, 255, 0.82) 0 1.5px, transparent 2px);
  opacity: 0.65;
}

.circuit-overlay::before,
.circuit-overlay::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(121, 244, 255, 0.85), transparent);
  filter: blur(0.4px);
}

.circuit-overlay::before {
  width: 52%;
  height: 2px;
  top: 28%;
  left: -8%;
  animation: circuitRun 6s linear infinite;
}

.circuit-overlay::after {
  width: 42%;
  height: 2px;
  bottom: 22%;
  right: -4%;
  animation: circuitRun 7.4s linear infinite reverse;
}

.scanline {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  transform: translateY(-100%);
  animation: scan 5.8s linear infinite;
  opacity: 0.55;
}

.logo-panel,
.content-panel {
  position: relative;
  z-index: 1;
}

.logo-panel {
  display: grid;
  place-items: center;
  min-height: 100%;
}

.logo-halo {
  position: absolute;
  width: min(32vw, 360px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(89, 243, 255, 0.22), transparent 54%),
    radial-gradient(circle at 70% 30%, rgba(36, 92, 255, 0.2), transparent 34%);
  filter: blur(14px);
  animation: pulseHalo 5s ease-in-out infinite;
}

.logo-stack {
  --logo-size: min(26vw, 320px);
  position: relative;
  width: var(--logo-size);
  aspect-ratio: 0.66;
  display: grid;
  place-items: center;
  filter:
    drop-shadow(0 0 16px rgba(89, 243, 255, 0.26))
    drop-shadow(0 0 40px rgba(77, 195, 255, 0.16));
  perspective: 1200px;
  transform-style: preserve-3d;
}

.logo-base,
.logo-core {
  position: absolute;
  width: 100%;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.logo-base {
  inset: auto 0 0 0;
  animation: neonShift 7s linear infinite;
}

.logo-core-wrap {
  position: absolute;
  width: 72%;
  top: 15.2%;
  left: 50%;
  transform: translateX(-50%) rotateX(0deg) rotateY(0deg);
  transform-origin: center;
  transform-style: preserve-3d;
  animation: coreSpin3d 6.6s linear infinite;
  z-index: 2;
}

.logo-core {
  position: relative;
  width: 100%;
  animation: neonShift 5.2s linear infinite reverse;
}

.content-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding-right: clamp(0px, 1vw, 12px);
}

.eyebrow {
  margin: 0;
  color: var(--signal-a);
  text-transform: uppercase;
  letter-spacing: 0.36em;
  font-size: 0.9rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(3rem, 5.4vw, 5.5rem);
  line-height: 0.92;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow:
    0 0 18px rgba(89, 243, 255, 0.2),
    0 0 44px rgba(77, 195, 255, 0.14);
}

.roles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.roles span {
  padding: 10px 14px;
  border: 1px solid rgba(158, 230, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.quote {
  max-width: 34ch;
  margin: 0;
  color: rgba(239, 247, 255, 0.92);
  font-size: clamp(1.24rem, 2vw, 1.55rem);
  line-height: 1.25;
  font-weight: 500;
}

.quote-line {
  white-space: nowrap;
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  margin-top: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(219, 243, 255, 0.82);
  font-size: 0.98rem;
  font-weight: 600;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--signal-a);
  box-shadow:
    0 0 0 0 rgba(89, 243, 255, 0.55),
    0 0 16px rgba(89, 243, 255, 0.8);
  animation: pulseDot 2.2s ease-out infinite;
}

.is-ready .logo-stack {
  animation: floatLogo 6s ease-in-out infinite;
}

@keyframes neonShift {
  0% {
    filter:
      brightness(0)
      saturate(100%)
      invert(82%)
      sepia(13%)
      saturate(1666%)
      hue-rotate(144deg)
      brightness(104%)
      contrast(103%)
      drop-shadow(0 0 12px rgba(89, 243, 255, 0.75))
      drop-shadow(0 0 26px rgba(89, 243, 255, 0.46));
  }
  33% {
    filter:
      brightness(0)
      saturate(100%)
      invert(97%)
      sepia(9%)
      saturate(877%)
      hue-rotate(168deg)
      brightness(109%)
      contrast(101%)
      drop-shadow(0 0 12px rgba(217, 246, 255, 0.82))
      drop-shadow(0 0 26px rgba(217, 246, 255, 0.56));
  }
  66% {
    filter:
      brightness(0)
      saturate(100%)
      invert(38%)
      sepia(84%)
      saturate(2357%)
      hue-rotate(209deg)
      brightness(98%)
      contrast(101%)
      drop-shadow(0 0 12px rgba(36, 92, 255, 0.78))
      drop-shadow(0 0 24px rgba(36, 92, 255, 0.5));
  }
  100% {
    filter:
      brightness(0.22)
      saturate(100%)
      invert(0%)
      sepia(0%)
      saturate(0%)
      hue-rotate(0deg)
      brightness(82%)
      contrast(122%)
      drop-shadow(0 0 10px rgba(255, 255, 255, 0.18))
      drop-shadow(0 0 18px rgba(89, 243, 255, 0.14));
  }
}

@keyframes coreSpin3d {
  0% {
    transform: translateX(-50%) rotateX(18deg) rotateY(0deg) rotateZ(0deg);
  }
  25% {
    transform: translateX(-50%) rotateX(6deg) rotateY(90deg) rotateZ(2deg);
  }
  50% {
    transform: translateX(-50%) rotateX(-18deg) rotateY(180deg) rotateZ(0deg);
  }
  75% {
    transform: translateX(-50%) rotateX(-6deg) rotateY(270deg) rotateZ(-2deg);
  }
  100% {
    transform: translateX(-50%) rotateX(18deg) rotateY(360deg) rotateZ(0deg);
  }
}

@keyframes floatLogo {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulseHalo {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.52;
  }
  50% {
    transform: scale(1.07);
    opacity: 0.92;
  }
}

@keyframes pulseDot {
  0% {
    box-shadow:
      0 0 0 0 rgba(89, 243, 255, 0.48),
      0 0 16px rgba(89, 243, 255, 0.8);
  }
  70% {
    box-shadow:
      0 0 0 10px rgba(89, 243, 255, 0),
      0 0 18px rgba(89, 243, 255, 0.65);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(89, 243, 255, 0),
      0 0 16px rgba(89, 243, 255, 0.7);
  }
}

@keyframes driftA {
  from {
    transform: translate3d(-2%, 0, 0) scale(1);
  }
  to {
    transform: translate3d(3%, -4%, 0) scale(1.14);
  }
}

@keyframes driftB {
  from {
    transform: translate3d(3%, 4%, 0) scale(1);
  }
  to {
    transform: translate3d(-4%, -2%, 0) scale(1.18);
  }
}

@keyframes waveMove {
  from {
    background-position: 0 0, 0 0, 0 0;
  }
  to {
    background-position: 300px 0, 140px 0, 0 90px;
  }
}

@keyframes waveMoveReverse {
  from {
    background-position: 0 0, 0 0, 0 0;
  }
  to {
    background-position: -260px 0, -120px 0, 0 -90px;
  }
}

@keyframes circuitRun {
  from {
    transform: translateX(-18%);
    opacity: 0;
  }
  15%,
  85% {
    opacity: 1;
  }
  to {
    transform: translateX(18%);
    opacity: 0;
  }
}

@keyframes scan {
  from {
    transform: translateY(-100%);
  }
  45%,
  100% {
    transform: translateY(100%);
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .scene {
    min-height: auto;
    padding: 18px;
  }

  .identity-card {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 10px;
    padding: 24px 20px 28px;
  }

  .logo-stack {
    --logo-size: min(50vw, 260px);
  }

  .content-panel {
    padding-right: 0;
    align-items: center;
    text-align: center;
  }

  .roles {
    justify-content: center;
  }

  .quote {
    max-width: 100%;
  }

  .quote-line {
    white-space: normal;
  }

  .status-line {
    width: 100%;
    justify-content: center;
  }
}

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