:root {
  --aurora-green: #00ff87;
  --aurora-cyan: #00d9ff;
  --aurora-blue: #0066ff;
  --aurora-purple: #8b5cf6;
  --aurora-pink: #ff006e;
  --aurora-magenta: #ff00ff;

  --bg-primary: #0a0e1a;
  --bg-secondary: #0f1628;
  --bg-card: #141d30;
  --bg-card-hover: #1a2540;
  --text-primary: #ffffff;
  --text-secondary: #7a8baa;
  --border: rgba(255, 255, 255, 0.06);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
  line-height: 1.6;
}

/* ====== AURORA BACKGROUND ====== */

.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.2;
  background:
    radial-gradient(ellipse at 15% 20%, var(--aurora-green) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 15%, var(--aurora-cyan) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, var(--aurora-purple) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, var(--aurora-pink) 0%, transparent 40%);
  filter: blur(100px);
  animation: auroraMove 25s ease-in-out infinite;
}

@keyframes auroraMove {
  0%, 100% { transform: scale(1) translate(0, 0); }
  25% { transform: scale(1.05) translate(2%, -1%); }
  50% { transform: scale(0.97) translate(-1%, 2%); }
  75% { transform: scale(1.03) translate(1%, -2%); }
}

/* ====== HEADER ====== */

.masthead {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 2rem;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(180%);
  background: rgba(10, 14, 26, 0.75);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: 'Orbitron', monospace;
  font-size: 1.6rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--aurora-cyan), var(--aurora-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  letter-spacing: 2px;
}

.nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-menu a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.3s;
  position: relative;
}

.nav-menu a:hover {
  color: var(--aurora-cyan);
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--aurora-cyan);
  transition: width 0.3s;
}

.nav-menu a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  transition: 0.3s;
}

/* ====== HERO ====== */

.hero {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 120px 2rem 40px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--aurora-cyan), var(--aurora-green), var(--aurora-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  font-weight: 400;
}

/* ====== SPEEDTEST CARD ====== */

.speedtest-section {
  position: relative;
  z-index: 10;
  padding: 2rem;
}

.speedtest-card {
  max-width: 820px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 2.5rem 2rem;
  box-shadow:
    0 0 80px rgba(0, 217, 255, 0.06),
    0 0 160px rgba(139, 92, 246, 0.04),
    0 30px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.speedtest-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 2rem;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.15), transparent 50%, rgba(0, 255, 135, 0.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ====== STATUS BAR ====== */

.status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 2rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--aurora-cyan);
  box-shadow: 0 0 8px var(--aurora-cyan);
  transition: background 0.3s;
}

.status-dot.testing {
  background: var(--aurora-green);
  animation: pulse 1s ease-in-out infinite;
}

.status-dot.done {
  background: var(--aurora-green);
}

.status-dot.error {
  background: #ff4444;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.status-text {
  font-size: 0.9rem;
  color: var(--aurora-cyan);
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: opacity 0.3s;
}

/* ====== GAUGE ====== */

.gauge-wrapper {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 2rem;
}

.gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(90deg);
  pointer-events: none;
}

.gauge-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 16;
}

.gauge-progress {
  fill: none;
  stroke: url(#gaugeGrad);
  stroke-width: 16;
  stroke-linecap: round;
  stroke-dasharray: 817;
  stroke-dashoffset: 817;
  transition: stroke-dashoffset 0.15s linear;
}

.gauge-inner-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.02);
  stroke-width: 1;
}

.gauge-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.gauge-speed {
  font-family: 'Orbitron', monospace;
  font-size: 3.2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--aurora-cyan), var(--aurora-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.gauge-unit {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 4px;
}

.gauge-phase {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 6px;
  min-height: 18px;
}

/* ====== GO BUTTON ====== */

.go-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--aurora-cyan), var(--aurora-green));
  color: var(--bg-primary);
  font-family: 'Orbitron', monospace;
  font-size: 1.8rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow:
    0 0 30px rgba(0, 217, 255, 0.4),
    0 0 60px rgba(0, 255, 135, 0.2),
    inset 0 0 15px rgba(255, 255, 255, 0.2);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.go-button:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow:
    0 0 50px rgba(0, 217, 255, 0.6),
    0 0 100px rgba(0, 255, 135, 0.3),
    inset 0 0 25px rgba(255, 255, 255, 0.3);
}

.go-button:active:not(:disabled) {
  transform: translate(-50%, -50%) scale(0.95);
}

