/*
  neurodivergent.work: the one stylesheet.

  Contents
   1. Fonts
   2. Tokens: light theme, type, space, motion
   3. Dark theme (from the device setting)
   4. Reduced motion token
   5. Base elements (a template with no classes should still look right)
   6. Layout helpers
   7. Site chrome: skip link, header, navigation, messages, footer
   8. Components
   9. Styleguide page only (.sg-*)
  10. Forced colours
  11. Reduced motion
  12. Print

  Rules for adding to this file
  - Every colour, space and type size comes from a custom property in section 2.
  - Class names: .block, .block__part, .block--variant. Keep the set small.
  - Nothing animates. Transitions use var(--duration), which is 0s when motion is reduced.
  - Colour is never the only signal: pair it with text, and an icon where it helps.
*/

/* 1. Fonts ------------------------------------------------------------------ */
/* Self-hosted woff2, SIL Open Font License (see static/fonts/*-OFL.txt). */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/fraunces-latin-normal.069cb90e11a3.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: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/fraunces-latin-ext-normal.a04d353989ad.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/fraunces-latin-italic.fa7ce081be5e.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: "Fraunces";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/fraunces-latin-ext-italic.53f8865644cd.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("../fonts/dm-sans-latin-normal.7c87a648293f.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: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("../fonts/dm-sans-latin-ext-normal.49935c4b6235.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans";
  font-style: italic;
  font-weight: 100 1000;
  font-display: swap;
  src: url("../fonts/dm-sans-latin-italic.d981d4cbcf42.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: "DM Sans";
  font-style: italic;
  font-weight: 100 1000;
  font-display: swap;
  src: url("../fonts/dm-sans-latin-ext-italic.331cc04da374.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* 2. Tokens ----------------------------------------------------------------- */

:root {
  color-scheme: light;

  /* Azul family palette (fixed in both themes) */
  --blue-900: #0b2545;
  --blue-700: #1e5aa8;
  --blue-500: #3b82c4;
  --blue-300: #5ba3d9;
  --blue-100: #e8f1fa;
  --blue-800: #123566;
  --blue-950: #061a33;
  --gold: #d4a853;
  --gold-light: #f4d58d;
  --tile-blue: #1b52a0;           /* blue-700 a shade deeper, so white text on it reaches 7.6:1 */

  /* Site chrome: header and footer. Navy in both
     themes; in dark it goes a step deeper than the page and gets a hairline edge. */
  --chrome-bg: #0b2545;
  --chrome-text: #c9d8ea;
  --chrome-strong: #ffffff;
  --chrome-accent: #d4a853;
  --chrome-line: #24406a;
  --chrome-edge: transparent;     /* the header's lower edge: needed only where the page is navy too */
  --chrome-hover: #123566;

  /* Light theme roles */
  --color-bg: #faf8f5;
  --color-sand: #f2eee7;
  --color-surface: #ffffff;
  --color-heading: #1a202c;
  --color-text: #3d4756;          /* family #4a5568 darkened: 8.1:1 on sand, so AAA everywhere */
  --color-muted: #5f6b7a;
  --color-link: #194c91;          /* blue-700 darkened a step: 7:1 or more on paper, sand and white */
  --color-link-hover: #0b2545;
  --color-accent: #7a5410;        /* gold for text: deep enough to pass on paper and white */
  --color-tile-gold: var(--gold); /* decoration only, never text */
  --color-border: #ddd5c8;        /* dividers and card edges (decorative) */
  --color-border-strong: #6b7787; /* form fields and controls: 4.3:1 on paper */
  --color-primary: #1e5aa8;
  --color-primary-hover: #174a8c;
  --color-on-primary: #ffffff;
  --color-focus: #0b2545;
  --color-highlight: #f6ead0;     /* featured cards, selected text */
  --color-tint: #e8f1fa;          /* info tint, steps tiles */
  --color-tint-text: #0b2545;
  --color-band: #e8f1fa;          /* the blue-100 band behind the latest jobs */
  --color-card-edge: transparent; /* cards on the band need no edge in light */
  --color-chip: #e8f1fa;
  --color-chip-text: #123566;
  --color-pay: #123566;
  --color-strong: #0b2545;        /* navy button */
  --color-on-strong: #ffffff;
  --tile-edge: transparent;

  --color-success: #1b6236;
  --color-success-bg: #e5f1e8;
  --color-warning: #774700;
  --color-warning-bg: #fbefd6;
  --color-danger: #a32323;
  --color-danger-bg: #fbe9e8;
  --color-on-danger: #ffffff;
  --color-info: #194c91;
  --color-info-bg: #e8f1fa;
  --color-neutral: #4a5363;
  --color-neutral-bg: #ece8e1;

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-brand: "Fraunces", Georgia, serif; /* the wordmark keeps this whatever the reading font */
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --root-size: 112.5%;            /* 18px when the browser default is 16px (research rule R8) */
  --step--1: 0.889rem;            /* 16px: meta text, never body copy or decision facts */
  --step-0: 1rem;                 /* 18px: body */
  --step-1: 1.167rem;             /* 21px */
  --step-2: 1.389rem;             /* 25px */
  --step-3: clamp(1.6rem, 1.4rem + 0.8vw, 1.85rem);
  --step-4: clamp(1.95rem, 1.6rem + 1.6vw, 2.5rem);
  --step-5: clamp(2.2rem, 1.7rem + 2.6vw, 3.25rem);

  --leading: 1.65;
  --leading-tight: 1.2;
  --tracking: normal;
  --tracking-heading: -0.01em;
  --word-spacing: normal;
  --para-space: 1em;
  --measure: 65ch;

  /* Space */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4.5rem;
  --gutter: clamp(1rem, 3vw, 2rem);
  --wrap: 64.5rem;                /* about 1160px of content at the 18px root */
  --target: 2.75rem;              /* 44px+ touch target */

  /* Shape */
  --radius-s: 0.375rem;
  --radius: 0.5rem;
  --radius-l: 0.875rem;
  --radius-button: 0.625rem;      /* 10px: buttons and fields */
  --radius-tile: 0.75rem;         /* 12px: monogram tiles */
  --radius-xl: 1.25rem;           /* 20px: cards, panels, tiles */
  --border-width: 1px;
  --control-border: 2px;
  --focus-width: 3px;

  /* Motion: short, and off when reduced */
  --duration: 120ms;
}

/* 3. Dark theme ------------------------------------------------------------- */
/* The site follows the device's light or dark setting. There is no control on the page. */

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --color-bg: #0b2545;
    --color-sand: #0d2848;
    --color-surface: #17304e;
    --color-heading: #ffffff;
    --color-text: #cfe0f2;
    --color-muted: #9aa7b8;
    --color-link: #8cc4ee;
    --color-link-hover: #ffffff;
    --color-accent: #d4a853;
    --color-border: #2c4a70;
    --color-border-strong: #8395ad;
    --color-primary: #8cc4ee;
    --color-primary-hover: #b5daf5;
    --color-on-primary: #0b2545;
    --color-focus: #f4d58d;
    --color-highlight: #2a3a4a;
    --color-tint: #1d3d63;
    --color-tint-text: #e8f1fa;
    --color-success: #94d8a8;
    --color-success-bg: #133a35;
    --color-warning: #f4d58d;
    --color-warning-bg: #3a3420;
    --color-danger: #f6aaa5;
    --color-danger-bg: #3d2233;
    --color-on-danger: #0b2545;
    --color-info: #8cc4ee;
    --color-info-bg: #12355c;
    --color-neutral: #c3cfdc;
    --color-neutral-bg: #233c5c;
    --color-band: #0f2b4f;
    --color-card-edge: #2c4a70;
    --color-chip: #1d3d63;
    --color-chip-text: #e8f1fa;
    --color-pay: #b5daf5;
    --color-strong: #8cc4ee;
    --color-on-strong: #0b2545;
    --tile-edge: rgb(255 255 255 / 0.18);
    --chrome-bg: #061a33;
    --chrome-line: #2c4a70;
    --chrome-hover: #0f2b4f;
    --chrome-edge: #2c4a70;
  }
}

/* 4. Reduced motion: the device setting turns transitions off --------------- */

@media (prefers-reduced-motion: reduce) {
  :root { --duration: 0s; }
}

/* 5. Base elements ---------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  font-size: var(--root-size);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--space-m);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading);
  letter-spacing: var(--tracking);
  word-spacing: var(--word-spacing);
  text-align: left;
  overflow-wrap: break-word;
  font-kerning: normal;
}

:where(p, ul, ol, dl, blockquote, pre, table, figure, fieldset, details, address) {
  margin-block: 0 var(--para-space);
}
:where(p, ul, ol, dl, blockquote, pre, table, figure, fieldset, details, address):last-child { margin-block-end: 0; }

:where(p, dd, blockquote, figcaption, legend, label, address, :where(ul, ol):not([class]) > li) { max-width: var(--measure); }

h1, h2, h3, h4, h5, h6 {
  margin-block: 0 var(--space-xs);
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-heading);
  color: var(--color-heading);
  text-wrap: balance;
  /* A long word, such as the site's name at 320px with large text, breaks
     instead of running off the screen. Only words too long for the line break. */
  overflow-wrap: anywhere;
  max-width: 34ch;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); margin-block-start: var(--space-xl); }
