/*
  neurodivergent.work: the one stylesheet.

  Contents
   1. Fonts
   2. Tokens: light theme, type, space, motion
   3. Dark theme (device setting, then the site's own setting)
   4. Display settings: text size, reading font, spacing, motion
   5. Base elements (a template with no classes should still look right)
   6. Layout helpers
   7. Site chrome: skip link, display settings, 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;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-latin-400-normal.f1f8a8210104.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: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-latin-ext-400-normal.fe905e20f857.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: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-latin-700-normal.13a58e05dfd2.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: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-latin-ext-700-normal.764b69c9ccc8.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: "Atkinson Hyperlegible";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-latin-400-italic.de4c0c22fd4e.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: "Atkinson Hyperlegible";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-latin-700-italic.4a631a0a40b7.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;
}

/* 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;
  --gold: #d4a853;
  --gold-light: #f4d58d;

  /* 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-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: 106.25%;           /* 17px when the browser default is 16px */
  --step--1: 0.882rem;            /* 15px: meta text, never body copy */
  --step-0: 1rem;                 /* 17px: body */
  --step-1: 1.176rem;             /* 20px */
  --step-2: 1.412rem;             /* 24px */
  --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: 72rem;
  --target: 2.75rem;              /* 44px+ touch target */

  /* Shape */
  --radius-s: 0.375rem;
  --radius: 0.5rem;
  --radius-l: 0.875rem;
  --border-width: 1px;
  --control-border: 2px;
  --focus-width: 3px;

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

/* 3. Dark theme ------------------------------------------------------------- */
/* The same block twice: once for the device setting (works with JavaScript off),
   once for the site's own "Dark" choice. Keep them identical. */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    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;
  }
}

:root[data-theme="dark"] {
  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;
}

/* 4. Display settings ------------------------------------------------------- */
/* static/js/settings.js sets these attributes on <html> from localStorage. */

:root[data-text-size="large"] { --root-size: 118.75%; }  /* 19px */
:root[data-text-size="larger"] { --root-size: 131.25%; } /* 21px */

:root[data-font="legible"] {
  --font-body: "Atkinson Hyperlegible", Verdana, system-ui, sans-serif;
  --font-display: var(--font-body);
}

/* WCAG 1.4.12 text spacing values, slightly over */
:root[data-spacing="wide"] {
  --leading: 1.9;
  --leading-tight: 1.5;
  --tracking: 0.12em;
  --tracking-heading: 0.06em;
  --word-spacing: 0.16em;
  --para-space: 2em;
  --measure: 60ch;
}

@media (prefers-reduced-motion: reduce) {
  :root { --duration: 0s; }
}
:root[data-motion="reduce"] { --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;
  max-width: 34ch;
}
:root[data-font="legible"] :is(h1, h2, h3, h4, h5, h6) { font-weight: 700; }
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: italic, in the accent colour */
:is(h1, h2, h3) em { font-style: italic; font-weight: 400; 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; }

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-s);
  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);
  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-tint); }

.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); }
.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; }

/* Display settings: a <details> in the bar at the top of every page.
   It opens in the page flow and pushes content down; it never covers anything. */
.utility-bar {
  padding-block: 0.25rem;
  background: var(--color-sand);
  border-bottom: var(--border-width) solid var(--color-border);
}
.display-settings__toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  width: fit-content;
  min-height: var(--target);
  margin-inline: auto max(var(--gutter), (100% - var(--wrap)) / 2);
  padding-inline: var(--space-xs);
  color: var(--color-heading);
  font-weight: 600;
  font-size: var(--step--1);
  border-radius: var(--radius-s);
  list-style: none;
}
.display-settings__toggle::-webkit-details-marker { display: none; }
.display-settings__toggle::after {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
}
.display-settings[open] > .display-settings__toggle::after { transform: translateY(0.15em) rotate(-135deg); }
.display-settings__toggle:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.display-settings__panel {
  padding-block: var(--space-m) var(--space-l);
  border-top: var(--border-width) solid var(--color-border);
}
.display-settings__title { font-size: var(--step-2); margin-block-end: var(--space-2xs); }
.display-settings__form {
  display: none;
}
:root[data-js] .display-settings__form { display: block; }
:root[data-js] .display-settings__nojs { display: none; }
.display-settings__groups {
  display: grid;
  gap: var(--space-m) var(--space-l);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  margin-block: var(--space-s) var(--space-m);
}
.display-settings__groups legend { margin-block-end: var(--space-3xs); }
.display-settings__actions { --cluster-space: var(--space-s); }

.site-header {
  background: var(--color-bg);
  border-bottom: var(--border-width) solid var(--color-border);
}
.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; }
.wordmark__tld { color: var(--color-accent); font-style: italic; font-weight: 500; }

.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-2xs);
  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(--color-heading);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-s);
  border-bottom: 3px solid transparent;
  border-top: 3px solid transparent;
}
.site-nav__link:hover { color: var(--color-link); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
.site-nav__link[aria-current="page"] { border-bottom-color: var(--color-tile-gold); }
.site-nav__account { padding-inline-start: var(--space-m); border-inline-start: var(--border-width) solid var(--color-border); }
@media (max-width: 40em) {
  .site-nav { width: 100%; }
  .site-nav__account { padding-inline-start: 0; border-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);
  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);
  background: var(--color-sand);
  border-top: var(--border-width) solid var(--color-border);
  font-size: var(--step--1);
}
.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(--color-heading); }
.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);
  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%; }
