:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #242132;
  background: #f7f6fa;
  --muted: #625e73;
  --border: #dedbe7;
  --accent: #55418d;
  --accent-dark: #433071;
  --selected: #f3effa;
  --page-gutter: clamp(.75rem, 4vw, 2rem);
  --panel-padding: clamp(1.25rem, 5vw, 3rem);
  --content-padding: calc(var(--panel-padding) + 1px);
  --quiz-width: 60rem;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header, .site-footer { padding-inline: var(--page-gutter); }

.site-header {
  background: white;
  border-bottom: 1px solid var(--border);
}

.header-content, .footer-content {
  max-width: var(--quiz-width);
  padding-inline: var(--content-padding);
  margin: 0 auto;
}

.header-content {
  padding-block: 1.25rem;
  font-size: .9375rem;
  font-weight: 650;
}

.footer-content {
  padding-bottom: 1.25rem;
  font-size: .875rem;
}

main {
  flex: 1;
  padding: clamp(2rem, 9vh, 6rem) var(--page-gutter) 2rem;
}

.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: var(--panel-padding);
  margin: 0 auto;
  box-shadow: 0 12px 40px rgb(46 35 71 / 5%);
}

.completion { max-width: 37rem; }
.quiz, .quiz-instructions { max-width: var(--quiz-width); }

h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -.035em;
  font-weight: 680;
}

.quiz h1 {
  margin-top: 1.75rem;
  text-align: center;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

h1:focus { outline: none; }

p {
  line-height: 1.55;
  color: var(--muted);
  margin: .875rem 0 0;
}

.quiz-instructions {
  margin: 0 auto 1.125rem;
  padding-inline: var(--content-padding);
}

button {
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.primary, .secondary {
  border: 1px solid transparent;
  border-radius: .625rem;
  padding: .6875rem 1rem;
  min-height: 2.875rem;
  font-weight: 620;
}

.primary { color: white; background: var(--accent); }
.primary:hover { background: var(--accent-dark); }
.primary:disabled { opacity: .7; cursor: wait; }

.secondary { background: white; border-color: var(--border); }
.secondary:hover { background: #f7f6fa; }

.progress-label {
  font-size: .875rem;
  color: var(--muted);
  font-weight: 620;
}

progress {
  display: block;
  width: 100%;
  height: .375rem;
  margin-top: .625rem;
  appearance: none;
  border: 0;
  border-radius: 1rem;
  background: #edeaf2;
  color: var(--accent);
}

progress::-webkit-progress-bar { border-radius: 1rem; background: #edeaf2; }
progress::-webkit-progress-value { border-radius: 1rem; background: var(--accent); }
progress::-moz-progress-bar { border-radius: 1rem; background: var(--accent); }

.statement-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: clamp(.375rem, 2vw, 1.5rem);
  margin-top: 1rem;
}

.side {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 2;
}

.connector {
  grid-row: 1;
  grid-column: 2;
  align-self: center;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 650;
  text-transform: uppercase;
}

.statement {
  min-height: 8rem;
  padding: clamp(.625rem, 2.25vw, 1.5rem);
  border-radius: .875rem;
  border: 1px solid #c9c4d5;
  background: white;
  font-size: clamp(1rem, 2.2vw, 1.1875rem);
  line-height: 1.45;
  text-align: left;
  overflow-wrap: anywhere;
}

.statement:hover, .strength:hover {
  background: #f7f6fa;
}

.statement[aria-pressed="true"], .strength[aria-pressed="true"] {
  background: var(--selected);
  border-color: var(--accent);
}

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
  margin-top: .625rem;
}

.options:focus { outline: none; }

.strength {
  border: 1px solid var(--border);
  border-radius: .625rem;
  background: white;
  padding: .625rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  text-align: left;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.35;
  min-height: 2.875rem;
}

.strength span {
  flex: none;
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--accent);
  border-radius: .125rem;
  display: grid;
  place-items: center;
}

.strength[aria-pressed="true"] span { background: var(--accent); }
.strength[aria-pressed="true"] span::after {
  content: "";
  width: .3rem;
  height: .54rem;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}

.keyboard-hint {
  margin-top: 1.125rem;
  text-align: center;
  font-size: .875rem;
}

kbd { font: inherit; font-weight: 650; }

.panel-actions {
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
  padding-top: 1rem;
}

.finish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.5rem;
}

#download-error { color: #952f42; }

@media (max-width: 42rem) {
  .options { grid-template-columns: 1fr; }
  .connector { font-size: .75rem; }
  .statement { min-height: 6rem; }
}
