/* Website Check result card.
   One stylesheet, two homes: the section under the hero on the landing page and
   the shareable /check/<id> page. Keeping it in one file is what stops the two
   drifting into looking like different products.

   THE CARD TAKES ITS COLOUR FROM THE VERDICT. A result is a moment: somebody
   has just been told what their website is doing to their business. A card that
   looks identical whether the news is good or bad throws that away. One token,
   --tone, is set from the grade on .wc-result and everything downstream reads
   it: the ring, the top edge, the glow, the chip, the findings. Green when they
   are fine, amber when they are leaking work, red when it is costing them now.

   Colour tokens come from whichever page loads this, so the component inherits
   the site's own palette rather than carrying a second one. */

/* The site's --mut2 (#647787) is only 3.83:1 on this card, which fails WCAG AA
   for the small uppercase labels that use it. This component sets its own label
   colour at 5.38:1 rather than changing a token the rest of the site depends
   on. Measured against the darker end of the card gradient, #0a1928. */
:root{
  --wc-label:#7B90A3;
  --wc-good:#2EE6A6;
  --wc-warn:#FFC266;
  --wc-bad:#FF8A8A;
}

/* ---- the card, tinted by the verdict ---- */
.wc-result{
  --tone:var(--acc);
  --tone-soft:rgba(68,215,255,.14);
  --tone-glow:rgba(68,215,255,.30);
  position:relative;
  overflow:hidden;
  background:linear-gradient(160deg,var(--surf2),var(--surf));
  border:1px solid var(--line2);
  border-radius:22px;
  padding:34px 32px;
}
.wc-result[data-grade="good"]{ --tone:var(--wc-good); --tone-soft:rgba(46,230,166,.13); --tone-glow:rgba(46,230,166,.34) }
.wc-result[data-grade="fair"]{ --tone:var(--wc-warn); --tone-soft:rgba(255,194,102,.13); --tone-glow:rgba(255,194,102,.34) }
.wc-result[data-grade="poor"]{ --tone:var(--wc-bad);  --tone-soft:rgba(255,138,138,.14); --tone-glow:rgba(255,138,138,.38) }

/* A hairline of the verdict colour across the top, and a soft wash behind the
   score. This is the whole "a bad result should feel different" idea, and it
   costs two pseudo elements. */
.wc-result::before{
  content:"";position:absolute;top:0;left:0;right:0;height:3px;
  background:linear-gradient(90deg,transparent,var(--tone),transparent);
  opacity:.9;
}
.wc-result::after{
  content:"";position:absolute;top:-120px;left:-80px;width:420px;height:300px;
  background:radial-gradient(closest-side,var(--tone-glow),transparent 70%);
  opacity:.5;pointer-events:none;
}
.wc-result > *{position:relative;z-index:1}
@media(max-width:600px){ .wc-result{padding:26px 18px;border-radius:18px} }

/* ---- score ring ---- */
.wc-top{display:flex;align-items:center;gap:28px;flex-wrap:wrap}
.wc-dial{position:relative;flex:none;width:136px;height:136px}
.wc-dial svg{width:100%;height:100%;transform:rotate(-90deg)}
.wc-ring-track{fill:none;stroke:rgba(255,255,255,.07);stroke-width:9}
.wc-ring{
  fill:none;stroke:var(--tone);stroke-width:9;stroke-linecap:round;
  filter:drop-shadow(0 0 7px var(--tone-glow));
  /* 2 * pi * r, r = 58 */
  stroke-dasharray:364.4;
  stroke-dashoffset:364.4;
  transition:stroke-dashoffset 1.1s cubic-bezier(.22,1,.36,1);
}
.wc-dial-mid{
  position:absolute;inset:0;display:grid;place-content:center;text-align:center;
}
.wc-dial-num{display:block;font-size:42px;font-weight:800;letter-spacing:-.03em;line-height:1;font-variant-numeric:tabular-nums}
.wc-dial-of{display:block;font-family:var(--mono);font-size:9.5px;letter-spacing:.15em;text-transform:uppercase;color:var(--wc-label);margin-top:7px}

/* Still running: the ring is a short arc that spins, which reads as working
   rather than as a score of nearly nothing. */
.wc-result[data-grade="pending"] .wc-ring{
  stroke-dasharray:70 300;
  stroke-dashoffset:0;
  transition:none;
  transform-origin:50% 50%;
  animation:wc-spin 1.5s linear infinite;
}
@keyframes wc-spin{ to{ transform:rotate(360deg) } }

