/* css/site.css — all layout and component styling. Consumes css/tokens.css only:
   no hex codes, no raw design values (AGENTS.md rule 6). */

/* faces — pin W-008, RESOLVED 2026-08-08. Self-hosted latin subsets; licenses in
   assets/fonts/ (DESIGN.md Part 4.5). */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../assets/fonts/newsreader-var-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/public-sans-var-latin.woff2") format("woff2");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

h1,
h2,
h3,
p,
ol {
  margin: 0;
}

.wrap {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* interactive = green, and green means nothing else (DESIGN.md Part 1.5) */
a {
  color: var(--accent);
  text-underline-offset: var(--space-1);
  transition: color var(--transition);
}
a:hover {
  color: var(--accent-hover);
}
a:focus-visible,
.button:focus-visible,
.accessibility-help summary:focus-visible,
.mobile-menu summary:focus-visible {
  outline: var(--space-1) solid var(--accent);
  outline-offset: var(--space-1);
}

/* keyboard route past the repeated header (DESIGN.md Part 7 W3 accessibility pass);
   in the tab order always, painted only while focused */
.skip-link {
  position: absolute;
  z-index: 1;
  inset-inline-start: var(--space-6);
  inset-block-start: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--surface-1);
  border: var(--hairline) solid var(--border-strong);
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
}
.skip-link:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

/* shared header — real pages and section links; copy lives in content/home.md */
.site-header {
  border-bottom: var(--hairline) solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  max-width: var(--container-home);
  padding-inline: var(--home-gutter);
  padding-block: var(--space-6);
}
.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-6);
  font-size: var(--text-base);
  font-weight: 500;
}
.site-nav > a:not(.button) {
  padding-block: var(--space-2);
  text-decoration: none;
}
.site-nav > a:not(.button):hover,
.site-nav > a[aria-current="page"] {
  text-decoration: underline;
}
.site-nav .button {
  font-size: var(--text-sm);
  max-width: 100%;
}
.mobile-menu {
  display: none;
}
.mobile-menu summary {
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  padding-block: var(--space-2);
  transition: color var(--transition);
}
.mobile-menu summary:hover {
  color: var(--accent-hover);
}
.wordmark {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
}
.wordmark:hover {
  color: var(--accent-hover);
}

/* hero — headline and supporting copy above the product (2026-09-21 direction) */
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--space-20);
  align-items: center;
  padding-block: var(--space-20) 0;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-home-hero);
  font-weight: 400;
  line-height: var(--leading-display);
  max-width: var(--home-title-measure);
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.hero-copy {
  min-width: 0;
  max-width: var(--home-copy-measure);
  justify-self: end;
}
.hero .lede {
  font-size: var(--text-base);
  color: var(--text-secondary);
}
.hero-broker {
  display: block;
  margin-top: var(--space-6);
  color: var(--text-primary);
}
.hero .cta-row {
  align-items: flex-start;
  flex-direction: column;
  gap: var(--space-4);
}
.hero .trust-line {
  font-size: var(--text-sm);
}
.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-6);
  font-size: var(--text-sm);
}
.product-showcase {
  grid-column: 1 / -1;
  min-width: 0;
}
.product-stage {
  padding: var(--home-stage-inset);
  background-color: var(--surface-2);
  background-image: url("../assets/textures/home-grain.webp");
  background-position: center;
  background-size: cover;
  border-radius: var(--radius);
}
.product-stage .shot {
  box-shadow: var(--shadow-2);
}
.screen-link {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  text-align: right;
}
main section[id],
.product-showcase,
figure[id] {
  scroll-margin-block-start: var(--space-8);
}
.cta-row {
  margin-top: var(--space-8);
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.button {
  display: inline-block;
  background: var(--accent);
  color: var(--surface-1);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  text-decoration: none;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius);
  transition: background-color var(--transition);
}
.button:hover {
  background: var(--accent-hover);
  color: var(--surface-1);
}
.trust-line {
  font-weight: 500;
}

