:root {
  --bg: #080a0b;
  --panel: rgba(19, 26, 24, 0.78);
  --panel-border: rgba(169, 255, 132, 0.22);
  --text: #f4f8f0;
  --muted: #afbdab;
  --accent: #91ff6d;
  --accent-soft: #2e5d33;
  --hot: #ffd166;
  --stone: #202725;
  --arcane: #9f7bff;
  --arcane-soft: #5a42b4;
  --ok: #32d583;
  --bad: #ff5d5d;
}

* {
  box-sizing: border-box;
}

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

body {
  background: radial-gradient(circle at 15% -5%, #193321 0%, transparent 45%),
              radial-gradient(circle at 90% -12%, rgba(125, 91, 255, 0.24) 0%, transparent 38%),
              radial-gradient(circle at 85% 105%, #3b2f18 0%, transparent 40%),
              var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  overflow-x: hidden;
}

body.loading {
  overflow: hidden;
}

.preloader {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, rgba(28, 33, 44, 0.82), rgba(6, 8, 12, 0.96));
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

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

.preloader-core {
  width: min(92vw, 470px);
  padding: 1rem;
  border: 1px solid rgba(159, 123, 255, 0.45);
  background: rgba(8, 12, 17, 0.9);
  box-shadow: 0 0 34px rgba(159, 123, 255, 0.22);
  text-align: center;
}

.preloader-title {
  display: block;
  font-family: "Press Start 2P", monospace;
  font-size: 0.8rem;
  color: var(--text);
}

.preloader-sub {
  display: block;
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
}

.preloader-bar {
  margin-top: 0.85rem;
  height: 8px;
  border: 1px solid rgba(145, 255, 109, 0.45);
  background: rgba(145, 255, 109, 0.08);
  overflow: hidden;
}

.preloader-bar i {
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, #6dff7f, #9f7bff);
  animation: preloadSlide 1s ease-in-out infinite alternate;
}

.bg-glow {
  position: fixed;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.16;
  z-index: 0;
  animation: drift 14s ease-in-out infinite alternate;
}

.bg-glow-left {
  left: -10rem;
  top: -14rem;
  background: #66ff7a;
}

.bg-glow-right {
  right: -12rem;
  bottom: -16rem;
  background: var(--arcane);
}

.grain {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 0.4px, transparent 0.4px);
  background-size: 4px 4px;
  pointer-events: none;
  opacity: 0.16;
  z-index: 0;
}

.voxel-skyline {
  position: fixed;
  inset: auto 0 0 0;
  height: 110px;
  background:
    linear-gradient(0deg, rgba(84, 54, 34, 0.48), rgba(84, 54, 34, 0.48)),
    repeating-linear-gradient(90deg, rgba(111, 147, 84, 0.38) 0 24px, rgba(83, 112, 66, 0.38) 24px 48px);
  clip-path: polygon(0% 100%, 0% 72%, 8% 72%, 8% 56%, 15% 56%, 15% 72%, 24% 72%, 24% 60%, 31% 60%, 31% 72%, 41% 72%, 41% 52%, 49% 52%, 49% 72%, 57% 72%, 57% 58%, 63% 58%, 63% 72%, 72% 72%, 72% 50%, 80% 50%, 80% 72%, 89% 72%, 89% 60%, 95% 60%, 95% 72%, 100% 72%, 100% 100%);
  opacity: 0.72;
  animation: horizon-shift 16s linear infinite alternate;
  pointer-events: none;
  z-index: 0;
}

.floating-cubes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.cube {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25);
  background: linear-gradient(135deg, rgba(145, 255, 109, 0.25), rgba(159, 123, 255, 0.2));
  image-rendering: pixelated;
  animation: cube-float 9s ease-in-out infinite;
}

.c1 { top: 18%; left: 8%; animation-delay: 0.2s; }
.c2 { top: 32%; left: 86%; width: 18px; height: 18px; animation-delay: 1.3s; }
.c3 { top: 56%; left: 12%; width: 22px; height: 22px; animation-delay: 2.1s; }
.c4 { top: 70%; left: 78%; width: 30px; height: 30px; animation-delay: 0.7s; }
.c5 { top: 22%; left: 54%; width: 16px; height: 16px; animation-delay: 1.8s; }

.topbar,
main,
footer {
  position: relative;
  z-index: 1;
}

