:root {
  color-scheme: only light;
  --bg-top: #dcebe6;
  --bg-bottom: #f5efe2;
  --panel: rgba(255, 252, 247, 0.9);
  --ink: #203039;
  --muted: #667681;
  --line: #d3d9d4;
  --accent: #1b7b6c;
  --accent-deep: #0f4e45;
  --accent-soft: #d8efe9;
  --warm: #d77b38;
  --warm-soft: #ffe4cf;
  --good: #157547;
  --bad: #a12d2a;
  --shadow: 0 22px 44px rgba(49, 61, 66, 0.14);
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(27, 123, 108, 0.2), transparent 28%),
    radial-gradient(circle at top right, rgba(215, 123, 56, 0.16), transparent 24%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom) 48%, #efe5d6 100%);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Archivo Black", "Arial Black", sans-serif;
  letter-spacing: 0.02em;
}

p,
ol {
  margin: 0;
}

button,
select {
  font: inherit;
}

button,
select {
  border-radius: 18px;
}

button {
  border: 0;
  cursor: pointer;
  font-weight: 700;
  padding: 12px 18px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

button:hover,
button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 18px rgba(38, 58, 58, 0.15);
}

button:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(27, 123, 108, 0.26);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.hero,
.layout {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(290px, 0.62fr);
  gap: 22px;
  padding: 34px 0 20px;
}

.hero-copy,
.score-panel,
.panel {
  background: var(--panel);
  border: 1px solid rgba(211, 217, 212, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  border-radius: 30px;
}

.hero-copy {
  padding: 34px;
  position: relative;
  overflow: hidden;
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: -52px;
  bottom: -52px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(215, 123, 56, 0.18), transparent 70%);
}

.eyebrow,
.section-tag,
.tile-label,
.complete-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-deep);
}

.eyebrow,
.section-tag {
  margin-bottom: 10px;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: 0.95;
  max-width: 8ch;
}

.lede {
  margin-top: 18px;
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.05rem;
}

.hero-media {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.hero-media-card {
  margin: 0;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(211, 217, 212, 0.94);
  text-align: center;
}

.hero-media-card img {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: contain;
}

.hero-media-card figcaption {
  margin-top: 10px;
  color: #55646f;
  font-size: 0.9rem;
  font-weight: 700;
}

.keyword-row {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.keyword-pill,
.pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(211, 217, 212, 0.94);
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent-deep);
  font-weight: 700;
}

.pill.on {
  color: var(--good);
  border-color: rgba(21, 117, 71, 0.28);
  background: #e3f6eb;
}

.score-panel {
  padding: 24px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.score-card {
  border-radius: 24px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(211, 217, 212, 0.94);
}

.big-score {
  margin-top: 8px;
  font-size: clamp(1.5rem, 3.6vw, 2.4rem);
  font-family: "Archivo Black", "Arial Black", sans-serif;
}

.complete-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  padding-bottom: 40px;
}

.panel {
  padding: 24px;
  min-width: 0;
}

.download-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 24px 28px 40px;
  margin-top: -6px;
}

.download-copy {
  min-width: 0;
}

.download-copy p:last-child {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.65;
}

.panel-heading p:last-child {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.65;
}

.options-box,
.task-row,
.gap-card {
  margin-top: 20px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(211, 217, 212, 0.94);
}

.options-title {
  font-weight: 700;
  color: var(--accent-deep);
  margin-bottom: 12px;
}

.sentence-bank {
  padding-left: 20px;
  display: grid;
  gap: 8px;
  line-height: 1.55;
}

.task-grid,
.gap-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.task-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

#task1Rows {
  display: contents;
}

.gap-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}

.task-row h3,
.gap-card h3 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.task1-choices {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.task1-choice {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 18px;
  background: #fffaf4;
  border: 1px solid var(--line);
  line-height: 1.55;
}

.task1-choice input {
  margin: 3px 0 0;
}

.task1-choice span {
  min-width: 0;
}

.task-intro-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, #f2fbf8 0%, #fffaf4 100%);
  border: 1px solid rgba(27, 123, 108, 0.18);
}

.task-intro-card h3 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.task-intro-card p {
  color: var(--muted);
  line-height: 1.65;
}

.task-intro-graphic {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  min-height: 126px;
  flex: 1;
}

.device {
  min-width: 110px;
  padding: 16px 12px;
  border-radius: 20px;
  text-align: center;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 12px 18px rgba(38, 58, 58, 0.12);
}

.device-storage {
  background: linear-gradient(135deg, #d77b38, #b2551a);
}

.device-memory {
  background: linear-gradient(135deg, #1b7b6c, #0f4e45);
}

.device-processor {
  background: linear-gradient(135deg, #4a6bb3, #2c4376);
}

.flow-arrow {
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: 1.5rem;
  color: var(--accent-deep);
}

.task-row p,
.gap-card p {
  line-height: 1.65;
}

select {
  min-width: 0;
  max-width: 100%;
  margin: 6px 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fffaf4;
  color: var(--ink);
}

.task-row.correct,
.gap-card.correct {
  border-color: rgba(21, 117, 71, 0.28);
  background: #ecf9f1;
}

.task-row.incorrect,
.gap-card.incorrect {
  border-color: rgba(161, 45, 42, 0.24);
  background: #fff1f0;
}

.support-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.support-card {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: #55646f;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid rgba(122, 136, 147, 0.22);
  text-align: center;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
}

.ghost {
  background: var(--warm-soft);
  color: #8d4d22;
  border: 1px solid rgba(215, 123, 56, 0.18);
}

.download-btn {
  background: linear-gradient(135deg, var(--warm), #b2551a);
  color: #fff;
  font-size: 1.05rem;
  padding: 16px 26px;
  min-width: 220px;
  box-shadow: 0 16px 26px rgba(141, 77, 34, 0.24);
}

.feedback {
  min-height: 1.5em;
  margin-top: 14px;
  font-weight: 700;
}

.feedback.good {
  color: var(--good);
}

.feedback.bad {
  color: var(--bad);
}

@media (max-width: 960px) {
  .hero,
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-media {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-grid,
  .gap-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .download-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .download-btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .hero,
  .layout {
    width: min(100vw - 20px, 1180px);
  }

  .hero-copy,
  .score-panel,
  .panel {
    border-radius: 22px;
    padding: 18px;
  }

  .support-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  select {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}
