/* Launch v5: the one-frame coloring slider, collapsible book sections on the parents page,
   the shared day -> dream -> morning sky, and the grown-up email gate on /explorer/ pages.
   Motion is transform/opacity only and all of it stops under reduced motion. */

/* ---------- Before/after coloring slider (/printables/) ---------- */
.ci-grid { display: grid; gap: 22px; align-items: center; }
@media (min-width: 960px) { .ci-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 48px; } .color-it { padding: 64px 0; } }
.ci-cta { margin: 18px 0 0; }
.ci { width: min(100%, 460px); justify-self: center; margin: 0; }
.ci-frame {
  position: relative; overflow: hidden; border-radius: 18px; background: #fff; isolation: isolate;
  box-shadow: 0 22px 44px -26px rgba(59, 42, 34, 0.6), 0 0 0 1px rgba(59, 42, 34, 0.08);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.ci.is-live .ci-frame { cursor: ew-resize; }
.ci-img { display: block; width: 100%; height: auto; pointer-events: none; }
/* the colored copy: an outer layer slides left, its inner copy slides back right, so exactly the
   left part shows, without clip-path or width changes (transform only) */
.ci-top, .ci-top-in { position: absolute; inset: 0; overflow: hidden; will-change: transform; }
.ci-top { transform: translate3d(-50%, 0, 0); }
.ci-top-in { transform: translate3d(50%, 0, 0); }
.ci-top-in .ci-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* the handle is a full-width layer moved by its own width, so 37% = 37% of the picture */
.ci-handle { position: absolute; inset: 0; transform: translate3d(50%, 0, 0); pointer-events: none; will-change: transform; z-index: 2; }
.ci-line { position: absolute; left: -2px; top: 0; bottom: 0; width: 4px; background: #fffaf1; box-shadow: 0 0 0 1px rgba(59, 42, 34, 0.3); }
.ci-knob {
  position: absolute; left: 0; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #fffaf1; color: var(--ink); font-weight: 700; font-size: 1.3rem; line-height: 1;
  box-shadow: 0 0 0 3px var(--cta), 0 8px 18px -6px rgba(59, 42, 34, 0.6);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ci.is-dragging .ci-knob, .ci-frame:hover .ci-knob { transform: scale(1.08); }
/* the native range input: visually hidden, but focusable; its focus shows on the knob */
.ci-range { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.ci-range:focus-visible ~ .ci-handle .ci-knob { box-shadow: 0 0 0 3px #fffaf1, 0 0 0 6px var(--ink), 0 8px 18px -6px rgba(59, 42, 34, 0.6); }
.ci-cap { margin: 10px 2px 0; font-size: 0.92rem; color: var(--ink-soft); line-height: 1.45; }
.ci-how { font-weight: 700; color: var(--ink); }
.ci-note { font-size: 0.85rem; }
html:not(.js) .ci-handle, html:not(.js) .ci-how, html:not(.js) .ci-range { display: none; }

/* ---------- Parents page: one disclosure per book ---------- */
.lbook { padding: 0; overflow: hidden; }
.lbook > summary { list-style: none; cursor: pointer; }
.lbook > summary::-webkit-details-marker { display: none; }
.lbook-head { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 16px; align-items: center; margin: 0; padding: 18px 20px; border-radius: var(--radius); }
.lbook-head:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--ink); }
.lbook-cover .cover { width: 84px; box-shadow: 0 8px 16px -10px rgba(59, 42, 34, 0.55); }
.lbook-sum { display: block; min-width: 0; }
.lbook-place { display: block; }
.lbook-head h3 { margin: 2px 0 4px; font-size: 1.35rem; }
.lbook-head .lesson-name { display: block; margin: 0 0 8px; font-weight: 700; color: var(--ink-soft); }
.lbook-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; background: #fffaf1; box-shadow: inset 0 0 0 2px #e9c77d; font-weight: 700; font-size: 1rem; color: var(--ink); }
.lbook-toggle::after { content: ""; width: 9px; height: 9px; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 0.25s ease; }
.lbook[open] .lbook-toggle::after { transform: translateY(2px) rotate(-135deg); }
.lbook-head:hover .lbook-toggle { background: var(--honey-soft); }
.lt-hide, .lbook[open] .lt-show { display: none; }
.lbook[open] .lt-hide { display: inline; }
.lbook-body { padding: 0 20px 22px; }
.lbook-tools { margin-bottom: 14px; }
.lbook-tools p { margin: 0 0 6px; }
.lbook-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; }
.lbook-links .print-btn { margin: 0; }
@media (min-width: 720px) {
  .lbook-featured .lbook-head { grid-template-columns: 120px minmax(0, 1fr); gap: 22px; padding: 22px 26px; }
  .lbook-featured .lbook-cover .cover { width: 120px; }
  .lbook-body { padding: 0 26px 26px; }
}
.lbook-more { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); align-items: start; }
.lbook-more .lbook { margin: 0; }
.lbook-more .lbook[open] { grid-column: 1 / -1; }
@media print {
  .lbook-toggle, .lbook-links { display: none !important; }
  .lbook > summary { cursor: auto; }
  .lbook-more { display: block; }
  .print-one .lbook-more { margin: 0; }
}

/* ---------- The day -> dream -> morning sky (lx-sky.js) ----------
   All colors are light (darkest stop #c9c3e8): body text #3b2a22 stays 8.1:1 on it and the
   soft ink #5e4636 5.2:1 (both at the dream peak), so contrast holds at every state. */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; display: none; overflow: hidden; contain: strict; }
