/*
 * One sheet of paper: an HR assessment form on a carpet-grey desk.
 * Answers are filled-in bubbles, like an exam sheet. The one bold move is the rubber-stamp result.
 */
:root {
  --ground: #cdd5da;
  --carpet: #c3ccd2;
  --paper: #fcfcfa;
  --field: #eef2f4;
  --ink: #1c2831;
  --muted: #566772;
  --rule: #b8c4cb;
  --hi: #f6d94a;
  --hi-ink: #1c2831;
  --stamp: #b3261e;
  --display: "Special Elite", "Courier New", Courier, monospace;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #10181d; --carpet: #151f26; --paper: #1c2730; --field: #243541; --ink: #e9eff2; --muted: #9db0bb;
    --rule: #384853; --hi: #e3c63a; --hi-ink: #14202a; --stamp: #f0766b;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--ground);
  background-image: repeating-linear-gradient(0deg, transparent 0 3px, var(--carpet) 3px 4px), repeating-linear-gradient(90deg, transparent 0 3px, var(--carpet) 3px 4px);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
}
.desk {
  padding-block: clamp(16px, 4vw, 44px);
  padding-left: max(14px, env(safe-area-inset-left, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px));
}
.sheet {
  max-width: 740px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: 0 1px 0 var(--rule), 0 18px 34px -22px rgba(0, 0, 0, .55);
}
img { max-width: 100%; height: auto; }
h1, h2, h3, p, ol, ul, dl, dd, fieldset { margin: 0; padding: 0; }
ol, ul { list-style: none; }

/* header strip */
.strip {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px;
  padding: 11px clamp(16px, 4vw, 32px);
  border-bottom: 1px solid var(--rule);
  font: 400 12.5px/1.5 var(--mono);
  color: var(--muted);
}
.badge { display: inline-block; margin-left: 6px; padding: 0 6px; background: var(--hi); color: var(--hi-ink); font-weight: 500; border-radius: 2px; }

.pad { padding: clamp(22px, 5vw, 40px) clamp(16px, 4vw, 32px) clamp(26px, 5vw, 44px); }
.band { display: block; width: 100%; height: auto; border-bottom: 1px solid var(--rule); }
.center { text-align: center; }
.center .btn { margin-top: 18px; }

/* type */
.display, h1 { font-family: var(--display); font-weight: 400; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 7.4vw, 3.3rem); line-height: 1.06; }
h2.display { font-size: clamp(1.7rem, 5.6vw, 2.5rem); line-height: 1.1; }
h3 { margin: 38px 0 12px; font: 500 14px/1.3 var(--mono); color: var(--muted); }
h1:focus, .display:focus, .q:focus { outline: none; }
.lede { max-width: 62ch; margin-top: 16px; font-size: 1.0625rem; }
.small-lede { font-size: 1rem; color: var(--muted); margin-top: 10px; }
.facts { margin-top: 18px; padding: 12px 0; border-block: 1px solid var(--rule); font: 400 13px/1.5 var(--mono); color: var(--muted); }
.fine, .note { margin-top: 18px; max-width: 62ch; font-size: 13.5px; color: var(--muted); }
.center .note { margin-inline: auto; }
.tag { font: 500 13px/1.4 var(--mono); color: var(--muted); }

