/* Bookworm School — official site. Style "一天": the page scrolls from a summer morning to a starry night,
   drawn in a Japanese-anime look with original art only (never copyrighted characters).
   Shared by all languages (site/<lang>/), built by tools/site_build.py.
   Each page defines its own CJK serif ("BW Serif"), --serif and --sans in a small <style> block. */
@font-face { font-family: "Newsreader"; src: url("assets/fonts/newsreader-300.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("assets/fonts/newsreader-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("assets/fonts/newsreader-300-italic.woff2") format("woff2"); font-weight: 300; font-style: italic; font-display: swap; }

:root {
  --navy: #173A5E;
  --navy-soft: #4D6680;
  --navy-faint: #8597AA;
  --sky-deep: #2468C7;
  --sky: #4E9BE3;
  --sky-pale: #EAF4FC;
  --sun: #F6C25B;
  --night: #13213F;
  --star: #FFF3CF;
  --line: #D8E3EE;
  --gutter: clamp(20px, 5vw, 64px);
  --max: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: #F6F9FB; color: var(--navy); font-family: var(--sans); font-size: 17px; line-height: 1.85; letter-spacing: .01em; -webkit-font-smoothing: antialiased; }
html[lang="en"] body { line-height: 1.7; letter-spacing: 0; }
html[lang="ko"] body { word-break: keep-all; overflow-wrap: anywhere; }
html[lang="ja"] body { word-break: auto-phrase; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--sky-deep); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(246, 249, 251, .88); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 28px; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand svg { width: 34px; height: 34px; }
.brand b { font-family: "Newsreader", serif; font-weight: 400; font-size: 22px; letter-spacing: -.01em; white-space: nowrap; }
.nav { display: flex; gap: 26px; font-size: 15px; }
.nav a { text-decoration: none; color: var(--navy-soft); }
.nav a:hover { color: var(--navy); }
/* home page: the menu floats over the morning sky, then becomes a frosted white bar once the sky has scrolled away */
html { scroll-padding-top: 80px; }
.home .top { position: fixed; left: 0; right: 0; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 1px solid transparent; transition: background .35s, border-color .35s, box-shadow .35s; }
.home .top .brand b, .home .top .nav a, .home .top .langs summary { color: #fff; text-shadow: 0 1px 8px rgba(23, 58, 94, .35); transition: color .35s; }
.home .top .nav a:hover { opacity: .8; }
.home .top .langs summary { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .5); }
.home .top.solid { background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px); border-bottom-color: rgba(216, 227, 238, .9); box-shadow: 0 6px 24px rgba(23, 58, 94, .06); }
.home .top.solid .brand b, .home .top.solid .nav a, .home .top.solid .langs summary { color: var(--navy); text-shadow: none; }
.home .top.solid .nav a { color: var(--navy-soft); }
.home .top.solid .nav a:hover { color: var(--navy); opacity: 1; }
.home .top.solid .langs summary { background: #fff; border-color: var(--line); }
@media (max-width: 860px) { .nav { display: none; } .top .wrap { gap: 14px; height: 64px; } }

.langs { position: relative; font-size: 14px; }
.langs summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; color: var(--navy); background: #fff; white-space: nowrap; }
.langs summary::-webkit-details-marker { display: none; }
.langs summary svg { width: 16px; height: 16px; }
.langs summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); margin-left: 2px; }
.langs ul { position: absolute; right: 0; top: calc(100% + 8px); list-style: none; margin: 0; padding: 8px; min-width: 168px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 36px rgba(23, 58, 94, .16); }
.langs li a { display: block; padding: 9px 14px; border-radius: 9px; text-decoration: none; color: var(--navy-soft); text-shadow: none; }
.langs li a:hover { background: var(--sky-pale); color: var(--navy); }
.langs li a[aria-current="true"] { color: var(--navy); font-weight: 500; }
.langs li a[aria-current="true"]::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--sky); margin-left: 10px; vertical-align: middle; }
@media (max-width: 420px) {
  .brand { gap: 8px; } .brand svg { width: 30px; height: 30px; } .brand b { font-size: 19px; }
  .langs summary { padding: 6px 10px; gap: 6px; font-size: 13px; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 28px; border-radius: 999px; font: inherit; font-size: 16px; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: background .2s, color .2s; }
.btn.white { background: #fff; color: var(--navy); font-weight: 500; box-shadow: 0 10px 30px rgba(23, 58, 94, .18); }
.btn.white:hover { background: var(--sky-pale); }
.btn.clear { background: rgba(23, 58, 94, .32); border-color: rgba(255, 255, 255, .7); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.btn.clear:hover { background: rgba(23, 58, 94, .45); }
.btn.star { background: var(--star); color: var(--night); font-weight: 500; box-shadow: 0 0 40px rgba(255, 243, 207, .35); }
.btn.star:hover { background: #fff; }
.btn[aria-disabled="true"] { cursor: default; background: #fff; color: var(--navy-faint); border-color: var(--line); }
.btn small { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: #FFE9A8; color: var(--navy); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- shared section type ---------- */
section.block { position: relative; padding: clamp(84px, 11vw, 140px) 0; }
.head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px clamp(32px, 6vw, 96px); align-items: end; margin-bottom: clamp(44px, 6vw, 76px); }
.head h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 4.1vw, 50px); line-height: 1.32; letter-spacing: .04em; text-wrap: balance; }
html[lang="en"] .head h2, html[lang="ko"] .head h2 { letter-spacing: -.005em; line-height: 1.2; }
.head p { margin: 0; color: var(--navy-soft); max-width: 32em; }
.time { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font-family: "Newsreader", serif; font-style: italic; font-weight: 300; font-size: 19px; color: var(--sky-deep); }
.time svg { width: 22px; height: 22px; flex: none; }
@media (max-width: 760px) { .head { grid-template-columns: 1fr; } }

/* ---------- 1. summer morning (hero) ---------- */
.morning { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; color: #fff; background: var(--sky-deep); }
.morning .bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.morning .wrap { position: relative; z-index: 2; padding-top: clamp(120px, 18vh, 190px); padding-bottom: 60px; }
.morning .eyebrow { font-family: "Newsreader", serif; font-style: italic; font-weight: 300; font-size: 21px; margin: 0 0 18px; text-shadow: 0 1px 10px rgba(23, 58, 94, .35); }
.morning h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 5.4vw, 76px); line-height: 1.28; letter-spacing: .06em; text-shadow: 0 2px 22px rgba(23, 58, 94, .35); }
html[lang="en"] .morning h1 { letter-spacing: -.01em; line-height: 1.1; font-size: clamp(38px, 4.3vw, 60px); }
html[lang="ja"] .morning h1, html[lang="ko"] .morning h1 { letter-spacing: .02em; font-size: clamp(34px, 4.3vw, 60px); }
.morning h1 .line { display: block; }
.morning .wrap > * { max-width: 640px; }
@media (min-width: 861px) { html[lang^="zh"] .morning h1 .line { white-space: nowrap; } html[lang^="zh"] .morning .wrap > h1 { max-width: none; } }
.morning .sub { margin: 26px 0 0; max-width: 27em; font-size: clamp(16px, 1.35vw, 18px); line-height: 1.9; text-shadow: 0 1px 10px rgba(23, 58, 94, .45); }
html[lang="en"] .morning .sub { line-height: 1.7; }
.morning .actions { margin-top: 36px; }
.book { position: absolute; z-index: 3; pointer-events: none; right: max(2vw, calc(50% - 720px)); bottom: -2%; width: min(46vw, 640px); }
.book svg { width: 100%; height: auto; overflow: visible; }
.fly path { stroke: #8FB0D1; stroke-width: 1.5; stroke-linejoin: round; }
.fly { transform-box: fill-box; transform-origin: center; animation: fly 2.4s cubic-bezier(.2, .7, .2, 1) both; }
.fly.f2 { animation-delay: .25s; } .fly.f3 { animation-delay: .5s; } .fly.f4 { animation-delay: .75s; } .fly.f5 { animation-delay: 1s; }
@keyframes fly { from { opacity: 0; transform: translate(-40px, 140px) scale(.5) rotate(-20deg); } 30% { opacity: 1; } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fly { animation: none; } }
@media (max-width: 860px) {
  .morning { min-height: 0; padding-bottom: 92vw; }
  .morning .wrap { padding-top: 104px; padding-bottom: 0; }
  .poles { display: none; }
  .book { right: 50%; transform: translateX(50%); width: 104vw; bottom: -1%; }
}

/* ---------- 2. late morning: the idea ---------- */
.idea-sec { background: linear-gradient(180deg, #E4F2FB 0%, #F6F9FB 100%); overflow: hidden; }
.idea-sec .cloud-deco { position: absolute; top: 40px; right: -60px; width: 340px; }
.idea-sec .wrap { position: relative; }
.ideas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.idea { background: #fff; border-radius: 24px; padding: 30px 28px 32px; box-shadow: 0 1px 0 var(--line), 0 18px 40px rgba(36, 104, 199, .07); }
.idea .ic { width: 64px; height: 64px; margin-bottom: 20px; }
.idea h3 { margin: 0 0 10px; font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.45; }
.idea p { margin: 0; color: var(--navy-soft); font-size: 16px; }
@media (max-width: 860px) { .ideas { grid-template-columns: 1fr; } .idea-sec .cloud-deco { width: 200px; right: -70px; top: 20px; } }

/* ---------- 3. noon: one class ---------- */
.noon { background: #F6F9FB; }
.noon .time { color: #D9922E; }
.lesson { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(36px, 6vw, 88px); align-items: start; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 46px 1fr; gap: 4px 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(s); grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--sky-pale); color: var(--sky-deep); font-family: "Newsreader", serif; font-size: 18px; margin-top: 2px; }
.steps b { font-weight: 500; font-size: 17px; }
.steps span { color: var(--navy-soft); font-size: 15px; line-height: 1.7; }
.devices { position: sticky; top: 104px; margin: 0; }
.laptop { position: relative; }
.laptop .screen { background: #1E2A3A; border-radius: 18px 18px 6px 6px; padding: 14px 14px 18px; box-shadow: 0 30px 60px rgba(23, 58, 94, .18); }
.laptop .screen img { width: 100%; height: auto; border-radius: 6px; background: #fff; }
.laptop .base { height: 16px; margin: 0 -5%; border-radius: 0 0 18px 18px; background: linear-gradient(#D7DEE6, #B9C4D0); }
.phone { position: absolute; right: -3%; bottom: -14%; width: 27%; background: #1E2A3A; border-radius: 26px; padding: 7px; box-shadow: 0 24px 50px rgba(23, 58, 94, .28); }
.phone img { width: 100%; height: auto; border-radius: 20px; background: #fff; }
.devices figcaption { margin-top: clamp(48px, 9vw, 96px); font-size: 13px; color: var(--navy-faint); line-height: 1.6; max-width: 30em; }
@media (max-width: 860px) { .lesson { grid-template-columns: 1fr; } .devices { position: static; } .phone { right: -1%; } }

/* ---------- 4. afternoon: levels on a wooden shelf ---------- */
.afternoon { background: linear-gradient(180deg, #F6F9FB 0%, #FFF4E0 100%); }
.afternoon .time { color: #D9822E; }
.shelf { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: end; padding: 0 14px; }
.spine { position: relative; border-radius: 8px 8px 2px 2px; color: #fff; padding: 18px 14px 16px; display: flex; flex-direction: column; text-decoration: none; box-shadow: inset -10px 0 0 rgba(0, 0, 0, .08), inset 0 -3px 0 rgba(0, 0, 0, .12); }
.spine::before, .spine::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: rgba(255, 236, 180, .75); }
.spine::before { top: 26%; } .spine::after { top: calc(26% + 7px); }
.spine .lv { font-family: "Newsreader", serif; font-size: 32px; line-height: 1; font-weight: 300; }
.spine .cefr { font-size: 12.5px; opacity: .9; margin-top: 8px; }
.spine .meta { margin-top: auto; font-size: 13px; line-height: 1.6; opacity: .95; }
.spine .state { display: inline-block; margin-top: 12px; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, .22); align-self: flex-start; }
.spine.open .state { background: #FFE9A8; color: var(--navy); }
.spine.open:hover { filter: brightness(1.06); }
.s1 { height: 300px; background: #5FAE6B; } .s2 { height: 330px; background: #3E9E9A; } .s3 { height: 360px; background: #3D86C8; }
.s4 { height: 390px; background: #4E68B8; } .s5 { height: 420px; background: #6F5FA0; } .s6 { height: 450px; background: #8A4F86; }
.plank { height: 22px; border-radius: 4px; background: linear-gradient(#C99A62, #A97A44); box-shadow: 0 14px 24px rgba(120, 80, 30, .22); }
.shelf-note { margin: 26px 0 0; color: var(--navy-soft); font-size: 15px; max-width: 46em; }
@media (max-width: 860px) {
  .shelf { grid-template-columns: 1fr; gap: 8px; padding: 0; }
  .spine { height: auto !important; border-radius: 10px; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 18px; }
  .spine::before, .spine::after { display: none; }
  .spine .meta { margin: 0; width: 100%; } .spine .state { margin: 0; }
  .plank { display: none; }
}

/* placement test, still afternoon */
section.block.test-sec { background: #FFF4E0; padding-top: 0; }
.test { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(36px, 6vw, 88px); align-items: center; background: #fff; border-radius: 32px; padding: clamp(28px, 5vw, 64px); box-shadow: 0 24px 60px rgba(160, 110, 40, .1); }
.test .head { grid-template-columns: 1fr; margin-bottom: 0; }
.test .head h2 { font-size: clamp(28px, 3.2vw, 40px); }
.test-kinds { list-style: none; padding: 0; margin: 28px 0 34px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.test-kinds li { padding-left: 20px; position: relative; color: var(--navy-soft); font-size: 16px; }
.test-kinds li::before { content: ""; position: absolute; left: 0; top: .7em; width: 9px; height: 9px; border-radius: 50%; background: var(--sun); }
.test-card { background: var(--sky-pale); border-radius: 22px; padding: clamp(22px, 3.4vw, 36px); }
.test-card .q { font-family: "Newsreader", serif; font-size: 26px; font-weight: 300; margin: 0 0 20px; }
.pics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pics div { aspect-ratio: 1; border-radius: 14px; background: #fff; display: grid; place-items: center; border: 2px solid transparent; }
.pics div.on { border-color: var(--sky); }
.pics svg { width: 86%; }
.test-card .bar { height: 5px; border-radius: 5px; background: #fff; margin-top: 22px; overflow: hidden; }
.test-card .bar i { display: block; height: 100%; width: 38%; background: var(--sky); }
.test-card p { margin: 12px 0 0; font-size: 13px; color: var(--navy-faint); }
@media (max-width: 860px) { .test { grid-template-columns: 1fr; } .test-kinds { grid-template-columns: 1fr; } }

/* ---------- 5. sunset: our story ---------- */
.sunset { position: relative; color: #fff; background: linear-gradient(180deg, #F9C98A 0%, #F09A72 18%, #D9758A 40%, #8F6AAE 66%, #5E5A9E 100%); padding: 0 0 clamp(90px, 11vw, 140px); overflow: hidden; }
.sunset .scene { display: block; width: 100%; height: auto; }
.sunset .page { position: relative; max-width: 700px; margin: clamp(-90px, -6vw, -40px) auto 0; background: #FFFBF4; color: #3B2E3F; border-radius: 6px; padding: clamp(40px, 6vw, 72px) clamp(24px, 6vw, 72px) clamp(40px, 6vw, 64px); box-shadow: 0 30px 80px rgba(60, 30, 70, .35); }
.sunset .page::before { content: ""; position: absolute; left: 50%; top: -14px; width: 120px; height: 28px; margin-left: -60px; background: rgba(255, 236, 200, .85); transform: rotate(-2deg); border-radius: 2px; }
.sunset .kicker { font-family: "Newsreader", serif; font-style: italic; font-weight: 300; color: #D9758A; font-size: 20px; margin: 0 0 14px; }
.sunset h2 { margin: 0 0 40px; font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 4.2vw, 46px); line-height: 1.3; letter-spacing: .04em; text-wrap: balance; }
html[lang="en"] .sunset h2, html[lang="ko"] .sunset h2 { letter-spacing: -.005em; }
.sunset .page p { font-family: var(--serif); font-weight: 300; font-size: clamp(17px, 1.8vw, 20px); line-height: 2.05; margin: 0 0 1.4em; }
html[lang="en"] .sunset .page p { line-height: 1.75; }
.sunset .name { text-align: center; margin: 2em 0; }
.sunset .name span { display: block; font-family: var(--serif); font-size: 15px; color: #8C7A8E; }
.sunset .name b { display: block; font-family: "Newsreader", serif; font-weight: 300; font-style: italic; font-size: clamp(48px, 8vw, 84px); line-height: 1.1; color: #C9607A; letter-spacing: -.02em; }
.sunset .page p.motto { text-align: center; font-size: 21px; margin: 2.2em 0 .6em; font-weight: 400; }
.sunset .page p.sign { text-align: right; color: #8C7A8E; font-family: var(--sans); font-size: 15px; margin: 0; }

/* ---------- 6. dusk: fees and questions ---------- */
.dusk { background: linear-gradient(180deg, #5E5A9E 0%, #3E4A86 22%, #2A3A6E 60%, #1E2E5C 100%); color: #fff; }
.dusk .head p, .dusk .faq details p { color: rgba(255, 255, 255, .8); }
.dusk .time { color: #FFD9A0; }
.plans { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.plan { border-radius: 26px; padding: clamp(30px, 4vw, 48px); }
.plan.now { background: #fff; color: var(--navy); box-shadow: 0 24px 60px rgba(10, 15, 40, .3); }
.plan.later { border: 1px dashed rgba(255, 255, 255, .45); color: rgba(255, 255, 255, .85); }
.plan h3 { margin: 0; font-weight: 400; font-size: 17px; }
.plan .price { font-family: var(--serif); font-weight: 300; font-size: clamp(54px, 7vw, 82px); line-height: 1.1; margin: 20px 0 6px; letter-spacing: -.01em; }
.plan.later .price { font-size: clamp(36px, 4.4vw, 52px); line-height: 1.6; color: rgba(255, 255, 255, .7); }
.plan .unit { font-size: 15px; opacity: .75; }
.plan ul { list-style: none; padding: 0; margin: 26px 0 0; }
.plan li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.plan.later li { border-top-color: rgba(255, 255, 255, .2); }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }
.faq-wrap { margin-top: clamp(90px, 11vw, 140px); }
.faq { max-width: 860px; }
.faq details { border-top: 1px solid rgba(255, 255, 255, .2); }
.faq details:last-child { border-bottom: 1px solid rgba(255, 255, 255, .2); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative; font-size: 18px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 11px; height: 11px; border-right: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: translateY(-75%) rotate(45deg); transition: transform .25s; }
.faq details[open] summary::after { transform: translateY(-25%) rotate(-135deg); }
.faq details p { margin: -6px 0 24px; max-width: 40em; }
.faq a { color: #FFD9A0; }

/* ---------- 7. night: closing ---------- */
.night { position: relative; color: #fff; background: linear-gradient(180deg, #1E2E5C 0%, #16244A 45%, var(--night) 100%); text-align: center; overflow: hidden; }
.night .sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.night .wrap { position: relative; padding-top: clamp(110px, 14vw, 170px); }
.night p.end { margin: 0 auto 34px; font-family: var(--serif); font-weight: 300; font-size: clamp(28px, 4vw, 46px); line-height: 1.4; letter-spacing: .04em; max-width: 18em; text-wrap: balance; }
html[lang="en"] .night p.end, html[lang="ko"] .night p.end { letter-spacing: -.005em; }
.night .actions { justify-content: center; }
.night .town { position: relative; display: block; width: 100%; height: auto; margin-top: clamp(40px, 6vw, 70px); }
.twinkle { animation: twinkle 3.6s ease-in-out infinite; }
.twinkle.t2 { animation-delay: 1.2s; } .twinkle.t3 { animation-delay: 2.4s; }
@keyframes twinkle { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .twinkle { animation: none; } }

footer { background: var(--night); color: rgba(255, 255, 255, .62); padding: 36px 0 56px; font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; }
footer .brand b { color: #fff; }
footer nav { display: flex; gap: 24px; }
footer a { text-decoration: none; }
footer a:hover { color: #fff; }

/* plain text pages (privacy) */
.doc { max-width: 720px; padding: clamp(56px, 9vw, 110px) 0; }
.doc h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 5vw, 52px); margin: 0 0 12px; letter-spacing: .03em; }
.doc .date { color: var(--navy-faint); font-size: 14px; margin: 0 0 48px; }
.doc h2 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 44px 0 10px; }
.doc p, .doc li { color: var(--navy-soft); }

/* =========================================================
   Motion. Miss Bookworm is alive; each time of day moves a little.
   Everything below stops for visitors who ask for reduced motion.
   ========================================================= */
.mb *, .crawler * { transform-box: fill-box; }
/* idle: she breathes, blinks, her antennae sway, and now and then she turns a page */
.sit .mb-head { transform-origin: 50% 100%; animation: breathe 3.4s ease-in-out infinite; }
.sit .mb-ant-l { transform-origin: 100% 100%; animation: sway 2.6s ease-in-out infinite; }
.sit .mb-ant-r { transform-origin: 0% 100%; animation: sway 2.6s ease-in-out infinite reverse; }
.sit .mb-eyes { transform-origin: center; animation: blink 4.8s infinite; }
.sit .mb-shut, .sit .mb-open { opacity: 0; }
.sit .mb-page { transform-origin: 0% 50%; animation: page 9s ease-in-out infinite; opacity: 0; }
@keyframes breathe { 50% { transform: translateY(-2px) rotate(-1.5deg); } }
@keyframes sway { 50% { transform: rotate(-9deg); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(.1); } }
@keyframes page { 0%, 78% { opacity: 0; transform: scaleX(1); } 80% { opacity: 1; } 90% { opacity: 1; transform: scaleX(-1); } 92%, 100% { opacity: 0; transform: scaleX(-1); } }
/* tap: she waves and talks */
.tap-me { cursor: pointer; outline: none; }
.tap-me:focus-visible .mb-head { filter: drop-shadow(0 0 6px #fff); }
.sit.waving .mb-hand-r { transform-origin: 0% 50%; animation: wave .5s ease-in-out 3; }
@keyframes wave { 50% { transform: translate(6px, -26px) rotate(-30deg); } }
.sit.talking .mb-smile { opacity: 0; }
.sit.talking .mb-open { opacity: 1; transform-origin: center; animation: talk .22s ease-in-out infinite alternate; }
@keyframes talk { from { transform: scaleY(.35); } to { transform: scaleY(1.1); } }
.sit.talking .mb-cheek { transform-origin: center; animation: talk .44s ease-in-out infinite alternate; }

/* the crawling pose: segments lift one after another, like an inchworm */
.crawler .seg { animation: inch .9s ease-in-out infinite; }
.crawler .s1 { animation-delay: .12s; } .crawler .s2 { animation-delay: .24s; } .crawler .s3 { animation-delay: .36s; }
.crawler .s0 { animation-name: inch-head; }
@keyframes inch { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-12px); } }
@keyframes inch-head { 0%, 100% { transform: translate(0, 0); } 40% { transform: translate(4px, -5px) rotate(3deg); } }

/* hero: she crawls in along the big book, then sits down to read */
/* nothing moves until the book is on screen (site.js adds .go), so every visitor sees her arrive */
.crawl-in, .book .sit, .tap-hint { opacity: 0; }
.book.go .crawl-in { animation: crawl-in 3.2s linear .2s both; }
@keyframes crawl-in { 0% { transform: translateX(390px); opacity: 0; } 6% { opacity: 1; } 88% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(0); opacity: 0; } }
.book.go .sit { animation: appear .5s ease-out 3.1s both; }
/* only Miss Bookworm and her bubble catch the mouse; the empty sky in the picture lets clicks through */
.book .tap-me, .book .tap-hint { pointer-events: auto; cursor: pointer; }
.book .tap-me > g { transition: transform .2s; }
.book .tap-me:hover .mb-head { filter: brightness(1.06); }
.book.tapped .tap-hint { pointer-events: none; }
/* a little "Tap me!" bubble once she has sat down; gone after the first tap */
.book.go .tap-hint { animation: appear .4s ease-out 3.8s both; }
.tap-bob { animation: bob 2.4s ease-in-out infinite; }
.book.tapped .tap-hint { animation: none; opacity: 0; transition: opacity .3s; }
@keyframes appear { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* morning: wisps drift, a tram runs past, paper birds keep floating */
.drift { animation: drift 26s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translateX(90px); } }
.tram-run { animation: tram 30s linear 2s infinite; transform: translateX(-500px); }
@keyframes tram { 0% { transform: translateX(-500px); } 40%, 100% { transform: translateX(2100px); } }
.bob { animation: bob 3.4s ease-in-out 2.4s infinite; }
.f2 .bob { animation-duration: 4.1s; } .f3 .bob { animation-duration: 3.7s; } .f4 .bob { animation-duration: 4.6s; } .f5 .bob { animation-duration: 3.2s; }
@keyframes bob { 50% { transform: translate(8px, -10px) rotate(4deg); } }

/* afternoon: Miss Bookworm crawls along the tops of the six books as you scroll */
.shelf { position: relative; }
.shelf-crawler { position: absolute; left: 0; top: 0; width: 106px; pointer-events: none; transition: transform .35s ease-out; will-change: transform; }
.shelf-crawler svg { width: 100%; height: auto; overflow: visible; }
@media (max-width: 860px) { .shelf-crawler { display: none; } }

/* sunset: a small flock crosses the evening sky */
.flock { animation: flock 22s linear infinite; }
@keyframes flock { from { transform: translateX(-1100px); } to { transform: translateX(700px); } }
.flap { transform-origin: 50% 80%; animation: flap .6s ease-in-out infinite; }
.flap.f2 { animation-delay: .2s; } .flap.f3 { animation-delay: .4s; }
@keyframes flap { 50% { transform: scaleY(-.6); } }

/* night: a shooting star, fireflies, and a sleepy yawn */
.shoot { opacity: 0; animation: shoot 11s ease-in 3s infinite; }
@keyframes shoot { 0% { opacity: 0; transform: translate(260px, 40px) rotate(18deg); } 2% { opacity: 1; } 9% { opacity: 0; transform: translate(760px, 200px) rotate(18deg); } 100% { opacity: 0; transform: translate(760px, 200px) rotate(18deg); } }
.fly-bug { animation: bug 5s ease-in-out infinite; filter: drop-shadow(0 0 4px #FFE88A); }
.fly-bug.b2 { animation-duration: 6.4s; animation-delay: 1s; } .fly-bug.b3 { animation-duration: 7.2s; animation-delay: 2s; } .fly-bug.b4 { animation-duration: 5.6s; animation-delay: 3s; }
@keyframes bug { 0%, 100% { transform: translate(0, 0); opacity: .2; } 30% { opacity: 1; } 50% { transform: translate(22px, -16px); opacity: .9; } 75% { transform: translate(-10px, -6px); opacity: .3; } }
.sleepy .mb-eyes { animation: sleepy-eyes 7s infinite; }
.sleepy .mb-shut { animation: sleepy-shut 7s infinite; }
.sleepy .mb-open { animation: yawn 7s infinite; transform-origin: center; }
.sleepy .mb-smile { animation: hide-smile 7s infinite; }
@keyframes sleepy-eyes { 0%, 60%, 84%, 100% { opacity: 1; } 64%, 80% { opacity: 0; } }
@keyframes sleepy-shut { 0%, 60%, 84%, 100% { opacity: 0; } 64%, 80% { opacity: 1; } }
@keyframes yawn { 0%, 62%, 82%, 100% { opacity: 0; transform: scale(1); } 66%, 78% { opacity: 1; transform: scale(1.6, 2); } }
@keyframes hide-smile { 0%, 62%, 82%, 100% { opacity: 1; } 64%, 80% { opacity: 0; } }
.sleepy.talking .mb-eyes { animation: none; opacity: 1; }
.sleepy.talking .mb-shut { animation: none; opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .sit *, .crawler *, .crawl-in, .book.go .crawl-in, .book.go .sit, .book.go .tap-hint, .drift, .tram-run, .bob, .flock, .flap, .shoot, .fly-bug, .book .sit { animation: none !important; }
  .crawl-in { display: none; }
  .book .sit, .book .tap-hint { opacity: 1; }
  .tap-bob { animation: none !important; }
  .shelf-crawler { transition: none; }
}

/* the short film, in the late-morning section */
.film { margin-top: clamp(56px, 8vw, 96px); display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.film h3 { margin: 0 0 12px; font-family: var(--serif); font-weight: 400; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.35; }
.film p { margin: 0; color: var(--navy-soft); }
.film-frame { border-radius: 24px; overflow: hidden; background: #13213F; box-shadow: 0 30px 70px rgba(23, 58, 94, .2); aspect-ratio: 16 / 9; }
.film-frame video { display: block; width: 100%; height: 100%; object-fit: cover; }
video::cue { font-family: -apple-system, "PingFang SC", "PingFang TC", "Hiragino Sans", "Apple SD Gothic Neo", "Noto Sans CJK SC", sans-serif; background: rgba(19, 33, 63, .72); color: #fff; }
@media (max-width: 860px) { .film { grid-template-columns: 1fr; } .film-frame { border-radius: 18px; } }