h3 { font-size: var(--step-2); margin-block-start: var(--space-l); }
h4 { font-size: var(--step-1); margin-block-start: var(--space-m); }
h5, h6 { font-size: var(--step-0); font-family: var(--font-body); font-weight: 700; margin-block-start: var(--space-m); }
:where(h1, h2, h3, h4, h5, h6):first-child { margin-block-start: 0; }

/* Emphasis inside a heading: upright, set apart by the accent colour only.
   No italics in headings (the wordmark's ".work" is part of the logo). */
:is(h1, h2, h3, h4) em { font-style: normal; color: var(--color-accent); }

a {
  color: var(--color-link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--duration), text-decoration-thickness var(--duration);
}
a:hover { color: var(--color-link-hover); text-decoration-thickness: 2px; }

:focus-visible {
  outline: var(--focus-width) solid var(--color-focus);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

strong, b { font-weight: 700; color: var(--color-heading); }
small { font-size: var(--step--1); }

ul, ol { padding-inline-start: 1.4em; }
li + li { margin-block-start: 0.35em; }
li::marker { color: var(--color-muted); }

dt { font-weight: 700; color: var(--color-heading); }
dd { margin: 0 0 var(--space-xs); }

blockquote {
  margin-inline: 0;
  padding: var(--space-xs) var(--space-m);
  border-inline-start: 4px solid var(--color-tile-gold);
  background: var(--color-sand);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--color-heading);
}
blockquote p { max-width: none; }
blockquote footer, blockquote cite { display: block; margin-top: var(--space-2xs); font-family: var(--font-body); font-size: var(--step--1); font-style: normal; color: var(--color-muted); }

hr {
  border: 0;
  border-top: var(--border-width) solid var(--color-border);
  margin-block: var(--space-l);
}

img, svg, video { max-width: 100%; height: auto; }
img { display: block; }

code, kbd, samp, pre { font-family: var(--font-mono); font-size: 0.9em; }
:not(pre) > code { padding: 0.1em 0.35em; background: var(--color-sand); border-radius: var(--radius-s); color: var(--color-heading); }
pre { overflow-x: auto; padding: var(--space-s); background: var(--color-sand); border-radius: var(--radius); line-height: 1.5; }
/* Text to copy as it is, such as an email in a guide: wraps, in the body font. */
.copy-text { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-body); font-size: var(--step-0); line-height: 1.55; padding: var(--space-m); border: var(--border-width) solid var(--color-border); }

abbr[title] { text-decoration: underline dotted; text-underline-offset: 0.2em; }

mark { background: var(--color-highlight); color: var(--color-heading); padding: 0 0.15em; }
::selection { background: var(--color-highlight); color: var(--color-heading); }

table { width: 100%; border-collapse: collapse; }
caption { text-align: left; font-weight: 700; color: var(--color-heading); padding-block-end: var(--space-2xs); }
th, td { text-align: left; vertical-align: top; padding: var(--space-xs) var(--space-s) var(--space-xs) 0; border-bottom: var(--border-width) solid var(--color-border); }
th { color: var(--color-heading); font-weight: 700; }
thead th { border-bottom-width: 2px; border-bottom-color: var(--color-border-strong); }

/* Forms: plain elements */
fieldset {
  min-width: 0;
  margin-inline: 0;
  padding: 0;
  border: 0;
}
legend {
  padding: 0;
  margin-block-end: var(--space-2xs);
  font-weight: 700;
  color: var(--color-heading);
}
label { display: block; font-weight: 600; color: var(--color-heading); margin-block-end: var(--space-3xs); }

input, select, textarea, button { font: inherit; letter-spacing: inherit; word-spacing: inherit; }

:where(input:not([type="checkbox"], [type="radio"], [type="submit"], [type="button"], [type="reset"], [type="hidden"], [type="file"], [type="range"], [type="color"]), select, textarea) {
  display: block;
  width: 100%;
  max-width: var(--field-width, 32rem);
  min-height: var(--target);
  padding: 0.55rem 0.75rem;
  color: var(--color-heading);
  background-color: var(--color-surface);
  border: var(--control-border) solid var(--color-border-strong);
  border-radius: var(--radius-button);
  line-height: 1.4;
  transition: border-color var(--duration);
}
textarea { min-height: 8rem; resize: vertical; max-width: var(--field-width, 42rem); }
select {
  appearance: none;
  padding-inline-end: 2.5rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 1.15rem center, right 0.8rem center;
  background-size: 0.36rem 0.36rem, 0.36rem 0.36rem;
  background-repeat: no-repeat;
}
::placeholder { color: var(--color-muted); opacity: 1; }
:where(input, select, textarea):hover { border-color: var(--color-heading); }
:where(input, select, textarea):focus-visible { outline-offset: 1px; }
:where(input, select, textarea)[aria-invalid="true"] {
  border-color: var(--color-danger);
  border-inline-start-width: 6px;
}
:where(input, select, textarea):disabled { background-color: var(--color-sand); color: var(--color-muted); cursor: not-allowed; }

