/* Evidarch — shared site system.
 *
 * Tokens are lifted from the console's own stylesheet (apps/control-plane/src/app/
 * globals.css) so the marketing site and the product read as one thing rather than two
 * teams' work. The neutrals carry a slight warm/olive bias — #f9f9f7 over #ffffff,
 * #e1e0d9 over a pure grey rule — which is what keeps a near-monochrome page from
 * reading as unconsidered.
 *
 * Colour discipline, inherited from the product: --seal is the only accent, and
 * --breach appears for exactly one thing (a chain that failed verification). Nothing
 * decorative is ever allowed to borrow either.
 */

/* -------------------------------------------------------------------- fonts
 *
 * Source Sans Pro, self-hosted. Two weights only — 400 and 600 — because those are the
 * two the design actually uses; shipping a Bold nobody references would be ~230KB of
 * dead weight.
 *
 * A real typeface rather than system-ui is most of the difference between a page that
 * looks assembled and one that looks designed: system-ui renders as Segoe on Windows,
 * SF on a Mac and Roboto on Android, so the page has no consistent voice and inherits
 * whatever the operating system feels like. Source Sans is a humanist face — open
 * apertures, slightly calligraphic terminals — which reads warmer than the geometric
 * sans that dominate software marketing.
 *
 * font-display: swap so text paints immediately in the fallback and swaps when the file
 * lands. Nothing is ever invisible while a font downloads.
 *
 * Served from our own origin, which the site's CSP (font-src 'self') requires anyway.
 */
@font-face {
  font-family: "Source Sans Pro";
  src: url("/assets/fonts/SourceSansPro-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans Pro";
  src: url("/assets/fonts/SourceSansPro-Semibold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------------- tokens */
:root {
  color-scheme: light;
  --paper:   #f9f9f7;
  --surface: #fcfcfb;
  --raised:  #f4f4f1;
  --ink:     #0b0b0b;
  --ink-2:   #52514e;
  --ink-3:   #706e68;
  --rule:    #e1e0d9;
  --rule-2:  rgba(11, 11, 11, 0.09);
  --seal:    #008300;
  --breach:  #d03b3b;
  --shadow:  0 1px 2px rgba(11, 11, 11, 0.05);
  --lift:    0 14px 40px rgba(11, 11, 11, 0.10);

  /* An old-style serif for display against a humanist sans for everything else — the
     pairing a printed report would use, which is the register this product belongs in.
     The serif stays a system chain: it is used at large sizes where the platform
     differences read as character rather than inconsistency, and loading a second
     webfont for a dozen headings is not worth another 200KB. */
  --display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --body: "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;

  --gap: clamp(64px, 8vw, 116px);
  --edge: clamp(20px, 4vw, 64px);
  /* Structural width. Prose is held to ~68ch separately by .narrow — the two are
     different jobs, and conflating them is what produced a thin centred column with
     dead margins on a wide display. */
  --wrap: 1320px;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --paper:   #0d0d0d;
    --surface: #1a1a19;
    --raised:  #202020;
    --ink:     #ffffff;
    --ink-2:   #c3c2b7;
    --ink-3:   #898781;
    --rule:    #2c2c2a;
    --rule-2:  rgba(255, 255, 255, 0.09);
    --seal:    #35a635;
    --breach:  #e26060;
    --shadow:  0 1px 2px rgba(0, 0, 0, 0.35);
    --lift:    0 14px 40px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0d0d0d; --surface: #1a1a19; --raised: #202020;
  --ink: #ffffff; --ink-2: #c3c2b7; --ink-3: #898781;
  --rule: #2c2c2a; --rule-2: rgba(255, 255, 255, 0.09);
  --seal: #35a635; --breach: #e26060;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --lift: 0 14px 40px rgba(0, 0, 0, 0.5);
}
:root[data-theme="light"] {
  color-scheme: light;
  --paper: #f9f9f7; --surface: #fcfcfb; --raised: #f4f4f1;
  --ink: #0b0b0b; --ink-2: #52514e; --ink-3: #706e68;
  --rule: #e1e0d9; --rule-2: rgba(11, 11, 11, 0.09);
  --seal: #008300; --breach: #d03b3b;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.05);
  --lift: 0 14px 40px rgba(11, 11, 11, 0.10);
}

/* --------------------------------------------------------------------- base */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--edge); }
.narrow { max-width: 68ch; }

h1, h2, h3 {
  font-family: var(--display); font-weight: 600; text-wrap: balance;
  margin: 0; letter-spacing: -0.015em;
}
h1 { font-size: clamp(38px, 6.4vw, 72px); line-height: 1.02; }
h2 { font-size: clamp(26px, 3.6vw, 40px); line-height: 1.12; }
h3 { font-size: 19px; line-height: 1.3; letter-spacing: -0.005em; }
p { margin: 0; }
a { color: inherit; }

.eyebrow {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--ink-3);
}
.lede { font-size: clamp(17px, 1.7vw, 20px); line-height: 1.6; color: var(--ink-2); }
.body-c { color: var(--ink-2); }
.fine { font-size: 13.5px; line-height: 1.6; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
code {
  font-family: var(--mono); font-size: 0.9em;
  background: var(--raised); border: 1px solid var(--rule);
  border-radius: 4px; padding: 1px 5px;
}

:is(a, button, summary):focus-visible {
  outline: 2px solid var(--seal); outline-offset: 3px; border-radius: 3px;
}
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface); color: var(--ink); padding: 10px 16px; z-index: 100;
  border: 1px solid var(--rule); border-radius: 6px;
}
.skip:focus { left: var(--edge); top: 10px; }

