/* ==========================================================================
   Free website check (audit.js). Reuses the Coder page shell from code.css.
   ========================================================================== */

.audit {
  display: grid;
  gap: 1.25rem;
  max-width: 62rem;
}
.audit__title {
  max-width: 16ch;
}
.audit__lead {
  max-width: 58ch;
}

/* ---------- Address field ---------- */
.audit__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 1rem;
  padding: 0.5rem 0.5rem 0.5rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--ink) 22%, var(--bg));
  border-radius: var(--radius-box);
  background: #0c0c0c;
  transition: border-color var(--t-fast);
}
.audit__form:focus-within {
  border-color: var(--accent);
}
.audit__prompt {
  color: var(--muted);
}
.audit__form input {
  flex: 1 1 12rem;
  min-width: 0;
  min-height: 2.75rem;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-md);
  outline: none;
}
.audit__form input::placeholder {
  color: color-mix(in srgb, var(--muted) 60%, var(--bg));
}
.audit__status {
  min-height: 1.3em;
  font-size: var(--fs-sm);
  color: var(--accent);
}
.audit__status:empty {
  display: none;
}
.audit__note {
  max-width: 62ch;
  font-size: var(--fs-xs);
  color: var(--muted);
}
/* ---------- Scan: a phone being read beside a terminal ---------- */
.scan {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  gap: 1.25rem;
  max-width: 50rem;
}
.scan[hidden] {
  display: none;
}
.audit__log .term__body {
  height: 15rem;
  overflow-y: auto;
  scrollbar-width: none;
}
.term__out--flag {
  color: var(--accent);
}
.scan__phone {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.5rem;
  width: 8.5rem;
  padding: 0.7rem 0.6rem 2rem;
  border: 1px solid color-mix(in srgb, var(--ink) 22%, var(--bg));
  border-radius: 1.1rem;
  background: #0c0c0c;
  overflow: hidden;
}
.scan__phone i {
  display: block;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink) 11%, var(--bg));
  outline: 1px solid transparent;
  outline-offset: 2px;
  transition: background-color var(--t), outline-color var(--t);
}
.scan__bar { height: 0.55rem; width: 45%; }
.scan__hero { height: 4.2rem; }
.scan__text { height: 0.45rem; }
.scan__text--short { width: 62%; }
.scan__btn { height: 1.15rem; width: 52%; border-radius: 999px; }
.scan__tiles {
  height: 2.6rem;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 11%, var(--bg)) 47%, transparent 47% 53%, color-mix(in srgb, var(--ink) 11%, var(--bg)) 53%) !important;
}
/* The beam that sweeps the screen */
.scan__phone .scan__beam {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2.2rem;
  border-radius: 0;
  background: linear-gradient(transparent, rgb(255 74 61 / 0.22));
  border-bottom: 1px solid var(--accent);
  animation: scan-beam 2.4s var(--ease) infinite alternate;
}
@keyframes scan-beam {
  from { translate: 0 -2.2rem; }
  to { translate: 0 13.5rem; }
}
.scan__tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.55rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.scan__tag::before { content: "DNS"; }
.scan[data-step="1"] .scan__tag::before { content: "HEADERS"; }
.scan[data-step="2"] .scan__tag::before { content: "LOADING"; }
.scan[data-step="3"] .scan__tag::before { content: "SPEED"; }
.scan[data-step="4"] .scan__tag::before { content: "A11Y · SEO"; }
.scan[data-step="5"] .scan__tag::before { content: "SECURITY"; }
.scan[data-step="6"] .scan__tag::before { content: "SORTING"; }
/* Each stage lights the part of the page it is about */
.scan[data-step="1"] .scan__bar,
.scan[data-step="3"] .scan__hero,
.scan[data-step="4"] .scan__text,
.scan[data-step="4"] .scan__btn,
.scan[data-step="5"] .scan__bar,
.scan[data-step="5"] .scan__btn,
.scan[data-step="6"] .scan__tiles {
  outline-color: var(--accent);
}
.scan[data-step="2"] .scan__phone i:not(.scan__beam) {
  animation: scan-load 1.2s ease-in-out infinite alternate;
}
.scan[data-step="2"] .scan__hero { animation-delay: 0.15s; }
.scan[data-step="2"] .scan__text { animation-delay: 0.3s; }
.scan[data-step="2"] .scan__btn { animation-delay: 0.45s; }
@keyframes scan-load {
  from { opacity: 0.25; }
}
@media (prefers-reduced-motion: reduce) {
  .scan__phone .scan__beam,
  .scan[data-step="2"] .scan__phone i {
    animation: none;
  }
}
@media (max-width: 720px) {
  .scan {
    grid-template-columns: 1fr;
  }
  .scan__phone {
    display: none;
  }
  /* The Coder page hides its interactive terminal on phones; this one is only read */
  .audit__log.term {
    display: block;
  }
}

