/* The WordPress check (/wordpress-check), on top of styles.css: its tokens, buttons, header,
   footer, struck list (.problem) and closing band are the site's own. Severity is told with the
   pen's dots: filled vermilion for critical, a vermilion ring for high, a highlighter dot for
   medium, faded ink for low, a dashed ring for info. */

.wpc-lead { margin-top: 24px; font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem); line-height: 1.55; color: var(--ink-soft); max-width: 600px; }
.muted { color: var(--ink-soft); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@keyframes wpc-slide { from { transform: translateY(18px); } }
@keyframes wpc-rise { from { opacity: 0; transform: translateY(18px); } }

/* ---------- start page ---------- */

main > .wpc-hero { padding-top: clamp(56px, 8vw, 120px); padding-bottom: clamp(72px, 9vw, 128px); }
.wpc-hero h1 { font-size: clamp(3rem, 1.4rem + 4.6vw, 5.6rem); line-height: 0.96; letter-spacing: -0.025em; max-width: 13ch; }
.wpc-hero h1 em { animation: marker 1.1s 0.4s var(--ease) both; }
.wpc-hero .wpc-lead { max-width: 580px; animation: wpc-slide 0.9s var(--ease) both; }
.wpc-hero .scanner { margin-top: 40px; animation: wpc-slide 0.9s 0.08s var(--ease) both; }
.wpc-hero__notes { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 0.9375rem; color: var(--ink-soft); }
.wpc-hero__notes li { display: flex; align-items: center; gap: 8px; }
.wpc-hero__notes li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.scanner { max-width: 720px; }
.scan-form__field { display: flex; gap: 8px; padding: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; transition: border-color 0.2s; }
.scan-form__field:focus-within { border-color: var(--ink); }
.scan-form input { flex: 1; min-width: 0; padding: 0 18px; border: 0; background: none; color: var(--ink); font: 400 1.125rem var(--sans); outline: none; }
.scan-form input::placeholder { color: var(--ink-soft); opacity: 0.7; }
.scan-form .button { border: 0; cursor: pointer; font: 500 1rem/1.2 var(--sans); white-space: nowrap; }
.scan-form__error { margin-top: 14px; color: var(--accent-deep); font-weight: 500; }

/* The progress: steps tick off one by one, found plugins drop in below */
.progress { padding: clamp(24px, 3vw, 32px); background: var(--ink); color: var(--on-ink); border-radius: 28px; }
.progress__title { font-family: var(--serif); font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem); line-height: 1.1; overflow-wrap: anywhere; }
.progress__host { font-style: italic; }
.progress__steps { list-style: none; margin: 22px 0 0; padding: 0; }
.progress__steps li { display: flex; align-items: center; gap: 14px; padding: 9px 0; border-top: 1px solid var(--line-ink); color: var(--on-ink-soft); transition: color 0.3s; }
.progress__steps li.is-run, .progress__steps li.is-done { color: var(--on-ink); }
.progress__steps li.is-skip { opacity: 0.4; }
.progress__mark { position: relative; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-ink); }
.is-run .progress__mark { border-color: var(--marker); border-right-color: transparent; animation: wpc-spin 0.8s linear infinite; }
.is-done .progress__mark { border-color: var(--marker); background: var(--marker); }
.is-done .progress__mark::after { content: ''; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid var(--ink); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.is-fail .progress__mark { border-color: var(--accent); background: var(--accent); }
@keyframes wpc-spin { to { transform: rotate(360deg); } }
.progress__detail { margin-left: auto; font-size: 0.875rem; color: var(--on-ink-soft); text-align: right; }
.progress__found { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.progress__found:empty { display: none; }
.progress__found li { padding: 6px 12px; border-radius: 999px; background: var(--ink-2); font-size: 0.875rem; animation: wpc-pop 0.45s var(--ease) both; }
.progress__found li span { color: var(--on-ink-soft); }
@keyframes wpc-pop { from { opacity: 0; transform: translateY(6px) scale(0.94); } }

main > .wpc-checks { padding-bottom: var(--section); display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(40px, 6vw, 96px); }
.wpc-checks__head { position: sticky; top: 120px; align-self: start; }
.wpc-checks__list { margin: 0; border-top: 1.5px solid var(--ink); }
.wpc-checks__list div { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 8px 32px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.wpc-checks__list dt { font-family: var(--serif); font-size: 1.5rem; line-height: 1.15; display: flex; gap: 14px; align-items: baseline; }
.wpc-checks__n { font-style: italic; color: var(--accent); }
.wpc-checks__list dd { margin: 0; color: var(--ink-soft); }
.wpc-checks + .problem { padding-top: 0 !important; }

/* ---------- report ---------- */

main > .report-head { padding-top: clamp(48px, 6vw, 88px); }
.report-head__kicker { font-size: 1.0625rem; color: var(--ink-soft); }
.report-head h1 { margin-top: 6px; font-size: clamp(2.6rem, 1.2rem + 5vw, 5.25rem); line-height: 0.98; letter-spacing: -0.025em; overflow-wrap: anywhere; }
.report-head h1 em { animation: marker 1.1s 0.3s var(--ease) both; }
.report-head__meta { margin-top: 18px; color: var(--ink-soft); }
.report-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 28px; }
.report-head__actions button.link { padding: 0; border: 0; background: none; color: inherit; font: 500 1rem var(--sans); cursor: pointer; }

/* The grade, marked like a paper: an ink letter, circled by hand with the vermilion pen */
main > .summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: center; margin-top: clamp(40px, 5vw, 72px); }
.grade { display: grid; justify-items: center; gap: 4px; }
.grade__mark { position: relative; display: grid; place-items: center; width: clamp(170px, 18vw, 220px); aspect-ratio: 10 / 9; }
.grade__letter { font-family: var(--serif); font-style: italic; font-size: clamp(7rem, 5rem + 5vw, 9.5rem); line-height: 1; color: var(--ink); transform: translate(-0.04em, 0.04em); }
.grade__circle { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.grade__circle path { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 100; animation: wpc-pen 1.1s 0.35s cubic-bezier(0.6, 0, 0.3, 1) both; }
@keyframes wpc-pen { from { stroke-dashoffset: 100; } }
.grade__score { font-size: 0.9375rem; color: var(--ink-soft); }
.grade__score b { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; color: var(--ink); }
.summary__verdict { font-family: var(--serif); font-size: clamp(1.8rem, 1.3rem + 2vw, 3rem); line-height: 1.08; max-width: 20ch; }
.counts { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 32px; }
.counts__item { display: flex; align-items: baseline; gap: 10px; }
.counts__item b { font-family: var(--serif); font-weight: 400; font-size: 2.2rem; line-height: 1; }
.counts__item.is-zero { opacity: 0.45; }
.summary__note { margin-top: 20px; padding: 14px 18px; border-radius: 14px; background: var(--paper-2); color: var(--ink-soft); font-size: 0.9375rem; max-width: 620px; }

.sev { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 500; color: var(--ink-soft); white-space: nowrap; }
.sev__dot { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ink-soft); }
.sev--critical, .sev--high { color: var(--accent-deep); }
.sev--critical .sev__dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px oklch(62% 0.2 34 / 0.18); }
.sev--high .sev__dot { border: 2.5px solid var(--accent); }
.sev--medium .sev__dot { background: var(--marker); border-color: oklch(75% 0.14 90); }
.sev--low .sev__dot { background: var(--ink-soft); width: 7px; height: 7px; margin: 0 1.5px; }
.sev--info .sev__dot { border-style: dashed; }

