/* Foundation Performance Cloud — design system.
 *
 * Aesthetic per BUILD_SPEC §6: gravitas, restraint, evidence-density, clarity.
 * Established-institution, not startup. The FP palette is used with restraint —
 * green as accent and large-heading colour, never as body text on white (it
 * fails WCAG AA there). A darker "green-ink" carries links/small accents at
 * >= 4.5:1 contrast.
 *
 * System font stack only — no Google Fonts, no third-party requests (a
 * sovereignty site should not call a US CDN for its typography).
 */

:root {
  /* FP brand */
  --fp-black: #181818;
  --fp-green: #60a840;     /* accent / large headings / rules — NOT body text on white */
  --fp-lime: #b8d030;      /* sparingly: highlights, focus glow */

  /* Derived, contrast-checked against white (#fff) */
  --green-ink: #2e6b1f;    /* links + small accents — ~5.6:1 on white (AA) */
  --ink: #181818;          /* body text — ~16:1 (AAA) */
  --ink-soft: #3a3a3a;     /* secondary text — ~10:1 (AAA) */
  --ink-muted: #585858;    /* tertiary / captions — ~6.5:1 (AA) */
  --line: #e4e6e1;         /* hairlines */
  --line-strong: #c9ccc4;
  --bg: #ffffff;
  --bg-soft: #f6f7f4;      /* section tint */
  --bg-ink: #181818;       /* dark sections */
  --bg-ink-soft: #232323;

  --maxw: 72rem;
  --maxw-prose: 42rem;
  --radius: 6px;
  --gap: clamp(1rem, 2.5vw, 2rem);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, "Noto Sans", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo,
    Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Skip link (a11y) --- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--fp-black);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* --- Layout --- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }
.prose { max-width: var(--maxw-prose); }
section { padding-block: clamp(2.75rem, 7vw, 5.5rem); }
section.tint { background: var(--bg-soft); }
section.ink { background: var(--bg-ink); color: #ececec; }
section.ink h1, section.ink h2, section.ink h3 { color: #fff; }
section.ink a { color: var(--fp-lime); }

/* --- Typography --- */
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.15; color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin: 0 0 0.5em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin: 0 0 0.6em; }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.4rem); margin: 1.6em 0 0.5em; }
p, ul, ol { margin: 0 0 1.1em; }
.lead { font-size: clamp(1.15rem, 2.2vw, 1.4rem); line-height: 1.5; color: var(--ink-soft); }
.eyebrow {
  font-family: var(--sans);
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--green-ink); margin: 0 0 0.9rem;
}
small, .caption { font-size: 0.875rem; color: var(--ink-muted); }
a { color: var(--green-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* Visible, high-contrast focus everywhere (a11y) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--fp-green);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- Header / nav --- */
.site-header { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 4.25rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand .mark { display: block; }
.brand .word { font-size: 1.05rem; line-height: 1.1; letter-spacing: -0.01em; }
.brand .word .sub { display: block; font-family: var(--sans); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-muted); text-transform: none; }

nav.primary { margin-left: auto; }
nav.primary ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; margin: 0; padding: 0; align-items: center; }
nav.primary a { font-family: var(--sans); font-size: 0.95rem; color: var(--ink-soft); text-decoration: none; padding: 0.4rem 0.2rem; }
nav.primary a:hover, nav.primary a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--fp-green); text-decoration-thickness: 2px; }

/* Mobile nav: details/summary disclosure (no JS dependency) */
.navtoggle { margin-left: auto; }
.navtoggle summary { list-style: none; cursor: pointer; padding: 0.5rem 0.75rem; border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: 0.9rem; color: var(--ink); }
.navtoggle summary::-webkit-details-marker { display: none; }
.navtoggle[open] > summary { background: var(--bg-soft); }

@media (max-width: 52rem) {
  nav.primary { display: none; }
  .navtoggle nav.primary { display: block; margin: 0; position: absolute; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 0.5rem clamp(1rem,4vw,2.5rem) 1rem; }
  .navtoggle nav.primary ul { flex-direction: column; align-items: stretch; gap: 0; }
  .navtoggle nav.primary a { display: block; padding: 0.7rem 0; border-top: 1px solid var(--line); }
}
@media (min-width: 52.01rem) { .navtoggle { display: none; } }

