/* =========================================================================
   WiFi Speed Insight – styles
   Mobile-first. Tokens up top; light is default, dark via
   prefers-color-scheme or [data-theme="dark"] (set by the theme toggle).

   Look: light and bright. Blue brand (buttons, links, dial, headings); colour comes from
   the icons, one hue per tool (.tone-*). White cards on a pale blue page. Everything that moves is switched off
   under prefers-reduced-motion (see the end of the file).
   ========================================================================= */

/* ---------- Font (self-hosted variable font, latin subset) ---------- */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/fonts/archivo-latin.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;

  --font-body: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wide: 116%;

  --bg: #f7faff;
  --surface: #ffffff;
  --surface-2: #e6eeff;
  --surface-glass: rgb(255 255 255 / .74);
  --surface-glass-strong: rgb(255 255 255 / .9);
  --border: #d5e1fa;
  --border-strong: #b6c9f2;
  --text: #0a1838;
  --muted: #4a5b80;
  --muted-2: #62739a;

  --accent: #0b63ff;
  --accent-2: #1a8fff;
  --accent-3: #38c6ff;
  --accent-rgb: 11 99 255;
  --accent-2-rgb: 26 143 255;
  --ok: #0cab82;
  --warn: #e58a00;
  --bad: #e83a6b;
  --ok-text: #07775a;
  --warn-text: #8c5300;
  --bad-text: #bf2452;

  --track: #dfe9fc;
  --tick: #9db1d8;

  --grad: linear-gradient(115deg, #0b4fe6, #0b63ff 45%, #38b6ff);
  --grad-hot: linear-gradient(115deg, #0b4fe6, #0b63ff 45%, #38c6ff);
  --shadow-sm: 0 1px 2px rgb(10 40 120 / .06), 0 16px 36px -22px rgb(11 70 200 / .38);
  --shadow-lg: 0 46px 100px -44px rgb(11 80 230 / .55);

  --orb-1: #bcd4ff;
  --orb-2: #c6e6ff;
  --orb-3: #d3defe;
  --orb-4: #a8ecff;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: clamp(26px, 4vw, 36px);
  --pill: 999px;

  --gutter: clamp(16px, 4vw, 28px);
  --page: 1160px;
  --header-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.2, 1.3, .4, 1);

  /* How strongly each icon's colour tints the square behind it. Raise for a deeper tint. */
  --icon-tint: 26%;

  /* Per-component colour pair (overridden by .tone-*) */
  --tone: #0b63ff;
}

/* Dark palette. Applied by OS preference unless the user picked light,
   and by [data-theme="dark"] when the user picked dark. The values are
   repeated because a media query and an attribute selector can't share a block. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #061024;
    --surface: #0c1b3a;
    --surface-2: #12264f;
    --surface-glass: rgb(12 27 58 / .66);
    --surface-glass-strong: rgb(12 27 58 / .88);
    --border: #1c3566;
    --border-strong: #2b4a8a;
    --text: #eaf1ff;
    --muted: #9fb3da;
    --muted-2: #8198c4;
    --accent: #4d94ff;
    --accent-2: #5cb4ff;
    --accent-3: #7fd4ff;
    --accent-rgb: 77 148 255;
    --accent-2-rgb: 92 180 255;
    --ok: #2bd3a4;
    --warn: #ffb347;
    --bad: #ff6690;
    --ok-text: #54e3ba;
    --warn-text: #ffc670;
    --bad-text: #ff8aab;
    --track: #152a55;
    --tick: #4a659c;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .3), 0 18px 40px -22px rgb(0 0 0 / .75);
    --shadow-lg: 0 50px 110px -40px rgb(10 60 200 / .7);
    --orb-1: #0d3a9e;
    --orb-2: #0a5a9e;
    --orb-3: #1a2f8f;
    --orb-4: #0f6f9a;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #061024;
  --surface: #0c1b3a;
  --surface-2: #12264f;
  --surface-glass: rgb(12 27 58 / .66);
  --surface-glass-strong: rgb(12 27 58 / .88);
  --border: #1c3566;
  --border-strong: #2b4a8a;
  --text: #eaf1ff;
  --muted: #9fb3da;
  --muted-2: #8198c4;
  --accent: #4d94ff;
  --accent-2: #5cb4ff;
  --accent-3: #7fd4ff;
  --accent-rgb: 77 148 255;
  --accent-2-rgb: 92 180 255;
  --ok: #2bd3a4;
  --warn: #ffb347;
  --bad: #ff6690;
  --ok-text: #54e3ba;
  --warn-text: #ffc670;
  --bad-text: #ff8aab;
  --track: #152a55;
  --tick: #4a659c;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .3), 0 18px 40px -22px rgb(0 0 0 / .75);
  --shadow-lg: 0 50px 110px -40px rgb(10 60 200 / .7);
  --orb-1: #0d3a9e;
  --orb-2: #0a5a9e;
  --orb-3: #1a2f8f;
  --orb-4: #0f6f9a;
}

/* ---------- Icon colours ----------
   The site itself is blue. Colour comes from the icons: each tool has its own
   hue, shown as a coloured icon on a pale square of the same hue. */
.tone-blue   { --tone: #0b63ff; }
.tone-violet { --tone: #7c4dff; }
.tone-green  { --tone: #10b981; }
.tone-rose   { --tone: #f43f6e; }
.tone-cyan   { --tone: #05a3bf; }
.tone-amber  { --tone: #e58600; }
.tone-sky    { --tone: #0a94d6; }
.tone-orange { --tone: #f97316; }

/* Verdict colours set from JS via data-tone */
[data-tone="ok"]    { color: var(--ok-text); }
[data-tone="warn"]  { color: var(--warn-text); }
[data-tone="bad"]   { color: var(--bad-text); }
[data-tone="muted"] { color: var(--muted); }

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--safe-top) + var(--header-h) + 32px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: var(--safe-top);
  /* room for the phone tab bar; removed at the desktop breakpoint */
  padding-bottom: calc(72px + var(--safe-bottom));
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.62 var(--font-body);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .4s ease, color .4s ease;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: not-allowed; }
img, svg, canvas { display: block; max-width: 100%; }
ul[class], ol[class] { list-style: none; padding: 0; }
[hidden] { display: none !important; } /* !important: [hidden] must beat component display rules */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: rgb(var(--accent-2-rgb) / .28); }

.sr-only {
  position: absolute !important; /* utility: must win over any component positioning */
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  top: calc(var(--safe-top) + 10px);
  left: 12px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: var(--pill);
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform .25s var(--ease-out);
}
.skip-link:focus-visible { transform: none; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
}

.ic {
  width: 1em; height: 1em;
  fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}

/* ---------- Background ---------- */
.scroll-progress {
  position: fixed;
  top: var(--safe-top);
  left: 0; right: 0;
  height: 3px;
  background: var(--grad);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 95;
  pointer-events: none;
}

/* Two soft blue glows behind the top of the page, slowly drifting */
.aurora { position: absolute; inset: 0 0 auto; height: 900px; z-index: -1; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); will-change: transform; }
.orb-1 { width: 620px; height: 620px; background: var(--orb-1); top: -260px; left: -180px; opacity: .8; animation: drift-a 20s ease-in-out infinite alternate; }
.orb-2 { width: 560px; height: 560px; background: var(--orb-2); top: -120px; right: -200px; opacity: .75; animation: drift-b 24s ease-in-out infinite alternate; }
.orb-3 { display: none; }
.grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgb(var(--accent-rgb) / .16) 1.2px, transparent 1.2px);
  background-size: 26px 26px;
  mask-image: linear-gradient(#000, transparent 70%);
  -webkit-mask-image: linear-gradient(#000, transparent 70%);
}
@keyframes drift-a { to { transform: translate(100px, 70px) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-90px, 80px) scale(1.1); } }

/* ---------- Type ---------- */
h1, h2, h3 { text-wrap: balance; }
h1 {
  font-weight: 800;
  font-size: clamp(2.3rem, 1.3rem + 4.4vw, 4.3rem);
  line-height: 1.03;
  font-stretch: var(--wide);
  letter-spacing: -.03em;
}
h2 {
  font-weight: 750;
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.9rem);
  line-height: 1.08;
  font-stretch: 112%;
  letter-spacing: -.025em;
}
h3 {
  font-weight: 700;
  font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem);
  line-height: 1.25;
  font-stretch: 106%;
  letter-spacing: -.01em;
}

/* Gradient text. In headings <em> marks the phrase that gets the brand gradient. */
:is(h1, h2, h3) em, .grad-text {
  font-style: normal;
  background: var(--grad-hot);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 6s ease-in-out infinite alternate;
}
@keyframes sheen { to { background-position: 100% 0; } }

.lede {
  max-width: 38rem;
  color: var(--muted);
  font-size: clamp(1.02rem, .98rem + .3vw, 1.15rem);
  line-height: 1.55;
  text-wrap: pretty;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: var(--pill);
  background: linear-gradient(115deg, rgb(var(--accent-rgb) / .14), rgb(var(--accent-2-rgb) / .16));
  color: var(--accent);
  font-size: .86rem; font-weight: 700;
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--grad-hot);
  animation: beat 1.8s ease-in-out infinite;
}
@keyframes beat { 50% { transform: scale(1.7); opacity: .5; } }

