/* PageSpeed scores section (partials/speed.php, assets/js/speed-scores.js).
 *
 * Green is PageSpeed's own "good" colour (#0cce6b), used only on the score
 * arcs, because that is what the numbers mean there; it is not a brand colour
 * anywhere else on the page. Coral stays reserved for things you can click. */

/* Sits straight under the live-blog section it belongs to. */
.blog-mockup + .speed { padding-top: 0; }

/* Frosted "liquid glass" (Buğra, 2026-10-02): see-through enough that the
   donkey guide (fixed, z-index -1, behind every section) shows as a soft
   blurred silhouette when it walks behind the card. The tints are all
   semi-transparent for that reason; nothing here may be an opaque fill.
   Browsers without backdrop-filter get a slightly denser tint instead. */
.speed-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  gap: var(--s-5);
  align-items: center;
  padding: var(--s-5) var(--s-4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-card);
  background:
    radial-gradient(520px 260px at 82% 50%, rgba(12, 206, 107, 0.10), transparent 70%),
    radial-gradient(420px 220px at 10% 0%, rgba(108, 192, 255, 0.08), transparent 70%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02) 55%, rgba(255, 255, 255, 0.05));
  -webkit-backdrop-filter: blur(6px) saturate(160%);
          backdrop-filter: blur(6px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 24px 60px -20px rgba(0, 0, 0, 0.55);
}
/* The glass sheen: a soft diagonal highlight across the top-left. */
.speed-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.03) 22%, transparent 40%);
  pointer-events: none;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .speed-card { background-color: rgba(28, 39, 64, 0.85); }
}
@media (min-width: 900px) {
  .speed-card { grid-template-columns: 1.05fr 1fr; padding: var(--s-6) var(--s-6); }
}

.speed-title {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0 0 var(--s-2);
}
.speed-lead {
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.65;
  margin: 0 0 var(--s-3);
  max-width: 46ch;
  text-wrap: pretty;
}
/* Small, and balanced when it does wrap (phones), so no lone word ends up on
   a line of its own. */
.speed-source { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--text-muted); opacity: 0.8; text-wrap: balance; }

.speed-gauges {
  display: flex;
  justify-content: center;
  gap: clamp(24px, 5vw, 56px);
}
.speed-gauge { margin: 0; display: flex; flex-direction: column; align-items: center; }

.speed-dial {
  position: relative;
  width: clamp(128px, 15vw, 168px);
  aspect-ratio: 1;
}
/* A soft halo that breathes in once the count finishes. */
.speed-dial::before {
  content: '';
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(12, 206, 107, 0.28), transparent 70%);
  filter: blur(14px);
  opacity: 0.55;
  transition: opacity 0.9s ease;
}
.speed-dial svg { position: relative; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.speed-track,
.speed-arc { fill: none; stroke-width: 9; }
.speed-track { stroke: rgba(238, 241, 248, 0.07); }
.speed-arc {
  stroke-linecap: round;
  stroke-dasharray: 100;
  filter: drop-shadow(0 0 6px rgba(12, 206, 107, 0.45));
}

.speed-number {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(36px, 4.4vw, 48px);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: #5cf2a0;
}

.speed-gauge figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--s-2);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.speed-icon { width: 18px; height: 18px; fill: none; stroke: var(--text-muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.speed-joke {
  margin: 6px 0 0;
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
  text-align: center;
}

/* --- The count-up (only once speed-scores.js has taken over) ------------- */
.speed-animated .speed-dial::before { opacity: 0; }
.speed-animated .speed-joke { opacity: 0; transform: translateY(4px); transition: opacity 0.6s ease, transform 0.6s ease; }
.speed-gauge.is-done .speed-dial::before { opacity: 1; animation: speed-breathe 3.2s ease-in-out 0.9s infinite; }
.speed-gauge.is-done .speed-joke { opacity: 1; transform: none; }
/* One ring ripples out when a gauge lands on its score. */
.speed-gauge.is-done .speed-dial::after {
  content: '';
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  border: 2px solid rgba(92, 242, 160, 0.55);
  animation: speed-ripple 1.1s cubic-bezier(.2, .7, .3, 1) forwards;
  pointer-events: none;
}
@keyframes speed-ripple {
  from { transform: scale(0.92); opacity: 0.9; }
  to   { transform: scale(1.22); opacity: 0; }
}
@keyframes speed-breathe {
  0%, 100% { opacity: 0.75; }
  50%      { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .speed-gauge.is-done .speed-dial::before { animation: none; }
  .speed-gauge.is-done .speed-dial::after { display: none; }
}
