:root {
  --paper: #f6f2e8;
  --ink: #17212b;
  --muted: #667079;
  --line: rgba(23, 33, 43, 0.18);
  --yellow: #ffe36e;
  --coral: #ff775e;
  --blue: #77a8ff;
  --mint: #b9e8cf;
  --white: #fffdf7;
  --shadow: 5px 5px 0 var(--ink);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: 'Space Grotesk', 'Avenir Next', sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--coral); outline-offset: 4px; }

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 11px;
  line-height: .92;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.brand strong { font-size: 12px; letter-spacing: .04em; }
.brand-mark { font-size: 34px; line-height: 1; transform: rotate(-18deg); }
.topbar-note, .mini-note, .footer, .question-id, .share-status { color: var(--muted); font: 11px 'DM Mono', monospace; }

.hero {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  padding: 55px 8% 65px 0;
  overflow: hidden;
}

.hero-copy { max-width: 760px; position: relative; z-index: 2; }
.eyebrow, .section-label {
  margin: 0 0 22px;
  font: 500 11px 'DM Mono', monospace;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: 8px; }
.eyebrow-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: var(--coral); }

h1, h2, p { margin-top: 0; }
h1 {
  max-width: 780px;
  margin-bottom: 26px;
  font-size: clamp(48px, 8vw, 92px);
  line-height: .94;
  letter-spacing: -.065em;
  font-weight: 700;
}
h1 em { color: var(--coral); font-style: normal; }
.hero-lede { max-width: 550px; margin-bottom: 34px; color: #46525c; font-size: 18px; line-height: 1.55; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
.hero-aside { max-width: 240px; color: var(--muted); font-size: 12px; line-height: 1.35; }

.button {
  min-height: 48px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.button:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--ink); }
.button:active { transform: translate(0, 0); box-shadow: none; }
.button-primary { color: var(--ink); background: var(--yellow); }
.button-dark { color: var(--white); background: var(--ink); }
.button-outline { color: var(--ink); background: transparent; }

.hero-sticker {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 190px;
  height: 190px;
  border: 2px solid var(--ink);
  border-radius: 48% 52% 47% 53%;
  box-shadow: var(--shadow);
  font: 16px/1.05 'DM Mono', monospace;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(9deg);
}
.sticker-yellow { top: 90px; right: 9%; background: var(--yellow); }
.sticker-coral { right: 22%; bottom: 50px; width: 115px; height: 115px; background: var(--coral); transform: rotate(-12deg); }
.hero-doodle { position: absolute; right: 4%; top: 44%; font-size: 100px; font-weight: 300; transform: rotate(24deg); }

.how-it-works, .lexicon-preview { padding: 55px 0 80px; border-top: 1px solid var(--line); }
.section-label { color: var(--muted); }
.protocol-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.protocol-grid article { min-height: 190px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 253, 247, .35); }
.protocol-number { display: block; margin-bottom: 34px; color: var(--coral); font: 12px 'DM Mono', monospace; }
.protocol-grid h2 { margin-bottom: 10px; font-size: 21px; letter-spacing: -.035em; }
.protocol-grid p { max-width: 260px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.word-cloud { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; max-width: 850px; }
.word-cloud span { padding: 12px 15px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--white); font-size: 14px; transform: rotate(var(--rotation, 0deg)); }
.word-cloud span:nth-child(2n) { background: var(--yellow); transform: rotate(1.4deg); }
.word-cloud span:nth-child(3n) { background: var(--mint); transform: rotate(-1.8deg); }
.word-cloud span:nth-child(5n) { background: var(--blue); transform: rotate(1.8deg); }

.quiz-screen, .result-screen { padding: 44px 0 100px; }
.quiz-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.quiz-header h2, .result-screen h2 { margin-bottom: 0; font-size: clamp(38px, 6vw, 70px); line-height: .95; letter-spacing: -.065em; }
.score-board { display: flex; gap: 22px; text-align: right; }
.score-board div { min-width: 85px; }
.score-board span, .final-score span, .result-stats span { display: block; color: var(--muted); font: 10px 'DM Mono', monospace; text-transform: uppercase; letter-spacing: .06em; }
.score-board strong { display: block; margin-top: 5px; font-size: 28px; letter-spacing: -.06em; }
.progress-wrap { margin: 44px 0 22px; }
.progress-meta { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--muted); font: 11px 'DM Mono', monospace; }
.progress-track { height: 8px; overflow: hidden; border: 1px solid var(--ink); border-radius: 99px; background: rgba(255,255,255,.4); }
.progress-bar { width: 0; height: 100%; background: var(--coral); transition: width .35s ease; }