.text-link, .block-more a {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent);
  font-weight: 650;
}
.text-link { display: inline; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: rgb(var(--accent-rgb) / .4); }
.text-link .ic { display: inline-block; vertical-align: -2px; margin-inline-start: 4px; }
.text-link:hover { text-decoration-color: currentColor; }
.block-more { margin-top: 20px; text-align: center; }
.block-more a {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--pill);
  background: var(--surface-glass-strong);
  transition: transform .3s var(--ease-out), border-color .3s, box-shadow .3s;
}
.block-more a:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 14px 30px -18px rgb(var(--accent-rgb) / .9); }
.block-more .ic, .guide-card-more .ic { transition: transform .25s var(--ease-out); }
.block-more a:hover .ic { transform: translateX(4px); }

/* ---------- Header: full-width bar ---------- */
.site-header {
  position: sticky;
  top: var(--safe-top);
  z-index: 80;
  background: var(--surface-glass);
  backdrop-filter: blur(16px) saturate(170%);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(100% - 2 * var(--gutter), var(--page));
  height: var(--header-h);
  margin-inline: auto;
}

.logo {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px;
  font-weight: 800;
  font-size: clamp(.98rem, .55rem + 2.4vw, 1.25rem); /* scales down so the full name fits on small phones */
  white-space: nowrap;
  font-stretch: var(--wide);
  letter-spacing: -.03em;
}
.logo-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--grad);
  box-shadow: 0 10px 20px -8px rgb(var(--accent-rgb) / .8), inset 0 1px 0 rgb(255 255 255 / .4);
  transition: transform .5s var(--ease-spring);
}
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.08); }
/* Logo: WiFi waves that double as a speed dial, with a needle (same drawing as favicon.svg) */
.logo-mark svg { width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 5.5; stroke-linecap: round; }
.logo-mark circle { fill: #fff; stroke: none; }
.logo-mark .needle { stroke-width: 5; }
.logo-mark .needle-gap { stroke: #0b5cf5; stroke-width: 10; } /* blue halo that separates the needle from the waves */
.logo-mark .wave { animation: wave 2.4s ease-in-out infinite; }
.logo-mark .wave + .wave { animation-delay: .2s; }
@keyframes wave { 50% { opacity: .3; } }

.nav-links { display: none; gap: 4px; margin-inline: auto 4px; font-size: .96rem; font-weight: 600; }
.nav-links a {
  position: relative;
  display: inline-flex; align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--muted);
  white-space: nowrap;
  transition: color .2s, background-color .2s;
}
.nav-links a::after {
  content: "";
  position: absolute; inset: auto 14px 6px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease-out);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: none; }
.nav-links a[aria-current="page"] { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.btn.nav-cta { display: none; } /* .btn sets display later in the file, so match its specificity */

.icon-btn {
  width: 44px; height: 44px;
  display: inline-grid; place-items: center;
  border-radius: 12px;
  color: var(--muted);
  font-size: 1.2rem;
  transition: background-color .2s, color .2s, transform .5s var(--ease-spring);
}
.icon-btn:hover { background: var(--surface-2); color: var(--accent); transform: rotate(20deg); }

/* Theme toggle: show the icon for the theme you'd switch TO */
#themeToggle .ic-sun { display: none; }
:root[data-theme="dark"] #themeToggle .ic-sun { display: block; }
:root[data-theme="dark"] #themeToggle .ic-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #themeToggle .ic-sun { display: block; }
  :root:not([data-theme="light"]) #themeToggle .ic-moon { display: none; }
}

/* ---------- Bottom tab bar (phones) ---------- */
.tab-bar {
  position: fixed;
  inset: auto 0 0;
  z-index: 85;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 6px 10px calc(6px + var(--safe-bottom));
  background: var(--surface-glass-strong);
  backdrop-filter: blur(16px) saturate(170%);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  border-top: 1px solid var(--border);
}
.tab-bar a {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-height: 52px;
  font-size: .74rem;
  font-weight: 650;
  color: var(--muted);
  transition: color .2s;
}
.tab-bar .ic { width: 44px; height: 28px; padding: 3px 0; border-radius: 14px; font-size: 1.4rem; transition: background-color .25s, transform .4s var(--ease-spring); }
.tab-bar a:active .ic { transform: scale(.88); }
.tab-bar a[aria-current="page"] { color: var(--accent); }
.tab-bar a[aria-current="page"] .ic { background: rgb(var(--accent-rgb) / .14); animation: pop .45s var(--ease-spring); }
@keyframes pop { from { transform: scale(.6); } }

@media (min-width: 900px) {
  .tab-bar { display: none; }
  body { padding-bottom: 0; }
  .nav-links { display: flex; }
  .btn.nav-cta { display: inline-flex; }
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--pill);
  background: var(--grad-hot);
  background-size: 230% 100%;
  color: #fff;
  font-weight: 650; font-size: .96rem;
  white-space: nowrap;
  box-shadow: 0 16px 30px -14px rgb(var(--accent-2-rgb) / .9), inset 0 1px 0 rgb(255 255 255 / .35);
  transition: transform .3s var(--ease-out), box-shadow .3s, opacity .2s;
  animation: sheen 5s ease-in-out infinite alternate;
}
/* light sweep on hover */
.btn::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / .45) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .7s;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 22px 36px -14px rgb(var(--accent-2-rgb) / 1), inset 0 1px 0 rgb(255 255 255 / .35); }
.btn:hover:not(:disabled)::after { transform: translateX(120%); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .5; box-shadow: none; animation: none; }
.btn .ic { font-size: 1.15em; }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  animation: none;
}
.btn-ghost::after { display: none; }
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); box-shadow: 0 16px 30px -18px rgb(var(--accent-rgb) / .8); }

.btn-light { background: #fff; color: #0b54e0; animation: none; box-shadow: 0 20px 40px -18px rgb(0 0 0 / .4); }
.btn-light::after { background: linear-gradient(100deg, transparent 30%, rgb(11 99 255 / .16) 50%, transparent 70%); }

.btn-sm { min-height: 44px; padding: 0 18px; font-size: .9rem; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { margin-top: 18px; font-size: .86rem; color: var(--muted); }
.breadcrumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.breadcrumbs li { display: flex; align-items: center; gap: 8px; }
.breadcrumbs li + li::before { content: "/"; color: var(--border-strong); }
.breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; transition: color .2s; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 600; }
/* Phones: keep the trail on one line; a long page name is cut with an ellipsis */
@media (max-width: 599px) {
  .breadcrumbs ol { flex-wrap: nowrap; }
  .breadcrumbs li { flex: none; }
  .breadcrumbs li:last-child { flex: 0 1 auto; min-width: 0; }
  .breadcrumbs li:last-child [aria-current="page"] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- Home hero: words on the left, the test on the right ---------- */
.hero { padding: clamp(24px, 4vw, 56px) 0 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.hero-copy { display: grid; gap: 18px; justify-items: start; }
.hero h1 { font-size: clamp(2.3rem, 1.3rem + 3.6vw, 3.9rem); }
@media (min-width: 1000px) {
  /* Intro on top (headline left, the three points right), the wide test card underneath */
  .hero-copy { grid-template-columns: minmax(0, 1fr) auto; column-gap: clamp(32px, 5vw, 72px); align-items: end; }
  .hero-copy > * { grid-column: 1; }
  .hero-copy > .hero-points { grid-column: 2; grid-row: 1 / span 3; align-self: end; margin: 0 0 6px; }
  .hero h1 { max-width: 17ch; }
}
/* Phones and tablets: the test card comes straight after the intro, the three points follow it,
   so the GO button is reachable without scrolling past them. */
@media (max-width: 999px) {
  .hero-grid { gap: 16px; justify-items: start; }
  .hero-copy { display: contents; }
  .hero-grid > .speed-card { order: 1; width: 100%; margin-top: 6px; }
  .hero-points { order: 2; margin-top: 10px; }
}

.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: .88rem; font-weight: 600;
  color: var(--muted);
}
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); animation: ping-dot 2s infinite; }
@keyframes ping-dot {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); }
  70%, 100% { box-shadow: 0 0 0 11px transparent; }
}
@keyframes float { 50% { transform: translateY(-6px); } }

