:root {
  --bg: #070b14;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-card-border: rgba(148, 163, 184, 0.12);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --cyan: #22d3ee;
  --indigo: #6366f1;
  --purple: #a855f7;
  --green: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* Background */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: float 12s ease-in-out infinite;
}

.bg-glow--left {
  top: -200px;
  left: -150px;
  background: var(--cyan);
}

.bg-glow--right {
  bottom: -200px;
  right: -150px;
  background: var(--purple);
  animation-delay: -6s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, 20px); }
}

/* Layout */
.site-header, .main, .footer, .page-hero {
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--bg-card-border);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.logo-icon {
  width: 34px;
  height: 34px;
  color: var(--cyan);
}

.logo-icon svg { width: 100%; height: 100%; }

.logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.nav-link {
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 10px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  border-radius: 8px;
  cursor: pointer;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.page-hero {
  text-align: center;
  padding: 32px 24px 16px;
}

.page-title {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-hero-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

.main--wide {
  max-width: 960px;
}

.main--speed {
  max-width: 960px;
}

/* Stat strip */
.stat-strip {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--bg-card-border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.stat-pill svg {
  width: 14px;
  height: 14px;
  color: var(--cyan);
  flex-shrink: 0;
}

/* Panel (matches terminal chrome) */
.panel {
  background: rgba(10, 14, 26, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 24px 64px rgba(0, 0, 0, 0.45);
  animation: cardIn 0.5s ease-out;
}

.panel-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(180deg, #2a2a2a 0%, #161616 100%);
  border-bottom: 1px solid #000;
}

.panel-title {
  flex: 1;
  font-size: 0.78rem;
  font-weight: 600;
  color: #ccc;
  text-align: center;
  letter-spacing: 0.02em;
}

.panel-phase {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--cyan);
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.2);
}

.panel-body {
  padding: 28px 24px 24px;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(99, 102, 241, 0.06) 0%, transparent 60%),
    rgba(7, 11, 20, 0.5);
}

/* Speed layout */
.speed-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
  align-items: start;
}

.speed-primary {
  min-width: 0;
}

.gauge-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.gauge-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(99, 102, 241, 0.15);
  pointer-events: none;
}

.gauge-ring--outer {
  width: 280px;
  height: 280px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -58%);
}

.gauge-ring--pulse {
  width: 300px;
  height: 300px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -58%);
  border-color: rgba(34, 211, 238, 0.08);
  animation: ringPulse 3s ease-in-out infinite;
}

.gauge-stage.testing .gauge-ring--pulse {
  animation: ringPulseActive 1.5s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% { opacity: 0.4; transform: translate(-50%, -58%) scale(1); }
  50% { opacity: 0.8; transform: translate(-50%, -58%) scale(1.02); }
}

@keyframes ringPulseActive {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -58%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -58%) scale(1.05); }
}

.quality-badge {
  margin-top: 12px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quality-badge--excellent { background: rgba(52, 211, 153, 0.15); color: var(--green); border: 1px solid rgba(52, 211, 153, 0.3); }
.quality-badge--good { background: rgba(34, 211, 238, 0.12); color: var(--cyan); border: 1px solid rgba(34, 211, 238, 0.3); }
.quality-badge--fair { background: rgba(251, 191, 36, 0.12); color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.3); }
.quality-badge--slow { background: rgba(251, 113, 133, 0.12); color: var(--rose); border: 1px solid rgba(251, 113, 133, 0.3); }

.chart-panel {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px 8px;
  margin-bottom: 20px;
}

.chart-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.chart-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.3);
  transition: background 0.3s, box-shadow 0.3s;
}

