/* speedtest.i-nter.net — mirrors the ip-echo / i-nter.net home palette. */

@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/worksans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/worksans-600.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/jetbrainsmono-500.woff2') format('woff2');
}

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

:root {
  --bg: #f6f8f9;
  --panel: #ffffff;
  --line: #dde2e8;
  --text: #14181d;
  --muted: #687180;
  --teal: #14b8a6;
  --font-sans: 'Work Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;
}

html {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(900px 500px at 50% -8%, rgba(20, 184, 166, .12), transparent 60%);
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.section { padding-top: 2.25rem; }

.hero { text-align: center; }

.brand {
  display: inline-block;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text);
}
.brand .dot { color: var(--teal); }
.brand:hover { text-decoration: none; }

.site-title {
  margin-top: 1.4rem;
  font-size: 1.7rem;
  font-weight: 600;
}

.tagline { color: var(--muted); margin-top: .35rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.panel h2 { font-size: 1rem; margin-bottom: .8rem; }

.gauge-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  text-align: center;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  text-align: center;
  margin-top: 1.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.metric { display: flex; flex-direction: column; }

.metric-label {
  color: var(--muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 2.6rem;
  font-weight: 500;
  line-height: 1.2;
  margin-top: .25rem;
}

.metric-value-sm {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 500;
  margin-top: .25rem;
}

.metric-unit { color: var(--muted); font-size: .8rem; }

.controls { text-align: center; margin-top: 1.5rem; }

.start-button {
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--teal);
  border: 0;
  border-radius: 8px;
  padding: .65rem 2.2rem;
  cursor: pointer;
}
.start-button:hover { filter: brightness(.95); }
.start-button:disabled { opacity: .55; cursor: default; }

.progress {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 1rem;
}

/* Indeterminate sweep — the engine exposes no per-phase progress index. */
.progress-bar {
  height: 100%;
  width: 35%;
  background: var(--teal);
  animation: sweep 1.4s ease-in-out infinite;
}

@keyframes sweep {
  0%   { margin-left: 0; }
  50%  { margin-left: 65%; }
  100% { margin-left: 0; }
}

.status { color: var(--muted); margin-top: .8rem; min-height: 1.4em; }
.status.error { color: #b3261e; }

.scores { list-style: none; }
.scores li {
  display: flex;
  justify-content: space-between;
  padding: .45rem 0;
  border-bottom: 1px solid var(--line);
}
.scores li:last-child { border-bottom: 0; }
.score-label { color: var(--muted); }
.score-value { font-weight: 600; }

@media (max-width: 480px) {
  .metric-value { font-size: 2rem; }
}