main > .first { margin-top: var(--section); display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(40px, 6vw, 96px); }
.first__head { position: sticky; top: 120px; align-self: start; }
.findings { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.findings:empty { display: none; }
.finding { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 20px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.finding .sev { padding-top: 5px; }
.finding h3 { font-size: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem); line-height: 1.15; }
.finding h3 a { text-decoration: none; }
.finding h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.finding p { margin-top: 8px; color: var(--ink-soft); }
.finding .finding__fix { color: var(--ink); font-weight: 500; }
.finding__fix span { color: var(--accent); }

main > .parts { margin-top: var(--section); display: grid; gap: clamp(64px, 8vw, 112px); padding-bottom: var(--section); }
.part { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 12px clamp(40px, 6vw, 96px); align-items: start; }
.part__title { grid-column: 1; font-size: clamp(2rem, 1.4rem + 2.2vw, 3.2rem); line-height: 1.02; }
.part__note { grid-column: 1; grid-row: 2; color: var(--ink-soft); font-size: 0.9375rem; max-width: 40ch; }
.part > :not(.part__title):not(.part__note) { grid-column: 2; grid-row: 1 / span 3; }
.part__empty { padding: 20px 0; border-top: 1.5px solid var(--ink); color: var(--ink-soft); }

.components { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.component { position: relative; padding: 22px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 110px; }
.component__row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) auto; gap: 12px 24px; align-items: start; }
.component__name h3 { font-size: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem); line-height: 1.15; overflow-wrap: anywhere; }
.component__name h3 span { padding: 0 0.06em; margin: 0 -0.06em; box-decoration-break: clone; -webkit-box-decoration-break: clone; background: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 92%, transparent 92%) no-repeat 0 0 / 0% 100%; }
.component__name p { margin-top: 4px; font-size: 0.875rem; overflow-wrap: anywhere; }
/* Arriving from "do these first": the name gets the highlighter and the pen draws a line down the
   margin, the two marks you'd make on a page */