.chart-dot.active {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.progress-wrap {
  margin-bottom: 20px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.progress-pct {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cyan);
  flex-shrink: 0;
}

.progress {
  height: 8px;
  background: rgba(148, 163, 184, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0;
}

.btn--lg {
  min-width: 220px;
  padding: 18px 40px;
  font-size: 1.05rem;
}

/* Sidebar metrics */
.speed-metrics {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.metrics-heading {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.metric-card:hover {
  border-color: rgba(99, 102, 241, 0.25);
}

.metric-card.active {
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.08);
  transform: translateX(4px);
}

.metric-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-card-icon svg { width: 20px; height: 20px; }

.metric-card-body { min-width: 0; }

.metric-card-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-card-value {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.metric-card-hint {
  margin: 4px 0 0;
  font-size: 0.72rem;
  color: rgba(148, 163, 184, 0.7);
}

/* Results panel */
.results-panel {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--bg-card-border);
  display: none;
}

.results-panel.visible {
  display: block;
  animation: fadeIn 0.45s ease;
}

.results-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.results-chip {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(52, 211, 153, 0.12);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.result-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.result-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.result-card-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.result-card-value {
  display: block;
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--cyan);
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.feature-card {
  display: block;
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  backdrop-filter: blur(12px);
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

a.feature-card:hover {
  border-color: rgba(34, 211, 238, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.feature-card--info {
  cursor: default;
}

.feature-card-icon {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
}

.feature-card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.feature-card-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cyan);
}

.footer--rich {
  padding-top: 24px;
  border-top: 1px solid var(--bg-card-border);
  margin-top: 16px;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
}

.footer-nav a {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-nav a:hover { color: var(--cyan); }

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 40px 32px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  animation: cardIn 0.6s ease-out;
}

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

/* Gauge */
.gauge-wrap {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto 24px;
}

.gauge {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-track {
  fill: none;
  stroke: rgba(148, 163, 184, 0.12);
  stroke-width: 14;
}

.gauge-fill {
  fill: none;
  stroke: url(#gaugeGrad);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 628;
  stroke-dashoffset: 628;
  filter: url(#glow);
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-value {
  font-family: var(--mono);
  font-size: 2.75rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--cyan), var(--indigo));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gauge-unit {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gauge-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Live chart */
.live-chart {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100px;
  border-radius: 8px;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.live-chart.active { opacity: 1; }

/* Metrics */
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.metric {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s;
}

.metric:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

.metric.active {
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.08);
}

.metric-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon svg { width: 20px; height: 20px; }

.metric-icon--ping {
  background: rgba(251, 191, 36, 0.15);
  color: var(--amber);
}

.metric-icon--down {
  background: rgba(34, 211, 238, 0.15);
  color: var(--cyan);
}

.metric-icon--up {
  background: rgba(168, 85, 247, 0.15);
  color: var(--purple);
}

.metric-value {
  margin: 0;
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text);
}

.metric-label {
  margin: 4px 0 0;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Progress */
.progress {
  height: 6px;
  background: rgba(148, 163, 184, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--indigo), var(--purple));
  border-radius: 3px;
  transition: width 0.4s ease;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

/* Status */
.status {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 24px;
  min-height: 1.5em;
}

/* Button */
.actions {
  display: flex;
  justify-content: center;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 180px;
  padding: 16px 32px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--indigo) 50%, var(--purple) 100%);
  background-size: 200% 200%;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.45);
  background-position: 100% 0;
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn.running .btn-text { opacity: 0; }
.btn.running .btn-spinner { opacity: 1; }

.btn-spinner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Results */
.results {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--bg-card-border);
  display: none;
  animation: fadeIn 0.4s ease;
}

.results.visible { display: block; }

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

.results-title {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.results-table th,
.results-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--bg-card-border);
}

.results-table th {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.results-table td:last-child {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--cyan);
}

.results-meta {
  margin: 16px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* Section headers */
.section-head {
  margin-bottom: 24px;
  text-align: center;
}

.section-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.card--downloads {
  margin-top: 24px;
}

/* Download tests */
.download-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.download-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 18px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.download-card.testing {
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.08);
}

.download-card.done {
  border-color: rgba(52, 211, 153, 0.35);
}

.download-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.download-size {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.download-filename {
  margin: 2px 0 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.download-badge {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--indigo);
  white-space: nowrap;
}

.download-badge.success {
  background: rgba(52, 211, 153, 0.15);
  color: var(--green);
}

.download-badge.error {
  background: rgba(251, 113, 133, 0.15);
  color: var(--rose);
}

.download-progress {
  height: 4px;
  background: rgba(148, 163, 184, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 14px;
}

.download-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--indigo));
  border-radius: 2px;
  transition: width 0.15s ease;
}

.download-card-actions {
  display: flex;
  gap: 8px;
}

.btn-sm {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid var(--bg-card-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  text-decoration: none;
  text-align: center;
  transition: background 0.2s, border-color 0.2s;
}

.btn-sm:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
}

.btn-sm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-sm--primary {
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.3);
  color: var(--cyan);
}

.download-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.btn-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--bg-card-border);
  min-width: 160px;
  padding: 14px 28px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.download-summary {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--bg-card-border);
}

.download-summary[hidden] {
  display: none !important;
}

/* Info cards */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 32px;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 24px;
  backdrop-filter: blur(12px);
}