/* ---- headline ---- */
.wc-top-copy{flex:1;min-width:230px}
.wc-chip{
  display:inline-flex;align-items:center;gap:7px;
  font-family:var(--mono);font-size:11px;letter-spacing:.14em;text-transform:uppercase;
  padding:6px 13px;border-radius:100px;margin-bottom:12px;
  color:var(--tone);border:1px solid currentColor;background:var(--tone-soft);
}
.wc-chip .wc-i{width:13px;height:13px}
.wc-top-copy h1,.wc-top-copy h2{font-size:clamp(23px,3.1vw,31px);margin:0 0 6px;word-break:break-word}
.wc-host{color:var(--mut);font-size:14.5px;display:flex;gap:10px;flex-wrap:wrap;align-items:baseline}
.wc-when{color:var(--wc-label);font-size:13px}
/* The sentence that makes it land. One line, in the verdict's colour. */
.wc-verdict{margin-top:11px;font-size:16.5px;font-weight:700;color:var(--tone);line-height:1.35}

/* ---- the four numbers ---- */
.wc-metrics{
  display:grid;grid-template-columns:repeat(5,1fr);gap:12px;
  margin:28px 0 4px;padding:20px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);
}
@media(max-width:900px){ .wc-metrics{grid-template-columns:repeat(3,1fr);gap:18px} }
@media(max-width:560px){ .wc-metrics{grid-template-columns:repeat(2,1fr);gap:18px} }
/* Each number carries its own verdict, not the card's. A site can be quick and
   still be missing every basic, and showing both in one colour hides that. */
.wc-metric{--m:var(--wc-label);text-align:center}
.wc-metric[data-tone="good"]{--m:var(--wc-good)}
.wc-metric[data-tone="fair"]{--m:var(--wc-warn)}
.wc-metric[data-tone="poor"]{--m:var(--wc-bad)}
.wc-metric-ico{display:block;width:17px;height:17px;margin:0 auto 7px;color:var(--m);opacity:.95}
.wc-metric b{display:block;font-size:23px;font-weight:800;letter-spacing:-.02em;font-variant-numeric:tabular-nums;color:var(--m);line-height:1}
.wc-metric span{display:block;font-family:var(--mono);font-size:10px;letter-spacing:.11em;text-transform:uppercase;color:var(--wc-label);margin-top:6px}
.wc-metric i{display:block;height:3px;border-radius:100px;background:rgba(255,255,255,.07);margin:9px auto 0;max-width:74px;overflow:hidden}
.wc-metric i::after{content:"";display:block;height:100%;width:var(--fill,0%);border-radius:100px;background:var(--m);transition:width .9s cubic-bezier(.22,1,.36,1)}

/* ---- how old it looks ---------------------------------------------------
   The moment of the whole report. A speed score is abstract; "your site looks
   like 2006" is something an owner can feel, and the timeline shows them the
   gap rather than asserting it. Only rendered when we can point at the
   evidence, never on a hunch. */
.wc-era{
  margin:26px 0 0;padding:22px 22px 16px;border-radius:16px;
  background:
    radial-gradient(120% 140% at 0% 0%, var(--tone-soft), transparent 62%),
    rgba(255,255,255,.02);
  border:1px solid rgba(255,255,255,.07);
}
.wc-era-kicker{display:block;font-family:var(--mono);font-size:10.5px;letter-spacing:.15em;text-transform:uppercase;color:var(--wc-label);margin-bottom:8px}
.wc-era h3{font-size:clamp(20px,2.7vw,27px);margin:0 0 6px;line-height:1.2}
.wc-era h3 b{color:var(--tone)}
.wc-era p{color:var(--mut);font-size:14.5px;margin:0 0 6px}
.wc-era-line{display:block;width:100%;height:auto;margin-top:6px;overflow:visible}
.wc-era-track{stroke:rgba(255,255,255,.10);stroke-width:3;stroke-linecap:round}
/* The distance between the site's era and today, drawn rather than described. */
.wc-era-gap{stroke:var(--tone);stroke-width:3;stroke-linecap:round;opacity:.85;
  stroke-dasharray:var(--gap);stroke-dashoffset:var(--gap);
  animation:wc-draw 1.1s cubic-bezier(.22,1,.36,1) .15s forwards}
@keyframes wc-draw{ to{ stroke-dashoffset:0 } }
.wc-era-tick{stroke:rgba(255,255,255,.14);stroke-width:1.5}
.wc-era-label{fill:var(--wc-label);font-family:var(--mono);font-size:9.5px;letter-spacing:.08em}
.wc-era-now{fill:var(--acc)}
.wc-era-pin{fill:var(--tone);filter:drop-shadow(0 0 6px var(--tone-glow))}
.wc-era-pin-ring{fill:none;stroke:var(--tone);stroke-width:2;opacity:.45;
  transform-origin:center;animation:wc-pulse 2.4s ease-out infinite}
