/* Avamboo Speedtest. The corporate identity (avamboo.de) lives in these
   variables, the gauge's gradient in index.html (#arc-green) and the logo
   (--branding-dir, else logo.svg): change them, nothing else. Inter is
   embedded (inter-latin.woff2, SIL OFL 1.1: Inter-OFL.txt); nothing is
   loaded from elsewhere. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(inter-latin.woff2) format("woff2-variations"), url(inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --green-1: #9adf57;      /* highlight */
  --green-2: #7bd648;
  --green-3: #62ba2f;      /* primary: button, download */
  --green-4: #43a51e;      /* hover / pressed */
  --green-grad: linear-gradient(90deg, var(--green-4), var(--green-3) 35%, var(--green-2) 70%, var(--green-1));
  --navy: #061b3a;         /* hero band */
  --navy-deep: #06172a;
  --ink: #0d1626;          /* text on light */
  --muted: #5a6680;        /* secondary text */
  --bg: #f8fbff;           /* page */
  --bg-tint: #eef5ff;
  --green-tint: #eaf7df;
  --card: #ffffff;
  --line: #dfe6ef;
  --up: #061b3a;           /* upload dot */
  --ping: #5a6680;         /* ping dot */
  --error: #b4232c;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(6, 27, 58, .04), 0 10px 30px rgba(6, 27, 58, .07);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg), var(--bg-tint));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* A white bar: the logo's wordmark is dark grey. */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.top { display: flex; align-items: center; gap: 16px; padding: 14px 28px; max-width: 980px; width: 100%; margin: 0 auto; }
.logo { height: 40px; width: auto; max-width: 260px; object-fit: contain; }
.product { font-weight: 600; color: var(--muted); letter-spacing: .01em; padding-left: 16px; border-left: 1px solid var(--line); }
.home { display: flex; } /* a link only with --homepage-url */
/* DE | EN, top right. */
.lang-switch { margin-left: auto; display: flex; align-items: center; gap: 2px; color: var(--line); font-size: 14px; }
.lang-switch button { border: 0; background: none; cursor: pointer; padding: 6px 8px; border-radius: 8px; font: 600 14px var(--font); color: var(--muted); letter-spacing: .04em; }
.lang-switch button:hover { color: var(--ink); background: var(--bg-tint); }
.lang-switch button[aria-pressed="true"] { color: var(--green-4); }
.lang-switch button:focus-visible { outline: 2px solid var(--green-3); outline-offset: 1px; }