html.js .sky.is-on { display: block; }
.sky.is-off { visibility: hidden; }
.sky.is-off *, .sky.is-off *::before, .sky.is-off *::after { animation-play-state: paused !important; }
.sky-dream, .sky-morning { position: absolute; inset: 0; opacity: 0; will-change: opacity; }
.sky-dream { background: linear-gradient(180deg, #c9c3e8 0%, #d3d6ef 42%, #e2e6f3 78%, #efe8ee 100%); }
.sky-morning {
  background:
    radial-gradient(90% 55% at 18% 100%, rgba(255, 214, 170, 0.75) 0%, rgba(253, 226, 196, 0.45) 45%, rgba(251, 244, 230, 0) 75%),
    linear-gradient(180deg, rgba(251, 244, 230, 0) 30%, #fbe7d2 100%);
}
.sky-l { position: absolute; left: 0; right: 0; top: 0; height: 160%; will-change: transform; }
.sky-l i { position: absolute; display: block; }
.sky .st { width: 2px; height: 2px; border-radius: 50%; background: #fff; }
.sky-far .st { opacity: 0.75; }
.sky-near .st { width: 4px; height: 4px; box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.85); animation: twinkle 3.6s ease-in-out infinite; }
.sky-far .st:nth-child(1) { top: 5%; left: 8%; } .sky-far .st:nth-child(2) { top: 9%; left: 27%; } .sky-far .st:nth-child(3) { top: 4%; left: 44%; }
.sky-far .st:nth-child(4) { top: 12%; left: 63%; } .sky-far .st:nth-child(5) { top: 7%; left: 86%; } .sky-far .st:nth-child(6) { top: 20%; left: 15%; }
.sky-far .st:nth-child(7) { top: 24%; left: 52%; } .sky-far .st:nth-child(8) { top: 18%; left: 76%; } .sky-far .st:nth-child(9) { top: 31%; left: 34%; }
.sky-far .st:nth-child(10) { top: 36%; left: 92%; } .sky-far .st:nth-child(11) { top: 44%; left: 4%; } .sky-far .st:nth-child(12) { top: 49%; left: 68%; }
.sky-near .st:nth-child(1) { top: 7%; left: 18%; } .sky-near .st:nth-child(2) { top: 14%; left: 39%; animation-delay: -1.2s; }
.sky-near .st:nth-child(3) { top: 6%; left: 70%; animation-delay: -2.4s; } .sky-near .st:nth-child(4) { top: 27%; left: 82%; animation-delay: -0.7s; width: 3px; height: 3px; }
.sky-near .st:nth-child(5) { top: 33%; left: 9%; animation-delay: -1.9s; width: 3px; height: 3px; } .sky-near .st:nth-child(6) { top: 42%; left: 57%; animation-delay: -3s; }
.sky-near .st:nth-child(7) { top: 52%; left: 28%; animation-delay: -0.4s; width: 3px; height: 3px; }
/* soft cloud wisps (three puffs each) drifting very slowly */
.sky .cl { width: 200px; height: 44px; border-radius: 44px; background: rgba(255, 255, 255, 0.5); animation: sky-drift 70s ease-in-out infinite alternate; }
.sky .cl::before, .sky .cl::after { content: ""; position: absolute; border-radius: 50%; background: inherit; }
.sky .cl::before { width: 74px; height: 74px; left: 34px; top: -36px; }
.sky .cl::after { width: 96px; height: 96px; left: 86px; top: -54px; }
.sky .cl:nth-child(1) { top: 22%; left: -4%; }
.sky .cl:nth-child(2) { top: 40%; right: -6%; transform: scale(0.8); animation-duration: 90s; animation-delay: -30s; }
.sky .cl:nth-child(3) { top: 62%; left: 30%; transform: scale(0.6); opacity: 0.8; animation-duration: 110s; animation-delay: -60s; }
@keyframes sky-drift { from { translate: -3vw 0; } to { translate: 4vw 0; } }
.sky-moon {
  position: absolute; right: 9vw; top: 10vh; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 36% 36%, #fffef6 0%, #fbf1cf 55%, #efdc9c 100%);
  box-shadow: 0 0 34px 10px rgba(255, 247, 214, 0.7); transform: translate3d(0, 34vh, 0); will-change: transform;
}
.sky-moon::after { content: ""; position: absolute; left: 30%; top: 52%; width: 10px; height: 8px; border-radius: 50%; background: rgba(222, 200, 140, 0.5); box-shadow: 15px -17px 0 -2px rgba(222, 200, 140, 0.4); }
.sky-moon-l .sky-moon { right: auto; left: 7vw; }
@media (min-width: 960px) { .sky-moon { width: 88px; height: 88px; right: 7vw; } }
/* Canada: a faint, light aurora ribbon */
.sky-aurora i { width: 130%; left: -15%; height: 16vh; top: 7%; border-radius: 50%; background: linear-gradient(90deg, rgba(178, 232, 210, 0), rgba(178, 232, 210, 0.55) 30%, rgba(196, 218, 246, 0.5) 60%, rgba(178, 232, 210, 0)); transform: rotate(-7deg); animation: sky-aurora 16s ease-in-out infinite alternate; }
.sky-aurora i + i { top: 13%; height: 10vh; opacity: 0.7; transform: rotate(-3deg); animation-duration: 21s; animation-delay: -8s; }
@keyframes sky-aurora { from { opacity: 0.45; translate: -2vw 0; } to { opacity: 0.9; translate: 2vw 0; } }
@media (prefers-reduced-motion: reduce) { .sky { display: none !important; } }
@media print { .sky { display: none !important; } }

/* ---------- /explorer/<book>/: the grown-up email gate ---------- */
.ex-kid { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 8px 16px; border-radius: 999px; background: #fffaf1; box-shadow: inset 0 0 0 2px #e9c77d; font-family: var(--display); font-weight: 600; font-size: 1.1rem; }
.ex-soon { font-weight: 700; }
.ex-join .ex-prev { border-radius: 14px; box-shadow: var(--shadow); background: #fff; }
.gate-wrap { width: 100%; }
.gate-fields { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .gate-fields { grid-template-columns: minmax(0, 1fr) 13em; grid-template-rows: auto auto; grid-auto-flow: column; } }
.year-select {
  width: 100%; min-height: 54px; margin-bottom: 14px; padding: 10px 14px; border: 2px solid #8a7262; border-radius: 16px;
  background: #fff; color: var(--ink); font: inherit; font-size: 1.1rem;
}
.year-select:focus-visible { outline: none; border-color: var(--ink); box-shadow: var(--focus); }
.gate-kid { background: #fffaf1; border-radius: 24px; box-shadow: var(--shadow); padding: 22px; text-align: center; }
.gate-kid:focus { outline: none; }
.gate-kid:focus-visible { box-shadow: var(--focus); }
.gk-art { width: 110px; height: auto; margin: 0 auto 8px; }
.gate-kid h2 { margin-bottom: 0.3em; }
.gate-fields .email-input { margin-bottom: 14px; }
@media (max-width: 959px) {
  .ex-gate .ihero-art { display: none; }
  .ex-gate { padding-bottom: 0; }
  .ex-join { padding-top: 8px; }
  .ex-join .join-art { width: min(46vw, 200px); }
}

/* ---------- /reward/<token>/: the Master Explorer certificates ---------- */
.reward-dl { padding: 40px 0 8px; }
.rw-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.rw-card { background: #fffaf1; border-radius: 24px; box-shadow: var(--shadow); padding: 18px 20px 20px; }
.rw-card:first-child { box-shadow: inset 0 0 0 3px #e9c77d, var(--shadow); }
.rw-prev { width: 100%; height: auto; border-radius: 12px; margin-bottom: 10px; background: #fff; }
.rw-card h3 { font-size: 1.3rem; margin-bottom: 0.4em; }

/* ---------- The finished Canada book: real cover, printed spreads, map, fun facts ---------- */
.cover-real { display: block; padding: 0; background: #cfe2ef; }
.cover-real .cover-img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.cover-real::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 6px 0 0 rgba(0, 0, 0, 0.07), inset 8px 0 6px -4px rgba(255, 255, 255, 0.35); }
/* printed spreads: the words are in the picture and stay as hidden text; only the no-JS stack of
   whole spreads (too small to read on phones) shows them as a caption */
.ob-final { background: #fffaf1; }
.ob-final .ob-art { aspect-ratio: 2 / 1; }
.ob-said { margin: 0; padding: 14px 18px 18px; font-family: var(--display); font-weight: 600; font-size: 1.05rem; line-height: 1.5; color: var(--ink); }
.ob-half .ob-said { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (min-width: 640px) {
  .ob-final .ob-said { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}
/* Sunny's Splorin' Map under "what they'll discover" */
.bk-map { margin: 26px 0 0; }
.bk-map-img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; border-radius: 16px; box-shadow: 0 22px 44px -26px rgba(30, 30, 60, 0.55); }
.bk-map figcaption { margin-top: 10px; font-size: 0.98rem; color: var(--ink-soft); }
@media (min-width: 960px) { .story .bk-map { grid-column: 1 / -1; } }
/* fun facts from page 36 */
.funfacts { padding: 48px 0; }
.ff-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-width: 820px; }
.ff { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; background: #fffaf1; border-radius: 22px; padding: 12px 18px 12px 12px; box-shadow: var(--shadow); }
.ff-art { width: 100%; height: auto; border-radius: 14px; }
.ff p { margin: 0; font-size: 1.05rem; line-height: 1.5; }
@media (min-width: 720px) { .funfacts { padding: 72px 0; } .ff { grid-template-columns: 190px 1fr; gap: 22px; padding: 12px 26px 12px 12px; } .ff p { font-size: 1.12rem; } }
/* a small 3D book with its title (meet-sunny, about) */
.cp-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; }
.bk-chip { display: inline-flex; align-items: center; gap: 14px; padding: 8px 16px 14px 6px; border-radius: 22px; text-decoration: none; color: var(--ink); margin-bottom: 18px; }
.bk-chip .b3d-sm { width: 96px; flex: none; }
.bk-chip-cap { display: grid; gap: 2px; max-width: 22ch; }
.bk-chip-cap strong { font-family: var(--display); font-weight: 600; font-size: 1.05rem; line-height: 1.25; }
.bk-chip-cap span { font-size: 0.92rem; color: var(--ink-soft); }
.bk-chip:hover .bk-chip-cap strong, .bk-chip:focus-visible .bk-chip-cap strong { text-decoration: underline; }
.bk-chip:focus-visible { box-shadow: var(--focus); }
.ab-books { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 18px; }
