:root {
  --ink: #171717;
  --ink-soft: #3d3b39;
  --paper: #f4f0e8;
  --paper-bright: #fffdf7;
  --paper-deep: #e8e1d5;
  --blue: #3157ff;
  --blue-dark: #1737c8;
  --red: #ff4b3e;
  --red-dark: #c92820;
  --green: #087f5b;
  --line: #c8c0b3;
  --shadow: 6px 6px 0 var(--ink);
  --radius: 6px;
  --page: 72rem;
  --logo-mark-size: 4.25rem;
  --font-display: "Bricolage Grotesque", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  background: var(--ink);
  color: var(--ink);
  font-family: var(--font-body);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, transparent 23px, rgba(23, 23, 23, 0.035) 24px, transparent 25px),
    linear-gradient(transparent 23px, rgba(23, 23, 23, 0.035) 24px, transparent 25px),
    var(--paper);
  background-size: 24px 24px;
  font-size: 1rem;
  line-height: 1.55;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--blue-dark);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--red-dark);
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  color: white;
  background: var(--blue-dark);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  color: white;
  background: var(--ink);
  border-bottom: 5px solid var(--blue);
}

.site-header__inner {
  width: min(calc(100% - 2rem), var(--page));
  min-height: 6rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
}

.brand-copy {
  display: grid;
  align-content: center;
  color: var(--paper-bright);
  line-height: 0.76;
  letter-spacing: -0.055em;
}

.brand-copy small,
.brand-copy strong {
  display: block;
}

.brand-copy small {
  margin: 0 0 0.28rem 0.08rem;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  line-height: 1;
}

.brand-copy strong {
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  line-height: 0.78;
}

.brand-mark {
  width: var(--logo-mark-size);
  height: var(--logo-mark-size);
  flex: 0 0 var(--logo-mark-size);
  display: block;
}

.site-header__aside {
  margin: 0;
  color: #c7c7c7;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

#app {
  min-height: 34rem;
}

.page-shell {
  width: min(calc(100% - 2rem), 56rem);
  margin: 0 auto;
  padding: clamp(2.25rem, 6vw, 5rem) 0;
  animation: arrive 380ms ease-out both;
}

.page-shell--wide {
  width: min(calc(100% - 2rem), var(--page));
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--red-dark);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

h1 {
  margin: 0;
  font-size: clamp(2.35rem, 7vw, 5.75rem);
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.35rem);
}

.home-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.38fr);
  align-items: center;
  gap: clamp(2rem, 7vw, 6rem);
}

.home-copy h1 em {
  color: var(--blue);
  font-style: normal;
}

.home-lede {
  max-width: 52rem;
  margin: 1.5rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(1.02rem, 2vw, 1.18rem);
}

.challenge-claim {
  width: fit-content;
  max-width: 100%;
  margin: 1.5rem 0 0;
  padding: 0.6rem 0.8rem;
  color: white;
  background: var(--blue-dark);
  font-weight: 600;
  transform: rotate(-0.7deg);
}

.home-actions,
.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.button {
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.05rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.button:hover:not(:disabled) {
  color: inherit;
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--ink);
}

.button:active:not(:disabled) {
  transform: translate(0, 0);
  box-shadow: none;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.button--primary {
  color: white;
  background: var(--blue);
}

.button--primary:hover:not(:disabled) {
  color: white;
  background: var(--blue-dark);
}

.button--quiet {
  color: var(--ink);
  background: var(--paper-bright);
}

.challenge-note {
  position: relative;
  padding: 1.5rem;
  color: white;
  background: var(--red);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
}

.challenge-note__number {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(5rem, 14vw, 8rem);
  font-weight: 800;
  line-height: 0.74;
  letter-spacing: -0.08em;
}

.challenge-note > strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.challenge-note hr {
  margin: 1.35rem 0;
  border: 0;
  border-top: 2px solid rgba(255, 255, 255, 0.65);
}

.challenge-note dl {
  margin: 0;
}

.challenge-note dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.38rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

.challenge-note dt {
  font-size: 0.78rem;
  text-transform: uppercase;
}

.challenge-note dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.progress-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 0.8rem;
}

