/* The palette — docs/colour-palette.md.
   Sampled from the reference mock-up's pixels and measured against WCAG; the ratios are in that file.

   Why this is an override file and not an edit to the stylesheets themselves: every page loads a bundle out
   of assets/css/build/, each of which says "GENERATED by tools/build-css.mjs … Do not edit" — and tools/ is
   not in this repository and never has been. Editing the generated file is editing something that claims it
   will be overwritten; editing the source it was generated from changes nothing, because nothing rebuilds.
   So the palette is one file, loaded last, that gives the existing token names new values. Every
   var(--ink), var(--blue) and var(--line) in those 2.3 MB picks them up with nothing else touched, and the
   whole change is reverted by deleting this file and its line in components/root.tsx.

   It is a bridge, not a destination: when the pipeline is sorted out these values belong in the source. */

:root {
  /* ---------- the new names (docs/colour-palette.md) ---------- */
  --color-cream: #F9F2EC;
  --color-white: #FFFFFF;
  --color-sand: #EFE2D1;
  --color-icon-bg: #F3F0E9;

  --color-navy: #15243E;
  --color-navy-hover: #0F1B2E;
  --color-navy-active: #0B1422;
  --color-navy-soft: #1D3252;

  --color-text: #15243E;
  --color-text-secondary: #414E5F;
  --color-text-muted: #6B7788;
  --color-text-on-dark: #FFFFFF;
  --color-text-on-dark-secondary: #A9B6CC;

  /* gold is a DISPLAY colour: 3.19 on cream, which is AA for 18px and up and nothing below it.
     --color-gold-ink is the one to use the moment it has to be small text, a badge or a filled chip. */
  --color-gold: #A9814E;
  --color-gold-ink: #8A5A2B;
  --color-gold-tint: #F6EEE2;
  --color-gold-line: #E3D3BC;

  /* There is no blue in this palette. A link inside a paragraph is told apart from the navy around it by the
     warm gold ink and its underline, not by a second brand colour. 5.29 on cream, 5.87 under white. */
  --color-link: #8A5A2B;
  --color-link-hover: #15243E;
  --color-link-tint: #F6EEE2;

  --color-success: #16834D;
  --color-success-tint: #E4F2EA;
  --color-success-ink: #0F6B3E;
  --color-warning: #8A5A2B;
  --color-warning-tint: #F6EEE2;
  --color-error: #C62828;
  --color-error-tint: #FBEAE8;
  --color-error-ink: #A8201A;

  --color-border: #E3D3BC;
  --color-border-neutral: #E6E3DF;
  --color-border-strong: #D3C4AC;
  --color-divider: rgba(21, 36, 62, .08);

  /* ---------- the existing names, pointed at the new values ----------
     These are what the 2.3 MB of stylesheets actually reference. The mapping is deliberate, not mechanical:
     the notes say where a name's meaning changed rather than just its value. */

  /* ink. --ink is used 951 times, more than any other token. */
  --ink: var(--color-text);
  --ink-2: var(--color-text-secondary);
  --ink-3: var(--color-text-secondary);
  --ink-4: var(--color-text-muted);
  --body: var(--color-text-secondary);
  --mute: var(--color-text-muted);
  --head: var(--color-navy);

  /* surfaces */
  --paper: var(--color-white);
  --white: var(--color-white);
  --ivory: var(--color-cream);
  --sand-bg: var(--color-cream);
  --sand: var(--color-sand);
  --sand-2: var(--color-gold-tint);
  --soft: var(--color-cream);
  --soft-2: var(--color-gold-tint);
  --sky: var(--color-gold-tint);
  --dune: var(--color-border-strong);

  /* The action colour is navy (the reference has no bright blue on it, and both of its buttons are navy).
     --blue and --em are the button and accent tokens throughout; --blue-ink / --em-ink / --z-link are what
     inline links use. Blue is gone from all of them: beige and blue were the pairing being got rid of. */
  --blue: var(--color-navy);
  --blue-d: var(--color-navy-hover);
  --blue-t: var(--color-gold-tint);
  --blue-ink: var(--color-link);
  --em: var(--color-navy);
  --em-d: var(--color-navy-hover);
  --em-t: var(--color-gold-tint);
  --em-ink: var(--color-link);
  --z-blue: var(--color-navy);
  --z-blue-d: var(--color-navy-hover);
  --z-link: var(--color-link);

  /* gold / bronze / orange all collapse onto the one accent. --or was #FF8939, which cannot hold text at
     all (2.39 against white); anything that was orange and carries a letter now gets the ink. */
  --gold: var(--color-gold);
  --gold-d: var(--color-gold-ink);
  --gold-t: var(--color-gold-tint);
  --gold-hi: #C9A978;
  --bronze: var(--color-gold-ink);
  --or: var(--color-gold);
  --z-or: var(--color-gold);

  /* status */
  --ok: var(--color-success);
  --ok-t: var(--color-success-tint);
  --z-ok: var(--color-success);
  --z-ok-t: var(--color-success-tint);
  --red: var(--color-error);
  --red-t: var(--color-error-tint);
  --bad: var(--color-error);
  --bad-t: var(--color-error-tint);
  --warn: var(--color-warning);
  --warn-t: var(--color-warning-tint);

  /* lines */
  --line: var(--color-border-neutral);
  --line-2: var(--color-divider);
  --line-w: rgba(169, 129, 78, .22);
  --ring: var(--color-border-strong);
  --z-line: var(--color-border-neutral);
  --z-line-w: rgba(169, 129, 78, .22);

  /* the dark end of the page: footer and deep bands */
  --navy: var(--color-navy);
  --night: var(--color-navy);
  --night-2: var(--color-navy-soft);
  --deep: var(--color-navy);
  --z-deep: var(--color-navy);
  --z-navy: var(--color-navy);

  /* section tints */
  --tint-warm: var(--color-gold-tint);
  --tint-blue: var(--color-gold-tint);
  --tint-mint: var(--color-success-tint);
  --z-tint: var(--color-gold-tint);
  --z-sand: var(--color-sand);
  --z-card: var(--color-white);
  --z-ink: var(--color-text);
  --z-body: var(--color-text-secondary);
  --z-mute: var(--color-text-muted);
  --z-e: var(--color-gold);

  /* Shadows carried a blue cast (rgba(11,42,91,…)) that reads cold on cream. Same geometry, navy cast. */
  --sh: 0 1px 2px rgba(21, 36, 62, .05), 0 12px 28px -18px rgba(21, 36, 62, .26);
  --sh-2: 0 26px 56px -30px rgba(21, 36, 62, .42);
  --card-sh: 0 1px 2px rgba(21, 36, 62, .05), 0 10px 24px -16px rgba(21, 36, 62, .22);
  --z-card-h: 0 18px 40px -24px rgba(21, 36, 62, .35);
}

