:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #5f6878;
  --line: #dce3ec;
  --surface: #ffffff;
  --page: #f4f7fb;
  --accent: #235ea8;
  --accent-soft: #eef5ff;
  --correct: #177245;
  --correct-soft: #eaf8f0;
  --wrong: #b42318;
  --wrong-soft: #fff0ee;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

.page-shell {
  width: min(950px, calc(100% - 32px));
  margin-inline: auto;
  padding-block: 40px 64px;
}

.reading-card,
.quiz-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.reading-card header,
.passage,
.quiz-card {
  padding-inline: clamp(20px, 5vw, 56px);
}

.reading-card header {
  padding-top: 42px;
  padding-bottom: 26px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  max-width: 760px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  letter-spacing: -0.025em;
}

.hero-image {
  display: block;
  width: 100%;
  height: auto;
  border-block: 1px solid var(--line);
}

.passage {
  padding-top: 28px;
  padding-bottom: 34px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 2.1vw, 1.18rem);
}

.passage p {
  margin: 0 0 1.05em;
}

.passage p:last-child {
  margin-bottom: 0;
}

.quiz-card {
  margin-top: 28px;
  padding-top: 38px;
  padding-bottom: 42px;
}

.quiz-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
}

.score {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 8px 14px;
  font-size: 0.92rem;
  font-weight: 750;
}

.question {
  min-width: 0;
  margin: 0;
  padding: 30px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.question legend {
  display: block;
  width: 100%;
  padding: 0;
  font-size: 1.08rem;
  font-weight: 680;
  line-height: 1.5;
}

.question-number {
  display: inline-grid;
  width: 30px;
  height: 30px;
  margin-right: 8px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.9rem;
}

.prompt {
  margin: 14px 0 12px;
  color: var(--muted);
  font-weight: 650;
}

.answers {
  display: grid;
  gap: 9px;
}

.answers label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.answers label:hover {
  border-color: #9dbbe2;
  background: #f8fbff;
}

.answers label:has(input:focus-visible) {
  outline: 3px solid rgba(35, 94, 168, 0.25);
  outline-offset: 2px;
}

.answers input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.answers strong {
  display: inline-block;
  min-width: 1.4em;
  color: var(--accent);
}

.question.is-correct .answers label:has(input:checked) {
  border-color: var(--correct);
  background: var(--correct-soft);
}

.question.is-wrong .answers label:has(input:checked) {
  border-color: var(--wrong);
  background: var(--wrong-soft);
}

.feedback {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 1.6em;
  margin: 12px 0 0;
  font-weight: 780;
}

.is-correct .feedback {
  color: var(--correct);
}

.is-wrong .feedback {
  color: var(--wrong);
}

.feedback-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  line-height: 1;
}

.feedback-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.is-correct .feedback-icon {
  background: var(--correct);
}

.is-wrong .feedback-icon {
  background: var(--wrong);
}

.reset-button {
  margin-top: 28px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  font: inherit;
  font-weight: 720;
  cursor: pointer;
}

.reset-button:hover {
  background: #293650;
}

.reset-button:focus-visible {
  outline: 3px solid rgba(35, 94, 168, 0.3);
  outline-offset: 3px;
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 20px, 950px);
    padding-block: 18px 36px;
  }

  .reading-card,
  .quiz-card {
    border-radius: 14px;
  }

  .quiz-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .question {
    padding-block: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

a {color:var(--accent);text-underline-offset:4px}
:focus-visible {outline:3px solid #235ea8;outline-offset:4px}
.site-header {padding:16px 24px;background:white;border-bottom:1px solid var(--line);font-weight:750}
.site-header a {text-decoration:none;color:var(--ink)}
.page-nav {display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:0 0 22px}
.bottom-nav {margin:28px 0 0}
.hero-image {height:220px;object-fit:contain;padding:16px;background:#f8fbff}
.passage {font-family:inherit;font-size:1.22rem;line-height:1.85}
.vocabulary {padding:0 clamp(20px,5vw,56px) 32px}
.vocabulary h2 {font-size:1.2rem;margin-bottom:8px}
.vocab-grid {display:flex;gap:10px;flex-wrap:wrap}
.vocab-grid details {border:1px solid var(--line);border-radius:10px;padding:8px 12px;background:#f8fbff}
summary {cursor:pointer;color:var(--accent);font-weight:650}
.vocab-grid img {display:block;max-width:180px;width:100%;height:150px;object-fit:contain;margin-top:12px}
.question {margin-top:26px;padding-top:0}
.answers {margin-top:16px}
.picture-answers {grid-template-columns:1fr 1fr}
.picture-answers label {align-items:center;border-width:4px}
.question.is-correct .picture-answers label:has(input:checked),
.question.is-wrong .picture-answers label:has(input:checked) {
  background:var(--surface);
}
.picture-answers span {min-width:0;flex:1}
.picture-answers img {width:100%;height:180px;object-fit:contain;display:block;background:white;border-radius:6px}
.answer-letter {display:block;margin-bottom:8px}
.quiz-help {color:var(--muted)}
.completion {font-weight:700;color:var(--correct)}
body.index-page {background:#f9f9f9;font-family:Arial,sans-serif}
.index-shell {max-width:840px;margin:40px auto 0;padding:20px;background:white;box-shadow:0 2px 8px #0000001a;border-radius:10px}
.index-shell h1 {font-size:32px;text-align:center;max-width:none;letter-spacing:normal;margin:10px 0 20px}
.instructions {font-size:18px;color:#555;text-align:center;margin:0 0 30px}
.contents {list-style:none;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:15px}
.contents a {display:block;height:100%;padding:15px 20px;background:#eee;color:#333;text-decoration:none;border-radius:8px;font-size:18px;line-height:1.5}
.contents a:hover {background:#d6d6d6;color:#000}
.index-number {display:inline-block;color:#626262;font-size:14px;margin-right:10px;font-variant-numeric:tabular-nums}
#index-ad {margin:40px auto 0;text-align:center;max-width:100%}
.resdevad {width:320px;height:50px}
.index-page {padding-bottom:40px}
@media(min-width:500px){.resdevad{width:468px;height:60px}}
@media(min-width:800px){.resdevad{width:728px;height:90px}}
@media(max-width:880px){.index-shell{margin:24px 16px 0}}
@media(max-width:480px){.contents{grid-template-columns:1fr}.picture-answers label{padding:8px;gap:6px}.picture-answers img{height:125px}.passage{font-size:1.1rem}.hero-image{height:180px}}

/* V2: full-width context artwork; preserve the legacy header box model. */
.reading-card .hero-image {width:100%;height:auto;aspect-ratio:3 / 1;object-fit:cover;padding:0;display:block;}
#head1, #head1 * {box-sizing:content-box;}
