/* Kalimo website. Colours are the app's brand tokens (docs/brand.md): the start page follows the
   visitor's clock like the shelf (DayTheme), help and legal pages use the grown-ups' daylight paper. */

@font-face { font-family: "Baloo 2"; src: url(/fonts/baloo2.woff2) format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Literata"; src: url(/fonts/literata.woff2) format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Nunito"; src: url(/fonts/nunito.woff2) format("woff2"); font-weight: 200 1000; font-display: swap; }

:root {
  --display: "Baloo 2", "Nunito", system-ui, sans-serif;
  --story: "Literata", Georgia, serif;
  --ui: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --amber: #F2A541;      /* lanternAmber: the primary action at every time of day */
  --nightInk: #1C1A36;
  --teal: #6FB3A4;       /* mossTeal: anything a child can tap */
  /* Evening (the default until the clock is read) */
  --ground: #1C1A36; --card: #2E2752; --raised: #3B3266; --ink: #F6E7C8; --accent: #F2A541;
  --muted: rgba(246, 231, 200, .72); --line: rgba(246, 231, 200, .18);
  --sky: #13132f; --skyMid: #1a183d; --skyLow: #231a42;
  --reading: #1C1A36; --readingInk: #F6E7C8;
  color-scheme: dark;
}
html[data-time="morning"] {
  --ground: #FBE7D6; --card: #FFF6EE; --raised: #F6D7BF; --ink: #3A2747; --accent: #B4533D;
  --muted: rgba(58, 39, 71, .74); --line: rgba(58, 39, 71, .14);
  --sky: #cd94b7; --skyMid: #fcbb91; --skyLow: #f7c98e;
  --reading: #FFF6EE; --readingInk: #3A2747;
  color-scheme: light;
}
html[data-time="day"] {
  --ground: #E9F5F2; --card: #FFFFFF; --raised: #D3EBE5; --ink: #1F3A44; --accent: #2F7566;
  --muted: rgba(31, 58, 68, .74); --line: rgba(31, 58, 68, .14);
  --sky: #7dc9eb; --skyMid: #93d8f5; --skyLow: #b9e2c9;
  --reading: #FFFFFF; --readingInk: #1F3A44;
  color-scheme: light;
}
html[data-zone="paper"] {
  --ground: #FFF5E6; --card: #FFFFFF; --raised: #F6E7C8; --ink: #2A2445; --accent: #B4533D;
  --muted: rgba(42, 36, 69, .74); --line: rgba(42, 36, 69, .14);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--ui); font-size: 17px; line-height: 1.6; transition: background-color .6s, color .6s; }
img { max-width: 100%; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0; text-wrap: balance; font-weight: 700; }
h2 { font-size: clamp(28px, 4vw, 40px); }
h3 { font-size: 20px; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1120px; margin-inline: auto; padding-inline: 20px; }
.eyebrow { font-weight: 800; font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.lede { color: var(--muted); max-width: 60ch; }
.small { font-size: 14px; color: var(--muted); }

/* ---------- Header and footer ---------- */
.top { position: absolute; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 16px; padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 14px; max-width: 1160px; margin-inline: auto; }
html[data-zone="paper"] .top { position: static; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 800; font-size: 24px; color: var(--ink); text-decoration: none; }
.logo img { border-radius: 9px; }
.top nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; padding: 8px 11px; border-radius: 99px; }
.top nav a:hover { background: var(--line); }
.top nav a.lang { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--line); }
.flag { width: 22px; height: 14px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); display: block; flex: none; }
.foot { background: var(--card); margin-top: 0; padding-block: 40px calc(40px + env(safe-area-inset-bottom, 0px)); }
.footIn { max-width: 1120px; margin-inline: auto; padding-inline: 20px; display: grid; grid-template-columns: 1fr auto; gap: 18px 40px; }
.footBrand { display: flex; flex-direction: column; gap: 6px; }
.footBrand p { color: var(--muted); font-size: 15px; }
.footLinks { display: flex; flex-wrap: wrap; gap: 6px 22px; align-content: start; }
.footLinks a { color: var(--ink); font-weight: 700; font-size: 15px; }
.footSmall { grid-column: 1 / -1; font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }
.footSmall a { color: inherit; }

