@font-face {
  font-family: "Barlow Condensed";
  src: url("./fonts/barlow-condensed-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("./fonts/dm-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --paper: #f4f5ff;
  --ink: #101b4d;
  --blue: #1834b6;
  --solar: #ffbc42;
  --line: #b7bfdc;
  --muted: #45517d;
  --white: #fff;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
  --gutter: clamp(1rem, 4vw, 3rem);
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
a { color: inherit; }
button, input { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.skip-link { position: fixed; z-index: 2; inset: .5rem auto auto .5rem; padding: .75rem 1rem; background: var(--white); }
.skip-link:not(:focus) { transform: translateY(-150%); }
.shell { width: min(100%, 86rem); margin-inline: auto; padding-inline: var(--gutter); }

.masthead { min-height: 4.65rem; display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.wordmark { display: flex; align-items: center; gap: .55rem; font: 700 clamp(1.45rem, 2.8vw, 2rem)/1 var(--display); text-decoration: none; }
.wordmark img { border-radius: 4px; }
.preview-label { color: var(--muted); font-size: .88rem; text-align: right; }

.hero {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  min-height: clamp(31rem, 43vw, 42rem);
  background: var(--blue);
  color: var(--white);
}
.hero-copy { align-self: center; min-width: 0; padding: clamp(2rem, 5vw, 4.5rem); }
h1, h2 { margin: 0; font-family: var(--display); font-weight: 700; }
.hero-copy, .panel, .results { overflow-wrap: anywhere; }
.hero h1 { line-height: .9; font-size: clamp(3.65rem, 5.6vw, 6.7rem); letter-spacing: -.015em; }
.hero h1 span { display: block; }
.lede { color: var(--muted); font-size: clamp(1rem, 1.65vw, 1.22rem); line-height: 1.5; }
.hero .lede { color: var(--white); max-width: 31ch; margin: 1.45rem 0 1.55rem; }
.hero-action { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem 1rem; }
.hero-action p { margin: 0; font-size: .91rem; }
.hero-image { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: 63% 50%; }
.hero :focus-visible { outline-color: var(--white); }

.primary, .secondary { min-height: 3rem; padding: .65rem 1.12rem; border-radius: 4px; font-weight: 700; }
.primary { background: var(--solar); color: var(--ink); border: 2px solid var(--solar); }
.primary:hover:not(:disabled) { background: #ffd076; border-color: #ffd076; }
.primary:disabled { background: #dce1f2; border-color: #dce1f2; color: var(--muted); }
.secondary { background: var(--white); color: var(--blue); border: 2px solid var(--blue); }
.secondary:hover { background: var(--paper); }
.text-button { min-height: 2.75rem; padding: .35rem .12rem; border: 0; background: none; color: var(--blue); font-weight: 700; text-decoration: underline; text-underline-offset: .22em; }

.panel, .results { margin: clamp(1rem, 3vw, 2.8rem) auto 0; }
.panel { max-width: 46rem; padding: clamp(1rem, 4vw, 2.75rem); background: var(--white); border-top: .4rem solid var(--blue); }
.panel-top, .action-row, .result-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem; }
.kicker { margin: 0; color: var(--blue); font-size: .94rem; font-weight: 700; }
progress { display: block; width: 100%; height: .4rem; margin: .45rem 0 1.5rem; border: 0; background: var(--paper); color: var(--blue); }
progress::-webkit-progress-bar { background: var(--paper); }
progress::-webkit-progress-value { background: var(--blue); }
progress::-moz-progress-bar { background: var(--blue); }
fieldset { padding: 0; border: 0; margin: 0; min-width: 0; }
#question-title { font-size: clamp(2.25rem, 5.5vw, 3.4rem); line-height: .99; }
.hint { margin: .75rem 0 1.2rem; color: var(--muted); line-height: 1.45; }
.choices { display: grid; grid-template-columns: minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.option { display: flex; gap: .9rem; align-items: center; padding: .86rem .8rem; border-top: 1px solid var(--line); min-height: 3.45rem; cursor: pointer; }
.option:hover { background: var(--paper); }
.option:has(input:checked) { background: var(--paper); box-shadow: inset .24rem 0 var(--blue); }
.option input, #analytics-choice { accent-color: var(--blue); width: 1.1rem; height: 1.1rem; flex: 0 0 auto; margin: 0; }
.option-copy { display: grid; min-width: 0; gap: .14rem; }
.option-copy small { color: var(--muted); font-size: .91rem; line-height: 1.35; }
.action-row { margin-top: 1.25rem; }
.action-row .primary { margin-left: auto; }

.results { max-width: 60rem; }
.result-heading { align-items: flex-start; }
.result-heading > div { min-width: 0; }
.result-heading h1 { font-size: clamp(3rem, 7vw, 5.2rem); line-height: .96; }
.result-heading .lede { max-width: 52ch; margin: .55rem 0 .15rem; }
.criteria, .ranking { list-style: none; padding: 0; }
.criteria { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; color: var(--blue); font-size: .95rem; font-weight: 700; }
.notice { background: var(--white); border-left: .27rem solid var(--solar); padding: .8rem .9rem; line-height: 1.45; }
.ranking { margin-block: 1.25rem 0; border-top: 2px solid var(--blue); }
.course { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: 1.05rem 0; border-bottom: 1px solid var(--line); }
.rank { align-self: start; color: var(--blue); font: 700 2.4rem/1 var(--display); }
.course h2, dialog h2 { font-size: 2rem; line-height: 1; }
.course p, dialog p { color: var(--muted); line-height: 1.46; margin: .35rem 0 0; }
.course .course-meta { font-weight: 700; color: var(--blue); }
.restart { margin-top: .3rem; }

dialog { width: min(30rem, calc(100% - 2rem)); border: 0; border-top: .4rem solid var(--blue); padding: 1.5rem; color: var(--ink); overflow-wrap: anywhere; }
dialog .primary { margin-top: 1rem; }
dialog::backdrop { background: rgb(16 27 77 / 65%); }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; padding-block: 1.35rem; color: var(--muted); font-size: .9rem; }
.footer p { margin: 0; }
.footer details { max-width: 23rem; }
.footer label { display: flex; align-items: flex-start; gap: .45rem; margin: .65rem 0 .35rem; }

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr 1fr; min-height: 28rem; }
  .hero-copy { padding: 1.7rem; }
  .hero h1 { font-size: clamp(3rem, 6.2vw, 5rem); }
  .hero-action { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 600px) {
  .masthead { min-height: 3.8rem; }
  .wordmark img { width: 32px; height: 32px; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero-copy { padding: 1.65rem min(1.25rem, 5vw); }
  .panel, dialog { padding-inline: min(5vw, 1.25rem); }
  .hero h1 { font-size: clamp(2.7rem, 12.3vw, 5rem); }
  .hero .lede { margin: .9rem 0 1.15rem; }
  .hero-action { flex-direction: row; align-items: center; }
  .hero-action p { font-size: .82rem; }
  .hero-image { height: auto; max-height: 19rem; aspect-ratio: 1.45; object-position: 59% 55%; }
  .course { grid-template-columns: 1.65rem minmax(0, 1fr); gap: .6rem; }
  .rank { font-size: 2rem; }
  .course button { grid-column: 2; justify-self: start; max-width: 100%; }
  .footer { display: grid; }
}
