/* snag.page's one stylesheet, served as a static asset (wrangler.jsonc,
   "assets") and allowed by style-src 'self' in every page's CSP.

   Every colour is a token with a light and a dark value; ratings use the
   three web.dev colours, softened for backgrounds with color-mix(). */
:root {
  color-scheme: light dark;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #15161a;
  --muted: #61656d;
  --faint: #8d9199;
  --border: #e4e4e0;
  --track: #ececea;
  --focus: #2f6bff;
  --good: #0a8754;
  --ni: #c27400;
  --poor: #d23a2f;
  --shadow: 0 1px 2px rgb(20 20 30 / 0.04), 0 8px 24px rgb(20 20 30 / 0.05);
  /* Squircle corners (corner-shape below) look squarer than round ones of the
     same radius, so these are a little larger; browsers without
     corner-shape draw them round. */
  --radius: 12px;
  --radius-sm: 9px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e10;
    --surface: #16181b;
    --text: #ececee;
    --muted: #a0a4ac;
    --faint: #6f737b;
    --border: #25282d;
    --track: #22252a;
    --focus: #7ea0ff;
    --good: #3cc888;
    --ni: #f2a93b;
    --poor: #ff6f61;
    --shadow: none;
  }
}
*, *::before, *::after { box-sizing: border-box; corner-shape: squircle; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration-color: var(--faint); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }
main { flex: 1; }

