:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #1d2939;
  --muted: #475467;
  --accent: #0f766e;
  --accent-2: #164e63;
  --line: #d0d5dd;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #e6f7f4, var(--bg) 32%);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

.container {
  width: min(1200px, 94%);
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: #ffffffcc;
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1rem;
  font-size: 0.95rem;
}

nav a:hover {
  color: var(--text);
}

h2,
h3 {
  line-height: 1.2;
}

button {
  display: inline-block;
  margin-top: 1rem;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0.7rem 1.2rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

#run-test.retest-highlight {
  padding: 0.9rem 1.8rem;
  font-size: 1.05rem;
  box-shadow: 0 0 0 4px #d1fae5, 0 10px 20px #0f766e33;
}

.test-section,
.content-section,
.ad-slot-wrap {
  padding: 2.8rem 0;
}

#speed-test,
#how-it-works,
#faq {
  scroll-margin-top: 96px;
}

.subtext,
.tiny-note {
  color: var(--muted);
}

.network-info {
  margin-top: 0.8rem;
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 0.45rem 1.2rem;
  text-align: left;
}

.network-info p {
  margin: 0;
  color: #344054;
  font-size: 0.98rem;
}

.network-info strong {
  color: #111827;
}

.test-heading {
  text-align: center;
  margin: 0 0 0.65rem;
  font-size: clamp(2rem, 4.8vw, 3rem);
}

.test-card {
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 2.6rem 1.6rem 1.4rem;
  text-align: center;
}

.speed-focus {
  margin-bottom: 1.25rem;
}

.rpm-meter {
  width: min(560px, 96%);
  height: 220px;
  margin: 0.8rem auto 0.3rem;
}

.rpm-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.rpm-track {
  fill: none;
  stroke: #d7e7eb;
  stroke-width: 22;
  stroke-linecap: round;
}

.rpm-zone {
  fill: none;
  stroke-width: 16;
  stroke-linecap: round;
}

.zone-green {
  stroke: #16a34a;
}

.zone-yellow {
  stroke: #d97706;
}

.zone-red {
  stroke: #dc2626;
}

.tick {
  stroke: #334155;
  stroke-linecap: round;
}

.tick.major {
  stroke-width: 3;
}

.tick.minor {
  stroke-width: 2;
  opacity: 0.6;
}

.rpm-labels text {
  fill: #475467;
  font-size: 14px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: middle;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 2px;
  stroke-linejoin: round;
}

.rpm-needle {
  stroke: #1a6f74;
  stroke-width: 8;
  stroke-linecap: round;
  filter: drop-shadow(0 0 7px #164e6340);
  transition: transform 120ms linear;
}

.rpm-hub {
  fill: #0f766e;
  stroke: #e7f7f4;
  stroke-width: 4;
}

.phase {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

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

.speed-big {
  display: inline-flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.result-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.2rem, 2.2vw, 2rem);
  font-weight: 700;
  color: #1f2937;
}

.phase-banner {
  display: inline-block;
  margin: 0 0 0.55rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #ecfdf3;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-weight: 700;
  font-size: 0.92rem;
}

#live-speed {
  display: block;
  font-size: clamp(4.5rem, 15vw, 10.5rem);
  font-weight: 700;
  line-height: 0.95;
}

.speed-big small {
  font-size: clamp(1rem, 2vw, 1.35rem);
  color: var(--muted);
  margin-bottom: 0.7rem;
}

.speed-secondary {
  margin: 0.35rem 0 0.2rem;
  color: #344054;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  min-height: 1.4em;
}

.stats {
  display: grid;
  gap: 0.65rem;
}

.stats.compact {
  grid-template-columns: repeat(5, minmax(80px, 1fr));
  margin-bottom: 0.8rem;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.5rem;
  background: #fff;
}

.stat span {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.15rem;
}

.alt {
  background: #eefaf7;
}

.ad-slot {
  border: 1px dashed #98a2b3;
  border-radius: 12px;
  min-height: 100px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fff;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.2rem 0;
  color: var(--muted);
  flex-shrink: 0;
  background: #fff;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.2rem;
  margin-top: 0.35rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

.info-page {
  padding: 2.3rem 0 3rem;
}

.content-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.2rem;
}

.content-card h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin: 0.2rem 0 0.8rem;
}

.content-card h2 {
  margin-top: 1.3rem;
}

.content-card p,
.content-card li {
  color: #344054;
  line-height: 1.6;
}

.content-card ul {
  padding-left: 1.1rem;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 0.9rem;
}

.guide-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.9rem;
}

.guide-card h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

.guide-card a {
  text-decoration: none;
  color: #0f766e;
  font-weight: 700;
}

@media (max-width: 900px) {
  .stats.compact {
    grid-template-columns: 1fr;
  }

  .network-info {
    grid-template-columns: 1fr;
  }

  .rpm-meter {
    height: 170px;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }
}