@keyframes wc-pulse{0%{r:9;opacity:.5}70%{r:19;opacity:0}100%{r:19;opacity:0}}
.wc-era-year{fill:var(--tone);font-family:var(--mono);font-size:12px;font-weight:600}
.wc-era-sigs{display:flex;flex-wrap:wrap;gap:7px;margin-top:14px}
.wc-era-sig{
  display:inline-flex;align-items:center;gap:6px;
  font-size:12.5px;padding:6px 11px;border-radius:100px;
  background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.07);color:var(--mut);
}
.wc-era-sig .wc-i{width:12px;height:12px}
.wc-era-sig[data-level="bad"]{color:var(--wc-bad);border-color:rgba(255,138,138,.26);background:rgba(255,138,138,.07)}
.wc-era-sig[data-level="warn"]{color:var(--wc-warn);border-color:rgba(255,194,102,.24);background:rgba(255,194,102,.06)}
@media(max-width:600px){ .wc-era{padding:18px 15px 14px} }

/* ---- findings ---- */
.wc-h2{font-size:13px;letter-spacing:.14em;text-transform:uppercase;color:var(--wc-label);font-weight:700;margin:30px 0 14px}
.wc-findings{list-style:none;display:flex;flex-direction:column;gap:10px;margin:0;padding:0}
.wc-finding{
  --f:var(--wc-label);--fs:rgba(255,255,255,.03);
  display:flex;gap:13px;align-items:flex-start;
  padding:13px 15px;border-radius:13px;
  background:var(--fs);border:1px solid rgba(255,255,255,.05);
  border-left:3px solid var(--f);
}
.wc-finding[data-level="bad"]  {--f:var(--wc-bad); --fs:rgba(255,138,138,.07)}
.wc-finding[data-level="warn"] {--f:var(--wc-warn);--fs:rgba(255,194,102,.06)}
.wc-finding[data-level="good"] {--f:var(--wc-good);--fs:rgba(46,230,166,.06)}
.wc-finding[data-level="info"] {--f:var(--acc);    --fs:rgba(68,215,255,.05)}
.wc-finding b{display:block;font-size:16px;font-weight:700;margin-bottom:3px}
.wc-finding p{color:var(--mut);font-size:14.5px;line-height:1.55;margin:0}
.wc-ico{
  flex:none;width:24px;height:24px;border-radius:50%;margin-top:1px;
  display:grid;place-items:center;color:var(--f);
  background:color-mix(in srgb,var(--f) 16%,transparent);
}
.wc-ico .wc-i{width:14px;height:14px}
/* color-mix is widely supported now, but a browser without it must still show
   a readable badge rather than a transparent hole. */
@supports not (background:color-mix(in srgb,red 10%,transparent)){
  .wc-ico{background:rgba(255,255,255,.08)}
}

/* ---- the basics checklist ---- */
.wc-basics{list-style:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 14px;margin:0;padding:0}
@media(max-width:560px){ .wc-basics{grid-template-columns:1fr} }
.wc-basics li{
  display:flex;align-items:center;gap:10px;font-size:14.5px;
  padding:9px 13px;border-radius:10px;border:1px solid rgba(255,255,255,.05);
}
.wc-basics li.ok{color:var(--txt);background:rgba(46,230,166,.05)}
.wc-basics li.no{color:var(--txt);background:rgba(255,138,138,.07);border-color:rgba(255,138,138,.16)}
.wc-tick{flex:none;width:21px;height:21px;border-radius:50%;display:grid;place-items:center}
.wc-tick .wc-i{width:11px;height:11px}
.wc-basics li.ok .wc-tick{background:rgba(46,230,166,.16);color:var(--wc-good)}
.wc-basics li.no .wc-tick{background:rgba(255,138,138,.16);color:var(--wc-bad)}
/* Colour and a glyph are not enough on their own, so the state is also spoken. */
.wc-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* ---- AI visibility (feature flagged, usually absent) ---- */
.wc-ai{margin-top:26px;padding:16px 18px;border:1px solid var(--line);border-radius:14px;background:rgba(255,255,255,.02)}
.wc-ai b{display:block;font-size:15px;margin-bottom:6px}
.wc-ai-verdict{display:inline-block;font-family:var(--mono);font-size:12px;letter-spacing:.14em;text-transform:uppercase;padding:4px 10px;border-radius:100px;border:1px solid currentColor}
.wc-ai[data-verdict="yes"] .wc-ai-verdict{color:var(--wc-good)}
.wc-ai[data-verdict="maybe"] .wc-ai-verdict{color:var(--wc-warn)}
.wc-ai[data-verdict="no"] .wc-ai-verdict{color:var(--wc-bad)}
.wc-ai[data-verdict="unknown"] .wc-ai-verdict{color:var(--wc-label)}
.wc-ai p{color:var(--mut);font-size:14px;margin-top:9px}