.info-card h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.info-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Network terminal windows */
.terminals-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.terminal {
  background: #0c0c0c;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 20px 50px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #2d2d2d 0%, #1a1a1a 100%);
  border-bottom: 1px solid #000;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot--red { background: #ff5f57; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2); }
.dot--yellow { background: #febc2e; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2); }
.dot--green { background: #28c840; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2); }

.terminal-title {
  flex: 1;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ccc;
  text-align: center;
  font-family: var(--font);
  letter-spacing: 0.02em;
}

.terminal-clear {
  font-size: 0.7rem;
  font-weight: 600;
  color: #888;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 3px 10px;
  cursor: pointer;
  font-family: var(--font);
  transition: color 0.2s, background 0.2s;
}

.terminal-clear:hover {
  color: #fff;
  background: rgba(255,255,255,0.12);
}

.terminal-screen {
  position: relative;
  height: 320px;
  overflow-y: auto;
  padding: 14px 16px 8px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(34, 211, 238, 0.03) 0%, transparent 60%),
    #0a0a0a;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  color: #cccccc;
  scrollbar-width: thin;
  scrollbar-color: #333 #0a0a0a;
}

.terminal-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 4px
  );
  pointer-events: none;
  opacity: 0.35;
}

.terminal-screen--busy {
  cursor: progress;
}

.terminal-screen--busy::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 14px;
  width: 8px;
  height: 14px;
  background: #cccccc;
  animation: termBlink 1s step-end infinite;
}

@keyframes termBlink {
  50% { opacity: 0; }
}

.terminal-output {
  position: relative;
  z-index: 1;
  margin-bottom: 8px;
}

.term-line { margin-bottom: 2px; word-break: break-word; }

