:root {
  --bg: #f4ecdd;
  --surface: #fff9f1;
  --surface-strong: #fffdf9;
  --surface-accent: #f7efe1;
  --ink: #23313d;
  --muted: #5d6a73;
  --line: rgba(35, 49, 61, 0.12);
  --sea: #1f5d75;
  --sea-deep: #173d52;
  --terracotta: #b45e40;
  --gold: #d2a24e;
  --olive: #5b6d37;
  --shadow: 0 18px 36px rgba(23, 38, 51, 0.09);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(210, 162, 78, 0.18), transparent 28%),
    linear-gradient(180deg, #f8f2e9 0%, #efe2d1 100%);
  min-height: 100vh;
}

a {
  color: inherit;
}

button,
.button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(248, 242, 233, 0.88);
  border-bottom: 1px solid rgba(35, 49, 61, 0.08);
}

.site-shell,
.page-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-shell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.95rem 0;
}

.page-shell {
  padding: 2rem 0 3.5rem;
}

.page-shell--narrow {
  width: min(920px, calc(100% - 2rem));
}

.brand {
  text-decoration: none;
  font-weight: 800;
  color: var(--sea-deep);
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  color: var(--sea-deep);
  font-weight: 700;
  background: rgba(31, 93, 117, 0.08);
  border: 1px solid transparent;
}

.site-nav a.is-current {
  color: #f8fbfd;
  background: linear-gradient(135deg, var(--sea), var(--sea-deep));
}

.hero-card,
.section-card {
  background: rgba(255, 249, 241, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.hero-card--landing {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  gap: 1.25rem;
  align-items: stretch;
}

.hero-side {
  padding: 1.2rem;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(23, 61, 82, 0.98), rgba(31, 93, 117, 0.94));
  color: #eff7fb;
}

.hero-side h2,
h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.hero-side ul {
  margin: 0.9rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.7rem;
  line-height: 1.55;
}

.eyebrow {
  margin: 0 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--terracotta);
}

h1 {
  font-size: clamp(2.15rem, 4vw, 3.8rem);
  line-height: 0.98;
}

.lead {
  font-size: 1.04rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 62ch;
  margin: 1rem 0 0;
}

.button-row,
.chip-row,
.jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button-row {
  margin-top: 1.2rem;
}

.activity-button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 0.78rem 1rem;
  font-weight: 800;
  cursor: pointer;
  color: #f8fbfd;
  background: linear-gradient(135deg, var(--sea), var(--sea-deep));
  box-shadow: 0 12px 24px rgba(23, 61, 82, 0.16);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.button:hover,
.button:focus-visible,
button:hover,
button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 15px 28px rgba(23, 61, 82, 0.18);
}

.button:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
  box-shadow: none;
}

.button--ghost,
.jump-button,
.option-row,
.empty-link {
  color: var(--sea-deep);
  background: rgba(31, 93, 117, 0.08);
  border: 1px solid rgba(31, 93, 117, 0.14);
  box-shadow: none;
}

.section-card {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.section-heading {
  margin-bottom: 1.1rem;
}

.section-heading p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 65ch;
}

.resource-grid,
.flow-grid,
.practice-support-grid,
.concept-grid,
.comparison-grid {
  display: grid;
  gap: 1rem;
}

.resource-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.resource-card,
.step-card,
.question-card,
.prompt-card,
.compare-panel,
.concept-card,
.empty-state {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.2rem;
}

.resource-card {
  display: block;
  height: 100%;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.resource-card:hover,
.resource-card:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 15px 28px rgba(23, 61, 82, 0.12);
}

.resource-card--accent {
  background: linear-gradient(180deg, rgba(255, 248, 236, 1), rgba(249, 239, 218, 1));
}

.resource-card p,
.step-card p,
.question-card p,
.prompt-card p,
.compare-panel p,
.concept-card p,
.empty-state p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.resource-card .button {
  margin-top: 1rem;
}

.activity-link {
  min-height: 88px;
  font-size: 1.02rem;
}

.tool-button-grid .activity-link {
  min-height: 84px;
}