/* placeholders — loud gaps, never content (DESIGN.md Part 3.5) */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: var(--space-24);
  aspect-ratio: 4 / 3;
  padding: var(--space-6);
  background: var(--surface-1);
  border: var(--hairline) dashed var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.placeholder-inline {
  display: inline-block;
  margin-top: var(--space-6);
  padding: var(--space-2) var(--space-4);
  background: var(--surface-1);
  border: var(--hairline) dashed var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
/* Keep the outstanding capture request visible without imitating a product screen. */
.product-stage .placeholder {
  aspect-ratio: auto;
}

/* product imagery (STATE.md 2026-08-09 supersession; values per docs/canonical_dataset.md) */
.shot {
  display: block;
  width: 100%;
  height: auto;
  border: var(--hairline) solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-1);
}
.shot-block {
  margin: var(--space-8) 0 0;
}
.shot-caption {
  margin-top: var(--space-3);
  max-width: var(--measure);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* shared section rhythm */
section h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 500;
}
.section-lede {
  margin-top: var(--space-4);
  max-width: var(--measure);
  color: var(--text-secondary);
}
.evidence .wrap,
.boundary .wrap,
.cta-section .wrap {
  padding-block: var(--space-16);
}

/* the broker gate section — terracotta carries its one meaning (DESIGN.md Part 1.5) */
.gate-section .wrap {
  padding-block: var(--space-8);
}
.gate-inner {
  border-left: var(--space-1) solid var(--gate);
  padding-left: var(--space-8);
}
.gate-inner p {
  margin-top: var(--space-4);
  max-width: var(--measure);
  color: var(--text-secondary);
}

.boundary .cta-row {
  margin-top: var(--space-8);
}
.boundary-list {
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}
.boundary-list li {
  max-width: var(--measure);
  color: var(--text-secondary);
  padding-block: var(--space-3);
  border-top: var(--hairline) solid var(--border);
}

/* subpages */
.page-head .wrap {
  padding-block: var(--space-12);
}
.page-head h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 500;
  line-height: var(--leading-tight);
}
.stage .wrap {
  padding-block: var(--space-12);
}
.stage h2 {
  font-size: var(--text-xl);
}
.shot-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-top: var(--space-8);
}
@media (max-width: 56rem) {
  .shot-pair {
    grid-template-columns: 1fr;
  }
}

/* pipeline — a real sequence, numbered because it is one (DESIGN.md Part 1.18) */
.pipeline .wrap {
  padding-block: var(--space-16);
}
.pipeline h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 500;
}
.pipeline ol {
  list-style: none;
  padding: 0;
  margin-top: var(--space-8);
}
.pipeline li {
  display: grid;
  grid-template-columns: var(--space-12) 1fr;
  gap: var(--space-6);
  padding-block: var(--space-6);
  border-top: var(--hairline) solid var(--border);
}
.step-number {
  font-weight: 600;
  color: var(--text-secondary);
}
.pipeline h3 {
  font-size: var(--text-base);
  font-weight: 600;
}
.pipeline li p {
  margin-top: var(--space-2);
  max-width: var(--measure);
  color: var(--text-secondary);
}
/* terracotta carries exactly one meaning: the broker gate (DESIGN.md Part 1.5).
   Borders only, never text (DESIGN.md Part 6). */
.step-gate {
  border-left: var(--space-1) solid var(--gate);
  padding-left: var(--space-6);
  margin-left: calc(-1 * var(--space-6) - var(--space-1));
}

/* data renders in mono, as the product renders it (DESIGN.md Part 1.11) */
.mono {
  font-family: var(--font-mono);
}

/* the reference ledger (how-it-works) — every reference the sample entry stands on,
   linked to the government source that answers for it. Tables render square
   (DESIGN.md Part 6: tables 0); green on the links is the one interactive meaning
   (DESIGN.md Part 1.5). */
