/* ===== SDTMIG v4.0 Impact Scanner — landing and privacy pages =====
 *
 * Loaded after style.css and using its tokens. Only what those two pages need
 * that the homepage does not: the hero call to action, the prose column, and
 * the verification steps.
 */

/* ===== Above the fold ===== */
/* One question, then the way in. Everything else is below the fold on purpose:
   the score is free, so there is nothing here to ask the visitor for. */
.impact-hero {
  background: var(--color-bg-dark);
  color: var(--color-text-white);
  padding: 96px 1.5rem 80px;
}

.impact-hero__container {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.impact-hero__title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
  text-wrap: balance;
}

.impact-hero__note {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

/* ===== The way in ===== */
/* Two lines and a button, and deliberately nothing that reads as a file
   target: no dashed border, no upload arrow, no hover state that invites a
   drag. This page has no file input and no drop handler, because handing a
   Define-XML between two pages would mean putting it somewhere — which is
   exactly what this product promises never to do. The reading happens on
   /scanner/, and this says so before the click rather than after it. */
.impact-hero__lead {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.impact-hero__sub {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

/* ===== Sections ===== */
.impact-section {
  padding: var(--section-padding-y) 1.5rem;
  background: var(--color-bg-white);
}

.impact-section--slate {
  background: var(--color-bg-slate);
}

.impact-section__container {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.impact-section__container--narrow {
  max-width: 720px;
}

.impact-section__title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
  color: var(--color-text-primary);
}

.impact-prose {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
  max-width: 68ch;
}

.impact-prose:last-of-type {
  margin-bottom: 1.75rem;
}

.impact-prose strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

.impact-prose code,
.impact-code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-bg-slate);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  color: var(--color-text-primary);
  overflow-wrap: anywhere;
}

.impact-section--slate .impact-prose code,
.impact-section--slate .impact-code {
  background: var(--color-bg-white);
}

/* ===== Card grid ===== */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.impact-card {
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 1.75rem;
}

.impact-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text-primary);
}

.impact-card__body {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--color-text-secondary);
}

/* ===== Verification steps (privacy page) ===== */
.impact-steps {
  counter-reset: step;
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
}

.impact-steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.25rem 3rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  max-width: 68ch;
}

.impact-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 4px;
  background: var(--color-accent);
  color: var(--color-text-white);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.impact-steps strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

/* ===== Definition list: what is collected ===== */
.impact-facts {
  margin: 0 0 1.75rem;
  border-top: 1px solid var(--color-border);
  max-width: 68ch;
}

.impact-facts div {
  display: grid;
  grid-template-columns: minmax(140px, 12rem) 1fr;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--color-border);
}

.impact-facts dt {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text-primary);
}

.impact-facts dd {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

@media (max-width: 600px) {
  .impact-facts div {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* ===== Header block on the privacy page ===== */
.impact-pagehead {
  background: var(--color-bg-dark);
  color: var(--color-text-white);
  padding: 72px 1.5rem 64px;
}

.impact-pagehead__container {
  max-width: 720px;
  margin: 0 auto;
}

.impact-pagehead__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.impact-pagehead__lede {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  max-width: 60ch;
}

.impact-pagehead__meta {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ===== Rules catalogue ===== */

.rule-table__scroll {
  overflow-x: auto;
}

/* The index is one table per category, and each would otherwise be sized from
 * its own longest rule title — putting Basis and Detectability somewhere
 * different in every section. `table-layout: fixed` makes the <colgroup> below
 * authoritative instead, so the four columns line up down the whole page.
 *
 * min-width holds the fixed three plus a readable "What it finds" on a phone;
 * .rule-table__scroll is what actually scrolls, so the page itself never does. */
.rule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  min-width: 720px;
  table-layout: fixed;
}

/* Sized for the longest label each column can hold: "Needs verification" as a
 * chip, and "External context required". "What it finds" is the one auto
 * column, so it takes the remainder and wraps. */
.rule-table__col--id     { width: 6.5rem; }
.rule-table__col--what   { width: auto; }
.rule-table__col--basis  { width: 11rem; }
.rule-table__col--detect { width: 13rem; }

.rule-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  padding: 0 0.75rem 0.625rem 0;
  border-bottom: 1px solid var(--color-border);
}

.rule-table td {
  padding: 0.75rem 0.75rem 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  color: var(--color-text-secondary);
  overflow-wrap: anywhere;
}

.rule-table a {
  color: var(--color-text-primary);
  text-decoration: none;
}

.rule-table a:hover,
.rule-table a:focus-visible {
  color: var(--color-accent);
  text-decoration: underline;
}

.rule-table__id {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  white-space: nowrap;
}

.rule-table__id a {
  color: var(--color-accent);
}

.rule-table__detect {
  font-size: 0.875rem;
}

/* ===== Chips ===== */
.chip {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid currentColor;
}

/* Basis colours are the scanner's own, repeated as literals here so a rule page
 * and the report that cites it grade the same finding the same colour. */
.chip--confidence-confirmed          { color: #0f766e; }
.chip--confidence-draft              { color: #8a5a00; }
.chip--confidence-needs-verification { color: #9a3412; }

/* ===== Rule page ===== */
.rule-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7fb2f5;
  margin-bottom: 0.75rem;
}

.rule-back {
  color: var(--color-text-muted);
}

.fact-note {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.rule-refs {
  margin: 0 0 1.75rem;
  padding-left: 1.25rem;
  max-width: 68ch;
}

.rule-refs li {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin-bottom: 0.625rem;
  padding-left: 0.25rem;
}

.rule-related {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 68ch;
}

.rule-related li {
  border-bottom: 1px solid var(--color-border);
}

.rule-related a {
  display: block;
  padding: 0.75rem 0;
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  text-decoration: none;
}

.rule-related a:hover,
.rule-related a:focus-visible {
  color: var(--color-accent);
}

.rule-related__id {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-accent);
  margin-right: 0.5rem;
}

/* ===== Mid-page CTA ===== */
.impact-cta {
  background: var(--color-bg-dark);
  color: var(--color-text-white);
  padding: 72px 1.5rem;
  text-align: center;
}

.impact-cta__container {
  max-width: 640px;
  margin: 0 auto;
}

.impact-cta__title {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

.impact-cta__body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-muted);
  margin-bottom: 1.75rem;
}