input[type="checkbox"], input[type="radio"] {
  width: 1.375rem;
  height: 1.375rem;
  margin: 0;
  flex: none;
  accent-color: var(--color-primary);
}

input[type="file"] { font-size: var(--step-0); max-width: 100%; }

button { cursor: pointer; }
:where(button:not([class]), input[type="submit"]:not([class]), input[type="button"]:not([class])) {
  min-height: var(--target);
  padding: 0.55rem 1.25rem;
  border: var(--control-border) solid var(--color-primary);
  border-radius: var(--radius-button);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 600;
}

details > summary { cursor: pointer; }

[hidden] { display: none !important; }

/* 6. Layout helpers --------------------------------------------------------- */

.visually-hidden:not(:focus, :active) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Content column. Direct children of <main> are wrapped by default; a .band
   runs edge to edge and puts a .wrap inside. */
.wrap,
.site-main > :where(:not(.band)) {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}
.wrap--narrow { --wrap: 46rem; }

.band { padding-block: var(--space-xl); }
.band--sand { background: var(--color-sand); }
.band--tint { background: var(--color-band); }

.section { margin-block: var(--space-xl); }
.section:first-child { margin-block-start: 0; }

.stack > * { margin-block: 0; }
.stack > * + * { margin-block-start: var(--stack-space, var(--space-s)); }
.stack--l { --stack-space: var(--space-l); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-space, var(--space-xs));
}
.cluster > * { margin: 0; }
/* A row of buttons at the top of a page, followed by more content. */
.wrap > .cluster:not(:last-child) { margin-block-end: var(--space-m); }

.grid {
  display: grid;
  gap: var(--space-m);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--grid-min, 16rem)), 1fr));
}

.lead {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--color-heading);
}
.small, .meta { font-size: var(--step--1); }
.muted, .meta { color: var(--color-muted); }

.page-header { margin-block-end: var(--space-l); padding-block-end: var(--space-m); border-bottom: var(--border-width) solid var(--color-border); }
.page-header > :last-child { margin-block-end: 0; }
.page-header__meta { color: var(--color-muted); font-size: var(--step--1); }

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  vertical-align: -0.25em;
}
.icon--large { width: 1.75rem; height: 1.75rem; }

/* 7. Site chrome ------------------------------------------------------------ */

.skip-link {
  position: absolute;
  left: var(--space-s);
  top: -10rem;
  z-index: 10;
  padding: var(--space-xs) var(--space-s);
  background: var(--color-surface);
  color: var(--color-link);
  font-weight: 700;
  border: var(--control-border) solid var(--color-focus);
  border-radius: var(--radius);
}
.skip-link:focus { top: var(--space-s); }

.site-main { flex: 1 0 auto; padding-block: var(--space-xl) var(--space-2xl); }
.site-main:focus { outline: none; }
.site-main:has(> .band:first-child) { padding-block-start: 0; }
.site-main:has(> .band:last-child) { padding-block-end: 0; }

/* The chrome: header and footer share the navy ground.
   Focus rings inside it are light gold so they show on navy. */
.site-header, .site-footer {
  --color-focus: var(--gold-light);
  background: var(--chrome-bg);
  color: var(--chrome-text);
}

.site-header { border-bottom: var(--border-width) solid var(--chrome-edge); }
.site-header__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-l);
  padding-block: var(--space-s);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--target);
  color: var(--color-heading);
  text-decoration: none;
  font-family: var(--font-brand);
  font-size: var(--step-1);
  font-weight: 500;
  letter-spacing: -0.01em;
  word-spacing: normal;
  line-height: 1;
  border-radius: var(--radius-s);
}
.wordmark:hover { color: var(--color-heading); }
.wordmark:hover .wordmark__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.wordmark__mark { width: 2.25rem; height: 2.25rem; flex: none; }
@media (max-width: 22em) { .site-header .wordmark { font-size: var(--step-0); } }
.wordmark__tld { color: var(--color-accent); font-style: italic; font-weight: 500; }
:is(.site-header, .site-footer) .wordmark,
:is(.site-header, .site-footer) .wordmark:hover { color: var(--chrome-strong); }
:is(.site-header, .site-footer) .wordmark__tld { color: var(--chrome-accent); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs) var(--space-m);
}
.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3xs) var(--space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav__list > li { margin: 0; }
.site-nav__list form { margin: 0; }
.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding-inline: var(--space-2xs);
  color: var(--chrome-strong);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-s);
  border-bottom: 3px solid transparent;
  border-top: 3px solid transparent;
}
.site-nav__link:hover { color: var(--chrome-strong); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
.site-nav__link[aria-current="page"] { border-bottom-color: var(--chrome-accent); }
.site-nav__account { padding-inline-start: var(--space-m); border-inline-start: var(--border-width) solid var(--chrome-line); }
.site-nav .button { margin-inline-start: var(--space-3xs); }
.site-nav .button[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.25em; }
@media (max-width: 40em) {
  .site-nav { width: 100%; }
  .site-nav__account { width: 100%; padding-inline-start: 0; padding-block-start: var(--space-2xs); border-inline-start: 0; border-block-start: var(--border-width) solid var(--chrome-line); }
  .site-nav .button { margin-inline-start: 0; }
}

/* Messages from Django: a status region at the top of <main> */
.messages {
  margin-block-end: var(--space-l);
  padding: 0;
  list-style: none;
}
.messages > li + li { margin-block-start: var(--space-xs); }

.message {
  display: flex;
  gap: var(--space-xs);
  align-items: flex-start;
  max-width: none;
  padding: var(--space-s) var(--space-m);
  border: var(--border-width) solid currentColor;
  border-inline-start-width: 6px;
  border-radius: var(--radius-tile);
  background: var(--color-info-bg);
  color: var(--color-info);
}
.message > .icon { margin-top: 0.15em; }
.message__body { color: var(--color-heading); }
.message__body > :last-child { margin-bottom: 0; }
.message__title { display: block; font-weight: 700; }
.message--success { color: var(--color-success); background: var(--color-success-bg); }
.message--info { color: var(--color-info); background: var(--color-info-bg); }
.message--warning { color: var(--color-warning); background: var(--color-warning-bg); }
.message--error { color: var(--color-danger); background: var(--color-danger-bg); }

.site-footer {
  margin-top: auto;
  padding-block: var(--space-xl) var(--space-2xl);
  border-top: var(--border-width) solid var(--chrome-edge);
  font-size: var(--step--1);
}
.site-footer a { color: var(--chrome-strong); }
.site-footer a:hover { color: var(--chrome-strong); text-decoration-thickness: 2px; }
.site-footer__inner {
  display: grid;
  gap: var(--space-l);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  align-items: start;
}
.site-footer__brand .wordmark { font-size: var(--step-0); }
.site-footer__brand p { margin-block: var(--space-xs) 0; }
.site-footer__promise { font-weight: 700; color: var(--chrome-strong); }
.site-footer__links { margin: 0; padding: 0; list-style: none; columns: 2 12rem; column-gap: var(--space-l); }
.site-footer__links li { margin: 0; break-inside: avoid; }
.site-footer__links a { display: inline-flex; align-items: center; min-height: var(--target); }

/* 8. Components ------------------------------------------------------------- */

/* Buttons. <a> or <button>. One primary action per view. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  min-height: var(--target);
  min-width: var(--target);
  padding: 0.5rem 1.25rem;
  border: var(--control-border) solid var(--color-border-strong);
  border-radius: var(--radius-button);
  background: var(--color-surface);
  color: var(--color-heading);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration), border-color var(--duration), color var(--duration);
}
.button:hover { border-color: var(--color-heading); background: var(--color-sand); color: var(--color-heading); text-decoration: underline; text-underline-offset: 0.2em; }
.button--primary { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); }
.button--primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: var(--color-on-primary); }
.button--secondary { background: var(--color-surface); }
.button--quiet { background: transparent; border-color: transparent; color: var(--color-link); padding-inline: var(--space-xs); }
.button--quiet:hover { background: var(--color-sand); border-color: transparent; color: var(--color-link-hover); }
.button--danger { background: var(--color-danger); border-color: var(--color-danger); color: var(--color-on-danger); }
.button--danger:hover { background: var(--color-heading); border-color: var(--color-heading); color: var(--color-bg); }
.button--block { width: 100%; }
/* Gold: the main action in the navy header. Navy: a strong action on sand. */
.button--gold { background: var(--gold); border-color: var(--gold); color: var(--blue-950); }
.button--gold:hover { background: var(--gold-light); border-color: var(--gold-light); color: var(--blue-950); }
.button--navy { background: var(--color-strong); border-color: var(--color-strong); color: var(--color-on-strong); }
.button--navy:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: var(--color-on-primary); }
.button[disabled], .button[aria-disabled="true"] {
  background: var(--color-sand);
  border-color: var(--color-border);
  border-style: dashed;
  color: var(--color-muted);
  cursor: not-allowed;
  text-decoration: none;
}

