/* 83zero workforce survey. Tokens from the 83zero design system (Claude Design). */
:root {
  /* colour: fixed brand tokens */
  --midnight-green: #003f4e;
  --princeton-orange: #f18620;
  --white: #ffffff;
  --midnight-deep: #0d1521;
  /* colour: roles on the brand (dark) ground */
  --surface-brand: var(--midnight-green);
  --on-brand: var(--white);
  --ink-muted: #b3c5ca;          /* dark ink-muted: 6.46:1 on Midnight Green */
  --accent: var(--princeton-orange);
  --on-accent: var(--midnight-green); /* 4.49:1 on Orange: 19px bold+ only */
  --rule: var(--white);
  --divider: #1d4a57;
  --focus: var(--princeton-orange);
  --field-ink: var(--midnight-green);
  --field-placeholder: #4d6f78;  /* light ink-muted: 5.44:1 on White */

  /* type: brand faces where installed (iOS/macOS ship Avenir Next); no font files served */
  --font-display: "Avenir Next LT Pro", "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  --font-text: "Avenir LT Std", Avenir, "Avenir Next", "Helvetica Neue", Arial, sans-serif;

  /* spacing (space-1..5) */
  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 32px;
  --radius: 6px; /* radius-sm: softened corners, requested by 83zero in the walkthrough (brand default is square) */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --slide: 320ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--surface-brand);
  color: var(--on-brand);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: var(--on-brand); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ── brand row + in-content navigation (progress, Back, Next) ─────── */
.brand { max-width: 560px; margin: 0 auto; padding: calc(var(--s3) + env(safe-area-inset-top)) var(--s3) 0; }
.brand[hidden] { display: none; }
.bar-logo { width: 104px; height: auto; }
.nav {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  max-width: 560px; margin: 0 auto;
  padding: 12px var(--s3);
  background: var(--surface-brand);
  border-bottom: 1px solid var(--divider);
}
.nav[hidden] { display: none; }
.nav-btn {
  min-height: 44px; min-width: 72px; padding: 8px 14px;
  background: transparent; color: var(--on-brand);
  border: 1px solid var(--rule); border-radius: var(--radius);
  font-family: var(--font-display); font-weight: 700; font-size: 19px;
  cursor: pointer;
}
/* The one forward control: filled Orange when it can be used (Midnight text at 19px bold, 4.49:1). */
.nav-btn.fwd:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.nav-btn:disabled { opacity: 0.35; cursor: default; }
@media (hover: hover) { .nav-btn:not(:disabled):hover { border-color: var(--accent); } }
.nav-progress { min-width: 0; }
.progress { height: 8px; background: var(--divider); border-radius: 4px; overflow: hidden; }
.progress-fill {
  height: 100%; width: 100%;
  background: var(--accent);
  border-radius: 4px;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 400ms var(--ease);
}
.step { display: block; margin-top: 6px; font-size: 13px; color: var(--ink-muted); text-align: center; }

/* ── card deck: one card per screen, sliding horizontally ───────────── */
.deck {
  display: grid;
  max-width: 560px; margin: 0 auto;
  overflow-x: clip; /* clip, not hidden, so sticky elements inside cards still stick */
}
.card {
  grid-area: 1 / 1;
  display: none;
  padding: var(--s3) var(--s3) calc(var(--s5) + env(safe-area-inset-bottom));
  min-width: 0;
}
.card.is-current, .card.is-leaving { display: block; }
.card { padding-top: var(--s4); }
.card.is-leaving { pointer-events: none; }
.card.in-next { animation: in-next var(--slide) var(--ease) both; }
.card.out-next { animation: out-next var(--slide) var(--ease) both; }
.card.in-prev { animation: in-prev var(--slide) var(--ease) both; }
.card.out-prev { animation: out-prev var(--slide) var(--ease) both; }
@keyframes in-next { from { transform: translateX(100%); } to { transform: none; } }
@keyframes out-next { from { transform: none; } to { transform: translateX(-100%); } }
@keyframes in-prev { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes out-prev { from { transform: none; } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .card.in-next, .card.out-next, .card.in-prev, .card.out-prev { animation: none; }
  .progress-fill { transition: none; }
}

.loading { color: var(--ink-muted); }

/* ── intro (shares the first card with Q1) ──────────────────────────── */
.intro { margin-bottom: var(--s4); }
.intro-logo { width: 150px; height: auto; margin: var(--s2) 0 var(--s4); }
.stacked { margin: 0; font-size: 32px; }
.stacked .echo, .stacked .solid {
  font-family: var(--font-display); font-weight: 700; font-size: 1em; line-height: 1.02;
  letter-spacing: -0.01em; margin: 0;
}
/* Stacked title: two hollow outline echoes of the opening words, directly above the solid title. */
.stacked .echo {
  color: transparent;
  -webkit-text-stroke: 0.75pt var(--white);
  white-space: nowrap; overflow: hidden;
  pointer-events: none; user-select: none;
}
.stacked .echo-1 { opacity: 0.25; }
.stacked .echo-2 { opacity: 0.5; }
.stacked .hl { color: var(--accent); }
.intro-context { font-size: 17px; line-height: 1.5; margin: var(--s3) 0 var(--s2); }
.intro-meta {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  color: var(--ink-muted); margin: 0;
}

/* ── question ───────────────────────────────────────────────────────── */
.q-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 26px; line-height: 1.15; margin: var(--s2) 0 var(--s2);
}
.q-title:focus { outline: none; }
.q-sub { color: var(--ink-muted); margin: 0 0 var(--s4); font-size: 16px; }
.intro + .q-title { padding-top: var(--s4); border-top: 1px solid var(--divider); }

