/* ─────────────────────────────────────────────────────────────
   playful-shell.css · the Playful theme's header, footer and
   floating "Get the app" pill, shared by every page.

   Drop-in:
     <link rel="stylesheet" href="/playful-shell.css">
     <script src="/playful-shell.js" defer></script>
     <header data-np-shell="header"></header>   (top of <body>)
     <footer data-np-shell="footer"></footer>   (end of page)
   The script fills both and adds the pill and the phone menu.

   Everything is scoped under .nps- classes, and the properties that
   old pages set on bare header / nav / footer / a are set explicitly
   here, so the shell looks the same on any page and never changes
   the page's own styles.
   ───────────────────────────────────────────────────────────── */

:root {
  --nps-ink: #13213c;
  --nps-mango: #ffb000;
  --nps-beet: #a4134a;
  --nps-tomato: #ff4b3e;
  --nps-pista: #9fd36b;
  --nps-paper: #ffffff;
  --nps-disp: 'Bricolage Grotesque', 'Arial Black', system-ui, sans-serif;
  --nps-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --nps-b: 3px solid #13213c;
  --nps-spring: cubic-bezier(.34, 1.56, .64, 1);
  --nps-head-h: 76px;
}
@media (max-width: 640px) { :root { --nps-head-h: 66px; } }

/* placeholders hold their space before the script runs (no jump) */
header[data-np-shell="header"] { display: block; min-height: var(--nps-head-h); background: #fff; border-bottom: 3px solid #13213c; }
footer[data-np-shell="footer"] { display: block; min-height: 320px; background: #13213c; }

.nps-ic { width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: middle; }

/* ── header ─────────────────────────────────────────────────── */
.nps-head {
  position: sticky; top: env(safe-area-inset-top, 0px); left: auto; right: auto; z-index: 900;
  display: block; height: auto; min-height: var(--nps-head-h); margin: 0; padding: 0;
  background: #fff; color: var(--nps-ink); border: 0; border-bottom: var(--nps-b);
  box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  font-family: var(--nps-body); font-size: 16px; line-height: 1.4; text-align: left;
  transition: box-shadow .25s ease;
}
.nps-head.nps-scrolled { box-shadow: 0 6px 0 rgba(19, 33, 60, .08); }
.nps-safe-top { position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 901; background: #fff; pointer-events: none; }
.nps-wrap {
  max-width: 1280px; margin: 0 auto; box-sizing: border-box;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.nps-head .nps-wrap { display: flex; align-items: center; gap: 20px; height: var(--nps-head-h); }
.nps-head *, .nps-foot *, .nps-sheet *, .nps-fab, .nps-fab * { box-sizing: border-box; }

.nps-brand { display: flex; align-items: center; gap: 10px; flex: none; text-decoration: none; color: var(--nps-ink); }
.nps-brand:hover { color: var(--nps-ink); text-decoration: none; }
.nps-brand img { width: 40px; height: 40px; display: block; margin: 0; }
.nps-brand b { font-family: var(--nps-disp); font-weight: 800; font-size: 23px; letter-spacing: -.02em; font-variation-settings: 'wdth' 90; line-height: 1; color: inherit; }

.nps-nav {
  position: static; display: flex; gap: 4px; margin: 0 0 0 auto; padding: 0;
  height: auto; width: auto; background: none; border: 0; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.nps-nav a {
  font-family: var(--nps-body); font-weight: 700; font-size: 16px; line-height: 1.2; letter-spacing: 0; text-transform: none;
  color: var(--nps-ink); text-decoration: none; padding: 10px 12px; border-radius: 12px; transition: background .2s;
}
.nps-nav a::after { display: none !important; }
.nps-nav a:hover, .nps-nav a.nps-on { background: #ffefc7; color: var(--nps-ink); text-decoration: none; }

.nps-cta { display: flex; gap: 12px; align-items: center; }
.nps-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 16px; margin: 0;
  border: var(--nps-b); border-radius: 13px; background: #fff; color: var(--nps-ink);
  font: 800 15.5px/1.1 var(--nps-body); letter-spacing: 0; text-transform: none; text-decoration: none; white-space: nowrap;
  box-shadow: 3px 3px 0 var(--nps-ink); cursor: pointer;
  transition: transform .18s var(--nps-spring), box-shadow .18s ease, background .2s ease;
}
.nps-btn img { width: 22px; height: 22px; display: block; }
.nps-btn .nps-ic { width: 19px; height: 19px; }
.nps-btn.nps-mango { background: var(--nps-mango); }
.nps-head .nps-btn:hover, .nps-sheet .nps-btn:hover, .nps-foot .nps-btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--nps-ink); color: var(--nps-ink); text-decoration: none; }
.nps-head .nps-btn:active, .nps-sheet .nps-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--nps-ink); }

.nps-menu {
  display: none; width: 46px; height: 46px; padding: 0; margin: 0;
  border: var(--nps-b); border-radius: 13px; background: #fff; color: var(--nps-ink);
  box-shadow: 3px 3px 0 var(--nps-ink); align-items: center; justify-content: center; cursor: pointer;
}
.nps-menu .nps-ic { width: 22px; height: 22px; }
.nps-head .nps-menu:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--nps-ink); }
.nps-sheet .nps-x:hover { transform: rotate(90deg); }