/* ---- the ask ---- */
.wc-cta{
  margin-top:30px;padding:26px 22px;border-radius:16px;text-align:center;
  background:var(--tone-soft);border:1px solid color-mix(in srgb,var(--tone) 26%,transparent);
}
@supports not (border-color:color-mix(in srgb,red 10%,transparent)){
  .wc-cta{border-color:var(--line2)}
}
.wc-cta h2,.wc-cta h3{font-size:clamp(21px,2.6vw,27px);margin:0 0 8px}
.wc-cta p{color:var(--mut);font-size:15.5px;margin-bottom:18px}
.wc-cta .btn{margin:0 5px 10px}

/* ---- share link ---- */
.wc-share{margin-top:18px;display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;font-size:13.5px;color:var(--wc-label)}
.wc-share a{color:var(--acc);text-decoration:underline;text-underline-offset:3px;word-break:break-all}

/* A number we are still waiting for. Not "n/a": nothing has failed yet. */
.wc-wait{letter-spacing:.14em;color:var(--wc-label);animation:wc-breathe 1.4s ease-in-out infinite}
@keyframes wc-breathe{0%,100%{opacity:1}50%{opacity:.5}}


/* ---- icons -------------------------------------------------------------
   Defined ONCE, here, as CSS masks rather than as inline SVG in the markup.
   There are two renderers for this card (the landing page builds it in JS,
   /check/<id> builds it in Astro) and anything written twice eventually says
   two different things. A mask takes its colour from `currentColor`, so each
   icon still turns red, amber or green with whatever it sits inside. */
.wc-i{
  display:inline-block;background-color:currentColor;
  -webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;
  -webkit-mask-position:center;mask-position:center;
  -webkit-mask-size:contain;mask-size:contain;
}

.wc-i-bolt{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M13 2 4 14h7l-1 8 9-12h-7z'/></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M13 2 4 14h7l-1 8 9-12h-7z'/></svg>")}
.wc-i-clock{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 7v5l3.5 2'/></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 7v5l3.5 2'/></svg>")}
.wc-i-eye{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7-10-7-10-7z'/><circle cx='12' cy='12' r='3'/></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7-10-7-10-7z'/><circle cx='12' cy='12' r='3'/></svg>")}
.wc-i-list{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 7h10M4 12h10M4 17h6'/><path d='M16.5 16.5 18 18l3.5-3.5'/></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 7h10M4 12h10M4 17h6'/><path d='M16.5 16.5 18 18l3.5-3.5'/></svg>")}
.wc-i-warn{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3.5 2.5 20h19z'/><path d='M12 10v4M12 17.5h.01'/></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3.5 2.5 20h19z'/><path d='M12 10v4M12 17.5h.01'/></svg>")}
.wc-i-alert{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 7.5v5M12 16h.01'/></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 7.5v5M12 16h.01'/></svg>")}
.wc-i-check{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4.5 12.5 9.5 17.5 19.5 6.5'/></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4.5 12.5 9.5 17.5 19.5 6.5'/></svg>")}
.wc-i-cross{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 6l12 12M18 6 6 18'/></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 6l12 12M18 6 6 18'/></svg>")}
.wc-i-info{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 11v5.5M12 8h.01'/></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 11v5.5M12 8h.01'/></svg>")}
.wc-i-shield{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2.5 4 6v6c0 5 3.4 8.3 8 9.5 4.6-1.2 8-4.5 8-9.5V6z'/><path d='M9 12l2 2 4-4'/></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2.5 4 6v6c0 5 3.4 8.3 8 9.5 4.6-1.2 8-4.5 8-9.5V6z'/><path d='M9 12l2 2 4-4'/></svg>")}

/* A browser with no mask support must not show a blank square where a status
   icon should be, so the shape falls back to a plain dot of the same colour. */
@supports not ((-webkit-mask-image:url("")) or (mask-image:url(""))){
  .wc-i{border-radius:50%;background-color:currentColor;width:9px;height:9px}
}

@media(prefers-reduced-motion:reduce){
  .wc-ring,.wc-metric i::after{transition:none}
  .wc-result[data-grade="pending"] .wc-ring,.wc-wait,.wc-era-pin-ring{animation:none}
  .wc-era-gap{animation:none;stroke-dashoffset:0}
}
