:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --ink: #141414;
  --muted: #6b665d;
  --line: #d8d2c7;
  --accent: #0f766e;
  --accent-soft: #d8f1ec;
  --bad: #b42318;
  --bad-soft: #fde5df;
  --good: #137333;
  --good-soft: #e0f3e6;
  --panel: #ffffff;
  --shadow: 0 18px 55px rgba(24, 22, 18, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--ink);
}

button,
textarea {
  font: inherit;
}

.progress-shell {
  position: fixed;
  inset: 0 0 auto;
  height: 6px;
  background: rgba(20, 20, 20, 0.08);
  z-index: 5;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 280ms ease;
}

.site-header {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 4;
}

.site-header a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
  text-decoration: none;
}

.site-header a:hover {
  color: var(--accent);
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 72px 20px 36px;
}

.screen {
  width: min(860px, 100%);
  animation: rise 220ms ease both;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 5.4rem);
  font-weight: 400;
  line-height: 0.97;
  letter-spacing: 0;
  max-width: 13ch;
}

.lead {
  margin: 24px 0 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.45;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 30px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.96rem;
  font-weight: 400;
}

.pill + .pill::before {
  content: "/";
  margin: 0 10px;
  color: #b7aea1;
}

.start-button,
.share-button,
.next-button {
  margin-top: 38px;
  border: 0;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  min-height: 48px;
  padding: 0 18px;
  font-weight: 500;
  cursor: pointer;
}

.key-cue {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 400;
}

.start-button:focus-visible,
.share-button:focus-visible,
.next-button:focus-visible,
.option:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.35);
  outline-offset: 3px;
}

.question-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 34px;
}

.section-label {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 400;
}

.score {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 400;
}

.quiz-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.prompt {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.term {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  color: var(--accent);
}

.options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 38px;
}

.option {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: start;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.option:hover {
  border-color: #a8a094;
  transform: translateY(-1px);
}

.option[disabled] {
  cursor: default;
  transform: none;
}

.option.is-correct {
  border-color: rgba(19, 115, 51, 0.5);
  background: var(--good-soft);
}

.option.is-wrong {
  border-color: rgba(180, 35, 24, 0.45);
  background: var(--bad-soft);
}

.key {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 500;
}

.option-text {
  min-width: 0;
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.35;
}

.feedback {
  min-height: 64px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.4;
}

.feedback strong {
  color: var(--ink);
  font-weight: 500;
}

.example {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.continue {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  font-weight: 500;
}

.next-button {
  margin-top: 18px;
  min-width: 112px;
}

.saved-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 380px);
  gap: 36px;
  align-items: start;
}

.share-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
}

.share-box label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

textarea {
  width: 100%;
  min-height: 178px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  line-height: 1.35;
}

.misses {
  margin-top: 28px;
  color: var(--muted);
}

.misses h2 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
}

.misses ul {
  margin: 0;
  padding-left: 20px;
}

.misses li {
  margin: 8px 0;
}

.miss-picked {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.92rem;
}

.error {
  max-width: 58ch;
  color: var(--bad);
  line-height: 1.5;
}

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

@media (max-width: 720px) {
  .site-header {
    top: 18px;
    right: 18px;
  }

  .app {
    place-items: start center;
    padding-top: 72px;
  }

  .question-top,
  .result-layout {
    display: block;
  }

  .score,
  .quiz-stats {
    margin-top: 8px;
  }

  .quiz-stats {
    justify-content: flex-start;
  }

  .option {
    grid-template-columns: 36px 1fr;
    gap: 10px;
    padding: 13px;
  }

  .key {
    width: 28px;
    height: 28px;
  }

  .start-button,
  .next-button,
  .share-button {
    width: 100%;
  }

  .share-box {
    margin-top: 30px;
  }
}