.hero-points { display: grid; gap: 12px; margin-top: 6px; }
.hero-points li { display: flex; align-items: center; gap: 14px; font-size: .96rem; color: var(--muted); animation: rise .6s var(--ease-out) both; }
.hero-points li:nth-child(1) { animation-delay: .35s; }
.hero-points li:nth-child(2) { animation-delay: .45s; }
.hero-points li:nth-child(3) { animation-delay: .55s; }
.hero-points b { display: block; color: var(--text); font-weight: 700; line-height: 1.3; }
.point-icon, .how-icon, .tile-icon, .hero-icon {
  display: grid; place-items: center;
  flex: none;
  background: color-mix(in srgb, var(--tone) var(--icon-tint), var(--surface));
  color: var(--tone);
}
.point-icon { width: 44px; height: 44px; border-radius: 14px; font-size: 1.3rem; }
.point-icon .ic, .how-icon .ic, .tile-icon .ic, .hero-icon .ic { stroke-width: 2.1; }
@media (min-width: 560px) and (max-width: 999px) {
  .hero-points { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
}

/* ---------- Tool page hero: icon beside the title ---------- */
.page-hero { padding: clamp(16px, 3vw, 32px) 0 0; }
.page-hero > .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px clamp(16px, 2.5vw, 24px); align-items: center; }
.page-hero h1 { font-size: clamp(1.95rem, 1.2rem + 3vw, 3.1rem); }
.page-hero .lede { max-width: 44rem; }
.hero-icon {
  position: relative;
  width: clamp(60px, 8vw, 84px); aspect-ratio: 1;
  border-radius: 26%;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  animation: float 5s ease-in-out infinite;
}
.hero-icon::after {
  content: "";
  position: absolute; inset: -8px;
  border-radius: 30%;
  border: 2px solid color-mix(in srgb, var(--tone) 40%, transparent);
  animation: ripple 2.8s ease-out infinite;
}
@keyframes ripple { to { transform: scale(1.4); opacity: 0; } }
@media (min-width: 700px) {
  .page-hero > .wrap:has(> .hero-icon) { grid-template-columns: auto minmax(0, 1fr); }
  .page-hero .hero-icon { grid-row: span 2; align-self: start; }
  .page-hero .speed-card, .page-hero .tool-card { grid-column: 1 / -1; }
}
.page-hero .speed-card, .page-hero .tool-card { margin-top: clamp(10px, 2vw, 20px); }
/* hubs and 404 have no icon: keep them centred */
.page-hero > .wrap:not(:has(> .hero-icon)) { justify-items: center; text-align: center; }