.has-tool-modal-open {
  overflow: hidden;
}

.tool-launcher {
  position: relative;
}

.tool-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.tool-modal[hidden] {
  display: none;
}

.tool-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 38, 51, 0.42);
  backdrop-filter: blur(8px);
}

.tool-dialog {
  position: relative;
  width: min(920px, calc(100vw - 1.25rem));
  max-height: calc(100vh - 1.25rem);
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(255, 250, 244, 0.98);
  box-shadow: 0 24px 54px rgba(23, 38, 51, 0.18);
}

.tool-dialog-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
  padding: 1.15rem 1.15rem 1rem;
  border-bottom: 1px solid rgba(35, 49, 61, 0.1);
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.98), rgba(250, 242, 229, 0.96));
}

.tool-dialog-heading p {
  margin: 0 0 0.2rem;
}

.tool-dialog-heading h2 {
  font-size: clamp(1.35rem, 2.8vw, 2rem);
}

.tool-back-button {
  min-width: 88px;
}

.tool-dialog-body {
  max-height: calc(100vh - 8.25rem);
  overflow-y: auto;
  padding: 1rem;
}

.tool-panel[hidden] {
  display: none;
}

.tool-panel > .concept-grid,
.tool-panel > .practice-support-grid,
.tool-panel > .comparison-stack {
  margin-top: 0;
}

.tool-panel .question-list {
  margin-top: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #7a5220;
  background: rgba(210, 162, 78, 0.16);
  border: 1px solid rgba(210, 162, 78, 0.24);
}

.step-card {
  position: relative;
}

.step-number,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #7a5220;
  background: rgba(210, 162, 78, 0.16);
  border: 1px solid rgba(210, 162, 78, 0.24);
}

.flow-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.site-footer {
  border-top: 1px solid rgba(35, 49, 61, 0.08);
  background: rgba(255, 249, 241, 0.75);
}

.site-footer .site-shell {
  padding: 1rem 0 1.4rem;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
}

.vocab-widget {
  display: grid;
  gap: 1rem;
}

.challenge-layout {
  display: grid;
  grid-template-columns: minmax(250px, 290px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.challenge-main {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.mode-button {
  color: var(--sea-deep);
  background: rgba(31, 93, 117, 0.08);
  border: 1px solid rgba(31, 93, 117, 0.14);
  box-shadow: none;
}

.mode-button.is-active {
  color: #f8fbfd;
  background: linear-gradient(135deg, var(--sea), var(--sea-deep));
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(23, 61, 82, 0.16);
}

.challenge-panel,
.challenge-complete {
  padding: 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(35, 49, 61, 0.1);
  background: linear-gradient(180deg, rgba(255, 248, 236, 1), rgba(248, 239, 224, 0.98));
}

.challenge-panel {
  align-self: start;
}

.challenge-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: start;
}

.challenge-head h3,
.challenge-complete h3 {
  margin-top: 0.2rem;
  font-size: 1.35rem;
}

.challenge-head p:last-child,
.challenge-complete p:last-child {
  margin-bottom: 0;
}

.challenge-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.challenge-stat {
  padding: 0.85rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(210, 162, 78, 0.18);
  text-align: center;
}

.challenge-stat strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.35rem;
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.challenge-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
}

.olympus-panel {
  position: relative;
  margin-top: 1rem;
  min-height: 138px;
  padding: 1rem 0.9rem 0.8rem;
  border-radius: 18px;
  overflow: visible;
  background:
    radial-gradient(circle at 15% 20%, rgba(210, 162, 78, 0.32), transparent 24%),
    linear-gradient(180deg, rgba(31, 93, 117, 0.2), rgba(23, 61, 82, 0.02));
  border: 1px solid rgba(31, 93, 117, 0.12);
}

.olympus-ridge {
  position: absolute;
  inset: auto 0 0;
  height: 78px;
  background: linear-gradient(180deg, rgba(91, 109, 55, 0.9), rgba(54, 69, 30, 0.98));
  clip-path: polygon(0% 100%, 0% 78%, 12% 62%, 24% 70%, 38% 36%, 51% 54%, 62% 28%, 75% 59%, 88% 34%, 100% 68%, 100% 100%);
}

.olympus-badges {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  max-width: 420px;
}

.olympian-badge {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  aspect-ratio: 1 / 1;
  min-height: 56px;
  text-decoration: none;
}

.olympian-badge:hover,
.olympian-badge:focus-visible {
  transform: none;
  box-shadow: none;
}

.olympian-surface {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(23, 61, 82, 0.42);
  border: 1px solid rgba(248, 251, 253, 0.2);
  box-shadow: inset 0 -4px 0 rgba(15, 29, 39, 0.25);
}

.olympian-fill {
  position: absolute;
  inset: auto 0 0;
  height: var(--badge-fill, 0%);
  background: linear-gradient(180deg, var(--badge-color-start), var(--badge-color-end));
  transition: height 260ms ease;
}

.olympian-code {
  position: relative;
  z-index: 1;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: rgba(248, 251, 253, 0.72);
}

.olympian-name {
  position: absolute;
  left: 50%;
  top: calc(100% + 0.45rem);
  transform: translate(-50%, -0.1rem);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(23, 61, 82, 0.96);
  color: #f8fbfd;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  box-shadow: 0 12px 20px rgba(23, 38, 51, 0.18);
}

.olympian-name::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid rgba(23, 61, 82, 0.96);
}