/* A <button> that looks like a link: for POST actions like "Sign out" */
.button-link {
  display: inline;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  color: var(--color-link);
  font: inherit;
  font-weight: inherit;
  text-align: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.button-link:hover { color: var(--color-link-hover); text-decoration-thickness: 2px; }
.site-nav__link.button-link { display: inline-flex; min-height: var(--target); padding-inline: var(--space-2xs); color: var(--chrome-strong); font-weight: 500; text-decoration: none; }
.site-nav__link.button-link:hover { color: var(--chrome-strong); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.3em; }

/* Form fields */
.field { margin-block-end: var(--space-m); }
.field > :last-child { margin-block-end: 0; }
.field__label { display: block; margin-block-end: var(--space-3xs); font-weight: 600; color: var(--color-heading); }
.field__optional { font-weight: 400; color: var(--color-muted); }
.field__hint { display: block; margin-block: 0 var(--space-2xs); color: var(--color-muted); max-width: var(--measure); }
.field__error {
  display: flex;
  gap: var(--space-2xs);
  align-items: flex-start;
  margin-block: 0 var(--space-2xs);
  color: var(--color-danger);
  font-weight: 700;
}
.field__error .icon { margin-top: 0.2em; }
.field--error { padding-inline-start: var(--space-s); border-inline-start: 4px solid var(--color-danger); }
.field--short { --field-width: 12rem; }
.field--medium { --field-width: 20rem; }

/* Checkbox and radio: the whole label is the target */
.choices { margin: 0; padding: 0; list-style: none; }
.choices > li { margin: 0; }
.choices--inline { display: flex; flex-wrap: wrap; gap: 0 var(--space-m); }
.choice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  min-height: var(--target);
  padding-block: 0.55rem;
  margin: 0;
  font-weight: 400;
  color: var(--color-text);
  cursor: pointer;
}
.choice > input { margin-top: 0.12em; }
.choice__text { color: var(--color-heading); }
.choice__hint { display: block; color: var(--color-muted); }

/* A group of related fields */
.fieldset {
  margin-block-end: var(--space-m);
}
.fieldset__legend { font-size: var(--step-1); font-family: var(--font-display); font-weight: 500; margin-block-end: var(--space-2xs); }

/* Error summary: put it at the top of the form, link to each field */
.error-summary {
  margin-block-end: var(--space-l);
  padding: var(--space-m);
  border: 3px solid var(--color-danger);
  border-radius: var(--radius-tile);
  background: var(--color-surface);
}
.error-summary:focus-visible { outline-offset: 3px; }
.error-summary__title { display: flex; align-items: center; gap: var(--space-2xs); margin: 0 0 var(--space-xs); font-size: var(--step-2); color: var(--color-heading); }
.error-summary__title .icon { color: var(--color-danger); }
.error-summary ul { margin: 0; }
.error-summary a { color: var(--color-danger); font-weight: 700; }

/* What a draft still needs, at the top of its preview. Each item links to the
   question on the form. Not an error: the draft is saved. */
.needed-list {
  margin-block-end: var(--space-l);
  padding: var(--space-m);
  border: 2px dashed var(--color-warning);
  border-radius: var(--radius-tile);
  background: var(--color-surface);
}
.needed-list__title { margin: 0 0 var(--space-xs); font-size: var(--step-2); }
.needed-list ul { margin: 0; }

/* Row of form buttons */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-s);
  margin-block-start: var(--space-l);
  padding-block-start: var(--space-m);
  border-top: var(--border-width) solid var(--color-border);
}
.form-actions__note { flex-basis: 100%; margin: 0; color: var(--color-muted); font-size: var(--step--1); }

/* Long form in numbered sections (post a job) */
.form-contents {
  margin-block-end: var(--space-l);
  padding: var(--space-m) var(--space-l);
  background: var(--color-sand);
  border: var(--border-width) solid var(--color-card-edge);
  border-radius: var(--radius-xl);
}
.form-contents ol { margin: 0; }
.form-contents li + li { margin-block-start: var(--space-3xs); }

/* How much of one part of the job form is answered: words plus an icon */
.part-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  margin-inline-start: var(--space-2xs);
  color: var(--color-warning);
  font-weight: 600;
}
.part-status--done { color: var(--color-success); }
.form-section {
  margin-block: 0 var(--space-l);
  padding: var(--space-m) var(--space-l) var(--space-l);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-xl);
}
@media (max-width: 30em) { .form-section { padding-inline: var(--space-s); } }
.form-section__legend {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  float: left;            /* lets the legend sit inside the box like a heading */
  width: 100%;
  margin-block-end: var(--space-m);
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 500;
}
.form-section__legend + * { clear: left; }
.form-section__number {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  border-radius: var(--radius-tile);
  background: var(--tile-blue);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 700;
}
.form-section__intro { clear: left; color: var(--color-muted); }

/* Tags: facts about a job. Not interactive. */
.tag-list { display: flex; flex-wrap: wrap; gap: var(--space-2xs); margin: 0 0 var(--space-s); padding: 0; list-style: none; }
.tag-list > li { margin: 0; }
.tag, .chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  background: var(--color-chip);
  color: var(--color-chip-text);
  font-size: var(--step--1);
  font-weight: 500;
  line-height: 1.5;
}
.tag .icon, .chip .icon { width: 1.1em; height: 1.1em; vertical-align: 0; }

