/* Structural styles — shared across the three-site constellation.
   All colour and type values come from assets/tokens.css; no literal colour
   or font-family appears below. Transitions name exact properties (never
   "all") and never animate width/height/top/left. */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  overflow-x: clip;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-base);
}

::selection {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}
input,
textarea {
  caret-color: var(--color-accent);
}
.table-scroll {
  scrollbar-color: var(--color-ink-muted) var(--color-surface);
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

a {
  color: var(--color-accent);
  text-decoration-line: underline;
  text-decoration-color: color-mix(in srgb, var(--color-accent) 45%, transparent);
  text-underline-offset: 0.16em;
  transition: text-decoration-color 120ms ease-out, color 120ms ease-out;
}
a:hover {
  text-decoration-color: var(--color-accent);
}
a:visited {
  color: var(--color-accent);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: var(--space-1);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius);
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 120ms ease-out;
}
.skip-link:focus-visible {
  transform: translateY(0);
}

/* ---------------- layout containers ---------------- */

.site-header,
main,
.site-footer {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  padding-top: var(--space-3);
  padding-bottom: var(--space-2);
  border-top: var(--header-rule-top, none);
  border-bottom: var(--header-rule);
}
.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-style: var(--wordmark-style);
  font-weight: 700;
  font-size: var(--text-h3);
  letter-spacing: var(--tracking-display);
}
.wordmark a {
  color: var(--color-ink);
  text-decoration: none;
}
.site-header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-header nav a {
  color: var(--color-ink-muted);
  text-decoration: none;
  font-size: var(--text-small);
  border-bottom: 1px solid transparent;
  transition: color 120ms ease-out, border-color 120ms ease-out;
}
.site-header nav a:hover {
  color: var(--color-ink);
  border-bottom-color: var(--color-ink-muted);
}

main {
  padding-top: var(--space-4);
  padding-bottom: var(--space-5);
}

/* ---------------- headings & prose ---------------- */

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--color-ink);
  font-weight: 700;
  overflow-wrap: break-word;
  min-width: 0;
}
h1 {
  font-size: var(--text-h1);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  margin: 0 0 var(--space-2);
  max-width: 24ch;
}
h2 {
  font-size: var(--text-h2);
  line-height: 1.25;
  margin: var(--space-5) 0 var(--space-2);
}
h3 {
  font-size: var(--text-h3);
  line-height: 1.3;
  margin: var(--space-4) 0 var(--space-1);
}
h2 + h3 {
  margin-top: var(--space-2);
}
main > article > h1 + .verified-stamp {
  margin-top: 0;
}
p {
  margin: 0 0 var(--space-2);
}

/* Long-form reading voice: methodology, pitfalls, FAQs, profile/hub bodies.
   Everything else (tables, facts, nav, labels) stays in the structural
   sans so dense data keeps scanning fast. */
.profile-body,
.hub-body,
.support-body,
section[aria-labelledby^="sec-"],
section[aria-labelledby="faq-heading"] {
  font-family: var(--font-prose);
  font-size: 1.0625rem;
  line-height: var(--leading-prose);
}
.profile-body :is(h2, h3),
.hub-body :is(h2, h3),
.support-body :is(h2, h3),
section[aria-labelledby^="sec-"] :is(h2, h3) {
  font-family: var(--font-display);
}
.profile-body p,
.hub-body p,
.support-body p,
section[aria-labelledby^="sec-"] p,
section[aria-labelledby="faq-heading"] p {
  max-width: 70ch;
}
section[aria-labelledby="faq-heading"] h3 {
  font-size: 1.0625rem;
  font-family: var(--font-prose);
  font-weight: 600;
  font-style: italic;
  margin-bottom: 0.1em;
}

/* ---------------- answer-first & stamps ---------------- */

.answer-first {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
.answer-first > :last-child {
  margin-bottom: 0;
}

.verified-stamp {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--color-ink-muted);
  margin: 0 0 var(--space-3);
}

.entity-type {
  font-size: var(--text-small);
  color: var(--color-ink-muted);
  margin: var(--space-1) 0 var(--space-2);
}

/* Draft / unconfirmed language shares one visual grammar: a dashed hairline,
   never the solid rule used for confirmed structure, and never a warning
   colour — unresearched is a status, not an error. */
.draft-marker,
.sponsorship-disclosure,
#unclassified-heading ~ p,
#unclassified-heading ~ ul {
  font-size: var(--text-small);
  color: var(--color-ink-muted);
}
.draft-marker {
  display: inline-block;
  border: 1px dashed var(--color-line);
  border-radius: var(--radius);
  padding: var(--space-0) var(--space-1);
}
.sponsorship-disclosure {
  border: 1px dashed var(--color-line);
  border-radius: var(--radius);
  padding: var(--space-1) var(--space-2);
}
#unclassified-heading ~ ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px dashed var(--color-line);
}
#unclassified-heading ~ ul li {
  padding: var(--space-1) 0;
  border-bottom: 1px dashed var(--color-line);
}

