/* SPDX-License-Identifier: Apache-2.0
   Copyright 2026 Hodeitek S.L. */

/* One screen, one job, one answer. The hodeishield.com palette, dark only:
   obsidian ground, elevated panels, ink text, violet for the action, focus and
   links. Outcome colours appear only on the border, the glyph and the word of a
   result, never as a fill, and always travel with a drawn glyph and a word.
   Fonts are bundled (fonts/, SIL Open Font License); nothing is fetched. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans-latin-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-latin-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* Matches the hodeishield.com palette. */
:root {
  color-scheme: dark;
  --bg: oklch(0.13 0.015 260);
  --recessed: oklch(0.105 0.012 260);
  --surface: oklch(0.16 0.018 260);
  --subtle: oklch(0.19 0.02 260);
  --ink: oklch(0.97 0.01 260);
  --muted: oklch(0.76 0.025 260);
  --faint: oklch(0.62 0.025 260);
  --line: oklch(0.32 0.025 260);
  --line-strong: oklch(0.48 0.04 260);
  --control: oklch(0.52 0.04 260);
  --control-hover: oklch(0.6 0.04 260);
  --primary: oklch(0.55 0.22 287);
  --primary-hover: oklch(0.57 0.22 287);
  --primary-ink: oklch(0.99 0.003 287);
  --ring: oklch(0.588 0.219 287);
  --link: oklch(0.8 0.13 287);
  --ok: oklch(0.74 0.13 172);
  --bad: oklch(0.65 0.22 25);
  --info: oklch(0.72 0.13 264);
  --warn: oklch(0.85 0.146 90);
  --shadow: 0 4px 12px oklch(0 0 0 / 0.45), 0 1px 2px oklch(0 0 0 / 0.2);

  --radius-sm: 0.5rem;
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --measure: 46rem;
  --fast: 150ms;
  --slow: 380ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
}
/* Browsers without oklch: the same tokens in sRGB. */
@supports not (color: oklch(0 0 0)) {
  :root {
    --bg: #0e1118;
    --recessed: #090c12;
    --surface: #131820;
    --subtle: #1a1f29;
    --ink: #f3f5f9;
    --muted: #b4bac7;
    --faint: #8a91a1;
    --line: #353b49;
    --line-strong: #596175;
    --control: #667089;
    --control-hover: #7c869d;
    --primary: #704ee8;
    --primary-hover: #7a58ee;
    --primary-ink: #fcfbff;
    --ring: #7a5bf5;
    --link: #b8b0ff;
    --ok: #35c5a1;
    --bad: #e0564a;
    --info: #7ea4f9;
    --warn: #f2c94c;
    --shadow: 0 4px 12px rgba(0, 0, 0, .45), 0 1px 2px rgba(0, 0, 0, .2);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font);
  word-spacing: .04em;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  accent-color: var(--primary);
  caret-color: var(--ring);
  scrollbar-color: var(--line-strong) var(--bg);
}
::selection { background: var(--primary); color: var(--primary-ink); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
a:focus-visible, button.link:focus-visible, summary:focus-visible { border-radius: 4px; }

.skip { position: absolute; left: 1rem; top: -4rem; background: var(--primary); color: var(--primary-ink); font-weight: 600; padding: .6rem 1rem; border-radius: var(--radius); z-index: 10; text-decoration: none; }
.skip:focus { top: 1rem; }

a { color: var(--link); text-underline-offset: .2em; text-decoration-thickness: .07em; transition: text-decoration-thickness var(--fast) var(--ease); }
a:hover { text-decoration-thickness: .14em; }

.icon { width: 1.25rem; height: 1.25rem; flex: none; }

/* header: the shield and the wordmark, gap half the shield's width */
.top, main, .foot { width: min(100% - 2rem, var(--measure)); margin-inline: auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { display: block; width: 28px; height: 28px; flex: none; }
.brand-name { font-size: 1.25rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; color: var(--ink); }
.lang { display: flex; align-items: center; gap: .5rem; }
.lang-label { color: var(--muted); font-size: .875rem; }
/* on a phone the select alone shows the language; its label stays for screen readers */
@media (max-width: 30rem) { .lang-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
select, input[type="text"], input[type="url"], input[type="number"], textarea {
  font: inherit; color: var(--ink); background: var(--recessed);
  border: 1px solid var(--control); border-radius: var(--radius);
  min-height: 2.75rem; padding: .5rem .75rem; max-width: 100%;
  transition: border-color var(--fast) var(--ease);
}
select:hover, input:hover, textarea:hover { border-color: var(--control-hover); }
select { padding-right: 2rem; cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
textarea { width: 100%; min-height: 6rem; font-family: var(--mono); font-size: .875rem; line-height: 1.5; word-spacing: normal; resize: vertical; }

/* intro */
main { padding-block: 2.5rem 3rem; }
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: clamp(1.875rem, 1.3rem + 2.4vw, 2.25rem); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .75rem; }
.intro h1::before { content: ""; display: block; width: 2.5rem; height: 3px; margin-bottom: .875rem; border-radius: 2px; background: var(--ring); }
h2 { font-size: 1.25rem; font-weight: 600; line-height: 1.25; letter-spacing: -.015em; margin: 0 0 .25rem; }
h3 { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; margin: 1.75rem 0 .6rem; }
/* long German, French, Italian and Basque words in a narrow column */
:is(:lang(de), :lang(fr), :lang(it), :lang(eu)) :is(h1, h2, h3) { hyphens: auto; overflow-wrap: anywhere; }
.lead { margin: 0 0 1.25rem; max-width: 65ch; font-size: 1.125rem; line-height: 1.55; color: var(--muted); }
.privacy { display: flex; align-items: flex-start; gap: .65rem; margin: 0 0 2.25rem; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-size: .9375rem; }
.privacy .icon { color: var(--muted); margin-top: .15rem; }
.help { color: var(--muted); font-size: .9375rem; margin: .15rem 0 .65rem; max-width: 65ch; }

/* inputs */
.inputs { display: grid; gap: 1.75rem; }
@media (min-width: 40rem) {
  .inputs { grid-template-columns: 1fr 1fr; column-gap: 1.5rem; row-gap: 0; }
  /* both slots share their rows, so the two drop zones start at the same height */
  .inputs > .slot { display: grid; grid-template-rows: subgrid; grid-row: span 6; align-content: start; }
  .inputs > .slot > * { margin-block-end: 0; }
  .inputs > .slot > [data-remove] { grid-row: 5; }
  .inputs > .slot > .paste { grid-row: 6; }
}
.slot h2 { margin-top: 0; }
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .4rem;
  min-height: 8.5rem; padding: 1.25rem 1rem; background: var(--surface);
  border: 1.5px dashed var(--control); border-radius: var(--radius-lg);
  transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.drop:hover { border-color: var(--control-hover); }
.drop-icon { width: 1.75rem; height: 1.75rem; color: var(--muted); }
.drop-text { margin: 0; color: var(--muted); }
.drop-over { display: none; margin: 0; font-weight: 600; color: var(--ink); }
.drop.is-over { border-style: solid; border-color: var(--ring); background: var(--subtle); }
.drop.is-over .drop-text, .drop.is-over .drop-icon { display: none; }
.drop.is-over .drop-over { display: block; }
.drop.has-file { border-style: solid; border-color: var(--control); }
.drop.has-file .drop-icon { color: var(--ink); }
.drop:focus-within, .drop.has-file:focus-within { border-color: var(--ring); }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.slot-status { min-height: 1.5rem; margin: .55rem 0 0; font-size: .9375rem; overflow-wrap: anywhere; }
.slot-status.is-error { color: var(--bad); font-weight: 600; }
button.link { font: inherit; font-weight: 600; color: var(--link); background: none; border: 0; padding: .25rem .1rem; min-height: 2rem; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: .07em; }
button.link:hover { text-decoration-thickness: .14em; }
button.link.small { font-size: .9375rem; }
.slot button.link { justify-self: start; }
.paste { margin-top: .5rem; }
.paste summary, .more > summary { cursor: pointer; color: var(--link); font-weight: 600; min-height: 2rem; padding-block: .25rem; }
.paste summary { font-size: .9375rem; }
.paste summary:hover, .more > summary:hover { color: var(--ink); }
.paste textarea { margin-top: .4rem; }
.more > summary { font-size: 1.0625rem; letter-spacing: -.01em; }
.more { margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }

.fields { display: grid; gap: 1.1rem; margin-top: .6rem; }
@media (min-width: 40rem) { .fields { grid-template-columns: 1fr 1fr; column-gap: 1.5rem; } }
.field label { display: block; font-weight: 600; font-size: .9375rem; margin-bottom: .35rem; }
.field input { width: 100%; }
.field .help { margin-top: .35rem; font-size: .875rem; }

/* actions */
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
button.primary, button.secondary {
  font: inherit; font-weight: 600; letter-spacing: -.005em; min-height: 3rem; padding: .6rem 1.5rem; border-radius: var(--radius); cursor: pointer;
  border: 1px solid transparent;
}
button.secondary { transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease); }
button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 1px 2px oklch(0 0 0 / 0.4); }
button.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
button.primary:active:not(:disabled) { transform: translateY(1px); }
button.primary:disabled { background: transparent; color: var(--faint); border-color: var(--line-strong); box-shadow: none; cursor: not-allowed; }
button.secondary { background: transparent; color: var(--ink); border-color: var(--control); }
button.secondary:hover { background: var(--subtle); border-color: var(--control-hover); }
button.secondary.small { min-height: 2.5rem; padding: .35rem 1rem; font-size: .9375rem; }
@media (max-width: 39.99rem) { .actions button { width: 100%; } }
.engine { margin: .75rem 0 0; color: var(--muted); font-size: .9375rem; min-height: 1.5rem; }
.engine.is-error { color: var(--bad); font-weight: 600; }

/* the result slip: elevated, the verdict's hue on its border, glyph and word only */
.result { margin-top: 3rem; scroll-margin-top: 1rem; }
.slip {
  display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: start;
  padding: 1.6rem 1.6rem 1.5rem; border: 2px solid var(--tone); background: var(--surface); color: var(--ink);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.glyph { width: 3.5rem; height: 3.5rem; padding: .7rem; border-radius: 50%; border: 2px solid var(--tone); color: var(--tone); background: transparent; }
.slip h2 { font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.125rem); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; margin: .2rem 0 .6rem; color: var(--tone); }
.slip h2:focus-visible { outline-offset: 4px; border-radius: 4px; }
.slip p { margin: .3rem 0; max-width: 62ch; }
.slip .meaning { color: var(--ink); }
.slip .next { font-weight: 600; }
.slip .why { margin-top: .9rem; padding-top: .75rem; border-top: 1px solid var(--line); color: var(--muted); }
.slip .why strong { color: var(--ink); font-weight: 600; }
.slip .stamp { margin-top: .9rem; font-size: .8125rem; color: var(--faint); overflow-wrap: anywhere; font-variant-numeric: tabular-nums lining-nums; }
.result[data-verdict="verified"], .result[data-verdict="good"] { --tone: var(--ok); }
.result[data-verdict="failed"], .result[data-verdict="revoked"] { --tone: var(--bad); }
.result[data-verdict="could_not_check"], .result[data-verdict="unknown"] { --tone: var(--info); }
.result[data-verdict="expired"] { --tone: var(--warn); }
.result { --tone: var(--info); }
@media (max-width: 30rem) { .slip { grid-template-columns: 1fr; gap: .9rem; padding: 1.2rem; } .glyph { width: 3rem; height: 3rem; padding: .6rem; } }

.notes { list-style: none; margin: 1rem 0 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.notes:empty { display: none; }
.notes li { padding: .75rem 1rem; border-top: 1px solid var(--line); font-size: .9375rem; color: var(--muted); }
.notes li:first-child { border-top: 0; }
.limits { margin: 1rem 0 0; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); font-size: .9375rem; }

.checklist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.checklist li { display: grid; grid-template-columns: 1.75rem 1fr auto; gap: .75rem; align-items: start; padding: .8rem 1rem; border-top: 1px solid var(--line); animation: settle var(--slow) var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 60ms); }
.checklist li:first-child { border-top: 0; }
.checklist .mark { width: 1.5rem; height: 1.5rem; padding: .2rem; border-radius: 50%; margin-top: .05rem; border: 2px solid currentColor; background: transparent; }
.checklist .st-pass .mark { color: var(--ok); }
.checklist .st-fail .mark { color: var(--bad); }
.checklist .st-skip .mark, .checklist .st-notreached .mark { color: var(--muted); border-color: var(--control); }
.checklist .state { font-size: .875rem; font-weight: 600; white-space: nowrap; color: var(--muted); }
.checklist .st-pass .state { color: var(--ok); }
.checklist .st-fail .state { color: var(--bad); }
.result[data-verdict="expired"] .checklist .st-fail .mark, .result[data-verdict="expired"] .checklist .st-fail .state, .result[data-verdict="expired"] .codes .r-fail { color: var(--warn); }
.checklist .hint { display: block; color: var(--muted); font-size: .875rem; margin-top: .1rem; }
@media (max-width: 30rem) { .checklist li { grid-template-columns: 1.75rem 1fr; } .checklist .state { grid-column: 2; } }
@keyframes settle { from { opacity: 0; transform: translateY(6px); } }