.refs {
  margin-top: var(--space-8);
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.refs th,
.refs td {
  border: var(--hairline) solid var(--border);
  padding: var(--space-2) var(--space-3);
  text-align: left;
  vertical-align: top;
  color: var(--text-secondary);
}
.refs th {
  background: var(--surface-2);
  color: var(--text-primary);
  font-weight: 600;
}
.refs td:first-child {
  font-family: var(--font-mono);
  white-space: nowrap;
}
.refs td:last-child {
  max-width: var(--measure);
}

/* privacy policy — long-form legal document (privacy/index.html, STATE.md 2026-08-11) */
.policy-meta {
  margin-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.legal .wrap {
  padding-block: var(--space-4) var(--space-8);
}
.legal h2 {
  margin-top: var(--space-12);
  font-size: var(--text-xl);
}
.legal h3 {
  margin-top: var(--space-8);
  font-size: var(--text-base);
  font-weight: 600;
}
.legal p,
.legal ol,
.legal ul {
  margin-top: var(--space-4);
  max-width: var(--measure);
  color: var(--text-secondary);
}
.legal ol,
.legal ul {
  padding-left: var(--space-6);
}
.legal li {
  margin-top: var(--space-2);
}
.legal strong {
  color: var(--text-primary);
}
/* the "In short" summaries; neutral border — green stays interactive-only and
   terracotta stays the broker gate (DESIGN.md Part 1.5) */
.legal blockquote {
  margin: var(--space-6) 0 0;
  padding: var(--space-4) var(--space-6);
  max-width: var(--measure);
  background: var(--surface-1);
  border-left: var(--space-1) solid var(--border-strong);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.legal blockquote p {
  margin-top: 0;
}
.legal blockquote p + p {
  margin-top: var(--space-3);
}
/* tables render square, as everywhere else (DESIGN.md Part 6: tables 0) */
.legal table {
  display: block;
  overflow-x: auto;
  margin-top: var(--space-6);
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.legal th,
.legal td {
  border: var(--hairline) solid var(--border);
  padding: var(--space-2) var(--space-3);
  text-align: left;
  vertical-align: top;
  color: var(--text-secondary);
}
.legal th {
  background: var(--surface-2);
  color: var(--text-primary);
  font-weight: 600;
}
.legal code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--surface-2);
  padding: 0 var(--space-1);
}
/* section separation is carried by heading rhythm; the pandoc <hr>s would double it */
.legal hr {
  display: none;
}
/* the policy cites bare URLs; unbreakable, they push the page wider than a phone */
.legal a {
  overflow-wrap: anywhere;
}

/* footer — the entity-level disclaimer lives here verbatim (pin W-003) */
.site-footer {
  margin-top: var(--space-16);
  border-top: var(--hairline) solid var(--border);
}
.site-footer .wrap {
  padding-block: var(--space-8);
}
.site-footer p {
  max-width: var(--measure);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.site-footer .copyright {
  margin-top: var(--space-4);
}
.accessibility-help {
  margin-top: var(--space-4);
  max-width: var(--measure);
  font-size: var(--text-sm);
}
.accessibility-help summary {
  width: fit-content;
  padding: var(--space-3) var(--space-4);
  border: var(--hairline) solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
  transition: color var(--transition);
}
.accessibility-help summary:hover {
  color: var(--accent-hover);
}
.accessibility-help p {
  margin-top: var(--space-4);
}

/* homepage composition; document pages retain their existing scale and rhythm */
.home .wrap {
  max-width: var(--container-home);
  padding-inline: var(--home-gutter);
}
.home {
  overflow-wrap: anywhere;
}
.home .button {
  max-width: 100%;
}
.home .site-header {
  border-bottom: 0;
}
.home section h2 {
  font-size: var(--text-home-section);
  font-weight: 400;
  line-height: var(--leading-tight);
  text-wrap: balance;
}
.home .evidence .wrap,
.home .pipeline .wrap,
.home .boundary .wrap,
.home .cta-section .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: var(--space-12) var(--space-20);
  padding-block: var(--space-24);
}
.home .section-lede,
.home .pipeline ol,
.home .boundary-list {
  margin-top: 0;
}
.home .evidence .shot-block {
  grid-column: 1 / -1;
  margin: var(--space-4) 0 0;
}
.home .evidence .shot-caption {
  margin-top: var(--space-4);
}
.home .pipeline li:first-child {
  padding-top: 0;
  border-top: 0;
}
.home .gate-section .wrap {
  padding-block: var(--space-16);
}
.home .gate-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  column-gap: var(--space-20);
  row-gap: var(--space-4);
}
.home .gate-inner h2 {
  grid-row: 1 / 3;
}
.home .gate-inner p {
  margin-top: 0;
}
.home .cta-section {
  background: var(--surface-1);
}
.home .cta-section h2 {
  grid-row: 1 / 3;
}
.home .cta-section .wrap {
  row-gap: var(--space-8);
}
.home .cta-section .cta-row {
  grid-column: 2;
  margin-top: 0;
}
.home .site-footer {
  margin-top: 0;
}
.home .site-footer .wrap {
  padding-block: var(--space-12);
}

@media (max-width: 72rem) {
  .site-header .wrap {
    position: relative;
    flex-wrap: wrap;
    gap: 0;
  }
  .wordmark {
    font-size: var(--text-xl);
  }
  .desktop-nav {
    flex-basis: 100%;
    justify-content: space-between;
    margin-top: var(--space-6);
    gap: var(--space-4);
  }
  .desktop-nav > .button {
    position: absolute;
    inset-block-start: var(--space-4);
    inset-inline-end: var(--home-gutter);
  }
}

@media (max-width: 40rem) {
  .hero h1 {
    font-size: var(--text-3xl);
  }
  .site-header .wrap {
    gap: var(--space-4);
  }
  .desktop-nav {
    display: none;
  }
  .mobile-menu {
    display: block;
    min-width: 0;
    margin-left: auto;
  }
  .mobile-menu[open] {
    flex-basis: 100%;
    margin-left: 0;
  }
  .mobile-menu summary {
    width: fit-content;
    margin-left: auto;
  }
  .mobile-menu .site-nav {
    margin-left: 0;
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: var(--hairline) solid var(--border);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2) var(--space-4);
    align-items: start;
  }
  .mobile-menu .site-nav > a:not(.button) {
    padding-block: var(--space-3);
    overflow-wrap: anywhere;
  }
  .mobile-menu .button {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: var(--space-2);
  }
}

