/* =====================================================================
 * Speed test homepage styles — standalone, no Tailwind build required.
 * Contains the custom component styles plus just the utility classes the
 * homepage markup actually uses, hand-written so nothing needs compiling.
 * ===================================================================== */

:root {
    --bg-deep: #05070f;
    --bg-panel: #0b1120;
    --bg-panel-light: #111a2e;
    --border-subtle: #1c2740;
    --accent-blue: #2b7fff;
    --accent-cyan: #22d3ee;
    --text-primary: #e6ecff;
    --text-muted: #8b9bc2;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: radial-gradient(circle at 20% 0%, #0d1830 0%, #05070f 55%);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ---- Fonts / helpers ---- */
.font-body { font-family: 'Inter', sans-serif; }
.font-display { font-family: 'Space Grotesk', sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.tracking-wide { letter-spacing: 0.025em; }
.leading-relaxed { line-height: 1.625; }
.leading-snug { line-height: 1.375; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.uppercase { text-transform: uppercase; }

/* ---- Text sizes ---- */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

/* ---- Colors ---- */
.text-text-primary { color: var(--text-primary); }
.text-text-muted { color: var(--text-muted); }
.text-accent-cyan { color: var(--accent-cyan); }
.text-bg-deep { color: var(--bg-deep); }
.bg-bg-panel-light { background: var(--bg-panel-light); }
.bg-accent-cyan { background: var(--accent-cyan); }
.border-border-subtle { border-color: var(--border-subtle); }
.border { border-width: 1px; border-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }

/* ---- Layout ---- */
.block { display: block; }
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none !important; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.max-w-3xl { max-width: 48rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mt-4 { margin-top: 1rem; }
.ml-1 { margin-left: 0.25rem; }

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.p-5 { padding: 1.25rem; }

.h-7 { height: 1.75rem; }
.w-2\.5 { width: 0.625rem; }
.h-2\.5 { height: 0.625rem; }
.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.pointer-events-auto { pointer-events: auto; }
.transition { transition: all 0.15s ease; }
.hover\:underline:hover { text-decoration: underline; }
.hover\:bg-bg-panel-light:hover { background: var(--bg-panel-light); }
.hover\:border-accent-blue:hover { border-color: var(--accent-blue); }
.hover\:text-text-primary:hover { color: var(--text-primary); }

/* ---- Gradient button ---- */
.bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--accent-blue), var(--accent-cyan));
}
.from-accent-blue { --tw-from: var(--accent-blue); }
.to-accent-cyan { --tw-to: var(--accent-cyan); }
.shadow-\[0_0_12px_\#22d3ee\] { box-shadow: 0 0 12px #22d3ee; }

/* ---- Responsive (md breakpoint = 768px) ---- */
@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:text-4xl { font-size: 2.25rem; }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .hidden.md\:flex { display: flex; }
}
@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* On small screens, the md:flex nav stays hidden (matches Tailwind's hidden md:flex). */
@media (max-width: 767px) {
    .hidden { display: none !important; }
}

/* ---- Network grid background ---- */
.network-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(43, 127, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(43, 127, 255, 0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 40%, transparent 100%);
    mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 40%, transparent 100%);
}

/* ---- Speedometer ---- */
.speedometer-wrap {
    position: relative;
    width: min(360px, 80vw);
    height: min(360px, 80vw);
    margin: 0 auto;
}
.speedometer-wrap canvas { width: 100%; height: 100%; }
.speedometer-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* ---- GO button ---- */
.go-button {
    width: 140px;
    height: 140px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #2b7fff, #22d3ee);
    color: #06101f;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.05em;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 60px rgba(34, 211, 238, 0.35), 0 20px 40px rgba(0,0,0,0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.go-button:hover {
    transform: scale(1.04);
    box-shadow: 0 0 80px rgba(34, 211, 238, 0.5), 0 20px 40px rgba(0,0,0,0.4);
}
.go-button:active { transform: scale(0.98); }

/* ---- Result stats ---- */
.result-stat {
    background: linear-gradient(180deg, #111a2e, #0b1120);
    border: 1px solid #1c2740;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
}
.result-stat .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8b9bc2;
    margin-bottom: 8px;
}
.result-stat .value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 600;
    color: #e6ecff;
}
.result-stat .unit { font-size: 12px; color: #8b9bc2; margin-left: 4px; }

/* Accessibility quality floor */
html { scroll-behavior: smooth; }
:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