.content dl, .facts { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: .55rem 1.25rem; margin: .6rem 0 0; padding: 1.1rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.content dt, .facts dt { color: var(--muted); font-size: .9375rem; }
.content dd, .facts dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums lining-nums; }
.facts dd.mono, .codes { font-family: var(--mono); font-size: .8125rem; font-variant-numeric: tabular-nums lining-nums; word-spacing: normal; }
.facts dd.mono { padding-top: .1rem; }
@media (max-width: 30rem) { .content dl, .facts { grid-template-columns: 1fr; gap: 0; } .content dd, .facts dd { margin-bottom: .65rem; } }
.fw { list-style: none; margin: 0; padding: 0; }
.fw li { padding: .1rem 0; }
.codes { margin: 0 0 1rem; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--recessed); overflow: hidden; }
.codes li { display: grid; grid-template-columns: 5rem 1fr auto; gap: .6rem; padding: .4rem .8rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; color: var(--muted); }
.codes li:first-child { border-top: 0; }
.codes [class^="r-"] { font-family: var(--font); font-weight: 600; word-spacing: .04em; }
.codes .r-pass { color: var(--ok); }
.codes .r-fail { color: var(--bad); font-weight: 700; }
.codes .r-warn { color: var(--warn); }
.copied { margin-left: .75rem; color: var(--muted); font-size: .9375rem; }

