/**
 * Prizmetrics public site.
 *
 * The tokens are the ones the portal uses, so the marketing page and the
 * product do not look like two different companies. Anything defined only
 * inside a media query would be undefined for a visitor whose OS is set to
 * "system", so every token is declared on bare :root first and only
 * *redefined* under dark.
 *
 * WHERE THEY DELIBERATELY DIVERGE
 *
 * The status colours are not copied from the portal wholesale, because the two
 * surfaces put them on different backgrounds. The portal draws them on its own
 * panels; this site draws them on white and on tinted message strips, and three
 * of the portal's values fail contrast there — its amber measures 1.83:1 as
 * text on white. Every value below was measured against the background it is
 * actually used on, and the ratio is recorded beside it. docs/brand-system.md
 * carries the full table.
 */
:root {
  --ground: #fafafc;
  --surface: #ffffff;
  --surface-2: #f4f4f8;
  --ink: #10131c;
  --ink-2: #454a5e;

  /*
   * 4.90:1 on --surface, 4.71:1 on --ground. Was #767c92, which measured 4.14
   * and 3.97 and so failed on both — the same defect the portal found and fixed
   * in its own palette without the fix reaching here. This token carries the
   * chart axis and month labels in the hero at 8.5px, which is exactly the text
   * least able to afford it.
   */
  --ink-3: #6b7085;

  --line: #e3e3ec;
  --line-strong: #c9cad8;

  --accent: #4a3ae8;
  --accent-soft: #eeecfd;
  --accent-ink: #ffffff;

  /*
   * Marks, not text. --good is the tick glyph (3.35:1, clearing the 3:1 that
   * non-text needs) and --bad the error strip's edge (4.80:1).
   */
  --good: #0ca30c;
  --bad: #d03b3b;

  /*
   * Amber is the exception: its only uses are the hero's dashed target line and
   * the label on it, both on white. The portal's #fab219 is unreadable there,
   * so this is carried down until the label clears 4.5:1 (5.14 on --surface,
   * 4.93 on --ground) and the line comfortably clears the 3:1 for a graphical
   * object that carries meaning.
   */
  --warn: #9a6100;

  --good-soft: #e6f5ec;
  --bad-soft: #fbeae8;

  /*
   * Text on the tinted strips, which is a harder problem than text on white:
   * the background is already carrying the hue. 6.69:1 and 4.82:1 respectively.
   * The portal solves the same problem the same way, with --success-text.
   */
  --good-text: #006300;
  --bad-text: #c22f2f;

  /*
   * Headings in a serif, everything else in Inter. --data is the role the
   * monospace face used to fill: kickers, dates, step numbers, table labels and
   * figures. It is now Inter, and body text turns on tabular numerals so those
   * figures still align without a third face.
   */
  --display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --data: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;

  --r: 6px;
  --shadow: 0 1px 2px rgba(16, 19, 28, .05), 0 8px 24px -12px rgba(16, 19, 28, .18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0b0d14;
    --surface: #14161f;
    --surface-2: #1b1e29;
    --ink: #f2f3f8;
    --ink-2: #b3b7c7;
    /* 6.12:1 on --ground, 5.69:1 on --surface. Was #7f849a, which passed but
       with less headroom than the portal's equivalent; aligned to it. */
    --ink-3: #8b90a4;
    --line: #262a37;
    --line-strong: #3a3f52;
    --accent: #8579ff;
    --accent-soft: #201d3d;
    --accent-ink: #0b0d14;

    /* Dark needs no separate text variants: on these grounds the mark colours
       already clear 4.5:1 as text (6.53, 8.51 and 5.38), so the -text tokens
       resolve to the same values rather than inventing a difference. */
    --good: #3fbb7d;
    --warn: #e0a93a;
    --bad: #e8695c;
    --good-soft: #12261c;
    --bad-soft: #2b1614;
    --good-text: #3fbb7d;
    --bad-text: #e8695c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px -12px rgba(0, 0, 0, .7);
  }
}

