/* Wake Up | Win | Repeat: the shared header and footer on every page (30 Nov 2026).
   Brand pages (home, app, Good Things, Inner Alchemy, our story, free) and the older pages (guides, shop, crew, help)
   all load this file, so the top and bottom of the site look the same everywhere. Class names start with bh- (header)
   and bf- (footer) so they never clash with style.css or the brand pages' own styles. */
.bh, .bf, .bh *, .bf * { box-sizing: border-box; }
.bh { position: relative; z-index: 50; background: #F5ECDD; border-bottom: 1px solid #E2D6C2; font-family: 'DM Sans', system-ui, sans-serif; }
.bh-in { max-width: 1160px; margin: 0 auto; padding: 0 20px; min-height: 70px; display: flex; align-items: center; gap: 12px; }
.bh-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #2F3628; flex: none; }
.bh-brand svg { width: 34px; height: 34px; flex: none; }
.bh-brand span { font: 600 20px/1.1 'Fraunces', Georgia, serif; letter-spacing: -.01em; white-space: nowrap; }
.bh-nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.bh-nav a { text-decoration: none; color: #4E5942; font-size: 15px; font-weight: 600; padding: 10px 12px; border-radius: 999px; white-space: nowrap; }
.bh-nav a:hover { color: #A3482A; }
.bh-nav a[aria-current="page"] { color: #2F3628; box-shadow: inset 0 -2px 0 #E07A4F; border-radius: 0; }
.bh-cta { display: inline-flex; align-items: center; min-height: 46px; text-decoration: none; background: #4E5942; color: #F5ECDD !important; font-size: 15px; font-weight: 700; padding: 0 18px; border-radius: 999px; white-space: nowrap; transition: transform .2s, box-shadow .3s; }
.bh-cta:hover { transform: translateY(-2px); box-shadow: 0 0 0 6px rgba(224,122,79,.2); }
.bh .store-wrap { position: relative; display: inline-flex; margin-left: 6px; }
.bh-menu { display: none; margin-left: auto; position: relative; }
.bh-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1.5px solid #AEB79C; border-radius: 999px; color: #2F3628; font-weight: 700; font-size: 15px; }
.bh-menu summary::-webkit-details-marker { display: none; }
.bh-menu summary svg { width: 18px; height: 18px; }
.bh-menu[open] summary { background: #FBF6EC; }
.bh-panel { position: absolute; right: 0; top: calc(100% + 10px); width: min(300px, calc(100vw - 32px)); background: #FBF6EC; border: 1px solid #E2D6C2; border-radius: 20px; box-shadow: 0 24px 48px -18px rgba(47,54,40,.45); padding: 10px; display: flex; flex-direction: column; }
.bh-panel a { text-decoration: none; color: #2F3628; font-size: 17px; font-weight: 600; padding: 13px 14px; border-radius: 12px; }
.bh-panel a:hover, .bh-panel a[aria-current="page"] { background: #F1E7D6; }
.bh-panel .bh-cta { justify-content: center; margin-top: 6px; }
.bh-panel small { display: block; padding: 10px 14px 4px; color: #6B735E; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
@media (max-width: 1000px) { .bh-nav a { padding: 10px 8px; font-size: 14px; } }
@media (max-width: 900px) { .bh-nav, .bh .bh-ctaw { display: none; } .bh-menu { display: block; } }
@media (max-width: 400px) { .bh-brand span { font-size: 17px; } .bh-brand svg { width: 28px; height: 28px; } .bh-in { padding: 0 14px; gap: 8px; } .bh-menu summary { padding: 0 12px; } }
@media (max-width: 340px) { .bh-brand span { font-size: 15px; } }

/* The QR code pop-up beside "Get the app" (computers only; same behaviour as before). */
.bh .qr-pop { display: none; }
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .bh .qr-pop { display: flex; align-items: center; gap: 12px; width: max-content; position: absolute; z-index: 60; right: 0; top: calc(100% + 12px);
    padding: 10px 16px 10px 10px; background: #FBF6EC; border: 1px solid #E2D6C2; border-radius: 16px; box-shadow: 0 18px 36px -16px rgba(47,54,40,.5);
    font: 400 13px/1.35 'DM Sans', sans-serif; color: #5E6A4E; white-space: nowrap; text-align: left;
    opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-6px); transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s; }
  .bh .store-wrap:hover .qr-pop, .bh .store-wrap:focus-within .qr-pop { opacity: 1; visibility: visible; transform: none; transition-delay: .1s; }
  .bh .qr-pop img { box-sizing: content-box; width: 111px; height: 111px; border-radius: 8px; }
  .bh .qr-pop b { display: block; color: #2F3628; font-weight: 700; }
}

/* Footer */
.bf-sun { display: block; width: 100%; height: auto; aspect-ratio: 1440 / 150; min-height: 150px; background: #F5ECDD; }
.bf { background: #36402C; color: #D6C7B4; font-family: 'DM Sans', system-ui, sans-serif; font-size: 14px; line-height: 1.5; }
.bf-in { max-width: 1160px; margin: 0 auto; padding: 52px 20px 28px; display: flex; flex-wrap: wrap; gap: 32px 40px; justify-content: space-between; }
.bf-about { flex: 1 1 260px; }
.bf-about div { display: flex; align-items: center; gap: 10px; }
.bf-about svg { width: 30px; height: 30px; flex: none; }
.bf-about strong { font: 600 22px/1.2 'Fraunces', Georgia, serif; color: #F5ECDD; }
.bf-about p { margin: 10px 0 0; max-width: 280px; }
.bf nav { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.bf nav strong { color: #F5ECDD; margin-bottom: 4px; }
.bf a { color: #D6C7B4; text-decoration: none; padding: 3px 0; }
.bf a:hover { color: #F2B880; text-decoration: underline; }
.bf-base { max-width: 1160px; margin: 0 auto; padding: 18px 20px 30px; border-top: 1px solid rgba(214,199,180,.18); display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; color: #AFA48F; font-size: 13px; }
.bf-base a { color: #D6C7B4; }
@keyframes bf-set { from { transform: translateY(0); } to { transform: translateY(34px); } }
.bf-sun .bf-sunball { animation: bf-set 14s ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce) { .bf-sun .bf-sunball { animation: none; } .bh-cta { transition: none; } }
@keyframes bf-sway { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg); } }
@media (prefers-reduced-motion: reduce) { .bf-sun g { animation: none !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.bh-skip:focus { position: fixed; left: 12px; top: 12px; width: auto; height: auto; clip: auto; margin: 0; z-index: 100; padding: 12px 18px; background: #2F3628; color: #F5ECDD; border-radius: 999px; font: 700 15px 'DM Sans', sans-serif; }
#main { outline: none; }
html, body { overflow-x: clip; }
.bh .qr-pop { left: auto; }

/* ---- Smooth scrolling on phones (1 Dec 2026) ----
   The paper texture is a small still picture (it used to be a live filter redrawn on every scroll).
   On phones, tablets and small windows the swaying trees and the hill parallax stand still; the sun, clouds,
   birds and walker still move. Anyone who asks their device for less motion gets none at all. */
.grain { position: fixed; inset: 0; pointer-events: none; z-index: 60; opacity: .015; background: url(/img/grain.png); transform: translateZ(0); }
@media (hover: none), (pointer: coarse), (max-width: 900px) {
  [style*="animation:sway"], [style*="animation:bf-sway"] { animation: none !important; }
  .para1, .para2, .para3 { animation: none !important; }
  .grain { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* Home: the alarm demo on small screens, so the mascots sit around the phone instead of behind it */
@media (max-width: 640px) {
  .demo-stage { height: 520px !important; }
  .demo-stage .demo-ph { width: 214px !important; height: 440px !important; border-radius: 38px !important; }
  .demo-stage .stk { width: 84px !important; z-index: 2; }
  .demo-stage .stk:nth-of-type(1) { left: -2% !important; top: 6px !important; }
  .demo-stage .stk:nth-of-type(2) { right: -2% !important; top: 40px !important; }
  .demo-stage .stk:nth-of-type(3) { left: -2% !important; bottom: 10px !important; }
  .demo-stage .stk:nth-of-type(4) { right: -2% !important; bottom: 0 !important; }
}
/* The app page's phone: the mascots stand either side of it on small screens instead of squeezing it */
@media (max-width: 640px) {
  .app-stage { min-height: 470px; }
  .app-stage img { position: absolute; z-index: 2; width: 96px !important; margin: 0 !important; }
  .app-stage img:first-child { left: -4px; top: 0; }
  .app-stage img:last-child { right: -4px; bottom: 16px; }
}
/* Fewer things moving inside the big landscape pictures: stars only twinkle at dusk, and the walker only moves
   his legs while he is actually walking (while you scroll). On phones the birds glide without flapping. */
html:not([data-tod="dusk"]) .stars circle { animation: none !important; }
.walker:not(.moving) * { animation-play-state: paused !important; }
@media (hover: none), (pointer: coarse), (max-width: 900px) {
  .stars circle { animation: none !important; }
  [style*="animation:flap"] { animation: none !important; }
}
/* Landscapes more than a screen away from view pause their swaying, drifting and gliding, and pick up exactly where
   they left off before they come into view (300 px early), so nothing looks different. Scroll-linked effects
   (hill parallax, reveals) are left alone. */
.anim-off *:not(.para1):not(.para2):not(.para3):not(.reveal):not(.draw) { animation-play-state: paused !important; }
/* Landscapes grow with very wide screens (height follows the width above 1440 px, set in build.py), so the sun and the
   tree tops are never cut off. The 1px overlap hides a hairline gap that rounding can leave under them. */
svg[viewBox^="0 0 1440"][preserveAspectRatio] { margin-bottom: -1px; }
