/* The website check on /check: page layout plus the self-contained checker component (.sc).
   Needs site.css for tokens, buttons, .field-pill, .dot, and .mono. */

.check-hero { position: relative; padding-block: clamp(40px, 7vw, 96px) 36px; overflow: clip; isolation: isolate; }
.check-hero::before {
  content: ""; position: absolute; z-index: -1; right: -12%; top: -40%; width: 1000px; height: 900px;
  background: radial-gradient(closest-side, rgba(4, 186, 222, 0.18), transparent 70%);
}
.check-hero h1 { margin-top: 14px; font-size: clamp(42px, 6.4vw, 100px); max-width: 15ch; }
.check-hero .lede { margin-top: 22px; max-width: 52ch; font-size: clamp(17px, 1.35vw, 20px); color: var(--muted); }

/* Component ------------------------------------------------------------------------------------ */
.sc { display: grid; gap: 28px; padding-bottom: clamp(64px, 9vw, 120px); }
.sc-form { max-width: 760px; }
.sc-form label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.sc-form .field-pill input { min-height: 54px; font-size: 18px; }
.sc-form input[aria-invalid="true"] { color: var(--fail); }
.sc-hint { margin-top: 12px; font-size: 14px; color: var(--muted); }
.sc-self { padding: 0; border: 0; background: none; color: var(--cyan-hi); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(67, 214, 242, 0.4); cursor: pointer; }
.sc-self[hidden] { display: none; }

.sc-console {
  position: relative; overflow: hidden; border-radius: 28px; border: 1px solid var(--line-2);
  background: radial-gradient(90% 70% at 100% 0%, rgba(4, 186, 222, 0.1), transparent 60%), var(--glass);
  box-shadow: 0 60px 120px -60px rgba(0, 0, 0, 0.9);
}
.sc-progress { position: absolute; inset: 0 0 auto; height: 3px; overflow: hidden; opacity: 0; transition: opacity 0.3s; }
.sc-progress span { display: block; width: 40%; height: 100%; background: linear-gradient(90deg, transparent, var(--cyan-hi), transparent); }
.sc.is-running .sc-progress { opacity: 1; }