.go-button:disabled {
  cursor: default;
}

.go-button.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.5);
}

.go-spinner {
  display: none;
  width: 36px;
  height: 36px;
  border: 4px solid rgba(10, 14, 26, 0.3);
  border-top-color: var(--bg-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.go-button.loading .go-text { display: none; }
.go-button.loading .go-spinner { display: block; }

/* ====== METRICS ROW ====== */

.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 1rem;
  transition: all 0.3s;
}

.metric-item.active {
  border-color: rgba(0, 217, 255, 0.3);
  background: rgba(0, 217, 255, 0.04);
}

.metric-item.done {
  border-color: rgba(0, 255, 135, 0.2);
}

.metric-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ping-icon { background: linear-gradient(135deg, rgba(0,255,135,0.15), rgba(0,217,255,0.15)); color: var(--aurora-green); }
.download-icon { background: linear-gradient(135deg, rgba(0,217,255,0.15), rgba(0,102,255,0.15)); color: var(--aurora-cyan); }
.upload-icon { background: linear-gradient(135deg, rgba(255,0,110,0.15), rgba(139,92,246,0.15)); color: var(--aurora-pink); }

.metric-data {
  display: flex;
  flex-direction: column;
}

.metric-value {
  font-family: 'Orbitron', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}

#metricPing .metric-value { color: var(--aurora-green); }
#metricDownload .metric-value { color: var(--aurora-cyan); }
#metricUpload .metric-value { color: var(--aurora-pink); }

.metric-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.metric-label small {
  opacity: 0.7;
  font-weight: 400;
}

/* ====== DETAILS ROW ====== */

.details-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  transition: opacity 0.5s;
}

.details-row.show {
  opacity: 1;
}

.detail-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(0, 217, 255, 0.06);
  border: 1px solid rgba(0, 217, 255, 0.12);
  border-radius: 2rem;
  font-size: 0.8rem;
}

.detail-label {
  color: var(--text-secondary);
}

.detail-value {
  color: var(--aurora-cyan);
  font-weight: 600;
}

.extra-row {
  margin-top: 0.75rem;
}

.gaming-chip {
  border-color: rgba(0, 255, 135, 0.2);
  background: rgba(0, 255, 135, 0.06);
}

.gaming-chip .detail-label {
  color: var(--aurora-green);
}

/* ====== FEATURES ====== */

.features-section {
  position: relative;
  z-index: 10;
  padding: 5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 3rem;
  color: var(--text-primary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2rem;
  transition: all 0.3s;
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 217, 255, 0.15);
  transform: translateY(-4px);
}

.feature-icon {
  margin-bottom: 1.2rem;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ====== FOOTER ====== */

.site-footer {
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  margin-bottom: 1.5rem;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--aurora-cyan);
}

.footer-copy {
  color: var(--text-secondary);
  font-size: 0.75rem;
  opacity: 0.6;
}

/* ====== RESPONSIVE ====== */

@media (max-width: 768px) {
  .masthead { padding: 0 1.2rem; }

  .nav-menu { display: none; }

  .nav-toggle { display: flex; }

  .hero { padding: 100px 1.5rem 30px; }

  .speedtest-card { padding: 2rem 1.2rem; border-radius: 1.5rem; }

  .gauge-wrapper { width: 240px; height: 240px; }

  .gauge-speed { font-size: 2.5rem; }

  .go-button { width: 100px; height: 100px; font-size: 1.4rem; }

  .metrics-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .details-row { gap: 0.5rem; }

  .detail-chip { font-size: 0.72rem; padding: 6px 12px; }
}

@media (max-width: 480px) {
  .gauge-wrapper { width: 200px; height: 200px; }
  .gauge-speed { font-size: 2rem; }
  .go-button { width: 85px; height: 85px; font-size: 1.2rem; }
}

/* ====== CONSENT BANNER ====== */

.consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(20, 29, 48, 0.95);
  backdrop-filter: blur(15px);
  border-top: 1px solid rgba(0, 217, 255, 0.15);
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.consent-banner p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  max-width: 600px;
  line-height: 1.5;
}

.consent-btn {
  padding: 8px 24px;
  background: linear-gradient(135deg, var(--aurora-cyan), var(--aurora-green));
  border: none;
  border-radius: 8px;
  color: var(--bg-primary);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.consent-btn:hover {
  opacity: 0.9;
}

@media (max-width: 768px) {
  .consent-banner {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    text-align: center;
  }
}
