/* Standard Trade site shell (proposal, Oct 2026): one set of tokens, one masthead, one footer for every page.
   Faces: General Sans for the brand, interface, headlines and labels (self-hosted); Source Serif 4 for reading text.
   Every page loads this file first; page styles (guides-v5.css, the home and research rules below) build on it. */

@font-face { font-family: "General Sans"; src: url("/fonts/GeneralSans-Variable.woff2") format("woff2"); font-weight: 200 700; font-style: normal; font-display: swap; }

:root {
  --ink: #141414;
  --text: #2b2b2b;
  --muted: #6b6b6b;
  --rule: rgba(0, 0, 0, 0.14);
  --rule-strong: rgba(0, 0, 0, 0.35);
  --brass: #866016;
  --brass-deep: #6f4f12;
  --brass-tint: #f7f1e3;
  --tint: #f5f4f1;
  --bar: #d8d5ce;
  --paper: #ffffff;
  --sans: "General Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --serif: "Source Serif 4", Charter, "Iowan Old Style", Georgia, serif;
  --gutter: 2rem;
  --shell: 67rem;          /* masthead, footer and the article grid share this width */
  --col: 44rem;            /* article column */
  --side: 18rem;           /* rail */
  --mast-h: 4rem;
  color-scheme: light;
}
@media (max-width: 720px) { :root { --gutter: 1.25rem; --mast-h: 3.5rem; } }

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body { min-height: 100vh; display: flex; flex-direction: column; padding-top: var(--mast-h); background: var(--paper); color: var(--text); font: 400 16px/1.5 var(--sans); font-kerning: normal; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
body > main { flex: 1; }
a { color: inherit; }
::selection { background: color-mix(in srgb, var(--brass) 28%, transparent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Masthead: identical on every page, fixed, so nothing shifts between pages or on scroll.
   Quiet on purpose: the wordmark and one link. No buttons, no taglines. ---------- */
.mast { position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: var(--mast-h); background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--rule); }
.mast-in { max-width: calc(var(--shell) + 2 * var(--gutter)); height: 100%; margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 2rem; }
.mast .wordmark { font-family: var(--sans); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.02em; line-height: 1; color: var(--ink); text-decoration: none; white-space: nowrap; }
.mast .now { flex: 1; min-width: 0; font-size: 0.9375rem; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .2s; }
.mast-nav { margin-left: auto; display: flex; align-items: center; gap: 1.75rem; font-size: 0.9375rem; font-weight: 500; white-space: nowrap; }
.mast-nav a { color: var(--ink); text-decoration: none; transition: color .15s; }
.mast-nav a:hover { color: var(--brass); }
.mast-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--brass); text-decoration-thickness: 1.5px; text-underline-offset: 0.5em; }
/* Trade Intelligence is a menu of its products (Background Check, Steel Mill Tracker). No script: <details> opens it,
   and while it is open the summary's ::before covers the screen, so a click anywhere else closes it. */
.mast-menu { position: relative; }
.mast-menu summary { display: flex; align-items: center; gap: 0.45em; list-style: none; cursor: pointer; color: var(--ink); transition: color .15s; }
.mast-menu summary::-webkit-details-marker { display: none; }
.mast-menu summary::after { content: ""; width: 0.36em; height: 0.36em; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-0.14em) rotate(45deg); }
.mast-menu[open] summary::after { transform: translateY(0.1em) rotate(-135deg); }
.mast-menu summary:hover, .mast-menu[open] summary { color: var(--brass); }
.mast-menu.on summary { text-decoration: underline; text-decoration-color: var(--brass); text-decoration-thickness: 1.5px; text-underline-offset: 0.5em; }
.mast-menu[open] summary::before { content: ""; position: fixed; inset: 0; cursor: default; }
.mast-sub { position: absolute; top: calc(100% + 0.85rem); right: 0; z-index: 1; min-width: 12.5rem; padding: 0.35rem 0; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--rule); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08); }
.mast-sub a { padding: 0.6rem 1rem; }
.mast-nav .mast-sub a[aria-current="page"] { text-decoration: none; color: var(--brass); }
.mast .progress { position: absolute; left: 0; bottom: -1px; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: var(--brass); }
.mast.scrolled .now { opacity: 1; }
@media (prefers-reduced-motion: no-preference) { .mast .progress { transition: transform .08s linear; } }
@media (prefers-reduced-motion: reduce) { .mast .now { transition: none; } }