.term-line--reveal {
  opacity: 0;
  transform: translateY(8px);
  filter: blur(3px);
  transition:
    opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.term-line--reveal.term-line--visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.term-line--banner { color: #cccccc; margin-bottom: 8px; }
.term-line--muted { color: #666; font-style: italic; margin-bottom: 10px; }
.term-line--cmd { color: #fff; margin: 10px 0 6px; }
.term-line--out { color: #cccccc; }
.term-line--error { color: #ff6b6b; }

.term-line--help { color: #7dd3fc; }

.term-line--status {
  color: var(--amber);
  animation: termPulse 1.2s ease-in-out infinite;
}

@keyframes termPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.term-prompt-inline { color: #cccccc; }
.term-cmd-inline { color: #fff; font-weight: 600; }
.term-host-inline { color: #22d3ee; }

.terminal-input-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.term-prompt {
  color: #cccccc;
  font-family: var(--mono);
  font-size: 0.78rem;
  white-space: nowrap;
}

.term-cmd {
  color: #fff;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
}

.term-input {
  flex: 1;
  min-width: 120px;
  background: transparent;
  border: none;
  outline: none;
  color: #22d3ee;
  font-family: var(--mono);
  font-size: 0.78rem;
  caret-color: #cccccc;
}

.term-input::placeholder { color: #555; }
.term-input:disabled { opacity: 0.5; }

.terminal-quick {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #111;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.terminal-quick-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.term-chip {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  background: rgba(34, 211, 238, 0.06);
  color: #22d3ee;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.term-chip:hover {
  background: rgba(34, 211, 238, 0.14);
  border-color: rgba(34, 211, 238, 0.45);
}

.term-chip--help {
  border-color: rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.1);
  color: var(--purple);
  font-weight: 700;
}

.terminal-screen--tall {
  height: 420px;
}

.term-input--full {
  flex: 1;
  min-width: 0;
}

.terminal--single {
  width: 100%;
}

.update-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9999;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(34, 211, 238, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

.update-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Minecraft latency test */
.main--minecraft {
  max-width: 960px;
}

.mc-status-badge {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.mc-status-badge--starting {
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber);
  border-color: rgba(251, 191, 36, 0.3);
}

.mc-status-badge--running {
  background: rgba(52, 211, 153, 0.12);
  color: var(--green);
  border-color: rgba(52, 211, 153, 0.3);
}

.mc-status-badge--stopping {
  background: rgba(251, 113, 133, 0.12);
  color: var(--rose);
  border-color: rgba(251, 113, 133, 0.3);
}

.mc-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
  align-items: start;
}

.mc-primary { min-width: 0; }

.mc-hero-card {
  text-align: center;
  padding: 28px 24px 32px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.mc-hero-card--active {
  border-color: rgba(52, 211, 153, 0.3);
  box-shadow: 0 0 40px rgba(52, 211, 153, 0.06);
}

.mc-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(34, 211, 238, 0.3));
}

.mc-hero-title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.mc-hero-desc {
  margin: 0 auto 24px;
  max-width: 420px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.mc-timer {
  margin-bottom: 20px;
}

.mc-timer-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.mc-timer-value {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 600;
  color: var(--cyan);
}

.mc-address-box {
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
}

.mc-address-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.mc-address-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.mc-address {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--green);
  padding: 8px 14px;
  background: rgba(52, 211, 153, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.mc-copy-btn {
  padding: 8px 16px;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--bg-card-border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.mc-copy-btn:hover {
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.3);
}

.mc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.mc-warning {
  margin: 20px 0 0;
  font-size: 0.82rem;
  color: var(--amber);
}

.mc-warning code {
  font-family: var(--mono);
  font-size: 0.78rem;
}

.mc-latency-panel {
  margin-top: 20px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
}

.mc-latency-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.mc-latency-live {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.mc-latency-live.mc-latency--excellent { color: var(--green); }
.mc-latency-live.mc-latency--good { color: var(--cyan); }
.mc-latency-live.mc-latency--fair { color: var(--amber); }
.mc-latency-live.mc-latency--slow { color: var(--rose); }

.mc-latency-bar-wrap {
  height: 8px;
  background: rgba(148, 163, 184, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.mc-latency-bar {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  transition: width 0.5s ease, background 0.3s;
}

.mc-latency-bar.mc-latency--fair {
  background: linear-gradient(90deg, var(--amber), var(--rose));
}

.mc-latency-bar.mc-latency--slow {
  background: var(--rose);
}

.mc-latency-hint {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.75);
  line-height: 1.45;
}

.mc-sidebar .metric-card-value.mc-version-val {
  font-size: 0.95rem;
}

.mc-steps {
  margin-top: 8px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
}

.mc-steps-title {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mc-steps-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.mc-steps-list strong { color: var(--text); }

.mc-auth-note {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--bg-card-border);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.mc-auth-note code {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--cyan);
}

.mc-console {
  margin-top: 24px;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0c0c0c;
}

.mc-console-head {
  padding: 8px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #161616;
  border-bottom: 1px solid #000;
}

.mc-console-out {
  margin: 0;
  padding: 14px 10px 14px 14px;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.5;
  color: #9cdcfe;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 211, 238, 0.55) rgba(0, 0, 0, 0.45);
}

.mc-console-out::-webkit-scrollbar {
  width: 9px;
}

.mc-console-out::-webkit-scrollbar-track {
  margin: 4px 0;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
}

.mc-console-out::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.65) 0%, rgba(99, 102, 241, 0.65) 100%);
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0.35);
  min-height: 32px;
}

.mc-console-out::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.9) 0%, rgba(168, 85, 247, 0.85) 100%);
}

.mc-console-out::-webkit-scrollbar-corner {
  background: transparent;
}

/* Footer */
.footer {
  text-align: center;
  padding: 32px 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer p { margin: 0; }

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
    gap: 0;
  }

  .nav-toggle { display: flex; }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 0 4px;
    order: 4;
  }

  .site-nav.open {
    display: flex;
  }

  .nav-link {
    padding: 12px 14px;
    text-align: center;
  }

  .header-status {
    order: 3;
    margin-left: auto;
    margin-right: 8px;
  }

  .logo { order: 1; }
  .nav-toggle { order: 2; }
}

@media (max-width: 600px) {
  .speed-layout { grid-template-columns: 1fr; }
  .result-cards { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .mc-layout { grid-template-columns: 1fr; }
  .panel-body { padding: 20px 16px; }
  .gauge-wrap { width: 200px; height: 200px; }
  .gauge-value { font-size: 2.2rem; }
  .gauge-ring--outer { width: 230px; height: 230px; }
  .gauge-ring--pulse { width: 250px; height: 250px; }
  .metrics { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .download-grid { grid-template-columns: 1fr; }
  .terminals-grid { grid-template-columns: 1fr; }
  .terminal-screen { height: 260px; }
}