/* The page itself. body had `background:#fff` hard-coded in the bundle rather than taking a token, so it
   cannot be moved by a variable alone. Cream is the page; white stays for the cards that sit on it. */
body {
  background: var(--color-cream);
}

/* ---------- the display accent ----------
   The hero's second line (.gl) took --blue-ink, which is also what every inline link uses, so the two could
   not be separated by a variable alone. In the reference that line is the gold — it is the one place the
   accent is meant to carry a whole phrase, and at ~56px gold on cream (3.19) is AA for large text.
   Links stay blue. The selector is `h1 .gl`, matching the bundle's own, because a bare `.gl` is one point
   less specific and loses however late it is read. The rule restates -webkit-text-fill-color because the
   bundle sets it for the gradient this accent used to be. */
h1 .gl {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: var(--color-gold);
  -webkit-text-fill-color: currentColor;
}

/* ---------- a button's label is navy ----------
   --blue-ink is the inline-link colour, and gold is right for a link inside a sentence. .btn-o (the outlined
   "Apply Now" on the cards) and .btn-l on hover are the two places that token lands on a control instead, where
   a warm ink reads weaker than the navy it sits beside — and weaker than the same button on /visas, which takes
   a different class. Both load after the bundle at equal specificity, so this wins without !important. */
.btn-o,
.btn-l:hover {
  color: var(--color-navy);
}

/* ---------- blog topic pills and search (owner, 2 Dec) ----------
   The bundle paints them #F6F5F3, picked for a white page; on the cream page (body above) they were the same
   colour as what they sit on and only the text showed. White with a hairline, like the cards; hover and the
   picked pill keep the bundle's sand and ink. */
.bl-chips button:not([aria-pressed="true"]),
.bl-q input {
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}
.bl-chips button:not([aria-pressed="true"]):hover,
.bl-q input:hover {
  background: #EFE2D1;
  box-shadow: inset 0 0 0 1px transparent;
}
.bl-q input:focus {
  background: #fff;
  box-shadow: 0 0 0 1.5px var(--em, #15243E);
}