.topbar {
  max-width: 1260px;
  margin: 0 auto;
  padding: 1.2rem 1.3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: "Press Start 2P", monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

main {
  max-width: 1260px;
  margin: 0 auto;
  padding: 1rem 1.3rem 3.5rem;
}

.hero {
  max-width: 760px;
  padding: 2.2rem 0 2rem;
  animation: rise 0.8s ease-out;
}

.eyebrow {
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}

h1 {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(1.18rem, 2.45vw, 2.25rem);
  line-height: 1.18;
  margin: 0;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

h1 span {
  color: var(--hot);
  text-shadow: 0 0 16px rgba(159, 123, 255, 0.45);
}

.lead {
  color: var(--muted);
  max-width: 64ch;
  margin: 1rem 0 0;
  line-height: 1.7;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.8rem;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.tiny-btn {
  text-decoration: none;
  border-radius: 4px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: transform 0.15s ease, filter 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}

.primary-btn {
  background: linear-gradient(180deg, #a6ff77, #5dc94f);
  border-color: #2d6d2f;
  color: #0f1d0e;
  padding: 0.85rem 1.2rem;
}

.secondary-btn {
  background: linear-gradient(180deg, #4a5b61, #2d393d);
  border-color: #63767a;
  color: var(--text);
  padding: 0.85rem 1.2rem;
}

.ghost-btn {
  padding: 0.55rem 0.95rem;
  background: rgba(145, 255, 109, 0.1);
  border-color: rgba(145, 255, 109, 0.42);
  color: var(--text);
}

.tiny-btn {
  background: rgba(145, 255, 109, 0.12);
  border-color: rgba(145, 255, 109, 0.32);
  color: var(--text);
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.tiny-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.primary-btn:active,
.secondary-btn:active,
.ghost-btn:active,
.tiny-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.chip {
  background: rgba(145, 255, 109, 0.08);
  border: 1px solid rgba(145, 255, 109, 0.3);
  border-radius: 4px;
  padding: 0.35rem 0.7rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.status-card {
  position: relative;
  margin-top: 1.4rem;
  background: linear-gradient(180deg, rgba(23, 31, 29, 0.84), rgba(14, 19, 18, 0.86));
  border: 1px solid var(--panel-border);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(7px);
  border-radius: 6px;
  padding: 1.2rem;
  animation: rise 0.9s ease-out;
}

.hud-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(159, 123, 255, 0.45);
  pointer-events: none;
}

.hud-corner-tl { top: 7px; left: 7px; border-right: 0; border-bottom: 0; }
.hud-corner-tr { top: 7px; right: 7px; border-left: 0; border-bottom: 0; }
.hud-corner-bl { bottom: 7px; left: 7px; border-right: 0; border-top: 0; }
.hud-corner-br { bottom: 7px; right: 7px; border-left: 0; border-top: 0; }

.hud-scanline {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(145, 255, 109, 0.8), transparent);
  opacity: 0.6;
  animation: scanMove 4.4s linear infinite;
}

.status-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.status-head h2 {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: 0.86rem;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.label {
  color: var(--muted);
  margin: 0;
  font-size: 0.82rem;
}

.value {
  margin: 0.2rem 0 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.hint {
  color: var(--muted);
  margin-top: 0.9rem;
  font-size: 0.9rem;
}

.features {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.features article {
  background: linear-gradient(180deg, rgba(44, 56, 48, 0.9), rgba(23, 29, 27, 0.92));
  border: 1px solid rgba(172, 228, 142, 0.28);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  padding: 1rem;
}

.features h3 {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: 1.08rem;
  line-height: 1.3;
}

.features p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  line-height: 1.58;
}

footer {
  max-width: 1260px;
  margin: 0 auto;
  padding: 1rem 1.3rem 2.2rem;
  color: var(--muted);
  border-top: 1px solid rgba(145, 255, 109, 0.2);
}

footer p {
  margin: 0.2rem 0;
}

.muted {
  opacity: 0.8;
}

.status-online {
  color: var(--ok);
}

.ping-flash {
  animation: pingPulse 0.45s ease;
}

.status-offline {
  color: var(--bad);
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(20px, -16px, 0) scale(1.08); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cube-float {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(0, -12px, 0) rotate(8deg); }
  100% { transform: translate3d(0, 0, 0) rotate(0deg); }
}

@keyframes horizon-shift {
  from { transform: translateX(0); }
  to { transform: translateX(18px); }
}

@keyframes pingPulse {
  0% { transform: scale(1); color: var(--text); }
  50% { transform: scale(1.12); color: var(--arcane); }
  100% { transform: scale(1); color: var(--text); }
}

@keyframes preloadSlide {
  from { transform: translateX(-35%); }
  to { transform: translateX(145%); }
}

@keyframes scanMove {
  0% { top: 8px; opacity: 0; }
  10% { opacity: 0.65; }
  90% { opacity: 0.65; }
  100% { top: calc(100% - 8px); opacity: 0; }
}

@media (max-width: 920px) {
  h1 {
    font-size: clamp(0.7rem, 3.4vw, 1rem);
  }

  .status-grid,
  .features {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 2rem;
  }
}
