/* The speed test page. Tokens, fonts, buttons, the form and the footer come from /styles.css. */

.speed-top {
  position: relative;
  padding: max(24px, env(safe-area-inset-top)) 24px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.speed-top .wordmark { width: 104px; margin: 0; }
/* Run again and share sit top right once a test is done. */
.speed-tools {
  position: absolute;
  right: 16px;
  top: calc(max(24px, env(safe-area-inset-top)) - 8px);
  display: flex;
  gap: 8px;
}
.speed-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--glass);
  border: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--glass-line);
  cursor: pointer;
  animation: rise 0.5s var(--ease) both;
  transition: background 0.2s, transform 0.25s var(--ease);
}
.speed-icon:hover { background: rgba(253, 253, 253, 0.14); }
.speed-icon:active { transform: scale(0.94); }
.speed-icon:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.speed-top .wordmark-svg { display: block; width: 100%; height: auto; }

.speed-main { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.speed-app { padding-top: 48px; text-align: center; }

/* The headline: two lines' worth of room so the page does not jump when a verdict wraps. */
.speed-headline {
  font-size: clamp(38px, 11vw, 76px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin: 0 auto 14px;
  min-height: 2.04em;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-wrap: balance;
}
.speed-headline > [aria-hidden] { display: block; }
.speed-word { display: inline-block; white-space: nowrap; }
.speed-char {
  display: inline-block;
  transform-origin: 50% 100%;
  animation: speed-hop 0.7s var(--ease) both;
  animation-delay: calc(var(--i) * 16ms);
}
@keyframes speed-hop {
  0% { opacity: 0; transform: translateY(0.55em) scaleY(1.25) scaleX(0.9); }
  55% { opacity: 1; transform: translateY(-0.08em) scaleY(0.94) scaleX(1.04); }
  100% { opacity: 1; transform: none; }
}

.speed-sub { color: var(--ink-2); font-size: 17px; margin: 0 auto 8px; max-width: 30em; }

.speed-chart {
  height: 240px;
  margin: 20px -12px 0;
  transition: opacity 0.4s var(--ease);
}
.speed-chart.is-idle { opacity: 0.55; }

.speed-stat { margin-top: 8px; }
.speed-number {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-size: clamp(56px, 17vw, 104px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.speed-unit { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink-2); }
.speed-label {
  margin: 10px 0 0;
  color: var(--ink-3);
  font-size: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
}
.speed-badge {
  color: var(--ground);
  background: var(--ink);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 500;
  animation: rise 0.6s var(--ease) both;
}

.speed-actions {
  margin: 28px auto 0;
  display: flex;
  gap: 10px;
  justify-content: center;
  max-width: 420px;
}
.speed-actions .button { flex: 1 1 0; }
.speed-start { max-width: 320px; }
.speed-ghost {
  font: inherit;
  font-size: 15px;
  color: var(--ink-3);
  background: none;
  border: 0;
  padding: 12px 18px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.speed-ghost:hover { color: var(--ink); }
.speed-ghost:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 8px; }

.speed-details {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  text-align: left;
  animation: rise 0.6s var(--ease) both;
}
.speed-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--glass-line);
  font-size: 16px;
}
.speed-row dt { color: var(--ink-3); flex: 0 0 auto; }
.speed-row dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.speed-row dd.is-pending { color: var(--ink-3); animation: speed-breathe 1.6s ease-in-out infinite; }
@keyframes speed-breathe { 50% { opacity: 0.45; } }

/* Download is white, upload is Juno blue. */
.speed-page { --up: #5b83ff; }
.speed-number.is-up, .speed-number.is-up .speed-unit { color: var(--up); }
.speed-label.is-up { color: var(--up); }
.speed-summary {
  margin: 18px auto 0;
  max-width: 26em;
  font-size: 19px;
  line-height: 1.4;
  color: var(--ink);
  text-wrap: balance;
  animation: rise 0.6s var(--ease) both;
}

.speed-tabs {
  display: inline-flex;
  gap: 4px;
  margin: 8px auto 0;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass);
  box-shadow: inset 0 0 0 1px var(--glass-line);
  animation: rise 0.6s var(--ease) both;
}
.speed-tab {
  font: inherit;
  font-size: 15px;
  color: var(--ink-3);
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
.speed-tab strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.speed-tab:hover { color: var(--ink-2); }
.speed-tab[aria-pressed="true"].is-down { color: var(--ground); background: var(--ink); }
.speed-tab[aria-pressed="true"].is-up { color: var(--ground); background: var(--up); }
.speed-tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* What the line handles: a dot per use that fills in as the speed clears it. */
.speed-section {
  margin: 48px 0 6px;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
}
.speed-section + .speed-details { margin-top: 0; }
.speed-uses { list-style: none; margin: 0; padding: 0; text-align: left; display: grid; grid-template-columns: 1fr; }
.speed-use {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--glass-line);
  font-size: 16px;
}
.speed-use-label { flex: 1 1 auto; transition: color 0.3s; }
.speed-use-note { color: var(--ink-3); font-size: 14px; text-align: right; white-space: nowrap; }
.speed-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--ink-3);
  transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
}
.speed-use.is-wait .speed-use-label { color: var(--ink-3); }
.speed-use.is-wait .speed-dot { box-shadow: inset 0 0 0 1.5px var(--glass-line); animation: speed-breathe 1.6s ease-in-out infinite; }
.speed-use.is-no .speed-use-label { color: var(--ink-2); }
.speed-use.is-yes .speed-dot { background: var(--ink); box-shadow: none; animation: speed-pop 0.5s var(--ease); }
@keyframes speed-pop { 0% { transform: scale(0.3); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* The pitch under the tool. */
.speed-pitch { margin: 96px 0 0; }
.speed-pitch .rule { display: block; height: 1px; background: var(--glass-line); margin-bottom: 36px; }
.speed-pitch-line {
  font-size: clamp(28px, 7vw, 38px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 16px;
}
.speed-pitch-copy { color: var(--ink-2); font-size: 18px; margin: 0 0 28px; }
.speed-pitch-copy a { color: var(--ink); text-underline-offset: 3px; }
.speed-pitch .signup, .speed-pitch .done { margin: 0; }
.speed-privacy { color: var(--ink-3); font-size: 14px; margin: 36px 0 56px; }

@media (min-width: 900px) {
  .speed-top { justify-content: flex-start; max-width: 1180px; margin: 0 auto; padding: 36px 48px 0; }
  .speed-top .wordmark { width: 120px; }
  .speed-tools { position: static; margin-left: auto; }
  .speed-icon { width: 44px; height: 44px; }
  .speed-main { padding: 0 48px; }
  .speed-app { padding-top: 40px; }
  .speed-chart { height: 340px; margin: 28px -24px 0; }
  .speed-details { grid-template-columns: 1fr 1fr; column-gap: 48px; }
  .speed-uses { grid-template-columns: 1fr 1fr; column-gap: 48px; }
  .speed-row:nth-child(2) { border-top: 1px solid var(--glass-line); }
  .speed-pitch { margin-top: 128px; }
  .speed-pitch .signup-row { flex-direction: row; }
}

@media (prefers-reduced-motion: reduce) {
  .speed-char, .speed-details, .speed-badge, .speed-summary, .speed-tabs, .speed-use .speed-dot, .speed-icon { animation: none; }
  .speed-row dd.is-pending { animation: none; }
}