/* An answer a draft does not have yet, on the employer's preview. Words and an
   icon on a dashed edge; public jobs never show it. */
.not-answered {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.1em 0.6em;
  border: 2px dashed var(--color-warning);
  border-radius: var(--radius-s);
  background: var(--color-warning-bg);
  color: var(--color-warning);
  font-weight: 700;
}
.not-answered .icon { width: 1.1em; height: 1.1em; flex: none; }

/* Status badges: always text plus an icon. Class follows Job.status. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.15rem 0.6rem;
  border: var(--border-width) solid currentColor;
  border-radius: 999px;
  background: var(--color-neutral-bg);
  color: var(--color-neutral);
  font-size: var(--step--1);
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.badge .icon { width: 1.1em; height: 1.1em; }
.badge--draft { color: var(--color-neutral); background: var(--color-neutral-bg); border-style: dashed; }
.badge--pending { color: var(--color-info); background: var(--color-info-bg); }
.badge--published { color: var(--color-success); background: var(--color-success-bg); }
.badge--rejected { color: var(--color-warning); background: var(--color-warning-bg); }
.badge--expired { color: var(--color-muted); background: var(--color-sand); }
.badge--closed { color: var(--color-neutral); background: var(--color-neutral-bg); }

/* Featured marker: the small loose gold tile, plus the word */
.featured {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin: 0;
  color: var(--color-accent);
  font-size: var(--step--1);
  font-weight: 700;
}

/* Company monogram: a family tile with the company's first letter.
   Pick the colour from a fixed list, for example by company id. */
.monogram {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  flex: none;
  border-radius: var(--radius-s);
  background: var(--blue-700);
  color: #ffffff;
  font-family: var(--font-brand);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  user-select: none;
}
.monogram--blue { background: var(--blue-700); color: #ffffff; }
.monogram--sky { background: var(--blue-100); color: var(--blue-900); }
.monogram--navy { background: var(--blue-900); color: var(--gold-light); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.2); }
.monogram--gold { background: var(--gold); color: var(--blue-900); }
.monogram--sand { background: #f2eee7; color: #1a202c; box-shadow: inset 0 0 0 1px #ddd5c8; }
.monogram--large { width: 4.5rem; height: 4.5rem; font-size: 2.25rem; border-radius: var(--radius-tile); }

/* Job list and job card.
   The card is a column (home page grid). In a wide list (jobs page) a container
   query turns it into a row: the monogram on the left, the rest beside it. */
.job-list { display: grid; gap: var(--space-s); margin: 0 0 var(--space-l); padding: 0; list-style: none; }
.job-list > li { display: grid; margin: 0; container-type: inline-size; }
.latest-jobs > .wrap { --stack-space: var(--space-m); }
.latest-jobs .job-list { margin-block: var(--space-m) 0; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }

.job-card {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: var(--space-m);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-xl);
}
.band--tint .job-card { border-color: var(--color-card-edge); }
.job-card > * { margin: 0; }
.job-card > .monogram { width: 4rem; height: 4rem; border-radius: var(--radius-tile); font-size: 1.875rem; }
.job-card--featured,
.band--tint .job-card--featured { border: 2px solid var(--color-tile-gold); }
.job-card__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-2xs) var(--space-s); }
.job-card__heading { flex: 1 1 12rem; min-width: 0; }
.job-card__title { margin: 0; font-size: var(--step-2); line-height: 1.25; max-width: none; }
.job-card__title a { color: var(--color-heading); text-decoration-color: var(--color-border-strong); }
.job-card__title a:hover { color: var(--color-link); text-decoration-color: currentColor; }
.job-card__company { margin: var(--space-3xs) 0 0; color: var(--color-text); font-weight: 500; }
.job-card__facts { display: flex; flex-wrap: wrap; gap: var(--space-2xs); margin: 0; }
.job-card__facts > div { margin: 0; }
.job-card__facts dd { margin: 0; }
.job-card__facts .chip dd { display: inline-flex; align-items: center; gap: 0.4em; }
.job-card__pay { flex-basis: 100%; }
.job-card__pay dd { color: var(--color-pay); font-size: 1.118rem; font-weight: 700; }
.job-card__summary { flex-grow: 1; color: var(--color-text); }
.job-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2xs) var(--space-s);
}
.job-card__foot form { margin: 0; }
.job-card__foot .button--quiet { padding-inline: var(--space-2xs); margin-inline: calc(-1 * var(--space-2xs)); }
.job-card__date { margin: 0; color: var(--color-muted); font-size: var(--step--1); }

@container (min-width: 36rem) {
  .job-card {
    display: grid;
    grid-template-columns: 4rem minmax(0, 1fr);
    gap: 0.75rem var(--space-m);
    padding: var(--space-m) var(--space-l) var(--space-m) var(--space-m);
  }
  .job-card > * { grid-column: 2; }
  .job-card > .monogram { grid-column: 1; grid-row: 1 / span 4; }
}

/* Facts in a row (job card) and the facts list (job page) */
.fact-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3xs) var(--space-m);
  margin: 0;
  padding: 0;
}
.fact-row > div { margin: 0; }
.fact-row dt { margin: 0; }
.fact-row dd { display: inline-flex; align-items: center; gap: 0.4em; margin: 0; color: var(--color-heading); }
.fact-row .icon { color: var(--color-muted); }
.fact-row__pay dd { font-weight: 700; }

.facts {
  margin: 0 0 var(--space-m);
  padding: var(--space-s) var(--space-m);
  background: var(--color-sand);
  border: var(--border-width) solid var(--color-card-edge);
  border-radius: var(--radius-xl);
}
.facts > div {
  padding-block: var(--space-xs);
  border-bottom: var(--border-width) solid var(--color-border);
}
.facts > div:last-child { border-bottom: 0; }
.facts > div:first-child dd { color: var(--color-pay); font-size: var(--step-1); font-weight: 700; }
.facts dt { display: flex; align-items: center; gap: 0.4em; font-size: var(--step--1); font-weight: 600; color: var(--color-muted); }
.facts dt .icon { width: 1.15em; height: 1.15em; }
.facts dd { margin: 0; color: var(--color-heading); font-weight: 600; }
.facts dd .meta { display: block; font-weight: 400; }

/* Definition list for longer answers (work environment, hiring details) */
.details-list { margin: 0; }
.details-list > div { padding-block: var(--space-xs); border-top: var(--border-width) solid var(--color-border); }
.details-list > div:first-child { border-top: 0; padding-block-start: 0; }
.details-list dt { margin-bottom: var(--space-3xs); }
.details-list dd { margin: 0; }

/* Panels: a titled block on a job page */
.panel {
  margin-block: 0 var(--space-m);
  padding: var(--space-m) var(--space-l) var(--space-l);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-xl);
}
@media (max-width: 30em) { .panel { padding-inline: var(--space-s); } }
.panel > :last-child { margin-block-end: 0; }
.panel__title { display: flex; align-items: center; gap: var(--space-xs); margin: 0 0 var(--space-s); font-size: var(--step-2); }
.panel__title .icon { color: var(--color-primary); width: 1.1em; height: 1.1em; }
.panel--hiring .panel__title .icon { color: var(--color-tint-text); }
.panel--hiring { background: var(--color-tint); border-color: var(--color-card-edge); }
.panel--hiring .details-list > div { border-top-color: color-mix(in srgb, var(--color-tint-text) 18%, transparent); }
.panel--sand { background: var(--color-sand); border-color: var(--color-card-edge); }

