/* A bounded slide stage with controls that stay outside the slide. */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { display: block; min-height: 0; background: #dce5ef; }
#player {
  position: fixed;
  inset: clamp(.35rem,1.3vw,1.15rem);
  margin: auto;
  max-width: 90rem;
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  border: 1px solid #aebed0;
  border-radius: 1rem;
  background: #eff5fc;
  box-shadow: 0 15px 44px #082b6824;
}
.wmo-header { border-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.wmo-header__items { min-height: 4.1rem; padding: .35rem clamp(.8rem,2vw,1.6rem); }
.wmo-brand { width: clamp(8.9rem,18vw,11.3rem); }
.wmo-progress { width: 2.6rem; height: 2.6rem; }
.wmo-progress__text { font-size: .73rem; }
.wmo-band { width: min(12vw,11rem); }
.wmo-position { font-size: .88rem; }
.wmo-menu { max-height: none; padding: .45rem .65rem; }
.wmo-menu a { min-height: 2rem; padding: .35rem .5rem; font-size: .875rem; line-height: 1.26; }
.wmo-menu strong { margin: .6rem .5rem .3rem; }
/* Keep slide layers below the header and its dropdown. */
main { position: relative; min-height: 0; overflow: clip; isolation: isolate; }
.slide-fit {
  position: absolute;
  left: 50%;
  top: 7px;
  transform: translateX(-50%) scale(var(--slide-scale,1));
  transform-origin: top center;
  font-size: 1rem;
  line-height: 1.42;
}
.slide-fit > section {
  border: 1px solid #c8d6e5;
  border-radius: .75rem;
  background: white;
  box-shadow: 0 4px 12px #082b680d;
}
.slide-fit .wmo-shell { padding-inline: 1.35rem; }
.slide-fit :is(.course-cover,.dashboard,.lesson) { padding-block: 1.2rem; min-height: 0; }
.slide-fit h1 { font-size: clamp(1.7rem,3vw,2.65rem); margin-bottom: .48rem; }
.slide-fit h2 { font-size: clamp(1.18rem,2vw,1.6rem); }
.slide-fit .cover-layout { grid-template-columns: minmax(0,1fr) minmax(12rem,32%); gap: 1.9rem; }
.slide-fit .cover-copy h1 { font-size: clamp(2.1rem,4.4vw,4rem); text-wrap: initial; }
.cover-copy p { margin: .85rem 0 1.2rem; }
.cover-layout > .photo-strip { min-height: clamp(15rem,26vw,24rem); }
.dashboard-layout { grid-template-columns: minmax(0,1fr) clamp(9rem,14vw,12rem); gap: 1rem; }
.dashboard-intro p { font-size: 1rem; }
.choose-heading { margin-top: 1rem; margin-bottom: .55rem; }
.pathway-card .wmo-photo { aspect-ratio: 3.6; max-height: 8.5rem; }
.pathway-card__body { padding: .8rem 1rem; }
.pathway-card__body h3 { font-size: clamp(1.1rem,2.1vw,1.35rem); }
.completion { margin-block: .7rem; }
.lesson-heading { margin-bottom: .55rem; }
.lesson-heading .wmo-kicker { font-size: .82rem; margin-bottom: .3rem; }
.lesson-instruction { margin-bottom: .65rem; }
.forecast-branch { margin: .55rem 0 .6rem; }
.farm-card .wmo-photo { aspect-ratio: 3.4; max-height: 8rem; }
.farm-card .wmo-card__copy { padding: .5rem; }
.card-state { margin: .35rem 0 0; }
.takeaway { margin-top: .75rem; }
.comic { gap: .55rem; margin-bottom: .8rem; }
.story-card img { aspect-ratio: 3.6; max-height: 6rem; }
.story-card__copy { padding: .65rem .75rem; }
.story-card p { line-height: 1.34; }
.decision-form legend { font-size: 1.03rem; }
.decision-form fieldset { margin-bottom: .6rem; }
.wmo-option { min-height: 2.55rem; margin: .35rem 0; padding-block: .35rem; }
.decision-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.final-check .decision { grid-template-columns: 1fr; }
.risk-panel { gap: 1rem; padding: .8rem; }
.risk-figure img { aspect-ratio: 2.5; max-height: 14rem; }
.wmo-tabs { margin-top: .6rem; margin-bottom: .55rem; }
.heat-photos .wmo-photo { aspect-ratio: 2.6; max-height: 6.7rem; }
.early-hero { margin-bottom: .7rem; }
.early-hero .photo-strip { min-height: 5.3rem; }
.ag-example { margin-top: .65rem; }
.ag-example img { max-height: 6rem; }
.timeline { padding-block: .55rem; }
.timeline-steps li { min-height: 2.5rem; }
.early-intro { margin-bottom: .5rem; }
.aa-path { padding: .55rem .7rem; }
.aa-detail { min-height: 5.7rem; padding-block: .45rem; }
.aa-detail__image { height: 4.5rem; }
.aa-hotspot { min-height: 3.2rem; padding: .3rem; }
.aa-hotspot__text strong { font-size: .69rem; }
.aa-hotspot__text small { font-size: .59rem; }
.aa-path--traditional .aa-event { min-height: 2.15rem; padding-block: .3rem; font-size: .75rem; }
.flood-story { gap: .5rem; }
.flood-story .story-card img, .warning-phone { min-height: 6.1rem; max-height: none; }
.flood-layout { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: .75rem; }
.flood-layout .decision { padding: .65rem; }
.mechanism-layout > .photo-strip { min-height: 13rem; }
.wmo-footer { border-radius: 0 0 .9rem .9rem; }
.wmo-footer__items, .footer-meta { min-height: 3.65rem; padding: .45rem clamp(.8rem,2vw,1.6rem); }
.wmo-footer__items { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.wmo-footer__items > :first-child { justify-self: start; }
.footer-meta > span { font-size: .86rem; color: var(--wmo-muted); }
.phase-rail { display: flex; align-items: center; gap: .24rem; border: 1px solid #d5e0ed; padding: .18rem; border-radius: 1rem; background: #edf4fc; }
.phase-rail a { padding: .33rem .58rem; border-radius: .8rem; color: var(--wmo-ink); line-height: 1.3; font-size: .78rem; font-weight: 700; text-decoration: none; }
.phase-rail a:hover { background: #d2e6ff; }
.phase-rail [aria-current="step"] { color: white; background: var(--wmo-blue); }
.phase-rail [aria-current="step"]:hover { color: white; background: var(--wmo-blue-hover); }
.next-group { flex-wrap: nowrap; gap: .55rem; }
.next-group span { line-height: 1.2; text-align: right; font-size: .79rem; }
.next-group .wmo-btn { flex: 0 0 auto; }

#lesson-dialog {
  width: min(37rem, calc(100vw - 1.5rem));
  max-width: unset;
  max-height: none;
  padding: 0;
  border: 1px solid #adc1d9;
  border-radius: .85rem;
  color: var(--wmo-text);
  box-shadow: 0 18px 48px #102e5690;
  overflow: clip;
  transform: scale(var(--dialog-scale,1));
}
#lesson-dialog::backdrop { background: #10294795; }
.dialog-body { padding: clamp(1rem,3vw,1.5rem); }
.dialog-photo, .outcome-photo { aspect-ratio: 3; margin-bottom: .8rem; max-height: 10rem; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 1rem; }
.feedback-result { display: flex; align-items: center; gap: .8rem; margin-bottom: .85rem; padding: .8rem .9rem; border: 1px solid; border-radius: .65rem; }
.feedback-result--correct { color: #15552c; border-color: #8fc49c; background: #eaf6ec; }
.feedback-result--review { color: #694300; border-color: #e3bd57; background: #fff7df; }
.feedback-result__icon { display: grid; flex: 0 0 2.5rem; width: 2.5rem; height: 2.5rem; place-items: center; border-radius: 50%; color: inherit; background: white; }
.feedback-result__icon { font-size: 1.65rem; font-weight: 900; line-height: 1; }
.feedback-result__copy { display: grid; gap: .1rem; }
.feedback-result__label { color: currentColor; font-size: .73rem; font-weight: 800; letter-spacing: .075em; text-transform: uppercase; }
.feedback-result__copy strong { color: var(--wmo-ink); font-size: 1.12rem; line-height: 1.25; }
.feedback-copy { padding: 0 .1rem; }
.feedback-copy p { margin: 0; }
.feedback-steps { margin-top: .9rem; }
@media (max-width: 50rem) {
  .slide-fit .dashboard-layout { grid-template-columns: minmax(0,1fr); }
  .dashboard-layout > .photo-strip { display: none; }
  .next-group span { max-width: 7rem; }
}
@media (max-width: 38rem) {
  #player { inset: .25rem; border-radius: .65rem; }
  .wmo-header__items { display: flex; flex-wrap: nowrap; gap: .4rem; padding-inline: .5rem; min-height: 3.25rem; }
  .wmo-brand { width: clamp(5.8rem,26vw,8.5rem); }
  .wmo-position { font-size: .72rem; }
  .wmo-progress { width: 2.15rem; height: 2.15rem; }
  .wmo-progress__text { font-size: .63rem; }
  .wmo-header__items .wmo-btn { min-width: 0; padding: .38rem .55rem; min-height: 2.5rem; font-size: .85rem; gap: .3rem; }
  .wmo-menu { right: .35rem; max-width: calc(100vw - 1.2rem); }
  .slide-fit .wmo-shell { padding-inline: .8rem; }
  .slide-fit :is(.course-cover,.dashboard,.lesson) { padding-block: .8rem; }
  .slide-fit .cover-layout { grid-template-columns: 1fr; gap: .8rem; }
  .cover-layout > .photo-strip { min-height: 7rem; }
  .slide-fit .cover-copy h1 { font-size: 2.15rem; }
  .pathway-grid, .farm-grid { grid-template-columns: 1fr; gap: .6rem; }
  .pathway-card .wmo-photo, .farm-card .wmo-photo { aspect-ratio: 5.4; }
  .pathway-card__body { padding: .55rem .7rem; }
  .pathway-card__body p { margin-bottom: .35rem; }
  .pathway-track { margin: .38rem 0 .5rem; }
  .comic { grid-template-columns: 1fr; }
  .comic .story-card { display: grid; grid-template-columns: 22% 1fr; }
  .comic .story-card img { height: 100%; max-height: none; }
  .story-card__copy { padding: .4rem .55rem; }
  .story-card h3, .story-card p { font-size: .94rem; }
  .story-card h3 { margin-bottom: .22rem; }
  .flood-layout { grid-template-columns: 1fr; }
  .flood-story .story-card img, .warning-phone { min-height: 3.8rem; }
  .warning-phone > div { font-size: .65rem; border-width: .25rem; }
  .risk-panel { padding: .55rem; gap: .4rem; }
  .risk-figure img { max-height: 5.75rem; }
  .risk-tabs .wmo-tab { flex: 1 1 40%; }
  .heat-photos .wmo-photo { aspect-ratio: 3.2; }
  .knowledge-check-banner { gap: .5rem; padding: .45rem .55rem; }
  .knowledge-check-progress { gap: .2rem; }
  .knowledge-check-progress b { width: 1.1rem; }
  .check-process { gap: .25rem; padding: .45rem .4rem; }
  .check-process li { gap: .2rem; font-size: .7rem; }
  .check-process li .wmo-icon { width: 1rem; height: 1rem; flex-basis: 1rem; }
  .early-hero .photo-strip { display: none; }
  .ag-example { grid-template-columns: minmax(4rem,24%) 1fr; gap: .55rem; }
  .ag-example img { aspect-ratio: 1; }
  .mechanism-layout > .photo-strip { min-height: 5.4rem; }
  .wmo-footer__items { grid-template-columns: auto 1fr; align-items: start; gap: .35rem; }
  .phase-rail { display: none; }
  .wmo-footer__items .wmo-btn, .footer-meta .wmo-btn { min-height: 2.5rem; padding: .34rem .65rem; }
  .next-group { justify-content: flex-end; }
  .next-group span { order: 0; width: auto; font-size: .73rem; }
  .footer-meta { gap: .35rem; }
}
@media (max-height: 27rem) {
  .wmo-header__items, .wmo-footer__items, .footer-meta { min-height: 2.6rem; padding-block: .1rem; }
  .wmo-menu { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); width: min(30rem,calc(100vw - 1.5rem)); }
  .wmo-menu > a { grid-column: 1/-1; }
  .wmo-menu strong:nth-of-type(2) { grid-column: 2; grid-row: 2; }
}
.mobile-story { display: none; }
.scene-controls { display: flex; justify-content: space-between; gap: .45rem; margin-top: .75rem; }
.dialog-body .story-card .wmo-photo { max-height: 9rem; }
@media (max-width: 38rem) {
  .mobile-story { display: inline-flex; margin-bottom: .65rem; }
  .slide-fit .comic, .slide-fit .flood-story { display: none; }
  .scene-controls .wmo-btn { padding-inline: .65rem; }
}

.completion > .wmo-btn { margin-inline-start: auto; flex: 0 0 auto; align-self: center; }
.course-closing {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  text-align: center;
  min-height: clamp(17rem, 42vh, 26rem);
  padding: clamp(1.2rem,4vw,2.4rem);
}
.closing-copy { z-index: 1; max-width: 39rem; position: relative; }
.closing-copy > p:not(.exit-status) { margin: .7rem auto 1.15rem; color: var(--wmo-muted); }
.closing-check {
  display: grid;
  place-items: center;
  width: 3.75rem;
  height: 3.75rem;
  margin: 0 auto .8rem;
  border-radius: 50%;
  color: #15552c;
  background: #e6f4ea;
  border: 1px solid #bbdfc6;
  font-size: 1.65rem;
}
.closing-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .55rem; }
.closing-actions > .wmo-btn { min-width: 7rem; }
.exit-status { min-height: 1.5em; margin: .8rem 0 0; color: var(--wmo-ink); }
.celebration-confetti { position: absolute; inset: 0; pointer-events: none; }
.celebration-confetti i {
  position: absolute;
  top: -1rem;
  left: var(--piece-x);
  width: .45rem;
  height: .75rem;
  border-radius: .1rem;
  background: var(--piece-color);
  opacity: 0;
  animation: closing-confetti var(--piece-duration) var(--piece-delay) ease-in both;
}
.celebration-confetti i:nth-child(3n) { width: .55rem; height: .55rem; border-radius: 50%; }
@keyframes closing-confetti {
  0% { opacity: 0; transform: translate(0,0) rotate(0); }
  9%, 66% { opacity: .8; }
  100% { opacity: 0; transform: translate(var(--piece-drift), 30rem) rotate(390deg); }
}
@media (max-width: 38rem) {
  .completion { flex-wrap: wrap; }
  .completion > .wmo-btn { margin-inline-start: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .celebration-confetti { display: none; }
}

.timeline-caption { margin: 0 0 .6rem; }
.mechanism-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 0; }
.mechanism-tabs .wmo-tab { display:flex; align-items:center; gap:.4rem; text-align:left; }
.mechanism-panels { display: grid; background: #edf4fc; border-radius: .45rem; }
.mechanism-panel { grid-area: 1 / 1; padding: 1rem; opacity: 1; transition: opacity 180ms ease, visibility 180ms; }
.mechanism-panel[aria-hidden="true"] { opacity:0; visibility:hidden; pointer-events:none; }
.mechanism-panel p:last-child { margin-bottom:0; }

.closing-copy { background: rgb(255 255 255 / 92%); border-radius: .65rem; padding: .8rem 1.4rem; }
.closing-copy > p { color: var(--wmo-text); }
@media (prefers-reduced-motion: reduce) { .mechanism-panel { transition:none; } }


.risk-panels .risk-copy { padding: .2rem; }
.risk-copy p, .mechanism-panel p { margin-bottom: .6rem; }
.mechanism-panel .risk-question { margin-bottom: 0; }

.action-timing {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border: 1px solid #c8d6e5;
  border-radius: .55rem;
  overflow: hidden;
  font-size: .94rem;
}
.action-timing caption { text-align: left; font-weight: 700; color: var(--wmo-ink); padding-bottom: .45rem; }
.action-timing :is(th,td) { text-align: left; vertical-align: top; padding: .55rem .65rem; overflow-wrap: break-word; }
.action-timing thead th { background: #eaf1f9; color: var(--wmo-ink); }
.action-timing th:first-child { width: 21%; }
.action-timing thead th:nth-child(3) { width: 18%; }
.action-timing tbody th { color: var(--wmo-ink); }
.action-timing tbody :is(th,td) { border-top: 1px solid #d6e0ea; }
.action-timing td:nth-child(3) { background: #f5f7fa; }
.action-timing td strong, .action-timing td span { display: block; }
.action-timing .early-stage { background: #003da5; color: white; }
.action-timing .response-stage { background: #edf4fc; color: var(--wmo-ink); }
@media (max-width: 38rem) {
  .action-timing { font-size: .75rem; }
  .action-timing :is(th,td) { padding: .38rem .3rem; }
}

/* Small transparent cutouts replace full photo backdrops on learning screens. */
main[data-screen] {
  --stage-art: none;
  --stage-detail: none;
  --stage-art-size: clamp(12rem,24vw,22rem) auto;
  --stage-detail-size: min(40vw,34rem) auto;
  --stage-art-position: right bottom;
  --stage-detail-position: left bottom;
  background-color: #eff5fc;
}
main[data-screen]::before {
  content: "";
  display: block;
  position: absolute;
  z-index: 0;
  inset: 0;
  background-image: var(--stage-art), var(--stage-detail);
  background-position: var(--stage-art-position), var(--stage-detail-position);
  background-size: var(--stage-art-size), var(--stage-detail-size);
  background-repeat: no-repeat;
  opacity: .58;
  pointer-events: none;
}
main[data-screen="welcome"] { --stage-art: none; --stage-detail: none; }
main[data-screen="pathways"], main[data-screen="two-farms"] {
  --stage-art: url("../assets/backgrounds/cutout-sunlit-fields.webp");
  --stage-detail: url("../assets/backgrounds/cutout-contour-waves.webp");
}
main[data-screen="issue-warning"], main[data-screen="flood-decision"] {
  --stage-art: url("../assets/backgrounds/cutout-storm-cloud.webp");
  --stage-art-position: right bottom;
  --stage-detail: url("../assets/backgrounds/cutout-contour-waves.webp");
}
main[data-screen="risk-concepts"], main[data-screen="heat-check"], main[data-screen="act-early"], main[data-screen="action-check"] {
  --stage-art: url("../assets/backgrounds/cutout-maize-panels.webp");
  --stage-detail: url("../assets/backgrounds/cutout-contour-waves.webp");
}
main[data-screen="action-mechanism"], main[data-screen="complete"] {
  --stage-art: url("../assets/backgrounds/cutout-sunlit-fields.webp");
  --stage-detail: url("../assets/backgrounds/cutout-contour-waves.webp");
}
.slide-fit { z-index: 1; }

/* Agreed WMO cover artwork without the additional leaf or logo backdrop. */
.slide-fit .course-cover {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  padding: 0;
  background: #fff url("../assets/backgrounds/course-cover.webp") center / cover no-repeat;
}
.slide-fit .course-cover::before { display: none; }
.slide-fit .course-cover .cover-layout {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: none;
  min-height: 100%;
  padding-inline: clamp(1.7rem,4vw,3.8rem);
}
.slide-fit .course-cover .cover-copy {
  width: min(48%, 36rem);
  max-width: 48%;
  padding-bottom: 1rem;
}
.slide-fit .course-cover .cover-copy h1 {
  margin-bottom: .65rem;
  font-size: clamp(2rem,4.1vw,3.7rem);
  line-height: 1.06;
  letter-spacing: -.035em;
}
.slide-fit .course-cover .cover-label {
  margin: 0 0 1.15rem !important;
  font-size: clamp(1rem,1.8vw,1.3rem) !important;
}
.slide-fit .course-cover .cover-actions .wmo-btn { min-width: 9.5rem; }
@media (max-width: 38rem) {
  .slide-fit .course-cover {
    aspect-ratio: auto;
    min-height: 26rem;
    background-image: linear-gradient(180deg,#fff 0%,#fff 48%,rgb(255 255 255 / 10%) 74%),url("../assets/backgrounds/course-cover.webp");
    background-position: center, 66% bottom;
    background-size: 100% 100%, 100% auto;
  }
  .slide-fit .course-cover .cover-layout {
    align-items: start;
    padding: 1.2rem 1.1rem;
  }
  .slide-fit .course-cover .cover-copy {
    width: 100%;
    max-width: 100%;
    padding-bottom: 0;
  }
  .slide-fit .course-cover .cover-copy h1 { font-size: 2rem; }
}

/* Completion uses the same open photo composition and WMO contour signature as the cover. */
.slide-fit .course-closing {
  aspect-ratio: 16 / 9;
  min-height: 0;
  place-items: center start;
  padding: 0;
  text-align: left;
  background: #fff url("../assets/backgrounds/course-cover.webp") center / cover no-repeat;
}
.slide-fit .course-closing .closing-copy {
  width: 49%;
  max-width: 37rem;
  margin-left: clamp(1.7rem,4vw,3.8rem);
  padding: .5rem 1rem .75rem 0;
  background: transparent;
}
.slide-fit .course-closing .closing-check { margin: 0 0 .75rem; }
.slide-fit .course-closing .closing-copy h1 { max-width: 34rem; font-size: clamp(2.4rem,4.5vw,4rem); line-height: 1.05; }
.slide-fit .course-closing .closing-copy > p:not(.exit-status) { max-width: 35rem; margin: .8rem 0 1.2rem; }
.slide-fit .course-closing .closing-actions { justify-content: flex-start; }
.slide-fit .course-closing .celebration-confetti { z-index: 1; }
@media (max-width: 38rem) {
  .slide-fit .course-closing {
    aspect-ratio: auto;
    min-height: 26rem;
    background-image: linear-gradient(180deg,#fff 0%,#fff 48%,rgb(255 255 255 / 10%) 74%),url("../assets/backgrounds/course-cover.webp");
    background-position: center,66% bottom;
    background-size: 100% 100%,100% auto;
  }
  .slide-fit .course-closing .closing-copy { width: auto; max-width: 100%; margin: 0; padding: 1.2rem 1.1rem; }
  .slide-fit .course-closing .closing-copy h1 { font-size: 2.3rem; }
  .slide-fit .course-closing .closing-actions { justify-content: flex-start; }
}