/* fields: typed lines on a form */
.fields { margin-top: 26px; display: grid; gap: 18px; max-width: 520px; }
.field { display: grid; gap: 4px; }
.lab { font: 500 13px/1.3 var(--mono); }
.opt { font-weight: 400; color: var(--muted); }
.field input {
  width: 100%; min-height: 46px; padding: 9px 12px;
  font: 400 16px/1.3 var(--mono); color: var(--ink);
  background: var(--field); border: 0; border-bottom: 2px solid var(--ink); border-radius: 2px 2px 0 0;
}
.field input:focus-visible { outline: 3px solid var(--stamp); outline-offset: 1px; }
.field input[aria-invalid="true"] { border-bottom-color: var(--stamp); background: color-mix(in srgb, var(--stamp) 10%, var(--field)); }
.help { font-size: 13px; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { min-height: 1.4em; font-size: 14px; font-weight: 500; color: var(--stamp); }
.form-error:empty { min-height: 0; }

/* buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn {
  appearance: none; cursor: pointer; border-radius: 2px;
  min-height: 46px; padding: 12px 20px;
  border: 2px solid var(--ink); background: var(--ink); color: var(--paper);
  font: 500 14px/1.2 var(--mono);
}
.btn:hover:not(:disabled) { background: var(--hi); color: var(--hi-ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover:not(:disabled) { background: var(--field); color: var(--ink); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--stamp); outline-offset: 2px; }

/* quiz */
.prog { display: grid; gap: 10px; margin-bottom: 26px; }
.count { font: 500 13px/1.2 var(--mono); color: var(--muted); }
.cells { display: flex; gap: 3px; }
.cells i { flex: 1 1 0; min-width: 0; height: 9px; border: 1px solid var(--rule); background: transparent; }
.cells i.done { background: var(--ink); border-color: var(--ink); }
.cells i.now { background: var(--hi); border-color: var(--ink); }
.cells i.bonus { border-style: dashed; border-color: var(--muted); }
.cells i.bonus.done { border-style: solid; }
fieldset { border: 0; min-width: 0; }
legend { padding: 0; width: 100%; }
legend .tag { display: block; margin-bottom: 8px; }
.q { display: block; max-width: 38ch; font: 600 clamp(1.2rem, 3.8vw, 1.5rem)/1.3 var(--body); text-wrap: pretty; }
.opts { display: grid; gap: 10px; margin-top: 24px; }
.choice {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start;
  padding: 14px 16px; min-height: 52px;
  border: 1px solid var(--rule); background: var(--paper); border-radius: 2px; cursor: pointer;
}
.choice:hover { border-color: var(--ink); }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bubble {
  width: 26px; height: 26px; display: grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 50%;
  font: 500 12px/1 var(--mono); color: var(--ink);
}
.txt { padding-top: 2px; }
.choice.sel { background: var(--hi); color: var(--hi-ink); border-color: var(--ink); }
.choice.sel .bubble { background: var(--ink); color: var(--paper); }
.choice:focus-within { outline: 3px solid var(--stamp); outline-offset: 2px; }

/* loading */
.spinner { width: 34px; height: 34px; margin: 10px auto 18px; border: 4px solid var(--rule); border-top-color: var(--ink); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* result */
.band.short { max-height: 120px; object-fit: cover; }
.band.slim { max-height: 56px; object-fit: cover; }
.file-head { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 22px; }
.id { margin: 0; flex: none; width: 132px; border: 1px solid var(--ink); background: var(--paper); }
.badge-photo { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; background: var(--field); object-fit: cover; object-position: 50% 15%; }
.id figcaption { padding: 5px 2px 4px; border-top: 1px solid var(--ink); text-align: center; font: 400 13px/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-id { flex: 1 1 240px; min-width: 0; }
.role { margin-top: 8px; font: 400 13.5px/1.4 var(--mono); color: var(--muted); }
.stamp {
  flex: none; margin: 4px 6px 4px auto; padding: 8px 14px;
  border: 3px solid var(--stamp); border-radius: 4px; color: var(--stamp);
  font: 400 1.4rem/1.1 var(--display); text-align: center; letter-spacing: .02em;
  transform: rotate(-7deg);
  animation: stamp-in .34s .12s cubic-bezier(.2, .8, .2, 1) backwards;
}
.stamp small { display: block; margin-bottom: 3px; font: 500 11px/1.2 var(--mono); letter-spacing: .06em; }
@keyframes stamp-in { from { transform: rotate(-7deg) scale(1.8); opacity: 0; } }
.blurb { margin-top: 24px; max-width: 60ch; font-size: 1.0625rem; }
.rows { margin-top: 22px; border-top: 1px solid var(--rule); }
.rows div { display: grid; grid-template-columns: minmax(96px, 150px) minmax(0, 1fr); gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.rows dt { font: 500 13px/1.6 var(--mono); color: var(--muted); }
.bars { display: grid; gap: 12px; }
.bar { display: grid; grid-template-columns: minmax(96px, 150px) minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; font-size: 14.5px; }
.track { position: relative; height: 12px; background: var(--field); border: 1px solid var(--rule); }
.fill { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.notch { position: absolute; top: -6px; bottom: -6px; width: 4px; margin-left: -2px; background: var(--stamp); }
.num { font: 400 12.5px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.key { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.key span::before { content: ""; display: inline-block; margin-right: 7px; vertical-align: -2px; }
.key .k1::before { width: 16px; height: 10px; background: var(--ink); }
.key .k2::before { width: 4px; height: 14px; background: var(--stamp); vertical-align: -3px; }
.runners { border-top: 1px solid var(--rule); }
.runners li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.runners img { width: 44px; height: 44px; flex: none; border: 1px solid var(--rule); object-fit: cover; object-position: 50% 15%; }
.runners .who { flex: 1 1 auto; min-width: 0; }
.runners .who span { display: block; font: 400 12.5px/1.3 var(--mono); color: var(--muted); }
.pc { font: 400 13.5px/1.4 var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.copybox { display: block; width: 100%; margin-top: 12px; padding: 10px 12px; font: 400 13px/1.4 var(--mono); color: var(--ink); background: var(--field); border: 1px solid var(--rule); border-radius: 2px; }
.status { min-height: 1.4em; margin-top: 10px; font-size: 13.5px; color: var(--muted); }

/* past results */
.recent { border-top: 1px solid var(--rule); }
.recent li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.recent img { width: 40px; height: 40px; flex: none; border: 1px solid var(--rule); object-fit: cover; object-position: 50% 15%; }
.recent .who { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.recent .who b { font-weight: 600; }
.recent .who span { display: block; font-size: 13.5px; color: var(--muted); }
.empty { padding: 14px 0; color: var(--muted); border-bottom: 1px solid var(--rule); }
.chart { display: grid; gap: 8px; }
.chart li { display: grid; grid-template-columns: 30px minmax(92px, 150px) minmax(0, 1fr) 2.2em; gap: 10px; align-items: center; font-size: 14px; }
.chart img { width: 30px; height: 30px; border: 1px solid var(--rule); object-fit: cover; object-position: 50% 15%; }
.chart .track { height: 16px; }
.chart .fill { min-width: 0; }
.chart .num { text-align: right; color: var(--ink); }

/* meet the staff */
.staff { margin-top: 22px; border-top: 1px solid var(--rule); }
.person {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); grid-template-areas: "photo who" "photo detail";
  gap: 6px 22px; align-items: start; padding: 22px 0; border-bottom: 1px solid var(--rule);
}
.person .id { grid-area: photo; width: 112px; }
.person .who { grid-area: who; min-width: 0; }
.person .detail { grid-area: detail; min-width: 0; }
.person h3 { margin: 0; font: 400 clamp(1.3rem, 4.4vw, 1.6rem)/1.15 var(--display); color: var(--ink); }
.person .role { margin-top: 6px; }
.person .blurb { margin-top: 0; font-size: 1rem; }
.person .rows { margin-top: 14px; }
.profile { margin-top: 14px; }
.profile summary { padding: 4px 0; cursor: pointer; font: 500 13px/1.4 var(--mono); color: var(--muted); }
.profile summary:focus-visible { outline: 3px solid var(--stamp); outline-offset: 2px; }
.profile[open] summary { margin-bottom: 12px; }

@media (max-width: 520px) {
  .bar { grid-template-columns: minmax(0, 1fr) auto; }
  .bar .track { grid-column: 1 / -1; order: 3; }
  .rows div { grid-template-columns: minmax(0, 1fr); }
  .q { max-width: none; }
  .chart li { grid-template-columns: 26px 76px minmax(0, 1fr) 1.6em; gap: 8px; }
  .chart .last { display: none; }
  .chart img { width: 26px; height: 26px; }
  .stamp { margin-left: 0; }
  .person { grid-template-columns: 76px minmax(0, 1fr); grid-template-areas: "photo who" "detail detail"; gap: 14px; }
  .person .id { width: 76px; }
  .person .id figcaption { font-size: 11px; letter-spacing: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .stamp { animation: none; }
  .spinner { animation-duration: 3s; }
}