.olympian-badge:hover .olympian-name,
.olympian-badge:focus-visible .olympian-name,
.olympian-badge.is-active .olympian-name {
  opacity: 1;
  transform: translate(-50%, 0);
}

.olympian-badge.is-awake {
  filter: saturate(1.02);
}

.olympian-badge.is-awake .olympian-code {
  color: #2b1e09;
  text-shadow: 0 1px 0 rgba(255, 248, 231, 0.3);
}

.olympian-badge.is-active .olympian-surface {
  outline: 2px solid rgba(248, 251, 253, 0.68);
  outline-offset: 2px;
}

.olympus-readout {
  position: relative;
  z-index: 1;
  margin: 0.85rem 0 0;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--sea-deep);
  text-align: center;
}

.study-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
}

.study-note {
  color: var(--muted);
  font-weight: 700;
  justify-self: end;
  text-align: right;
}

.quiz-card {
  border-radius: var(--radius-lg);
}

.quiz-card-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 320px;
  padding: 1.45rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(35, 49, 61, 0.12);
  color: #f8fbfd;
  text-align: center;
  background: linear-gradient(180deg, rgba(31, 93, 117, 0.96), rgba(23, 61, 82, 0.98));
  box-shadow: 0 18px 36px rgba(23, 38, 51, 0.12);
}

.quiz-term {
  max-width: 16ch;
}

.challenge-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.challenge-choice {
  width: 100%;
  min-width: 0;
  min-height: 76px;
  padding: 0.75rem 0.6rem;
  border-radius: 18px;
  border: 1px solid rgba(31, 93, 117, 0.16);
  background: rgba(255, 250, 244, 0.98);
  color: var(--sea-deep);
  box-shadow: 0 10px 20px rgba(23, 61, 82, 0.08);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  white-space: normal;
}

.challenge-choice:hover,
.challenge-choice:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(23, 61, 82, 0.12);
}

.challenge-options--term-to-definition .challenge-choice {
  font-size: 0.8rem;
  font-weight: 700;
}

.challenge-choice-note {
  margin: -0.15rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
}

.matching-widget {
  display: grid;
  gap: 1rem;
  padding: 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(35, 49, 61, 0.1);
  background: linear-gradient(180deg, rgba(255, 248, 236, 1), rgba(248, 239, 224, 0.98));
}

.matching-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
}