/* ---------- Speed card ---------- */
.speed-card, .panel {
  position: relative;
  background: var(--surface-glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}
.speed-card {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: clamp(16px, 3vw, 26px);
  box-shadow: var(--shadow-lg);
  transform: perspective(1600px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transition: transform .25s ease-out;
}

/* A light that travels round the card edge; faster while a test runs */
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.speed-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(from var(--angle), transparent 0 62%, #38c6ff, #0b63ff, transparent 96%);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  pointer-events: none;
  animation: spin-border 7s linear infinite;
}
.speed-card[data-state="running"]::before { animation-duration: 1.8s; }
@keyframes spin-border { to { --angle: 360deg; } }

.speed-card-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px 16px; flex-wrap: wrap;
}
.net-info { display: flex; align-items: center; gap: 12px; font-size: .88rem; color: var(--muted); min-width: 0; }
.net-info > div { display: grid; min-width: 0; line-height: 1.35; }
.net-info strong { color: var(--text); font-weight: 700; font-size: 1rem; }
.net-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-icon {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--grad);
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 12px 22px -12px rgb(var(--accent-2-rgb) / .95);
}

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-radius: var(--pill);
  background: var(--surface-2);
  font-size: .84rem; font-weight: 650;
  color: var(--muted);
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: ping-dot 2s infinite; }
.chip[data-mode="demo"] i { background: var(--warn); animation: none; }
.chip[data-mode="busy"] i { background: var(--accent-2); animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* Dial */
.gauge { position: relative; width: 100%; max-width: 460px; margin: clamp(10px, 2vw, 18px) auto 0; }
.gauge::before {
  /* soft coloured glow behind the dial */
  content: "";
  position: absolute; inset: 12% 14% 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(var(--accent-2-rgb) / .28), transparent 68%);
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.12); opacity: .6; } }
.gauge-svg { position: relative; width: 100%; height: auto; overflow: visible; }
.stop-a { stop-color: #38c6ff; }
.stop-b { stop-color: #1a8fff; }
.stop-c { stop-color: #0b4fe6; }
.gauge-track { fill: none; stroke: var(--track); stroke-width: 18; stroke-linecap: round; }
.gauge-progress {
  fill: none;
  stroke: url(#gaugeGrad);
  stroke-width: 18; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  filter: drop-shadow(0 6px 12px rgb(var(--accent-2-rgb) / .55));
}
.gauge-ticks line { stroke: var(--tick); stroke-width: 1.5; stroke-linecap: round; }
.gauge-ticks line.is-major { stroke: var(--muted); stroke-width: 2.4; }
.gauge-ticks text {
  font: 650 14px var(--font-body);
  font-variant-numeric: tabular-nums;
  fill: var(--muted);
  text-anchor: middle;
}
.gauge-needle { transform-origin: 200px 190px; transform: rotate(-45deg); }
.gauge-needle path { fill: var(--text); filter: drop-shadow(0 2px 4px rgb(var(--accent-rgb) / .5)); }

/* The dial's centre sits at 190 / 312 of the SVG height */
.gauge-readout {
  position: absolute; left: 0; right: 0; top: 60.9%;
  translate: 0 -50%;
  text-align: center;
  pointer-events: none;
  transition: opacity .3s;
}
.speed-card[data-state="idle"] .gauge-readout { opacity: 0; }
.gauge-phase {
  min-height: 1.3em;
  font-size: .9rem; font-weight: 750;
  color: var(--accent-2);
}
.speed-card[data-state="running"] .gauge-phase { animation: blink 1.2s ease-in-out infinite; }
.gauge-number {
  font-weight: 800;
  font-size: clamp(2.9rem, 1.6rem + 6vw, 4.6rem);
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  background: var(--grad-hot);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gauge-unit { font-size: .95rem; font-weight: 600; color: var(--muted); }

.go-btn {
  position: absolute;
  left: 50%; top: 60.9%;
  translate: -50% -50%;
  width: clamp(108px, 30%, 140px);
  aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--grad-hot);
  background-size: 200% 200%;
  color: #fff;
  font-weight: 800;
  font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.2rem);
  font-stretch: var(--wide);
  box-shadow: 0 26px 50px -16px rgb(var(--accent-2-rgb) / .95), inset 0 2px 0 rgb(255 255 255 / .4);
  z-index: 3;
  animation: hue-slide 4s ease-in-out infinite alternate;
  transition: scale .4s var(--ease-spring), opacity .4s;
}
.go-btn::before, .go-btn::after {
  content: "";
  position: absolute; inset: -10px;
  border-radius: 50%;
  border: 2px solid rgb(var(--accent-2-rgb) / .45);
  animation: ripple 2.4s ease-out infinite;
  pointer-events: none;
}
.go-btn::after { animation-delay: 1.2s; border-color: rgb(56 198 255 / .5); }
.go-btn:hover { scale: 1.08; }
.go-btn:active { scale: .95; }
.go-btn:focus-visible { outline-offset: 9px; border-radius: 50%; }
.speed-card:not([data-state="idle"]) .go-btn {
  opacity: 0; scale: .6; pointer-events: none; visibility: hidden;
  transition: scale .4s, opacity .4s, visibility 0s .4s;
}

.speed-actions { display: flex; justify-content: center; gap: 10px; min-height: 44px; margin-top: 4px; }
/* Phones: don't reserve an empty row under the dial while both buttons are hidden */
@media (max-width: 899px) {
  .speed-actions:not(:has(> button:not([hidden]))) { min-height: 0; margin-top: -14px; }
}

/* Readout tiles: white cards, one icon colour each */
.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.metric {
  position: relative;
  overflow: hidden;
  display: grid; gap: 4px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform .3s var(--ease-out), box-shadow .3s, border-color .3s;
}
.metric-ping   { --tone: #10b981; }
.metric-jitter { --tone: #f59e0b; }
.metric-down   { --tone: #0b63ff; }
.metric-up     { --tone: #7c4dff; }
.metric:hover { transform: translateY(-3px); box-shadow: 0 18px 30px -20px var(--tone); }
.metric::after {
  content: "";
  position: absolute; inset: auto 0 0;
  height: 3px;
  background: var(--tone);
  transform-origin: left;
  transform: scaleX(0);
}
.metric.is-active {
  border-color: var(--tone);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tone) 18%, transparent), 0 20px 34px -20px var(--tone);
  transform: translateY(-4px);
}
.metric.is-active::after { animation: load-bar 1.1s ease-in-out infinite alternate; }
@keyframes load-bar { from { transform: scaleX(.15); } to { transform: scaleX(1); } }
.metric-label { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .9rem; font-weight: 650; }
.metric-label .ic {
  width: 32px; height: 32px;
  padding: 7px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--tone) var(--icon-tint), var(--surface));
  color: var(--tone);
  stroke-width: 2.2;
}
.metric.is-active .metric-label .ic { animation: wiggle .7s ease-in-out infinite; }
@keyframes wiggle { 25% { transform: rotate(-10deg) scale(1.08); } 75% { transform: rotate(10deg) scale(1.08); } }
.metric-value { white-space: nowrap; }
.metric-value b {
  font-weight: 800;
  font-size: clamp(1.5rem, 1.25rem + 1.2vw, 1.95rem);
  line-height: 1.15;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.metric-unit { margin-inline-start: 5px; font-size: .84rem; font-weight: 600; color: var(--muted); }

/* Result */
.result {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  text-align: center;
  gap: 16px 24px;
  margin-top: 14px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: linear-gradient(140deg, rgb(var(--accent-rgb) / .08), rgb(var(--accent-2-rgb) / .1));
  animation: rise .6s var(--ease-spring);
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.score-ring { width: 110px; height: 110px; position: relative; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); filter: drop-shadow(0 6px 12px color-mix(in srgb, var(--score-color, var(--accent)) 45%, transparent)); }
.score-ring circle { fill: none; stroke-width: 10; stroke-linecap: round; }
.ring-track { stroke: var(--track); }
.ring-value {
  stroke: var(--score-color, var(--accent));
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.2s var(--ease-out);
}
.score-ring b {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center;
  font-weight: 800; font-size: 1.95rem; line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.score-ring small { display: block; margin-top: 3px; font-size: .8rem; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.result-title { margin-bottom: 12px; font-size: 1.35rem; font-weight: 750; font-stretch: 108%; line-height: 1.25; }
.result-title span { color: var(--score-text, var(--accent)); }
.activities { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.activity {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: var(--pill);
  border: 1px solid color-mix(in srgb, var(--dot) 40%, var(--border));
  background: color-mix(in srgb, var(--dot) 10%, var(--surface));
  font-size: .9rem; font-weight: 650;
  animation: pop .5s var(--ease-spring) both;
}
.activity:nth-child(2) { animation-delay: .06s; }
.activity:nth-child(3) { animation-delay: .12s; }
.activity:nth-child(4) { animation-delay: .18s; }
.activity:nth-child(5) { animation-delay: .24s; }
.activity:nth-child(6) { animation-delay: .3s; }
.activity i { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--dot); }
.activity span { font-weight: 750; }
.activity[data-level="great"] { --dot: var(--ok); }
.activity[data-level="great"] span { color: var(--ok-text); }
.activity[data-level="ok"] { --dot: var(--warn); }
.activity[data-level="ok"] span { color: var(--warn-text); }
.activity[data-level="poor"] { --dot: var(--bad); }
.activity[data-level="poor"] span { color: var(--bad-text); }

.speed-note { margin-top: 14px; font-size: .88rem; color: var(--muted); text-align: center; }

@media (min-width: 600px) {
  .result { grid-template-columns: auto minmax(0, 1fr); justify-items: start; align-items: center; text-align: start; padding: 22px 24px; }
  .activities { justify-content: flex-start; }
}

/* Tool pages have the full width: dial on the left, readouts stacked on the right.
   (On the home page the card sits in the hero's right column and stays stacked.) */
@media (min-width: 900px) {
  :is(.hero, .page-hero) .speed-card {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
    grid-template-areas:
      "top top"
      "gauge metrics"
      "actions metrics"
      "result result"
      "note note";
    column-gap: clamp(24px, 4vw, 48px);
  }
  :is(.hero, .page-hero) .speed-card-top { grid-area: top; }
  :is(.hero, .page-hero) .gauge { grid-area: gauge; }
  :is(.hero, .page-hero) .speed-actions { grid-area: actions; }
  :is(.hero, .page-hero) .metrics { grid-area: metrics; grid-template-columns: minmax(0, 1fr); align-self: center; gap: 12px; margin: 0; }
  :is(.hero, .page-hero) .metric { grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 14px 18px 16px 14px; }
  :is(.hero, .page-hero) .result { grid-area: result; }
  :is(.hero, .page-hero) .speed-note { grid-area: note; }
}

/* ---------- Tool panel ---------- */
.panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px clamp(28px, 5vw, 52px);
  align-items: center;
  padding: clamp(18px, 3.5vw, 32px);
  box-shadow: var(--shadow-lg);
}
.panel > div > p, .panel form > p { color: var(--muted); }
@media (min-width: 900px) {
  .panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Tools whose controls, stats and chart read top-to-bottom */
.panel.panel-stack { grid-template-columns: minmax(0, 1fr); gap: 0; align-items: stretch; }

/* Fields */
.field { margin-top: 16px; }
.field:first-child { margin-top: 0; }
.field label, .field-row label { display: block; margin-bottom: 6px; font-size: .92rem; font-weight: 650; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.field-row label { margin: 0; }
.field-row output {
  padding: 3px 12px;
  border-radius: var(--pill);
  background: var(--grad);
  color: #fff;
  font-weight: 750; font-size: .98rem;
  font-variant-numeric: tabular-nums;
}
.field-hint { margin-top: 6px; font-size: .84rem; color: var(--muted-2); }
.field-error { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-size: .86rem; font-weight: 650; color: var(--bad-text); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

input[type="text"], input[type="password"], select {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: 500 1rem var(--font-body); /* 16px avoids iOS zoom on focus */
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
input[type="text"]:hover, input[type="password"]:hover, select:hover { border-color: var(--accent-2); }
input[type="text"]:focus-visible, input[type="password"]:focus-visible, select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / .2), 0 14px 26px -18px rgb(var(--accent-2-rgb) / .9);
}
input:disabled { background: var(--surface-2); color: var(--muted-2); border-color: var(--border); }
input[aria-invalid="true"] { border-color: var(--bad); }
input[aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 22%, transparent); }
::placeholder { color: var(--muted-2); opacity: 1; }

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent-2) 50%), linear-gradient(135deg, var(--accent-2) 50%, transparent 50%);
  background-position: calc(100% - 21px) 50%, calc(100% - 15px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-inline-end: 42px;
}

.input-group { position: relative; }
.input-group input { padding-inline-end: 54px; }
.input-addon {
  position: absolute; top: 3px; right: 3px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 11px;
  color: var(--muted);
  font-size: 1.15rem;
  transition: color .2s, background-color .2s;
}
.input-addon:hover, .input-addon[aria-pressed="true"] { color: var(--accent-2); background: var(--surface-2); }

input[type="range"] {
  width: 100%;
  height: 44px;
  accent-color: var(--accent-2);
  cursor: pointer;
  background: transparent;
}

.checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; border: 0; padding: 0; }
.check {
  display: flex; align-items: center; gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 13px;
  background: var(--surface);
  font-size: .92rem; font-weight: 650;
  cursor: pointer;
  user-select: none;
  transition: border-color .2s, background-color .2s, transform .3s var(--ease-spring);
}
.check:hover { transform: translateY(-2px); }
.check input { accent-color: var(--accent-2); width: 18px; height: 18px; margin: 0; cursor: pointer; }
.check:has(input:checked) { border-color: var(--accent-2); background: linear-gradient(120deg, rgb(var(--accent-rgb) / .12), rgb(var(--accent-2-rgb) / .14)); }
.check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.check input:focus-visible { outline: none; }

/* Stat tiles (ping, IP) */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 900px) { #pingTool .stat-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.stat {
  --tone: var(--accent);
  min-width: 0;
  padding: 13px 15px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform .3s var(--ease-out), box-shadow .3s;
}
.stat:hover { transform: translateY(-3px); box-shadow: 0 18px 30px -22px var(--tone); }
.stat dt { font-size: .86rem; font-weight: 650; color: var(--muted); }
.stat dd {
  margin: 2px 0 0;
  font-weight: 800;
  font-size: clamp(1.35rem, 1.15rem + 1vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.stat small { margin-inline-start: 4px; font-size: .82rem; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.stat-text dd { font-size: 1.02rem; font-weight: 650; letter-spacing: 0; line-height: 1.4; }

.tool-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 18px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-radius: var(--pill);
  background: var(--surface-2);
  font-size: .88rem; font-weight: 650;
}
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill[data-tone="ok"]::before { animation: blink 1s ease-in-out infinite; }

.chart-box { margin-top: 14px; padding: 12px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
.chart-canvas { width: 100%; height: clamp(160px, 26vw, 220px); }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 8px 4px 0; font-size: .84rem; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 16px; height: 4px; border-radius: 2px; background: var(--grad); }
.chart-legend i.lost { width: 4px; height: 12px; background: var(--bad); }
.chart-legend i.base { height: 0; background: none; border-top: 2px dashed var(--ok); border-radius: 0; }

progress.run-progress { display: block; width: 100%; height: 8px; margin-top: 14px; appearance: none; border: 0; border-radius: var(--pill); background: var(--track); overflow: hidden; }
progress.run-progress::-webkit-progress-bar { background: var(--track); }
progress.run-progress::-webkit-progress-value { background: var(--grad-hot); border-radius: var(--pill); transition: width .3s; }
progress.run-progress::-moz-progress-bar { background: var(--grad-hot); border-radius: var(--pill); }

.verdict-box {
  --verdict: var(--accent);
  display: flex; gap: 16px; align-items: center;
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1.5px solid color-mix(in srgb, var(--verdict) 50%, var(--border));
  background: color-mix(in srgb, var(--verdict) 10%, var(--surface));
  animation: rise .5s var(--ease-spring);
}
.verdict-box[data-tone] { color: inherit; } /* data-tone colours the accents below, not the whole box */
.verdict-box[data-tone="ok"] { --verdict: var(--ok); --verdict-text: var(--ok-text); }
.verdict-box[data-tone="warn"] { --verdict: var(--warn); --verdict-text: var(--warn-text); }
.verdict-box[data-tone="bad"] { --verdict: var(--bad); --verdict-text: var(--bad-text); }
.verdict-box p { color: var(--muted); font-size: .96rem; }
.verdict-box .verdict-title { margin-bottom: 2px; color: var(--text); font-size: 1.2rem; font-weight: 750; font-stretch: 106%; }
.verdict-box .verdict-title span { color: var(--verdict-text, inherit); text-transform: capitalize; }

.subhead { margin: 26px 0 10px; font-size: 1.02rem; font-weight: 750; font-stretch: 106%; }

/* Signal tool */
.ref-table { width: 100%; margin-top: 16px; border-collapse: separate; border-spacing: 0 4px; font-size: .94rem; }
.ref-table th { padding: 0 12px 4px; text-align: start; font-size: .86rem; font-weight: 650; color: var(--muted); }
.ref-table th:last-child, .ref-table td:last-child { text-align: end; }
.ref-table td { padding: 10px 12px; background: var(--surface-2); font-variant-numeric: tabular-nums; transition: background-color .25s, color .25s; }
.ref-table td:first-child { border-radius: 12px 0 0 12px; }
.ref-table td:last-child { border-radius: 0 12px 12px 0; font-weight: 700; }
.ref-table tr[aria-current="true"] td { background: var(--accent); color: #fff; }
.ref-table tr[aria-current="true"] td:first-child { background: linear-gradient(90deg, var(--accent), var(--accent)); }
:root[data-theme="dark"] .ref-table tr[aria-current="true"] td { color: #061024; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ref-table tr[aria-current="true"] td { color: #061024; }
}

.signal-visual { position: relative; width: min(100%, 320px); margin: auto; }
.signal-gauge { width: 100%; overflow: visible; }
.stop-bad { stop-color: var(--bad); }
.stop-warn { stop-color: var(--warn); }
.stop-ok { stop-color: var(--ok); }
.signal-track { fill: none; stroke: var(--track); stroke-width: 20; stroke-linecap: round; }
.signal-value {
  fill: none; stroke: url(#signalGrad); stroke-width: 20; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: .5;
  filter: drop-shadow(0 6px 10px rgb(var(--accent-2-rgb) / .3));
  transition: stroke-dashoffset .5s var(--ease-spring);
}
.signal-readout { margin-top: -62px; text-align: center; }
.signal-readout b { display: block; font-weight: 800; font-size: 3.2rem; line-height: 1.05; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.signal-readout small { display: block; font-size: 1.02rem; font-weight: 750; }
.signal-bars { display: flex; gap: 6px; align-items: flex-end; justify-content: center; height: 40px; margin-top: 14px; }
.signal-bars i { width: 12px; border-radius: 5px; background: var(--track); transition: background-color .35s, transform .35s var(--ease-spring); transform-origin: bottom; }
.signal-bars i:nth-child(1) { height: 30%; }
.signal-bars i:nth-child(2) { height: 48%; }
.signal-bars i:nth-child(3) { height: 66%; }
.signal-bars i:nth-child(4) { height: 84%; }
.signal-bars i:nth-child(5) { height: 100%; }
.signal-bars i.is-on { background: var(--bar-color, var(--ok)); transform: scaleY(1.08); }

/* QR tool */
.qr-box {
  display: grid; place-items: center;
  min-height: 290px;
  padding: 22px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, rgb(var(--accent-rgb) / .08), rgb(var(--accent-2-rgb) / .1));
}
.qr-placeholder { color: var(--muted); font-size: .98rem; font-weight: 600; text-align: center; animation: float 4s ease-in-out infinite; }
.qr-canvas { width: 240px; height: 240px; border-radius: 16px; box-shadow: 0 24px 44px -22px rgb(var(--accent-2-rgb) / .9); animation: rise .5s var(--ease-spring); }

/* Password tool */
.pw-output {
  display: flex; align-items: center; gap: 10px;
  min-height: 70px;
  padding: 10px 10px 10px 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: linear-gradient(140deg, rgb(var(--accent-rgb) / .08), rgb(var(--accent-2-rgb) / .1));
}
.pw-value { flex: 1; min-width: 0; font: 650 1.14rem/1.4 var(--font-mono); word-break: break-all; }
.strength { height: 10px; margin-top: 14px; border-radius: var(--pill); background: var(--track); overflow: hidden; }
.strength i {
  display: block; height: 100%;
  border-radius: var(--pill);
  background: var(--strength-color, var(--ok));
  transform-origin: left;
  transform: scaleX(var(--strength, 0));
  transition: transform .5s var(--ease-spring), background-color .5s;
}
.strength-text { margin: 8px 0 16px; font-size: .94rem; font-weight: 600; color: var(--muted); }

/* Band tool */
.segmented { display: flex; gap: 6px; margin-bottom: 20px; padding: 5px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface-2); }
.segmented button {
  flex: 1;
  min-height: 46px;
  border-radius: 13px;
  font-weight: 700; font-size: .95rem;
  color: var(--muted);
  transition: background-color .2s, color .2s, box-shadow .2s, transform .3s var(--ease-spring);
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--grad); color: #fff; box-shadow: 0 10px 20px -10px rgb(var(--accent-2-rgb) / .95); transform: scale(1.02); }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.facts > div {
  --tone: var(--accent);
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--tone) 28%, var(--border));
  background: color-mix(in srgb, var(--tone) 9%, var(--surface));
  animation: pop .45s var(--ease-spring) both;
}
.facts > div:nth-child(2) { animation-delay: .05s; }
.facts > div:nth-child(3) { animation-delay: .1s; }
.facts > div:nth-child(4) { animation-delay: .15s; }
.facts dt { font-size: .86rem; font-weight: 650; color: var(--muted); }
.facts dd { margin: 0; font-weight: 750; }

.channel-chart {
  display: flex; align-items: flex-end; gap: 4px;
  height: 180px;
  padding: 14px 14px 30px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  overflow: hidden;
}
.channel-bar {
  position: relative;
  flex: 1; min-width: 6px;
  height: var(--h);
  border-radius: 7px 7px 2px 2px;
  background: var(--border-strong);
  opacity: .7;
  animation: grow .7s var(--ease-spring) both;
  animation-delay: var(--delay, 0ms);
  transform-origin: bottom;
}
.channel-bar.is-rec { opacity: 1; background: linear-gradient(180deg, #38b6ff, #0b63ff); box-shadow: 0 8px 16px -8px #0b63ff; }
.channel-bar span {
  position: absolute; top: 100%; left: 50%;
  translate: -50% 6px;
  font-size: .76rem; font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}
@keyframes grow { from { transform: scaleY(.05); } }
.channel-legend { display: flex; gap: 16px; padding: 10px 4px 0; font-size: .84rem; color: var(--muted); }
.channel-legend span { display: flex; align-items: center; gap: 6px; }
.channel-legend i { width: 11px; height: 11px; border-radius: 4px; }
.legend-rec { background: linear-gradient(180deg, #38b6ff, #0b63ff); }
.legend-dim { background: var(--border-strong); }
.channel-tip { margin-top: 10px; padding: 0 4px; font-weight: 650; }

/* Bufferbloat */
.bb-steps { display: grid; gap: 10px; }
@media (min-width: 720px) { .bb-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
.bb-step {
  --tone: var(--accent);
  position: relative;
  padding: 16px;
  border-radius: 20px;
  border: 1.5px solid color-mix(in srgb, var(--tone) 28%, var(--border));
  background: color-mix(in srgb, var(--tone) 8%, var(--surface));
  transition: border-color .3s, box-shadow .3s, transform .3s var(--ease-out);
}
.bb-step[data-state="active"] { border-color: var(--tone); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tone) 18%, transparent), 0 20px 34px -22px var(--tone); transform: translateY(-4px); }
.bb-step-title { display: flex; align-items: center; gap: 9px; font-size: .94rem; font-weight: 700; color: var(--muted); }
.bb-step-title b {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--tone);
  color: #fff;
  font-size: .86rem;
}
.bb-step[data-state="active"] .bb-step-title b { animation: beat 1s ease-in-out infinite; }
.bb-step[data-state="done"] .bb-step-title::after { content: "✓"; margin-inline-start: auto; color: var(--ok-text); font-weight: 800; }
.bb-ms { margin-top: 6px; font-weight: 800; font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.2rem); line-height: 1.15; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.bb-ms small { font-size: .88rem; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.bb-sub { display: flex; justify-content: space-between; gap: 8px; margin-top: 2px; font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.bb-add { font-weight: 750; color: var(--warn-text); }
.grade-badge {
  flex: none;
  width: 66px; height: 66px;
  display: grid; place-items: center;
  border-radius: 20px;
  background: var(--verdict);
  color: #fff;
  font-weight: 800; font-size: 1.9rem;
  box-shadow: 0 16px 28px -14px var(--verdict);
  animation: pop .6s var(--ease-spring);
}

/* IP page */
.ip-hero { padding: 6px 0 10px; text-align: center; }
.ip-label { font-size: .94rem; font-weight: 650; color: var(--muted); }
.ip-value {
  margin: 4px 0 0;
  font: 800 clamp(1.5rem, 1rem + 4.4vw, 3.3rem)/1.15 var(--font-mono);
  letter-spacing: -.03em;
  overflow-wrap: anywhere;
  background: var(--grad-hot);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 5s ease-in-out infinite alternate;
}
.ip-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.ip-status { margin-top: 16px; font-size: .9rem; text-align: center; }
.last-test {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 16px;
  padding: 14px 18px;
  border: 1px solid rgb(var(--accent-2-rgb) / .3);
  border-radius: 18px;
  background: linear-gradient(120deg, rgb(var(--accent-rgb) / .09), rgb(var(--accent-2-rgb) / .11));
  font-size: .94rem;
}

/* Router page */
.router-picker { display: grid; gap: 14px; }
.router-result { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; }
.router-open {
  display: inline-flex; align-items: center; gap: 14px;
  min-height: 54px;
  padding: 0 7px 0 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 17px;
  background: var(--surface);
  transition: border-color .2s, transform .3s var(--ease-spring), box-shadow .3s;
}
.router-open:hover { border-color: var(--accent-2); transform: translateY(-3px); box-shadow: 0 18px 30px -20px rgb(var(--accent-2-rgb) / .9); }
.router-addr { font: 700 1rem var(--font-mono); }
.router-open-label { padding: 8px 14px; border-radius: 11px; background: var(--grad); color: #fff; font-size: .86rem; font-weight: 700; }
.router-note { font-size: .94rem; color: var(--muted); }
.panel .subhead:first-child { margin-top: 0; }

/* ---------- Tool cards: coloured icon, name, arrow ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: clamp(10px, 1.6vw, 16px);
}
.tool-tile a {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  height: 100%;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease-spring), box-shadow .35s, border-color .35s;
}
.tool-tile a:hover { transform: translateY(-5px); border-color: var(--tone); box-shadow: 0 24px 40px -26px var(--tone); }
.tile-icon {
  width: 56px; height: 56px;
  border-radius: 17px;
  font-size: 1.6rem;
  transition: transform .45s var(--ease-spring), background-color .3s, color .3s;
}
.tool-tile a:hover .tile-icon { background: var(--tone); color: #fff; transform: rotate(-8deg) scale(1.1); }
.tile-text { display: grid; gap: 3px; }
.tile-title { font-size: 1.06rem; line-height: 1.25; }
.tile-blurb { font-size: .9rem; line-height: 1.45; color: var(--muted); }
.tile-go {
  width: 34px; height: 34px;
  padding: 8px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  transition: background-color .3s, color .3s, transform .35s var(--ease-out);
}
.tool-tile a:hover .tile-go { background: var(--accent); color: #fff; transform: translateX(4px); }

/* Phones: two compact tiles per row (icon + name) so the list is half as long.
   The description and arrow return from 600px up. */
@media (max-width: 599px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tool-tile a {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
    align-content: start;
    gap: 10px;
    min-height: 112px;
    padding: 14px;
  }
  .tile-title { font-size: .98rem; line-height: 1.25; }
  .tile-blurb, .tile-go { display: none; }
  /* an odd tile left on its own takes the full row, icon beside the name */
  .tool-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .tool-tile:last-child:nth-child(odd) a { grid-template-columns: auto minmax(0, 1fr); align-items: center; min-height: 0; }
}

/* "More tools" row */
.chip-links { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-link {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 46px;
  padding: 0 16px 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: var(--surface);
  font-size: .92rem; font-weight: 650;
  transition: transform .3s var(--ease-spring), box-shadow .3s, border-color .3s;
}
.chip-link .ic { width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: color-mix(in srgb, var(--tone) var(--icon-tint), var(--surface)); color: var(--tone); transition: transform .45s var(--ease-spring), background-color .3s, color .3s; }
.chip-link:hover { transform: translateY(-3px); border-color: var(--tone); box-shadow: 0 16px 26px -18px var(--tone); }
.chip-link:hover .ic { background: var(--tone); color: #fff; transform: rotate(-12deg) scale(1.1); }

/* ---------- Guide cards ---------- */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(10px, 1.6vw, 16px); }
.guide-card a {
  display: flex; flex-direction: column; gap: 8px;
  height: 100%;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease-spring), box-shadow .35s, border-color .35s;
}
.guide-card a:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 24px 40px -26px rgb(var(--accent-rgb) / .9); }
.guide-tag {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 12px 4px 5px;
  border-radius: var(--pill);
  background: color-mix(in srgb, var(--tone) var(--icon-tint), var(--surface));
  color: color-mix(in srgb, var(--tone) 70%, var(--text));
  font-size: .82rem; font-weight: 700;
}
.guide-tag .ic { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--tone); color: #fff; }
.guide-card-title { font-size: 1.12rem; line-height: 1.3; }
.guide-card-desc { flex: 1; font-size: .92rem; line-height: 1.5; color: var(--muted); }
.guide-card-more { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 700; color: var(--accent); }
.guide-card a:hover .guide-card-more .ic { transform: translateX(5px); }

/* ---------- Blocks & home sections ---------- */
.section-block { margin-top: clamp(44px, 6vw, 72px); }
.block-title { margin-bottom: 18px; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); }
.section-block .block-more { text-align: start; }

.home-section { padding-top: clamp(56px, 8vw, 104px); }
/* heading on the left, optional link on the right */
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; margin-bottom: clamp(22px, 3vw, 34px); }
.section-head > div { display: grid; gap: 10px; max-width: 40rem; }
.section-head p { color: var(--muted); text-wrap: pretty; }

/* How it works: four cards in a row */
.how-steps { counter-reset: how; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: clamp(10px, 1.6vw, 16px); }
.how-steps li {
  counter-increment: how;
  position: relative;
  display: grid; gap: 8px; align-content: start;
  padding: 22px 20px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease-spring), box-shadow .35s, border-color .35s;
}
.how-steps li:hover { transform: translateY(-5px); border-color: var(--tone); box-shadow: 0 24px 40px -26px var(--tone); }
.how-steps li::after {
  content: counter(how);
  position: absolute; top: 16px; right: 20px;
  font-weight: 800; font-size: 2.6rem; line-height: 1;
  font-stretch: var(--wide);
  color: color-mix(in srgb, var(--tone) 22%, transparent);
}
.how-icon { width: 52px; height: 52px; border-radius: 16px; font-size: 1.5rem; transition: transform .45s var(--ease-spring), background-color .3s, color .3s; }
.how-steps li:hover .how-icon { background: var(--tone); color: #fff; transform: rotate(-8deg) scale(1.08); }
.how-steps p { font-size: .94rem; line-height: 1.55; color: var(--muted); }
.how-steps a { color: var(--accent); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgb(var(--accent-rgb) / .4); }
.how-notes { max-width: 46rem; margin-top: 24px; font-size: 1rem; }

/* History */
.history-card {
  padding: clamp(14px, 3vw, 26px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.history-empty { padding: 14px 0; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; font-size: .96rem; font-variant-numeric: tabular-nums; }
.history-table th { padding: 8px 10px; text-align: start; font-size: .88rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.history-table td { padding: 12px 10px; border-top: 1px solid var(--border); white-space: nowrap; }
.history-table td:nth-child(2), .history-table td:nth-child(3) { font-weight: 750; color: var(--accent); }
.history-table tbody tr { transition: background-color .2s; animation: rise .4s var(--ease-out) both; }
.history-table tbody tr:hover { background: rgb(var(--accent-rgb) / .06); }
.history-table th:nth-child(n+4), .history-table td:nth-child(n+4) { display: none; }
@media (min-width: 560px) {
  .history-table th:nth-child(n+4), .history-table td:nth-child(n+4) { display: table-cell; }
}
.tag {
  margin-inline-start: 8px;
  padding: 2px 9px;
  border-radius: var(--pill);
  background: color-mix(in srgb, var(--warn) 20%, transparent);
  color: var(--warn-text);
  font-size: .76rem; font-weight: 700;
}
.history-foot { display: flex; justify-content: flex-end; margin-top: 14px; }

/* Can / can't see */
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: clamp(10px, 1.6vw, 16px); }
.compare-card {
  --tone: #10b981;
  padding: clamp(20px, 3vw, 28px);
  border-radius: 20px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--tone);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease-spring), box-shadow .35s;
}
.compare-card:hover { transform: translateY(-5px); box-shadow: 0 24px 40px -28px var(--tone); }
.compare-no { --tone: #f59e0b; }
.compare-card h3 { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.compare-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 13px; background: color-mix(in srgb, var(--tone) var(--icon-tint), var(--surface)); color: var(--tone); font-size: 1.3rem; }
.compare-icon .ic { stroke-width: 2.4; }
.compare-card ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.compare-card li { display: flex; gap: 10px; font-size: .96rem; color: var(--muted); }
.compare-card li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: .6em; border-radius: 50%; background: var(--tone); }
.compare-card li b { color: var(--text); font-weight: 700; }

/* FAQ on the home page: heading left, questions right */
@media (min-width: 960px) {
  .faq-layout { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 48px; align-items: start; }
  .faq-layout .section-head { position: sticky; top: calc(var(--header-h) + 32px); }
}

/* Closing band */
.section-cta { padding-top: clamp(56px, 8vw, 104px); }
.cta {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px;
  padding: clamp(32px, 6vw, 64px);
  border-radius: var(--radius-xl);
  background: linear-gradient(115deg, #0b3fd9, #0b63ff 45%, #38b6ff);
  background-size: 230% 100%;
  color: #fff;
  box-shadow: var(--shadow-lg);
  animation: sheen 8s ease-in-out infinite alternate;
}
.cta::before, .cta::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; background: rgb(255 255 255 / .14); animation: float 7s ease-in-out infinite; }
.cta::before { width: 380px; height: 380px; right: -100px; top: -190px; }
.cta::after { width: 240px; height: 240px; right: 22%; bottom: -170px; animation-delay: -3.5s; }
.cta h2 { max-width: 18ch; }
.cta :focus-visible { outline-color: #fff; }

/* ---------- Articles (guides, tool explainers, legal pages) ---------- */
.article-wrap { width: min(100% - 2 * var(--gutter), 780px); margin-inline: auto; }
.article-head { display: grid; gap: 14px; justify-items: start; padding: clamp(18px, 4vw, 36px) 0 4px; }
.article-head h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.1rem); }
.article-head .lede { max-width: none; color: color-mix(in srgb, var(--text) 82%, var(--muted)); }
.guide-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
.guide-meta .ic { color: var(--accent-2); }

.prose { font-size: 1.05rem; line-height: 1.72; }
.prose > * + * { margin-top: 1em; }
.prose h2 { margin-top: 2em; font-size: clamp(1.45rem, 1.2rem + 1.2vw, 1.95rem); scroll-margin-top: calc(var(--header-h) + 40px); }
.prose h2:first-child { margin-top: 0; }
.article-head ~ .prose { margin-top: 28px; }
.prose h3 { margin-top: 1.6em; font-size: 1.18rem; }
.prose h2 + *, .prose h3 + * { margin-top: .5em; }
.prose p, .prose li { color: color-mix(in srgb, var(--text) 86%, var(--muted)); }
.prose ul, .prose ol { padding-inline-start: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--accent-2); font-weight: 800; }
.prose a:not(.btn), .faq-a a {
  color: var(--accent); font-weight: 650;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px;
  text-decoration-color: rgb(var(--accent-rgb) / .4);
  transition: color .2s, text-decoration-color .2s;
}
.prose a:not(.btn):hover, .faq-a a:hover { color: var(--accent-2); text-decoration-color: currentColor; }
.prose strong { color: var(--text); font-weight: 700; }
.prose code, .prose kbd {
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-2);
  font: 600 .88em var(--font-mono);
  white-space: nowrap;
}
.prose .table-scroll { border: 1px solid var(--border); border-radius: 18px; background: var(--surface); overflow: hidden; overflow-x: auto; box-shadow: var(--shadow-sm); }
.prose table { width: 100%; border-collapse: collapse; font-size: .96rem; line-height: 1.5; }
.prose th, .prose td { padding: 12px 16px; text-align: start; border-top: 1px solid var(--border); vertical-align: top; }
.prose thead th { border-top: 0; background: var(--grad); color: #fff; font-size: .92rem; font-weight: 700; }
.prose tbody tr:first-child td { border-top: 0; }
.prose tbody tr { transition: background-color .2s; }
.prose tbody tr:hover { background: rgb(var(--accent-2-rgb) / .07); }

/* Numbered steps */
.prose ol.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 12px; }
.prose ol.steps > li {
  --tone: var(--accent);
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: 16px 18px 16px 64px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--tone) 28%, var(--border));
  background: color-mix(in srgb, var(--tone) 7%, var(--surface));
  transition: transform .3s var(--ease-spring), box-shadow .3s;
}
.prose ol.steps > li:hover { transform: translateX(6px); box-shadow: 0 18px 30px -22px var(--tone); }
.prose ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 16px; top: 14px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--tone), color-mix(in srgb, var(--tone) 70%, white));
  color: #fff;
  font-size: .98rem; font-weight: 800; line-height: 1;
  box-shadow: 0 10px 18px -10px var(--tone);
}