/* footer */
.foot { padding-block: 1.75rem 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9375rem; }
.foot p { margin: 0 0 .6rem; max-width: 65ch; }
.foot .browsers { color: var(--ink); font-weight: 600; }
.links { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; margin: 1.1rem 0 .85rem; padding: 0; }
.links a { display: inline-block; padding-block: .35rem; font-weight: 600; }
.version { font-size: .8125rem; color: var(--faint); font-variant-numeric: tabular-nums lining-nums; }
.noscript { width: min(100% - 2rem, var(--measure)); margin: 1rem auto; padding: 1rem; border: 2px solid var(--warn); background: var(--surface); border-radius: var(--radius); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .drop, .slip, .checklist, .codes, .privacy { border-color: CanvasText; }
  .glyph, .checklist .mark { forced-color-adjust: none; background: Canvas; color: CanvasText; border-color: CanvasText; }
}

/* A result is forwarded and filed: print it without the form, in black and white. */
@media print {
  :root { color-scheme: light; --bg: #fff; --recessed: #fff; --surface: #fff; --subtle: #fff; --ink: #000; --muted: #333; --faint: #333; --line: #000; --line-strong: #000; --control: #000; --tone: #000; --ok: #000; --bad: #000; --info: #000; --warn: #000; --link: #000; --ring: #000; --shadow: none; }
  .skip, .top, .intro, #form, .foot .links, .foot p:not(.version), #copy, .copied, .more > summary + p { display: none !important; }
  html, body { font-size: 11pt; background: #fff; color: #000; }
  .result { margin-top: 0; }
  .slip, .checklist, .content dl, .limits, .notes { border: 1.5pt solid #000; box-shadow: none; break-inside: avoid; }
  .notes li { border-top-color: #000; }
  .checklist li { animation: none; }
  .glyph { background: #fff; color: #000; border: 2pt solid #000; }
  .checklist .st-pass .mark, .checklist .st-fail .mark { background: #fff; color: #000; border: 2pt solid #000; }
  .tech:not([open]) { display: none; }
}