/* ---------- Footer: identical on every page ---------- */
.g-footer { border-top: 1px solid var(--rule); }
.g-footer-in { max-width: calc(var(--shell) + 2 * var(--gutter)); margin: 0 auto; padding: 1.5rem var(--gutter) 2.5rem; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.75rem 1.5rem; font-size: 0.8125rem; color: var(--muted); }
.g-footer nav { display: flex; gap: 1.25rem; }
.g-footer a { color: var(--muted); text-decoration: none; }
.g-footer a:hover { color: var(--brass); }

/* ---------- Home: one sentence, set in a regular weight, on the shell's left edge ---------- */
.home { max-width: calc(var(--shell) + 2 * var(--gutter)); width: 100%; margin: 0 auto; padding: 4rem var(--gutter); display: flex; flex-direction: column; justify-content: center; }
.home .statement { max-width: 19em; margin-left: -0.04em; font-family: var(--sans); font-weight: 400; font-size: clamp(1.75rem, 1.1rem + 1.9vw, 2.5rem); line-height: 1.18; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
.home .sub { margin-top: 1.5rem; font-size: 1rem; color: var(--muted); }
.home .sub a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule-strong); transition: color .15s, border-color .15s; }
.home .sub a:hover { color: var(--brass); border-color: currentColor; }

/* ---------- Research: title, reading text, figure ---------- */
.research { max-width: calc(var(--shell) + 2 * var(--gutter)); width: 100%; margin: 0 auto; padding: 3rem var(--gutter) 5rem; }
.research .page-title { font-family: var(--sans); font-weight: 400; font-size: clamp(1.75rem, 1.1rem + 1.9vw, 2.5rem); line-height: 1.18; letter-spacing: -0.02em; color: var(--ink); }
.research .prose { max-width: 40rem; margin-top: 1.5rem; font-family: var(--serif); font-size: 1.25rem; line-height: 1.65; color: var(--text); }
.research .prose p + p { margin-top: 1em; }
.research .convergence { max-width: 40rem; margin-top: 3rem; }
.research .convergence svg { display: block; width: 100%; height: auto; overflow: visible; }
.research .convergence .cv-band { fill: var(--tint); }
.research .convergence .cv-buyer { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: miter; stroke-linecap: square; }
.research .convergence .cv-seller { fill: none; stroke: var(--muted); stroke-width: 1.25; stroke-linejoin: miter; stroke-linecap: square; }
.research .convergence .cv-deal { fill: none; stroke: var(--ink); stroke-width: 2; }
.research .convergence .cv-agreed { fill: var(--brass); }
.research .convergence text { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; fill: var(--muted); }
.research .convergence .cv-label-strong { fill: var(--ink); }
.research .convergence .cv-label-accent { fill: var(--brass); }
.research .convergence figcaption { margin-top: 1rem; font-size: 0.875rem; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .research .convergence.animate .cv-buyer, .research .convergence.animate .cv-seller { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: cv-draw 1.8s cubic-bezier(.4, 0, .2, 1) forwards; }
  .research .convergence.animate .cv-deal { stroke-dasharray: 200; stroke-dashoffset: 200; animation: cv-draw 0.6s 1.9s ease-out forwards; }
  .research .convergence.animate .cv-agreed, .research .convergence.animate .cv-label-accent { opacity: 0; animation: cv-appear 0.3s 1.8s forwards; }
  @keyframes cv-draw { to { stroke-dashoffset: 0; } }
  @keyframes cv-appear { to { opacity: 1; } }
}

@media (max-width: 720px) {
  .mast-in { gap: 1rem; }
  .mast .wordmark { font-size: 1.125rem; }
  .mast .now { display: none; }
  .mast-nav { gap: 1rem; }
  .research { padding-top: 1.75rem; }
  .mast-nav a { padding-block: 0.6rem; }
  .mast-nav a[aria-current="page"] { display: none; }   /* phones: the page you are on doesn't need a link, so the rest fit */
  .mast-nav .mast-sub a { display: block; padding-block: 0.7rem; }   /* the menu always lists both products */
  .g-footer a { padding-block: 0.7rem; }
  .research .prose { font-size: 1.125rem; }
  .research .convergence text { font-size: 16px; }
}

@media (max-width: 360px) {
  .mast .wordmark { font-size: 1rem; }
  .mast-nav { gap: 0.75rem; font-size: 0.875rem; }
}

/* Small phones: shrink the masthead so the wordmark and menu fit. */
@media (max-width: 400px) {
  .mast .wordmark { font-size: 1rem; }
  .mast-nav { gap: 0.75rem; font-size: 0.875rem; }
}

/* The Background Check page also carries Log in, so on the narrowest phones the menu drops out. */
@media (max-width: 340px) { .mast-nav:has([data-login]) .mast-menu { display: none; } }
