:root {
  --bg-1: #05060f;
  --bg-2: #0a1024;
  --blue: #2148e0;
  --blue-glow: #4f7dff;
  --red: #e02335;
  --red-glow: #ff5566;
  --silver: #cfd8f0;
  --text-light: #eef2ff;
  --text-muted: #8d97bf;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 50% 15%, var(--bg-2) 0%, var(--bg-1) 72%);
  color: var(--text-light);
  font-family: "Segoe UI", "Inter", Roboto, Arial, sans-serif;
  overflow-x: hidden;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.bg-glow {
  position: fixed;
  width: 60vw;
  height: 60vw;
  max-width: 700px;
  max-height: 700px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.22;
  z-index: 0;
  pointer-events: none;
}
.bg-glow--blue { background: var(--blue); top: -12%; left: -10%; }
.bg-glow--red { background: var(--red); bottom: -16%; right: -10%; }

.intro {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5vh 4vw 3vh;
  text-align: center;
}

.intro-head { margin-bottom: 0.5rem; }

.brand-title {
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: 0.5px;
  margin: 0;
  background: linear-gradient(90deg, var(--blue-glow), var(--silver) 45%, var(--red-glow));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(79, 125, 255, 0.25);
}
.brand-title span { color: var(--silver); }

.brand-tagline {
  margin: 0.6rem 0 0;
  color: var(--text-muted);
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* ================= Blockchain hub 3D ================= */
.hub-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.hub {
  position: relative;
  width: min(94vw, 680px);
  max-height: 58vh;
  aspect-ratio: 1 / 0.82;
}

/* SVG lớp sau (bị logo che) & lớp trước (nằm trên logo) */
.hub-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
#linesBack { z-index: 1; }
#linesFront { z-index: 4; }

.hub-line {
  fill: none;
  stroke: rgba(140, 170, 255, 0.5);
  stroke-linecap: round;
  stroke-dasharray: 6 7;
  vector-effect: non-scaling-stroke;
  animation: dash-flow 2.6s linear infinite;
}
.hub-line--ring {
  stroke: rgba(255, 170, 120, 0.5);
  animation: dash-flow 4s linear infinite reverse;
}
.orbit-path {
  fill: none;
  stroke: rgba(160, 190, 255, 0.16);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

@keyframes dash-flow { to { stroke-dashoffset: -78; } }

/* Tâm: logo + vòng sáng */
.hub-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 26%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.center-glow {
  position: absolute;
  inset: -26%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 125, 255, 0.4), rgba(224, 35, 53, 0.16) 55%, transparent 76%);
  filter: blur(20px);
  animation: pulse-glow 3.2s ease-in-out infinite;
}

.center-ring {
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  border: 1px solid rgba(207, 216, 240, 0.35);
  box-shadow: inset 0 0 28px rgba(79, 125, 255, 0.3);
  animation: pulse-glow 3.2s ease-in-out infinite reverse;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

.center-logo {
  position: relative;
  width: 82%;
  height: 82%;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(79, 125, 255, 0.5));
  animation: breathe 3.2s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

/* Khối vệ tinh: hình tròn, tên nằm trong */
.nodes { position: absolute; inset: 0; }

.node {
  position: absolute;
  top: 0;
  left: 0;
  text-decoration: none;
  z-index: 2;
  will-change: left, top;
}

.node-block {
  position: relative;
  width: clamp(72px, 14.5vw, 112px);
  height: clamp(72px, 14.5vw, 112px);
  /* margin âm = tự căn giữa quanh toạ độ node, để dành transform cho JS (scale theo chiều sâu) */
  margin-left: calc(clamp(72px, 14.5vw, 112px) / -2);
  margin-top: calc(clamp(72px, 14.5vw, 112px) / -2);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.22), transparent 52%),
    linear-gradient(150deg, rgba(33, 72, 224, 0.62), rgba(224, 35, 53, 0.5));
  border: 1px solid rgba(207, 216, 240, 0.45);
  box-shadow:
    0 0 24px rgba(79, 125, 255, 0.35),
    inset 0 -6px 14px rgba(0, 0, 0, 0.35),
    inset 0 6px 12px rgba(255, 255, 255, 0.14);
  will-change: transform;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.node-label {
  font-size: clamp(0.62rem, 1.55vw, 0.82rem);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.75);
  letter-spacing: 0.2px;
}

.node-index {
  font-size: 0.52rem;
  letter-spacing: 1px;
  color: rgba(230, 238, 255, 0.65);
}

.node:hover .node-block,
.node:focus-visible .node-block {
  border-color: var(--blue-glow);
  box-shadow:
    0 0 40px rgba(79, 125, 255, 0.7),
    inset 0 -6px 14px rgba(0, 0, 0, 0.3),
    inset 0 6px 12px rgba(255, 255, 255, 0.22);
}
.node:focus-visible { outline: none; }
.node:focus-visible .node-block { outline: 2px solid var(--silver); outline-offset: 3px; }

.hub-hint {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ================= Footer ================= */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.2rem 1rem 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}
.site-footer p { margin: 0.2rem 0; }
.site-footer a {
  color: var(--silver);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.site-footer a:hover,
.site-footer a:focus-visible { color: var(--blue-glow); border-color: var(--blue-glow); }

@media (max-width: 480px) {
  .intro { padding: 4vh 3vw 2vh; }
  .brand-tagline { letter-spacing: 0.8px; }
}

@media (prefers-reduced-motion: reduce) {
  .center-glow, .center-ring, .center-logo, .hub-line { animation: none !important; }
}