:where(.nps-head, .nps-sheet, .nps-foot, .nps-fab) :focus-visible { outline: 3px solid var(--nps-beet); outline-offset: 3px; }

@media (max-width: 1180px) { .nps-nav { display: none; } .nps-menu { display: inline-flex; } .nps-cta { margin-left: auto; } }
@media (max-width: 640px) {
  .nps-head .nps-wrap { gap: 10px; }
  .nps-brand img { width: 34px; height: 34px; }
  .nps-brand b { font-size: 20px; }
  .nps-cta .nps-call { display: none; }
  .nps-cta .nps-mango { min-height: 42px; padding: 0 12px; font-size: 14.5px; }
  .nps-cta .nps-mango img { display: none; }
  .nps-menu { width: 42px; height: 42px; }
}
@media (max-width: 370px) { .nps-brand b { font-size: 18px; } }

/* ── phone menu sheet ───────────────────────────────────────── */
.nps-sheet {
  position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column;
  background: var(--nps-ink); color: #fff; font-family: var(--nps-body);
  padding: calc(env(safe-area-inset-top, 0px) + 14px) max(20px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 24px) max(20px, env(safe-area-inset-left, 0px));
  transform: translateY(-104%); visibility: hidden; transition: transform .5s var(--nps-spring), visibility .5s;
}
.nps-sheet.nps-open { transform: none; visibility: visible; }
.nps-sheet-top { display: flex; justify-content: space-between; align-items: center; height: 52px; }
.nps-sheet .nps-brand, .nps-sheet .nps-brand:hover { color: #fff; }
.nps-x {
  width: 46px; height: 46px; padding: 0; border-radius: 13px; border: 3px solid #fff; background: transparent; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.nps-x .nps-ic { width: 24px; height: 24px; }
.nps-sheet nav { position: static; display: flex; flex-direction: column; margin: 28px 0 0; padding: 0; height: auto; background: none; border: 0; }
.nps-sheet nav a {
  display: flex; justify-content: space-between; align-items: center; padding: 6px 0;
  font-family: var(--nps-disp); font-weight: 800; font-size: clamp(34px, 9vw, 52px); line-height: 1.15; letter-spacing: -.02em;
  color: #fff; text-decoration: none; border-bottom: 2px solid rgba(255, 255, 255, .14);
}
.nps-sheet nav a:hover { color: var(--nps-mango); text-decoration: none; }
.nps-sheet nav a .nps-ic { color: var(--nps-mango); width: 28px; height: 28px; }
.nps-sheet-btns { display: grid; gap: 12px; margin-top: auto; padding-top: 24px; }
.nps-sheet-btns .nps-btn { width: 100%; min-height: 56px; font-size: 17px; border-radius: 16px; box-shadow: 4px 4px 0 #000; }

/* ── footer ─────────────────────────────────────────────────── */
.nps-foot {
  display: block; position: static; margin: 0; min-height: 0;
  background: var(--nps-ink); color: #fff; border: 0; border-top: var(--nps-b);
  padding: clamp(56px, 6vw, 88px) 0 calc(28px + env(safe-area-inset-bottom, 0px));
  font-family: var(--nps-body); font-size: 16px; line-height: 1.5; text-align: left;
}
.nps-foot-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
@media (max-width: 960px) { .nps-foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .nps-foot-grid { grid-template-columns: 1fr; } }
.nps-foot .nps-brand, .nps-foot .nps-brand:hover { color: #fff; }
.nps-foot .nps-brand b { font-size: 26px; }
.nps-foot p { margin: 0; color: inherit; }
.nps-tag { font-family: var(--nps-disp); font-weight: 700; font-size: 21px; line-height: 1.25; margin-top: 16px !important; max-width: 24ch; font-variation-settings: 'wdth' 90; }
.nps-est { margin-top: 10px !important; opacity: .75; font-size: 15.5px; }
.nps-soc { display: flex; gap: 10px; margin-top: 18px; }
.nps-soc a {
  width: 46px; height: 46px; border-radius: 14px; border: 3px solid #fff; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  transition: background .2s, transform .3s var(--nps-spring), border-color .2s, color .2s;
}
.nps-soc a:hover { background: var(--nps-mango); color: var(--nps-ink); border-color: var(--nps-mango); transform: rotate(-6deg); text-decoration: none; }
.nps-soc .nps-ic { width: 22px; height: 22px; }
.nps-foot h4 {
  margin: 0 0 14px; padding: 0; font-family: var(--nps-body); font-weight: 800; font-size: 13px; line-height: 1.2;
  letter-spacing: .14em; text-transform: uppercase; color: var(--nps-mango);
}
.nps-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.nps-foot li { margin: 0; padding: 0; }
.nps-foot ul a { color: #fff; text-decoration: none; font-weight: 600; font-size: 16px; opacity: .92; }
.nps-foot ul a:hover { color: #fff; opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.nps-rzp-badge { display: inline-block; line-height: 0; border-radius: 8px; }
.nps-rzp-badge img { height: 45px; width: 113px; display: block; border-radius: 6px; }
.nps-rzp { display: inline-flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 10px 14px; color: #072654; text-decoration: none; }
.nps-rzp .nps-ic { width: 28px; height: 28px; color: #3395ff; }
.nps-rzp small { display: block; font-size: 11px; font-weight: 700; color: #5b6b84; line-height: 1; }
.nps-rzp b { display: block; font-family: var(--nps-body); font-weight: 800; font-size: 20px; letter-spacing: -.01em; line-height: 1.1; color: #072654; }
.nps-pay { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.nps-pay span { border: 2px solid rgba(255, 255, 255, .4); border-radius: 999px; padding: 5px 12px; font-weight: 700; font-size: 14px; }
.nps-foot-bottom {
  margin-top: 44px; padding-top: 22px; border-top: 2px solid rgba(255, 255, 255, .14);
  display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; font-size: 14.5px; opacity: .85; line-height: 1.5;
}

/* ── floating "Get the app" pill ────────────────────────────── */
.nps-fab {
  position: fixed; z-index: 800;
  right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 20px 0 10px;
  border: var(--nps-b); border-radius: 999px; background: var(--nps-mango); color: var(--nps-ink);
  font: 800 16.5px/1.1 var(--nps-body); text-decoration: none; box-shadow: 5px 5px 0 var(--nps-ink);
  transition: transform .5s var(--nps-spring), opacity .3s ease;
}
.nps-fab:hover { color: var(--nps-ink); text-decoration: none; transform: translate(-2px, -2px) rotate(-2deg); }
.nps-fab img { width: 36px; height: 36px; background: #fff; border-radius: 50%; border: 2px solid var(--nps-ink); padding: 4px; display: block; }
.nps-fab .nps-ic { width: 20px; height: 20px; }
.nps-fab.nps-hide { transform: translateY(160%); opacity: 0; pointer-events: none; }
@keyframes nps-wiggle { 0%, 86%, 100% { transform: rotate(0); } 89% { transform: rotate(-7deg); } 92% { transform: rotate(6deg); } 95% { transform: rotate(-3deg); } }
.nps-fab:not(.nps-hide) { animation: nps-wiggle 6s ease-in-out 2s infinite; }
/* a page's own bottom banner (the Cookbook's "Add to home screen") takes the corner */
body:has(.pwa-install.show) .nps-fab { transform: translateY(160%); opacity: 0; pointer-events: none; }
@media (max-width: 640px) {
  .nps-fab { min-height: 50px; padding: 0 16px 0 8px; font-size: 15.5px; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .nps-fab img { width: 32px; height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .nps-head, .nps-sheet, .nps-fab, .nps-btn, .nps-soc a { transition: none !important; animation: none !important; }
}