/* ---------- App Store badge ---------- */
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.badge { display: inline-flex; align-items: center; gap: 10px; background: #000; color: #fff; border: 1px solid #a6a6a6; border-radius: 11px; padding: 7px 16px 7px 12px; text-decoration: none; }
.badge.official { background: none; border: 0; padding: 0; }
.badge svg { width: 22px; height: 26px; fill: #fff; }
.badge span { display: flex; flex-direction: column; line-height: 1.05; font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; }
.badge small { font-size: 11px; }
.badge strong { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.badge.soon { opacity: .9; }
.soonNote { font-size: 13.5px; font-weight: 800; color: var(--accent); }

/* ---------- Hero: the shelf's painted world ---------- */
.hero { position: relative; overflow: hidden; height: clamp(440px, 64vh, 580px); isolation: isolate; }
.backdrop { position: absolute; inset: 0; background: linear-gradient(180deg, var(--sky) 0%, var(--skyMid) 60%, var(--skyLow) 100%); transition: background .8s; }
.stage { position: absolute; }
.set { position: absolute; inset: 0; transition: opacity 1s ease; opacity: 0; }
html[data-time="morning"] .set[data-set="morning"], html[data-time="day"] .set[data-set="day"], html[data-time="evening"] .set[data-set="evening"] { opacity: 1; }
.layer { position: absolute; inset: 0; width: 100%; height: 100%; will-change: transform; }
.hero.wide .stage { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 32%); mask-image: linear-gradient(90deg, transparent 0, #000 32%); }
.dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.moth { position: absolute; left: 31%; top: 49%; width: 16%; aspect-ratio: 960 / 769; animation: hover 4.2s ease-in-out infinite; filter: drop-shadow(0 0 18px rgba(242, 165, 65, .55)); }
.moth img { position: absolute; inset: 0; width: 100%; height: 100%; }
.moth .wl, .moth .wr { transform-origin: 50% 55%; }
.moth .wl { animation: flapL .9s ease-in-out infinite; }
.moth .wr { animation: flapR .9s ease-in-out infinite; }
@keyframes flapL { 50% { transform: perspective(600px) rotateY(52deg); } }
@keyframes flapR { 50% { transform: perspective(600px) rotateY(-52deg); } }
@keyframes hover { 50% { translate: 0 -5%; } }
.heroCopy { position: absolute; z-index: 5; left: max(20px, calc((100% - 1120px) / 2 + 20px)); top: 54%; transform: translateY(-50%); width: min(44%, 520px); display: flex; flex-direction: column; gap: 14px; }
.heroCopy h1 { font-size: clamp(30px, 4.2vw, 52px); font-weight: 800; line-height: 1.04; }
.heroCopy p { color: var(--muted); font-size: clamp(16px, 1.5vw, 19px); max-width: 40ch; }
.heroCopy .heroMeta { font-size: 13.5px; font-weight: 800; }
.hero .top { color: var(--ink); }

/* ---------- Film ---------- */
.film { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 28px; padding-block: 72px 24px; }
.filmText { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 56ch; }
.screenWide { position: relative; width: 100%; max-width: 960px; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; background: #0d0c1c; box-shadow: 0 0 0 2px rgba(255, 255, 255, .08), 0 30px 60px rgba(10, 8, 30, .35); }
.screenWide > video, .screenWide > .reel { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.screenWide .reel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.screenWide .reel img { position: static; width: 100%; height: 100%; object-fit: cover; opacity: 1; animation: none; }
.filmText p { color: var(--muted); font-size: 18px; }
.phone { position: relative; width: 280px; max-width: 100%; aspect-ratio: 9 / 19.5; border-radius: 44px; padding: 10px; background: #0d0c1c; box-shadow: 0 0 0 2px rgba(255, 255, 255, .08), 0 30px 60px rgba(10, 8, 30, .35); }
/* Absolutely placed: WebKit leaves height: 100% unresolved inside an aspect-ratio box, which showed an empty phone on iOS. */
.phone.phone > * { position: absolute; inset: 10px; width: auto; height: auto; border-radius: 34px; overflow: hidden; display: block; object-fit: cover; background-color: var(--nightInk); }
.phone.small { width: 190px; border-radius: 32px; padding: 7px; }
.phone.phone.small > * { inset: 7px; border-radius: 25px; }
/* Video and images keep their own size when only inset is set, so they get it spelled out. */
.phone.phone > video, .phone.phone > img { width: calc(100% - 20px); height: calc(100% - 20px); }
.phone.phone.small > video, .phone.phone.small > img { width: calc(100% - 14px); height: calc(100% - 14px); }
.reel { position: relative; }
.reel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: reel 16s infinite; }
.reel img:nth-child(2) { animation-delay: 4s; }
.reel img:nth-child(3) { animation-delay: 8s; }
.reel img:nth-child(4) { animation-delay: 12s; }
@keyframes reel { 0% { opacity: 0; transform: scale(1.02); } 4% { opacity: 1; } 25% { opacity: 1; } 30% { opacity: 0; transform: scale(1.12); } 100% { opacity: 0; } }

/* ---------- Sections ---------- */
.block { display: flex; flex-direction: column; gap: 28px; padding-block: 72px 0; }
.head { display: flex; flex-direction: column; gap: 10px; max-width: 62ch; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.step { display: flex; flex-direction: column; gap: 18px; align-items: center; text-align: center; min-width: 0; }
.stepText { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.stepText p { color: var(--muted); font-size: 16px; max-width: 34ch; }
.stepNo { width: 30px; height: 30px; border-radius: 50%; background: var(--amber); color: var(--nightInk); font-weight: 800; display: grid; place-items: center; font-size: 15px; }
.screen { background-size: cover; background-position: center; position: relative; }
.screen .ask { position: absolute; left: 10px; right: 10px; top: 18px; text-align: center; font-family: var(--display); font-weight: 700; font-size: 15px; color: #F6E7C8; text-shadow: 0 1px 8px rgba(0, 0, 0, .7); }
/* New story: three idea cards, a sticker from the effects' painted library on each (the app's IdeaSetupView). */
.screen.ideas { background: #1C1A36; display: flex; flex-direction: column; padding: 70px 9px 9px; }
.ideaCards { display: flex; flex-direction: column; gap: 7px; }
.idea { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 7px; align-items: center; background: #2E2752; border: 2px solid transparent; border-radius: 12px; padding: 7px 8px; color: #F6E7C8; }
.idea img { grid-row: 1 / 3; width: 34px; height: 34px; object-fit: contain; }
.idea b { font: 700 11.5px/1.15 var(--display); }
.idea small { font-size: 9.5px; color: rgba(246, 231, 200, .65); font-weight: 700; }
.tapDot { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 3px solid var(--teal); opacity: 0; }

/* The three steps play on a 7 s loop each, one after the other, so the row tells the story in order. */
.screen .go { position: absolute; left: 50%; bottom: 16px; translate: -50% 0; font: 800 13px var(--ui); background: var(--amber); color: #1C1A36; border-radius: 99px; padding: 6px 20px; }
.s1 .field { position: absolute; left: 12px; right: 12px; bottom: 58px; height: 38px; border-radius: 12px; background: rgba(28, 26, 54, .78); border: 2px solid #F2A541; display: flex; align-items: center; padding: 0 12px; font: 700 19px var(--story); color: #F6E7C8; }
/* No inline styles anywhere: the site's Content-Security-Policy blocks style attributes. */
.s1 { background-image: url(/img/welcome.webp); }
.s1 .typed span { opacity: 0; animation: type 7s infinite; animation-delay: .9s; }
.s1 .typed span:nth-child(2) { animation-delay: 1.18s; }
.s1 .typed span:nth-child(3) { animation-delay: 1.46s; }
.s1 .typed span:nth-child(4) { animation-delay: 1.74s; }
.s1 .typed span:nth-child(5) { animation-delay: 2.02s; }
.s1 .caret { width: 2px; height: 20px; background: #F2A541; margin-left: 2px; animation: blink 1s steps(1) infinite; }
.s1 .tapDot { left: 50%; top: calc(100% - 29px); animation: tap 7s infinite; animation-delay: 2.6s; }
.s1 .go { animation: press 7s infinite; animation-delay: 2.6s; }
@keyframes type { 0% { opacity: 0; } 4%, 88% { opacity: 1; } 94%, 100% { opacity: 0; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes tap { 0% { opacity: 0; transform: scale(1.8); } 6% { opacity: 1; transform: scale(1); } 12% { opacity: 0; transform: scale(.7); } 100% { opacity: 0; } }
@keyframes press { 0%, 100% { scale: 1; } 7% { scale: .9; } 13% { scale: 1.06; } 18% { scale: 1; } }
.s2 .pick { animation: pick 7s infinite; animation-delay: 2.33s; }
.s2 .tapDot { left: 50%; top: 47%; animation: tap 7s infinite; animation-delay: 2.33s; }
.s2 .go { opacity: .45; animation: ready 7s infinite; animation-delay: 2.33s; }
@keyframes pick { 0% { box-shadow: none; scale: 1; } 6% { scale: .92; } 12% { scale: 1.04; box-shadow: 0 0 0 3px #F2A541; } 18%, 80% { scale: 1; box-shadow: 0 0 0 3px #F2A541; } 88%, 100% { box-shadow: none; } }
@keyframes ready { 0% { opacity: .45; } 12%, 80% { opacity: 1; } 88%, 100% { opacity: .45; } }

/* Times of day */
.times { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.timeCard { background: var(--card); border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.timeCard img { width: 100%; aspect-ratio: 720 / 492; object-fit: cover; display: block; }
.timeCard div { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 6px; }
.timeCard p { color: var(--muted); font-size: 16px; }

/* Wonder: the sample book to turn and tap */
.wonder { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 56px; align-items: start; }
.bookFrame { width: 100%; max-width: 360px; justify-self: center; }

/* Grows with them: age tabs switch the book and the words beside it */
.ageTabs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ageTabs .ask { font-weight: 800; margin-right: 6px; }
.ageTabs [role=tab] { font: inherit; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 8px 16px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.1; min-width: 78px; }
.ageTabs [role=tab] b { font: 800 24px/1 var(--display); }
.ageTabs [role=tab] span { font-size: 12px; color: var(--muted); font-weight: 700; }
.ageTabs [role=tab][aria-selected=true] { background: var(--amber); border-color: var(--amber); color: var(--nightInk); }
.ageTabs [role=tab][aria-selected=true] span { color: rgba(28, 26, 54, .75); }
.agePanels { display: flex; flex-direction: column; gap: 18px; padding-top: 8px; min-width: 0; }
.agePanel { display: flex; flex-direction: column; gap: 10px; }
.agePanel[hidden] { display: none; }
.agePanel h3 { font-size: clamp(26px, 3vw, 34px); }
.agePanel p { color: var(--muted); font-size: 18px; max-width: 46ch; }
.agePanel .who { font-size: 15px; font-weight: 700; color: var(--ink); }
.ageBook { font-family: var(--story); font-style: italic; color: var(--accent); font-size: 17px; }
.strip { display: flex; gap: 10px; margin-top: 8px; overflow-x: auto; padding: 3px; max-width: 100%; scrollbar-width: thin; }
.strip button { flex: none; }
.strip button { padding: 0; border: 3px solid transparent; border-radius: 12px; overflow: hidden; width: 86px; aspect-ratio: 2 / 3; cursor: pointer; background: var(--card); }
.strip button.on { border-color: var(--teal); }
.strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.note { font-size: 15px; color: var(--muted); border-top: 2px solid var(--line); padding-top: 14px; max-width: 46ch; }
.plays { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.plays h3 { font-size: 24px; }
.wonderList { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.wonderList li { display: flex; flex-direction: column; gap: 4px; border-left: 3px solid var(--teal); padding-left: 16px; }
.wonderList h4 { margin: 0; font: 700 18px/1.2 var(--display); }
.wonderList p { color: var(--muted); font-size: 15.5px; }

/* The book (also the mini copy in step 3). Sizes follow its own width. */
.book { position: relative; aspect-ratio: 9 / 16; width: 100%; container-type: inline-size; border-radius: 6px 14px 14px 6px; overflow: hidden; background: #1C1A36; box-shadow: 0 24px 50px rgba(10, 8, 30, .35), inset 3px 0 0 rgba(0, 0, 0, .25); touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: pointer; }
.book.mini { aspect-ratio: auto; border-radius: 25px; box-shadow: none; cursor: default; }
.book .under, .book .front { position: absolute; inset: 0; }
.book .flap, .book .shade { position: absolute; inset: 0; display: none; pointer-events: none; }
.book .flap i { position: absolute; top: 0; bottom: 0; background: linear-gradient(90deg, #fbf1dc 0%, #efdcb6 70%, #cdb68a 100%); }
.book .shade i { position: absolute; top: 0; bottom: 0; width: 45%; background: linear-gradient(90deg, rgba(10, 8, 30, .45), rgba(10, 8, 30, 0)); }
.pg { position: absolute; inset: 0; }
.pg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; }
.pg.cover h4 { position: absolute; left: 6%; right: 6%; top: 5%; margin: 0; text-align: center; font: 800 8.4cqw/1.05 var(--display); color: #F6E7C8; text-shadow: 0 2px 14px rgba(0, 0, 0, .75); }
/* Text pages as the app's reader sets them: the book's own time of day (DayTheme's reading colours), the
   size for the youngest listener (main.js fits it), a little above the middle. */
.pg.text { background: #1C1A36; color: #F6E7C8; padding: 9% 9% 14%; display: flex; flex-direction: column; justify-content: center; }
.pg.text.morning { background: #FFF6EE; color: #3A2747; }
.pg.text.day { background: #FFFFFF; color: #1F3A44; }
.pg.text .words { font: 400 6.4cqw/1.5 var(--story); margin-top: -6%; text-align: left; }
.pg.text p { margin: 0; }
.pg.text p + p { margin-top: .6em; }
.pg.text.a3 .words { line-height: 1.45; text-align: center; }
.pg.text.a3 b { font-weight: 800; }
.pg.text.a7 .words { hyphens: auto; -webkit-hyphens: auto; }
.pg.text .drop { float: left; font-size: 2.9em; line-height: .8; font-weight: 700; color: #F2A541; margin: .08em .1em 0 0; }
.pg.text.morning .drop { color: #B4533D; }
.pg.text.morning .num { color: rgba(58, 39, 71, .45); }
.pg.text.day .num { color: rgba(31, 58, 68, .45); }
.pg.text.day .drop { color: #2F7566; }
.pg.text .num { position: absolute; bottom: 4.5%; left: 0; right: 0; text-align: center; font: 700 3.2cqw var(--ui); color: rgba(246, 231, 200, .45); }
/* The sparkle cue around a tappable thing (the app's SparkleCue); main.js moves the sparkles and breathes the light. */
.pg .cue { position: absolute; pointer-events: none; transition: opacity .2s ease-in-out; }
.cue i, .cue b { position: absolute; display: block; }
.cue .light { left: 50%; top: 50%; width: 124%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle, #F2A541 0%, rgba(242, 165, 65, 0) 70%); }
.cue .ring { inset: 0; border-radius: 50%; border: .76cqw solid #F2A541; filter: blur(.6cqw); }
.cue .hint { inset: 0; border-radius: 50%; border: 1cqw solid #F6E7C8; box-shadow: 0 0 2cqw #F2A541; opacity: 0; animation: hint 1.6s ease-out; }
@keyframes hint { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.5); } }
.cue b { left: 0; top: 0; filter: drop-shadow(0 0 1.5cqw #F2A541) drop-shadow(0 0 3cqw rgba(242, 165, 65, .8)); }
.cue svg { width: 100%; height: 100%; fill: #F6E7C8; display: block; }
/* The effect as the app plays it: its clip over the page, or a card naming it. */
.pg .magic { position: absolute; inset: 0; z-index: 3; display: flex; align-items: flex-end; justify-content: center; padding: 0 6% 16%; animation: magicIn .35s ease-out; transition: opacity .3s; }
.pg .magic.gone { opacity: 0; }
.pg .magic video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #1C1A36; }
.pg .magic.withClip { align-items: flex-start; padding-top: 5%; }
.pg .magicCard { position: relative; display: flex; flex-direction: column; gap: 1.6cqw; background: rgba(28, 26, 54, .9); color: #F6E7C8; border-radius: 4cqw; padding: 3.6cqw 5cqw; box-shadow: 0 0 0 .6cqw rgba(242, 165, 65, .55), 0 2cqw 6cqw rgba(0, 0, 0, .35); text-align: center; }
.pg .magicName { font: 800 4.6cqw/1.2 var(--display); color: #F2A541; }
.pg .magicLine { font: 600 4cqw/1.35 var(--ui); }
.pg .magic.withClip .magicCard { padding: 2.2cqw 4.4cqw; border-radius: 99px; }
.pg .magic.withClip .magicName { font-size: 3.8cqw; }
.pg .cue.away { opacity: 0; }
.pg .base { will-change: transform; }
@keyframes magicIn { from { opacity: 0; transform: scale(.97); } }
.pg .spark { position: absolute; z-index: 2; border-radius: 50%; background: #F6E7C8; box-shadow: 0 0 1.5cqw #F2A541; pointer-events: none; }
.turn { position: absolute; z-index: 3; bottom: 2.5%; width: 11cqw; height: 11cqw; border-radius: 50%; border: 0; background: rgba(28, 26, 54, .55); color: #F6E7C8; font: 800 7cqw/1 var(--ui); cursor: pointer; display: grid; place-items: center; padding: 0 0 .8cqw; opacity: .8; }
.turn.prev { left: 2.5%; }
.turn.next { right: 2.5%; }
.turn:hover { opacity: 1; }
.book[data-kind="cover"] .turn.prev { display: none; }

/* Trust */
.trust { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 36px; align-items: start; }
.names { background: var(--card); border-radius: 22px; padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.names p { color: var(--muted); }
.swap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 22px; margin-bottom: 6px; }
.swap code { font-size: 17px; background: var(--raised); padding: 5px 10px; border-radius: 9px; }
.swap .arrow { color: var(--accent); font-weight: 800; }
.swap .real { font-family: var(--story); color: var(--accent); font-weight: 600; }
.promises { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; }
.promises li { display: flex; flex-direction: column; gap: 4px; border-top: 2px solid var(--line); padding-top: 12px; }
.promises h3 { font-size: 18px; }
.promises p { color: var(--muted); font-size: 15.5px; }

/* FAQ */
.faq, .group { display: flex; flex-direction: column; gap: 10px; max-width: 780px; }
.qa { background: var(--card); border-radius: 16px; padding: 0 20px; }
.qa summary { cursor: pointer; font-weight: 800; padding: 16px 28px 16px 0; list-style: none; position: relative; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; position: absolute; right: 0; top: 12px; font-size: 24px; color: var(--accent); }
.qa[open] summary::after { content: "–"; }
.qa p { padding-bottom: 18px; color: var(--muted); }
.more { font-weight: 800; }

/* End */
.end { position: relative; margin-top: 88px; min-height: 420px; display: flex; align-items: center; overflow: hidden; background: #1C1A36; color: #F6E7C8; }
.endScene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 70%; }
.end::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(28, 26, 54, .92) 0%, rgba(28, 26, 54, .55) 45%, transparent 75%); }
.end .moth { z-index: 2; left: auto; right: 22%; top: 30%; width: 150px; }
.end .moth.sleepy .wl, .end .moth.sleepy .wr { animation-duration: 2.4s; }
.endCopy { position: relative; z-index: 3; width: 100%; display: flex; flex-direction: column; gap: 14px; padding-block: 56px; }
.endCopy h2, .endCopy p { max-width: 24ch; }
.endCopy p { color: rgba(246, 231, 200, .8); max-width: 40ch; }
.end .soonNote { color: #F2A541; }

/* ---------- Paper pages: help and legal ---------- */
.paper { padding-block: 24px 80px; }
.doc.withToc { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 48px; align-items: start; }
.toc { position: sticky; top: 24px; font-size: 14px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; border-left: 2px solid var(--line); padding-left: 14px; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); }
.prose { max-width: 72ch; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.prose h1 { font-size: clamp(32px, 5vw, 46px); font-weight: 800; }
.prose h2 { font-size: 26px; margin-top: 26px; scroll-margin-top: 20px; }
.prose h3 { font-size: 19px; margin-top: 12px; font-family: var(--ui); font-weight: 800; }
.prose p, .prose li { color: var(--ink); }
.prose ul, .prose ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; width: 100%; }
.prose code { font-size: .9em; background: var(--raised); padding: 1px 6px; border-radius: 5px; }
.tableWrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14.5px; min-width: 620px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { background: var(--raised); }
.prose tr:last-child td { border-bottom: 0; }
mark.open { background: #FBE0A6; color: #6a3b00; border-radius: 4px; padding: 0 3px; }
.draft { background: #FBE0A6; color: #6a3b00; font-weight: 800; border-radius: 12px; padding: 10px 14px; margin-bottom: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 7px 15px; font-weight: 800; color: var(--ink); text-decoration: none; font-size: 15px; }
.group { margin-top: 14px; }
.group h2 { margin-top: 12px; }
.contact { background: var(--card); border-radius: 22px; padding: 26px; display: flex; flex-direction: column; gap: 12px; margin-top: 28px; box-shadow: inset 0 0 0 1px var(--line); }
.contact h2 { margin: 0; }
.mail { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mail a { font-size: 22px; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; }
.copy, .button { font: 800 15px var(--ui); background: var(--amber); color: var(--nightInk); border: 0; border-radius: 99px; padding: 9px 18px; cursor: pointer; text-decoration: none; display: inline-block; }

/* 404 */
.lost { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; padding-block: 120px 60px; }
.lost .moth { position: relative; left: auto; top: auto; width: 150px; }
.lost .moth.hiding { animation: peek 5s ease-in-out infinite; }
@keyframes peek { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 30px -6px; rotate: 8deg; } }
.lost p { color: var(--muted); max-width: 44ch; }

/* ---------- Articles: stories, guides, about Kalimo (docs/seo-content.md) ---------- */
.paper .eyebrow { text-decoration: none; }
.byline { color: var(--muted); font-size: 15px; }
.byline a { color: inherit; }
.prose blockquote { margin: 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--line); color: var(--muted); }
.prose blockquote.short { background: var(--card); border: 0; border-radius: 18px; padding: 18px 22px; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 8px; }
.prose blockquote.short ul { padding-left: 20px; }
.pic { margin: 6px 0; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.pic img { width: min(100%, 380px); height: auto; border-radius: 18px; box-shadow: 0 10px 30px rgba(42, 36, 69, .14); }
.pic.cover img { width: min(100%, 420px); }
.pic figcaption { font-size: 14px; color: var(--muted); text-align: center; max-width: 46ch; }
.storyTitle { font-family: var(--display); }
.storyMeta { display: flex; flex-wrap: wrap; gap: 8px; }
.storyMeta span { background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; font-weight: 800; font-size: 14px; }
.aboutBox, .askAfter, .faqBlock, .sources { display: flex; flex-direction: column; gap: 10px; }
.aboutBox { background: var(--card); border-radius: 18px; padding: 18px 22px; box-shadow: inset 0 0 0 1px var(--line); }
.aboutBox h2, .askAfter h2 { font-size: 20px; margin: 0; }
.story { font-family: var(--story); font-size: 20px; line-height: 1.7; display: flex; flex-direction: column; gap: 18px; padding-block: 8px; }
.story p { color: var(--ink); }
.askAfter ul { font-size: 17px; }
.sources ol { font-size: 15px; }
.sources a { overflow-wrap: anywhere; }
.storeBox { display: flex; gap: 18px; align-items: flex-start; background: #1C1A36; color: #F6E7C8; border-radius: 22px; padding: 24px; margin-top: 24px; }
.storeBox img { border-radius: 14px; flex: none; }
.storeBox div { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.storeBox h2 { font-size: 24px; margin: 0; color: #F6E7C8; }
.storeBox p { color: rgba(246, 231, 200, .82); }
.storeBox .soonNote { color: #F2A541; }
.moreList { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.prose .cards { padding: 0; display: grid; flex-direction: unset; gap: 18px; }
.card a { display: flex; flex-direction: column; gap: 6px; height: 100%; background: var(--card); border-radius: 18px; padding: 12px 12px 16px; text-decoration: none; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.card a:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.card img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; }
.card h3 { font-size: 19px; }
.card p { font-size: 15px; color: var(--muted); }
.cardMeta { font-size: 13px; font-weight: 800; color: var(--accent); }
.overview .prose { max-width: none; }
.overview .intro { max-width: 72ch; display: flex; flex-direction: column; gap: 14px; }
.chips a[aria-current] { background: var(--ink); color: var(--card); }
.teaser { display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 560px) {
  .story { font-size: 18px; }
  .storeBox { flex-direction: column; }
  .cards, .prose .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card p { display: none; }
}

/* ---------- Narrow screens ---------- */
@media (max-width: 900px) {
  .trust { grid-template-columns: 1fr; }
  .wonderList { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agePanels { order: -1; padding-top: 0; }
  .steps, .times { grid-template-columns: 1fr; gap: 40px; }
  .wonder { grid-template-columns: 1fr; gap: 32px; }
  .doc.withToc { grid-template-columns: 1fr; }
  .toc { position: static; }
  .hero { height: auto; aspect-ratio: 3 / 4.3; max-height: 760px; }
  .heroCopy { top: calc(76px + env(safe-area-inset-top, 0px)); transform: none; width: auto; right: 20px; gap: 10px; }
  .moth { left: 26%; top: 64%; width: 22%; }
  .end .moth { right: 8%; top: 12%; width: 110px; }
  .end::before { background: linear-gradient(180deg, transparent 0%, rgba(28, 26, 54, .6) 40%, rgba(28, 26, 54, .95) 100%); }
  .end { align-items: flex-end; min-height: 520px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .navHide { display: none; }
  .promises { grid-template-columns: 1fr; }
  .wonderList { grid-template-columns: 1fr; }
  .ageTabs .ask { width: 100%; }
  .ageTabs [role=tab] { min-width: 0; flex: 1; padding-inline: 6px; }
  .strip button { width: 64px; }
  .screenWide { border-radius: 14px; }
  .footIn { grid-template-columns: 1fr; }
  .heroCopy p:not(.heroMeta) { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .moth, .moth img, .tapDot, .lost .moth.hiding, .s1 *, .s2 *, .book * { animation: none !important; }
  .s1 .typed span { opacity: 1; }
  .reel img { animation: none; }
  .reel img:first-child { opacity: 1; }
  .set, body { transition: none; }
}