.sc-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; padding: 30px 32px; border-bottom: 1px solid var(--line); }
.sc-dial { position: relative; width: 148px; height: 148px; }
.sc-dial svg { width: 100%; height: 100%; rotate: -90deg; }
.sc-dial .track { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 7; }
.sc-dial .fill { fill: none; stroke: var(--dim); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 339.3; stroke-dashoffset: 339.3; transition: stroke-dashoffset 1.3s var(--ease), stroke 0.4s; }
.sc-dial[data-grade^="A"] .fill { stroke: var(--pass); }
.sc-dial[data-grade="B"] .fill { stroke: var(--cyan); }
.sc-dial[data-grade="C"] .fill, .sc-dial[data-grade="D"] .fill { stroke: var(--warn); }
.sc-dial[data-grade="F"] .fill { stroke: var(--fail); }
.sc-letter { position: absolute; inset: 0 0 18px; display: grid; place-items: center; font-size: 60px; font-weight: 700; font-variation-settings: "opsz" 32; letter-spacing: -0.03em; }
.sc-score { position: absolute; left: 0; right: 0; bottom: 34px; text-align: center; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sc-title { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }
.sc-target { margin-top: 4px; font-size: clamp(22px, 2.4vw, 32px); font-weight: 650; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.sc-status { margin-top: 8px; color: var(--muted); max-width: 60ch; }
.sc-status.is-error { color: var(--fail); }

.sc-rows { padding: 10px 16px; }
.sc-rows > li { border-bottom: 1px solid var(--line); }
.sc-rows > li:last-child { border-bottom: 0; }
.sc-rows summary {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 16px 16px; border-radius: 14px; cursor: pointer; list-style: none; transition: background-color 0.2s;
}
.sc-rows summary::-webkit-details-marker { display: none; }
.sc-rows summary:hover { background: rgba(255, 255, 255, 0.03); }
.sc-rows .dot { width: 11px; height: 11px; }
.sc-name { font-weight: 600; font-size: 16px; }
.sc-found { display: block; margin-top: 2px; font-weight: 400; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.sc-found:empty { display: none; }
.sc-state { font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; color: var(--muted); background: rgba(255, 255, 255, 0.05); white-space: nowrap; }
.sc-state::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; rotate: 45deg; translate: 0 -3px; transition: rotate 0.25s var(--ease); }
details[open] > summary .sc-state::after { rotate: -135deg; translate: 0 1px; }
[data-state="pass"] .sc-state { color: var(--pass); background: rgba(61, 220, 151, 0.1); }
[data-state="warn"] .sc-state { color: var(--warn); background: rgba(245, 184, 61, 0.1); }
[data-state="fail"] .sc-state { color: var(--fail); background: rgba(255, 122, 122, 0.1); }
[data-state="run"] .sc-state { color: var(--cyan-hi); background: rgba(67, 214, 242, 0.08); }
.sc-body { padding: 0 16px 20px 43px; display: grid; gap: 10px; color: var(--muted); font-size: 15.5px; max-width: 80ch; }
.sc-body strong { color: var(--text); }
.sc-advice { padding: 12px 14px; border-radius: 12px; color: var(--text); background: rgba(4, 186, 222, 0.1); border: 1px solid rgba(4, 186, 222, 0.28); }
.sc-advice[hidden] { display: none; }

.sc-extra { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; padding: 24px 32px; border-top: 1px solid var(--line); }
.sc-extra[hidden], .sc-notes[hidden] { display: none; }
.sc-extra h3 { font-size: 14px; font-weight: 600; color: var(--muted); }
.sc-extra ul, .sc-extra ol { margin-top: 10px; display: grid; gap: 8px; font-size: 14.5px; }
.sc-notes li { padding-left: 16px; position: relative; }
.sc-notes li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.sc-path li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: baseline; }
.sc-path .code { font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: var(--muted); font-variant-numeric: tabular-nums; }
.sc-path .url { overflow-wrap: anywhere; }
.sc-path .lane-label { grid-column: 1 / -1; font-size: 13px; color: var(--muted); margin-top: 6px; }

.sc-foot { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; padding: 22px 32px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.sc-foot .btn[hidden] { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .sc.is-running .sc-progress span { animation: sweep 1.2s ease-in-out infinite; }
  .sc-rows > li[data-state="run"] .dot { animation: blink 1s ease-in-out infinite; background: var(--cyan-hi); }
  .sc-rows > li[data-state="run"]:nth-child(2n) .dot { animation-delay: 0.25s; }
  .sc-rows > li[data-state="run"]:nth-child(3n) .dot { animation-delay: 0.5s; }
  .sc-rows > li.is-revealed summary { animation: land 0.5s var(--ease); }
}
@keyframes sweep { from { translate: -100% 0; } to { translate: 250% 0; } }
@keyframes blink { 50% { opacity: 0.25; } }
@keyframes land { from { background-color: rgba(67, 214, 242, 0.09); translate: 6px 0; } to { background-color: transparent; translate: 0 0; } }

/* Information sections --------------------------------------------------------------------------- */
.check-info { padding-block: clamp(64px, 8vw, 110px); border-top: 1px solid var(--line); }
.info-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 32px 64px; align-items: start; }
.check-info h2 { font-size: clamp(34px, 4vw, 60px); }
.info-lede { margin-top: 18px; color: var(--muted); max-width: 46ch; }
.grade-scale { border-top: 1px solid var(--line); }
.grade-scale div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.grade-scale dt { font-weight: 600; }
.grade-scale dd { color: var(--muted); }
.scope-list { border-top: 1px solid var(--line); }
.scope-list li { padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.scope-list strong { color: var(--text); }
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { display: flex; justify-content: space-between; gap: 20px; padding: 20px 0; font-weight: 600; font-size: 17px; cursor: pointer; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--cyan-hi); transition: rotate 0.25s var(--ease); }
.faq-list details[open] summary::after { rotate: 45deg; }
.faq-list p { padding: 0 0 20px; color: var(--muted); max-width: 64ch; }

@media (max-width: 860px) {
  .info-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .sc-head { grid-template-columns: minmax(0, 1fr); padding: 22px 20px; gap: 16px; }
  .sc-dial { width: 116px; height: 116px; }
  .sc-letter { font-size: 46px; inset: 0 0 14px; }
  .sc-score { bottom: 25px; font-size: 12px; }
  .sc-rows { padding: 6px 4px; }
  .sc-rows summary { grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 14px 12px; }
  .sc-state { grid-column: 2; justify-self: start; }
  .sc-body { padding: 0 12px 18px 35px; }
  .sc-extra, .sc-foot { padding: 20px; }
  .grade-scale div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
