/* 포리의 그림책 소개 사이트.
   색·둥글기·그림자는 앱의 디자인 토큰(lib/app/design.dart)과 같다: 복숭아빛 방, 색종이 깃발, 바느질 자국이 있는 종이 카드,
   아래로 두께가 보이는 알약 단추. 빛은 왼쪽 위에서 하나라 그림자는 모두 오른쪽 아래로 떨어진다. */
@font-face { font-family: "Jua"; src: url("fonts/jua.414c2a67ca.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Gowun Dodum"; src: url("fonts/gowun.414c2a67ca.woff2") format("woff2"); font-display: swap; }

:root {
  --room: #FBEBDA; --room-deep: #F3D2B4; --paper: #FFFBF4; --paper-shade: #F8ECDF; --edge: #F1D3B3; --stitch: #F4C9A6;
  --wood: #D9A273; --wood-dark: #A86E3E;
  --ink: #3A2618; --ink-soft: #7A5238;
  --sun: #FFC94D; --sun-deep: #B07C14; --terra: #B5522E; --terra-deep: #8A3B1C; --coral: #F08A6C; --peach: #FFE0C7;
  --butter: #FFF0C2; --mint: #E3F3E1; --mint-edge: #CFE3C9; --pink: #FFE3E8; --lilac: #EDE6FA; --night: #34449E; --leaf: #2E7D4A;
  --shadow: 122 82 56;
  --fallback: "Hiragino Maru Gothic ProN", "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans JP", "Malgun Gothic", "Yu Gothic UI", sans-serif;
  --display: "Jua", "Gowun Dodum", var(--fallback);
  --body: "Gowun Dodum", var(--fallback);
  --book: var(--coral);
  --c: var(--peach);
  color-scheme: light;
}
/* 앱의 두 글꼴에는 가나·한자가 없다. 일본어 화면은 앱처럼 기기의 일본어 글꼴(애플 기기는 둥근 히라기노)로 그린다. */
html:lang(ja) {
  --display: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  --body: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--room); color: var(--ink);
  font: 400 1.0625rem/1.7 var(--body); word-break: keep-all; overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
html:lang(ja) body { word-break: normal; line-break: strict; }
/* 이야기에서 온 일본어 글(제목·대사·이름)은 낱말 사이를 띄어 쓴 히라가나라, 띈 자리에서만 줄을 바꾼다. */
html:lang(ja) :is(.book-title, .book-theme, .book-sub, .book-copy h2, .book-hero-copy h1, .book-hero-copy .tagline, .book-row .chip, .book-hero-copy .chip, .story-card, .fork-q, .opt, .lesson-words, .friend-bubble, .crumbs [aria-current], .listen-caption) { word-break: keep-all; }
img, video, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.22; margin: 0; text-wrap: balance; }
html:lang(ja) :is(h1, h2, h3, .pill, .brand, .book-title, .friend-name, .chip, summary) { font-weight: 700; }
p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--terra); text-underline-offset: 0.2em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--terra-deep); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--night); outline-offset: 3px; border-radius: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(100% - 40px, 1120px); margin-inline: auto; }
.wrap.narrow { width: min(100% - 40px, 760px); }
.icon { display: inline-block; flex: none; }