.component:target .component__name h3 span { background-size: 100% 100%; transition: background-size 0.9s 0.15s var(--ease); }
.component::before { content: ''; position: absolute; left: calc(-1 * min(var(--gutter), 28px) + 4px); top: 22px; bottom: 22px; width: 2px; border-radius: 2px; background: var(--accent); transform: scaleY(0); transform-origin: top; }
.component:target::before { transform: scaleY(1); transition: transform 0.7s 0.1s var(--ease); }
.component__facts { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 24px; }
.component__facts dt { font-size: 0.8125rem; color: var(--ink-soft); }
.component__facts dd { margin: 0; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.component__radar { margin-top: 14px; padding: 12px 16px; border-radius: 14px; background: var(--paper-2); font-size: 0.9375rem; color: var(--ink-soft); }
.component__radar b { color: var(--ink); font-weight: 500; }

.status { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 500; white-space: nowrap; color: var(--ink-soft); }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; }
.status--bad { color: var(--accent-deep); }
.status--bad::before { background: var(--accent); border-color: var(--accent); }
.status--warn, .status--ok { color: var(--ink); }
.status--warn::before { background: var(--marker); border-color: oklch(75% 0.14 90); }
.status--ok::before { border: 0; width: 9px; height: 5px; border-radius: 0; border-left: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: rotate(-45deg) translateY(-2px); }