.matching-note {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.matching-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.matching-card {
  width: 100%;
  min-width: 0;
  min-height: 122px;
  padding: 0.85rem 0.7rem;
  border-radius: 18px;
  border: 1px solid rgba(35, 49, 61, 0.12);
  box-shadow: 0 10px 22px rgba(23, 38, 51, 0.08);
  text-align: center;
  align-items: center;
  justify-content: center;
  white-space: normal;
  line-height: 1.3;
}

.matching-card--term {
  color: #f8fbfd;
  background: linear-gradient(180deg, rgba(31, 93, 117, 0.96), rgba(23, 61, 82, 0.98));
}

.matching-card--definition {
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 250, 244, 1), rgba(247, 239, 225, 1));
}

.matching-card.is-selected {
  border-color: rgba(210, 162, 78, 0.48);
  box-shadow:
    0 0 0 2px rgba(210, 162, 78, 0.2),
    0 14px 28px rgba(210, 162, 78, 0.18);
}

.matching-card.is-correct {
  border-color: rgba(91, 140, 82, 0.82);
  box-shadow:
    0 0 0 3px rgba(91, 140, 82, 0.36),
    0 0 34px rgba(91, 140, 82, 0.44),
    inset 0 0 0 999px rgba(91, 140, 82, 0.12);
}

.matching-card.is-incorrect {
  border-color: rgba(180, 94, 64, 0.82);
  box-shadow:
    0 0 0 3px rgba(180, 94, 64, 0.34),
    0 0 32px rgba(180, 94, 64, 0.4),
    inset 0 0 0 999px rgba(180, 94, 64, 0.1);
}

.matching-text {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
}

.matching-card--term .matching-text {
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.05rem;
}

.study-card {
  width: 100%;
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  border-radius: var(--radius-lg);
  box-shadow: none;
  perspective: 1500px;
  align-items: stretch;
  justify-content: stretch;
}

.study-card:hover,
.study-card:focus-visible,
.jump-button:hover,
.jump-button:focus-visible,
.option-row:hover,
.option-row:focus-visible {
  box-shadow: none;
}

.study-card:hover,
.study-card:focus-visible {
  transform: translateY(-2px);
}

.study-card-inner {
  position: relative;
  display: block;
  width: 100%;
  min-height: 320px;
  transform-style: preserve-3d;
  transition: transform 720ms cubic-bezier(0.22, 0.8, 0.24, 1);
}

.study-card.is-flipped .study-card-inner {
  transform: rotateY(180deg);
}

.study-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.45rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(35, 49, 61, 0.12);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 18px 36px rgba(23, 38, 51, 0.12);
  overflow: hidden;
  transition: opacity 180ms ease;
}

.study-face--front {
  color: #f8fbfd;
  background: linear-gradient(180deg, rgba(31, 93, 117, 0.96), rgba(23, 61, 82, 0.98));
  transform: rotateY(0deg);
}

.study-face--front-test,
.study-face--back-test {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.study-face--back {
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 250, 244, 1), rgba(247, 239, 225, 1));
  transform: rotateY(180deg);
  align-items: center;
  justify-content: center;
  text-align: center;
}

.study-card:not(.is-flipped) .study-face--back {
  opacity: 0;
}

.study-card.is-flipped .study-face--front {
  opacity: 0;
}

.micro-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.82;
}

.study-term {
  display: block;
  margin: 0.85rem 0 0.65rem;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.05;
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-weight: 700;
  max-width: 100%;
}

.study-prompt {
  display: block;
  line-height: 1.65;
  font-size: 1.02rem;
  max-width: 32ch;
}

.study-definition {
  display: block;
  max-width: 18ch;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.35;
  font-weight: 700;
}

.study-definition--prompt {
  max-width: 16ch;
  font-size: clamp(1.75rem, 3.8vw, 2.35rem);
}

.study-term--answer {
  margin: 0;
  text-align: center;
}

.study-controls,
.support-buttons {
  display: grid;
  gap: 0.75rem;
}

.study-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

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

.study-controls .button,
.study-controls button,
.support-buttons .button,
.support-buttons button {
  width: 100%;
  min-width: 0;
}

.support-panels {
  display: grid;
  gap: 0.75rem;
}

