:root {
  --blue: #4285f4;
  --red: #ea4335;
  --yellow: #fbbc05;
  --green: #34a853;
  --ink: #202124;
  --ink-soft: #5f6368;
  --line: #dadce0;
  --bg: #ffffff;
  --bg-soft: #f8f9fa;
  --shadow-1: 0 1px 2px rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15);
  --shadow-2: 0 1px 3px rgba(60, 64, 67, .3), 0 4px 8px 3px rgba(60, 64, 67, .15);
  --radius: 16px;
  --font: "Google Sans", "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ---------- Header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: 1080px;
  margin: 0 auto;
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  width: 26px;
  height: 26px;
}
.brand__dot { border-radius: 50%; }
.brand__dot--blue { background: var(--blue); }
.brand__dot--red { background: var(--red); }
.brand__dot--yellow { background: var(--yellow); }
.brand__dot--green { background: var(--green); }
.brand__name {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.3px;
}
.brand__name::first-letter { color: var(--blue); }

.topbar__nav { display: flex; gap: 8px; }
.topbar__link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: background .15s ease, color .15s ease;
}
.topbar__link:hover { background: var(--bg-soft); color: var(--ink); }

/* ---------- Layout ---------- */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.hero { text-align: center; padding: 10px 0 0; }
.hero__title {
  margin: 0 0 6px;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 500;
  letter-spacing: -1px;
  line-height: 1.1;
}
.hero__subtitle {
  margin: 0 auto;
  max-width: 620px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ---------- Gauge ---------- */
.test {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 8px;
}
.gauge {
  position: relative;
  width: min(360px, 82vw);
  aspect-ratio: 1 / 1;
}
.gauge__svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.gauge__track {
  fill: none;
  stroke: #e8eaed;
  stroke-width: 14;
}
.gauge__progress {
  fill: none;
  stroke: url(#gaugeGrad);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 879.6;
  stroke-dashoffset: 879.6;
  transition: stroke-dashoffset .28s ease-out;
}
.gauge__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 56px;
  text-align: center;
}
.gauge__readout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.gauge__value {
  font-size: clamp(48px, 11vw, 68px);
  font-weight: 500;
  letter-spacing: -2px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.gauge__unit { font-size: 15px; color: var(--ink-soft); }
.gauge__phase {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
  letter-spacing: .3px;
  text-transform: uppercase;
}

.start {
  margin-top: 14px;
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .2px;
  color: #fff;
  background: var(--blue);
  padding: 0 40px;
  height: 52px;
  border-radius: 999px;
  box-shadow: var(--shadow-1);
  transition: box-shadow .18s ease, transform .18s ease, background .18s ease, color .18s ease;
}
.start:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.start:active { transform: translateY(0); box-shadow: var(--shadow-1); }
.start:focus-visible { outline: 3px solid rgba(66, 133, 244, .4); outline-offset: 2px; }
.start.is-running { background: var(--red); }

.gauge.is-active .start {
  margin-top: 10px;
  height: 38px;
  padding: 0 22px;
  font-size: 14px;
  background: transparent;
  color: var(--blue);
  box-shadow: none;
}
.gauge.is-active .start:hover { background: rgba(66, 133, 244, .08); transform: none; box-shadow: none; }
.gauge.is-active .start:active { transform: none; }
.gauge.is-active .start.is-running { background: transparent; color: var(--red); }
.gauge.is-active .start.is-running:hover { background: rgba(234, 67, 53, .08); }

.test__hint {
  margin: 18px 0 0;
  max-width: 460px;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ---------- Metrics ---------- */
.metrics {
  margin-top: 4px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.metric {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.metric:hover { box-shadow: var(--shadow-1); transform: translateY(-2px); }
.metric__icon {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.metric__icon svg { width: 24px; height: 24px; fill: #fff; }
.metric--download .metric__icon { background: var(--blue); }
.metric--upload .metric__icon { background: var(--green); }
.metric--ping .metric__icon { background: var(--yellow); }
.metric--jitter .metric__icon { background: var(--red); }
.metric__label {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.metric__value {
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.metric__value small {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-soft);
  margin-left: 4px;
}
.metric.is-updated .metric__value { animation: pop .35s ease; }
@keyframes pop {
  0% { transform: scale(.94); opacity: .5; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------- Server ---------- */
.server {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.server__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9aa0a6;
}
.server__dot.is-ok { background: var(--green); }
.server__dot.is-bad { background: var(--red); }
.server__text strong { color: var(--ink); font-weight: 500; }
.server__sep { color: var(--line); }

/* ---------- Cards ---------- */
.cards { margin-top: 32px; }
.cards__title {
  text-align: center;
  font-size: 26px;
  font-weight: 500;
  margin: 0 0 24px;
}
.cards__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.card {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.card__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  margin-bottom: 18px;
}
.card__icon--blue { background: var(--blue); }
.card__icon--green { background: var(--green); }
.card__icon--yellow { background: var(--yellow); }
.card__title { margin: 0 0 8px; font-size: 18px; font-weight: 500; }
.card__text { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); }

/* ---------- About ---------- */
.about {
  margin-top: 32px;
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}
.about__title { font-size: 26px; font-weight: 500; margin: 0 0 14px; }
.about__text { margin: 0; font-size: 15.5px; line-height: 1.7; color: var(--ink-soft); }

/* ---------- FAQ ---------- */
.faq {
  margin-top: 40px;
  max-width: 800px;
  margin-inline: auto;
}
.faq__title { text-align: center; font-size: 26px; font-weight: 500; margin: 0 0 24px; }
.faq__list { display: flex; flex-direction: column; gap: 12px; }
.faq__item {
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.faq__q { margin: 0 0 8px; font-size: 16.5px; font-weight: 500; }
.faq__a { margin: 0; font-size: 15px; line-height: 1.65; color: var(--ink-soft); }

/* ---------- Утилиты доступности ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--blue);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  transition: top .18s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- Ticker (strip under header) ---------- */
.ticker {
  position: sticky;
  top: 64px;
  z-index: 19;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(60, 64, 67, .12);
  max-height: 56px;
  overflow: hidden;
  transition: max-height .28s ease, opacity .28s ease;
}
.ticker.is-hidden { max-height: 0; opacity: 0; pointer-events: none; }

.ticker__inner {
  max-width: 1080px;
  margin: 0 auto;
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.ticker__label {
  flex: none;
  display: flex;
  align-items: center;
  height: 24px;
  padding-right: 16px;
  border-right: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--blue);
}
.ticker__viewport {
  position: relative;
  flex: 1;
  height: 56px;
  overflow: hidden;
}
.ticker__slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
  transition: opacity .4s ease, transform .4s ease;
}
.ticker__slide.is-active { opacity: 1; transform: translateY(0); pointer-events: auto; }
.ticker__icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  color: var(--ink-soft);
}
.ticker__icon svg { width: 18px; height: 18px; fill: currentColor; }
.ticker__icon--tg { color: #29a9eb; }
.ticker__icon--ext { color: var(--blue); }
.ticker__icon--web { color: var(--green); }
.ticker__marquee {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.ticker__text {
  display: inline-block;
  font-size: 14px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.ticker__marquee.is-scrolling .ticker__text {
  animation: tickerScroll var(--ticker-dur, 8s) linear infinite;
}
@keyframes tickerScroll {
  0%, 10% { transform: translateX(0); }
  90%, 100% { transform: translateX(calc(var(--ticker-shift, 0px) * -1)); }
}
.ticker__text strong { color: var(--ink); font-weight: 500; }
.ticker__cta {
  flex: none;
  margin-left: auto;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--blue);
  white-space: nowrap;
}
.ticker__slide:hover .ticker__cta { text-decoration: underline; }
.ticker__close {
  flex: none;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s ease, color .15s ease;
}
.ticker__close:hover { background: var(--bg-soft); color: var(--ink); }
.ticker__close svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- Promo (popup after test) ---------- */
.promo {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  width: min(360px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-2);
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
}
.promo.is-open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.promo__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s ease, color .15s ease;
}
.promo__close:hover { background: var(--bg-soft); color: var(--ink); }
.promo__close svg { width: 18px; height: 18px; fill: currentColor; }

.promo__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-right: 28px; }
.promo__badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
}
.promo__title { font-size: 16px; font-weight: 500; }
.promo__subtitle { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

.promo__list { display: flex; flex-direction: column; gap: 4px; }
.promo__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  transition: background .15s ease;
}
.promo__item:hover { background: var(--bg-soft); }
.promo__item:focus-visible { outline: 3px solid rgba(66, 133, 244, .4); outline-offset: 1px; }
.promo__icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  color: var(--ink-soft);
  transition: color .15s ease, background .15s ease;
}
.promo__icon svg { width: 20px; height: 20px; fill: currentColor; }
.promo__item:hover .promo__icon--tg { color: #fff; background: #29a9eb; }
.promo__item:hover .promo__icon--ext { color: #fff; background: var(--blue); }
.promo__item:hover .promo__icon--web { color: #fff; background: var(--green); }
.promo__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.promo__name { font-size: 14px; font-weight: 500; }
.promo__desc { font-size: 12px; color: var(--ink-soft); }
.promo__arrow { margin-left: auto; color: #c4c7c5; font-size: 16px; transition: color .15s ease, transform .15s ease; }
.promo__item:hover .promo__arrow { color: var(--blue); transform: translateX(3px); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}
.footer__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.footer__nav { display: flex; gap: 20px; }
.footer__nav a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .cards__grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ticker__label { display: none; }
  .ticker__text { font-size: 13px; }
  .ticker__cta { display: none; }
  .ticker__icon { width: 30px; height: 30px; }
}
@media (max-width: 520px) {
  .topbar__nav { display: none; }
  .metrics { grid-template-columns: 1fr; }
  .page { padding: 0 16px 48px; }
  .server { font-size: 12.5px; }
  .promo { right: 16px; left: 16px; width: auto; bottom: 16px; }
  .ticker__inner { padding: 0 16px; gap: 10px; }
  .gauge__center { padding: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