/* ---------------- field values by evidence status ---------------- */

/* build.mjs wraps every printed field value in .fv[data-status]; the
   wording is decided there, never here. These treatments extend the
   dashed-hairline grammar above: full ink is settled, dashed/muted is
   still being checked — a placeholder reads as provisional at a glance. */
.fv[data-status="verified"] {
  color: var(--color-ink);
}
.fv[data-status="vendor_claimed"] {
  color: var(--color-ink);
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--color-line);
  text-underline-offset: 0.18em;
}
.fv[data-status="unresearched"],
.fv[data-status="not_disclosed"],
.fv[data-status="conflicting"] {
  color: var(--color-ink-muted);
  border-bottom: 1px dashed var(--color-line);
}
.fv[data-status="not_applicable"] {
  color: var(--color-ink-muted);
}

/* ---------------- tables ---------------- */

.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  margin-bottom: var(--space-3);
}
.table-scroll:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

table {
  border-collapse: collapse;
  width: 100%;
}
caption {
  text-align: left;
  color: var(--color-ink-muted);
  font-size: var(--text-small);
  padding-bottom: var(--space-2);
  max-width: 70ch;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: var(--space-2) var(--space-2) var(--space-2) 0;
  border-bottom: 1px solid var(--color-line);
}
th:last-child,
td:last-child {
  padding-right: 0;
}
thead th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-small);
  color: var(--color-ink-muted);
  border-bottom: 2px solid var(--color-ink);
  padding-top: 0;
}
tbody tr {
  transition: background-color 120ms ease-out;
}
tbody tr:hover {
  background: var(--color-surface);
}
tbody th {
  font-weight: 600;
}

/* Price and verification columns read as instruments, not prose: mono,
   tabular, right of the reading flow where the template's own column
   order puts them. The aria-labels are stable template hooks. */
div[aria-label="Build and Deploy companies table"] td:nth-of-type(4),
div[aria-label="Build and Deploy companies table"] td:nth-of-type(5),
div[aria-label="Agent platforms table"] td:nth-of-type(3),
div[aria-label="Agent platforms table"] td:nth-of-type(4) {
  font-family: var(--font-mono);
  font-size: var(--text-small);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
div[aria-label="Build and Deploy companies table"] th:nth-of-type(4),
div[aria-label="Build and Deploy companies table"] th:nth-of-type(5),
div[aria-label="Agent platforms table"] th:nth-of-type(3),
div[aria-label="Agent platforms table"] th:nth-of-type(4) {
  text-align: right;
}

.hub-entities {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
}
.hub-entities li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-line);
}
.hub-entities li:first-child {
  border-top: 1px solid var(--color-line);
}

/* ---------------- profile facts ---------------- */

.profile-facts {
  display: grid;
  gap: 0;
  margin: 0 0 var(--space-4);
  border-top: 1px solid var(--color-line);
}
.profile-facts > div {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-line);
}
.profile-facts dt {
  color: var(--color-ink-muted);
  font-size: var(--text-small);
  font-weight: 600;
  padding-top: 0.1em;
}
.profile-facts dd {
  margin: 0;
}

.source-list {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  font-size: var(--text-small);
  color: var(--color-ink-muted);
}
.source-list li {
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--color-line);
}
.source-list a {
  overflow-wrap: anywhere;
  color: var(--color-ink);
}

.profile-backlinks,
.hub-backlinks {
  margin-top: var(--space-4);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-line);
}
.profile-backlinks p,
.hub-backlinks p {
  margin: 0;
}

/* ---------------- forms (base, ahead of a shortlist intake) ---------------- */

input,
textarea,
select,
button {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-ink);
}
input,
textarea,
select {
  background: var(--color-paper);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: var(--space-1) var(--space-2);
}
button,
.button {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border: none;
  border-radius: var(--radius);
  padding: var(--space-1) var(--space-3);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 120ms ease-out;
}
button:hover,
.button:hover {
  background: color-mix(in srgb, var(--color-accent) 85%, var(--color-ink) 15%);
}
button:disabled,
.button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------------- footer ---------------- */

.site-footer {
  border-top: 1px solid var(--color-ink);
  padding-top: var(--space-2);
  padding-bottom: var(--space-4);
  color: var(--color-ink-muted);
  font-size: var(--text-small);
}
.site-footer p {
  margin: 0 0 var(--space-1);
}

/* ---------------- narrow screens ---------------- */

@media (max-width: 640px) {
  :root {
    --gutter: 1rem;
  }
  .site-header {
    padding-top: var(--space-2);
  }
  h1 {
    font-size: calc(var(--text-h1) * 0.78);
  }
  h2 {
    font-size: calc(var(--text-h2) * 0.9);
  }
  .profile-facts > div {
    grid-template-columns: 1fr;
    gap: var(--space-0);
  }
  main {
    padding-top: var(--space-3);
  }
}