/* --- Buttons / CTAs --- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--sans); font-weight: 600; font-size: 1rem;
  padding: 0.8rem 1.4rem; border-radius: var(--radius);
  text-decoration: none; cursor: pointer; border: 2px solid transparent;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--fp-black); color: #fff; }
.btn-primary:hover { background: #000; text-decoration: none; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--fp-black); text-decoration: none; }
section.ink .btn-secondary { color: #fff; border-color: #555; }
section.ink .btn-secondary:hover { border-color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.6rem; }

/* --- Cards / grids --- */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; background: #fff; }
.card h3 { margin-top: 0; }
.card.pad-lg { padding: 1.75rem; }
section.tint .card { background: #fff; }

/* Signal list (trust signals) */
.signals { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 0.75rem; }
.signals li { padding-left: 1.9rem; position: relative; }
.signals li::before {
  content: ""; position: absolute; left: 0; top: 0.55em;
  width: 0.7rem; height: 0.7rem; border-radius: 2px;
  background: var(--fp-green);
}

/* Definition rows (e.g. provider list, attestation fields) */
.deftable { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
.deftable caption { text-align: left; color: var(--ink-muted); font-size: 0.9rem; margin-bottom: 0.6rem; }
.deftable th, .deftable td { text-align: left; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.deftable thead th { font-family: var(--sans); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); border-bottom: 2px solid var(--line-strong); }
.deftable tbody tr:hover { background: var(--bg-soft); }

/* Status pills */
.pill { display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.03em; padding: 0.18rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.pill-inplace { background: #e7f3e0; color: #245018; }
.pill-progress { background: #fdf3df; color: #6b4e10; }
.pill-planned { background: #eef0ee; color: #4a4a4a; }
.pill-nz { background: #e7f3e0; color: #245018; }
.pill-foreign { background: #fae9e6; color: #7a2418; }

/* Diagram (flow) — CSS/markup, no images */
.flow { display: grid; gap: 0.75rem; margin: 1.75rem 0; }
.flow-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.75rem; }
.flow-node { flex: 1 1 12rem; border: 1.5px solid var(--line-strong); border-radius: var(--radius); padding: 0.9rem 1rem; background: #fff; }
.flow-node .n-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); }
.flow-node .n-title { font-weight: 600; }
.flow-node.accent { border-color: var(--fp-green); }
.flow-node.ink { background: var(--fp-black); color: #fff; border-color: var(--fp-black); }
.flow-node.ink .n-label { color: #b9b9b9; }
.flow-arrow { align-self: center; color: var(--ink-muted); font-size: 1.4rem; }

/* Callout / note */
.callout { border-left: 4px solid var(--fp-green); background: var(--bg-soft); padding: 1.1rem 1.3rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.5rem 0; }
.callout.warn { border-left-color: #c9772a; }
.callout p:last-child { margin-bottom: 0; }

/* Hero */
.hero { padding-block: clamp(3rem, 9vw, 6.5rem); }
.hero .lead { max-width: 40rem; }
.hero .tagline { font-family: var(--serif); font-style: italic; color: var(--green-ink); font-size: clamp(1.1rem,2.4vw,1.45rem); margin: 0 0 1.2rem; }

/* Footer */
.site-footer { background: var(--fp-black); color: #c7c7c7; padding-block: 3rem 2rem; font-size: 0.95rem; }
.site-footer a { color: #e4e4e4; }
.site-footer h2 { color: #fff; font-size: 1rem; font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 0.9rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #333; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; color: #9a9a9a; }
.footer-reo { color: #b8d030; font-style: italic; }

/* Forms */
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.field .hint { display: block; font-size: 0.875rem; color: var(--ink-muted); margin-bottom: 0.4rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: 0.7rem 0.8rem; border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--fp-green); }
.field .req { color: #a3301f; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { padding: 1rem 1.2rem; border-radius: var(--radius); margin-bottom: 1.2rem; }
.form-status.ok { background: #e7f3e0; color: #245018; border: 1px solid #bcdcae; }
.form-status.err { background: #fae9e6; color: #7a2418; border: 1px solid #e7bcb4; }

/* Utility */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.muted { color: var(--ink-muted); }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Cookie/consent note (we set NO tracking cookies; this is informational) */
.consent { font-size: 0.85rem; color: var(--ink-muted); }
