/* preambient.com/careers/<slug>/ — one plain application form per role.
   The Letter register: field, ink, serif and footer match manifesto.css. "Newsreader Text" is
   declared in the page head, as on the manifesto. System sans for labels and inputs. */
:root {
  color-scheme: light dark;
  --bg: #e6e8ec;
  --text: rgba(23, 24, 21, 0.9);
  --muted: rgba(23, 24, 26, 0.7);
  --line: rgba(23, 24, 26, 0.3);
  /* Field borders meet the 3:1 non-text contrast minimum (WCAG 1.4.11). */
  --field-border: rgba(23, 24, 26, 0.55);
  --field: rgba(255, 255, 255, 0.7);
  --ink: #171815;
  --focus: #482873;
  --error: #9b1c1c;
  --serif: "Newsreader Text", Georgia, "Times New Roman", serif;
  --mono: Consolas, Monaco, "Lucida Console", "Courier New", monospace;
  --gutter: clamp(20px, 4vw, 56px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101113;
    --text: rgba(255, 255, 255, 0.86);
    --muted: rgba(255, 255, 255, 0.62);
    --line: rgba(255, 255, 255, 0.3);
    --field-border: rgba(255, 255, 255, 0.45);
    --field: rgba(255, 255, 255, 0.06);
    --ink: #f2f2f2;
    --focus: #b9a2e0;
    --error: #ff9b9b;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.top { padding: calc(28px + env(safe-area-inset-top, 0px)) var(--gutter) 0; }
.top__wordmark { font: 300 24px/1.2 var(--serif); letter-spacing: -0.022em; color: var(--text); text-decoration: none; }
.top__wordmark, h1, .status--done, .roles a { font-optical-sizing: auto; -webkit-font-smoothing: antialiased; }
main { flex: 1; width: 100%; max-width: 600px; margin: 0 auto; padding: clamp(40px, 10vh, 96px) 20px 80px; }
h1 { font: 400 clamp(30px, 5vw, 40px)/1.15 var(--serif); letter-spacing: -0.01em; margin: 0 0 32px; }
.apply { display: grid; gap: 20px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 480px) { .row { grid-template-columns: 1fr; } }
label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
/* One box per question; careers.js appends the field's error message to it, 6px under the input. */
.field { display: grid; gap: 6px; }
input:not([type="radio"]) {
  font: inherit; font-size: 16px; color: var(--text); background: var(--field);
  border: 1px solid var(--field-border); border-radius: 6px; padding: 10px 12px; width: 100%;
}
/* Text, date and file fields share one height, 46px: text is 24px line + 20px padding + 2px border. */
input[type="date"] { height: 46px; padding-block: 0; text-align: left; -webkit-appearance: none; appearance: none; }
/* An empty date or file field reads as unanswered: muted like a placeholder, not ink like a value.
   careers.js keeps data-empty on the date input; the CV input is required, so :invalid means empty. */
input[type="date"][data-empty]:not(:focus)::-webkit-datetime-edit { color: var(--muted); }
input[type="file"]:invalid { color: var(--muted); }
input::-webkit-date-and-time-value { text-align: left; }
/* An invalid field: a 2px error edge (border plus an inset line), so it still reads as invalid
   under the focus ring, and its message directly below it. */
input:not([type="radio"])[aria-invalid="true"] { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.field-error { margin: 0; font-size: 14px; line-height: 1.4; color: var(--error); }
/* A radio row is 44px tall for the hit area, so an 18px radio has 13px of air under it: the message under the radio group
   moves up 7px to sit about as close to the radios as other messages sit to their fields. */
.field > fieldset + .field-error { margin-top: -7px; }
input[type="file"] { height: 46px; padding: 0 5px; }
/* The file button matches the fields instead of the raw OS "Choose File" button. */
input[type="file"]::file-selector-button {
  font: inherit; font-size: 14px; color: var(--text); background: transparent;
  border: 1px solid var(--field-border); border-radius: 4px; padding: 7px 12px; margin: 5px 12px 5px 0; cursor: pointer;
}
input[type="file"]:hover::file-selector-button { background: var(--field); }
/* Every focusable element, the wordmark and role links included, uses the careers focus token. */
a:focus-visible, input:focus-visible, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* The date field's calendar button takes focus inside the input. There only :focus-within matches
   the field, and Chrome drew its own blue ring on the button, which CSS cannot recolour:
   the whole field takes the careers ring instead, as it does for the date text. */
input[type="date"]:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
input[type="date"]::-webkit-calendar-picker-indicator { outline: none; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
legend { font-size: 14px; color: var(--muted); padding: 0; margin-bottom: 0; width: 100%; } /* the 44px radio rows already give the question 13px of air */
.choice { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 16px; color: var(--text); cursor: pointer; }
.choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--focus); }
[hidden] { display: none !important; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
button {
  justify-self: start; font: inherit; font-weight: 500; color: var(--bg); background: var(--ink);
  border: 0; border-radius: 6px; padding: 12px 20px; cursor: pointer;
  /* 20px grid gap + 12px: the action sits apart from the last field, as a label sits apart from the field above it. */
  margin-top: 12px;
}
/* Forced colours drop the fill, so the button gets an edge to stay a button. */
@media (forced-colors: active) { button { border: 1px solid ButtonText; } }
/* careers.js marks the button aria-disabled while a send is in flight (it keeps focus; disabled would drop it). */
button:disabled, button[aria-disabled="true"] { opacity: 0.6; cursor: progress; }
.status { margin: 16px 0 0; min-height: 1.5em; font-size: 14px; }
.status:focus { outline: none; }
.status--error { color: var(--error); }
.status--done { margin: 0; font: 400 20px/1.5 var(--serif); color: var(--text); }
/* /careers/: the list of open roles. */
.roles { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.roles li { border-bottom: 1px solid var(--line); }
.roles a { display: block; padding: 16px 0; font: 400 20px/1.4 var(--serif); color: var(--text); text-decoration: none; }
.roles a:hover { text-decoration: underline; text-underline-offset: 4px; }
/* As on the manifesto: mono, 11px, centred. */
.site-footer {
  padding: 24px var(--gutter) calc(28px + env(safe-area-inset-bottom, 0px));
  text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--muted);
}
