*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Logo Color Palette */
  --accent: #0088ff; /* Bright Electric Blue */
  --accent2: #0b2545; /* Deep Tech Navy */
  --warn: #ffb800;

  --font-h: "Poppins", sans-serif;
  --font-m: "JetBrains Mono", monospace;
  --r: 12px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t: 0.28s;
}

[data-theme="dark"] {
  --bg: #060e1a; /* Dark Tech Navy Background */
  --surface: #0e1a2b;
  --surface2: #15263d;
  --border: #1b3352;
  --border2: #284b77;
  --text: #f0f6fc;
  --text2: #8da4c4;
  --text3: #adc5e6;
  --shadow: rgba(0, 0, 0, 0.6);
  --glow: rgba(0, 136, 255, 0.15);
  --accent-cyan: #00d2ff;
}

[data-theme="light"] {
  --bg: #f4f8fc;
  --surface: #ffffff;
  --surface2: #ebf3fa;
  --border: #d0e0f0;
  --border2: #b0ccf0;
  --text: #0b1e3d;
  --text2: #3a587d;
  --text3: #2a3b50;
  --shadow: rgba(11, 30, 61, 0.08);
  --glow: rgba(0, 117, 255, 0.08);
  --accent-cyan: #004858;
}

html,
body {
  min-height: 100%;
  font-family: var(--font-h);
  background: var(--bg);
  color: var(--text);
  transition:
    background var(--t) var(--ease),
    color var(--t) var(--ease);
}

/* Background gradient mesh matching logo tech nodes */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 70% 60% at 50% 0%,
      rgba(0, 136, 255, 0.12) 0%,
      transparent 65%
    ),
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size:
    100% 100%,
    52px 52px,
    52px 52px;
  opacity: 0.35;
}
[data-theme="light"] body::before {
  opacity: 0.5;
}

/* ── Topbar ── */
.topbar {
  width: 100%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  padding: 28px 24px 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0b1e3d 0%, #0075ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #ffffff;
  border: 1px solid rgba(0, 210, 255, 0.4);
  box-shadow: 0 4px 14px rgba(0, 117, 255, 0.25);
  flex-shrink: 0;
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px 6px 10px;
  cursor: pointer;
  transition:
    border-color var(--t),
    box-shadow var(--t);
  font-family: var(--font-h);
  color: var(--text2);
  font-size: 0.73rem;
  font-weight: 500;
  user-select: none;
}
.toggle-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--glow);
}
.t-track {
  width: 38px;
  height: 20px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  position: relative;
  transition: background var(--t);
  flex-shrink: 0;
}
[data-theme="light"] .t-track {
  background: var(--accent);
}
.t-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text3);
  transition:
    transform var(--t) var(--ease),
    background var(--t);
}
[data-theme="light"] .t-thumb {
  transform: translateX(16px);
  background: #fff;
}

/* ── Page ── */
.page {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

/* ── Hero ring ── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 56px 0 8px;
  animation: rise 0.6s var(--ease) both;
}

.ring-wrap {
  position: relative;
  width: 160px;
  height: 160px;
}

/* Outer pulsing rings */
.ring-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  animation: pulse-out 2.4s ease-out infinite;
  opacity: 0;
}
.ring-pulse:nth-child(2) {
  animation-delay: 0.8s;
}
@keyframes pulse-out {
  0% {
    transform: scale(1);
    opacity: 0.45;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ring-pulse {
    animation: none;
  }
}

/* Rotating orbit rings */
.orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.orbit-1 {
  width: calc(100% + 14px);
  height: calc(100% + 14px);
  border-color: rgba(0, 136, 255, 0.25);
  animation: spin 9s linear infinite;
}
.orbit-2 {
  width: calc(100% + 28px);
  height: calc(100% + 28px);
  border-color: rgba(0, 210, 255, 0.15);
  animation: spin 16s linear infinite reverse;
}
@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.ring-body {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  box-shadow:
    0 0 40px var(--glow),
    0 8px 32px var(--shadow);
  position: relative;
  z-index: 2;
}

.ring-icon {
  font-size: 2.6rem;
  line-height: 1;
  color: var(--accent);
  filter: drop-shadow(0 0 12px rgba(0, 136, 255, 0.6));
}

.ring-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-m);
}

/* Title */
.hero-title {
  text-align: center;
}
.hero-title h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  background: linear-gradient(135deg, #0b1e3d 0%, #0075ff 60%, #00d2ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="dark"] .hero-title h1 {
  background: linear-gradient(135deg, #ffffff 0%, #0088ff 70%, #00d2ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-title p {
  font-size: 0.92rem;
  color: var(--text2);
  letter-spacing: 0.06em;
  font-family: var(--font-m);
  margin-top: 8px;
}

/* ── Stat grid ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  width: 100%;
  animation: rise 0.6s 0.1s var(--ease) both;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition:
    border-color var(--t),
    box-shadow var(--t),
    transform var(--t);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, #0075ff, #00d2ff);
  opacity: 0;
  transition: opacity var(--t);
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border2);
  box-shadow: 0 8px 28px var(--shadow);
}
.stat-card:hover::before {
  opacity: 1;
}

.stat-l {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
  font-family: var(--font-m);
}
.stat-v {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-m);
}
.stat-v.hi {
  color: var(--accent);
}

/* ── JSON block ── */
/* ── JSON block ── */
.json-section {
  width: 100%;
  animation: rise 0.6s 0.2s var(--ease) both;
}

.sec-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text3);
  font-family: var(--font-m);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Optional dot indicator next to section label */
.sec-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.json-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 24px;
  max-height: 360px;
  overflow-y: auto;
  overflow-x: auto;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
  transition:
    border-color var(--t),
    box-shadow var(--t);
}

.json-box:hover {
  border-color: var(--border2);
  box-shadow:
    0 0 20px var(--glow),
    inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Pre and Code formatting */
.json-box pre {
  margin: 0;
  padding: 0;
  background: transparent;
}

.json-box code {
  font-family: var(--font-m);
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--accent-cyan); /* Cyan hue for JSON content */
  white-space: pre;
  word-break: normal;
  word-wrap: normal;
}

/* Custom Scrollbar */
.json-box::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.json-box::-webkit-scrollbar-track {
  background: transparent;
}

.json-box::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 999px;
}

.json-box::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ── Back button ── */
.back-wrap {
  animation: rise 0.6s 0.25s var(--ease) both;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text2);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font-m);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 20px;
  transition: all var(--t);
}
.back:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 16px var(--glow);
}

/* ── Footer ── */
.footer {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  width: 100%;
  text-align: center;
  animation: rise 0.65s 0.25s var(--ease) both;
}
.footer-l {
  font-size: 0.7rem;
  color: var(--text3);
  font-family: var(--font-m);
}

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

@media (max-width: 520px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}