.progress-heading p {
  margin-top: 0;
}

.progress-label {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.question-stat {
  margin-bottom: 0.12rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.progress-track {
  height: 0.55rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
  background: var(--paper-deep);
  border: 2px solid var(--ink);
}

.progress-track span {
  height: 100%;
  display: block;
  background: var(--red);
  transition: width 240ms ease;
}

.question-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.question-card {
  position: relative;
  min-height: 9rem;
  display: grid;
  align-items: center;
  padding: clamp(1.25rem, 4vw, 2.25rem) clamp(1.25rem, 5vw, 3rem) clamp(1.25rem, 4vw, 2.25rem) clamp(4.5rem, 10vw, 7rem);
  background: var(--paper-bright);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.question-number {
  position: absolute;
  inset: 0 auto 0 0;
  width: clamp(3.4rem, 8vw, 5.25rem);
  display: grid;
  place-items: center;
  color: white;
  background: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 4vw, 2.3rem);
  font-weight: 800;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.question-title {
  max-width: none;
  font-size: clamp(1.45rem, 4vw, 2.55rem);
}

.question-title--long {
  font-size: clamp(1.22rem, 3vw, 1.85rem);
  line-height: 1.1;
}

.invisible-ink {
  color: var(--paper-bright) !important;
  text-shadow: none;
}

.invisible-ink::selection,
.invisible-ink *::selection {
  color: white;
  background: var(--blue);
}

.answers-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.answer-choice {
  position: relative;
  min-height: 3.8rem;
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  align-items: center;
  gap: 0.9rem;
  padding: 0.65rem 0.9rem;
  background: var(--paper-bright);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.answer-choice:hover {
  transform: translateX(3px);
  box-shadow: -4px 0 0 var(--red);
}

.answer-choice.is-selected {
  color: white;
  background: var(--blue-dark);
  box-shadow: -4px 0 0 var(--red);
}

.answer-choice:has(input:focus-visible) {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.answer-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.answer-choice__letter {
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  background: var(--paper-deep);
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
}

.answer-choice.is-selected .answer-choice__letter {
  background: var(--red);
}

.answer-choice__text {
  font-weight: 600;
}

.form-status {
  min-height: 1.5rem;
  margin: 0.65rem 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.quiz-actions,
.review-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.results-shell {
  display: grid;
  grid-template-columns: minmax(17rem, 0.65fr) minmax(0, 1fr);
  gap: clamp(2rem, 7vw, 6rem);
  align-items: center;
}

.results-intro h1 {
  font-size: clamp(2.35rem, 6vw, 5rem);
}

.results-intro > p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-weight: 600;
}

.score-lockup {
  display: flex;
  align-items: end;
  gap: 0.7rem;
  font-family: var(--font-display);
  line-height: 0.82;
}

.score-lockup strong {
  color: var(--blue);
  font-size: clamp(6.5rem, 18vw, 11rem);
  letter-spacing: -0.1em;
}

.score-lockup span {
  padding-bottom: 1rem;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
}

.result-details {
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--paper-bright);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 2px solid var(--ink);
  border-left: 2px solid var(--ink);
}

.result-grid div {
  min-height: 6.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.85rem;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.result-grid dt {
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-grid dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1;
}

.benchmark-note {
  margin: 1rem 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.review-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.review-heading h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.review-card {
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background: var(--paper-bright);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.review-card h2 {
  margin-top: 0;
}

.answer-verdict {
  width: fit-content;
  padding: 0.35rem 0.55rem;
  color: white;
  font-weight: 700;
}

.answer-verdict.is-correct {
  background: var(--green);
}

.answer-verdict.is-wrong {
  background: var(--red-dark);
}

.review-choices {
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.review-choice {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.review-choice.is-correct {
  color: var(--green);
  font-weight: 700;
}

.review-choice.is-wrong {
  color: var(--red-dark);
  font-weight: 700;
}

.review-choice small {
  font-weight: 700;
}

.review-choice__mark {
  font-size: 1.2rem;
  font-weight: 800;
}

.explanation {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 3px solid var(--ink);
}

.explanation h3 {
  margin: 0 0 1rem;
  font-size: 1.3rem;
}

.explanation ul {
  padding-left: 1.25rem;
}

.explanation iframe {
  width: 100%;
  max-width: 35rem;
  aspect-ratio: 16 / 9;
  border: 0;
}

.review-nav {
  margin-top: 1.35rem;
}

.review-nav span {
  font-weight: 700;
}

.prose-shell {
  max-width: 49rem;
}

.prose-shell h1,
.contact-shell h1,
.empty-shell h1 {
  font-size: clamp(2.6rem, 7vw, 5rem);
}

.prose-lede {
  margin: 1.25rem 0 2.5rem;
  font-size: 1.18rem;
}

.prose-shell h2 {
  margin: 2rem 0 0.5rem;
  font-size: 1.5rem;
}

.policy-date {
  margin-top: 2.5rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.contact-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 3rem;
}

.contact-shell p:not(.eyebrow),
.empty-shell p {
  max-width: 48rem;
  font-size: 1.1rem;
}

.empty-shell {
  min-height: 30rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.empty-shell .button {
  margin-top: 1rem;
}

.site-footer {
  color: #ededed;
  background: var(--ink);
  border-top: 5px solid var(--red);
}

.site-footer__inner {
  width: min(calc(100% - 2rem), var(--page));
  margin: 0 auto;
  padding: 2.2rem 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #4a4a4a;
}

.footer-links span {
  color: var(--red);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer a {
  color: white;
}

.site-footer a:hover {
  color: #aab8ff;
}

.footer-meta {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 2rem;
  padding-top: 1.5rem;
  color: #bcbcbc;
  font-size: 0.78rem;
}

.footer-meta p {
  max-width: 43rem;
  margin: 0;
}

.footer-meta nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem 1rem;
  white-space: nowrap;
}

.noscript {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: 28rem;
  padding: 1rem;
  color: white;
  background: var(--red-dark);
  border: 2px solid var(--ink);
}

.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;
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 48rem) {
  :root {
    --logo-mark-size: 3.25rem;
  }

  .site-header__inner {
    min-height: 5rem;
  }

  .site-header__aside {
    display: none;
  }

  .brand-copy strong {
    font-size: 1.18rem;
  }

  .brand-copy small {
    margin-bottom: 0.22rem;
    font-size: 0.52rem;
  }

  .home-shell,
  .results-shell,
  .contact-shell {
    grid-template-columns: 1fr;
  }

  .challenge-note {
    width: min(100%, 24rem);
    transform: none;
  }

  .progress-heading,
  .review-heading,
  .footer-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
  }

  .question-stat {
    margin-bottom: 0;
  }

  .footer-meta nav {
    justify-content: flex-start;
  }

  .contact-shell .button {
    justify-self: start;
  }
}

@media (max-width: 34rem) {
  .page-shell {
    width: min(calc(100% - 1.25rem), 56rem);
    padding: 2rem 0 2.5rem;
  }

  .site-header__inner,
  .site-footer__inner {
    width: calc(100% - 1.25rem);
  }

  .question-card {
    min-height: 8.5rem;
    padding-left: 3.9rem;
    box-shadow: 4px 4px 0 var(--ink);
  }

  .question-number {
    width: 3rem;
  }

  .answer-choice {
    grid-template-columns: 2.15rem 1fr;
    padding-inline: 0.65rem;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .quiz-actions,
  .review-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .quiz-actions .button,
  .review-nav .button {
    width: 100%;
  }

  .review-nav span {
    order: -1;
    text-align: center;
  }

  .review-choice {
    grid-template-columns: 1.5rem 1fr;
  }

  .review-choice small {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