/**
 * Self-hosted, so a visitor reading a page about data minimisation does not
 * announce themselves to a third party in order to read it. It also keeps both
 * Google origins out of the content security policy.
 *
 * TWO FACES, TWO FILES
 *
 * Source Serif 4 carries headings and Inter carries everything else, figures
 * included. Both are variable fonts, so each is one file declared against a
 * weight RANGE. There is no monospace face: figures that must align in a column
 * use Inter's tabular numerals instead, which keeps the page to two downloads
 * and gives numbers the same voice as the text around them.
 *
 * Latin subset only. A character outside it falls back to the next font in the
 * stack for that glyph alone.
 *
 * font-display: swap, so text is readable in the fallback immediately and
 * reflows when the face arrives rather than leaving the page blank.
 */
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/assets/fonts/source-serif-4.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/inter.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  text-wrap: balance;
  margin: 0;
  /* -0.01em: a serif crowds at the -0.02em that suited Archivo. */
  letter-spacing: -0.01em;
  /**
   * Set here rather than inherited. Body copy runs at 1.55, which is right for
   * a paragraph and much too airy for a display face at 28px and up: a
   * two-line heading reads as two separate statements rather than one
   * sentence. Individual headings override where they need to.
   */
  line-height: 1.14;
}

/**
 * The header is sticky and 62px tall, so an anchor that scrolls its target to
 * y=0 puts the heading underneath it. Every jump link on this site lands on a
 * section id, so the offset belongs on the targets rather than on each link.
 */
[id] { scroll-margin-top: 84px; }
p { margin: 0; }
a { color: inherit; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 640px) { .wrap { padding: 0 18px; } }

.mark { display: block; flex: none; }
.brandrow { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brandrow .name {
  font-family: var(--body); font-weight: 700; font-size: 17px; letter-spacing: -0.02em; /* the logo stays sans whatever the heading face */
}

.spectral {
  height: 2px; border: 0; margin: 0;
  background: linear-gradient(90deg, #4a3ae8, #2a78d6, #1baf7a, #eda100, #eb6834, #d03b3b);
}

/* Screen-reader-only, for labels a sighted user gets from context. */
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 0 0 var(--r) 0;
}
.skip:focus { left: 0; }

.btn {
  font: inherit; font-size: 14px; font-weight: 550; cursor: pointer;
  padding: 10px 18px; border-radius: var(--r); border: 1px solid transparent;
  display: inline-block; text-align: center; text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn:focus-visible, a:focus-visible, button:focus-visible,
input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---------------- header ---------------- */
.site-head {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px; gap: 20px;
}
.site-links { display: flex; gap: 24px; align-items: center; font-size: 13.5px; color: var(--ink-2); }
.site-links a { text-decoration: none; }
.site-links a:hover { color: var(--ink); }
@media (max-width: 860px) { .site-links .hideable { display: none; } }

/* ---------------- hero ---------------- */
.hero { padding: 66px 0 60px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -180px -15% auto 42%; height: 460px;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 72%);
  pointer-events: none;
}
.hero .wrap {
  position: relative; display: grid;
  grid-template-columns: 1.15fr .85fr; gap: 46px; align-items: center;
}
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; gap: 34px; } }

.eyebrow-pill {
  display: inline-block; font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  padding: 5px 11px; border-radius: 20px; font-weight: 600;
}
.hero h1 {
  font-size: clamp(32px, 4.6vw, 52px); line-height: 1.05; font-weight: 700;
  margin-top: 18px; max-width: 15ch;
}
.hero .lede { margin-top: 18px; max-width: 52ch; color: var(--ink-2); font-size: 16.5px; }
.hero-cta { display: flex; gap: 11px; margin-top: 28px; flex-wrap: wrap; }

