@charset "UTF-8";
/* A Little Space, the Breathing Heart.
   One heart, one pattern: breathe in 5, breathe out 5, hold 5.
   The heart is scaled by breathing-heart.js each frame; this file
   only carries the still design. In reduced-motion the script never
   scales the heart and the ring speaks through opacity alone. */

.bh-hero{padding-bottom:8px}
.bh-hero .lead{font-size:clamp(1.15rem,2.4vw,1.45rem)}

.bh-stage-wrap{text-align:center;padding:18px 0 34px}

/* The stage: ring on the outside, heart in the middle. */
.bh-stage{
  position:relative;
  width:min(74vw,280px);
  aspect-ratio:1/1;
  margin-inline:auto;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  touch-action:none;
  -webkit-user-select:none;
  user-select:none;
}
.bh-ring{
  position:absolute;inset:0;width:100%;height:100%;
  transform:rotate(-90deg);
}
.bh-ring circle{fill:none}
.bh-ring-track{stroke:#e9c3ca;stroke-width:2}
.bh-ring-arc{stroke:#d64a63;stroke-width:2.5;stroke-linecap:round}
html[data-theme="dark"] .bh-ring-track{stroke:#4a3238}

/* The scaling wrapper: positioned by offsets so the script's
   transform is free to carry scale alone. */
.bh-heart-scale{
  position:absolute;
  left:13%;top:15.5%;
  width:74%;
  transform-origin:50% 50%;
  will-change:transform;
}
.bh-heart{display:block;width:100%;height:auto}
.bh-glow{
  position:absolute;inset:0;width:100%;height:auto;
  fill:#e14e66;
  filter:blur(17px);
  opacity:.3;
  pointer-events:none;
  transform-origin:50% 50%;
}

/* The heart's own life, inside the breath's scale: at rest it
   keeps a very gentle double-thump heartbeat (lub-dub, then
   stillness) on a slow cycle. During a Hold the heart itself
   stays still and only its halo breathes, faintly. */
.bh-heart-beat{position:relative;width:100%;transform-origin:50% 55%}
.bh-heart-beat.bh-beating{animation:bh-lubdub 3.4s ease-in-out infinite}
@keyframes bh-lubdub{
  0%{transform:scale(1)}
  7%{transform:scale(1.03)}
  14%{transform:scale(1.008)}
  21%{transform:scale(1.045)}
  30%,100%{transform:scale(1)}
}
.bh-stage.bh-holdphase .bh-glow{animation:bh-halo-breathe 5s ease-in-out infinite alternate}
@keyframes bh-halo-breathe{from{transform:scale(1)}to{transform:scale(1.07)}}

/* A fine ring of light that leaves the heart as the breath
   comes in, expanding and fading; the script drives it. */
.bh-heart-ring{position:absolute;inset:0;width:100%;height:auto;pointer-events:none}
.bh-heart-ring path{transform-box:fill-box;transform-origin:center;opacity:0}

/* Tiny light motes that drift upward as the breath comes in;
   the script raises them through the --rise custom property. */
.bh-motes{position:absolute;inset:0;pointer-events:none;opacity:0}
.bh-motes span{
  position:absolute;bottom:18%;
  width:5px;height:5px;border-radius:50%;
  background:#ffd9de;
  box-shadow:0 0 6px 2px rgba(255,178,192,.5);
  transform:translate(calc(var(--rise,0)*var(--dx,0px)),calc(var(--rise,0)*-54px*var(--m,1)));
}
/* Each mote's place and drift live here, not in style attributes:
   the page CSP (style-src 'self') blocks inline styles. */
.bh-motes span:nth-child(1){left:38%;--m:.7;--dx:-10px}
.bh-motes span:nth-child(2){left:50%;--m:1;--dx:2px}
.bh-motes span:nth-child(3){left:61%;--m:.55;--dx:12px}
.bh-motes span:nth-child(4){left:45%;--m:.85;--dx:-4px}
.bh-motes span:nth-child(5){left:56%;--m:.65;--dx:7px}

.bh-instruction{
  font-size:clamp(1.35rem,5.6vw,1.72rem);
  font-weight:680;
  line-height:1.3;
  color:#9c2b44;
  margin:30px 0 4px;
  min-height:2.6em;
  display:flex;align-items:flex-start;justify-content:center;
  transition:opacity .22s ease;
}
.bh-instruction.bh-swap{opacity:0}
html[data-theme="dark"] .bh-instruction{color:#f3aeb9}

.bh-controls{margin:6px 0 0}
.bh-toggle{
  min-height:48px;
  padding:11px 32px;
  border-radius:999px;
  border:1px solid #285d56;
  background:#285d56;
  color:#fff;
  font:inherit;
  font-weight:710;
  cursor:pointer;
}
.bh-toggle:hover{background:#1c473e}
.bh-toggle:focus-visible{outline:3px solid #916244;outline-offset:3px}
html[data-theme="dark"] .bh-toggle{background:#2e6b58;border-color:#2e6b58}

.bh-quiet{font-size:.98rem;margin:16px 0 0}
.bh-motion-note{display:none;font-size:.9rem;margin:8px 0 0}
.bh-motion-note.bh-show{display:block}
@media (prefers-reduced-motion: reduce){
  .bh-motion-note{display:block}
}

.bh-pattern{margin-top:6px}
.bh-pattern-list{font-size:1.05rem;line-height:1.85;padding-left:22px}

/* The two ways to breathe: quiet pills above the stage. */
.bh-modes{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin:2px 0 22px}
.bh-mode{
  min-height:44px;
  padding:9px 22px;
  border-radius:999px;
  border:1px solid #285d56;
  background:transparent;
  color:#285d56;
  font:inherit;
  font-weight:650;
  cursor:pointer;
}
.bh-mode:hover{border-color:#1c473e;color:#1c473e}
.bh-mode.is-active{background:#285d56;color:#fff}
.bh-mode.is-active:hover{background:#1c473e;color:#fff}
.bh-mode:focus-visible{outline:3px solid #916244;outline-offset:3px}
html[data-theme="dark"] .bh-mode{border-color:#7fb8a6;color:#a8d5c5}
html[data-theme="dark"] .bh-mode.is-active{background:#2e6b58;border-color:#2e6b58;color:#fff}

/* In Tap with me and Hold with me the heart itself is the
   control, so the Begin/Pause button steps aside. */
.bh-stage-wrap[data-mode="tap"] .bh-controls,
.bh-stage-wrap[data-mode="hold"] .bh-controls{display:none}
.bh-stage:focus-visible{outline:3px solid #916244;outline-offset:5px;border-radius:50%}

/* A waiting prompt breathes a little itself. */
@keyframes bh-pulse{0%,100%{opacity:1}50%{opacity:.42}}
.bh-instruction.bh-waiting{animation:bh-pulse 2.8s ease-in-out infinite}
@media (prefers-reduced-motion: reduce){
  .bh-instruction.bh-waiting{animation:none}
}

/* Gentle progress in Tap with me: which round you are on. */
.bh-round{
  margin:10px 0 0;
  font-size:.9rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:#8a5a62;
}
html[data-theme="dark"] .bh-round{color:#c99aa4}

/* The eyes-closed lines: a note under the stage in the
   automatic third round, and the rest itself in Tap with me. */
.bh-rest{
  max-width:33em;
  margin:22px auto 0;
  font-size:1.02rem;
  line-height:1.7;
  color:#5c4a42;
}
html[data-theme="dark"] .bh-rest{color:#d8c9c2}

.bh-tap-note{font-size:.95rem;margin:14px 0 0}

/* The moon scene: a small round window on a calm night, echoing the
   owner's painting. Deep blue sky, a soft full moon, thin clouds on
   slow CSS loops, a dark pine island, and water with a shimmering
   moonlight path. The moon itself is moved by the breathing engine
   (it rises and brightens on the in-breath, settles on the out,
   rests on the hold) while the clouds and water keep drifting. */
.bh-scenes{margin-top:-6px}
.bh-moon-scene{position:absolute;inset:7%;border-radius:50%;overflow:hidden;display:none;background:#0d1f3c}
.bh-stage-wrap[data-scene="moon"] .bh-moon-scene{display:block}
.bh-stage-wrap[data-scene="moon"] .bh-heart-scale{display:none}
.bh-moon-art{display:block;width:100%;height:100%}
#bh-moon-el{transform-box:fill-box;transform-origin:center}
/* Each star twinkles on its own clock, at staggered rates. */
.bh-stars circle{animation:bh-twinkle 5.2s ease-in-out infinite alternate}
.bh-stars circle:nth-child(2n){animation-duration:6.8s;animation-delay:-2.1s}
.bh-stars circle:nth-child(3n){animation-duration:4.4s;animation-delay:-1.3s}
.bh-stars circle:nth-child(4n){animation-duration:7.6s;animation-delay:-3.7s}
.bh-stars circle:nth-child(5n){animation-duration:5.9s;animation-delay:-.6s}
@keyframes bh-twinkle{from{opacity:.35}to{opacity:1}}
/* The moon's halo breathes on a very slow pulse of its own. */
#bh-moon-halo{transform-box:fill-box;transform-origin:center;animation:bh-halo-pulse 9s ease-in-out infinite alternate}
@keyframes bh-halo-pulse{from{transform:scale(1)}to{transform:scale(1.08)}}
.bh-cloud{filter:blur(1.6px);animation-name:bh-drift;animation-timing-function:linear;animation-iteration-count:infinite}
.bh-cloud-1{opacity:.4;animation-duration:36s;animation-delay:-14s}
.bh-cloud-2{opacity:.3;animation-duration:54s;animation-delay:-38s}
@keyframes bh-drift{from{transform:translateX(-60px)}to{transform:translateX(260px)}}
.bh-shimmer{animation:bh-shimmer 6s ease-in-out infinite;transform-box:fill-box;transform-origin:50% 0}
@keyframes bh-shimmer{0%,100%{opacity:.35}50%{opacity:.75}}
@media (prefers-reduced-motion: reduce){
  .bh-cloud,.bh-shimmer,.bh-stars circle,#bh-moon-halo,
  .bh-heart-beat.bh-beating,.bh-stage.bh-holdphase .bh-glow{animation:none}
}
