@view-transition { navigation: auto; }
:root { --storybook-serif: Georgia, 'Times New Roman', serif; }
.living-home {
  --paper: #fffbf1;
  --rewards-paper: #f8f1de;
  --stories-paper: #e8eee0;
  --trail-paper: #f0f2e5;
  --ink: #223729;
  --deep: #153a2a;
  --pine: #225a3c;
  --moss: #3b6247;
  --mint: #edf2e6;
  --line: #c9d1bc;
  --sun: #f4d477;
  --display: var(--storybook-serif);
  background: var(--paper);
  color: var(--ink);
}
.living-home :is(h1, h2) { font-weight: 700; letter-spacing: -.052em; text-wrap: balance; }
.living-home h2 { font-size: clamp(2.5rem, 5vw, 4.65rem); line-height: 1; }
.living-home h2 em { font-style: italic; font-weight: 500; }
.living-home h3 { font-family: var(--storybook-serif); }
.living-home .eyebrow { font-size: .875rem; letter-spacing: .115em; }
.living-home .button, .living-home .menu-button { border-radius: 100px; padding-inline: 1.15rem; }
.living-home .button.outline { border-color: #8da390; color: var(--deep); background: transparent; }
.living-home .button.outline:hover { background: #f5ebce; }
.living-home .section { padding-block: clamp(3.5rem, 7vw, 7rem); }
.living-home .site-header { background: var(--paper); border-color: #dccfb6; }
.living-home .header-inner { width: min(100% - 2.5rem, 86rem); min-height: 5rem; }
.living-home .site-header .brand { font-size: clamp(1.04rem, 1.55vw, 1.42rem); }
.living-home .site-header .brand-mark { width: clamp(2.15rem, 3.3vw, 2.8rem); }
.living-home #nav { gap: clamp(.75rem, 1.7vw, 1.65rem); }
.living-home #nav a { position: relative; text-decoration: none; }
.living-home #nav a::after {
  position: absolute; inset: auto 0 .32rem; height: .16rem; content: "";
  background: #9d6d13; transform: scaleX(0); transform-origin: left;
  transition: transform .2s ease;
}
.living-home #nav a:is(:hover, :focus-visible, [aria-current="location"])::after { transform: scaleX(1); }

.living-home .chapter-trail {
  background: radial-gradient(ellipse at center, #fffaf0 0, transparent 65%), var(--trail-paper);
}
.chapter-trail::before, .living-home .parents::before, .living-home .questions::before { display: none; }
.trail-next { display: flex; flex-wrap: wrap; justify-content: center; }
.trail-scene {
  position: relative;
  width: min(91%, 405px);
  margin: 0 auto;
  padding: .44rem;
}
.trail-scene::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  border: 2px dashed #a6b496;
  border-radius: 50%;
  background: #f8e9c58c;
}
.trail-photo {
  display: block;
  width: 100%;
  height: auto;
  border: 5px solid #fffaf0;
  border-radius: 50%;
  box-shadow: 0 .34rem .8rem #65532c28;
}
.trail-tug {
  position: absolute;
  z-index: 1;
  inset: auto -4% -.45rem;
  height: clamp(2.55rem, 6vw, 4.15rem);
  pointer-events: none;
}
.trail-tug-cord {
  position: absolute;
  inset: 52% 10% auto;
  width: 80%;
  height: .5rem;
  overflow: visible;
}
.trail-tug-cord path {
  fill: none;
  stroke: #a57748;
  stroke-width: 5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.trail-tug-cord path + path { stroke: #f9dc9f; stroke-width: 1.3; stroke-dasharray: 2 3; }
.trail-tug > img {
  position: absolute;
  height: 100%;
  width: auto;
  filter: drop-shadow(0 .15rem .2rem #6b4d3133);
}
.trail-tug-chloe { left: 0; }
.trail-tug-scrolly { right: 0; }
@media (prefers-reduced-motion: no-preference) {
  .trail-is-visible .trail-tug > img { animation: trail-character-tug 1.2s .45s ease-in-out 2; }
  .trail-tug-chloe { --tug-distance: -.24rem; }
  .trail-tug-scrolly { --tug-distance: .24rem; }
}
@keyframes trail-character-tug {
  0%, 100% { translate: 0 0; }
  48% { translate: var(--tug-distance) 0; }
}

.trail-badge {
  display: grid;
  flex: none;
  place-items: center;
  width: clamp(2.4rem, 3.7vw, 3rem);
  aspect-ratio: 1;
  border-radius: 50%;
  color: #fffaf0;
  background: #316149;
  box-shadow: inset 0 -.19rem #222a3026, 0 0 0 .24rem var(--trail-paper);
}
.trail-steps li:nth-child(1) .trail-badge { background: #93631f; }
.trail-steps li:nth-child(2) .trail-badge { background: #9e472d; }
.trail-badge svg {
  width: 58%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#think-and-talk { scroll-margin-top: 1.1rem; }

@media (max-width: 760px) {
  .trail-scene { width: min(89%, 305px); }
}

.living-home .story-grid {
  display: grid; grid-template-columns: minmax(0, 1fr); align-items: start;
  gap: clamp(1.6rem, 4.5vw, 4rem) clamp(1.3rem, 3.1vw, 3rem);
}
.living-home .story { grid-column: auto; min-width: 0; border: 0; overflow: visible; }
.living-home .story h3 { font-size: clamp(1.4rem, 2.5vw, 2.15rem); color: var(--deep); }
.living-home .story > :not(img) { margin-inline: 0; }
.living-home :is(.story > img, .story-cover-link > img) {
  border-radius: .32rem 1.05rem 1.05rem .32rem; object-fit: contain;
  background: #e2e9d8; box-shadow: 0 3px 0 #b9c8ac, 0 10px 23px #1933221d;
}
.living-home .story-topic { font-size: .875rem; }
.living-home .story-edition { color: #496149; font-size: .92rem; font-weight: 700; }
.living-home .story details { border-color: #aeba9f; margin-top: .55rem; }
.living-home .story .story-read { align-self: start; margin-block: .25rem .5rem; }
.living-home .story-cover-link:focus-visible { outline-offset: 4px; border-radius: .35rem; }

.living-home .home-activities.section { background: #fffbf1; }
.featured-activity {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4.5rem);
  grid-template-areas: "photo copy";
  align-items: center;
  scroll-margin-top: 1rem;
}
.featured-photo { grid-area: photo; }
.featured-copy { grid-area: copy; }
.featured-photo img { border-radius: .6rem 2.35rem .6rem .6rem; }
.featured-copy h3 { font-size: clamp(2.35rem, 5vw, 3.5rem); letter-spacing: -.055em; color: var(--deep); }
.featured-copy .eyebrow { margin-bottom: .45rem; }
.activity-instructions { scroll-margin-top: .85rem; }
.activity-instructions p:not(.eyebrow) { margin-top: .65rem; }
.parents-program-note {
  max-width: 48ch;
  margin-block: .75rem .25rem;
  color: #365744;
  line-height: 1.5;
}
.activity-safety { padding-left: .8rem; border-left: .2rem solid #a8761e; }
.clap-steps { margin-top: 1rem; }
.clap-steps li::marker { font-weight: 750; color: var(--pine); }
.featured-copy .actions { margin-top: 1.1rem; }
.offscreen-play { margin-top: .7rem; color: #435a44; }
.clap-demo, .activity-demo { text-align: center; margin-top: .85rem; font-weight: 750; color: var(--deep); }
.clap-demo svg { height: 6.8rem; width: min(100%, 16rem); }
.demo-arc { fill: none; stroke: #6e886d; stroke-width: 1.5; stroke-dasharray: 4 5; }
.demo-ball { fill: #e7ad35; stroke: #533b24; stroke-width: 2; }
.demo-hands { fill: #efd6af; stroke: #715839; stroke-width: 2; }
.demo-clap { fill: none; stroke: #795414; stroke-width: 3; stroke-linecap: round; opacity: .65; }
.more-activities-title {
  font-size: clamp(1.75rem, 3.2vw, 2.8rem);
  margin-bottom: clamp(1.8rem, 4vw, 2.9rem);
}
.activity-edition { font-size: .875rem; color: #496149; }
.activity-panel details > :not(summary) { margin-bottom: .65rem; }
.activity-panel details summary { gap: .35rem; }
.activity-demo ol { text-align: left; }
.activity-demo li[data-current] { color: #14582f; background: #f8e4a4; }
.parents .disclosures > a { display: flex; border-bottom: 1px solid var(--line); min-height: 49px; }

.living-home .parents { background: #f1edda; }
.living-home .schools { background: #e7eee5; }
.living-home .school-guide { border: 1px solid #bfcdb9; border-radius: 1rem 2.4rem 1rem 1rem; background: #fffdf4; box-shadow: .38rem .38rem 0 #d2dfce; scroll-margin-top: 1rem; }
.living-home .school-guide h3 { font-weight: 700; }
.living-home .about { background: #fffbf1; }
.living-home .founder-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.35rem, 3.3vw, 2.85rem);
}
.living-home .founder-title {
  grid-column: 1 / -1;
  text-align: center;
  font-size: clamp(2.65rem, 7.25vw, 5.7rem);
  line-height: 1.16;
}
.founder-portrait { margin: 0; text-align: center; }
.founder-credit { margin-top: clamp(.9rem, 2.3vw, 1.45rem); }
.living-home .founder-credit h3 { font-size: clamp(1.65rem, 3.5vw, 2.75rem); }
.founder-credit p {
  margin-top: .25rem;
  color: var(--pine);
  font-size: clamp(1.15rem, 2.25vw, 1.55rem);
}
.founder-greeting {
  margin: 0;
  color: #854725;
  font-family: var(--display);
  font-size: clamp(1.55rem, 3.1vw, 2.55rem);
  font-weight: 700;
  line-height: 1.35;
}
.founder-welcome { min-width: 0; }
.founder-welcome-body {
  margin-top: .65rem;
  font-size: clamp(1.05rem, 1.65vw, 1.23rem);
  line-height: 1.55;
}
.founder-welcome-body p + p { margin-top: .8em; }
.founder-welcome-signoff { color: var(--pine); }
@media (max-width: 760px) {
  .living-home .founder-feature { grid-template-columns: minmax(0, 1fr); }
  .founder-welcome { width: min(100%, 34rem); justify-self: center; }
}
.living-home .book-section { background: #f3e8c9; }
.book-descriptions { margin: 1.2rem 0 0; }
.book-descriptions div { padding: .62rem 0; border-bottom: 1px solid #d6c397; }
.book-descriptions dt { font-size: 1.16rem; font-weight: 750; color: var(--deep); }
.book-descriptions dd { margin: .22rem 0 0; }
.living-home .questions { background: var(--paper); }
.living-home .footer {
  background: #f7ecd1;
  color: var(--deep);
  padding-block: clamp(1.45rem, 4vw, 3rem);
}
.living-home .footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr) minmax(0, .9fr);
  align-items: start;
  gap: clamp(1.2rem, 4vw, 3.5rem);
}
.footer-intro > p { margin-top: .45rem; }
.living-home .footer .brand { font-size: 1.45rem; }
.living-home .footer .brand-mark { width: 2.3rem; }
.living-home .footer .brand-accent { color: #35664a; }
.living-home .footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .4rem .9rem;
}
.living-home .footer-links a {
  background: var(--thin-rope);
  text-decoration: none;
}
.living-home .footer-links a:is(:hover, :focus-visible) { text-decoration: underline; }
.living-home .footer-setup {
  align-self: start;
  padding: .85rem 1rem;
  border-radius: .55rem 1.5rem .65rem .8rem;
  background: #fffaf0;
}
.living-home .footer-setup .setup-button {
  color: #fffaf0;
  background: var(--pine);
  text-decoration: none;
}
.living-home .footer-setup .setup-button:hover { background: var(--deep); }
.living-home .footer-setup p { margin-top: .45rem; color: #40584a; }
@media (max-width: 720px) {
  .living-home .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-intro { grid-column: 1 / -1; }
}
@media (max-width: 470px) {
  .living-home .footer-inner { width: calc(100% - 2rem); grid-template-columns: 1fr; }
}

@media (min-width: 701px) {
  .living-home .story-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .living-home .story { grid-column: span 2; }
}
@media (max-width: 850px) {
  .living-home .header-inner { grid-template-columns: minmax(0, 1fr) auto auto; gap: .45rem; }
  .living-home .header-action { display: inline-flex; grid-column: 2; grid-row: 1; padding-inline: .75rem; }
  .living-home .menu-button { grid-column: 3; grid-row: 1; padding-inline: .75rem; }
}
@media (max-width: 760px) {
  .featured-activity { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "photo"; }
  .featured-photo img { aspect-ratio: 1.6; object-fit: cover; }
}
@media (max-width: 720px) {
}
@media (max-width: 600px) {
  .living-home .header-inner { width: calc(100% - 1.5rem); min-height: 4.15rem; }
  .living-home .header-action { font-size: .82rem; padding-inline: .55rem; }
  .living-home .site-header .brand { gap: .37rem; }
  .living-home .site-header .brand small { font-size: .65rem; }
  .living-home .menu-button { font-size: .83rem; padding-inline: .6rem; }

}

@media (prefers-reduced-motion: no-preference) {
  .living-home .brand .brand-mark { animation: slow-ring 24s linear infinite; }
  .living-home :is(.story > img, .story-cover-link > img) { transition: transform .22s ease, box-shadow .22s ease; }
  .living-home :is(.story > img, .story-cover-link > img):is(:hover, :focus-visible), .living-home .story-cover-link:focus-visible img {
    transform: translateY(-.35rem); box-shadow: 0 6px 0 #b9c8ac, 0 14px 25px #1933222b;
  }
  .living-home .button { transition: transform .14s ease, background-color .18s ease; }
  .living-home :is(.button, .opening-controls button):active { transform: translateY(2px); }
  .living-home .section .soft-reveal { animation: soft-reveal .5s ease both; }
  .clap-demo.is-playing .demo-ball { animation: clap-ball 2.7s ease-in-out both; }
  .clap-demo.is-playing .demo-hands { animation: clap-hands 2.7s ease-in-out both; }
  .clap-demo.is-playing .demo-clap { animation: clap-rays 2.7s ease-in-out both; }
  html[data-story-turn]::view-transition-old(root) { animation: page-turn .28s ease-in both; transform-origin: left; }
  html[data-story-turn]::view-transition-new(root) { animation: page-arrive .28s ease-out both; }
}
@keyframes slow-ring { to { rotate: 1turn; } }
@keyframes soft-reveal { from { translate: 0 .36rem; } to { translate: 0; } }
@keyframes page-turn { to { transform: perspective(1700px) rotateY(-9deg); opacity: .35; } }
@keyframes page-arrive { from { opacity: .55; } to { opacity: 1; } }
@keyframes clap-ball {
  0%, 14% { transform: translate(0, 0); }
  45%, 56% { transform: translate(70px, -51px); }
  84%, 100% { transform: translate(140px, 0); }
}
@keyframes clap-hands { 0%, 31%, 69%, 100% { transform: scaleX(1); } 45%, 55% { transform: scaleX(.37); } }
@keyframes clap-rays { 0%, 35%, 69%, 100% { opacity: 0; } 48%, 57% { opacity: 1; } }
.demo-hands { transform-origin: 50% 75%; }
@media (max-width: 600px) {
  .living-home .section .soft-reveal { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .opening-scene, .living-home #nav a::after { transition: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
.activity-panel .step-demo-playing li { transition: background-color .22s ease; }
.activity-panel .step-demo-playing li[data-current] { background: #f8e4a4; border-radius: .2rem; }
.activity-panel [data-step-demo] { margin-top: .35rem; }
.activity-panel [data-step-demo] + a { margin-left: .45rem; }
.reader-page { background: #fffcf4; }
.reader-page .reader-header { background: #fffcf4; border-color: #dfd5b9; }
.reader-page .reader-header .text-link { white-space: normal; text-align: right; }
.reader-page .reader-hero { background: linear-gradient(155deg, #f6ecd5, #fffcf4 70%, white); }
.keep-together { white-space: nowrap; }
.living-home .site-header .brand-accent { color: #37764a; }
.living-home .header-action[aria-current="location"] { text-decoration: underline; text-underline-offset: .2em; }
::view-transition { pointer-events: none; }
html:not([data-story-turn])::view-transition-old(root),
html:not([data-story-turn])::view-transition-new(root) { animation: none; }
@media (max-width: 380px) {
  .living-home .header-inner { gap: .28rem; }
  .living-home .site-header .brand { font-size: 1rem; }
  .living-home .site-header .brand-mark { width: 1.95rem; }
}
@media print {
  .living-home .schools .school-guide > a { display: none; }
}

/* The shelf reads like an illustrated spread, with room for the artwork and a short caption. */
.living-home .stories {
  padding-block: clamp(2.8rem, 5.4vw, 5.25rem);
  background: var(--stories-paper);
}
.shelf-heading {
  margin-bottom: clamp(1.15rem, 3.3vw, 2.65rem);
}
.shelf-heading .eyebrow { margin-bottom: .68rem; }
.shelf-heading .lead { max-width: 39ch; margin-top: .7rem; }
.chloe-flight {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: min(100%, 17.5rem);
  margin-block-end: .85rem;
}
.chloe-flight-art {
  position: relative;
  flex: 0 0 clamp(3.6rem, 6.4vw, 5rem);
  aspect-ratio: 1.08;
}
.chloe-thought {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: .42rem .65rem;
  border: 1px solid #c69a66;
  border-radius: .85rem .95rem .95rem .65rem;
  background: #fff8e8;
  color: #31523c;
  box-shadow: 0 .14rem 0 #ead9b57a;
  font-size: .88rem;
  line-height: 1.26;
}
.chloe-thought::before, .chloe-thought::after {
  content: "";
  position: absolute;
  border: 1px solid #c69a66;
  border-radius: 50%; background: inherit;
}
.chloe-thought::before { left: calc(100% - .03rem); bottom: .72rem; width: .43rem; height: .43rem; }
.chloe-thought::after { left: calc(100% + .38rem); bottom: .59rem; width: .23rem; height: .23rem; }
.opening-book-link { font-size: .95rem; color: #35664a; }
.chloe-flight svg { position: absolute; inset: 25% 0 0; width: 100%; height: 75%; }
.chloe-flight path {
  fill: none; stroke: #a67430; stroke-width: 2; stroke-dasharray: 4 7;
  stroke-linecap: round; vector-effect: non-scaling-stroke;
}
.chloe-flight img {
  position: absolute; right: 0; top: 0; width: 86%; height: auto;
  filter: drop-shadow(0 .28rem .2rem #57380e30);
}
.living-home .story-grid { gap: clamp(1.15rem, 3vw, 2.2rem) clamp(1.15rem, 3vw, 2.55rem); }
.living-home .story {
  border: 1px solid #d8c9a9;
  border-radius: .5rem 1.5rem 1.15rem .55rem;
  padding: clamp(.55rem, 1.12vw, .83rem);
  background: #fffdf4;
  box-shadow: .18rem .25rem 0 #dacdaf;
}
.living-home :is(.story > img, .story-cover-link > img) { display: block; width: 100%; border-radius: .3rem 1rem .55rem .3rem; }
.story-copy { padding: .68rem .24rem 0; }
.living-home .story-copy > :is(h3, p) { margin: 0; }
.living-home .story-copy .story-topic { font-size: .77rem; line-height: 1.25; letter-spacing: .035em; color: #436049; }
.living-home .story-copy h3 { margin-block: .2rem .24rem; font-size: clamp(1.4rem, 2.4vw, 1.95rem); line-height: 1.12; }
.living-home .story-copy > p:not(.story-topic) { margin-block: .27rem; line-height: 1.42; }
.living-home .story-copy .story-edition { font-size: .85rem; }
.living-home .story-copy .story-read { min-height: 44px; margin: .35rem 0 .15rem; }
.living-home .story-copy details { margin-top: .35rem; }
.living-home .story-copy details > summary { min-height: 44px; font-size: .9rem; }
.living-home .story-copy details > p { margin-bottom: .4rem; line-height: 1.48; }
.shelf-interlude {
  display: grid; grid-template-columns: minmax(3.2rem, .4fr) minmax(0, 1fr);
  align-items: center; gap: clamp(.6rem, 3vw, 2.15rem); align-self: stretch;
  padding: clamp(.8rem, 3.5vw, 2.35rem); border-radius: .65rem 1.65rem .65rem 1.65rem;
  background: radial-gradient(ellipse at 18% 50%, #f6e4a5, transparent 64%), #e7eddc;
  color: var(--deep);
}
.shelf-interlude h3 { font-size: clamp(1.55rem, 3.25vw, 2.8rem); line-height: 1.05; }
.shelf-interlude p { margin-top: .55rem; }
.sparky-art { position: relative; isolation: isolate; }
.sparky-art img { max-width: 13rem; max-height: 15rem; margin-inline: auto; object-fit: contain; height: auto; }
.living-home .about .founder-image {
  padding: clamp(.32rem, .75vw, .65rem);
  background: #f6e8c2;
  border-radius: 1.15rem 2.7rem 1.15rem 2.7rem;
}
.living-home .founder-image::before { display: none; }
.living-home .founder-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: .8rem 2.15rem .8rem 2.15rem;
}
.living-home .book-section { background: #f7ecd3; }
.bookshop { max-width: 70rem; text-align: center; }
.bookshop-editions {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.1rem, 4vw, 3.3rem);
  margin: clamp(1.35rem, 3.5vw, 2.65rem) 0 .25rem; text-align: left;
}
.bookshop-edition { min-width: 0; }
.bookshop-edition h3 { margin-block: .6rem .2rem; font-size: clamp(1.5rem, 3vw, 2.35rem); }
.bookshop-edition p { max-width: 48ch; }
.bookshop-stage {
  aspect-ratio: 4 / 3; border-radius: 1rem 2.35rem 1rem 1rem; overflow: hidden;
  background: #f8ebd5;
}
.bookshop-stage img { width: 100%; height: 100%; object-fit: contain; }
.living-home .featured-photo img.book-scene-image {
  aspect-ratio: auto; object-fit: contain;
}
@media (min-width: 701px) {
  .shelf-interlude { grid-column: span 2; }
}
@media (max-width: 660px) {
  .bookshop-editions { grid-template-columns: minmax(0, 1fr); }
  .shelf-heading h2 { font-size: clamp(2.35rem, 9.6vw, 3.65rem); }
}
@media (prefers-reduced-motion: no-preference) {
  .chloe-flight img { animation: chloe-glide 1.65s ease-out both; animation-play-state: paused; }
  .chloe-flight.in-flight img { animation-play-state: running; }
}
@keyframes chloe-glide {
  0% { transform: translate(-38%, -62%) rotate(-9deg); }
  48% { transform: translate(-13%, -20%) rotate(8deg); }
  76% { transform: translate(1%, 9%) rotate(-4deg); }
  100% { transform: translate(0) rotate(0); }
}

.cast-lineup {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: clamp(.25rem, 1.2vw, .9rem);
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  padding: .2rem .3rem .5rem;
  pointer-events: none;
}
.cast-lineup svg {
  position: absolute;
  z-index: -1;
  inset: auto 0 0;
  width: 100%;
  height: 40%;
  overflow: visible;
}
.cast-lineup path {
  fill: none;
  stroke: #aa7a37;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 4 6;
  opacity: .72;
  vector-effect: non-scaling-stroke;
}
.cast-lineup img {
  display: block;
  width: var(--sticker-width, clamp(3rem, 8vw, 6.6rem));
  height: auto;
  max-width: 30vw;
  aspect-ratio: 240 / 264;
  object-fit: contain;
  filter: drop-shadow(0 .28rem .18rem #5a42182c);
}
.cast-lineup img:nth-of-type(2) { rotate: 2.5deg; }
.cast-lineup--shelf { --sticker-width: clamp(2.6rem, 6vw, 4.65rem); margin: .7rem 0 0; }
.cast-lineup--books { --sticker-width: clamp(3rem, 7vw, 5.65rem); margin-bottom: .35rem; }
.cast-divider {
  background: var(--paper);
}
.cast-divider .wrap { display: flex; justify-content: end; }
.cast-lineup--desert {
  --sticker-width: clamp(3.25rem, 8vw, 6.75rem);
  margin: 0 min(8vw, 7rem) 0 0;
}
.cast-lineup--desert img:last-of-type { width: calc(var(--sticker-width) * 1.28); }
.living-home .cast-divider + .book-section { padding-top: clamp(2rem, 4vw, 4.25rem); }
@media (max-width: 660px) {
  .cast-lineup--shelf { margin-top: .45rem; }
}
@media print {
  .cast-lineup, .cast-divider { display: none !important; }
}

.cast-lineup--questions {
  --sticker-width: clamp(3rem, 7vw, 6.5rem);
  margin: .85rem 0 0;
}
.cast-lineup--footer { --sticker-width: clamp(2.45rem, 4vw, 3.65rem); margin: .45rem auto 0 0; }
.cast-lineup--footer path { stroke: #9e793f; }
@media (max-width: 600px) {
  }

/* Knotted cords follow the paper edge between chapters. */
.rope-divider {
  --rope-above: var(--paper);
  --rope-below: var(--paper);
  --rope-depth: clamp(1.8rem, 3.5vw, 3.25rem);
  --reader-seat: 29%;
  --reader-bottom: calc(var(--rope-depth) * .46);
  position: relative;
  height: clamp(3.85rem, 5.9vw, 5.6rem);
  isolation: isolate;
  background: var(--rope-above);
  pointer-events: none;
}
.rope-span { position: absolute; inset: auto 0 0; width: 100%; height: var(--rope-depth); display: block; overflow: hidden; }
.rope-paper { fill: var(--rope-below); stroke: none; }
.rope-strand { fill: none; }
.rope-divider .rope-span { stroke: #88623d; stroke-width: 7.2px; }
.rope-track { stroke: inherit; stroke-width: inherit; }
.rope-strand--twine { stroke: #d6ad70; stroke-width: 5.2px; }
.rope-strand--stitch { stroke: #fff0c6; stroke-width: 1.55px; stroke-dasharray: 2.4 3.6; stroke-linecap: round; }
.rope-knot {
  position: absolute; z-index: 1; left: 50%; bottom: 0;
  width: clamp(2rem, 3.6vw, 3.2rem); height: var(--rope-depth); translate: -50%;
  overflow: visible;
}
.rope-divider > .rope-knot {
  bottom: calc(var(--knot-rope-bottom, var(--reader-bottom)) - 17px);
  height: 34px;
}
.rope-divider--program { --rope-above: #fffaf0; --rope-below: var(--trail-paper); }
.rope-divider--stories { --rope-above: var(--trail-paper); --rope-below: var(--stories-paper); --reader-seat: 19%; }
.rope-divider--activities { --rope-above: #fffaf0; }
.rope-divider--parents {
  --rope-above: var(--rewards-paper);
  --rope-below: #f1edda;
  height: calc(var(--rope-depth) + clamp(.65rem, 1.2vw, 1.15rem));
}
.rope-divider--schools { --rope-above: #f1edda; --rope-below: #e7eee5; --reader-seat: 47%; }
.rope-divider--about { --rope-above: #e7eee5; }
.rope-divider--books { --rope-below: #f7ecd3; }
.rope-divider--questions { --rope-above: #f7ecd3; }
.rope-divider--footer { --rope-below: #f7ecd1; }
.rope-divider:is(.rope-divider--program, .rope-divider--parents, .rope-divider--about, .rope-divider--questions) .rope-span { transform: scaleX(-1); }
.rope-divider--perched { height: clamp(4.25rem, 6.4vw, 6rem); }
.rope-perch {
  position: absolute; z-index: 2; right: clamp(1.5rem, 18vw, 17rem);
  width: clamp(4.5rem, 8vw, 7.5rem); height: auto;
  bottom: calc(var(--perch-rope-bottom, var(--reader-bottom)) - var(--perch-seat-offset, 1.5rem));
  filter: drop-shadow(0 .15rem .15rem #6451302b);
}
.rope-perch--sparky { right: clamp(.85rem, 12vw, 12rem); }
.rope-perch--scrolly { right: auto; left: clamp(1.5rem, 22vw, 21rem); width: clamp(4rem, 7vw, 6.5rem); --perch-seat-offset: .9rem; }
.living-home .rope-divider + .section { padding-top: clamp(2.35rem, 4.6vw, 4.65rem); }
.living-home > .footer { border-top: 0; }
@media print { .rope-divider { display: none !important; } }

/* A short loop adds action to the rope without shifting its layout. */
.rope-camel, .rope-humpty {
  position: absolute;
  z-index: 2;
  bottom: calc(var(--rope-depth) * .46);
  display: block;
  height: auto;
  aspect-ratio: 1;
  transform: translateX(-50%);
}
.rope-camel { left: 48%; width: clamp(3.15rem, 6.7vw, 5.5rem); }
.rope-camel-gait {
  display: block;
  width: 100%;
  height: 100%;
  background: url("assets/storybook/camel-run.webp") left center / 400% 100% no-repeat;
  filter: drop-shadow(0 .1rem .1rem #65482b36);
}
.rope-humpty {
  left: var(--reader-seat);
  bottom: var(--reader-bottom);
  width: clamp(3.1rem, 5.7vw, 5.1rem);
}
.rope-humpty img {
  aspect-ratio: 1;
  transform: translateY(23%);
  transform-origin: 50% 77%;
  filter: drop-shadow(0 .14rem .12rem #65482b36);
}
.rope-divider--stories .rope-camel { left: 43%; }
.rope-divider--schools .rope-camel { left: 66%; }
.rope-divider--activities .rope-humpty { --tumble-beat: -1.4s; }
.rope-divider--schools .rope-humpty { --tumble-beat: -2.8s; }
.rope-divider--questions .rope-humpty { --tumble-beat: -4s; }
@media (prefers-reduced-motion: no-preference) {
  .rope-in-view .rope-camel-gait { animation: camel-hoofbeats .48s steps(4, end) infinite; }
  .rope-in-view .rope-humpty img { animation: humpty-tumble 12s var(--tumble-beat, 0s) ease-in-out infinite; }
}
@keyframes camel-hoofbeats { from { background-position-x: 0; } to { background-position-x: 133.333333%; } }
@keyframes humpty-tumble {
  0%, 53%, 98%, 100% { transform: translateY(23%) rotate(0); opacity: 1; }
  62% { transform: translateY(23%) rotate(-10deg); }
  67% { transform: translateY(29%) rotate(15deg); }
  74% { transform: translate(16%, 62%) rotate(78deg); opacity: 1; }
  79%, 84% { transform: translate(21%, 78%) rotate(100deg); opacity: 0; }
  85% { transform: translateY(64%) rotate(-7deg); opacity: 0; }
  94% { transform: translateY(18%) rotate(4deg); opacity: 1; }
}

/* Short lengths of cord finish the links, disclosures, and illustrated frames. */
.living-home {
  --thin-rope: url("assets/storybook/thin-rope.svg") repeat-x left bottom / .75rem .25rem;
}
.rope-rows {
  padding-top: .25rem;
  border-top: 0;
  background: var(--thin-rope);
  background-position: left top;
}
.living-home .rope-rows > :is(details, a) {
  border-bottom: 0;
  background: var(--thin-rope);
}
.living-home .rope-rows > a,
.rope-rows summary {
  min-height: 4.25rem;
  padding-block: .35rem .55rem;
}
.rope-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
}
.trail-next .rope-link {
  flex: 1 1 15.5rem;
  max-width: 21rem;
  min-height: 4.25rem;
  padding: .65rem .85rem;
  border-radius: .65rem 1.5rem .75rem .65rem;
  background: #fff9e9;
  text-decoration: none;
}
.trail-next .rope-link:hover { background: #f5edd7; }
.trail-next .rope-link:hover strong { text-decoration: underline; text-underline-offset: .18em; }
.trail-next .rope-link .rope-row-character { width: 3rem; height: 3rem; }
.trail-link-copy { display: grid; gap: .12rem; line-height: 1.32; }
.trail-link-copy small { color: #425a48; font-size: .875rem; font-weight: 500; }
.rope-row-character,
.living-home summary > img.rope-row-character {
  flex: none;
  width: 2.7rem;
  height: 2.7rem;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
}
.rope-link:hover .rope-row-character,
summary:is(:hover, :focus-visible) .rope-row-character,
details[open] > summary .rope-row-character {
  transform: rotate(-9deg);
}
.rope-heading {
  position: relative;
  width: fit-content;
  max-width: 100%;
  padding: 0 .6rem .4rem 0;
  background: var(--thin-rope);
}

/* A brief greeting when an illustrated character comes into view. */
@media screen and (prefers-reduced-motion: no-preference) {
  .character-seen {
    --character-hop: -4px;
    animation: character-greeting 1.15s var(--character-delay, 0s) ease-in-out;
    transform-origin: 50% 85%;
  }
  .cast-lineup img:nth-of-type(2) { --character-delay: .14s; }
  .cast-lineup img:nth-of-type(3) { --character-delay: .28s; }
  :is(.rope-perch, .rope-perch--scrolly img).character-seen { --character-hop: -2px; }
}
@keyframes character-greeting {
  0%, 100% { translate: 0 0; }
  42% { translate: 0 var(--character-hop); }
  68% { translate: 0 1px; }
}

/* Thoughts follow each Humpty, with a special scene above the books. */
.rope-divider { z-index: 1; }
.rope-divider--books { z-index: 2; scroll-margin-top: 8rem; }
.humpty-thought, .scrolly-thought {
  position: absolute;
  width: max-content;
  max-width: clamp(8rem, 23vw, 14rem);
  padding: .55rem .75rem;
  border: 1px solid #c69a66;
  border-radius: 1.25rem 1.35rem 1.25rem .9rem;
  background: #fff8e8;
  color: #31523c;
  box-shadow: 0 .2rem 0 #ead9b57a;
  font-size: clamp(.85rem, 1.3vw, 1.02rem);
  line-height: 1.25;
}
.humpty-thought { left: 78%; bottom: 77%; }
.scrolly-thought { right: -.24rem; bottom: 92%; max-width: min(48vw, clamp(7.7rem, 14vw, 11rem)); }
#scrolly-on-the-rope { scroll-margin-top: 8rem; }
:is(.humpty-thought, .scrolly-thought)::before,
:is(.humpty-thought, .scrolly-thought)::after {
  content: "";
  position: absolute; z-index: -1;
  border: 1px solid #c69a66;
  border-radius: 50%;
  background: inherit;
}
.humpty-thought::before { left: -.28rem; bottom: -.38rem; width: .56rem; height: .56rem; }
.humpty-thought::after { left: -.56rem; bottom: -.61rem; width: .29rem; height: .29rem; }
.scrolly-thought::before { right: 31%; bottom: -.38rem; width: .56rem; height: .56rem; }
.scrolly-thought::after { right: 29%; bottom: -.65rem; width: .29rem; height: .29rem; }
.rope-humpty .humpty-chloe {
  position: absolute; inset: 0 auto auto 0; height: auto;
  aspect-ratio: auto; opacity: 0;
  transform: translateY(12%);
}
@media (prefers-reduced-motion: no-preference) {
  .rope-in-view:not(.rope-divider--books) .humpty-thought {
    animation: humpty-reading-thought 12s var(--tumble-beat, 0s) ease-in-out infinite;
  }
  .rope-divider--books.rope-in-view .humpty-book-reader { animation: humpty-book-fall 8s ease-in-out forwards; }
  .rope-divider--books.rope-in-view .humpty-thought { animation: humpty-thought-away 8s ease-in-out forwards; }
  .rope-divider--books.rope-in-view .humpty-chloe { animation: chloe-takes-the-rope 8s ease-in-out forwards; }
}
@keyframes humpty-reading-thought {
  0%, 53%, 98%, 100% { opacity: 1; }
  62%, 94% { opacity: 0; }
}
@keyframes humpty-book-fall {
  0%, 55% { transform: translateY(23%) rotate(0); opacity: 1; }
  65% { transform: translate(4%, 28%) rotate(-10deg); opacity: 1; }
  72% { transform: translate(12%, 58%) rotate(38deg); opacity: 1; }
  80%, 100% { transform: translate(32%, 137%) rotate(105deg); opacity: 0; }
}
@keyframes humpty-thought-away {
  0%, 54% { opacity: 1; }
  62%, 100% { opacity: 0; }
}
@keyframes chloe-takes-the-rope {
  0%, 79% { transform: translate(-30%, 135%) rotate(-24deg); opacity: 0; }
  84% { transform: translate(-20%, 78%) rotate(-19deg); opacity: 1; }
  93% { transform: translate(4%, 0) rotate(9deg); opacity: 1; }
  97% { transform: translateY(16%) rotate(-5deg); opacity: 1; }
  100% { transform: translateY(12%) rotate(0); opacity: 1; }
}

.rope-ghaf {
  --tree-width: clamp(5.15rem, 10vw, 9.15rem);
  position: absolute;
  left: var(--reader-seat);
  bottom: calc(var(--reader-bottom) - .15rem);
  z-index: 1;
  width: var(--tree-width);
  translate: -68%;
}
.desert-ghaf {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 46% 94%;
}
.ghaf-leaf {
  position: absolute;
  top: var(--leaf-top, 25%);
  left: var(--leaf-left, 61%);
  width: clamp(7px, .8vw, 12px);
  aspect-ratio: 1.45;
  border-radius: 68% 30% 60% 39%;
  background: var(--leaf-color, #be8960);
  opacity: 0;
}
.ghaf-leaf:nth-of-type(2) {
  --leaf-top: 36%;
  --leaf-left: 73%;
  --leaf-color: #deaa64;
  --leaf-drift: .23;
  --leaf-drop: .48;
  --leaf-delay: 1.65s;
}
.ghaf-leaf:nth-of-type(3) {
  --leaf-top: 29%;
  --leaf-left: 43%;
  --leaf-color: #b8a362;
  --leaf-drift: .38;
  --leaf-drop: .51;
  --leaf-delay: 2.8s;
}
@media screen and (prefers-reduced-motion: no-preference) {
  .rope-in-view .desert-ghaf { animation: ghaf-sway 7.2s ease-in-out infinite; }
  .rope-in-view .ghaf-leaf { animation: ghaf-leaf-fall 7.8s var(--leaf-delay, .35s) ease-in-out infinite; }
  .rope-in-view.petal-path-ready .ghaf-leaf:nth-of-type(1) {
    animation: ghaf-petal-brush 12s linear infinite;
  }
  .rope-in-view.petal-path-ready:not(.rope-divider--books) .humpty-thought {
    animation: ghaf-thought-dissolve 12s linear infinite;
  }
  .rope-divider--books.rope-in-view.petal-path-ready .humpty-thought {
    animation: humpty-thought-away 8s ease-in-out forwards, ghaf-thought-dissolve 12s linear;
  }
}
@keyframes ghaf-sway {
  0%, 100% { rotate: 0deg; }
  30% { rotate: 2.5deg; }
  68% { rotate: -1.5deg; }
}
@keyframes ghaf-leaf-fall {
  0% { opacity: 0; transform: rotate(-24deg); }
  15% { opacity: .84; }
  33% { transform: translate(calc(var(--tree-width) * .18), calc(var(--tree-width) * .17)) rotate(52deg); }
  51% { transform: translate(calc(var(--tree-width) * .13), calc(var(--tree-width) * .36)) rotate(104deg); }
  65% { opacity: .75; }
  80%, 100% {
    opacity: 0;
    transform: translate(calc(var(--tree-width) * var(--leaf-drift, .31)), calc(var(--tree-width) * var(--leaf-drop, .59))) rotate(158deg);
  }
}
@keyframes ghaf-petal-brush {
  0%, 11% { opacity: 0; transform: rotate(-25deg); }
  17% { opacity: .96; }
  22% {
    transform: translate(calc(var(--petal-touch-x) * .48), calc(var(--petal-touch-y) - 9px)) rotate(38deg);
  }
  34% {
    opacity: 1;
    transform: translate(var(--petal-touch-x), var(--petal-touch-y)) rotate(105deg);
  }
  47% {
    opacity: .9;
    transform: translate(calc(var(--petal-touch-x) + 24px), calc(var(--petal-ground-y) * .62)) rotate(158deg);
  }
  59%, 100% {
    opacity: 0;
    transform: translate(calc(var(--petal-touch-x) + 13px), var(--petal-ground-y)) rotate(230deg);
  }
}
@keyframes ghaf-thought-dissolve {
  0%, 34%, 92%, 100% { filter: opacity(1) blur(0); }
  39%, 83% { filter: opacity(0) blur(.18rem); }
}
.rope-row-humpty {
  position: relative;
  display: grid;
  isolation: isolate;
}
.rope-row-ghaf {
  position: absolute;
  z-index: -1;
  bottom: .15rem;
  right: .45rem;
  width: 2.7rem;
  max-width: none;
  height: auto;
}
.footer-desert { display: flex; align-items: end; gap: .35rem; margin-top: .25rem; }
.footer-desert .cast-lineup { margin: 0; }
.desert-palms { width: clamp(3rem, 6.5vw, 5.5rem); }
@media print { .desert-ghaf, .footer-desert { display: none; } }

.living-home .rewards-journey {
  padding-block: 0 clamp(2.1rem, 6vw, 5rem);
  background:
    linear-gradient(to bottom, var(--rewards-paper) 175px, transparent 285px, transparent 65%, var(--rewards-paper)),
    radial-gradient(ellipse at 78% 26%, #f4e8c7, transparent 68%),
    var(--rewards-paper);
}
.rewards-rope {
  --chase-duration: 14.4s;
  position: relative;
  background: var(--paper);
  height: clamp(9.25rem, 14vw, 12rem);
  margin-bottom: clamp(1rem, 2.8vw, 2.45rem);
}
.rewards-rope-line {
  position: absolute;
  inset: auto 0 0;
  width: 100%;
  height: 2.35rem;
  overflow: hidden;
}
.rewards-rope-paper { fill: var(--rewards-paper); }
.rewards-chloe {
  position: absolute;
  z-index: 5;
  bottom: .85rem;
  left: clamp(2.1rem, 11%, 10rem);
  width: clamp(3.4rem, 6vw, 5.3rem);
  translate: -50% 0;
}
.rewards-chloe img { filter: drop-shadow(0 .14rem .13rem #65482b36); }
.rewards-chloe-blink {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}
@media screen and (prefers-reduced-motion: no-preference) {
  .rewards-rope:has(.rewards-chase.character-seen) .rewards-chloe-blink {
    animation: rewards-chloe-blink 5.4s steps(1, end) 5;
  }
}
@keyframes rewards-chloe-blink {
  0%, 31%, 78%, 100% { opacity: 0; }
  28%, 76% { opacity: 1; }
}
.rewards-cheer {
  position: absolute;
  left: 105%;
  bottom: 64%;
  width: max-content;
  max-width: min(58vw, 17.5rem);
  margin: 0;
  padding: .56rem .8rem;
  border: 1px solid #c69a66;
  border-radius: 1.2rem 1.35rem 1.15rem .6rem;
  background: #fff8e8;
  color: #31523c;
  box-shadow: 0 .2rem 0 #ead9b57a;
  font-size: clamp(.9rem, 1.3vw, 1.07rem);
  line-height: 1.25;
}
.rewards-cheer::before {
  content: "";
  position: absolute;
  left: -.47rem;
  bottom: .43rem;
  width: .72rem;
  aspect-ratio: 1;
  border: solid #c69a66;
  border-width: 0 0 1px 1px;
  background: inherit;
  rotate: 45deg;
}
.rewards-cheer strong { color: #8d502a; }
.rewards-layout {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(1.35rem, 5vw, 4.5rem);
}
.rewards-copy h2 em { color: #8d502a; }
.rewards-copy .lead { max-width: 36ch; margin-top: .85rem; }
.rewards-steps {
  list-style: none;
  counter-reset: reward-step;
  display: grid;
  gap: .7rem;
  padding: 0;
  margin: 1.15rem 0;
}
.rewards-steps li {
  counter-increment: reward-step;
  position: relative;
  margin: 0;
  padding-inline-start: 2.5rem;
}
.rewards-steps li::before {
  content: counter(reward-step);
  display: grid;
  place-items: center;
  position: absolute;
  inset: .05rem auto auto 0;
  width: 1.8rem;
  height: 1.8rem;
  border: 1px dashed #8d643c;
  border-radius: 50%;
  background: #f3e2af;
  color: #614324;
  font-size: .95rem;
}
.rewards-note { color: #486152; font-size: .95rem; }
.rewards-illustration {
  margin: 0;
  padding: .4rem;
  border-radius: .7rem 2.1rem .8rem 1.55rem;
  background: #fffdf5;
}
.rewards-illustration img { height: auto; border-radius: inherit; }
.rewards-passport {
  display: grid;
  gap: .95rem;
  margin-top: clamp(1.2rem, 3.5vw, 2.6rem);
  padding: clamp(.95rem, 2.2vw, 1.6rem);
  border-radius: 1.35rem .7rem 1.7rem .75rem;
  background: #fffae9;
}
.rewards-passport h3 { font-size: clamp(1.3rem, 2.5vw, 1.9rem); }
.rewards-passport p { margin-top: .27rem; }
.rewards-stamps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(7.1rem, 100%), 1fr));
  gap: .85rem .45rem;
  align-items: start;
  list-style: none;
  padding: 0;
  margin: .1rem 0;
}
.rewards-stamps li {
  --stamp-paper: #f8eccc;
  --stamp-ink: #785029;
  display: grid;
  justify-items: center;
  gap: .45rem;
  margin: 0;
  color: #38513e;
  font-size: .93rem;
  line-height: 1.2;
  text-align: center;
}
.rewards-stamps li:nth-child(3n + 2) { --stamp-paper: #e8efda; --stamp-ink: #526b40; }
.rewards-stamps li:nth-child(3n) { --stamp-paper: #f7e2d4; --stamp-ink: #8c4f3b; }
.rewards-stamp-mark {
  display: grid;
  place-items: center;
  width: clamp(2.85rem, 6.1vw, 4.25rem);
  aspect-ratio: 1;
  border: 2px dashed var(--stamp-ink);
  border-radius: 50%;
  background: var(--stamp-paper);
  color: var(--stamp-ink);
}
.rewards-stamp-mark svg {
  width: 70%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rewards-passport .button { justify-self: start; }
#scrolly-on-the-rope.rope-in-view .scrolly-thought {
  animation: scrolly-thought-fade .45s 5.5s ease-in forwards;
}
@keyframes scrolly-thought-fade {
  to { opacity: 0; visibility: hidden; }
}
@media (max-width: 760px) {
  .rewards-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 660px) {
  .rope-divider { min-height: 6.65rem; }
  .rope-divider--perched { min-height: 7.05rem; }
  .rope-divider--program { min-height: 6.2rem; }
  .humpty-thought, .scrolly-thought, .chloe-thought {
    padding: .42rem .56rem;
    font-size: .88rem;
    line-height: 1.22;
    overflow-wrap: break-word;
  }
  .humpty-thought { max-width: min(51vw, 10rem); }
  .scrolly-thought,
  .rope-divider--schools .humpty-thought { max-width: min(42vw, 9rem); }
  .chloe-thought { max-width: min(28ch, 100%); }
}
@media (max-width: 480px) {
  .rewards-stamps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media screen {
  .rewards-cheer.character-seen {
    animation: rewards-cheer-dissolve .7s 7s ease-out forwards;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rewards-cheer.character-seen { animation-duration: .01s; animation-timing-function: step-end; }
}
@keyframes rewards-cheer-dissolve {
  to { opacity: 0; visibility: hidden; }
}

.living-home .character-shop {
  padding-block: clamp(2.25rem, 4.5vw, 4.5rem);
  background: #f7ecd3;
}
.shop-wrap { max-width: 72rem; }
.shop-feature {
  display: grid;
  grid-template-columns: minmax(0, .72fr) minmax(0, 1fr);
  gap: clamp(1.35rem, 4vw, 3.2rem);
  align-items: center;
  padding: clamp(1.1rem, 3.5vw, 2.7rem);
  background: linear-gradient(130deg, #fff9e9, #f4f3e4);
}
.living-home .shop-intro h2 {
  font-size: clamp(2.05rem, 4.25vw, 4rem);
  color: var(--deep);
}
.shop-lead {
  margin-block: .9rem 1.35rem;
  max-width: 33ch;
  font-size: clamp(1.08rem, 1.8vw, 1.4rem);
  line-height: 1.45;
}
.shop-preview { margin: 0; }
.shop-preview img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: .85rem 2.2rem .85rem .85rem;
  background: #f3e5cb;
}
.shop-preview figcaption {
  margin-top: .45rem;
  color: #654923;
  font-size: .95rem;
  text-align: center;
}
.shop-characters {
  margin-top: clamp(1.65rem, 4vw, 3rem);
  text-align: center;
}
.living-home .shop-characters h3 { font-size: clamp(1.55rem, 2.8vw, 2.45rem); }
.shop-cast {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(.65rem, 2vw, 1.25rem);
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.shop-cast li {
  display: grid;
  justify-items: center;
  align-content: start;
  padding: .45rem .45rem .8rem;
  border: 1px solid #dac8a3;
  border-radius: .8rem 1.45rem .8rem .8rem;
  background: #fffbf1;
}
.shop-cast img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: .52rem 1.13rem .52rem .52rem;
  background: #f5eddf;
  margin-bottom: .7rem;
}
.shop-cast strong { color: var(--deep); font-size: clamp(1.02rem, 1.65vw, 1.27rem); line-height: 1.15; }
.shop-cast span { margin-top: .22rem; color: #3c5846; font-size: .92rem; line-height: 1.25; }
@media (max-width: 760px) {
  .shop-feature { grid-template-columns: minmax(0, 1fr); }
  .shop-intro { text-align: center; }
  .shop-lead { margin-inline: auto; }
  .shop-cast { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 440px) {
  .shop-cast { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.rewards-chase {
  --chase-hole-x: 89%;
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.rewards-chase-scene {
  position: absolute;
  inset: 0;
  isolation: isolate;
}
.rewards-chase-hole {
  position: absolute;
  z-index: 2;
  bottom: 1.05rem;
  left: var(--chase-hole-x);
  translate: -50%;
  width: clamp(2.2rem, 6vw, 4.1rem);
  aspect-ratio: .95;
  border: clamp(.24rem, .72vw, .53rem) solid #b78855;
  border-radius: 50% 45% 47% 44%;
  background: radial-gradient(ellipse at 65% 70%, #59412a, #312418 68%);
  box-shadow: inset .12rem .12rem .12rem #1c160d, 0 0 0 1px #825b38, 0 .17rem 0 #88603c;
}
.rewards-chase-runner {
  position: absolute;
  z-index: 3;
  bottom: .82rem;
  translate: -50%;
  width: clamp(2.8rem, 9vw, 6.8rem);
  transform-origin: 54% 83%;
}
.rewards-chase-walk {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: var(--walk-sheet) 100% 0 / 200% 200% no-repeat;
}
.rewards-chase-sparky { left: 34%; --walk-sheet: url("assets/storybook/chase-sparky-walk.webp"); }
.rewards-chase-scrolly { left: 67%; bottom: .62rem; width: clamp(2.45rem, 7.7vw, 5.75rem); --walk-sheet: url("assets/storybook/chase-scrolly-walk.webp"); }
.rewards-chase-dust {
  position: absolute;
  z-index: 4;
  bottom: .88rem;
  left: var(--chase-hole-x);
  width: clamp(.65rem, 1.8vw, 1.2rem);
  aspect-ratio: 1;
  background: #edcca0;
  border-radius: 50%;
  box-shadow: -.45rem .2rem 0 -.12rem #edcca0, .46rem .12rem 0 -.15rem #e4bb8a;
  opacity: 0;
  pointer-events: none;
}
.rewards-chase-thought {
  position: absolute;
  bottom: calc(100% + .25rem);
  left: 50%;
  translate: calc(-1 * var(--thought-tail)) 0;
  width: max-content;
  max-width: min(16rem, 47vw);
  margin: 0;
  padding: .4rem .7rem;
  border: 1px solid #b88d54;
  border-radius: .88rem 1.1rem .88rem .88rem;
  background: #fffaf0;
  color: #31523c;
  box-shadow: 0 .14rem 0 #dbc495;
  font-size: clamp(.9rem, 1.45vw, 1.1rem);
  line-height: 1.2;
}
.rewards-chase-thought--sparky { --thought-tail: 50%; }
.rewards-chase-thought--scrolly { --thought-tail: 79%; }
.rewards-chase-thought::after,
.rewards-chase-thought::before {
  content: "";
  position: absolute;
  left: var(--thought-tail);
  top: 100%;
  translate: -50% 0;
  width: .43rem;
  height: .43rem;
  border: 1px solid #b88d54;
  border-radius: 50%;
  background: inherit;
}
.rewards-chase-thought::after {
  margin: .49rem 0 0 .28rem;
  width: .25rem;
  height: .25rem;
}
.rewards-chase-untyped { visibility: hidden; }
.rewards-chase-speaker {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.rewards-chase-replay {
  display: none;
  position: absolute;
  top: 0;
  right: clamp(.7rem, 2.4vw, 2rem);
  pointer-events: auto;
  border: 1px solid #d8c5a0;
  border-radius: 100px;
  padding: .35rem .7rem;
  color: var(--deep);
  background: #fffaf0;
  font: inherit;
  font-size: .86rem;
  cursor: pointer;
}
@media screen and (prefers-reduced-motion: no-preference) {
  .rewards-chase-replay:not([hidden]) { display: block; }
  .rewards-chase-sparky { left: 24%; }
  .rewards-chase-scrolly { left: 40%; }
  .rewards-chase-thought { opacity: 0; }
  .rewards-chase.character-seen .rewards-chase-thought--sparky { animation: sparky-thought var(--chase-duration) linear both; }
  .rewards-chase.character-seen .rewards-chase-thought--scrolly { animation: scrolly-thought var(--chase-duration) linear both; }
  .rewards-chase.character-seen .rewards-chase-sparky { animation: rewards-sparky-chase var(--chase-duration) linear both; }
  .rewards-chase.character-seen .rewards-chase-scrolly { animation: rewards-scrolly-chase var(--chase-duration) linear both; }
  .rewards-chase.character-seen .rewards-chase-walk { animation: rewards-walk-cycle .96s steps(1, end) 13; }
  .rewards-chase.character-seen .rewards-chase-dust { animation: rewards-chase-dust .65s 12.8s ease-out both; }
  .rewards-rope:has(.rewards-chase.character-seen) .rewards-cheer {
    animation: rewards-cheer-arrive .28s var(--chase-duration) both,
      rewards-cheer-dissolve .7s calc(var(--chase-duration) + 7s) ease-out forwards;
  }
}
@keyframes rewards-cheer-arrive { from { opacity: 0; } to { opacity: 1; } }
@keyframes sparky-thought {
  0%, 7%, 47%, 100% { opacity: 0; }
  11%, 43% { opacity: 1; }
}
@keyframes scrolly-thought {
  0%, 48%, 87%, 100% { opacity: 0; }
  52%, 82% { opacity: 1; }
}
@keyframes rewards-walk-cycle {
  0%, 100% { background-position: 0 0; }
  25% { background-position: 100% 0; }
  50% { background-position: 0 100%; }
  75% { background-position: 100% 100%; }
}
@keyframes rewards-sparky-chase {
  0%, 7% { left: 24%; }
  45% { left: 45%; }
  83% { left: 67%; transform: none; }
  91% { left: 76%; transform: rotate(10deg); }
  98%, 100% { left: 76%; transform: rotate(-5deg); }
}
@keyframes rewards-scrolly-chase {
  0%, 5% { left: 40%; }
  46% { left: 58%; }
  78% { left: 77%; transform: translateY(0); }
  86% { left: 85%; opacity: 1; transform: translateY(-.34rem) rotate(18deg); }
  92%, 100% {
    left: var(--chase-hole-x);
    opacity: 0;
    transform: translateY(-.22rem) rotate(30deg) scale(.22);
  }
}
@keyframes rewards-chase-dust {
  0% { opacity: 0; transform: scale(.35); }
  25% { opacity: .9; }
  100% { opacity: 0; transform: translate(-.65rem, -.83rem) scale(1.25); }
}
@media (max-width: 540px) {
  .rewards-rope { height: 9.1rem; }
  .rewards-cheer { bottom: 108%; }
  .rewards-chase-thought { max-width: min(10rem, 45vw); }
  .rewards-chase-replay { top: .25rem; right: .7rem; }
}
@media screen and (prefers-reduced-motion: reduce) {
  .rewards-rope { height: clamp(12rem, 15vw, 14rem); }
  .rewards-cheer { bottom: 10rem; }
  .rewards-chase-thought { max-width: min(16rem, 41vw); }
  .rewards-chase-sparky { left: 27%; }
  .rewards-chase-scrolly { left: 74%; }
  .rewards-chase-thought--scrolly { --thought-tail: 50%; }
}
@media print { .rewards-chase { display: none; } }

.school-video { min-width: 0; margin: 0; }
.school-video-player {
  position: relative;
  background: #25372a;
  border-radius: .7rem 1.55rem .7rem .7rem;
  overflow: hidden;
}
.school-video-player video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1138 / 640;
}
.school-video-play:not([hidden]) {
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem 1.05rem;
  border: 1px solid #f5e3b9;
  border-radius: 100px;
  background: #173e2b;
  color: white;
  box-shadow: 0 .35rem 1rem #132e2670;
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}
.school-video-play:hover { background: #2a6041; }
.school-video-play:focus-visible { outline: 3px solid white; outline-offset: 3px; }
.school-video figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  margin-top: .45rem;
  color: var(--deep);
}
.school-video figcaption span {
  padding: .08rem .53rem;
  border-radius: 100px;
  background: #ede0b9;
  font-variant-numeric: tabular-nums;
}
.book-talk { gap: clamp(.65rem, 2.5vw, 1.75rem); }
.book-talk-speaker {
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  align-self: stretch;
  width: min(15rem, 41vw);
}
.book-talk-bubble {
  position: relative;
  align-self: end;
  width: 100%;
  margin: 0 0 .75rem;
  padding: .45rem .65rem;
  border: 1px solid #b88d54;
  border-radius: 1.05rem 1.15rem .9rem .9rem;
  background: #fffaf0;
  color: #31523c;
  box-shadow: 0 .14rem 0 #dbc495;
  font-size: clamp(.9rem, 1.6vw, 1.12rem);
  line-height: 1.22;
  text-align: left;
}
.book-talk-bubble::before,
.book-talk-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 49%;
  width: .43rem;
  height: .43rem;
  border: 1px solid #b88d54;
  border-radius: 50%;
  background: inherit;
}
.book-talk-bubble::after {
  margin: .45rem 0 0 .26rem;
  width: .24rem;
  height: .24rem;
}
@media screen and (prefers-reduced-motion: no-preference) {
  .book-talk-bubble { opacity: 0; }
  .book-talk-in-view .book-talk-bubble { animation: book-reader-talk 12s ease-in-out infinite; }
  .book-talk-in-view .book-talk-speaker + .book-talk-speaker .book-talk-bubble { animation-delay: 5.3s; }
}
@keyframes book-reader-talk {
  0%, 43%, 100% { opacity: 0; }
  5%, 37% { opacity: 1; }
}

.story-quiz-actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.rewards-quiz-journal {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem 1rem;
  margin-top: clamp(1.2rem, 3vw, 2.2rem);
  padding: clamp(.75rem, 2.4vw, 1.5rem);
  border-radius: .9rem 2.2rem .9rem .9rem;
  background: linear-gradient(125deg, #fbf4dc, #eaf0e1);
  scroll-margin-top: 1.2rem;
}
.living-home .rewards-quiz-journal h3 { font-size: clamp(1.18rem, 2.7vw, 1.85rem); }
.rewards-quiz-journal p { margin-top: .22rem; }
.rewards-quiz-mark {
  display: grid;
  place-items: center;
  width: clamp(2.65rem, 6.3vw, 4rem);
  aspect-ratio: 1;
  border: 2px dashed #9b723e;
  border-radius: 50%;
  background: #f3ead0;
  color: #896331;
  font-size: clamp(1.2rem, 3vw, 1.9rem);
}
.rewards-quiz-journal.is-stamped .rewards-quiz-mark {
  border: 3px double #745527;
  background: #f2ce71;
  color: #614312;
}
@media (max-width: 550px) {
  .rewards-quiz-journal { grid-template-columns: auto minmax(0, 1fr); }
  .rewards-quiz-journal .button { grid-column: 2; justify-self: start; }
}
