:root {
  color-scheme: light;
  --ink: #283334;
  --blue: #1746ae;
  --blue-deep: #122e72;
  --coral: #ec8c79;
  --coral-deep: #b95146;
  --teal: #087d79;
  --gold: #efb64f;
  --cream: #fff6e8;
  --paper: #fffdf7;
  --line: #d9c7ad;
  --shadow: 0 14px 34px rgba(37, 42, 50, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 8% 6%, #fbe5d3, transparent 25rem), var(--cream);
  font: 17px/1.55 "Trebuchet MS", "Segoe UI", sans-serif;
}
h1, h2, h3, p, figure { margin-top: 0; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.035em; }
h1 { font-size: clamp(2.6rem, 6vw, 5.8rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 3rem); }
h3 { font-size: 1.28rem; }
a { color: var(--blue-deep); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 4px solid #a54f17;
  outline-offset: 4px;
}
button { font: inherit; }
.skip { position: absolute; top: -6rem; left: .6rem; z-index: 20; padding: .7rem; background: white; }
.skip:focus { top: .6rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: .7rem max(1.25rem, calc((100vw - 1280px)/2));
  background: #fffdf9;
  border-bottom: 4px solid var(--teal);
}
.brand { display: flex; align-items: center; gap: .8rem; color: var(--blue-deep); text-decoration: none; font-size: 1.45rem; font-weight: 900; line-height: 1; white-space: nowrap; }
.brand img { width: 66px; height: 66px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--gold); }
.brand small { display: block; margin-top: .32rem; color: #724434; font-size: .7rem; letter-spacing: .03em; }
.main-nav { display: flex; flex-wrap: wrap; gap: .35rem; }
.main-nav a { padding: .64rem .9rem; border-radius: 999px; text-decoration: none; font-weight: 900; }
.main-nav a:hover { background: #dff4ee; }
.draft { padding: .5rem 1rem; background: #fff2b9; border-bottom: 2px solid #bd7d22; color: #4e330a; text-align: center; font-size: .79rem; font-weight: 900; letter-spacing: .035em; }
.page-shell { max-width: 1280px; margin: auto; padding: 1.4rem 1.3rem 5rem; }
.breadcrumbs { margin: 0 0 1.2rem; font-size: .86rem; font-weight: 700; }
.breadcrumbs a { text-underline-offset: 3px; }
.eyebrow { margin-bottom: .7rem; color: #8b3d32; font-size: .78rem; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.lead { max-width: 54ch; font-size: clamp(1.05rem, 1.5vw, 1.26rem); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.55rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: .7rem 1.1rem;
  border: 2px solid var(--blue-deep);
  border-radius: 14px;
  background: var(--blue);
  color: white;
  box-shadow: 4px 4px 0 var(--blue-deep);
  text-align: center;
  text-decoration: none;
  font-weight: 900;
  transition: transform .2s ease, box-shadow .2s ease;
}
.button:hover { transform: translateY(-3px); box-shadow: 4px 7px 0 var(--blue-deep); }
.button.secondary { background: #fffdf7; color: var(--blue-deep); }
.button.ghost { background: transparent; color: var(--blue-deep); box-shadow: none; }
.text-link { font-weight: 900; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* The curtain and paper shapes are layout decoration; character art comes from project assets. */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  align-items: center;
  gap: 3rem;
  min-height: 480px;
  padding: clamp(1.5rem, 4vw, 3.6rem);
  overflow: hidden;
  border: 3px solid #914c43;
  border-radius: 36px;
  background: radial-gradient(circle at 65% 42%, #ffedba, transparent 35%), linear-gradient(145deg, #fbd1bf 0%, #fff0d4 55%, #d5f3e8 100%);
  box-shadow: var(--shadow);
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  top: -2rem;
  bottom: -2rem;
  width: 7.5%;
  background: repeating-linear-gradient(90deg, #e28276 0 24%, #f4ab96 24% 52%, #d8776d 52% 75%);
  border-right: 4px solid #b96155;
  opacity: .82;
  transform: rotate(5deg);
  pointer-events: none;
}
.hero::before { left: -4.6%; }
.hero::after { right: -4.6%; transform: rotate(-5deg); border-right: 0; border-left: 4px solid #b96155; }
.hero > * { position: relative; z-index: 1; }
.hero--text-only { grid-template-columns: minmax(0, 1fr); }
.hero h1 { max-width: 13ch; margin-bottom: 1.1rem; color: var(--blue-deep); text-wrap: balance; }
.hero--text-only h1 { max-width: 16ch; }
.hero-copy { padding: .8rem 0; }
.scene { margin: 0; overflow: hidden; border: 3px solid #6d4637; border-radius: 24px; background: white; box-shadow: 7px 8px 0 rgba(96, 58, 35, .16); }
.scene img { display: block; width: 100%; height: 100%; max-height: 380px; object-fit: cover; }
.hero .scene { transform: rotate(2deg); }
.hero .scene img { aspect-ratio: 1.23; object-fit: cover; }
.song-hero .scene img { max-height: 350px; }
.route-intro {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  margin: 1.7rem 0 3rem;
}
.route-intro > div {
  position: relative;
  padding: 1.3rem 1.3rem 1rem 5.2rem;
  border: 2px solid #c99868;
  border-radius: 20px;
  background: var(--paper);
}
.route-intro span { position: absolute; top: 1.2rem; left: 1rem; display: grid; place-items: center; width: 3.3rem; height: 3.3rem; border-radius: 50%; background: var(--gold); color: #513013; font-weight: 900; }
.route-intro strong { display: block; color: var(--blue-deep); font-size: 1.08rem; }
.route-intro p { margin: .22rem 0 0; font-size: .88rem; }
.catalog { padding-top: .6rem; }
.section-heading { margin-bottom: 1.3rem; }
.section-heading h2 { color: var(--blue-deep); }
.song-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.35rem; }
.song-card {
  overflow: hidden;
  border: 2px solid #864a37;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 5px 6px 0 #dcc1a1;
  transition: transform .2s ease, box-shadow .2s ease;
}
.song-card:hover { transform: translateY(-4px); box-shadow: 5px 10px 0 #dcc1a1; }
.song-card .scene { border: 0; border-bottom: 2px solid #864a37; border-radius: 0; box-shadow: none; }
.song-card .scene img { height: 240px; object-fit: cover; }
.song-card-body, .song-card.pending { padding: 1.4rem; }
.song-card h2 { margin-bottom: .65rem; font-size: 1.55rem; }
.song-card.pending { background: #f4e9d9; border-style: dashed; box-shadow: none; }

.simple-hero, .activity-heading {
  position: relative;
  overflow: hidden;
  padding: 2.15rem 2.45rem;
  border: 3px solid var(--blue-deep);
  border-radius: 28px;
  background: linear-gradient(115deg, #e4f4ee, #fff3d5);
  box-shadow: 6px 7px 0 #b7d1c9;
}
.simple-hero::after, .activity-heading::after { content: ""; position: absolute; right: -5rem; bottom: -7rem; width: 19rem; height: 19rem; border: 3px solid #6a9b84; border-radius: 45% 60% 45% 55%; opacity: .25; pointer-events: none; }
.simple-hero h1, .activity-heading h1 { position: relative; max-width: 18ch; color: var(--blue-deep); }
.simple-hero .lead { position: relative; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.3rem; margin-top: 1.5rem; }
.choice {
  padding: 1.65rem;
  border: 2px solid var(--teal);
  border-radius: 23px;
  background: #fffefa;
  box-shadow: 5px 6px 0 #a9d0c7;
}
.choice:nth-child(2n) { border-color: #b65f4f; background: #fff7ee; box-shadow: 5px 6px 0 #efc1aa; }
.choice-num { display: inline-grid; place-items: center; min-width: 64px; height: 64px; padding: .3rem; margin-bottom: 1rem; border: 2px solid var(--blue-deep); border-radius: 20px; background: #dfeafd; color: var(--blue-deep); font-size: 1.2rem; font-weight: 900; }
.choice .button { margin: .3rem .5rem .3rem 0; }
.context-switch { display: flex; flex-wrap: wrap; gap: 1.2rem; margin: 2rem 0; }
.context-switch > div { display: flex; flex-wrap: wrap; align-items: center; gap: .36rem; }
.context-switch span { margin-right: .3rem; font-weight: 900; }
.context-switch a { display: inline-block; padding: .5rem .85rem; border: 2px solid var(--blue-deep); border-radius: 999px; background: white; text-decoration: none; font-size: .84rem; font-weight: 900; }
.context-switch a[aria-current] { background: var(--blue-deep); color: white; }
.song-section { margin-top: 2.6rem; scroll-margin-top: 2rem; }
.song-section-heading {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: .7rem 1.2rem .7rem .7rem;
  border: 2px solid #914c43;
  border-radius: 23px;
  background: #ffe5d5;
}
.song-section:nth-of-type(2n) .song-section-heading { background: #dff2e9; border-color: var(--teal); }
.song-section-heading .scene { flex: none; width: 170px; height: 104px; border: 0; border-radius: 16px; box-shadow: none; }
.song-section-heading .scene img { height: 100%; }
.song-section-heading h2 { margin: 0 .2rem .35rem 0; font-size: clamp(1.5rem, 2.5vw, 2.25rem); }
.activity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.activity-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  border: 2px solid #cfaa7e;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 4px 5px 0 #e6d3ba;
}
.activity-card h3 { color: var(--blue-deep); }
.activity-card p:not(.eyebrow) { font-size: .9rem; }
.card-icon, .heading-icon { display: inline-grid; place-items: center; flex: none; width: 54px; height: 54px; border: 2px solid #944637; border-radius: 17px; background: #ffdab6; color: #7a372e; font-size: 1.55rem; font-weight: 900; }

.activity-heading h1 { max-width: 25ch; margin-bottom: 0; font-size: clamp(2.1rem, 4vw, 4rem); }
.heading-icon { width: 60px; height: 60px; vertical-align: middle; }
.activity-stamp { position: absolute; top: .9rem; right: 1.2rem; width: 105px; height: 105px; object-fit: contain; opacity: .13; mix-blend-mode: multiply; pointer-events: none; }
.activity-heading > *:not(.activity-stamp) { position: relative; z-index: 1; }
.activity-heading + .scene { margin: 1.25rem 0; }
.activity-heading + .scene img { max-height: 340px; object-position: center 42%; }
.pdf-pending { display: inline-flex; align-items: center; padding: .7rem 1rem; border: 2px dashed #874835; border-radius: 13px; background: #fffdf8; color: #67402c; font-size: .88rem; font-weight: 900; }
.lesson-summary { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; margin: 1.4rem 0; padding: 1.25rem; border: 2px solid #d2ac75; border-radius: 18px; background: #fff6dc; }
.lesson-summary p { margin: 0; font-weight: 700; }
.lesson-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 1.15rem; }
.lesson-panel, .care, .vocabulary { padding: 1.5rem; border: 2px solid #c7b291; border-radius: 21px; background: var(--paper); }
.lesson-panel h2, .vocabulary h2 { color: var(--blue-deep); font-size: 1.65rem; }
.lesson-panel h3 { margin: 1.2rem 0 .4rem; font-size: 1.05rem; }
.lesson-panel li { margin: .48rem 0; }
.step-toolbar { margin-top: 1rem; }
.progress { margin-bottom: .7rem; color: #286b50; font-size: .85rem; font-weight: 900; }
.progress, .reset-steps, .support-toggle { display: none; }
.js .progress { display: block; }
.js .reset-steps, .js .support-toggle { display: inline-block; }
.step-list { counter-reset: lesson; padding: 0; list-style: none; }
.step-list li { position: relative; margin: .8rem 0; padding: .8rem .85rem .8rem 3.5rem; border: 2px solid #d4bd9b; border-radius: 15px; background: #fffaf0; }
.step-list li::before { counter-increment: lesson; content: counter(lesson); position: absolute; top: .7rem; left: .65rem; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--gold); color: #4e3013; font-weight: 900; }
.step-list label { display: flex; align-items: start; gap: .6rem; cursor: pointer; }
.step-list input { flex: none; width: 21px; height: 21px; margin-top: .15rem; accent-color: #2c7d52; }
.step-list input:checked + span { color: #426b4d; text-decoration: line-through; }
.reset-steps, .support-toggle { padding: .52rem .8rem; border: 2px solid var(--blue-deep); border-radius: 11px; background: white; color: var(--blue-deep); cursor: pointer; font-size: .82rem; font-weight: 900; }
.reset-steps:hover, .support-toggle:hover { background: #e3f2ed; }
.support { margin-top: 2rem; }
.support-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.support-heading h2 { margin-bottom: .8rem; color: var(--blue-deep); }
.support-toggle { margin-bottom: .8rem; }
.extras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.extras details { padding: 1.1rem; border: 2px solid #ab7862; border-radius: 16px; background: #fffaf3; }
.extras details:nth-child(2n) { border-color: var(--teal); background: #f0faf3; }
.extras summary { cursor: pointer; color: #6f3830; font-weight: 900; }
.extras li { margin: .5rem 0; font-size: .9rem; }
.vocabulary, .care { margin-top: 1.4rem; }
.vocabulary { border-color: var(--teal); background: #f0faf6; }
.term-grid { display: flex; flex-wrap: wrap; gap: .7rem; }
.term { display: flex; flex-direction: column; align-items: start; min-width: 155px; padding: .75rem .9rem; border: 2px solid var(--blue-deep); border-radius: 14px; background: white; color: var(--blue-deep); cursor: pointer; box-shadow: 3px 3px 0 #c1d8d0; }
.term span { font-size: 1.12rem; font-weight: 900; }
.term small { display: none; font-size: .78rem; }
.js .term small { display: block; }
.term[aria-pressed="true"] { border-color: #397451; background: #d7f1d8; color: #254e33; }
.term:disabled { opacity: 1; cursor: default; }
.care { background: #fff5e9; }
.care h2 { color: #7a3929; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; padding: 1rem max(1.25rem, calc((100vw - 1280px)/2)); border-top: 4px solid var(--teal); background: #fffdf9; font-size: .82rem; font-weight: 700; }
.footer-mark { flex: none; width: 48px; height: 48px; object-fit: contain; mix-blend-mode: multiply; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .song-grid, .activity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lesson-grid { grid-template-columns: 1fr; }
  .extras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route-intro > div { padding-left: 1.25rem; }
  .route-intro span { position: static; margin-bottom: .5rem; }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  .site-header { align-items: start; flex-direction: column; gap: .35rem; }
  .brand img { width: 52px; height: 52px; }
  .main-nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .main-nav a { white-space: nowrap; }
  .page-shell { padding: 1rem 1rem 3rem; }
  .hero { grid-template-columns: 1fr; min-height: 0; padding: 1.5rem; border-radius: 23px; }
  .hero h1 { font-size: clamp(2.3rem, 10vw, 4.2rem); }
  .hero .scene { transform: none; }
  .route-intro, .song-grid, .choice-grid, .activity-grid, .lesson-summary, .extras { grid-template-columns: 1fr; }
  .route-intro { margin-bottom: 2rem; }
  .simple-hero, .activity-heading { padding: 1.4rem; border-radius: 20px; }
  .song-section-heading .scene { width: 110px; height: 85px; }
  .activity-stamp { width: 74px; height: 74px; opacity: .1; }
  .support-heading { align-items: start; flex-direction: column; }
  .site-footer { flex-direction: column; align-items: start; }
}
@media (max-width: 440px) {
  .actions .button { width: 100%; }
  .song-section-heading { align-items: start; flex-direction: column; }
  .song-section-heading .scene { width: 100%; height: 150px; }
  .activity-card { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .song-card { transition: none; }
  .button:hover, .song-card:hover { transform: none; }
}
@media print {
  @page { size: A4; margin: 15mm; }
  body { background: white; color: #111; font: 11pt/1.4 Arial, sans-serif; }
  .site-header { padding: 0 0 3mm; border-bottom: 1pt solid #111; }
  .site-header .brand { color: #111; font-size: 12pt; }
  .site-header .brand img { width: 16mm; height: 16mm; }
  .main-nav, .site-footer, .breadcrumbs, .actions, .context-switch, .scene,
  .pdf-pending, .progress, .step-list input, .reset-steps, .support-toggle { display: none !important; }
  .draft { margin: 2mm 0 5mm; padding: 1.5mm; border: 1pt solid #111; background: white; color: #111; font-size: 9pt; }
  .page-shell { max-width: none; padding: 0; }
  .activity-heading, .lesson-summary, .lesson-panel, .extras details, .care, .vocabulary {
    padding: 0; border: 0; border-radius: 0; box-shadow: none; background: white; break-inside: avoid;
  }
  .activity-heading h1 { color: #111; font-size: 20pt; }
  .activity-stamp { top: 0; right: 0; width: 28mm; height: 28mm; opacity: .12; }
  .lesson-grid, .lesson-summary, .extras { display: block; }
  .lesson-panel, .extras details { margin: 5mm 0; }
  .extras details > * { display: block !important; }
  .term-grid { display: flex; gap: 2mm; }
  .term, .term[aria-pressed="true"] { min-width: 0; padding: 0; border: 0; background: white; box-shadow: none; color: #111; }
  .term span { font-size: 11pt; }
  .term small, .js .term small { display: none; }
  .step-list li { padding: 0 0 0 8mm; border: 0; background: white; }
  .step-list li::before { top: 0; left: 0; width: 6mm; height: 6mm; border: 1pt solid #111; background: white; color: #111; }
  .step-list input:checked + span { color: #111; text-decoration: none; }
}