/* ---------- Report ---------- */
.audit__result {
  display: grid;
  gap: 2.25rem;
  margin-top: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  outline: none;
  scroll-margin-top: calc(var(--header-h, 4rem) + 1rem);
}
.audit__result[hidden] {
  display: none;
}
.report__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
}
.report__shot {
  width: clamp(7rem, 16vw, 11rem);
  padding: 0.4rem;
  border: 1px solid color-mix(in srgb, var(--ink) 22%, var(--bg));
  border-radius: 1.1rem;
  background: #0c0c0c;
}
.report__shot img {
  display: block;
  width: 100%;
  border-radius: 0.75rem;
}
.report__verdict {
  margin-top: 0.6rem;
  max-width: 24ch;
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.report__lcp {
  margin-top: 0.6rem;
  color: var(--muted);
}
.report__title {
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.report__text {
  max-width: 60ch;
  color: var(--muted);
}
.report__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Score rings */
.dials {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 6.5rem));
  gap: 1rem;
  margin-top: -0.75rem;
}
.dial {
  --tone: var(--muted);
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  text-align: center;
}
.dial--good { --tone: #6fcf97; }
.dial--mid { --tone: #e8b04a; }
.dial--bad { --tone: var(--accent); }
.dial svg {
  width: 100%;
  max-width: 5.5rem;
  rotate: -90deg;
}
.dial circle {
  fill: none;
  stroke-width: 5;
}
.dial__track {
  stroke: color-mix(in srgb, var(--ink) 12%, var(--bg));
}
.dial__value {
  stroke: var(--tone);
  stroke-linecap: round;
  transition: stroke-dasharray 1.2s var(--ease);
}
.dial strong {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-width: 5.5rem;
  margin-inline: auto;
  font-size: var(--fs-lg);
  color: var(--tone);
}
.dial span {
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* The two fixes shown */
.fixes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1rem;
  margin: -1rem 0 0;
  padding: 0;
  list-style: none;
}
.fix {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-box);
  background: #0c0c0c;
}
.fix__n {
  color: var(--accent);
}
.fix__area {
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.fix__title {
  margin: 0.35rem 0 0.5rem;
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.25;
}
.fix__why {
  color: color-mix(in srgb, var(--ink) 78%, var(--bg));
}
.fix__raw {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted);
}
.fix__gain {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--accent);
}

/* What stays for the full report */
.more {
  display: grid;
  gap: 1rem;
}
.more__list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.more__list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 1.25rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}
.more__list b {
  font-weight: 400;
}
.more__list span {
  color: var(--accent);
}
.more__list i {
  font-style: normal;
  font-size: var(--fs-xs);
  color: var(--muted);
}
.more__list i::before {
  content: "→ ";
}

@media (max-width: 720px) {
  .report__head {
    grid-template-columns: 1fr;
  }
  .report__shot {
    width: 8rem;
  }
  .dials {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem 0.5rem;
  }
  .audit__form .button {
    width: 100%;
    justify-content: center;
  }
  .more__list li {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .more__list i {
    display: none;
  }
}

/* What real visitors experienced */
.field {
  display: grid;
  gap: 0.6rem;
  margin-top: -0.75rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-box);
  background: #0c0c0c;
}
.field__title {
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.field ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}
.field li {
  --tone: var(--muted);
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.field--fast { --tone: #6fcf97; }
.field--average { --tone: #e8b04a; }
.field--slow { --tone: var(--accent); }
.field span {
  color: var(--muted);
}
.field b {
  font-weight: 700;
}
.field i {
  font-style: normal;
  font-size: var(--fs-xs);
  color: var(--tone);
}

/* What a script cannot do */
.report__human {
  max-width: 54ch;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
  font-size: var(--fs-md);
  line-height: 1.4;
}
