/* ============================================================================
   Wonder Path · CALM page engine styles (W3, 2026-11-16; promoted from _drafts/calm-prototype)
   One screen = one idea = one thing to do. Pages load: shared/world.css, then this file, then (optional) a small page css.
   Same brand: Chewy headings, Nunito words, cream paper, an ink outline ONLY on things a child touches,
   one accent (moss green) for the one thing to press. 44px+ targets. Reduced motion turns every animation off.
   Everything is scoped to body.calm so it never touches the old ppd.css pages.
   ========================================================================== */
@font-face { font-family: "Chewy"; font-style: normal; font-weight: 400; font-display: swap; src: url("../../shared/fonts/chewy-latin.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url("../../shared/fonts/nunito-latin.woff2") format("woff2"); }
body.calm {
  --paper: #FBF4E4; --raise: #FFFDF6; --ink: #2B2620; --soft: #4F473D;
  --accent: #2F4A2A; --accent-dark: #1D3019; --accent-h: #3E5E33; --cream: #FFF8E8;
  --ok: #2E7D4B; --ok-bg: #D8F0DE; --warm: #B5441C; --warm-bg: #FADBC8; --gold: #E9C46A; --teal: #1F7A6B; --listen: #DDF1EC;
  --display: "Chewy", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tint: #FBF4E4;
  margin: 0; background: var(--tint); color: var(--ink); font: 700 20px/1.45 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; transition: background-color .5s;
}
.calm button { font: inherit; color: inherit; }
.calm [hidden] { display: none !important; }
.calm .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }
.calm :focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 10px; }

/* the shell: exactly one screen tall */
.c-app { display: flex; flex-direction: column; height: 100vh; height: 100svh; max-width: 1000px; margin: 0 auto; }
.c-top { flex: none; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 8px 12px 0 64px; min-height: 64px; }
.c-back, .c-ex { display: inline-flex; align-items: center; gap: 8px; min-width: 48px; min-height: 48px; padding: 0 12px; font: 400 18px/1 var(--display); color: var(--ink); background: transparent; border: 0; border-radius: 999px; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; text-decoration: none; }
.c-back { justify-self: start; } .c-ex { justify-self: end; color: var(--soft); }
.c-back svg { width: 26px; height: 26px; }
.c-back:hover, .c-ex:hover { background: rgba(43, 38, 32, .07); }
.c-ex i { position: relative; width: 36px; height: 22px; border-radius: 999px; background: rgba(43, 38, 32, .22); transition: background .2s; }
.c-ex i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.c-ex[aria-pressed="true"] { color: var(--ink); } .c-ex[aria-pressed="true"] i { background: var(--accent); } .c-ex[aria-pressed="true"] i::after { transform: translateX(14px); }
.c-dots { justify-self: center; display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; gap: 5px; margin: 0; padding: 0; list-style: none; }
.c-dots li { width: 10px; height: 10px; border-radius: 50%; background: rgba(43, 38, 32, .16); transition: transform .25s, background .25s; }
.c-dots li.done { background: rgba(43, 38, 32, .5); } .c-dots li.now { background: var(--accent); transform: scale(1.5); }