/* The navy band behind the gauge. */
.hero {
  background: radial-gradient(900px 420px at 50% 0, rgba(98, 186, 47, .16), transparent 70%), linear-gradient(180deg, var(--navy), var(--navy-deep));
  color: #fff;
  padding: 34px 20px 64px;
  overflow: hidden; /* the rotated gauge SVG's box is wider than the gauge */
}
.meter { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.gauge { position: relative; width: min(320px, 78vw); aspect-ratio: 1; }
.gauge svg { width: 100%; height: 100%; transform: rotate(135deg); }
.gauge circle { fill: none; stroke-width: 12; stroke-linecap: round; }
.gauge .track { stroke: rgba(255, 255, 255, .12); stroke-dasharray: 395.8 527.8; }
.gauge .arc { stroke: url(#arc-green); stroke-dasharray: 0 527.8; opacity: 0; transition: stroke-dasharray .25s ease-out; }
/* Upload: the inner arc (download stays on the outer one). */
.gauge .track-up { stroke: rgba(255, 255, 255, .07); stroke-width: 7; stroke-dasharray: 329.9 439.8; }
.gauge .arc-up { stroke: #dfe9f7; stroke-width: 7; stroke-dasharray: 0 439.8; opacity: 0; transition: stroke-dasharray .25s ease-out; }
.pair { display: flex; gap: 14px; margin-top: 8px; font-size: 14px; color: rgba(255, 255, 255, .72); font-variant-numeric: tabular-nums; min-height: 1.3em; }
.pair b { font-weight: 700; color: #fff; }
.pair .pd b { color: var(--green-1); }
body[data-state="ping"] .pair, body[data-state="queue"] .pair { visibility: hidden; }
.readout { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.value { font-size: clamp(44px, 12vw, 68px); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.02em; }
.unit { color: rgba(255, 255, 255, .7); margin-top: 6px; font-weight: 500; }
.phase { margin-top: 10px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--green-1); min-height: 1.2em; }

.start {
  position: absolute; inset: 22%; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--green-3); color: #fff; font: 700 clamp(22px, 6vw, 30px) var(--font); letter-spacing: .03em;
  box-shadow: 0 0 0 10px rgba(98, 186, 47, .14), 0 12px 32px rgba(0, 0, 0, .28);
  transition: transform .15s, background .15s, opacity .2s;
}
.start:hover { background: var(--green-4); transform: scale(1.03); }
.start:active { transform: scale(.98); }
.start:focus-visible { outline: 3px solid var(--green-1); outline-offset: 4px; }
body:not([data-state="idle"]):not([data-state="done"]):not([data-state="error"]) .start { opacity: 0; pointer-events: none; }
body[data-state="done"] .start, body[data-state="error"] .start { white-space: nowrap; inset: auto; bottom: -6px; left: 50%; transform: translateX(-50%); width: auto; height: auto; padding: 10px 26px; border-radius: 999px; font-size: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
body[data-state="idle"] .readout { visibility: hidden; }

.status { min-height: 1.4em; margin: 22px 0 10px; color: rgba(255, 255, 255, .78); text-align: center; font-weight: 500; }
body[data-state="error"] .status { color: #ffb4b4; }
.progress { width: min(420px, 90%); height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.bar { height: 100%; width: 0; background: var(--green-grad); transition: width .25s linear; }
body[data-state="queue"] .bar { width: 35% !important; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* White cards on the light page, the first row overlapping the band. */
main { flex: 1; width: 100%; max-width: 980px; margin: -40px auto 0; padding: 0 20px 28px; display: grid; gap: 18px; align-content: start; position: relative; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stat { padding: 18px 20px; transition: border-color .2s, background .2s; }
.label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot.down { background: var(--green-3); } .dot.up { background: var(--up); } .dot.ping { background: var(--ping); }
.num { margin-top: 8px; font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.num small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 6px; letter-spacing: 0; }
.sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.stat.active { border-color: var(--green-3); background: var(--green-tint); }

/* After a complete result: share the card, copy the text for an AI chat. */
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.actions[hidden], .copybox[hidden], .toast[hidden] { display: none; }
.action { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 10px 22px; font: 600 15px var(--font); cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s, color .15s; }
.action:hover { border-color: var(--green-3); color: var(--green-4); }
.action:focus-visible { outline: 3px solid var(--green-1); outline-offset: 2px; }
.copybox { flex-basis: 100%; }
.copybox textarea { width: 100%; font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 12px; resize: vertical; background: var(--card); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100vw - 32px); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 12px; box-shadow: 0 10px 30px rgba(6, 27, 58, .3); font-size: 14px; font-weight: 500; z-index: 10; }
.toast a { color: var(--green-1); font-weight: 600; }

.conn { padding: 18px 22px; }
.conn h2 { margin: 0 0 12px; font-size: 15px; color: var(--ink); font-weight: 600; }
.conn dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; }
.conn dt { color: var(--muted); font-size: 14px; }
.conn dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.attrib { margin: 14px 0 0; font-size: 12px; }
.attrib a { color: var(--muted); }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 18px; }
.foot .sep { margin: 0 6px; }
.foot .links { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-left: 14px; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--ink); }
/* privacy.html */
.doc { max-width: 760px; margin: 28px auto; padding: 24px 28px; line-height: 1.6; overflow-wrap: anywhere; hyphens: auto; }
.doc h1 { font-size: 24px; margin: 0 0 6px; }
.doc h2 { font-size: 17px; margin: 22px 0 6px; }
.doc p, .doc li { color: var(--ink); }
.doc a { color: var(--green-4); }
.doc-page main { margin-top: 0; padding-top: 28px; }
.doc [hidden] { display: none; }

@media (max-width: 640px) {
  .results { grid-template-columns: 1fr 1fr; }
  #r-ping { grid-column: span 2; }
  .top { padding: 12px 14px; gap: 10px; }
  .logo { height: 32px; }
  .product { padding-left: 10px; }
  .lang-switch button { padding: 6px 5px; }
  .stat { min-width: 0; padding: 16px; }
  .num { font-size: 28px; }
}
@media (max-width: 360px) {
  .logo { height: 26px; }
  .doc { padding: 20px 18px; }
}
