/* ============================================================================
   quietly raising · WORLD shared styles  (owner W5, v2 2026-10-16)
   ----------------------------------------------------------------------------
   Used by every page: Home (index.html), Apps (apps/), Story Room (stories/),
   Games Room (games/). Other pages link this file and add their own CSS; they
   do not edit it. v2 = the moss-hill look (style-test/h-master.png): deep moss,
   cream, blush, butter, dusty blue; hand-lettered words in Chewy (the "handmade alphabet" look), body in Nunito.

   HOW TO USE ON A PAGE (paths shown for a page one folder down, e.g. stories/):

     <link rel="stylesheet" href="../shared/world.css">
     <nav class="wnav" aria-label="Main">
       <a class="wnav__home" href="../">Home</a>
       <a href="../stories/" aria-current="page">Story Room</a>
       <a href="../games/">Games Room</a>
       <a class="wnav__apps" href="../apps/">Apps</a>
       <button class="wnav__music" type="button" data-music aria-pressed="false">music off</button>
     </nav>
     ...
     <script src="../shared/world.js" defer></script>

   world.js gives every page: the music toggle (off by default, starts only on a
   tap, choice remembered across pages), and the parental gate on any link that
   leaves the site (App Store, Instagram) or carries data-gate.
   Class names .wnav, .wnav__*, [data-music], .btn, .note, .gate, .wfoot are a
   stable API: other pages rely on them.
   ========================================================================== */

/* Self-hosted fonts. Chewy: Apache 2.0 (Sideshow; the display font, 2026-11-07, F1). Nunito, Caveat, Patrick Hand, Virgil: SIL OFL 1.1.
   Chewy ships one weight, so it is declared for 100-900: a bold h1 or button never gets a synthetic (smeared) bold. */
