/* --- CSS variables: tweak brand colors & site name styling --- */
:root {
  --bg-deep: #07090f;
  --bg-mid: #0f1424;
  --accent: #00e5c8;
  --accent-dim: rgba(0, 229, 200, 0.35);
  --accent-2: #7c5cff;
  --accent-2-dim: rgba(124, 92, 255, 0.4);
  --text: #e8eef8;
  --text-muted: rgba(232, 238, 248, 0.65);
  --card: rgba(18, 24, 42, 0.72);
  --stroke: rgba(255, 255, 255, 0.08);
  --radius: 24px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  min-height: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  /* Fill viewport: svh = stable mobile height; dvh = dynamic when bars hide */
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  font-family: "Outfit", system-ui, sans-serif;
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #1a2250 0%, transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(124, 92, 255, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(0, 229, 200, 0.1) 0%, transparent 45%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
  color: var(--text);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 2;
  animation: noise-shift 8s steps(10) infinite;
}

@keyframes noise-shift {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-2%, 2%);
  }
  50% {
    transform: translate(2%, -1%);
  }
  75% {
    transform: translate(-1%, -2%);
  }
}

.particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  z-index: 0;
  animation: orb-float 18s var(--ease-out) infinite;
}

.orb--1 {
  width: min(50vw, 420px);
  height: min(50vw, 420px);
  background: var(--accent-dim);
  top: -10%;
  left: -5%;
  animation-delay: 0s;
}

.orb--2 {
  width: min(40vw, 360px);
  height: min(40vw, 360px);
  background: var(--accent-2-dim);
  bottom: -5%;
  right: -8%;
  animation-delay: -6s;
  animation-duration: 22s;
}

.orb--3 {
  width: min(30vw, 280px);
  height: min(30vw, 280px);
  background: rgba(255, 255, 255, 0.06);
  top: 40%;
  left: 45%;
  animation-delay: -12s;
  animation-duration: 15s;
}

@keyframes orb-float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(8%, 12%) scale(1.05);
  }
  66% {
    transform: translate(-6%, 6%) scale(0.98);
  }
}

.wrap {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  min-height: 0;
  padding: clamp(0.65rem, 2.5vmin, 2rem) clamp(1rem, 4vw, 3rem);
  gap: clamp(0.6rem, 2vmin, 1.75rem);
}

/* --- Brand --- */
.brand {
  text-align: center;
  animation: rise-in 1s var(--ease-out) both;
}

.brand__badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  background: rgba(0, 229, 200, 0.08);
  margin-bottom: clamp(0.35rem, 1.5vmin, 1rem);
  animation: badge-pulse 2.5s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 229, 200, 0.25);
  }
  50% {
    box-shadow: 0 0 24px 2px rgba(0, 229, 200, 0.15);
  }
}

.brand__name {
  margin: 0;
  font-size: clamp(1.35rem, 5.5vmin, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 45%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: title-shimmer 6s ease-in-out infinite;
}

@keyframes title-shimmer {
  0%,
  100% {
    filter: hue-rotate(0deg);
  }
  50% {
    filter: hue-rotate(12deg);
  }
}

.brand__tag {
  margin: clamp(0.35rem, 1.2vmin, 0.75rem) 0 0;
  font-size: clamp(0.85rem, 2.2vmin, 1.05rem);
  font-weight: 300;
  color: var(--text-muted);
  animation: fade-in 1.2s var(--ease-out) 0.2s both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* --- Character --- */
.stage {
  perspective: 800px;
  animation: rise-in 1s var(--ease-out) 0.15s both;
  flex: 0 1 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 0;
  transform-origin: center bottom;
}

.character {
  position: relative;
  width: min(220px, 55vw);
  height: 260px;
  margin: 0 auto;
}

.character__shadow {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 70%;
  height: 18px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.45) 0%, transparent 70%);
  border-radius: 50%;
  animation: shadow-pulse 2.8s ease-in-out infinite;
}