.options { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.option {
  display: flex; align-items: center; width: 100%; min-height: 56px;
  padding: 14px var(--s3);
  text-align: left;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.25;
  cursor: pointer;
  transition: background-color 120ms, color 120ms, border-color 120ms;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .option:hover { border-color: var(--accent); } }
.option[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
}
.option[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
.option .tick { margin-left: auto; padding-left: var(--s3); font-size: 15px; visibility: hidden; }
.option[aria-pressed="true"] .tick { visibility: visible; }

/* Multi-select: badge, tick boxes, sticky Next bar */
.badge {
  display: inline-block; margin: 0 0 var(--s3); padding: 6px 12px;
  border: 2px solid var(--accent); border-radius: var(--radius);
  font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--on-brand);
}
.option-multi { gap: 14px; }
.option-multi .box {
  flex: none; width: 24px; height: 24px; position: relative;
  border: 2px solid currentColor; border-radius: 4px;
}
.option-multi[aria-checked="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
}
.option-multi[aria-checked="true"] .box::after {
  content: ""; position: absolute; left: 6px; top: 1px; width: 7px; height: 13px;
  border: solid currentColor; border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.multi-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 var(--s3); }
.multi-head .badge { margin: 0; }
.multi-head .counter { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--on-brand); }
.sticky-actions {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: var(--s3);
  margin: var(--s3) calc(-1 * var(--s3)) 0; padding: 12px var(--s3) calc(12px + env(safe-area-inset-bottom));
  background: var(--surface-brand); border-top: 1px solid var(--divider);
}
.sticky-actions .counter { flex: none; font-size: 15px; color: var(--on-brand); font-family: var(--font-display); font-weight: 700; }
.sticky-actions .primary { flex: 1; }
.link-button { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.email-wrap { margin-top: var(--s4); }
.email-wrap[hidden] { display: none; }

/* ── buttons ────────────────────────────────────────────────────────── */
.actions { margin-top: var(--s4); }
.primary {
  width: 100%; min-height: 56px; padding: 14px var(--s3);
  background: var(--accent); color: var(--on-accent);
  border: 0; border-radius: var(--radius);
  font-family: var(--font-display); font-weight: 700; font-size: 19px;
  cursor: pointer;
}
.primary:disabled { opacity: 0.4; cursor: not-allowed; }
.primary.is-busy { opacity: 0.7; }

/* ── text and email fields ──────────────────────────────────────────── */
.field-label {
  display: block; font-family: var(--font-display); font-weight: 700; font-size: 17px; margin: 0 0 var(--s2);
}
.textarea, .input {
  display: block; width: 100%;
  background: var(--white); color: var(--field-ink);
  border: 0; border-radius: var(--radius);
  padding: 14px var(--s3); font-size: 17px; line-height: 1.45;
}
.textarea { min-height: 140px; resize: vertical; }
.textarea::placeholder, .input::placeholder { color: var(--field-placeholder); }
.textarea:focus-visible, .input:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: inset 0 0 0 1px var(--midnight-green);
}
.hint { font-size: 14px; color: var(--ink-muted); margin: var(--s2) 0 0; }

/* ── profile: chip groups ───────────────────────────────────────────── */
.group { border: 0; margin: 0 0 var(--s4); padding: 0; min-width: 0; }
.group legend { padding: 0; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.chip { position: relative; display: block; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: flex; align-items: center; min-height: 48px; height: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rule); border-radius: var(--radius);
  font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1.25;
}
/* Selected chips go White with Midnight text (11.5:1), legible at chip size. */
.chip input:checked + span { background: var(--white); color: var(--midnight-green); box-shadow: inset 0 0 0 2px var(--accent); }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.check { display: flex; gap: 12px; align-items: flex-start; margin: var(--s4) 0 0; cursor: pointer; }
.check input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--accent); }
.check span { font-size: 16px; line-height: 1.45; }

.error {
  margin: var(--s3) 0 0; padding: 12px var(--s3);
  background: var(--white); color: var(--midnight-green);
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
}
.error:empty { display: none; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ── thank-you / closed ─────────────────────────────────────────────── */
.done-logo { width: 150px; height: auto; margin: var(--s4) 0; }
.done-title { font-family: var(--font-display); font-weight: 700; font-size: 40px; line-height: 1.05; margin: 0 0 var(--s3); }
.done-title .hl { color: var(--accent); }
.done-body { font-size: 18px; line-height: 1.55; margin: 0 0 var(--s3); }

/* ── footer ─────────────────────────────────────────────────────────── */
.foot { margin-top: var(--s5); font-size: 13px; color: var(--ink-muted); }
.foot a { color: var(--ink-muted); }

@media (min-width: 600px) {
  .stacked { font-size: 44px; }
  .q-title { font-size: 32px; }
}

/* ── legal pages ────────────────────────────────────────────────────── */
.doc .doc-body { display: block; max-width: 640px; margin: 0 auto; }
.doc h2 { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin: var(--s4) 0 var(--s2); }
.doc li { margin-bottom: var(--s2); }
.draft {
  display: inline-block; margin: 0 0 var(--s3); padding: 4px 10px;
  background: var(--accent); color: var(--on-accent);
  font-family: var(--font-display); font-weight: 700; font-size: 19px;
}

/* Short phones: keep the first answer option above the fold. */
@media (max-height: 720px) {
  .stacked { font-size: 26px; }
  .intro-context { font-size: 16px; margin: var(--s2) 0; }
  .intro { margin-bottom: var(--s3); }
  .intro + .q-title { padding-top: var(--s3); font-size: 22px; }
  .q-sub { margin-bottom: var(--s3); }
}