/* Numbered steps: hiring steps, "what happens next" */
.steps { counter-reset: step; margin: 0 0 var(--space-m); padding: 0; list-style: none; }
.steps > li {
  counter-increment: step;
  position: relative;
  min-height: 2.25rem;
  margin: 0;
  padding: 0.3rem 0 var(--space-s) 3.25rem;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.6rem;
  background: var(--tile-blue);
  color: #ffffff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(1.125rem - 1px);
  top: 2.6rem;
  bottom: 0.35rem;
  border-left: 2px solid var(--color-border);
}
.steps__title { display: block; font-weight: 700; color: var(--color-heading); }

/* Apply call to action */
.apply-box {
  padding: var(--space-m);
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-xl);
}
.apply-box > * { margin-block: 0 var(--space-s); }
.apply-box > :last-child { margin-block-end: 0; }
.apply-box__title { font-size: var(--step-2); }
.apply-box .button--primary { width: 100%; }
.apply-box__links { display: flex; flex-wrap: wrap; gap: 0 var(--space-m); }
.apply-box__links form { margin: 0; }
/* Stand-alone links and buttons: at least 44px tall */
.apply-box__links a, .apply-box__links .button-link { display: inline-flex; align-items: center; gap: 0.35em; min-height: var(--target); }
.filters__actions a, .section-head a { display: inline-flex; align-items: center; min-height: var(--target); }

/* Job page layout: main column and side column */
.job-header { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-m); margin-block-end: var(--space-l); }
.job-header__text { flex: 1 1 20rem; }
.job-header__text > * { margin-block: 0 var(--space-2xs); }
.job-header__company { font-size: var(--step-1); font-weight: 600; }
.job-layout {
  display: grid;
  gap: var(--space-l);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 56em) {
  .job-layout { grid-template-columns: minmax(0, 1fr) 21rem; align-items: start; }
  .job-layout__side { grid-column: 2; grid-row: 1 / span 3; }
}
.job-layout__side > * + * { margin-block-start: var(--space-m); }

/* Home hero: on the light page under the navy header. The headline, one
   sentence and the search form, nothing else. */
.hero { padding-block: 0 var(--space-l); }
.hero__title {
  max-width: 22ch;
  margin-block-end: var(--space-s);
  font-size: var(--step-5);
  font-weight: 500;
  line-height: 1.1;
}
.hero__text { max-width: 52ch; margin: 0 0 var(--space-l); font-size: var(--step-1); color: var(--color-heading); }

.search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-s);
  max-width: 48rem;
  padding: var(--space-m);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-xl);
}
.search-form > .field { flex: 1 1 14rem; margin: 0; --field-width: none; }
.search-form > .field--narrow { flex: 0 1 12rem; }
.search-form > .button { flex: 0 0 auto; }
@media (max-width: 30em) { .search-form { padding-inline: var(--space-s); } }

/* "What every job here tells you": three plain white cards. Each has a small
   solid marker with its icon (blue, gold, navy), a heading and one sentence. */
.promises {
  display: grid;
  gap: var(--space-m);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}
.stack > * + .promises { margin-block-start: var(--stack-space, var(--space-s)); }
.promises > li {
  margin: 0;
  padding: var(--space-m);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-xl);
}
.promises p { margin: 0; }
.promises__marker {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-block-end: var(--space-s);
  border-radius: var(--radius-s);
  background: var(--tile-blue);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px var(--tile-edge);
}
.promises__marker--gold { background: var(--gold); color: var(--blue-950); }
.promises__marker--navy { background: var(--blue-900); }
.promises__title { margin: 0 0 var(--space-2xs); font-size: var(--step-1); line-height: 1.25; }

/* A row with a section heading on the left and a link on the right */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2xs) var(--space-m); }
.section-head > * { margin: 0; }
.section-head a { font-weight: 600; }

/* Call-out panel: a rounded sand block with a strong button */
.cta-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m) var(--space-xl);
  padding: var(--space-xl) var(--space-xl);
  background: var(--color-sand);
  border: var(--border-width) solid var(--color-card-edge);
  border-radius: var(--radius-xl);
}
.cta-panel__text { flex: 999 1 26rem; min-width: 0; }
.cta-panel__text > * { margin-block: 0 var(--space-2xs); }
.cta-panel__text > :last-child { margin-block-end: 0; }
.cta-panel h2 { margin-block-start: 0; }
.cta-panel > .button { flex: 0 1 auto; max-width: 100%; min-height: 3.1rem; padding-inline: 1.6rem; }
@media (max-width: 30em) { .cta-panel { padding: var(--space-l) var(--space-s); } }

/* Jobs list page: filters beside results */
.jobs-layout { display: grid; gap: var(--space-l); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 60em) {
  .jobs-layout { grid-template-columns: 18rem minmax(0, 1fr); align-items: start; }
}
.filters {
  padding: var(--space-m);
  background: var(--color-sand);
  border: var(--border-width) solid var(--color-card-edge);
  border-radius: var(--radius-xl);
  --field-width: none;
}
.filters__title { font-size: var(--step-1); margin-block-end: var(--space-s); }
/* The filter form folds into a <details> on narrow screens (closed by default,
   so the results come first) and is always open from 60em. */
.filters-details { min-width: 0; margin: 0; }
.filters-details__summary {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: var(--target);
  padding: 0.5rem 1rem;
  background: var(--color-surface);
  border: var(--control-border) solid var(--color-border-strong);
  border-radius: var(--radius-button);
  color: var(--color-heading);
  font-weight: 600;
  list-style: none;
}
.filters-details__summary::-webkit-details-marker { display: none; }
.filters-details__summary::after {
  content: "";
  margin-inline-start: auto;
  width: 0.55em;
  height: 0.55em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
}
.filters-details[open] > .filters-details__summary { margin-block-end: var(--space-s); }
.filters-details[open] > .filters-details__summary::after { transform: translateY(0.15em) rotate(-135deg); }
.filters-details__summary:hover { border-color: var(--color-heading); }
@media (max-width: 59.99em) {
  .filters-details .filters__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (min-width: 60em) {
  @supports selector(::details-content) {
    .filters-details > .filters-details__summary { display: none; }
    .filters-details::details-content { content-visibility: visible; display: block; }
  }
}
.filters .field { margin-block-end: var(--space-s); }
.filters__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-s); }
.results-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2xs) var(--space-m);
  margin-block-end: var(--space-s);
}
.results-bar > * { margin: 0; }
.results-bar__count { font-weight: 700; color: var(--color-heading); }
/* The filters in use, in words, above the results at every width, so nobody
   has to scroll back to the filter form to know what is applied. */
.active-filters {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2xs);
  max-width: none;
  margin: 0 0 var(--space-m);
  padding: var(--space-xs) var(--space-s);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-heading);
}
.active-filters .icon { flex: none; margin-top: 0.2em; color: var(--color-muted); }