.callout {
  display: flex; gap: 12px;
  padding: 16px 18px;
  border: 1px solid rgb(var(--accent-2-rgb) / .3);
  border-radius: 18px;
  background: linear-gradient(120deg, rgb(var(--accent-rgb) / .08), rgb(var(--accent-2-rgb) / .1));
  font-size: .98rem;
}
.callout .ic { flex: none; margin-top: 4px; font-size: 1.3rem; color: var(--accent-2); }
.callout-warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.callout-warn .ic { color: var(--warn-text); }

/* Table of contents */
.toc { margin: 24px 0 8px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface-glass-strong); box-shadow: var(--shadow-sm); }
.toc-title { margin-bottom: 6px; font-size: .96rem; font-weight: 750; }
.toc ol { margin: 0; padding-inline-start: 1.3em; }
.toc li::marker { color: var(--accent-2); font-weight: 800; font-size: .9rem; }
.toc a { display: inline-block; padding: 5px 0; font-size: .96rem; line-height: 1.35; transition: color .2s, transform .25s var(--ease-out); }
.toc a:hover { color: var(--accent); transform: translateX(4px); }

/* Guide call-to-action box */
.guide-cta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px 16px;
  margin: 24px 0;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--tone);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.guide-cta .tile-icon { width: 54px; height: 54px; font-size: 1.45rem; }