/* ---------------------------------------------------------------------- nav
   Two rows: identity and primary action on top, section tabs beneath. The tabs
   are the site's spine — always visible, never collapsed into a hamburger, and
   scrollable sideways on a narrow screen rather than hidden. Someone evaluating
   a compliance tool should be able to see the whole shape of it at a glance. */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav-top { display: flex; align-items: center; gap: 20px; height: 58px; }
.mark {
  display: flex; align-items: center; gap: 9px; font-weight: 600;
  letter-spacing: -0.02em; font-size: 16.5px; text-decoration: none;
}
.mark-glyph { width: 15px; height: 15px; flex: none; }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-note { font-size: 13px; color: var(--ink-3); }
@media (max-width: 620px) { .nav-note { display: none; } }

.tabs {
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  margin-bottom: -1px; /* the active underline sits on the nav's own border */
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; text-decoration: none; white-space: nowrap;
  font-size: 14px; color: var(--ink-2);
  padding: 11px 14px; border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tab:hover { color: var(--ink); border-bottom-color: var(--rule); }
.tab[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--seal); }
@media (max-width: 560px) {
  .tabs { padding-inline: var(--edge); margin-inline: calc(var(--edge) * -1); }
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 14.5px; font-weight: 500;
  padding: 9px 17px; border-radius: 6px; text-decoration: none;
  border: 1px solid var(--rule-2); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { border-color: var(--ink-3); }
.btn-solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-solid:hover { background: var(--ink-2); border-color: var(--ink-2); }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ----------------------------------------------------------------- sections
   `.section` owns vertical rhythm and the top rule; nothing else sets
   padding-block on a section, so the two can never fight over spacing. */
.section { padding-block: var(--gap); border-top: 1px solid var(--rule); }
.section-first { border-top: none; }
.sec-head {
  display: flex; flex-direction: column; gap: 14px;
  margin-bottom: clamp(32px, 4vw, 52px);
}

/* Heading beside its content rather than stacked above it.
 *
 * A page of centred blocks reads as a narrow column with dead margins on a wide
 * display, however wide the container is. Putting the section heading in its own
 * left rail uses the horizontal space for structure, keeps running text at a
 * readable measure, and gives the eye a fixed edge to track down the page. Below
 * 900px it collapses back to a stack, where a rail would just cramp both halves. */
.split { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(28px, 5vw, 76px); }
.split > .sec-head { margin-bottom: 0; }
.split-head { position: sticky; top: 116px; align-self: start; }
.split-body { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); gap: clamp(24px, 4vw, 36px); }
  .split-head { position: static; }
}
/* The rail is narrow, so its lede steps down from the display size. */
.split-head .lede { font-size: 15.5px; }

/* Page header used by every page except the landing page. */
.phead { padding-block: clamp(48px, 7vw, 88px) clamp(32px, 4vw, 52px); }
/* Constrain the CHILDREN, never this element.
 *
 * These live on the same node as .wrap (`class="wrap phead-in"`), and .wrap carries
 * `max-width: var(--wrap); margin: 0 auto`. Setting a max-width here instead would win
 * the cascade, shrink the whole container to the measure, and then .wrap's auto margins
 * would centre that narrow block in the viewport — leaving the header floating in the
 * middle of the page while full-width sections below start at the left edge. Capping the
 * children keeps the container doing its job and the text at a readable measure. */
.phead-in { display: flex; flex-direction: column; gap: 20px; }
.phead-in > * { max-width: 72ch; }

/* --------------------------------------------------------------- structures */
/* Ledger spine: numbered records. Only used where the content genuinely is a
   sequence, so the numbering carries information rather than decorating. */
