/* America First Staffing — home page: the questionnaire.
   The page is a test sheet in the approved brand: Old Glory Blue ink on white paper, Inter throughout.
   One accent, Old Glory Red, appears only where the reader has touched the page: their marks, their
   supplier's name, their result. Nothing moves except what the reader changes. Print keeps the paper version. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/InterVariable.ttf") format("truetype");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/InterVariable-Italic.ttf") format("truetype");
  font-weight: 100 900; font-style: italic; font-display: swap;
}

:root {
  --ground: #FFFFFF;
  --ink: #002147;                            /* Old Glory Blue: 16.05:1 on white */
  --ink-soft: #4E535C;                       /* charcoal: 7.5:1 */
  --rule: #C9CDD3;
  --rule-strong: #002147;
  --rule-light: rgba(78, 83, 92, 0.25);
  --pen: #8A1A2C;                            /* Old Glory Red, deepened to a crimson for screen: 9.3:1 on white */
  --display: "Inter", "Helvetica Neue", Arial, sans-serif;
  --body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --measure: 62ch;
  --page: 1360px;
  --gutter: clamp(1rem, 4vw, 3.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ground); }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
@media (min-width: 768px) { body { font-size: 1.125rem; } }

a { color: var(--ink); text-decoration: underline; text-decoration-color: currentColor; text-underline-offset: 0.16em; text-decoration-thickness: 1px; }
a:hover { color: var(--pen); }
:focus-visible { outline: 2px solid var(--pen); outline-offset: 3px; }
p { margin: 0 0 1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }
button { font: inherit; color: inherit; }
img { max-width: 100%; height: auto; }

.skip-link { position: absolute; left: 1rem; top: -3rem; background: var(--ink); color: var(--ground); padding: 0.5rem 0.75rem; z-index: 1000; }
.skip-link:focus { top: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; margin: -1px; }