.guide-cta p { font-size: .94rem; line-height: 1.45; color: var(--muted); }
.guide-cta .guide-cta-title { color: var(--text); font-size: 1.08rem; font-weight: 750; }
.guide-cta .btn { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 640px) {
  .guide-cta { grid-template-columns: auto minmax(0, 1fr) auto; }
  .guide-cta .btn { grid-column: auto; }
}
.guide-cta-lg { margin-top: 40px; padding: 24px; }

/* ---------- FAQ ---------- */
.faq-list { display: grid; gap: 10px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-glass-strong);
  transition: border-color .3s, box-shadow .3s, background-color .3s;
}
.faq-item:hover { border-color: var(--border-strong); }
.faq-item[open] { border-color: rgb(var(--accent-2-rgb) / .55); box-shadow: 0 22px 40px -30px rgb(var(--accent-2-rgb) / .9); }
.faq-item summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 60px;
  padding: 14px 16px 14px 20px;
  cursor: pointer; list-style: none;
  border-radius: 20px;
  font-size: 1.05rem; font-weight: 700; line-height: 1.35;
  text-align: start;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  flex: none;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: 1.3rem; font-weight: 500; line-height: 1;
  transition: transform .4s var(--ease-spring);
}
.faq-item[open] summary::after { transform: rotate(135deg); }
.faq-a { padding: 0 20px 18px; color: var(--muted); text-align: start; }
.faq-item[open] .faq-a { animation: rise .4s var(--ease-out); }
.prose .faq-item { margin-top: 0; }
.prose .faq-list { margin-top: .8em; }