/* Top bar */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-top: 18px; padding-bottom: 18px; }
.mark { font-weight: 750; font-size: 1.25rem; letter-spacing: -0.03em; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.mark .tld { color: var(--faint); font-weight: 600; }
.mark svg { width: 22px; height: 22px; }
.mark rect { fill: var(--text); }
.mark path { fill: none; stroke: var(--bg); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.bar .search { margin-left: auto; flex: 1 1 260px; max-width: 360px; }

/* Search */
.search { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; box-shadow: var(--shadow); }
.search:focus-within { border-color: var(--focus); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; padding: 8px 14px; outline: none; }
.search input::placeholder { color: var(--faint); }
.search button { border: 0; border-radius: var(--radius-sm); background: var(--text); color: var(--bg); font: inherit; font-weight: 600; padding: 8px 18px; cursor: pointer; }
.search button:hover { opacity: 0.88; }
.search.big { padding: 7px; }
.search.big input { font-size: 1.125rem; padding: 12px 18px; }
.search.big button { font-size: 1.0625rem; padding: 12px 24px; }

/* Home */
.hero { min-height: 68vh; display: flex; flex-direction: column; justify-content: center; padding: 48px 0 32px; max-width: 640px; margin: 0 auto; text-align: center; }
.hero h1 { font-size: clamp(2.5rem, 7vw, 4.25rem); line-height: 1.02; letter-spacing: -0.045em; font-weight: 750; margin: 0 0 16px; }
.hero p { color: var(--muted); font-size: 1.125rem; margin: 0 auto 32px; max-width: 30em; }
.try { margin-top: 18px; color: var(--faint); font-size: 0.9375rem; }
.try a { color: var(--muted); margin: 0 4px; }
.error { color: var(--poor); margin: 14px 0 0; font-size: 0.9375rem; }
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 0 0 64px; }
.point { padding: 4px 0; }
.point h2 { font-size: 1rem; margin: 0 0 4px; letter-spacing: -0.01em; }
.point p { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.soon { font-size: 0.75rem; font-weight: 600; color: var(--faint); border: 1px solid var(--border); border-radius: 6px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; }

/* Report */
.head { padding: 28px 0 8px; }
.head h1 { font-size: clamp(1.9rem, 5vw, 2.75rem); line-height: 1.1; letter-spacing: -0.035em; font-weight: 750; margin: 0 0 6px; overflow-wrap: anywhere; }
.meta { color: var(--muted); margin: 0; font-size: 0.9375rem; }
.section { margin: 36px 0 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section h2 { font-size: 1.125rem; letter-spacing: -0.015em; margin: 0; }
.note { color: var(--faint); font-size: 0.875rem; margin: 14px 0 0; }

/* Phone and desktop, switched by two radios so it works without script */
.seg { display: inline-flex; background: var(--track); border-radius: var(--radius-sm); padding: 3px; position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg label { padding: 5px 14px; border-radius: 6px; font-size: 0.875rem; font-weight: 550; color: var(--muted); cursor: pointer; }
.seg input:checked + label { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 1px; }
.speed:has(#ff-desktop:checked) [data-ff="phone"],
.speed:has(#ff-phone:checked) [data-ff="desktop"] { display: none; }

.verdict { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.9375rem; border-radius: var(--radius-sm); padding: 6px 14px; margin-bottom: 14px; }
.verdict.pass { background: color-mix(in srgb, var(--good) 13%, transparent); color: var(--good); }
.verdict.fail { background: color-mix(in srgb, var(--poor) 12%, transparent); color: var(--poor); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.cards + .cards { margin-top: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card h3 { margin: 0; font-size: 0.9375rem; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.card h3 abbr { text-decoration: none; color: var(--faint); font-weight: 500; }
.value { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin: 10px 0 2px; font-variant-numeric: tabular-nums; }
.card.small .value { font-size: 1.625rem; }
.rating { font-size: 0.875rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.rating::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.good { color: var(--good); }
.needs_improvement { color: var(--ni); }
.poor { color: var(--poor); }
.dist { display: block; width: 100%; height: 6px; margin: 14px 0 6px; border-radius: 2px; overflow: hidden; background: var(--track); }
.dist .g { fill: var(--good); }
.dist .n { fill: var(--ni); }
.dist .p { fill: var(--poor); }
.legend { display: flex; justify-content: space-between; color: var(--faint); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.empty { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 22px 20px; color: var(--muted); }
.empty strong { color: var(--text); display: block; margin-bottom: 2px; }

/* Security: the summary, what to fix, and every check */
.summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 20px 0 0; padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.headline { margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; }
.summary.clear .headline { color: var(--good); }
.counts { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; font-size: 0.8125rem; font-weight: 600; border-radius: 6px; padding: 3px 9px; white-space: nowrap; }
.chip.sev-critical, .chip.sev-high { background: color-mix(in srgb, var(--poor) 13%, transparent); color: var(--poor); }
.chip.sev-medium { background: color-mix(in srgb, var(--ni) 15%, transparent); color: var(--ni); }
.chip.sev-low { background: var(--track); color: var(--muted); }
.chip.sev-info { background: var(--track); color: var(--faint); }
.chip.ok { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good); }

.todos { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.todo { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); scroll-margin-top: 16px; }
.todo:target { border-color: var(--focus); }
.todo-head { display: flex; align-items: center; gap: 12px; }
.todo-head h3 { margin: 0; font-size: 1.0625rem; letter-spacing: -0.01em; flex: 1; }
.n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--track); color: var(--muted); font-size: 0.8125rem; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.todo-detail { margin: 8px 0 0 38px; color: var(--muted); font-size: 0.9375rem; }
.facet { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); margin-right: 6px; }
.steps { margin: 12px 0 0 38px; padding-left: 1.2em; font-size: 0.9375rem; }
.steps li { margin: 4px 0; padding-left: 2px; }
.steps li::marker { color: var(--faint); font-variant-numeric: tabular-nums; }
.snippet { margin: 12px 0 0 38px; }
.snippet figcaption { font-size: 0.75rem; font-weight: 600; color: var(--faint); margin-bottom: 4px; }
pre { margin: 0; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; overflow-x: auto; font: 0.8125rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.evidence pre { color: var(--muted); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.875em; }
@media (max-width: 560px) {
  .todo-head { flex-wrap: wrap; }
  .todo-detail, .steps, .snippet { margin-left: 0; }
}

.all > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.all > summary::-webkit-details-marker { display: none; }
.all > summary h2 { display: inline; }
.all > summary span { color: var(--faint); font-size: 0.875rem; }
.all > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg); margin: -4px 0 0 2px; }
.all[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 14px; }
.group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.group h3 { margin: 0 0 8px; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 18px 1fr; column-gap: 8px; padding: 6px 0; font-size: 0.9375rem; border-top: 1px solid var(--border); }
.checks li:first-child { border-top: 0; }
.check-detail { grid-column: 2; color: var(--faint); font-size: 0.8125rem; overflow-wrap: anywhere; }
.status { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; }
.status.pass { width: 12px; height: 7px; border-radius: 0; border-left: 2px solid var(--good); border-bottom: 2px solid var(--good); transform: rotate(-45deg); margin: 6px 0 0 1px; }
.status.sev-critical, .status.sev-high { background: var(--poor); }
.status.sev-medium { background: var(--ni); }
.status.sev-low { background: var(--faint); }
.status.sev-info { background: transparent; border: 2px solid var(--faint); }

/* Owners: the banner, the withheld findings and the key form */
.banner { margin: 16px 0 0; padding: 12px 16px; border-radius: var(--radius); background: var(--track); color: var(--muted); font-size: 0.9375rem; }
.banner.owner { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--text); }
.banner code { font-size: 0.8125rem; }
.owner-only { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 18px 20px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--poor) 35%, var(--border)); background: color-mix(in srgb, var(--poor) 6%, var(--surface)); }
.owner-only-text { flex: 1 1 320px; }
.owner-only h2 { margin: 0 0 4px; font-size: 1.0625rem; }
.owner-only p { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.key-form { display: flex; gap: 6px; flex: 0 1 340px; }
.key-form input[type="password"] { flex: 1; min-width: 0; font: inherit; font-size: 0.9375rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; }
.key-form input[type="password"]:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.key-form button { border: 0; border-radius: var(--radius-sm); background: var(--text); color: var(--bg); font: inherit; font-size: 0.9375rem; font-weight: 600; padding: 8px 16px; cursor: pointer; white-space: nowrap; }
.snippet .key-form { max-width: 460px; }

/* Check pages */
.eyebrow { margin: 0 0 6px; color: var(--faint); font-size: 0.875rem; }
.article { max-width: 720px; }
.article h2 { margin: 28px 0 6px; }
.article h2:first-child { margin-top: 0; }
.article p { margin: 0; color: var(--muted); }
.article .steps, .article .snippet { margin-left: 0; }
.jumps { margin: 24px 0 0; display: grid; gap: 8px; }
.jump { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-size: 0.9375rem; }
.jump span { color: var(--faint); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; min-width: 140px; }
.jump a { color: var(--muted); }
.area { display: grid; grid-template-columns: 200px 1fr; gap: 8px 32px; padding: 20px 0; border-top: 1px solid var(--border); scroll-margin-top: 16px; }
.area:target .area-label h3 { color: var(--focus); }
.area-label h3 { margin: 0; font-size: 1rem; letter-spacing: -0.01em; }
.area-label span { color: var(--faint); font-size: 0.8125rem; }
.area-checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 32px; }
.area-checks a { font-weight: 600; text-decoration: none; }
.area-checks a:hover { text-decoration: underline; }
.area-checks p { margin: 2px 0 0; color: var(--muted); font-size: 0.875rem; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .area { grid-template-columns: 1fr; }
  .jump span { min-width: 0; width: 100%; }
}
.about { margin: 12px 0 0 38px; font-size: 0.875rem; }
.about a { color: var(--muted); }
@media (max-width: 560px) { .about { margin-left: 0; } }

footer { border-top: 1px solid var(--border); margin-top: 72px; padding: 22px 0 28px; color: var(--faint); font-size: 0.875rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 6px 18px; }
footer a { color: var(--muted); }

/* A finding on its own page, under the page's heading rather than a number. */
.single .todo-detail { margin-top: 0; }
.single .todo-head + .todo-detail { margin-top: 8px; }
.single .todo-detail, .single .steps, .single .snippet { margin-left: 0; }
.todo-head h3 a { color: inherit; text-decoration: none; }
.todo-head h3 a:hover { text-decoration: underline; }