.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(--color-heading); font-weight: 600; text-decoration: none; }
.site-nav__link.button-link:hover { color: var(--color-link); text-decoration: underline; }

/* 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);
  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; }

/* 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-s) var(--space-m);
  background: var(--color-sand);
  border-radius: var(--radius);
}
.form-contents ol { margin: 0; }
.form-section {
  margin-block: 0 var(--space-l);
  padding: var(--space-m);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-l);
}
.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.25rem;
  height: 2.25rem;
  flex: none;
  border-radius: var(--radius-s);
  background: var(--color-tint);
  color: var(--color-tint-text);
  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 {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.2rem 0.65rem;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-s);
  background: var(--color-sand);
  color: var(--color-heading);
  font-size: var(--step--1);
  font-weight: 600;
  line-height: 1.5;
}
.tag .icon { width: 1.1em; height: 1.1em; vertical-align: 0; }

/* 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;
}
.featured::before {
  content: "";
  width: 0.8em;
  height: 0.8em;
  border-radius: 0.15em;
  background: var(--color-tile-gold);
  transform: rotate(-9deg);
}

/* 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);
  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-l); }

/* Job list and job card */
.job-list { display: grid; gap: var(--space-s); margin: 0 0 var(--space-l); padding: 0; list-style: none; }
.job-list > li { margin: 0; }

.job-card {
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-m);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-l);
}
.job-card > * { margin: 0; }
.job-card--featured { border-color: var(--color-tile-gold); border-inline-start-width: 6px; }
.job-card__head { display: flex; flex-wrap: wrap; align-items: flex-start; 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); 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: 600; }
.job-card__summary { 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);
  padding-block-start: var(--space-xs);
  border-top: var(--border-width) solid var(--color-border);
}
.job-card__foot form { margin: 0; }
.job-card__date { margin: 0; color: var(--color-muted); font-size: var(--step--1); }

/* 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); }
.facts > div {
  padding-block: var(--space-xs);
  border-bottom: var(--border-width) solid var(--color-border);
}
.facts > div:first-child { padding-block-start: 0; }
.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);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-l);
}
.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 { background: var(--color-tint); border-color: transparent; }
.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: transparent; }

/* 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: var(--radius-s);
  background: var(--blue-700);
  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-l);
}
.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: var(--space-2xs) var(--space-m); font-size: var(--step--1); }

/* 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 */
.hero { padding-block: var(--space-2xl) var(--space-xl); background: var(--color-sand); border-bottom: var(--border-width) solid var(--color-border); }
.hero__title { font-size: var(--step-5); max-width: 18ch; margin-block-end: var(--space-s); }
.hero__text { font-size: var(--step-1); color: var(--color-heading); margin-block-end: var(--space-l); }

.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-l);
}
.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; }

.promises {
  display: grid;
  gap: var(--space-m);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}
.stack > * + .promises { margin-block-start: var(--stack-space, var(--space-s)); }
.promises > li { display: flex; gap: var(--space-s); align-items: flex-start; margin: 0; }
.promises__icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  border-radius: var(--radius);
  background: var(--blue-700);
  color: #ffffff;
}
.promises__icon--gold { background: var(--gold); color: var(--blue-900); transform: rotate(-6deg); }
.promises__title { display: block; font-weight: 700; color: var(--color-heading); }

/* 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-radius: var(--radius-l);
  --field-width: none;
}
.filters__title { font-size: var(--step-1); margin-block-end: var(--space-s); }
.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); }

.empty-state {
  padding: var(--space-l) var(--space-m);
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-l);
}
.empty-state__tiles { display: grid; grid-template-columns: repeat(2, 1rem); gap: 0.2rem; margin-block-end: var(--space-s); }
.empty-state__tiles span { width: 1rem; height: 1rem; border-radius: 0.2rem; border: 2px solid var(--color-border-strong); }
.empty-state__tiles span:nth-child(3) { border-color: var(--color-tile-gold); transform: rotate(-9deg); }
.empty-state > :last-child { margin-block-end: 0; }

/* 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);
  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__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 */
.callout {
  margin-block: 0 var(--space-m);
  padding: var(--space-s) var(--space-m);
  border-inline-start: 6px solid var(--color-primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--color-sand);
  color: var(--color-text);
}
.callout > :last-child { margin-block-end: 0; }
.callout__title { margin: 0 0 var(--space-3xs); font-family: var(--font-body); font-size: var(--step-0); font-weight: 700; color: var(--color-heading); }
.callout--gold { border-inline-start-color: var(--color-tile-gold); }

/* 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) var(--space-m);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-l);
}
.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-heading); 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-s) var(--space-m); background: var(--color-sand); border-radius: var(--radius); }
.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-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-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__icon, .sg-example, .sg-code {
    border: 1px solid CanvasText;
  }
  .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; }
  .featured::before, .empty-state__tiles span { border: 1px solid CanvasText; }
  :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; }
}
:root[data-motion="reduce"] *,
:root[data-motion="reduce"] *::before,
:root[data-motion="reduce"] *::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;
    --root-size: 75%;
  }
  @page { margin: 18mm 16mm; }
  body { display: block; }
  .skip-link, .utility-bar, .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 { display: none !important; }
  .site-header, .site-footer { border: 0; background: none; 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; }