.c-scene { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; padding: 4px 16px 0; overflow-y: auto; overflow-x: hidden; outline: none; }
.c-scene.enter { animation: calmIn .35s ease-out; }
@keyframes calmIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.c-art { flex: 1 1 0; min-height: 190px; container-type: size; display: grid; place-items: center; position: relative; }
.c-art--stack { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px; container-type: normal; }
.c-pic { flex: 1 1 0; min-height: 0; width: 100%; container-type: size; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; overflow: hidden; }
.c-tray { flex: none; width: 100%; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.c-tray--col { flex-direction: column; }
.c-fit { position: relative; width: min(100cqw, calc(100cqh * var(--r, 1))); aspect-ratio: var(--r, 1); }
.c-fit img, .c-fit canvas, .c-fit svg { display: block; width: 100%; height: 100%; }
.c-fit img { object-fit: contain; }
.c-fill { position: relative; width: 100%; height: 100%; }

.c-first .c-words { order: -1; padding: 4px 0 2px; }
.c-words { flex: none; text-align: center; padding: 8px 0 6px; }
.c-head { margin: 0 0 4px; font: 400 30px/1.1 var(--display); letter-spacing: .01em; }
.c-head--big { font-size: 44px; }
.c-head:empty { display: none; }
.c-note { margin: 0 auto 6px; max-width: 34ch; font: 700 14px/1.35 var(--body); color: var(--soft); }
.c-line { margin: 0 auto; max-width: 30ch; font: 700 22px/1.4 var(--body); color: var(--ink); min-height: 1.4em; border-radius: 12px; transition: background-color .2s; }
.c-line.can-hear { cursor: pointer; -webkit-tap-highlight-color: rgba(31, 122, 107, .16); }
.c-line.is-voicing, .c-exl.is-voicing { background: rgba(233, 196, 106, .42); box-shadow: 0 0 0 6px rgba(233, 196, 106, .42); }
.c-exl { margin: 10px auto 0; max-width: 32ch; font: 700 18px/1.4 var(--body); color: var(--soft); border-radius: 10px; }
.c-listen { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 48px; min-height: 48px; margin: 10px auto 0; padding: 0 18px 0 14px; font: 800 17px var(--body); color: var(--ink); background: var(--listen); border: 0; border-radius: 999px; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.c-listen:hover { background: #C8E8E0; } .c-listen svg { width: 26px; height: 26px; color: var(--teal); flex: none; }
.c-listen .bars { display: none; align-items: flex-end; gap: 3px; height: 20px; } .c-listen .bars i { width: 4px; height: 70%; border-radius: 2px; background: #8A650E; }
.c-listen.is-playing { background: #FBE9B5; } .c-listen.is-playing svg { display: none; } .c-listen.is-playing .bars { display: flex; }
.c-listen.is-blocked { background: var(--warm-bg); }
@media (prefers-reduced-motion: no-preference) { .c-listen.is-playing .bars i { animation: calmBar .9s ease-in-out infinite; } .c-listen.is-playing .bars i:nth-child(2) { animation-delay: .15s; } .c-listen.is-playing .bars i:nth-child(3) { animation-delay: .3s; } }
@keyframes calmBar { 0%, 100% { height: 30%; } 50% { height: 100%; } }

/* the ONE thing to press */
.c-foot { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; min-height: 92px; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); }
.c-foot > * { grid-row: 1; }
.c-nav { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 54px; padding: 0 18px; font: 400 22px/1 var(--display); letter-spacing: .015em; color: var(--ink); background: var(--raise); border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.c-nav svg { width: 22px; height: 22px; flex: none; } .c-nav:hover { background: #FFF1C9; } .c-nav:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.c-nav--prev { grid-column: 1; justify-self: start; padding-left: 12px; } .c-nav--next { grid-column: 3; justify-self: end; padding-right: 12px; }
.c-main { grid-column: 2; min-height: 60px; min-width: min(100%, 200px); padding: 0 34px; font: 400 25px/1.1 var(--display); letter-spacing: .015em; color: var(--cream); background: var(--accent); border: 2.5px solid var(--accent-dark); border-radius: 999px; box-shadow: 0 4px 0 var(--accent-dark); cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform .15s, background .15s; }
.calm .c-main { color: var(--cream); }
.c-main:hover { background: var(--accent-h); } .c-main:active, .c-main.is-down { transform: translateY(2px); box-shadow: 0 2px 0 var(--accent-dark); background: var(--accent-h); }
.c-main[hidden] { display: inline-block !important; visibility: hidden; }
.c-main.is-forward { grid-column: 3; justify-self: end; min-width: 0; padding: 0 26px; }
.c-main.is-forward::after { content: "\203A"; margin-left: 8px; font-size: 1.15em; line-height: 1; }

/* pictures sit on the page, no frame */
.c-hero { width: min(64vw, 320px, 100cqh); aspect-ratio: 1; border-radius: 50%; overflow: hidden; box-shadow: 0 14px 26px -16px rgba(43, 38, 32, .6); background: #efe3c8; }
.c-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (prefers-reduced-motion: no-preference) { .c-hero img { animation: calmBreathe 4.2s ease-in-out infinite; } }
@keyframes calmBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
.c-host { width: min(42vw, 180px, 70cqh); aspect-ratio: 1; display: block; margin: 0 auto; object-fit: contain; }
@media (prefers-reduced-motion: no-preference) { .c-host { animation: calmFloat 3.6s ease-in-out infinite; } }
@keyframes calmFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.c-canvas { position: relative; width: 100%; height: 100%; border-radius: 22px; overflow: hidden; }
.c-canvas canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.c-canvas .c-load { position: absolute; inset: 0; display: grid; place-items: center; font: 800 16px var(--body); color: #e9e4ff; transition: opacity .4s; pointer-events: none; }
.c-canvas.ready .c-load { opacity: 0; visibility: hidden; }
.c-canvas.flat canvas { display: none; } .c-canvas > img { width: 100%; height: 100%; object-fit: cover; }
.c-fit.c-night { border-radius: 22px; overflow: hidden; }
.c-night { background: radial-gradient(ellipse at 50% 40%, #1d2560, #070a22); }

/* things a child touches: simple outlined pills / cards */
.c-pin, .c-tok, .c-tool, .c-opt { color: var(--ink); background: var(--raise); border: 2.5px solid var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.c-pin:hover:not([disabled]), .c-tok:hover:not([disabled]), .c-tool:hover:not([disabled]), .c-opt:hover:not([disabled]) { background: #FFF1C9; }
.calm .ok { background: var(--ok-bg) !important; border-color: var(--ok) !important; }
.calm .no { background: var(--warm-bg) !important; border-color: var(--warm) !important; }
.calm .shake { animation: calmShake .4s; } @keyframes calmShake { 25% { translate: -5px 0; } 75% { translate: 5px 0; } }
.c-tok { min-height: 52px; padding: 6px 20px; font: 400 22px/1.1 var(--display); border-radius: 999px; box-shadow: 0 3px 0 var(--ink); }
.c-tok[disabled] { opacity: .55; cursor: default; }
.c-tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: 0 0 calc(33.3% - 8px); min-height: 84px; padding: 8px 4px 6px; font: 400 18px/1.1 var(--display); border-radius: 16px; }
.c-tool svg { width: 42px; height: 42px; } .c-tool[disabled] { cursor: default; } .c-tool.no { opacity: .75; }
.c-opt { width: 100%; max-width: 420px; min-height: 58px; padding: 8px 18px; font: 800 20px/1.25 var(--body); border-radius: 18px; box-shadow: 0 3px 0 var(--ink); text-align: center; }
.c-opt[disabled]:not(.ok):not(.no) { opacity: .6; cursor: default; }
.c-range { -webkit-appearance: none; appearance: none; width: min(100%, 420px); height: 48px; background: transparent; cursor: pointer; touch-action: pan-y; }
.c-range::-webkit-slider-runnable-track { height: 14px; border-radius: 999px; background: var(--trk, rgba(43, 38, 32, .2)); border: 2px solid var(--ink); }
.c-range::-moz-range-track { height: 14px; border-radius: 999px; background: var(--trk, rgba(43, 38, 32, .2)); border: 2px solid var(--ink); }
.c-range::-webkit-slider-thumb { -webkit-appearance: none; width: 40px; height: 40px; margin-top: -15px; border-radius: 50%; background: var(--raise); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.c-range::-moz-range-thumb { width: 36px; height: 36px; border-radius: 50%; background: var(--raise); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }

/* tiny round pips: progress inside a game (no boxes, no numbers) */
.c-pips { display: flex; justify-content: center; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; flex: none; }
.c-pips li { width: 9px; height: 9px; border-radius: 50%; background: rgba(43, 38, 32, .16); } .c-pips li.done { background: var(--ok); } .c-pips li.now { background: var(--ink); transform: scale(1.35); }

/* the grown-up apps note on the last screen (shared/world.js): keep its link a finger-sized target */
.calm .wmakers { margin: 6px auto 0; font-size: 15px; } .calm .wmakers a { display: inline-flex; align-items: center; min-height: 44px; }
/* the shared footer sits below the play screen */
.calm .wfoot { color: var(--soft); background: transparent; padding: 18px 16px calc(22px + env(safe-area-inset-bottom)); font-size: 14px; }
.calm .wfoot a { color: #1F3320; display: inline-flex; align-items: center; min-height: 44px; margin: 0 8px; }

/* wider screens: a big picture on the left, the words on the right, nothing ever scrolls inside the play screen */
.c-back__t { display: none; }
@media (min-width: 820px) and (min-height: 560px) {
  .c-app { max-width: 1640px; } .c-top { padding: 8px 28px 0 76px; } .c-back__t { display: inline; }
  .c-scene { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(300px, 1fr); grid-template-rows: minmax(0, 1fr) auto; column-gap: 48px; align-items: stretch; padding: 6px 36px 0; overflow: hidden; }
  .c-art, .c-art--stack { grid-column: 1; grid-row: 1; flex: none; width: 100%; height: 100%; min-width: 0; min-height: 0; }
  .c-pips { grid-column: 1; grid-row: 2; margin: 10px 0 2px; }
  .c-words, .c-first .c-words { grid-column: 2; grid-row: 1 / span 2; align-self: center; order: 0; max-height: 100%; overflow-y: auto; text-align: left; padding: 4px; }
  .c-line, .c-exl, .c-note { margin-left: 0; max-width: 30ch; } .c-line { font-size: 27px; } .c-exl { font-size: 20px; }
  .c-head { font-size: 40px; } .c-head--big { font-size: 60px; } .c-listen { margin-left: 0; }
  .c-hero { width: min(100cqw, 100cqh, 680px); } .c-host { width: min(100%, 340px, 80cqh); }
  .c-opt { max-width: 620px; min-height: 68px; font-size: 24px; } .c-tok { min-height: 58px; font-size: 25px; } .c-range { width: min(100%, 640px); }
  .c-foot { padding: 10px 36px calc(16px + env(safe-area-inset-bottom)); } .c-nav { min-height: 60px; padding: 0 26px; font-size: 26px; } .c-nav--prev { padding-left: 16px; } .c-nav--next { padding-right: 16px; } .c-main { min-height: 64px; font-size: 28px; }
}
@media (max-width: 430px) { .c-foot { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding-left: 10px; padding-right: 10px; } .c-main:not(.is-forward) { justify-self: center; max-width: 100%; } .c-nav { padding: 0 12px 0 8px; font-size: 19px; min-height: 50px; } .c-nav--next { padding: 0 8px 0 12px; } .c-main { min-width: 0; padding: 0 18px; font-size: 21px; min-height: 56px; } .c-main.is-forward { padding: 0 18px; } .c-top { gap: 4px; padding-right: 6px; } .c-dots { gap: 4px; } .c-dots li { width: 8px; height: 8px; } .c-ex { padding: 0 6px; gap: 6px; font-size: 16px; } }
@media (max-height: 520px) and (orientation: landscape) { .c-art { min-height: 120px; } .c-line { font-size: 19px; } .c-foot { min-height: 76px; } .c-main { min-height: 52px; } .c-top { min-height: 52px; } }
@media (prefers-reduced-motion: reduce) {
  .calm *, .calm *::before, .calm *::after { animation: none !important; transition: none !important; }
  body.calm { transition: none; }
}
