/*
 * Website Technology Detector — page-specific styles.
 *
 * The design system (tokens, chrome, buttons, badges, mode selector, FAQ,
 * toast, print) lives in /tools/tools.css, loaded first. Only this page's own
 * layout belongs here: the URL form, the report states and the technology list.
 */

/* ---------------------------------------------------------------- url form */

.url-form { margin-top: 26px; }

.url-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fog-500);
}

/* .url-row, .url-input, .url-hint and .url-error are shared primitives in
   tools.css — every tool that takes a URL uses the same control. */

/* ------------------------------------------------------------------ states */

.state { min-height: 120px; }

.empty {
  border: 1px solid var(--ink-600);
  border-radius: var(--radius-card);
  background: var(--ink-800);
  padding: clamp(18px, 3.5vw, 26px);
}
.empty h3 { font-size: 17px; }
.empty p {
  margin-top: 8px;
  max-width: 76ch;
  font-size: 13.5px;
  color: var(--fog-300);
}
.empty-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.empty-list li {
  font-size: 13px;
  line-height: 1.6;
  color: var(--fog-500);
  padding-left: 14px;
  border-left: 2px solid var(--ink-600);
}
.empty-list strong { color: var(--fog-100); font-weight: 600; }

.loading {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--ink-600);
  border-radius: var(--radius-card);
  background: var(--ink-800);
  padding: 20px 22px;
}
.spinner {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border: 2px solid var(--ink-500);
  border-top-color: var(--brand-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* Reduced motion: the spinner stops rather than disappearing, so the loading
   state is still visibly distinct from the idle one. */
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-top-color: var(--brand-500); }
}
.loading-title { font-size: 14.5px; font-weight: 600; color: var(--fog-50); }
.loading-note { margin-top: 3px; font-size: 12.5px; color: var(--fog-500); }

.error-card {
  border: 1px solid color-mix(in srgb, var(--fail-500) 35%, var(--ink-600));
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--fail-500) 6%, var(--ink-850));
  padding: clamp(18px, 3.5vw, 26px);
}
.error-kind {
  font-size: 16px;
  font-weight: 600;
  color: var(--fog-50);
}
.error-message {
  margin-top: 8px;
  max-width: 76ch;
  font-size: 14px;
  color: var(--fog-100);
  overflow-wrap: anywhere;
}
.error-help {
  margin-top: 8px;
  max-width: 76ch;
  font-size: 13px;
  color: var(--fog-500);
}
.error-card .actions { margin-top: 18px; }

.notice {
  margin-bottom: 18px;
  padding: 12px 15px;
  border: 1px solid color-mix(in srgb, var(--warn-500) 40%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--warn-500) 8%, transparent);
  font-size: 13px;
  line-height: 1.55;
  color: var(--fog-100);
}
.notice[hidden] { display: none; }

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

.report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ink-700);
}
.report-head-body { min-width: 0; flex: 1 1 280px; }
.report-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fog-500);
}
.report-head h3 {
  margin-top: 4px;
  font-size: clamp(20px, 3.4vw, 28px);
  /* A long hostname must wrap rather than push the layout sideways. */
  overflow-wrap: anywhere;
}
.report-url {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--fog-500);
  overflow-wrap: anywhere;
}
.report-count {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--fog-300);
}
.report-count span:first-child {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--brand-500);
}

.block-title {
  margin-top: 30px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--fog-500);
}

/* --------------------------------------------------------------- summary */

.summary-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin: 0;
  border: 1px solid var(--ink-600);
  border-radius: var(--radius-card);
  background: var(--ink-700);
  overflow: hidden;
}
@media (min-width: 560px) {
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .summary-strip { grid-template-columns: repeat(3, 1fr); }
}
.summary-item {
  min-width: 0;
  padding: 14px 16px;
  background: var(--ink-850);
}
.summary-item dt {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fog-500);
}
.summary-item dd {
  margin: 5px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--fog-50);
  overflow-wrap: anywhere;
}
.summary-item dd.muted {
  font-size: 13.5px;
  font-weight: 400;
  font-style: italic;
  color: var(--fog-500);
}

/* ------------------------------------------------------------ technologies */

.tech-category + .tech-category { margin-top: 20px; }
.tech-category h5 {
  margin: 0 0 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fog-500);
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 9px;
}

.tech {
  min-width: 0;
  border: 1px solid var(--ink-700);
  border-radius: 8px;
  background: var(--ink-850);
  overflow: hidden;
}
.tech-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
}
.tech-name {
  min-width: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--fog-50);
  overflow-wrap: anywhere;
}
.tech-version {
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fog-300);
}
.tech-meta {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--fog-500);
}

/* Confidence badges. Text carries the meaning; colour only reinforces it. */
.conf {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.conf-detected {
  color: var(--pass-500);
  border-color: color-mix(in srgb, var(--pass-500) 40%, transparent);
  background: color-mix(in srgb, var(--pass-500) 12%, transparent);
}
.conf-likely {
  color: var(--info-500);
  border-color: color-mix(in srgb, var(--info-500) 40%, transparent);
  background: color-mix(in srgb, var(--info-500) 12%, transparent);
}
.conf-possible {
  color: var(--warn-500);
  border-color: color-mix(in srgb, var(--warn-500) 40%, transparent);
  background: color-mix(in srgb, var(--warn-500) 12%, transparent);
}

.tech-why { border-top: 1px solid var(--ink-700); }
.tech-why summary {
  padding: 8px 14px;
  min-height: 36px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--fog-500);
  list-style: none;
}
.tech-why summary::-webkit-details-marker { display: none; }
.tech-why summary::before {
  content: '+';
  margin-right: 7px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
}
.tech-why[open] summary::before { content: '−'; }
.tech-why summary:hover { color: var(--fog-100); background: var(--ink-800); }

.evidence {
  margin: 0;
  padding: 4px 14px 13px;
  list-style: none;
  display: grid;
  gap: 9px;
}
.evidence li { font-size: 11.5px; line-height: 1.5; color: var(--fog-300); }
.evidence-source {
  display: inline-block;
  margin-bottom: 2px;
  padding: 0 5px;
  border-radius: 3px;
  background: var(--ink-700);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fog-500);
}
.evidence-sample {
  margin-top: 4px;
  padding: 5px 7px;
  border-radius: 4px;
  background: var(--ink-900);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fog-300);
  /* Matched samples are arbitrary remote text: it must wrap, never widen. */
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* --------------------------------------------------------------- snapshot */

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 9px;
}
.snapshot-item {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--ink-700);
  border-radius: 8px;
  background: var(--ink-850);
}
.snapshot-item dt {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fog-500);
}
.snapshot-item dd {
  margin: 5px 0 0;
  font-size: 13.5px;
  color: var(--fog-50);
  overflow-wrap: anywhere;
}
.snapshot-item dd.muted { color: var(--fog-500); font-style: italic; }
.snapshot-item dd.mono { font-family: var(--font-mono); font-size: 12.5px; }

#cta-responsive { margin-top: 30px; }