.empty-state {
  padding: var(--space-l) var(--space-m);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-xl);
}
.band--tint .empty-state { border-color: var(--color-card-edge); }
.empty-state > * { margin-block: 0 var(--space-s); }
.empty-state > :last-child { margin-block-end: 0; }
/* The larger version, for the home page while there are no jobs */
.empty-state--feature { padding: var(--space-xl); }
.empty-state--feature > h3 { font-size: var(--step-3); }
@media (max-width: 30em) { .empty-state--feature { padding: var(--space-l) var(--space-s); } }

/* Pagination */
.pagination ul { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs); margin: 0; padding: 0; list-style: none; }
.pagination li { margin: 0; }
.pagination a, .pagination [aria-current="page"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  min-width: var(--target);
  min-height: var(--target);
  padding-inline: var(--space-xs);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-button);
  background: var(--color-surface);
  font-weight: 600;
  text-decoration: none;
}
.pagination a:hover { border-color: var(--color-link); text-decoration: underline; }
.pagination [aria-current="page"] { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); }
.pagination__status { margin: var(--space-2xs) 0 0; color: var(--color-muted); font-size: var(--step--1); }

/* Data tables (employer dashboard) */
.table-wrap { overflow-x: auto; margin-block-end: var(--space-m); }
.table { font-variant-numeric: tabular-nums; }
.table th, .table td { padding-inline-end: var(--space-m); }
.table td.num, .table th.num { text-align: right; }
.table__title { font-weight: 700; color: var(--color-heading); }
.table__actions { display: flex; flex-wrap: wrap; gap: var(--space-3xs) var(--space-s); align-items: center; }
.table__actions form { margin: 0; }
.table__status-note { display: block; margin-block-start: var(--space-3xs); }
.table__actions a, .table__actions .button-link { display: inline-flex; align-items: center; min-height: var(--target); }
/* Under 44em each row becomes a block, cells show their column name from data-label */
@media (max-width: 44em) {
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table--stack, .table--stack caption, .table--stack tbody, .table--stack tr, .table--stack td { display: block; }
  .table--stack .badge { white-space: normal; }
  .table--stack tr {
    margin-block-end: var(--space-s);
    padding: var(--space-xs) var(--space-s);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
  }
  .table--stack td { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-3xs) var(--space-xs); padding: var(--space-2xs) 0; border: 0; }
  .table--stack td.num { text-align: left; }
  .table--stack td::before { content: attr(data-label); flex: 0 0 6.5rem; font-weight: 700; color: var(--color-muted); font-size: var(--step--1); }
  .table--stack td.table__primary { display: block; padding-block-end: var(--space-xs); border-bottom: var(--border-width) solid var(--color-border); }
  .table--stack td.table__primary::before { content: none; }
}

/* Callouts and notes: a rounded sand panel with a coloured rule on the left */
.callout {
  margin-block: 0 var(--space-m);
  padding: var(--space-m) var(--space-l);
  border: var(--border-width) solid var(--color-card-edge);
  border-inline-start: 5px solid var(--tile-blue);
  border-radius: var(--radius-xl);
  background: var(--color-sand);
  color: var(--color-text);
}
@media (max-width: 30em) { .callout { padding-inline: var(--space-s); } }
.callout > :last-child { margin-block-end: 0; }
.callout__title { margin: 0 0 var(--space-2xs); font-family: var(--font-body); font-size: var(--step-0); font-weight: 700; color: var(--color-heading); }
.callout--gold { border-inline-start-color: var(--gold); }
/* The banner on example ads (pages/example_ad.html): it must not be missed. */
.example-banner { border-width: 3px; border-color: var(--gold); border-inline-start-width: 8px; }
.example-banner .callout__title { font-family: var(--font-display); font-size: var(--step-2); }

/* Pricing */
.plans { display: grid; gap: var(--space-m); grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); margin-block-end: var(--space-m); }
.plan {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  padding: var(--space-l);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-xl);
}
.plan > * { margin: 0; }
.plan__name { font-size: var(--step-2); }
.plan__price { font-family: var(--font-display); font-size: var(--step-4); font-weight: 500; color: var(--color-pay); line-height: 1.1; }
.plan__period { font-family: var(--font-body); font-size: var(--step-0); font-weight: 400; color: var(--color-muted); }
.plan__note { color: var(--color-muted); }
.plan__features { margin: 0; padding: 0; list-style: none; }
.plan__features li { display: flex; gap: var(--space-2xs); align-items: flex-start; }
.plan__features .icon { color: var(--color-success); margin-top: 0.2em; }
.plan__action { margin-top: auto; }
.plan--launch { border: 2px solid var(--color-tile-gold); }
.plan__launch { align-self: flex-start; }

/* Long text: privacy policy, terms, guidelines */
.prose { max-width: var(--measure); }
:where(.prose) h2 { font-size: var(--step-3); margin-block-start: var(--space-xl); }
:where(.prose) h3 { font-size: var(--step-1); margin-block-start: var(--space-l); }
.prose li + li { margin-block-start: 0.5em; }
.prose table { font-size: var(--step--1); }
.toc { margin-block: 0 var(--space-l); padding: var(--space-m) var(--space-l); background: var(--color-band); border: var(--border-width) solid var(--color-card-edge); border-radius: var(--radius-xl); }
.toc__title { font-family: var(--font-body); font-size: var(--step-0); font-weight: 700; margin: 0 0 var(--space-2xs); }
.toc ol { margin: 0; }
.toc a { display: inline-block; padding-block: 0.15rem; }

/* 9. Styleguide page only --------------------------------------------------- */

