/* ---------------------------------------------------------------------------
   nlp-project — shared foundation.

   The subject is Dutch municipal post: letters that arrive on paper, in
   officialese, and have to be acted on. So the page is built from documents on
   a desk: an off-white sheet for the sentence under study, hairline rules, a
   mono face for reference numbers, and exactly one piece of colour — the red
   of a rubber stamp, spent only on the verdict.

   The two candidate sentences are deliberately styled identically. Anything
   that told them apart visually would be a thumb on the scale.
--------------------------------------------------------------------------- */

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/Archivo-var.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Literata';
  src: url('/fonts/Literata-var.woff2') format('woff2');
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/IBMPlexMono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/IBMPlexMono-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

:root {
  --ground: #dde1da;
  --ground-edge: #cdd2c9;
  --paper: #fdfcfa;
  --paper-sunk: #f4f3ef;
  --ink: #161c26;
  --ink-soft: #5a6472;
  --ink-faint: #8b939d;
  --rule: #c9cec4;
  --rule-soft: #e3e5df;
  --stamp: #ab2a1f;
  --stamp-soft: #f6e7e4;

  --ui: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --read: 'Literata', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --radius: 3px;
  --shadow: 0 1px 0 rgba(22, 28, 38, .04), 0 2px 10px -4px rgba(22, 28, 38, .16);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #15181c;
    --ground-edge: #0e1013;
    --paper: #1e2227;
    --paper-sunk: #23282e;
    --ink: #e9e7e2;
    --ink-soft: #a6afb9;
    --ink-faint: #7b848e;
    --rule: #39404a;
    --rule-soft: #2b3138;
    --stamp: #e8695c;
    --stamp-soft: #341f1d;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 2px 12px -4px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.5;
  padding: 0 0 env(safe-area-inset-bottom, 0px);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* --- shared type roles ------------------------------------------------- */

.eyebrow {
  font-family: var(--mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}

.ref {
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.sentence {
  font-family: var(--read);
  font-size: 1.0625rem;
  line-height: 1.6;
  margin: 0;
  /* Dutch compounds get long; never let one push the card sideways. */
  overflow-wrap: break-word;
}

/* --- sheet: the paper metaphor ----------------------------------------- */

.sheet {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* --- buttons ----------------------------------------------------------- */

.btn {
  display: inline-block;
  text-decoration: none;
  font-family: var(--ui);
  font-size: .9375rem;
  font-weight: 500;
  padding: .6rem 1.1rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: background .12s ease, color .12s ease, opacity .12s ease;
}
.btn:hover:not(:disabled) { background: #000; }
.btn:disabled { opacity: .35; cursor: not-allowed; }

.btn-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn-quiet:hover:not(:disabled) { background: var(--paper-sunk); color: var(--ink); }

.btn-link {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}
.btn-link:hover { color: var(--ink); }

@media (prefers-color-scheme: dark) {
  .btn:hover:not(:disabled) { background: #fff; }
}

/* --- notices ----------------------------------------------------------- */

.notice {
  font-size: .875rem;
  padding: .7rem .9rem;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--paper-sunk);
}
.notice-warn {
  border-color: var(--stamp);
  background: var(--stamp-soft);
  color: var(--ink);
}


/* --- form controls ------------------------------------------------------ */

input[type="text"], input[type="number"], input[type="password"],
input[type="search"], textarea, select {
  font-family: var(--ui);
  font-size: .9375rem;
  color: var(--ink);
  background: var(--paper-sunk);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: .55rem .7rem;
  width: 100%;
  max-width: 22rem;
}
textarea { max-width: none; font-family: var(--read); line-height: 1.55; }
input[type="number"] { font-family: var(--mono); width: 7rem; }

.hint {
  display: block;
  font-size: .8125rem;
  font-weight: 400;
  color: var(--ink-soft);
  margin: .3rem 0 0;
}

.error {
  margin: 1rem 0 0;
  font-size: .875rem;
  color: var(--stamp);
  font-weight: 500;
}

/* --- chip groups: ratings, levels, verdicts ----------------------------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.chip { position: relative; }
.chip input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.chip span {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  padding: .45rem .75rem;
  min-width: 2.4rem;
  text-align: center;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink-soft);
  transition: background .1s ease, color .1s ease, border-color .1s ease;
}
.chip input:hover + span { border-color: var(--ink-faint); }
.chip input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.chip input:focus-visible + span {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.chips-num .chip span { font-family: var(--mono); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