.skip { position: absolute; left: 12px; top: -80px; z-index: 10; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; }
.skip:focus { top: 12px; color: #fff; }

/* 색종이 깃발 */
.bunting {
  height: 46px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='46'%3E%3Crect y='8' width='300' height='2' fill='%23D9B48F'/%3E%3Cpath d='M12 9h36L30 39z' fill='%23F08A6C'/%3E%3Cpath d='M72 9h36L90 39z' fill='%23FFC94D'/%3E%3Cpath d='M132 9h36l-18 30z' fill='%239ED3A6'/%3E%3Cpath d='M192 9h36l-18 30z' fill='%23F7A9B8'/%3E%3Cpath d='M252 9h36l-18 30z' fill='%23B9A7E8'/%3E%3C/svg%3E") repeat-x center top;
}

/* 머리 */
.top { padding: 2px 0 6px; }
/* 좁은 화면: 첫 줄에 이름·언어(·받기), 둘째 줄에 메뉴. 1040px부터 한 줄(네 언어가 다 들어가는 폭) */
.top-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; word-break: keep-all; font-family: var(--display); font-size: 1.3rem; line-height: 1.1; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-icon { border-radius: 11px; box-shadow: 2px 3px 6px rgb(var(--shadow) / 0.22); flex: none; }
/* 메뉴 다섯 개: 휴대폰 폭(360px)에서 한국어 메뉴가 한 줄에 들어가게 좁게 두고, 560px부터 넉넉하게 */
.top-nav { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 2px; }
.top-nav a { padding: 8px 6px; border-radius: 999px; white-space: nowrap; font-family: var(--display); font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.top-nav a:hover { background: var(--peach); }
.lang { position: relative; }
.lang summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 10px; border-radius: 999px;
  background: var(--butter); border: 2px solid var(--edge); font-family: var(--display); font-size: 1.02rem; cursor: pointer; list-style: none;
}
.lang summary::-webkit-details-marker { display: none; }
.lang ul {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 5; min-width: 150px; padding: 8px;
  background: var(--paper); border: 2px solid var(--edge); border-radius: 20px; box-shadow: 4px 12px 22px rgb(var(--shadow) / 0.2);
}
.lang li a { display: block; padding: 9px 14px; border-radius: 12px; color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.lang li a:hover { background: var(--butter); }
.top .top-get { display: none; }
.lang-hint { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 12px; background: var(--butter); border-block: 2px solid var(--edge); font-size: 0.98rem; }
.lang-hint[hidden] { display: none; }
.lang-hint button { border: 0; background: none; width: 36px; height: 36px; border-radius: 50%; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--ink-soft); }
.lang-hint button:hover { background: var(--paper); }

/* 알약 단추 */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 4px 26px;
  border-radius: 999px; border: 2px solid transparent; font-family: var(--display); font-size: 1.15rem; line-height: 1.15;
  color: var(--ink); text-decoration: none; text-align: center; cursor: pointer; transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
}
.pill:hover { color: var(--ink); }
.pill-sun { background: var(--sun); box-shadow: 0 5px 0 var(--sun-deep); }
.pill-terra { background: var(--terra); color: #fff; box-shadow: 0 5px 0 var(--terra-deep); }
.pill-terra:hover { color: #fff; }
.pill-paper { background: var(--paper); border-color: var(--edge); box-shadow: 0 5px 0 var(--edge); }
.pill-sun:active, .pill-terra:active, .pill-paper:active { transform: translateY(3px); }
.pill-sun:active { box-shadow: 0 2px 0 var(--sun-deep); }
.pill-terra:active { box-shadow: 0 2px 0 var(--terra-deep); }
.pill-paper:active { box-shadow: 0 2px 0 var(--edge); }
.pill-soon { background: var(--paper-shade); border: 2px dashed var(--stitch); color: var(--ink-soft); cursor: default; }
.pill-small { min-height: 44px; padding: 2px 18px; font-size: 1.05rem; }
.chip { display: inline-block; padding: 3px 14px; border-radius: 999px; background: var(--butter); border: 2px solid var(--edge); font-family: var(--display); font-size: 0.95rem; line-height: 1.5; color: var(--ink); }

/* 종이 카드 */
.card { position: relative; background: var(--paper); border: 2px solid var(--edge); border-radius: 32px; padding: 28px; box-shadow: 0 6px 0 var(--edge), 5px 16px 26px rgb(var(--shadow) / 0.12); }
.card.stitched::before { content: ""; position: absolute; inset: 9px; border: 2px dashed var(--stitch); border-radius: 23px; pointer-events: none; }

/* 구역 */
.section { padding-block: clamp(52px, 8vw, 100px); }
.section.tight { padding-block: clamp(36px, 5.5vw, 68px); }
.section-head { max-width: 760px; margin-bottom: clamp(26px, 4vw, 44px); }
.section-head h2, .tour-copy h2, .get-copy h2 { font-size: clamp(1.75rem, 3.2vw + 0.8rem, 2.6rem); }
.section-head p { margin-top: 12px; font-size: 1.15rem; color: var(--ink-soft); }
.band { background: var(--paper); }
.lead { font-size: clamp(1.1rem, 0.6vw + 1rem, 1.25rem); line-height: 1.7; }
.more { margin-top: 36px; text-align: center; }

/* 첫 화면 */
.hero { padding-block: clamp(20px, 4vw, 48px) clamp(40px, 6vw, 72px); overflow: hidden; }
.hero-grid { display: grid; gap: 36px; align-items: center; }
.eyebrow { display: inline-block; padding: 4px 16px; border-radius: 999px; background: var(--peach); font-family: var(--display); font-size: 1rem; color: var(--ink-soft); }
.hero h1 { margin-top: 14px; font-size: clamp(2.7rem, 7vw + 0.8rem, 4.6rem); line-height: 1.08; letter-spacing: -0.01em; }
.tagline { margin-top: 10px; font-family: var(--display); font-size: clamp(1.25rem, 1.6vw + 0.9rem, 1.7rem); line-height: 1.3; color: var(--terra); text-wrap: balance; }
html:lang(ja) .tagline { font-weight: 700; }
.hero .lead { margin-top: 18px; max-width: 34em; }
.stores { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 26px; }
.badge { display: inline-block; border-radius: 10px; transition: transform 0.12s ease-out; }
.badge:hover { transform: translateY(-2px); }
.badge img { height: 54px; width: auto; }
.stores-note { margin-top: 12px; font-size: 0.98rem; color: var(--ink-soft); }
.stores-note + .stores-note { margin-top: 4px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.facts li { padding: 4px 14px; border-radius: 999px; background: var(--paper); border: 2px solid var(--edge); font-family: var(--display); font-size: 0.98rem; }
html:lang(ja) .facts li { font-weight: 700; }

.hero-art { position: relative; width: min(100%, 520px); aspect-ratio: 1 / 1.14; margin-inline: auto; }
.hero-disc { position: absolute; inset: 9% 2% 5% 2%; border-radius: 50%; background: var(--peach); }
.hero-art .phone { position: absolute; }
.hero-art .phone-back { left: 5%; top: 3%; width: 41%; transform: rotate(-7deg); }
.hero-art .phone-front { right: 6%; top: 7%; width: 45%; transform: rotate(4deg); }
.hero-pori { position: absolute; left: 0; bottom: 1%; width: 40%; filter: drop-shadow(4px 8px 8px rgb(var(--shadow) / 0.25)); animation: float 5s ease-in-out infinite; }
.spark { position: absolute; width: 26px; aspect-ratio: 1; background: var(--sun); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: twinkle 3.2s ease-in-out infinite; }
.spark-a { left: 2%; top: 12%; }
.spark-b { right: 0; top: 2%; width: 20px; background: var(--coral); animation-delay: 0.8s; }
.spark-c { right: 3%; bottom: 10%; width: 22px; background: #9ED3A6; animation-delay: 1.6s; }
@keyframes float { 50% { transform: translateY(-10px); } }
@keyframes twinkle { 50% { transform: scale(0.6) rotate(20deg); opacity: 0.55; } }

/* 80억 가운데 한 아이: 밤하늘. 스크립트가 돌면 그림(캔버스)이 화면에 붙어 있고 글 단락이 그 위로 지나간다.
   그림 속 사람·아이·포리·지구는 누를 수 있다(글 단락의 빈 곳은 누름을 그림으로 흘려보낸다). 스크립트가 없으면 글만 차례로 놓인다. */
.one { position: relative; background: #141B3D; color: #FFF6EA; }
.one-stage, .one-hint { display: none; }
.one-steps { padding-block: clamp(56px, 9vw, 110px); }
.one-step { width: min(100% - 40px, 760px); margin-inline: auto; }
.one-step + .one-step { margin-top: 18px; }
.one h2 { font-size: clamp(2.5rem, 6vw + 1rem, 4.4rem); line-height: 1.1; color: var(--sun); }
.one-step > p { font-family: var(--display); font-size: clamp(1.3rem, 1.3vw + 1rem, 1.8rem); line-height: 1.45; text-wrap: balance; }
html:lang(ja) .one-step > p { font-weight: 700; }
.one-step-end { margin-top: 36px; }
.one-closing { color: var(--ink); }
.one-closing h3 { font-size: clamp(1.4rem, 1.2vw + 1rem, 1.85rem); color: var(--terra); }
.one-closing p { margin-top: 10px; font-family: var(--body); font-size: 1.12rem; line-height: 1.75; text-wrap: pretty; }
@media (scripting: enabled) {
  .one-stage { display: block; position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: #141B3D; }
  .one-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
  .one-count { position: absolute; left: 50%; top: max(14px, 3svh); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
  .one-count p { margin: 0; opacity: 0; }
  .one-count-n {
    padding: 2px 18px; border-radius: 999px; background: rgb(17 23 51 / 0.66); font-family: var(--display); font-size: clamp(1.2rem, 1.8vw + 0.85rem, 2.1rem);
    line-height: 1.5; color: var(--sun); white-space: nowrap; font-variant-numeric: tabular-nums;
  }
  html:lang(ja) .one-count-n { font-weight: 700; }
  .one-count-note { max-width: min(86vw, 30rem); padding: 2px 12px; border-radius: 12px; background: rgb(17 23 51 / 0.6); font-size: 0.8rem; line-height: 1.5; color: #CBD3F2; text-align: center; }
  /* 음악 단추: 화면 오른쪽 아래에 떠 있다. 이 구역이 보일 때와, 음악이 페이지의 다른 곳에서 이어질 때만 보인다. */
  .one-music {
    position: fixed; z-index: 20; right: max(14px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom));
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 0 12px;
    border: 2px solid rgb(255 201 77 / 0.55); border-radius: 999px; background: rgb(17 23 51 / 0.82); color: var(--sun); font-family: var(--display); font-size: 1rem; cursor: pointer;
    box-shadow: 0 6px 18px rgb(0 0 0 / 0.25); opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity 0.3s, transform 0.3s, visibility 0s 0.3s;
  }
  .one-music.is-shown { opacity: 1; visibility: visible; transform: none; transition: opacity 0.3s, transform 0.3s, visibility 0s; }
  .one-music[hidden] { display: none; }
  .one-music svg { width: 20px; height: 20px; flex: none; }
  .one-music span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .one-music[aria-pressed="true"] { background: var(--sun); color: var(--ink); border-color: var(--sun); }
  .one-music[aria-pressed="true"] svg { animation: hop 1.2s ease-in-out infinite; }
  .one-music.is-waiting { animation: call 2.4s ease-in-out infinite; }
  html:lang(ja) .one-music { font-weight: 700; }
  .one-steps { position: relative; margin-top: -100vh; margin-top: -100svh; padding-block: 0; pointer-events: none; }
  .one-step { display: flex; align-items: flex-end; min-height: 80vh; min-height: 80svh; padding-bottom: 7svh; }
  .one-step > * { pointer-events: auto; }
  .one-step + .one-step { margin-top: 0; }
  .one-step-title { align-items: flex-start; padding: 6svh 0 0; }
  .one-step > p, .one-step-title h2 {
    padding: 14px 22px; border-radius: 24px; background: rgb(17 23 51 / 0.74); box-shadow: 0 10px 30px rgb(0 0 0 / 0.22);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  }
  .one-hint { display: block; margin-top: 6px; font-family: var(--body); font-size: 0.98rem; line-height: 1.55; color: #F6D9A8; }
  html:lang(ja) .one-hint { font-weight: 400; }
  .one-hint::before { content: "\2726\00a0"; color: var(--sun); }
  .one-step-end { min-height: 100vh; min-height: 100svh; margin-top: 0; padding-bottom: 5svh; }
}
@media (scripting: enabled) and (min-width: 860px) and (min-aspect-ratio: 11/10) {
  .one-step { width: min(100% - 80px, 1120px); align-items: center; padding-bottom: 0; }
  .one-step > * { max-width: 27rem; }
  .one-step-title { align-items: center; padding-top: 0; }
  .one-count { left: 66%; top: 4.5svh; }
  .one-music { right: 24px; bottom: 24px; padding: 0 18px 0 14px; }
  .one-music span { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
}
@media (scripting: enabled) and (prefers-reduced-motion: reduce) {
  .one-music[aria-pressed="true"] svg, .one-music.is-waiting { animation: none; }
}
@keyframes call { 50% { box-shadow: 0 0 0 7px rgb(255 201 77 / 0.22); } }

/* 기기 모양 */
.phone { width: min(100%, 280px); margin-inline: auto; padding: 2.6%; border-radius: 13% / 6.2%; background: var(--ink); box-shadow: 0 0 0 2px #5B4130 inset, 8px 18px 30px rgb(var(--shadow) / 0.3); position: relative; }
.phone-screen { display: block; border-radius: 11% / 5.1%; overflow: hidden; background: var(--room); }
.phone-screen img, .phone-screen video { width: 100%; }
.phone::after { content: ""; position: absolute; left: 50%; top: 3.1%; width: 27%; height: 2.6%; border-radius: 999px; background: var(--ink); transform: translateX(-50%); }
.phone-mini { width: 100%; padding: 3%; box-shadow: 0 0 0 1.5px #5B4130 inset, 4px 10px 16px rgb(var(--shadow) / 0.26); }
.tablet { padding: 2.2%; border-radius: 4.6% / 6.4%; background: var(--ink); box-shadow: 0 0 0 2px #5B4130 inset, 8px 18px 30px rgb(var(--shadow) / 0.3); }
.tablet-screen { display: block; border-radius: 2.8% / 4%; overflow: hidden; }
.tablet-screen img { width: 100%; }
.tour .phone::after { content: none; }  /* 녹화 화면에 기기의 섬이 이미 찍혀 있다 */

/* 약속 */
.promises { display: grid; gap: 20px; }
.promise { padding: 24px; border-radius: 28px; background: var(--room); border: 2px solid var(--edge); }
.promise svg { width: 52px; height: 52px; }
.promise h3 { margin-top: 12px; font-size: 1.35rem; }
.promise p { margin-top: 8px; color: var(--ink-soft); }

/* 책장 */
.shelf { --gap: 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 30px; }
.shelf > li { display: flex; flex-direction: column; min-width: 0; }
.book-link { display: flex; flex-direction: column; color: var(--ink); text-decoration: none; }
.book-link:hover { color: var(--ink); }
.cover { display: block; aspect-ratio: 3 / 4; border-radius: 6px 16px 16px 6px; overflow: hidden; border: 4px solid #fff; background: var(--paper-shade); box-shadow: 3px 8px 14px rgb(var(--shadow) / 0.26); transform-origin: 50% 100%; transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover.ghost { visibility: hidden; }
.tilt-a { transform: rotate(-2deg); } .tilt-b { transform: rotate(1.5deg); } .tilt-c { transform: rotate(-1deg); } .tilt-d { transform: rotate(2deg); }
.book-link:hover .cover, .book-link:focus-visible .cover, .book-cover:hover .cover { transform: translateY(-8px) rotate(0deg); }
.plank { display: block; height: 14px; margin-inline: calc(var(--gap) / -2); background: var(--wood); box-shadow: 0 6px 0 var(--wood-dark), 3px 14px 12px rgb(var(--shadow) / 0.2); }
.shelf > li:first-child .plank, .shelf > li:nth-child(3n + 1) .plank { margin-left: -10px; border-radius: 8px 0 0 8px; }
.shelf > li:nth-child(3n) .plank { margin-right: -10px; border-radius: 0 8px 8px 0; }
.book-title { margin-top: 22px; font-family: var(--display); font-size: clamp(1rem, 1.2vw + 0.75rem, 1.3rem); line-height: 1.3; }
.book-theme { margin-top: 4px; font-size: 0.92rem; color: var(--ink-soft); }

/* 이렇게 읽어요 */
.feature { display: grid; gap: 28px; align-items: center; padding-block: clamp(26px, 4vw, 48px); }
.feature + .feature { border-top: 2px dashed var(--stitch); }
.feature-icon { margin-bottom: 10px; }
.feature h3 { font-size: clamp(1.5rem, 2vw + 0.9rem, 2.05rem); }
.feature-copy p { margin-top: 12px; font-size: 1.12rem; max-width: 32em; }
.listen-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 22px; }
.listen-caption { font-size: 0.96rem; color: var(--ink-soft); }
.listen.is-playing { background: var(--terra-deep); box-shadow: 0 2px 0 #5d2610; transform: translateY(3px); }
.listen-row audio { width: 100%; margin-top: 8px; }

/* 친구들이 서는 무대 */
.stage { position: relative; padding: 46px 12px 0; border-radius: 28px; overflow: hidden; background: radial-gradient(120% 80% at 50% 20%, #FAD08A, #F3B25C 70%); border: 2px solid var(--edge); }
.stage::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 22px; background: radial-gradient(circle at 20px 0, var(--coral) 19px, transparent 20px) 0 0 / 80px 22px repeat-x, radial-gradient(circle at 60px 0, #F7A9B8 19px, transparent 20px) 0 0 / 80px 22px repeat-x; }
.stage::after { content: ""; display: block; height: 30px; margin: -22px -12px 0; background: var(--wood); border-top: 6px solid var(--wood-dark); }
.stage-row { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; row-gap: 6px; }
.friend { flex: 0 0 25%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 34px 2px 0; min-width: 0; border: 0; background: none; cursor: pointer; position: relative; border-radius: 16px; -webkit-tap-highlight-color: transparent; }
.friend-art { position: relative; display: block; width: min(100%, 104px); aspect-ratio: 1; }
.friend-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(2px 5px 4px rgb(59 36 14 / 0.3)); transform-origin: 50% 100%; transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
.friend:hover .friend-art img { transform: translateY(-4px); }
.friend.is-playing .friend-art img { animation: hop 0.5s ease-out 2; }
.friend-name { display: inline-block; margin: 6px 0 12px; padding: 2px 8px; border-radius: 14px; background: var(--paper); font-family: var(--display); font-size: 0.82rem; line-height: 1.3; text-align: center; min-width: min-content; max-width: 100%; overflow-wrap: normal; word-break: keep-all; text-wrap: balance; }
.friend-bubble { position: absolute; left: 50%; top: 0; transform: translate(-50%, 6px) scale(0.6); opacity: 0; padding: 2px 12px; border-radius: 14px; background: color-mix(in srgb, var(--c) 34%, #fff); border: 2px solid color-mix(in srgb, var(--c) 70%, var(--ink-soft)); font-family: var(--display); font-size: 0.92rem; line-height: 1.5; white-space: nowrap; pointer-events: none; transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.3), opacity 0.2s; }
.friend.is-playing .friend-bubble { transform: translate(-50%, 0) scale(1); opacity: 1; }
@keyframes hop { 30% { transform: translateY(-14px) rotate(-5deg); } 60% { transform: translateY(0) rotate(4deg); } }

/* 네 언어 */
.four { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: start; max-width: 720px; margin-inline: auto; width: 100%; }
.four li { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.four li:nth-child(odd) { margin-top: 18px; }
.four .chip { font-size: 0.85rem; padding: 1px 10px; }
.devices { position: relative; padding-bottom: 8%; }
.phone-over { position: absolute; right: 2%; bottom: 0; width: 23%; }

/* 둘러보기 영상 */
.tour { background: var(--terra); color: #fff; }
.tour-grid { display: grid; gap: 28px; align-items: center; }
.tour .lead { margin-top: 12px; color: #FFE9DD; }
.tour-toggle { position: absolute; right: 4%; bottom: 8%; width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--edge); background: var(--paper); box-shadow: 0 4px 0 var(--edge); cursor: pointer; }
.tour-toggle::before { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; border-left: 16px solid var(--ink); border-block: 10px solid transparent; transform: translateX(3px); }
.tour-toggle.is-playing::before { width: 16px; height: 18px; border: 0; border-inline: 5px solid var(--ink); transform: none; }
.tour-toggle[hidden] { display: none; }

/* 함께 읽기 */
.tips { display: grid; gap: 22px; }
.tip { padding: 26px 24px 24px; }
.tip-n { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--sun); box-shadow: 0 4px 0 var(--sun-deep); font-family: var(--display); font-size: 1.3rem; }
.tip h3 { margin-top: 16px; font-size: 1.35rem; }
.tip p { margin-top: 8px; color: var(--ink-soft); }

/* 묻고 답하기 */
.qa { border-bottom: 2px dashed var(--stitch); }
.qa summary { display: flex; align-items: center; gap: 12px; padding: 18px 4px; font-family: var(--display); font-size: 1.2rem; line-height: 1.35; cursor: pointer; list-style: none; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: ""; flex: none; margin-left: auto; width: 12px; height: 12px; border-right: 3px solid var(--terra); border-bottom: 3px solid var(--terra); transform: rotate(45deg) translate(-3px, -3px); transition: transform 0.2s; }
.qa[open] summary::after { transform: rotate(-135deg) translate(-3px, -3px); }
.qa p { padding: 0 4px 20px; color: var(--ink-soft); }

/* 받기 */
.get-card { display: grid; gap: 22px; padding: clamp(30px, 5vw, 52px); background: var(--butter); border-color: #F2D98A; box-shadow: 0 6px 0 #F2D98A, 5px 16px 26px rgb(var(--shadow) / 0.12); }
.get-card.stitched::before { border-color: #EBCB6F; }
.get-pori { width: 120px; filter: drop-shadow(3px 6px 6px rgb(var(--shadow) / 0.22)); }
.get-copy .lead { margin-top: 10px; }
.qr { display: none; }
.qr img { width: 132px; padding: 8px; border-radius: 16px; background: var(--paper); border: 2px solid var(--edge); }
.qr figcaption { margin-top: 8px; max-width: 150px; font-size: 0.86rem; line-height: 1.45; color: var(--ink-soft); }

/* 발 */
.foot { padding: 44px 0 56px; background: var(--room-deep); font-size: 0.98rem; }
.foot-row { display: grid; gap: 22px; margin-bottom: 26px; }
.foot-brand strong { display: block; font-family: var(--display); font-weight: 400; font-size: 1.4rem; }
html:lang(ja) .foot-brand strong { font-weight: 700; }
.foot-brand span { color: var(--ink-soft); }
.foot-links, .foot-langs { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot a { color: var(--ink); }
.foot-langs a[aria-current] { font-weight: 700; text-decoration: none; }
.foot-small { margin-top: 6px; font-size: 0.84rem; line-height: 1.6; color: var(--ink-soft); }

/* 속 페이지 머리 */
.page-head { padding-block: clamp(18px, 3vw, 32px) clamp(28px, 4vw, 48px); }
.page-head h1 { font-size: clamp(2.1rem, 4.4vw + 0.8rem, 3.4rem); }
.page-head .lead { margin-top: 14px; max-width: 36em; }
.crumbs { margin-bottom: 20px; font-size: 0.95rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.crumbs li + li::before { content: "›"; margin-right: 8px; color: var(--ink-soft); }
.crumbs [aria-current] { color: var(--ink-soft); }

/* 동화책 소개 */
.book-rows { display: grid; gap: 28px; }
.book-row { display: grid; gap: 24px; align-items: center; padding: clamp(24px, 4vw, 40px); border-radius: 32px; background: color-mix(in srgb, var(--book) 11%, var(--paper)); border: 2px solid color-mix(in srgb, var(--book) 24%, var(--edge)); }
.book-cover { display: block; width: min(60%, 240px); margin-inline: auto; }
.book-copy h2 { margin-top: 12px; font-size: clamp(1.6rem, 2.4vw + 0.9rem, 2.2rem); }
.book-copy h2 a { color: var(--ink); text-decoration: none; }
.book-copy h2 a:hover { text-decoration: underline; }
.book-sub { margin-top: 6px; font-family: var(--display); font-size: 1.15rem; color: var(--terra); }
html:lang(ja) .book-sub { font-weight: 700; }
.book-copy > p { margin-top: 14px; }
.faces { display: flex; gap: 6px; margin-top: 16px; }
.faces li { width: 48px; height: 48px; padding: 5px; border-radius: 50%; background: var(--paper); border: 2px solid var(--edge); }
.faces img { width: 100%; height: 100%; object-fit: contain; }

/* 책 한 권 */
.book-head { background: linear-gradient(color-mix(in srgb, var(--book) 15%, var(--room)), var(--room)); }
.book-hero { display: grid; gap: 28px; align-items: center; }
.book-hero > .cover { width: min(62%, 280px); margin-inline: auto; }
.book-hero-copy h1 { margin-top: 12px; }
.split { display: grid; gap: 32px; align-items: center; }
.split h2, .lesson h2 { font-size: clamp(1.6rem, 2.4vw + 0.9rem, 2.15rem); }
.split .lead { margin-top: 10px; color: var(--ink-soft); }
.story-card { margin-top: 20px; display: grid; gap: 12px; font-size: 1.2rem; line-height: 1.75; }
.say { display: flex; align-items: flex-start; gap: 10px; }
.say-face { flex: none; width: 44px; height: 44px; padding: 4px; border-radius: 50%; background: var(--paper); border: 2px solid var(--edge); }
.say-face img { width: 100%; height: 100%; object-fit: contain; }
.say-words { padding: 6px 16px; border-radius: 18px; background: color-mix(in srgb, var(--c) 30%, #fff); }
.feature-copy .story-card p { margin-top: 0; font-size: inherit; }  /* 첫 페이지 '들어 보기'의 글: 책 페이지의 카드와 같게 */
.fork { margin-top: 22px; }
.fork-q { font-family: var(--display); font-size: 1.3rem; line-height: 1.4; }
html:lang(ja) .fork-q { font-weight: 700; }
.opts { display: grid; gap: 12px; margin-top: 16px; }
.opt { display: flex; align-items: center; gap: 14px; padding: 8px; border-radius: 20px; border: 2px solid var(--edge); font-family: var(--display); font-size: 1.12rem; line-height: 1.35; }
html:lang(ja) .opt { font-weight: 700; }
.opt img { flex: none; width: 96px; border-radius: 13px; }
.opt-butter { background: var(--butter); border-color: #F2D98A; }
.opt-mint { background: var(--mint); border-color: var(--mint-edge); }
.opt-pink { background: var(--pink); border-color: #F5C9D2; }
.lesson { text-align: center; padding: 36px 28px; }
.lesson-icon { margin-inline: auto; }
.lesson-words { margin-top: 12px; font-family: var(--display); font-size: clamp(1.3rem, 1.6vw + 1rem, 1.7rem); line-height: 1.45; color: var(--terra); text-wrap: balance; }
html:lang(ja) .lesson-words { font-weight: 700; }
.talk { margin-top: 18px; display: grid; gap: 12px; counter-reset: talk; }
.talk li { position: relative; padding: 14px 18px 14px 58px; border-radius: 20px; background: var(--room); border: 2px solid var(--edge); font-size: 1.1rem; counter-increment: talk; }
.talk li::before { content: counter(talk); position: absolute; left: 14px; top: 12px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--sun); font-family: var(--display); }
ul.talk li::before { content: "•"; font-size: 1.6rem; line-height: 1; }

/* 글 문서(지원 · 개인정보 처리방침) */
/* 색칠 도안·활동지: 인쇄한 종이처럼 보이는 1쪽 미리 보기, 받기 단추, 선생님이 알림장에 붙여 넣을 글 */
.sheet-paper { display: block; max-width: 280px; margin-inline: auto; background: #fff; border: 2px solid var(--edge); border-radius: 8px; overflow: hidden; box-shadow: 0 6px 0 var(--edge), 5px 16px 26px rgb(var(--shadow) / 0.12); transform: rotate(-1.5deg); transition: transform 0.2s ease; }
.sheet-paper img { width: 100%; }
.sheet-paper:hover { transform: rotate(0deg); }
.sheet-get { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 18px; }
.sheet-note { color: var(--ink-soft); }
.notice { margin-top: 24px; padding: 22px; }
.notice h3 { font-size: 1.15rem; }
.notice-text { margin: 10px 0 14px; padding: 12px 16px; border-radius: 16px; background: var(--room); border: 2px dashed var(--edge); user-select: all; overflow-wrap: anywhere; }
.sheet-all { margin-top: 16px; }
.head-link { margin-top: 18px; }

/* 영상 모음: 유튜브로 가는 미리 보기 그림. 세로 영상(쇼츠)은 좁은 칸, 가로 영상(.wide)은 넓은 칸 */
.videos { display: grid; gap: 26px 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); }
.videos.wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.videos + .videos { margin-top: 30px; }
.video a { display: grid; gap: 4px; color: var(--ink); text-decoration: none; }
.video-thumb { display: block; margin-bottom: 6px; border: 2px solid var(--edge); border-radius: 20px; overflow: hidden; background: var(--paper-shade); box-shadow: 0 5px 0 var(--edge); transition: transform 0.2s ease; }
.video-thumb img { display: block; width: 100%; height: auto; }
.video a:hover .video-thumb, .video a:focus-visible .video-thumb { transform: translateY(-5px); }
.video-time { display: flex; align-items: center; gap: 6px; font-size: 0.92rem; line-height: 1.5; color: var(--ink-soft); }
.video-time::before { content: ""; border-left: 8px solid var(--terra); border-block: 5px solid transparent; }
.video-title { font-family: var(--display); font-size: 1.08rem; line-height: 1.35; }
.video-sub { font-size: 0.95rem; line-height: 1.4; color: var(--ink-soft); }
html:lang(ja) :is(.video-title, .video-sub) { word-break: keep-all; }
.tour-more { margin-top: 22px; }
.sheets { display: grid; gap: 28px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.sheet-card { display: grid; gap: 12px; align-content: start; padding: 22px; border-radius: 28px; background: color-mix(in srgb, var(--book) 11%, var(--paper)); border: 2px solid color-mix(in srgb, var(--book) 24%, var(--edge)); }
.sheet-card .sheet-paper { max-width: 220px; }
.sheet-card h3 { font-size: 1.12rem; line-height: 1.35; }
.sheet-card h3 a { color: inherit; text-decoration: none; }
.sheet-card .sheet-get { margin-top: 0; }
html:lang(ja) :is(.sheet-card h3) { word-break: keep-all; }
.doc { padding: clamp(26px, 5vw, 48px); }
.doc h1 { font-size: clamp(1.9rem, 3vw + 1rem, 2.6rem); }
.doc h2 { margin-top: 34px; font-size: 1.4rem; }
.doc p, .doc ul { margin-top: 12px; }
.doc ul { padding-left: 1.3em; list-style: disc; }
.doc-date { color: var(--ink-soft); font-size: 0.95rem; }
.doc-intro { font-size: 1.15rem; }
.doc-more { margin-top: 28px; }
.mail { font-size: 1.15rem; word-break: break-all; }

/* 404 */
.lost { padding-block: 40px 80px; text-align: center; }
.lost-pori { width: 150px; margin-inline: auto; }
.lost-langs { display: grid; gap: 28px; margin-top: 24px; }
.lost-langs h2 { font-size: 1.5rem; }
.lost-langs p { margin-top: 6px; }
.lost-langs p + p { margin-top: 14px; }

@media (min-width: 560px) {
  .top-nav { gap: 4px; }
  .top-nav a { padding-inline: 10px; }
  .promises { grid-template-columns: repeat(2, 1fr); }
  .stage { padding-inline: 24px; }
  .stage::after { margin-inline: -24px; }
  .friend-name { font-size: 0.95rem; }
  .qr { display: block; }
  .get-card { grid-template-columns: auto 1fr auto; align-items: center; }
  .foot-row { grid-template-columns: 1fr auto; align-items: end; }
  .foot-langs { grid-column: 1 / -1; }
}
@media (min-width: 720px) {
  .top-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .top .top-get { display: inline-flex; }
  .tips { grid-template-columns: repeat(3, 1fr); }
  .friend { flex-basis: 12.5%; }
  .book-row { grid-template-columns: 240px 1fr; gap: 40px; }
  .book-row.flip { grid-template-columns: 1fr 240px; }
  .book-row.flip .book-cover { order: 2; }
  .book-cover { width: 100%; }
  .book-hero { grid-template-columns: 280px 1fr; gap: 48px; }
  .book-hero > .cover { width: 100%; }
  .split { grid-template-columns: 1fr 300px; gap: 56px; }
  .split.flip { grid-template-columns: 300px 1fr; }
  .split.flip > :first-child { order: 2; }
  .split:has(.lesson) { grid-template-columns: 1fr 1.2fr; }
}
@media (min-width: 880px) {
  .videos { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
  .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 24px; }
  .promises { grid-template-columns: repeat(3, 1fr); }
  .shelf { grid-template-columns: repeat(5, minmax(0, 1fr)); --gap: 30px; }
  .shelf-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 880px; margin-inline: auto; }
  .shelf .shelf-fill { display: none; }
  .shelf > li .plank, .shelf > li:nth-child(3n) .plank, .shelf > li:nth-child(3n + 1) .plank { margin-inline: calc(var(--gap) / -2); border-radius: 0; }
  .shelf > li:first-child .plank { margin-left: -16px; border-radius: 8px 0 0 8px; }
  .shelf > li:nth-last-child(1 of :not(.shelf-fill)) .plank { margin-right: -16px; border-radius: 0 8px 8px 0; }
  .feature { grid-template-columns: 1fr 1fr; gap: 56px; }
  .feature.flip .feature-copy { order: 2; }
  .feature.wide { grid-template-columns: 1fr; }
  .feature.wide .feature-copy { max-width: 720px; }
  .tour-grid { grid-template-columns: 0.8fr 1.2fr; gap: 56px; }
  .friend-art { width: min(100%, 112px); }
}
@media (min-width: 1040px) {
  .top-row { grid-template-columns: auto 1fr auto auto; }
  .brand { margin-right: 8px; }
  .top-nav { grid-column: 2; grid-row: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 책과 인물의 색(stories/*/story.json) */
.b-moon_wolf{--book:#4B5FD7}
.b-seed_kong{--book:#5CB85C}
.b-whale_popo{--book:#2EA8D8}
.b-robot_pipi{--book:#F2A93B}
.b-bear_mungchi{--book:#B5651D}
.b-otter_pong{--book:#3B4F8A}
.c-wolf_lulu{--c:#8FA3FF}
.c-rabbit_tori{--c:#FFD1E3}
.c-owl_grandpa{--c:#C9A67A}
.c-star_byeol{--c:#FFE066}
.c-fireflies{--c:#B9FF8A}
.c-moon{--c:#FFF4C2}
.c-rabbit_mom{--c:#F5B7CF}
.c-seed_kong{--c:#9BE37D}
.c-worm_gil{--c:#E8A0BF}
.c-sun_haenim{--c:#FFC94D}
.c-cloud_guru{--c:#D6E6F5}
.c-butterfly_nabi{--c:#B28DFF}
.c-rainbow_small{--c:#FFB3C6}
.c-whale_popo{--c:#7CC8F0}
.c-turtle_dodo{--c:#8FD18F}
.c-crab_jjib{--c:#FF8C69}
.c-seagull_kkak{--c:#E9EEF5}
.c-fish_school{--c:#FFD166}
.c-trash_pile{--c:#A9A9A9}
.c-kids_beach{--c:#FFCBA4}
.c-robot_pipi{--c:#C9CDD6}
.c-apple_red{--c:#FF5A5A}
.c-frog_green{--c:#6BD46B}
.c-bird_blue{--c:#5AA9FF}
.c-rainbow_mujigae{--c:#FFB3C6}
.c-town_friends{--c:#F4D7A1}
.c-bear_mungchi{--c:#D2A26D}
.c-squirrel_ttori{--c:#F0A868}
.c-hedgehog_gasi{--c:#A88B6A}
.c-fox_yeoni{--c:#FF9E5E}
.c-honey_pot{--c:#FFC94D}
.c-snowflakes{--c:#E3F4FF}
.c-otter_pong{--c:#B07A4F}
.c-otter_mom{--c:#8B5E3C}
.c-mouse_tok{--c:#A89A8C}
.c-badger_bori{--c:#9DA3AE}
.c-duck_dongdong{--c:#3E8E5E}