@keyframes shadow-pulse {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.9;
  }
  50% {
    transform: translateX(-50%) scale(0.88);
    opacity: 0.65;
  }
}

.character__float {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  animation: bob 2.8s ease-in-out infinite;
  transform-origin: center bottom;
}

@keyframes bob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateX(-50%) translateY(-14px) rotate(1deg);
  }
}

.character__antenna {
  position: absolute;
  top: -28px;
  left: 50%;
  width: 4px;
  height: 28px;
  margin-left: -2px;
  background: linear-gradient(180deg, var(--accent-2), #4a3680);
  border-radius: 2px;
  transform-origin: bottom center;
  animation: antenna-wiggle 2s ease-in-out infinite;
}

.character__antenna-ball {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  background: radial-gradient(circle at 30% 30%, var(--accent), #008f7a);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-dim);
  animation: blink-glow 1.8s ease-in-out infinite;
}

@keyframes antenna-wiggle {
  0%,
  100% {
    transform: rotate(-6deg);
  }
  50% {
    transform: rotate(6deg);
  }
}

@keyframes blink-glow {
  0%,
  100% {
    box-shadow: 0 0 12px var(--accent-dim);
  }
  50% {
    box-shadow: 0 0 22px rgba(0, 229, 200, 0.65);
  }
}

.character__head {
  position: relative;
  width: 120px;
  height: 96px;
  margin: 0 auto;
  background: linear-gradient(160deg, #2a3348 0%, #151b2e 100%);
  border-radius: 28px 28px 22px 22px;
  border: 2px solid var(--stroke);
  box-shadow: inset 0 -12px 24px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.35);
}

.character__visor {
  position: absolute;
  inset: 18px 14px 14px;
  background: linear-gradient(180deg, rgba(0, 229, 200, 0.12) 0%, rgba(124, 92, 255, 0.15) 100%);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.character__eye {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 14px;
  margin-top: -7px;
  background: #0a0e18;
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px rgba(0, 229, 200, 0.35);
  animation: blink 4s ease-in-out infinite;
}

.character__eye::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 4px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.85;
  animation: eye-scan 3s ease-in-out infinite;
}

.character__eye--l {
  left: 16px;
}

.character__eye--r {
  right: 16px;
  animation-delay: 0.05s;
}

@keyframes blink {
  0%,
  92%,
  100% {
    transform: scaleY(1);
  }
  94%,
  96% {
    transform: scaleY(0.08);
  }
}

@keyframes eye-scan {
  0%,
  100% {
    transform: translate(0, 0);
    opacity: 0.85;
  }
  50% {
    transform: translate(-4px, 1px);
    opacity: 1;
  }
}

.character__mouth {
  position: absolute;
  bottom: 10px;
  left: 50%;
  width: 28px;
  height: 8px;
  margin-left: -14px;
  border-radius: 0 0 14px 14px;
  border: 2px solid rgba(0, 229, 200, 0.45);
  border-top: none;
  animation: mouth-smile 2.8s ease-in-out infinite;
}

@keyframes mouth-smile {
  0%,
  100% {
    transform: scaleX(1);
  }
  50% {
    transform: scaleX(1.08);
  }
}

.character__torso {
  position: relative;
  width: 100px;
  height: 88px;
  margin: 10px auto 0;
  background: linear-gradient(180deg, #232d44 0%, #121822 100%);
  border-radius: 20px;
  border: 2px solid var(--stroke);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.character__panel {
  position: absolute;
  top: 16px;
  left: 50%;
  width: 64px;
  height: 36px;
  margin-left: -32px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.character__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 200, 0.25), transparent);
  animation: panel-scan 2.5s linear infinite;
}

@keyframes panel-scan {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.character__gear {
  position: absolute;
  bottom: 14px;
  left: 50%;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  background: conic-gradient(from 0deg, #3d4a63 0deg 40deg, transparent 40deg 80deg, #3d4a63 80deg 120deg, transparent 120deg 160deg, #3d4a63 160deg 200deg, transparent 200deg 240deg, #3d4a63 240deg 280deg, transparent 280deg 320deg, #3d4a63 320deg 360deg);
  border-radius: 50%;
  animation: gear-spin 4s linear infinite;
  opacity: 0.85;
}

@keyframes gear-spin {
  to {
    transform: rotate(360deg);
  }
}

.character__arm {
  position: absolute;
  top: 104px;
  width: 22px;
  height: 56px;
  background: linear-gradient(180deg, #2a3348, #1a2130);
  border-radius: 12px;
  border: 2px solid var(--stroke);
}

.character__arm--l {
  left: calc(50% - 78px);
  transform: rotate(12deg);
  animation: arm-sway-l 2.8s ease-in-out infinite;
}

.character__arm--r {
  right: calc(50% - 78px);
  transform: rotate(-18deg);
  transform-origin: top center;
  animation: wave 1.2s ease-in-out infinite;
}

@keyframes arm-sway-l {
  0%,
  100% {
    transform: rotate(12deg);
  }
  50% {
    transform: rotate(4deg);
  }
}

@keyframes wave {
  0%,
  100% {
    transform: rotate(-18deg);
  }
  25% {
    transform: rotate(-42deg);
  }
  50% {
    transform: rotate(-28deg);
  }
  75% {
    transform: rotate(-48deg);
  }
}

/* --- Card --- */
.card {
  width: min(100%, 520px);
  flex-shrink: 0;
  padding: clamp(0.85rem, 2.8vmin, 2rem);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--stroke);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  animation: rise-in 1s var(--ease-out) 0.25s both;
}

.card__title {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card__text {
  margin: 0 0 clamp(0.65rem, 2vmin, 1.25rem);
  line-height: 1.55;
  color: var(--text-muted);
  font-size: clamp(0.85rem, 2.2vmin, 1rem);
}

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: dot-beat 1.4s ease-in-out infinite;
}

@keyframes dot-beat {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.75;
  }
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  background-size: 200% 100%;
  animation: progress-gradient 3s linear infinite;
  transition: width 0.35s var(--ease-out);
}

@keyframes progress-gradient {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.mono {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.foot {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  text-align: center;
  padding: 0.5rem 1rem max(0.5rem, env(safe-area-inset-bottom, 0px));
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Glitch attribute hook */
[data-glitch]:hover {
  animation: glitch-text 0.4s linear;
}

@keyframes glitch-text {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 1px);
  }
  40% {
    transform: translate(2px, -1px);
  }
  60% {
    transform: translate(-1px, -1px);
  }
  80% {
    transform: translate(1px, 1px);
  }
  100% {
    transform: translate(0);
  }
}

/* Keep mascot + header + card on one screen when height is tight */
@media (max-height: 780px) {
  .stage {
    transform: scale(0.92);
    margin-bottom: -1.25rem;
  }
}

@media (max-height: 700px) {
  .stage {
    transform: scale(0.84);
    margin-bottom: -2rem;
  }

  .brand__name {
    font-size: clamp(1.2rem, 5vmin, 3rem);
  }
}

@media (max-height: 620px) {
  .stage {
    transform: scale(0.74);
    margin-bottom: -3rem;
  }

  .wrap {
    gap: clamp(0.35rem, 1.5vmin, 1rem);
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }

  .card__title {
    font-size: 1.15rem;
  }
}

@media (max-height: 520px) {
  .stage {
    transform: scale(0.62);
    margin-bottom: -4rem;
  }

  .brand__badge {
    margin-bottom: 0.15rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.65rem;
  }

  .foot {
    padding-top: 0.25rem;
    padding-bottom: max(0.35rem, env(safe-area-inset-bottom, 0px));
    font-size: 0.72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .progress__fill {
    animation: none;
  }
}
