:root {
  color: #17211c;
  background: #f2f0e8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, a { font: inherit; }
a { color: #315d4f; }
button:focus-visible, a:focus-visible { outline: 3px solid #d77136; outline-offset: 3px; }
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 20; background: #fff; color: #17211c; padding: .75rem 1rem; }
.skip-link:focus { top: 1rem; }
.shell { width: min(1080px, calc(100% - 2rem)); margin: 0 auto; padding: 1.25rem 0 4rem; }
.local-badge { width: fit-content; margin: 0 0 1rem; padding: .45rem .8rem; border: 1px solid #9c6a32; border-radius: 999px; color: #67441f; background: #fff6df; font-size: .82rem; }
.hero, .course-header { padding: clamp(2rem, 8vw, 6rem); border-radius: 2rem; color: #f8f5ea; background: #173f34; box-shadow: 0 24px 60px rgba(31, 52, 42, .18); }
.hero.compact { max-width: 780px; margin: 6vh auto 0; }
.eyebrow { margin: 0 0 1rem; color: #e9b96e; font-size: .78rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { max-width: 850px; margin: 0; font-family: Georgia, serif; font-size: clamp(2.35rem, 7vw, 5.7rem); font-weight: 500; line-height: .98; letter-spacing: -.035em; }
.lede { max-width: 720px; margin: 1.5rem 0 1rem; font-size: clamp(1.05rem, 2vw, 1.35rem); line-height: 1.6; }
.hero > p:not(.eyebrow, .lede) { max-width: 680px; line-height: 1.65; }
.primary, .lesson-card { border: 0; cursor: pointer; }
.primary { margin-top: 1.2rem; padding: .95rem 1.25rem; border-radius: .8rem; color: #16251f; background: #f2b75f; font-weight: 800; }
.primary:hover { background: #ffd183; }
.primary:disabled { cursor: wait; opacity: .7; }
.preview, .lesson-list { padding: 3rem 0; }
.preview h2, .lesson-list h2, .lesson-content h2 { font-family: Georgia, serif; font-size: clamp(1.65rem, 3vw, 2.35rem); font-weight: 500; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.card-grid article { min-height: 210px; padding: 1.5rem; border: 1px solid #d5d0c2; border-radius: 1.2rem; background: rgba(255,255,255,.62); }
.card-grid span, .lesson-card span { color: #97612d; font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.card-grid h3 { margin: 2.8rem 0 .7rem; font-family: Georgia, serif; font-size: 1.5rem; }
.card-grid p { line-height: 1.55; }
.status { min-height: 60vh; display: grid; place-content: center; justify-items: center; }
.spinner { width: 2rem; height: 2rem; border: 3px solid #cfc8b9; border-top-color: #173f34; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.course-header h1 { font-size: clamp(2.2rem, 6vw, 4.8rem); }
.course-header > p:not(.eyebrow) { max-width: 760px; font-size: 1.08rem; line-height: 1.65; }
.expires { color: #f2b75f; font-weight: 700; }
.progress-summary { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.25rem; }
.progress-summary span { padding: .45rem .75rem; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; font-size: .9rem; }
.course-actions, .material-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: 880px; margin: 1rem auto 0; }
.lesson-list { max-width: 880px; margin: 0 auto; }
.material-grid { display: grid; gap: .8rem; }
.lesson-card { display: grid; width: 100%; gap: .6rem; padding: 1.4rem; text-align: left; border: 1px solid #cbc5b7; border-radius: 1rem; color: #17211c; background: #fffdf7; }
.lesson-card:hover { border-color: #7d927f; transform: translateY(-1px); }
.lesson-card strong { font-family: Georgia, serif; font-size: 1.5rem; }
.lesson-card small { color: #4d6359; }
.text-button, .back { padding: .8rem 0; border: 0; color: #315d4f; background: transparent; text-decoration: underline; cursor: pointer; }
.hero .text-button { margin-left: 1rem; color: #fff; }
.back { margin: 1rem 0 1.5rem; }
.lesson-content { max-width: 780px; margin: 0 auto; padding: clamp(1.5rem, 5vw, 4rem); border-radius: 1.5rem; background: #fffdf7; box-shadow: 0 18px 50px rgba(31, 52, 42, .1); }
.lesson-content h1 { font-size: clamp(2.2rem, 6vw, 4.2rem); }
.lesson-content p, .lesson-content li, .lesson-content dd { line-height: 1.7; }
.lesson-content section { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #ded8ca; }
.callout, .memory-strip { padding: 1rem 1.2rem; border-radius: .8rem; background: #e8f0eb; }
.quiz button { display: block; width: 100%; margin: .65rem 0; padding: .85rem; text-align: left; border: 1px solid #b9b3a6; border-radius: .65rem; background: #fff; cursor: pointer; }
.quiz [data-feedback] { color: #255243; font-weight: 700; }
.quiz button[aria-pressed="true"] { border-color: #315d4f; background: #e8f0eb; }
.prompt-sample { padding: 1rem 1.2rem; border-left: 4px solid #d77136; background: #f4eee1; }
.related-list { display: grid; gap: .65rem; }
.related-link { width: 100%; padding: .85rem 1rem; border: 1px solid #b9b3a6; border-radius: .65rem; color: #244f41; background: #fff; text-align: left; text-decoration: underline; cursor: pointer; }
.check-list { display: grid; gap: .75rem; padding-left: 1.25rem; }
.term-list dd { margin: .35rem 0 1.15rem; }
.course-finish { max-width: 880px; margin: 2rem auto 0; padding: clamp(1.5rem, 4vw, 2.5rem); border-radius: 1.5rem; background: #e5ded0; }
.course-finish h2 { margin-top: 0; font-family: Georgia, serif; font-size: clamp(1.65rem, 3vw, 2.35rem); font-weight: 500; }
.link-button { display: inline-block; color: #16251f; text-decoration: none; }

@media (max-width: 720px) {
  .shell { width: min(100% - 1rem, 1080px); padding-top: .5rem; }
  .hero, .course-header { padding: 2rem 1.25rem; border-radius: 1.2rem; }
  .card-grid { grid-template-columns: 1fr; }
  .card-grid article { min-height: auto; }
  .card-grid h3 { margin-top: 1.2rem; }
  .hero .text-button { display: block; margin: .7rem 0 0; }
  .lesson-content { padding: 1.25rem; }
  .course-actions, .material-actions { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