.question-card { min-height: 440px; padding: clamp(24px, 5vw, 58px); border: 2px solid var(--ink); border-radius: 25px 19px 24px 18px; background: var(--white); box-shadow: var(--shadow); }
.question-card.shake { animation: shake .34s ease; }
.question-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 52px; }
.category-pill { padding: 7px 10px; border-radius: 99px; background: var(--mint); font: 11px 'DM Mono', monospace; text-transform: uppercase; }
.sentence { max-width: 830px; min-height: 150px; font-size: clamp(28px, 4.5vw, 58px); line-height: 1.08; letter-spacing: -.055em; font-weight: 600; }
.blank { display: inline-block; min-width: 105px; margin: 0 4px; padding: 0 9px 3px; border: 0; border-bottom: 4px solid var(--coral); color: var(--coral); background: transparent; cursor: pointer; font: inherit; font-weight: inherit; line-height: 1; }
.blank.active { color: var(--ink); background: var(--yellow); }
.blank.filled { color: var(--ink); border-bottom-color: var(--ink); cursor: default; }
.blank:disabled { color: var(--muted); cursor: not-allowed; opacity: .68; }
.blank.filled:disabled { color: var(--ink); opacity: 1; }
.answer-zone { margin-top: 38px; }
.answer-hint { margin-bottom: 15px; color: var(--muted); font-size: 13px; }
.options { display: flex; flex-wrap: wrap; gap: 10px; }
.option { display: inline-flex; align-items: center; gap: 9px; min-height: 45px; padding: 10px 15px; border: 1.5px solid var(--ink); border-radius: 10px; color: var(--ink); background: var(--paper); cursor: pointer; font-size: 14px; font-weight: 600; transition: background .14s ease, transform .14s ease; }
.option:hover:not(:disabled) { background: var(--yellow); transform: rotate(-1deg); }
.option:disabled { cursor: default; opacity: .5; }
.option-key { display: grid; place-items: center; width: 19px; height: 19px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--white); font: 10px 'DM Mono', monospace; }
.option.option-wrong { border-style: dashed; border-color: var(--muted); color: var(--muted); text-decoration: line-through; opacity: .45; }
.feedback { min-height: 24px; margin-top: 16px; color: var(--coral); font-size: 13px; font-weight: 600; animation: feedback-in .22s ease; }
.feedback.success { color: #19734d; }
.combo-hot { color: var(--coral); }
.score-board div { position: relative; }
.score-pop { position: absolute; right: 0; top: -26px; color: #19734d; font: 700 14px 'DM Mono', monospace; pointer-events: none; animation: score-pop .8s ease forwards; }
.question-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); }
.quiz-footnote { display: flex; justify-content: space-between; gap: 20px; margin-top: 20px; color: var(--muted); font: 11px 'DM Mono', monospace; }

.result-screen { position: relative; max-width: 900px; min-height: 650px; }
.result-stamp { position: absolute; top: 45px; right: 5%; padding: 13px 16px; border: 2px solid var(--ink); color: var(--coral); font: 700 14px/1.05 'DM Mono', monospace; letter-spacing: .08em; transform: rotate(11deg); }
.result-lede { max-width: 550px; margin: 24px 0 42px; color: #46525c; font-size: 18px; line-height: 1.5; }
.result-panel { display: grid; grid-template-columns: 1fr 1.4fr; gap: 35px; padding: 28px; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--yellow); box-shadow: var(--shadow); }
.final-score { display: flex; flex-direction: column; justify-content: center; }
.final-score strong { font-size: clamp(72px, 10vw, 130px); line-height: .9; letter-spacing: -.09em; }
.final-score small { font: 12px 'DM Mono', monospace; }
.result-stats { display: grid; gap: 0; }
.result-stats div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 17px 0; border-bottom: 1px solid rgba(23,33,43,.25); }
.result-stats div:last-child { border-bottom: 0; }
.result-stats strong { text-align: right; font-size: 18px; }
.result-quote { margin: 30px 0; padding-left: 20px; border-left: 3px solid var(--coral); font-size: 20px; line-height: 1.35; }
.result-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.share-status { min-height: 16px; margin: 16px 0 0; }

.footer { display: flex; justify-content: space-between; gap: 20px; padding: 26px 0 35px; border-top: 1px solid var(--line); }
.is-hidden { display: none !important; }

@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-7px) rotate(-.4deg); } 75% { transform: translateX(7px) rotate(.4deg); } }
@keyframes feedback-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes score-pop { 0% { opacity: 0; transform: translateY(6px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-22px); } }

@media (max-width: 760px) {
  .page-shell { width: min(100% - 28px, 600px); }
  .topbar { padding: 18px 0; }
  .hero { min-height: 540px; padding: 40px 0 150px; align-items: flex-start; }
  .keyboard-hint, .option-key { display: none; }
  .hero-sticker { opacity: .92; }
  .sticker-yellow { top: auto; right: 22px; bottom: 30px; width: 130px; height: 130px; }
  .sticker-coral { right: auto; left: 8px; bottom: 55px; width: 90px; height: 90px; }
  .hero-doodle { display: none; }
  .protocol-grid, .result-panel { grid-template-columns: 1fr; }
  .protocol-grid { gap: 12px; }
  .protocol-grid article { min-height: auto; }
  .protocol-number { margin-bottom: 18px; }
  .quiz-header { align-items: flex-start; flex-direction: column; }
  .score-board { width: 100%; justify-content: flex-start; text-align: left; }
  .score-board div { min-width: 100px; }
  .question-card { min-height: 530px; }
  .question-meta { margin-bottom: 35px; }
  .sentence { min-height: 190px; }
  .question-footer, .quiz-footnote, .footer { align-items: flex-start; flex-direction: column; }
  .question-footer .button { width: 100%; }
  .result-stamp { top: 22px; right: 0; font-size: 11px; }
  .result-screen h2 { padding-top: 55px; }
}

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