.steps { display: grid; gap: 0; }
.step {
  display: grid; grid-template-columns: 76px minmax(0, 1fr);
  gap: clamp(16px, 3vw, 36px); padding-block: 30px; border-top: 1px solid var(--rule);
}
.step:first-child { border-top: none; }
.step-n {
  font-family: var(--mono); font-size: 12px; color: var(--ink-3);
  letter-spacing: 0.08em; padding-top: 5px;
}
.step-b { display: flex; flex-direction: column; gap: 9px; max-width: 66ch; }
@media (max-width: 640px) { .step { grid-template-columns: minmax(0, 1fr); gap: 8px; } }

.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: 1px; background: var(--rule); border: 1px solid var(--rule);
  border-radius: 10px; overflow: hidden;
}
.card { background: var(--surface); padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.card-k { display: flex; align-items: center; gap: 8px; }
.card h3 { font-family: var(--body); font-size: 14.5px; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

/* Two-column definition rows: claim on the left, substance on the right. */
.props { display: grid; gap: 0; }
.prop {
  display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: clamp(16px, 4vw, 48px); padding-block: 24px; border-top: 1px solid var(--rule);
}
.prop:first-child { border-top: none; }
.prop p { font-size: 16px; line-height: 1.6; color: var(--ink-2); }
@media (max-width: 760px) { .prop { grid-template-columns: minmax(0, 1fr); gap: 6px; } }

/* Same content, laid out as a panel of cards instead of a long stack. Used where
   there are enough items that a single column would run far down the page and
   leave the width unused. */
.props-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1px; background: var(--rule); border: 1px solid var(--rule);
  border-radius: 10px; overflow: hidden;
}
.props-grid > .prop {
  grid-template-columns: minmax(0, 1fr); gap: 9px;
  padding: 24px; border-top: none; background: var(--surface);
}
.props-grid > .prop p { font-size: 14.5px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl th {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 400;
}
.tbl td:first-child { font-weight: 600; }
.tbl td:last-child { color: var(--ink-2); }
.scroll-x { overflow-x: auto; }

/* A panel for things that need to sit apart from the running text. */
.panel {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px;
  padding: 22px; display: flex; flex-direction: column; gap: 10px;
}
.panel-seal { border-left: 2px solid var(--seal); }

/* Faint monospace ledger strip, for showing record shapes. */
.strip {
  font-family: var(--mono); font-size: 12px; line-height: 1.85;
  background: var(--raised); border: 1px solid var(--rule); border-radius: 8px;
  padding: 14px 16px; overflow-x: auto; white-space: pre; color: var(--ink-2);
}
.strip b { color: var(--seal); font-weight: 400; }
.strip i { color: var(--ink-3); font-style: normal; }

/* ------------------------------------------------------------------- closing */
.end { padding-block: var(--gap); border-top: 1px solid var(--rule); }
.end-in { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.end-in > * { max-width: 62ch; }

/* Fixed bottom bar.
 *
 * Pinned to the viewport, so its height is permanently unavailable to the page — which
 * is why it is one row rather than the four-column sitemap it replaced. body reserves
 * the same height as padding, so the last section of every page clears it instead of
 * ending up underneath. On a narrow screen the link row scrolls sideways, the same
 * treatment as the tab strip, rather than wrapping the bar to three lines. */
.footbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--rule);
}
.footbar-in { display: flex; align-items: center; gap: clamp(14px, 2vw, 28px); height: 54px; }

.footbar-mark { font-size: 14.5px; gap: 8px; flex: none; }
.footbar-mark .mark-glyph { width: 13px; height: 13px; }
.footbar-gloss {
  font-family: var(--display); font-style: italic; font-size: 13px;
  color: var(--ink-3); margin-left: 8px; white-space: nowrap;
}
@media (max-width: 1180px) { .footbar-gloss { display: none; } }
@media (max-width: 620px) { .footbar-mark { font-size: 0; gap: 0; } }

.footbar-links {
  display: flex; align-items: center; gap: 16px; margin-left: auto;
  overflow-x: auto; scrollbar-width: none; min-width: 0;
}
.footbar-links::-webkit-scrollbar { display: none; }
.footbar-links a {
  font-size: 13px; color: var(--ink-2); text-decoration: none; white-space: nowrap; flex: none;
}
.footbar-links a:hover { color: var(--ink); }
.footbar-sep { width: 1px; height: 14px; background: var(--rule); flex: none; }

.footbar-theme {
  flex: none; margin-left: 4px; cursor: pointer; font: inherit; font-size: 14px;
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--rule-2); border-radius: 6px;
  background: var(--surface); color: var(--ink-2);
}
.footbar-theme:hover { color: var(--ink); border-color: var(--ink-3); }

/* Reserve the bar height so content can always scroll clear of it. */
body { padding-bottom: 54px; }


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
