*, *::before, *::after { box-sizing: border-box; }

:root {
  --ink: #111;
  --muted: #6b6b6b;
  --line: #e4e4e4;
  --bar: #cfcfcf;
  --bg: #fff;
  --good: #111;
  --font: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}

html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }

#app { max-width: 760px; margin: 0 auto; padding: 32px 20px 64px; }

.screen { display: none; }
.screen.active { display: block; animation: in .25s ease; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1 { font-size: clamp(48px, 11vw, 112px); font-weight: 500; letter-spacing: -0.04em; line-height: .95; margin: 18vh 0 24px; }
.lead { font-size: 20px; line-height: 1.4; margin: 0 0 32px; }
.muted { color: var(--muted); }
.small { font-size: 13px; letter-spacing: .02em; }

.btn {
  font: inherit; font-size: 16px; color: var(--ink); background: transparent;
  border: 1px solid var(--ink); border-radius: 999px; padding: 12px 28px; cursor: pointer;
  transition: background .15s, color .15s;
}
.btn:hover, .btn:focus-visible { background: var(--ink); color: var(--bg); outline: none; }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover, .btn.primary:focus-visible { background: #333; }
.btn:disabled { cursor: default; }
kbd { font: inherit; font-size: 11px; opacity: .45; margin-left: 6px; }

/* quiz */
.bar { display: flex; justify-content: space-between; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.progress { height: 2px; background: var(--line); margin: 10px 0 24px; }
#progress-fill { height: 100%; width: 0; background: var(--ink); transition: width .3s ease; }

.media {
  min-height: 240px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); margin-bottom: 24px; overflow: hidden;
}
.media img, .media video { display: block; max-width: 100%; max-height: 60vh; object-fit: contain; }
.media blockquote {
  margin: 0; padding: 32px; font-size: 20px; line-height: 1.55; white-space: pre-line;
  font-family: Georgia, "Times New Roman", serif;
}
.placeholder {
  width: 100%; min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: var(--muted); font-size: 14px; text-align: center; padding: 24px;
  background: repeating-linear-gradient(45deg, #fafafa 0 10px, #f2f2f2 10px 20px);
}
.placeholder code { color: var(--ink); }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { padding: 18px; font-size: 18px; }
.choice.picked { background: var(--ink); color: var(--bg); }
.choice.dim { opacity: .3; }

.feedback { margin-top: 24px; }
.verdict { font-size: 22px; margin: 0 0 8px; }
.note { margin: 0 0 8px; line-height: 1.45; }
.feedback .btn { margin-top: 16px; }

/* result */
.score { font-size: clamp(80px, 20vw, 160px); font-weight: 500; letter-spacing: -0.05em; line-height: 1; margin: 4px 0 16px; }
.score .of { color: var(--muted); font-size: .4em; letter-spacing: -0.02em; }

.chart-wrap { position: relative; margin: 32px 0 40px; }
.chart-wrap figcaption { margin-bottom: 8px; }
#chart svg { width: 100%; height: auto; display: block; overflow: visible; }
#chart .axis-label { font-size: 12px; fill: var(--muted); }
#chart .lbl { font-size: 12px; fill: var(--ink); }
#chart .hit { fill: transparent; cursor: default; }
.tooltip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--bg);
  font-size: 12px; padding: 6px 9px; border-radius: 4px; white-space: nowrap; transform: translate(-50%, -100%);
}

.answers { list-style: none; padding: 0; margin: 0 0 32px; border-top: 1px solid var(--line); }
.answers li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.answers .ok { font-weight: 600; }
.answers .no { color: var(--muted); }

@media (max-width: 520px) {
  h1 { margin-top: 12vh; }
  .media blockquote { font-size: 17px; padding: 20px; }
}