/* ---------- 404, contact ---------- */
.nf-code {
  font-weight: 800; font-size: clamp(5rem, 2rem + 16vw, 10rem); line-height: .95;
  font-stretch: 122%; letter-spacing: -.05em;
  background: var(--grad-hot);
  background-size: 240% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: sheen 4s ease-in-out infinite alternate, float 5s ease-in-out infinite;
}

.contact-card { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 22px; padding: 20px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface-glass-strong); box-shadow: var(--shadow-sm); }
.contact-card .tile-icon { width: 54px; height: 54px; font-size: 1.45rem; }
.contact-card p { font-size: .9rem; color: var(--muted); }
.contact-card a { font-size: 1.12rem; font-weight: 750; color: var(--accent); overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(64px, 9vw, 112px);
  padding: 52px 0 calc(32px + var(--safe-bottom));
  background: var(--surface-glass);
  color: var(--muted);
  font-size: .94rem;
}
.site-footer::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--grad-hot); background-size: 240% 100%; animation: sheen 6s ease-in-out infinite alternate; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px 32px; align-items: start; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
.footer-brand .logo { color: var(--text); }
.footer-brand p { max-width: 320px; margin-top: 10px; }
.footer-guides-link a { color: var(--accent); font-weight: 700; }
.footer-title { margin-bottom: 6px; font-size: .96rem; font-weight: 750; font-stretch: 100%; line-height: 1.4; letter-spacing: 0; color: var(--text); }
.footer-col ul { list-style: none; padding: 0; display: grid; }
.footer-col a { display: inline-flex; align-items: center; min-height: 36px; transition: color .2s, transform .25s var(--ease-out); }
.footer-col a:hover { color: var(--accent); transform: translateX(4px); }