.herocard {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); overflow: hidden;
}
.herocard .cap {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 12px 15px; border-bottom: 1px solid var(--line);
}
.herocard .cap b { font-family: var(--display); font-size: 13px; font-weight: 600; }
.herocard .cap span { font-family: var(--data); font-size: 10.5px; color: var(--ink-3); }
.herocard .body { padding: 13px 15px 16px; }
.herocard .row { display: flex; gap: 18px; margin-top: 12px; }
.herocard .row div { flex: 1; }
.herocard .row .k { font-size: 10.5px; color: var(--ink-3); }
.herocard .row .v {
  font-family: var(--data); font-weight: 700; font-size: 19px;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.herocard .note {
  font-size: 10.5px; color: var(--ink-3); margin-top: 12px;
  border-top: 1px solid var(--line); padding-top: 9px;
}

/* ---------------- sections ---------------- */
.sect { padding: 84px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 640px) { .sect { padding: 56px 0; } }
.sect h2 { font-size: 28px; font-weight: 700; max-width: 22ch; }

/**
 * One banded section, not three. Uniform sections at uniform spacing give the
 * scroll no landmarks, so the page reads as one long column and a reader loses
 * their place. Alternating every section would be just as uniform; changing
 * exactly one gives the middle of the page an edge to register against.
 */
.sect.band { background: var(--surface-2); }

/**
 * Scroll rhythm.
 *
 * The floor is 0.55 opacity, never 0. A reveal that starts fully transparent
 * depends on the animation actually running: if the timeline range is
 * misjudged, the browser is one of the many that ignores it, or a thumbnail is
 * captured before it fires, the text is simply gone. Starting part-visible
 * means the worst failure is slightly faint copy rather than a blank page.
 *
 * Behind @supports because scroll-driven animations are not universal, and
 * behind a reduced-motion query because this is decoration and some people are
 * made unwell by it. Both fall back to fully visible, which is the correct
 * page either way.
 */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .sect > .wrap > *, .closer .wrap > * {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 45%;
    }
  }
}
@keyframes rise {
  from { opacity: .55; transform: translateY(14px); }
  to   { opacity: 1;   transform: none; }
}
.kicker {
  font-family: var(--data); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px;
}
.argument { max-width: 62ch; color: var(--ink-2); font-size: 16px; margin-top: 14px; }
.argument strong { color: var(--ink); font-weight: 600; }