.vulns { margin-top: 18px; padding: 18px 20px 6px; border-radius: 18px; background: var(--paper-2); }
.vulns--possible { background: none; border: 1.5px dashed var(--line); }
.vulns__title { font-weight: 500; }
.vulns__note { margin-top: 4px; font-size: 0.875rem; color: var(--ink-soft); }
.vulns ul { list-style: none; margin: 10px 0 0; padding: 0; }
.vuln { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 4px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.vuln .sev { padding-top: 2px; font-size: 0.8125rem; }
.vuln__title { font-size: 0.9375rem; line-height: 1.45; overflow-wrap: anywhere; }
.vuln__title a { text-decoration: none; }
.vuln__title a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.vuln__meta { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.8125rem; color: var(--ink-soft); }
.vuln__meta a { color: inherit; text-underline-offset: 3px; }
.vuln__kev { color: var(--accent-deep); font-weight: 600; }
.vuln__nofix { color: var(--accent-deep); font-weight: 500; }
.vulns details { border-top: 1px solid var(--line); }
.vulns summary { padding: 12px 0; font-size: 0.9375rem; font-weight: 500; cursor: pointer; list-style: none; }
.vulns summary::-webkit-details-marker { display: none; }
.vulns summary::before { content: '+'; display: inline-block; width: 1.2em; color: var(--accent); transition: transform 0.3s var(--ease); }
.vulns details[open] summary::before { transform: rotate(45deg); }
.vulns details ul { margin-top: 0; }

.checklist { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.check { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.check__mark { position: relative; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--ink-soft); }
.check--ok .check__mark { background: var(--ink); border-color: var(--ink); }
.check--ok .check__mark::after { content: ''; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid var(--on-ink); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.check--bad .check__mark { border-color: var(--accent); }
.check--bad .check__mark::after { content: ''; position: absolute; left: 3px; right: 3px; top: 7px; height: 1.5px; background: var(--accent); }
.check__value { margin-left: auto; font-size: 0.875rem; color: var(--ink-soft); }
.check--bad .check__value { color: var(--accent-deep); font-weight: 500; }

main > .report-foot { padding-bottom: var(--section); display: grid; gap: 6px; font-size: 0.875rem; color: var(--ink-soft); }
.report-foot a { text-underline-offset: 3px; }

main > .notice { padding-top: clamp(48px, 6vw, 80px); padding-bottom: var(--section); }
.notice h2 { font-size: clamp(2.4rem, 1.2rem + 4vw, 4.6rem); }
.notice .scanner { margin-top: 36px; }

@supports (animation-timeline: view()) {
  .wpc-checks__list div, .findings > li, .part { animation: wpc-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 45%; }
}

/* ---------- smaller screens ---------- */

@media (max-width: 900px) {
  main > .wpc-checks, main > .first, .part { grid-template-columns: minmax(0, 1fr); }
  .wpc-checks__head, .first__head { position: static; }
  .part > :not(.part__title):not(.part__note) { grid-column: 1; grid-row: auto; }
  .part__note { grid-row: auto; }
}
@media (max-width: 720px) {
  .scan-form__field { flex-direction: column; border-radius: 22px; }
  .scan-form input { padding: 12px 14px; }
  main > .summary { grid-template-columns: minmax(0, 1fr); }
  .grade { justify-self: start; justify-items: start; }
  .wpc-checks__list div, .component__row, .finding, .vuln { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .wpc-hero *, .report-head *, .summary *, .component, .component *, .progress * { animation: none !important; transition: none !important; }
  .is-run .progress__mark { border-right-color: var(--marker); }
}

/* ---------- print: the report as a clean document ---------- */

/* Everything in its finished state (scroll-driven reveals would print invisible), one column, no
   section-sized gaps, and only small things kept from splitting across pages */
@page { margin: 16mm 14mm; }
@media print {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  body { background: none !important; font-size: 10pt; }
  .top, .closing, .foot, .report-head__actions, .scanner, .consent, .book, .dots, .skip { display: none !important; }
  main > section { max-width: none; padding: 0 !important; margin: 0 !important; }
  main > .report-head h1 { font-size: 28pt; }
  main > .summary { margin-top: 8mm !important; grid-template-columns: auto minmax(0, 1fr); gap: 10mm; }
  .grade__mark { width: 38mm; }
  .grade__letter { font-size: 60pt; }
  .summary__verdict { font-size: 18pt; }
  main > .first, .part { display: block; margin-top: 10mm !important; }
  .first__head, .part__title { position: static; margin-bottom: 4mm; }
  .first__head h2, .part__title { font-size: 18pt; }
  .first__head .wpc-lead, .part__note { margin: 0 0 3mm; font-size: 9pt; }
  main > .parts { display: block; }
  .finding, .vuln, .component__row, .check, .component__radar { break-inside: avoid; }
  .part__title, .vulns__title { break-after: avoid; }
  .component::before, .vulns summary { display: none; }
  .vulns details { border-top: 0; }
  .vulns { background: none; border: 1px solid var(--line); }
  main > .report-foot { margin-top: 10mm !important; }
  a { text-decoration: none; }
}