.support-panel {
  display: none;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.support-panel.is-visible {
  display: block;
}

.support-panel h3 {
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

.support-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.challenge-complete .button-row {
  margin-top: 1rem;
}

.jump-nav {
  padding-top: 0.2rem;
  justify-content: flex-start;
  align-items: flex-start;
}

.jump-button {
  display: inline-flex;
  flex: 0 0 auto;
  max-width: 100%;
  padding: 0.55rem 0.85rem;
  font-weight: 800;
}

.jump-button.is-active {
  color: #f8fbfd;
  background: linear-gradient(135deg, var(--sea), var(--sea-deep));
}

.empty-state {
  text-align: left;
}

.empty-state code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.95em;
}

.question-list {
  display: grid;
  gap: 1rem;
}

.question-label,
.question-card legend {
  font-weight: 800;
  line-height: 1.55;
  margin-bottom: 0.8rem;
  display: block;
}

.option-list {
  display: grid;
  gap: 0.65rem;
}

.answer-select,
.response-box {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(35, 49, 61, 0.14);
  background: #fffdfa;
  color: var(--ink);
  font: inherit;
}

.answer-select {
  padding: 0.9rem 1rem;
}

.answer-select.is-correct {
  border-color: rgba(91, 140, 82, 0.42);
  background: rgba(240, 249, 238, 0.95);
}

.answer-select.is-incorrect {
  border-color: rgba(180, 94, 64, 0.38);
  background: rgba(255, 245, 241, 0.96);
}

.response-box {
  min-height: 135px;
  padding: 0.95rem 1rem;
  resize: vertical;
  line-height: 1.55;
  margin-top: 0.9rem;
}

.card-list {
  margin: 0.85rem 0 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  line-height: 1.6;
}

.option-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  cursor: pointer;
}

.option-row input {
  margin-top: 0.2rem;
  accent-color: var(--sea);
}

.question-card details,
.concept-card details,
.prompt-card details {
  margin-top: 0.9rem;
}

summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--sea-deep);
}

.feedback,
.score-banner {
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  display: none;
  font-weight: 800;
}

.feedback.is-visible,
.score-banner.is-visible {
  display: block;
}

.feedback.correct,
.score-banner.correct {
  color: #27472b;
  background: rgba(91, 140, 82, 0.16);
  border: 1px solid rgba(91, 140, 82, 0.24);
}

.feedback.incorrect,
.score-banner.incorrect {
  color: #7f342c;
  background: rgba(180, 94, 64, 0.13);
  border: 1px solid rgba(180, 94, 64, 0.2);
}

.practice-support-grid,
.concept-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 1rem;
}

.comparison-stack {
  display: grid;
  gap: 1rem;
}

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

.compare-column {
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-accent);
}

.compare-column h4 {
  margin-bottom: 0.65rem;
}

.compare-column ul {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  line-height: 1.55;
}

.concept-grid {
  margin-top: 1rem;
}

.concept-card h4 {
  margin-bottom: 0.55rem;
}

.concept-card h3 {
  margin-bottom: 0.55rem;
  font-size: 1.1rem;
}

.concept-card p {
  margin: 0;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

@media (max-width: 860px) {
  .hero-card--landing,
  .comparison-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell,
  .page-shell--narrow {
    width: min(100% - 1rem, 1120px);
  }

  .site-shell {
    padding: 0.8rem 0;
  }

  .hero-card,
  .section-card {
    padding: 1.2rem;
  }

  .study-card-inner {
    min-height: 280px;
  }

  .study-face {
    padding: 1.1rem;
  }

  .study-toolbar,
  .study-controls,
  .support-buttons,
  .mode-switch,
  .challenge-stats,
  .challenge-layout {
    grid-template-columns: 1fr;
  }

  .olympus-badges {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .challenge-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .matching-head {
    grid-template-columns: 1fr;
  }

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

  .tool-dialog {
    width: min(100vw - 0.6rem, 920px);
    max-height: calc(100vh - 0.6rem);
    border-radius: 20px;
  }

  .tool-dialog-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .tool-dialog-body {
    max-height: calc(100vh - 9.8rem);
    padding: 0.85rem;
  }

  .study-note {
    justify-self: start;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .study-card-inner,
  .button,
  button {
    transition: none;
  }
}