.roles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-top: 30px; }
@media (max-width: 700px) { .roles { grid-template-columns: 1fr; } }
.role {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 24px 22px;
}
.role h3 { font-size: 16px; font-weight: 600; }
.role p { font-size: 14px; color: var(--ink-2); margin-top: 7px; }
.role .dot { width: 24px; height: 3px; border-radius: 2px; display: block; margin-bottom: 13px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 28px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { border-left: 2px solid var(--accent); padding-left: 16px; }
.step .s { font-family: var(--data); font-size: 11px; color: var(--accent); letter-spacing: .1em; }
.step h3 { font-size: 16px; font-weight: 600; margin-top: 6px; }
.step p { font-size: 14px; color: var(--ink-2); margin-top: 6px; }

/* ---------------- demo form ---------------- */
.demo { padding: 58px 0; }
.demo .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 46px; align-items: start; }
@media (max-width: 860px) { .demo .wrap { grid-template-columns: 1fr; gap: 30px; } }
.demo h2 { font-size: 30px; font-weight: 700; max-width: 18ch; }
.demo .sub { color: var(--ink-2); margin-top: 14px; max-width: 44ch; }
.demo .assur { margin-top: 22px; display: flex; flex-direction: column; gap: 9px; }
.demo .assur li { font-size: 13.5px; color: var(--ink-2); display: flex; gap: 9px; align-items: flex-start; }
.demo .assur { list-style: none; padding: 0; }
.demo .assur .tick { color: var(--good); flex: none; font-weight: 700; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 24px; box-shadow: var(--shadow);
}
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--ground); border: 1px solid var(--line-strong);
  border-radius: 5px; padding: 10px 11px;
}
.field textarea { resize: vertical; min-height: 92px; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .pair { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; }
.formnote { font-size: 12px; color: var(--ink-3); margin-top: 12px; }
.formmsg { font-size: 13.5px; margin-top: 14px; padding: 11px 13px; border-radius: 5px; }
/*
 * Consent. The checkbox is not decorative: it carries `required`, so the plain
 * form post is blocked by the browser and the Worker refuses a submission
 * without it, and the agreement is recorded against the row.
 *
 * align-items: flex-start so a label that wraps to two lines keeps its box
 * against the first line rather than floating to the vertical centre.
 */
.consent { display: flex; align-items: flex-start; gap: 9px; margin: 16px 0 14px; }
.consent input { margin: 2px 0 0; flex: none; width: 15px; height: 15px; accent-color: var(--accent); }
.consent label { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.consent a { color: var(--accent); }

.formmsg.ok { background: var(--good-soft); color: var(--good-text); }
.formmsg.err { background: var(--bad-soft); color: var(--bad-text); }

/* ---------------- document page ---------------- */
.doc { padding: 52px 0 20px; }
.doc .lead { max-width: 60ch; color: var(--ink-2); font-size: 16.5px; margin-top: 16px; }
.doc h1 { font-size: clamp(30px, 4vw, 42px); font-weight: 700; max-width: 18ch; }
.doc .updated { font-family: var(--data); font-size: 11.5px; color: var(--ink-3); margin-top: 18px; }

.clause { padding: 34px 0; border-top: 1px solid var(--line); }
.clause h2 { font-size: 21px; font-weight: 700; max-width: 26ch; }
.clause p { max-width: 64ch; color: var(--ink-2); margin-top: 12px; }
.clause p strong { color: var(--ink); font-weight: 600; }
.clause ul { max-width: 64ch; color: var(--ink-2); margin: 12px 0 0; padding-left: 20px; }
.clause li { margin-bottom: 6px; }
.clause code {
  font-family: var(--data); font-size: 12.5px;
  background: var(--surface-2); padding: 1px 5px; border-radius: 4px;
}

.rolebox { border: 1px solid var(--line); border-radius: var(--r); margin-top: 18px; overflow: hidden; }
.rolebox table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--surface); }
.rolebox th {
  text-align: left; font-weight: 500; color: var(--ink-3); font-size: 11px;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 9px 14px; border-bottom: 1px solid var(--line);
}
.rolebox td { padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.rolebox tr:last-child td { border-bottom: 0; }
/* 110px rather than 90: "underwriter" is the longest role name and wrapped it. */
.rolebox td:first-child { font-family: var(--data); font-size: 12.5px; color: var(--ink); width: 110px; }

.rolenote { font-size: 13.5px; color: var(--ink-2); margin-top: 14px; }

/* ---------------- draft banner and placeholders ---------------- */
/*
 * Deliberately loud. A draft of a legal document that looks finished is the
 * thing most likely to be published by accident, so it is marked on the page
 * itself rather than only in a commit message, and every value nobody has
 * supplied yet is highlighted individually.
 */
.draftbar {
  border: 1px solid var(--warn);
  border-radius: var(--r);
  padding: 12px 14px;
  margin: 18px 0 4px;
  font-size: 13.5px;
  color: var(--ink-2);
  background: var(--surface-2);
}
.draftbar strong { color: var(--ink); }

.pending {
  font-family: var(--data);
  font-size: .92em;
  color: var(--warn);
  border-bottom: 1px dotted var(--warn);
}

/* ---------------- data flow diagram ---------------- */
/*
 * Scrolls rather than shrinks. The diagram carries text, and an SVG scaled to a
 * 375px phone would render its 12px labels at under 5px — technically present
 * and actually unreadable. A minimum width plus a scrolling container keeps the
 * type legible and confines the horizontal scroll to the figure, never the page.
 */
.flow { margin: 20px 0 4px; overflow-x: auto; }
.flow svg { display: block; min-width: 800px; height: auto; }

.f-box { fill: var(--surface); stroke: var(--line); stroke-width: 1; }
/* The stage where the deletion happens, given the only accent on the diagram. */
.f-box-key { stroke: var(--accent); stroke-width: 1.6; }
/* Dashed, because this box is the one thing on the diagram that does not travel. */
.f-box-out { fill: var(--surface-2); stroke-dasharray: 4 3; }

.f-step { font-family: var(--data); font-size: 10.5px; letter-spacing: .08em; fill: var(--ink-3); }
.f-title { font-family: var(--body); font-size: 14px; font-weight: 600; fill: var(--ink); }
.f-body { font-family: var(--body); font-size: 12px; fill: var(--ink-2); }

.f-arrow, .f-arrow-down { stroke: var(--line-strong); stroke-width: 1.4; fill: none; }

/* ---------------- footer ---------------- */
.foot { background: var(--surface); border-top: 1px solid var(--line); padding: 40px 0 30px; }
/* Five columns since the landing pages landed: brand, product, measures,
   resources, trust. The brand column stays wider because it carries a line of
   prose rather than a list. */
.foot .cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.1fr 1fr; gap: 26px; }
@media (max-width: 1000px) { .foot .cols { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 760px) { .foot .cols { grid-template-columns: 1fr 1fr; } }
.foot h4 {
  font-family: var(--body); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 500;
}
.foot ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.foot li a { font-size: 13.5px; color: var(--ink-2); text-decoration: none; }
.foot li a:hover { color: var(--ink); }
.foot .legal {
  margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--ink-3);
}