.sg-intro { margin-block-end: var(--space-l); }
.sg-nav ol { columns: 3 13rem; column-gap: var(--space-l); margin: 0; }
.sg-nav li { break-inside: avoid; }
.sg-section { margin-block: var(--space-2xl) 0; padding-block-start: var(--space-l); border-top: 2px solid var(--color-border); }
.sg-section > h2 { margin-block-start: 0; }
.sg-sub { margin-block-start: var(--space-l); }
.sg-example {
  margin-block: var(--space-s) 0;
  padding: var(--space-m);
  background: var(--color-bg);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
}
.sg-example > :last-child { margin-block-end: 0; }
.sg-example--sand { background: var(--color-sand); }
.sg-example--flush { padding: 0; overflow: hidden; }
.sg-example--chrome { --color-focus: var(--gold-light); background: var(--chrome-bg); }
.sg-code {
  margin-block: var(--space-s) var(--space-m);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-l);
  background: var(--color-sand);
}
.sg-example + .sg-code { margin-block-start: 0; border-top: 0; border-radius: 0 0 var(--radius-l) var(--radius-l); }
.sg-code + .sg-code { margin-block-start: calc(-1 * var(--space-m)); border-top: 0; border-radius: 0 0 var(--radius-l) var(--radius-l); }
.sg-code > summary { display: flex; align-items: center; min-height: var(--target); padding-inline: var(--space-m); font-weight: 600; color: var(--color-heading); font-size: var(--step--1); }
.sg-code pre { margin: 0; border-radius: 0 0 var(--radius-l) var(--radius-l); background: var(--color-surface); font-size: 0.82rem; white-space: pre; tab-size: 2; max-height: 32rem; overflow: auto; }
.sg-classes { margin: var(--space-s) 0 0; font-size: var(--step--1); }
.sg-classes > div { padding-block: 0.3rem; border-top: var(--border-width) solid var(--color-border); }
@media (min-width: 40em) { .sg-classes > div { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: 0 var(--space-m); } }
.sg-classes dt { font-family: var(--font-mono); font-weight: 600; font-size: 0.95em; }
.sg-classes dd { margin: 0; }
.sg-row { display: flex; flex-wrap: wrap; gap: var(--space-s); align-items: center; }
.sg-swatches { display: grid; gap: var(--space-s); grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); margin: 0; padding: 0; list-style: none; }
.sg-swatches li { margin: 0; font-size: var(--step--1); }
.sg-swatch { display: block; height: 3.5rem; margin-block-end: var(--space-3xs); border-radius: var(--radius); border: var(--border-width) solid var(--color-border); }
.sg-swatch--bg { background: var(--color-bg); }
.sg-swatch--sand { background: var(--color-sand); }
.sg-swatch--surface { background: var(--color-surface); }
.sg-swatch--heading { background: var(--color-heading); }
.sg-swatch--text { background: var(--color-text); }
.sg-swatch--muted { background: var(--color-muted); }
.sg-swatch--link { background: var(--color-link); }
.sg-swatch--accent { background: var(--color-accent); }
.sg-swatch--primary { background: var(--color-primary); }
.sg-swatch--gold { background: var(--gold); }
.sg-swatch--focus { background: var(--color-focus); }
.sg-swatch--border-strong { background: var(--color-border-strong); }
.sg-swatch--chrome { background: var(--chrome-bg); }
.sg-swatch--band { background: var(--color-band); }
.sg-swatch--chip { background: var(--color-chip); }
.sg-swatch--pay { background: var(--color-pay); }
.sg-swatch--tile-blue { background: var(--tile-blue); }
.sg-swatch--deep { background: var(--blue-800); }
.sg-logos { display: grid; gap: var(--space-m); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); margin: 0; padding: 0; list-style: none; }
.sg-logos > li { margin: 0; padding: var(--space-m); background: var(--color-surface); border: var(--border-width) solid var(--color-border); border-radius: var(--radius-l); }
.sg-logos--chosen { border: 3px solid var(--color-tile-gold) !important; }
.sg-logo-large { width: 10rem; height: 10rem; }
.sg-logo-sizes { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-s); margin-block: var(--space-s); }
.sg-logo-48 { width: 48px; height: 48px; }
.sg-logo-24 { width: 24px; height: 24px; }
.sg-circle { display: block; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; }
.sg-circle img { width: 64px; height: 64px; }
.sg-circle--dark { background: var(--blue-900); }

/* 10. Forced colours (Windows High Contrast and similar) -------------------- */

@media (forced-colors: active) {
  .button, .pagination a, .pagination [aria-current="page"], .tag, .badge, .monogram,
  .job-card, .panel, .callout, .message, .plan, .apply-box, .filters, .search-form,
  .empty-state, .form-section, .error-summary, .toc, .form-contents, .steps > li::before,
  .promises > li, .promises__marker, .chip, .facts, .cta-panel, .sg-example, .sg-code {
    border: 1px solid CanvasText;
  }
  .site-header, .site-footer { border-color: CanvasText; }
  .button--gold, .button--navy { border: 3px solid ButtonText; }
  .button--primary, .pagination [aria-current="page"] { border: 3px solid ButtonText; }
  .button[disabled], .button[aria-disabled="true"] { color: GrayText; border-color: GrayText; }
  .site-nav__link[aria-current="page"] { border-bottom-color: Highlight; }
  :focus-visible { outline: 3px solid Highlight; }
  .icon { forced-color-adjust: auto; }
  .wordmark__mark, .sg-logos img { forced-color-adjust: none; }
}

/* 11. Reduced motion -------------------------------------------------------- */

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

/* 12. Print: a job page prints as plain text on white ----------------------- */

@media print {
  :root {
    --color-bg: #ffffff;
    --color-sand: #ffffff;
    --color-surface: #ffffff;
    --color-heading: #000000;
    --color-text: #1a1a1a;
    --color-muted: #333333;
    --color-link: #000000;
    --color-border: #999999;
    --color-tint: #ffffff;
    --color-band: #ffffff;
    --color-chip: #ffffff;
    --color-chip-text: #000000;
    --color-pay: #000000;
    --color-accent: #000000;
    /* No navy slabs on paper: the chrome prints black on white */
    --chrome-bg: #ffffff;
    --chrome-text: #000000;
    --chrome-strong: #000000;
    --chrome-accent: #000000;
    --root-size: 75%;
  }
  @page { margin: 18mm 16mm; }
  body { display: block; }
  .skip-link, .site-nav, .messages, .job-card__foot form, .apply-box form,
  .apply-box .button, .apply-box__links, .filters, .pagination, .search-form, .form-actions, .no-print,
  .sg-code, .site-footer__links, .cta-panel .button, .filters-details > summary { display: none !important; }
  .hero { padding-block: 0 6mm; }
  .promises > li, .facts, .callout, .cta-panel, .empty-state, .toc { background: none !important; color: #000000 !important; border: 1px solid #999999; box-shadow: none; }
  .promises__marker { display: none; }
  .tag, .chip { border: 1px solid #999999; }
  .monogram, .steps > li::before, .form-section__number { background: none !important; color: #000000 !important; box-shadow: none; border: 1px solid #999999; }
  .site-header, .site-footer { border: 0; padding-block: 0 8mm; }
  .site-main { padding: 0; }
  .site-main > :where(:not(.band)), .wrap { width: auto; margin: 0; }
  .job-layout { display: block; }
  .job-layout__main { margin-top: 8mm; }
  .panel, .apply-box, .job-card, .callout, .plan, .steps > li { break-inside: avoid; }
  .panel, .apply-box { border: 1px solid #999999; }
  .prose a[href^="http"]::after, .apply-box a[href^="http"]::after, .apply-box a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
    font-weight: 400;
    word-break: break-all;
  }
  .print-only { display: block !important; }
  h1, h2, h3 { break-after: avoid; }
}
.print-only { display: none; }

/* Allauth pages: their headings and paragraphs sit straight inside <main> with
   .wrap--narrow. Headings and paragraphs have a reading-width max, which would
   centre them inside the narrow column. Let them fill it so the left edges line up. */
.site-main > .wrap--narrow { max-width: none; }

/* --- QR code on the staff two-factor set-up page ------------------------------
   The SVG is in the page, not a data: image, so the Content Security Policy
   needs no change. Dark squares on white in both colour schemes, because
   authenticator apps read dark-on-light codes most reliably. */
.qr-code {
  display: inline-block;
  margin: 0 0 var(--space-m);
  padding: 12px;
  background: #ffffff;
  border-radius: 8px;
}
.qr-code__image { display: block; width: 200px; height: 200px; }
.qr-code__image path { fill: #000000; }