@font-face { font-family: "Chewy"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/chewy-latin.woff2") format("woff2"); }
@font-face { font-family: "Virgil"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/virgil.woff2") format("woff2"); }
@font-face { font-family: "Caveat"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/caveat-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Caveat"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/caveat-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Patrick Hand"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/patrickhand-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url("fonts/nunito-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url("fonts/nunito-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* v2 palette (BRIEF v2) */
  --moss: #2F4A2A;
  --moss-2: #3E5E33;
  --moss-ink: #1F3320;
  --cream: #F6F0E1;
  --blush: #E9B9B5;
  --butter: #F2E2A6;
  --dusty: #93A4BC;
  --sky: #9DC0E6;

  /* older names other pages already use, retuned to v2 */
  --ink: #26301F;
  --ink-soft: #5C6553;
  --paper: #F6F0E1;
  --sage: #6F8F5E;
  --sage-deep: #3E5E33;
  --honey: #F2E2A6;
  --rose: #E9B9B5;
  --gold: #C9A84C;
  --brown: #2E2218;
  --red: #B8433A;
  --dusk: #4E4A72;
  --night: #1B2230;

  --display: "Chewy", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;   /* THE display font. --hand and --print are aliases: pages that already use var(--hand) get it. */
  --hand: var(--display);
  --print: var(--display);
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  --nav-h: 56px;
  --gutter: 16px;
  --radius-wob: 18px 220px 16px 240px / 240px 16px 220px 18px;
  --shadow-soft: 0 14px 36px -16px rgba(20, 32, 18, 0.55), 0 2px 6px rgba(20, 32, 18, 0.18);
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--blush); color: var(--moss-ink); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2.5px solid var(--butter); outline-offset: 3px; border-radius: 8px; }

/* ── NAV: a soft moss pill that reads on paint and on cream ──────────────── */
.wnav {
  position: fixed; z-index: 50; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0;
  max-width: calc(100vw - 2 * var(--gutter)); height: 46px; padding: 0 5px 0 8px;   /* 46 = 44px links + the 1px border (F1: tap targets) */
  background: rgba(31, 51, 32, 0.46); backdrop-filter: blur(12px) saturate(1.15); -webkit-backdrop-filter: blur(12px) saturate(1.15);
  border: 1px solid rgba(246, 240, 225, 0.22); border-radius: 999px; box-shadow: 0 10px 30px -14px rgba(10, 20, 10, .6);
  font-family: var(--hand); font-size: 17px; line-height: 1; white-space: nowrap; color: var(--cream);
}
.wnav a { display: inline-flex; align-items: center; justify-content: center; align-self: stretch; min-width: 44px; text-decoration: none; color: var(--cream); padding: 0 10px; border-radius: 999px; transition: background .3s, color .3s; }
.wnav a:hover { background: rgba(246, 240, 225, 0.12); }
.wnav a[aria-current="page"] { color: var(--butter); }
.wnav__home::before {
  content: ""; display: inline-block; width: 15px; height: 15px; margin: -3px 6px 0 0; vertical-align: middle;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg fill='%23E9B9B5'%3E%3Cellipse cx='16' cy='8.5' rx='5' ry='7'/%3E%3Cellipse cx='23.5' cy='16' rx='7' ry='5'/%3E%3Cellipse cx='16' cy='23.5' rx='5' ry='7'/%3E%3Cellipse cx='8.5' cy='16' rx='7' ry='5'/%3E%3C/g%3E%3Ccircle cx='16' cy='16' r='3.8' fill='%23F2E2A6'/%3E%3C/svg%3E") center/contain no-repeat;
}
.wnav__music {
  position: relative; margin-left: 4px; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; white-space: nowrap;
  font: inherit; font-size: 15px; color: rgba(246, 240, 225, .8); background: transparent;
  border: 1px solid rgba(246, 240, 225, .3); border-radius: 999px; cursor: pointer; transition: background .3s, color .3s, border-color .3s;
}
.wnav__music::before { content: "\266A"; font-family: system-ui, sans-serif; font-size: 13px; }
.wnav__music::after { content: ""; position: absolute; inset: -7px -3px; }   /* 44px hit area around the 32px pill (F1) */
.wnav__music:hover { background: rgba(246, 240, 225, .1); }
.wnav__music[aria-pressed="true"] { color: var(--moss-ink); background: var(--butter); border-color: var(--butter); }
.wnav__music[aria-pressed="true"]::before { animation: wnote 1.8s ease-in-out infinite; }
@keyframes wnote { 50% { transform: translateY(-2px) rotate(-10deg); } }
@media (max-width: 520px) {
  .wnav { font-size: 15.5px; padding: 0 4px 0 4px; height: 46px; }
  .wnav a { padding: 0 7px; }
  .wnav__home::before { margin-right: 4px; }
  .wnav__music { font-size: 0; width: 32px; padding: 0; justify-content: center; gap: 0; }
  .wnav__music::before { font-size: 15px; }
  .wnav__music::after { inset: -7px -10px -7px -5px; }   /* phone: pill is only 32 wide, so widen the invisible hit area to 45 (left edge stops flush with the Apps link) */
}
@media (max-width: 360px) { .wnav { font-size: 14px; } .wnav a { padding: 0 5px; } .wnav__home::before { display: none; } }

/* ── PAPER NOTES (body copy on a cream card) ─────────────────────────────── */
.note {
  position: relative; max-width: 30rem; padding: 18px 20px 20px;
  background: rgba(246, 240, 225, 0.95); color: var(--ink);
  border-radius: 14px; box-shadow: var(--shadow-soft);
}
.note p { margin: 0 0 .65em; }
.note p:last-child { margin-bottom: 0; }
.kicker { font-family: var(--hand); font-size: 17px; color: var(--sage-deep); margin: 0 0 4px; letter-spacing: .01em; }

/* Hand-lettered words (white marker on paint). Pages split them into letters to write them in. */
.hand { font-family: var(--hand); font-weight: 400; line-height: 1.02; letter-spacing: .01em; }
.hand--white { color: #FFFDF6; -webkit-text-stroke: .008em #FFFDF6; paint-order: stroke fill; text-shadow: 0 2px 14px rgba(15, 28, 14, .35); }

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px;
  font-family: var(--display); font-weight: 400; font-size: 19px; line-height: 1.1; letter-spacing: .015em; text-decoration: none; color: var(--cream);
  background: var(--moss); border: 0; border-radius: 999px; box-shadow: 0 8px 20px -10px rgba(20, 32, 18, .7);
  transition: transform .25s var(--ease-out), box-shadow .25s, background .25s; cursor: pointer;
}
.btn:hover { transform: translateY(-2px); background: var(--moss-2); box-shadow: 0 12px 24px -12px rgba(20, 32, 18, .75); }
.btn--spark { background: var(--brown); color: var(--cream); }
.btn--spark .btn__dot { background: var(--gold); }
.btn__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blush); }
.btn--ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn--cream { background: var(--cream); color: var(--moss-ink); }
.btn--cream:hover { background: #fffaf0; }

/* ── PARENTS' PIN GATE (UX1) ─────────────────────────────────────────────── */
.gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: var(--gutter); background: rgba(47, 38, 24, .5); overflow-y: auto; }
.gate[hidden] { display: none; }
.gate__card { width: min(360px, 100%); margin: auto; padding: 22px 18px 14px; background: #FBF4E4; border: 3px solid #2B2620; border-radius: 22px 26px 20px 28px / 26px 20px 28px 22px; box-shadow: 0 6px 0 #2B2620, 0 30px 50px -24px rgba(0, 0, 0, .55); text-align: center; color: #2B2620; outline: none; }
.gate__title { font-family: var(--hand); font-size: 28px; margin: 0 0 6px; line-height: 1.05; color: var(--moss-ink); letter-spacing: .01em; }
.gate__text { margin: 0 0 12px; color: #4A433A; font-size: 16px; line-height: 1.4; }
.gate__dots { display: flex; justify-content: center; gap: 14px; margin: 4px 0 6px; }
.gate__dots i { width: 20px; height: 20px; border-radius: 50%; border: 3px solid #2B2620; background: transparent; }
.gate__dots i.on { background: var(--moss); border-color: var(--moss); }
.gate__dots.bad i { border-color: #A33A2B; }
@media (prefers-reduced-motion: no-preference) { .gate__dots.bad { animation: gateShake .4s; } }
@keyframes gateShake { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.gate__msg { min-height: 2.6em; margin: 0 0 6px; font-size: 15px; line-height: 1.3; font-weight: 700; color: #8E2F22; }
.gate__pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto 10px; }
.gate__key { min-height: 64px; font: 400 30px/1 var(--hand); color: #2B2620; background: #FFFDF6; border: 2.5px solid #2B2620; border-radius: 16px; box-shadow: 0 4px 0 #2B2620; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: transform .08s; }
.gate__key:hover { background: var(--butter); }
.gate__key:active { transform: translateY(3px); box-shadow: 0 1px 0 #2B2620; }
.gate__key--fn { font: 800 16px var(--body); background: #F0E6CC; }
.gate__key--fn svg { width: 28px; height: 28px; display: block; margin: 0 auto; }
.gate__key[disabled] { opacity: .45; cursor: default; }
.gate__key:focus-visible, .gate__link:focus-visible, .gate__close:focus-visible { outline: 3px solid #1F6FB5; outline-offset: 2px; }
.gate__note { margin: 0 0 8px; padding: 8px 10px; border-radius: 10px; background: #F7E3B0; font-size: 14px; line-height: 1.35; color: #4A3A10; }
.gate__row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gate__link, .gate__close { min-height: 44px; font: 700 15px var(--body); color: #4A433A; background: none; border: 0; padding: 8px 10px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.gate__help { margin: 4px 0 6px; padding: 10px 12px; border-radius: 12px; background: #F0E6CC; font-size: 14px; line-height: 1.45; text-align: left; color: #2B2620; }

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
.wfoot { font-size: 14px; color: rgba(246, 240, 225, .82); text-align: center; padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom)); }
.wfoot a { color: inherit; text-underline-offset: 3px; }
.wfoot__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 8px 0; }
.wfoot__ai { font-size: 13px; opacity: .8; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ============================================================================
   W4a, 2026-11-16: kids' menu of three, menu "mini" mode, disclaimer line,
   grown-up notes. Class names .wnav--kids, .wnav__i, [data-nav], .wfoot__fun,
   .wfoot__grown, .wmakers, .wsupport are a stable API.
   ========================================================================== */

/* ── KIDS' MENU: a painted picture with the word under it ─────────────────── */
.wnav--kids { height: 58px; padding: 0 8px 0 6px; gap: 2px; background: rgba(31, 51, 32, 0.62); }
.wnav--kids .wnav__i { flex-direction: column; gap: 2px; min-width: 56px; padding: 0 8px; border-radius: 16px; font-size: 14px; line-height: 1; letter-spacing: .02em; }
.wnav--kids .wnav__i img { width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(246, 240, 225, .85); transition: transform .3s var(--ease-out); }
.wnav--kids .wnav__i:hover img { transform: scale(1.08) rotate(-3deg); }
.wnav--kids .wnav__i.is-here, .wnav--kids .wnav__i[aria-current="page"] { color: var(--butter); }
.wnav--kids .wnav__i.is-here img { box-shadow: 0 0 0 2.5px var(--butter); }
.wnav--kids .wnav__home::before { content: none; display: none; }
.wnav--kids .wnav__music { margin-left: 6px; }
@media (max-width: 520px) {
  .wnav--kids { height: 58px; padding: 0 8px 0 4px; }
  .wnav--kids .wnav__i { min-width: 58px; padding: 0 6px; font-size: 14px; }
  .wnav--kids .wnav__music { width: 34px; height: 34px; }
  .wnav--kids .wnav__music::after { inset: -12px -6px; }
}
@media (max-width: 360px) { .wnav--kids { font-size: 14px; } .wnav--kids .wnav__i { min-width: 52px; padding: 0 4px; } }

/* ── MENU OUT OF THE WAY (books, games): <body data-nav="mini"> or QRWorld.nav('mini') ──
   One small round Home button in the top left corner. data-nav="none" hides the menu completely
   (only for a screen that has its own way home). Works on the plain HTML menu too. */
[data-nav="mini"] .wnav { left: max(10px, env(safe-area-inset-left)); top: max(10px, env(safe-area-inset-top)); transform: none; width: 48px; height: 48px; padding: 0; gap: 0; border-radius: 50%; overflow: hidden; background: rgba(31, 51, 32, 0.5); }
[data-nav="mini"] .wnav > *:not(.wnav__home) { display: none; }
[data-nav="mini"] .wnav .wnav__home { width: 48px; height: 48px; min-width: 48px; padding: 0; border-radius: 50%; font-size: 0; }
[data-nav="mini"] .wnav .wnav__home img { width: 40px; height: 40px; }
[data-nav="mini"] .wnav .wnav__home::before { margin: 0; width: 24px; height: 24px; }
[data-nav="mini"] .wnav .wnav__home span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[data-nav="none"] .wnav { display: none; }

/* ── FOOTER: the disclaimer and the one Grown-ups link ───────────────────── */
.wfoot__fun { margin: 6px auto; max-width: 34rem; font-size: 13.5px; line-height: 1.45; }
.wfoot__grown { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-size: 14px; }

/* ── GROWN-UP NOTE: "From the makers of Bloom and Spark" ─────────────────────
   Small text for the adult in the room. Deliberately NOT a button: no fill, no shadow, body font. */
.wmakers { display: block; max-width: 30rem; margin: 18px auto 0; padding: 10px 14px; font-family: var(--body); font-size: 14px; line-height: 1.45; text-align: center;
  color: #4A433A; background: rgba(246, 240, 225, .92); border: 1px dashed rgba(43, 38, 32, .35); border-radius: 12px; }
.wmakers__for { display: inline-block; margin-right: 4px; padding: 1px 8px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #4A433A; border: 1px solid rgba(43, 38, 32, .4); border-radius: 999px; }
.wmakers a { color: #1F3320; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; display: inline-block; padding: 6px 2px; }
.wmakers--dark { color: rgba(246, 240, 225, .92); background: rgba(20, 30, 20, .55); border-color: rgba(246, 240, 225, .35); }
.wmakers--dark .wmakers__for { color: rgba(246, 240, 225, .92); border-color: rgba(246, 240, 225, .45); }
.wmakers--dark a { color: var(--butter); }

/* ── "SUPPORT THIS SITE" block (Grown-ups page and About only, never a kid's screen) ── */
.wsupport { max-width: 34rem; padding: 18px 20px; background: #FFF8E3; border: 2px solid #2B2620; border-radius: 18px; color: #2B2620; }
.wsupport h2 { margin: 0 0 6px; font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.1; }
.wsupport p { margin: 0 0 12px; font-size: 16px; line-height: 1.5; }
.wsupport p:last-child { margin-bottom: 0; }
.wsupport .btn[hidden] { display: none; }
.wsupport__small { font-size: 13.5px !important; color: #4A433A; }

/* ── PIN gate: the first-use check shows the number in words and the digits typed ── */
.gate__num { display: block; margin-top: 6px; font: 400 23px/1.2 var(--hand); color: var(--moss-ink); letter-spacing: .01em; }
.gate__dots.show i { width: 34px; height: 40px; border-radius: 10px; display: grid; place-items: center; font: 400 24px/1 var(--hand); font-style: normal; color: #2B2620; background: #FFFDF6; }
.gate__dots.show i.on { background: #FFFDF6; border-color: #2B2620; }
/* the small footer world.js adds to a grown-up page that has none (Apps) */
.wfoot--auto { position: relative; z-index: 5; color: #4A433A; background: #F6F0E1; border-top: 1.5px solid rgba(43, 38, 32, .2); padding: 14px var(--gutter) calc(16px + env(safe-area-inset-bottom)); font-family: var(--body); }
.wfoot--auto a { color: #1F3320; display: inline-flex; align-items: center; min-height: 44px; }