@media (max-width: 56rem) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-12);
    padding-block: var(--space-12) 0;
  }
  .hero-copy {
    justify-self: start;
  }
  .home .evidence .wrap,
  .home .pipeline .wrap,
  .home .boundary .wrap,
  .home .cta-section .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-8);
    padding-block: var(--space-16);
  }
  .home .gate-section .wrap {
    padding-block: var(--space-8);
  }
  .home .gate-inner {
    grid-template-columns: minmax(0, 1fr);
    padding-left: var(--space-6);
    gap: var(--space-6);
  }
  .home .gate-inner h2,
  .home .cta-section h2 {
    grid-row: auto;
  }
  .home .cta-section .cta-row {
    grid-column: auto;
  }
  .pipeline li {
    grid-template-columns: var(--space-8) 1fr;
    gap: var(--space-4);
  }
  .home .pipeline li {
    grid-template-columns: var(--space-8) minmax(0, 1fr);
  }
  .step-gate {
    margin-left: calc(-1 * var(--space-4) - var(--space-1));
    padding-left: var(--space-4);
  }
}

/* Content is visible in its final position unless a one-time entrance is running. */
@keyframes content-enter {
  from { transform: translateY(var(--motion-distance)); }
  to { transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
  [data-reveal].is-entering {
    animation: content-enter var(--motion-duration) var(--motion-easing);
  }
  [data-reveal]:focus-within,
  [data-reveal]:target,
  :target [data-reveal],
  html:has(.skip-link:focus) {
    animation: none;
    scroll-behavior: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation: none !important;
    transition: none !important;
  }
}