/* Phones: each column is an accordion (the buttons are added by js/site.js) */
.footer-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%;
  min-height: 54px;
  font: inherit; color: inherit;
  text-align: start;
}
.footer-toggle::after {
  content: "";
  flex: none;
  width: 9px; height: 9px;
  margin-inline-end: 6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-3px) rotate(45deg);
  transition: transform .3s var(--ease-spring), border-color .2s;
}
.footer-toggle[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); border-color: var(--accent); }
@media (max-width: 639px) {
  .footer-grid { gap: 0; }
  .footer-brand { margin-bottom: 22px; }
  .footer-col { border-top: 1px solid var(--border); }
  .footer-col:last-child { border-bottom: 1px solid var(--border); }
  .footer-col:has(.footer-toggle) .footer-title { margin: 0; }
  .footer-col:not(:has(.footer-toggle)) { padding: 14px 0 8px; } /* no JS: plain open lists */
  .footer-col ul { padding-bottom: 10px; animation: rise .3s var(--ease-out); }
  .footer-col a { min-height: 44px; }
  .footer-guides-link a { display: inline-flex; align-items: center; min-height: 44px; }
  .footer-bottom { margin-top: 20px; border-top: 0; padding-top: 0; }
}
.footer-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); font-size: .88rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + var(--safe-bottom));
  translate: -50% 30px;
  max-width: min(92vw, 440px);
  padding: 13px 22px;
  border-radius: var(--pill);
  background: var(--grad-hot);
  color: #fff;
  font-size: .94rem; font-weight: 650;
  text-align: center;
  z-index: 130;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 22px 40px -18px rgb(var(--accent-2-rgb) / .95);
  transition: opacity .4s var(--ease-out), translate .5s var(--ease-spring);
}
.toast.is-visible { opacity: 1; translate: -50% 0; }
@media (min-width: 900px) { .toast { bottom: calc(26px + var(--safe-bottom)); } }

/* ---------- Scroll reveal & word-by-word headings (classes added by js/site.js) ---------- */
.js .reveal { opacity: 0; transform: translateY(34px) scale(.98); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.js .reveal.is-revealed { opacity: 1; transform: none; }

/* cards inside a revealed block arrive one after another */
.js .reveal .tool-tile, .js .reveal .guide-card { opacity: 0; transform: translateY(26px) scale(.94); }
.js .reveal.is-revealed .tool-tile, .js .reveal.is-revealed .guide-card { animation: card-in .6s var(--ease-spring) forwards; }
@keyframes card-in { to { opacity: 1; transform: none; } }
.reveal.is-revealed :is(.tool-tile, .guide-card):nth-child(2) { animation-delay: .06s; }
.reveal.is-revealed :is(.tool-tile, .guide-card):nth-child(3) { animation-delay: .12s; }
.reveal.is-revealed :is(.tool-tile, .guide-card):nth-child(4) { animation-delay: .18s; }
.reveal.is-revealed :is(.tool-tile, .guide-card):nth-child(5) { animation-delay: .24s; }
.reveal.is-revealed :is(.tool-tile, .guide-card):nth-child(6) { animation-delay: .3s; }
.reveal.is-revealed :is(.tool-tile, .guide-card):nth-child(7) { animation-delay: .36s; }
.reveal.is-revealed :is(.tool-tile, .guide-card):nth-child(8) { animation-delay: .42s; }
.reveal.is-revealed :is(.tool-tile, .guide-card):nth-child(n+9) { animation-delay: .48s; }

.word { display: inline-block; opacity: 0; transform: translateY(.5em) rotate(4deg); filter: blur(8px); }
.split.is-revealed .word { animation: word-in .8s var(--ease-spring) forwards; animation-delay: calc(var(--i) * 45ms); }
@keyframes word-in { to { opacity: 1; transform: none; filter: none; } }
/* the gradient has to sit on each word, because inline-block children don't inherit a clipped background */
.split em { background: none; animation: none; }
.split em .word { background: var(--grad-hot); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Page-load entrance for pages without scroll reveal */
.page-hero h1, .page-hero .lede, .page-hero .tool-card, .page-hero .speed-card, .hero .speed-card, .hero .lede, .article-head > * { animation: rise .7s var(--ease-out) both; }
.page-hero .lede, .hero .lede, .article-head > :nth-child(2) { animation-delay: .1s; }
.page-hero .tool-card, .page-hero .speed-card, .hero .speed-card, .article-head > :nth-child(3) { animation-delay: .2s; }
.tool-grid:not(.reveal .tool-grid) .tool-tile, .guide-grid:not(.reveal .guide-grid) .guide-card { animation: rise .6s var(--ease-out) both; }
:is(.tool-grid, .guide-grid):not(.reveal *) > :nth-child(2) { animation-delay: .05s; }
:is(.tool-grid, .guide-grid):not(.reveal *) > :nth-child(3) { animation-delay: .1s; }
:is(.tool-grid, .guide-grid):not(.reveal *) > :nth-child(4) { animation-delay: .15s; }
:is(.tool-grid, .guide-grid):not(.reveal *) > :nth-child(5) { animation-delay: .2s; }
:is(.tool-grid, .guide-grid):not(.reveal *) > :nth-child(n+6) { animation-delay: .25s; }

/* ---------- Small screens ---------- */
@media (max-width: 380px) {
  .facts { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Motion & input preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  /* !important: a blanket opt-out has to beat every component's own timing */
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal, .js .reveal .tool-tile, .js .reveal .guide-card, .word { opacity: 1; transform: none; filter: none; }
  .speed-card { transform: none; }
  .orb, .grid, .gauge::before { animation: none; }
}

@media (hover: none) {
  .btn:hover:not(:disabled), .tool-tile a:hover, .guide-card a:hover, .compare-card:hover, .metric:hover, .stat:hover { transform: none; }
}

@media (forced-colors: active) {
  .btn, .segmented button[aria-pressed="true"], .go-btn, .nav-links a[aria-current="page"] { border: 1px solid ButtonText; }
  :is(h1, h2, h3) em, .split em .word, .gauge-number, .ip-value, .nf-code { background: none; color: CanvasText; }
  .gauge-progress, .ring-value, .signal-value { stroke: Highlight; }
}

@media print {
  .site-header, .tab-bar, .site-footer, .toast, .breadcrumbs, .skip-link, .aurora, .scroll-progress { display: none; }
  body { padding: 0; background: #fff; }
  .js .reveal, .word { opacity: 1; transform: none; filter: none; }
}