/* ---------- masthead: the lockup and the nav ---------- */
.masthead {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 2rem;
  max-width: var(--page); margin: 0 auto; padding: 1rem var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.masthead .name { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.masthead .lockup { width: clamp(220px, 24vw, 320px); height: auto; display: block; }
.masthead .emblem { width: 76px; height: auto; display: none; }
.masthead .wordmark-text { display: none; font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; white-space: nowrap; }
@media (max-width: 699px) { .masthead .lockup { display: none; } .masthead .emblem, .masthead .wordmark-text { display: block; } }
.masthead nav { display: flex; flex-wrap: wrap; gap: 0 1.4rem; font-size: 0.9375rem; font-weight: 500; }
.masthead nav a { text-decoration: none; color: var(--ink); padding: 0.35rem 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.masthead nav a:hover { border-bottom-color: var(--pen); }
.masthead nav a.btn { background: var(--pen); color: var(--ground); font-weight: 600; font-size: 0.9375rem; letter-spacing: 0.02em; line-height: 1; padding: 0.8rem 1.3rem; border-radius: 4px; border-bottom: 0; margin-left: 0.5rem; transition: background-color 200ms ease; }
.masthead nav a.btn:hover { background: var(--ink); }
.masthead nav { align-items: center; }
.masthead .brand { display: flex; align-items: center; flex-wrap: wrap; gap: 0.15rem 1rem; min-width: 0; }
.masthead .brand-line { margin: 0; font-family: var(--display); font-weight: 600; font-size: 0.95rem; line-height: 1.2; color: var(--ink-soft); white-space: nowrap; padding-left: 1rem; border-left: 1px solid var(--rule); }
@media (max-width: 1299px) { .masthead .brand-line { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; margin: -1px; } }

/* ---------- title block ---------- */
.lead { max-width: var(--page); margin: 0 auto; padding: 1rem var(--gutter) 0; }
.title { max-width: var(--page); margin: 0 auto; padding: clamp(2rem, 4vw, 3rem) var(--gutter) clamp(2rem, 4vw, 3rem); }
@media (min-width: 1000px) {
  .title { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); column-gap: 4rem; row-gap: 2rem; align-items: end; }
  .title h1 { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
  .title .standfirst { grid-column: 2; grid-row: 1; margin-top: 0; align-self: end; }
  .title .fields { grid-column: 2; grid-row: 2; margin-top: 0; max-width: none; }
}
.subline { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(0.95rem, 1.3vw, 1.2rem); line-height: 1.3; color: var(--pen); max-width: none; }
@media (min-width: 800px) { .subline { white-space: nowrap; } }
h1 {
  margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(2.4rem, 6vw, 5rem); line-height: 1.0; letter-spacing: -0.025em;
  max-width: 12ch; text-wrap: balance;
}
.standfirst { margin-top: clamp(1.25rem, 3vw, 2rem); font-size: clamp(1.1rem, 1.8vw, 1.35rem); line-height: 1.45; max-width: 40ch; color: var(--ink-soft); }
.fields { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem 3rem; margin-top: clamp(2rem, 4vw, 3rem); max-width: 48rem; }
.fields .field:first-child { flex: 1 1 16rem; min-width: 0; }
.fields .field:last-child { flex: 0 0 auto; }
.field { display: grid; grid-template-columns: 1fr; gap: 0.35rem; }
.field > span { font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.field input, .field output {
  font-family: var(--display); font-weight: 600; font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.15; color: var(--pen);
  background: transparent; border: 0; border-bottom: 1px solid var(--rule-strong); border-radius: 0; padding: 0.15rem 0 0.35rem; width: 100%; min-height: 2.6rem;
}
.field input::placeholder { color: var(--rule); font-weight: 600; }
.field input:focus-visible { outline: none; border-bottom: 2px solid var(--pen); padding-bottom: calc(0.35rem - 1px); }
.field output { display: block; white-space: nowrap; }

/* ---------- definition: one heading, one paragraph, the existing styles ---------- */
.define { max-width: var(--page); margin: 0 auto; padding: clamp(1.5rem, 3vw, 2.5rem) var(--gutter); border-bottom: 1px solid var(--rule-strong); }
.define h2 { margin: 0 0 0.75rem; font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.15; letter-spacing: -0.015em; color: var(--ink); max-width: 26ch; text-wrap: balance; }
.define p { max-width: 62ch; font-size: clamp(1.05rem, 1.5vw, 1.2rem); line-height: 1.55; color: var(--ink); }
@media print { .lead { display: none; } .define { padding: 0.5rem 0; border-bottom-color: #000; } .define h2 { font-size: 13pt; color: #000; } .define p { font-size: 10pt; color: #000; } }

/* ---------- the sheet ---------- */
.sheet { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); position: relative; }
@media (min-width: 1000px) { .sheet { display: grid; grid-template-columns: minmax(0, 1fr) 11rem; column-gap: 3rem; align-items: start; } }

.tally { display: flex; align-items: baseline; gap: 0.5rem; padding: 1rem 0; border-top: 1px solid var(--rule-strong); }
.tally-n { font-family: var(--display); font-weight: 700; font-size: 2.2rem; line-height: 1; color: var(--pen); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tally-n .of { font-weight: 600; font-size: 1.1rem; color: var(--ink); letter-spacing: 0; }
.tally-l { font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft); }
@media (min-width: 1000px) {
  .tally { grid-column: 2; grid-row: 1; position: sticky; top: 1.5rem; flex-direction: column; align-items: flex-start; gap: 0.25rem; border-top: 1px solid var(--rule-strong); padding-top: 0.75rem; }
  .tally-n { font-size: 4rem; }
  .tally-n .of { font-size: 1.25rem; }
  .questions { grid-column: 1; grid-row: 1 / span 2; }
  .result { grid-column: 1; }
}

.questions { list-style: none; margin: 0; padding: 0; counter-reset: q; }
.q { padding: clamp(1.75rem, 4vw, 3rem) 0; border-top: 1px solid var(--rule-strong); }
.q h2 {
  margin: 0; font-family: var(--body); font-weight: 400; font-size: clamp(1.25rem, 2.2vw, 1.7rem); line-height: 1.35; letter-spacing: -0.005em;
  max-width: 34ch; position: relative; padding-left: 2.4em; color: var(--ink);
}
.q .num { position: absolute; left: 0; top: -0.05em; font-family: var(--display); font-weight: 700; font-size: 1.5em; line-height: 1; color: var(--pen); font-variant-numeric: tabular-nums; }
.q .topic { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; }
.q fieldset { border: 0; margin: 1.5rem 0 0 2.4em; padding: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem; }
@media (max-width: 599px) { .q fieldset { margin-left: 0; flex-direction: column; gap: 0.6rem; } .q h2 { padding-left: 1.7em; } }
.q label { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; font-size: 1rem; line-height: 1.2; }
.q input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.q .box { display: inline-block; width: 1.25em; height: 1.25em; border: 1px solid var(--rule-strong); border-radius: 2px; position: relative; flex: none; background: var(--ground); }
.q .box::before, .q .box::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 1.15em; height: 2px; background: var(--pen);
  transform: translate(-50%, -50%) rotate(45deg) scaleX(0); transform-origin: center; transition: transform 200ms ease;
}
.q .box::after { transform: translate(-50%, -50%) rotate(-45deg) scaleX(0); }
.q input:checked + .box { border-color: var(--pen); }
.q input:checked + .box::before { transform: translate(-50%, -50%) rotate(45deg) scaleX(1); }
.q input:checked + .box::after { transform: translate(-50%, -50%) rotate(-45deg) scaleX(1); transition-delay: 90ms; }
.q input:checked ~ * { color: var(--pen); }
.q input:focus-visible + .box { outline: 2px solid var(--pen); outline-offset: 3px; }
.q .ours { margin: 1.5rem 0 0 2.4em; font-size: 1rem; line-height: 1.5; max-width: 56ch; color: var(--ink-soft); }
@media (max-width: 599px) { .q .ours { margin-left: 0; } }
.q .ours em { font-style: normal; font-weight: 600; color: var(--ink); }

/* our answer appears when the reader marks the question, or asks for it. Without script it is simply there. */
.show-ours { display: none; margin: 1.25rem 0 0 2.4em; padding: 0; border: 0; background: none; font: inherit; font-size: 0.9375rem; font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 0.16em; cursor: pointer; }
.show-ours:hover { color: var(--pen); text-decoration-color: currentColor; }
@media (max-width: 599px) { .show-ours { margin-left: 0; } }
.js .show-ours { display: inline-block; }
.js .q.is-revealed .show-ours { display: none; }
.js .q .ours { max-height: 0; opacity: 0; overflow: hidden; margin-top: 0; transition: max-height 300ms ease, opacity 250ms ease 60ms, margin-top 300ms ease; }
.js .q.is-revealed .ours { max-height: 24rem; opacity: 1; margin-top: 1.5rem; }
.q { position: relative; }
.q.is-next::before { content: ""; position: absolute; left: calc(-1 * var(--gutter) + 4px); top: clamp(1.75rem, 4vw, 3rem); bottom: clamp(1.75rem, 4vw, 3rem); width: 3px; background: var(--pen); }

/* ---------- result ---------- */
.result { border-top: 1px solid var(--rule-strong); padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(2.5rem, 6vw, 4rem); }
.result h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 4.5vw, 3.5rem); line-height: 1.05; letter-spacing: -0.02em; max-width: 16ch; color: var(--pen); text-wrap: balance; }
.result h2 output { font-variant-numeric: tabular-nums; }
.breakdown { margin-top: 1rem; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--pen); }
.breakdown output { font-weight: 700; }
.ours-closing { margin-top: 1.75rem; max-width: 56ch; color: var(--ink-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; margin-top: 2rem; }
.actions button, .actions .cta {
  display: inline-block; font-family: var(--body); font-weight: 600; font-size: 0.9375rem; line-height: 1; letter-spacing: 0.02em; padding: 0.9rem 1.4rem;
  border: 2px solid var(--ink); background: transparent; color: var(--ink);
  cursor: pointer; text-decoration: none; border-radius: 4px; transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}
.actions button:hover, .actions .cta:hover { background: var(--ink); color: var(--ground); }
.actions .cta { background: var(--pen); border-color: var(--pen); color: var(--ground); }
.actions .cta:hover { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.note { margin-top: 1.25rem; font-size: 0.9375rem; color: var(--ink-soft); }

/* ---------- coda: the reverse on navy ---------- */
.coda { background: var(--ink); color: var(--ground); padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.coda .wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.coda .line { font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 3.4vw, 2.6rem); line-height: 1.1; letter-spacing: -0.015em; max-width: 24ch; margin-bottom: 1.25rem; }
.coda p { color: rgba(255, 255, 255, 0.82); }
.coda a { color: var(--ground); }
.coda a:hover { color: var(--ground); text-decoration-thickness: 2px; }
.coda .tagline { margin-top: 2rem; font-family: var(--display); font-weight: 700; font-size: 1.5rem; color: var(--ground); }
.coda .tagline .star { display: inline-block; width: 0.6em; height: 0.6em; margin-right: 0.35em; vertical-align: 0.05em; }
.star path { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }

/* ---------- colophon ---------- */
.colophon { background: var(--ink); color: rgba(255, 255, 255, 0.7); padding: 1.5rem 0 3rem; border-top: 1px solid rgba(255, 255, 255, 0.2); font-size: 0.875rem; }
.colophon .wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.colophon a { margin-right: 1.25rem; color: rgba(255, 255, 255, 0.85); }
.colophon a:hover { color: var(--ground); }
.colophon .notice { margin-top: 0.75rem; max-width: 80ch; }

/* ---------- privacy choices ---------- */
.privacy-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--ground); color: var(--ink); border-top: 3px solid var(--ink);
  padding: 0.9rem var(--gutter); display: none; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 0.9375rem;
  box-shadow: 0 -4px 16px rgba(0, 33, 71, 0.12);
}
.privacy-bar.is-visible { display: flex; }
.privacy-bar p { margin: 0; max-width: 70ch; }
.privacy-bar button { border: 2px solid var(--ink); background: var(--ink); color: var(--ground); padding: 0.6rem 1rem; cursor: pointer; border-radius: 4px; font-weight: 600; }
.privacy-bar button:hover { background: transparent; color: var(--ink); }

/* ---------- print: a one-page scorecard ---------- */
@media print {
  @page { margin: 18mm; }
  html, body { background: #fff; color: #000; font-size: 11pt; }
  .masthead nav, .masthead .brand-line, .subline, .skip-link, .privacy-bar, .actions, .note, .coda, .tally, .standfirst { display: none !important; }
  .masthead { border-bottom: 1px solid #000; padding: 0 0 0.5rem; }
  .masthead .lockup { display: block !important; width: 60mm; }
  .masthead .emblem, .masthead .wordmark-text { display: none !important; }
  .title { padding: 1rem 0 0.75rem; }
  h1 { font-size: 22pt; max-width: none; color: #000; }
  .fields { margin-top: 0.75rem; grid-template-columns: 2fr 1fr; }
  .field > span { color: #3A3A3A; }
  .field input, .field output { font-size: 13pt; min-height: auto; padding: 0; color: #8A1A2C; border-bottom-color: #000; }
  .sheet { display: block; padding: 0; }
  .q { padding: 0.55rem 0; break-inside: avoid; border-top-color: #000; }
  .q h2 { font-size: 12pt; padding-left: 1.8em; max-width: none; color: #000; }
  .q .num, .q .topic { color: #000; }
  .q fieldset { margin: 0.35rem 0 0 1.8em; gap: 0.25rem 1.5rem; }
  .q label { font-size: 10pt; color: #000; }
  .q .box { border-color: #000; }
  .q .box::before, .q .box::after { transition: none; background: #8A1A2C; }
  .q input:checked ~ * { color: #8A1A2C; }
  .q .ours { margin: 0.3rem 0 0 1.8em; font-size: 9.5pt; max-width: none; color: #000; max-height: none !important; opacity: 1 !important; }
  .show-ours, .q.is-next::before { display: none !important; }
  .q .ours em { color: #3A3A3A; }
  .result { padding: 0.75rem 0 0; break-inside: avoid; border-top-color: #000; }
  .result h2 { font-size: 18pt; color: #8A1A2C; }
  .breakdown { font-size: 11pt; color: #8A1A2C; }
  .ours-closing { font-size: 9.5pt; color: #000; }
  .colophon { background: none; color: #3A3A3A; font-size: 8pt; padding: 0.5rem 0 0; border-top-color: #000; }
  .colophon .wrap { padding: 0; }
  .colophon a { text-decoration: none; color: #3A3A3A; }
  .colophon a[data-open-privacy] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
