/* yoga.org/breathe — guru-mode breath trainer */
body.breathe-guru {
  margin: 0;
  background: radial-gradient(1200px 800px at 70% 10%, #1a2240 0%, #0f1218 55%);
  color: #f4efe6;
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  min-height: 100dvh;
}
body.breathe-guru .ys-top.on-dark { position: absolute; left: 0; right: 0; z-index: 4; }
body.breathe-guru.is-lander .ys-foot { display: none; }

.bg-stage {
  max-width: 980px;
  margin: 0 auto;
  padding: max(88px, env(safe-area-inset-top)) 18px 36px;
}
.bg-kicker {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 750;
  color: #c4a574;
  margin: 0 0 10px;
}
.bg-stage h1 {
  margin: 0 0 10px;
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  letter-spacing: -0.03em;
  line-height: 0.98;
}
.bg-lead {
  margin: 0 0 22px;
  color: #b7aea0;
  font-size: 1.08rem;
  max-width: 26em;
  line-height: 1.45;
}
.bg-gold {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #e4c98a, #c4a574);
  color: #1a1408;
  font-weight: 800;
  font-size: 1.08rem;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(80, 50, 10, 0.28);
}
.bg-gold .play {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 0 8px 14px;
  border-color: transparent transparent transparent #1a1408;
}
.bg-gate {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  color: #f4efe6;
}
.bg-gate.on { display: block; }
.bg-gate.off { display: none; }
.bg-still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}
.bg-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10,12,18,0.88) 0%, rgba(10,12,18,0.55) 48%, rgba(10,12,18,0.35) 100%),
    linear-gradient(180deg, rgba(10,12,18,0.45) 0%, transparent 28%, rgba(10,12,18,0.72) 100%);
}
.bg-gate-grid {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: max(110px, env(safe-area-inset-top)) 28px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 420px);
  gap: 40px 56px;
  align-items: center;
}
.bg-bill h1 {
  margin: 0 0 12px;
  font-size: clamp(3rem, 8vw, 5.4rem);
  letter-spacing: -0.04em;
  line-height: 0.92;
}
.bg-bill .bg-lead {
  font-size: 1.2rem;
  max-width: 18em;
  color: rgba(243,230,200,0.88);
}
.bg-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.bg-caption {
  margin: 0 0 16px;
  max-width: 22em;
  min-height: 2.6em;
  color: #f4efe6;
  font-size: 1.12rem;
  line-height: 1.4;
  font-weight: 550;
}
body.breathe-guru.is-guiding .bg-bill .bg-lead { display: none; }
.bg-gate .bg-ghost {
  min-height: 56px;
  padding: 0 18px;
  color: #f4efe6;
}
.bg-gate .bg-box {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  width: min(100%, 420px);
  height: auto;
  aspect-ratio: 1;
  filter: drop-shadow(0 24px 50px rgba(0,0,0,0.45));
}
.bg-box-loop {
  fill: none;
  stroke: #f0d48a;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 0.18 0.82;
  animation: box-march 8s linear infinite;
}
@keyframes box-march {
  to { stroke-dashoffset: -1; }
}
.bg-how { display: none; }
.bg-how.on { display: block; }
.bg-room { display: none; }
.bg-room.on { display: block; }
.bg-steps {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 10px;
  max-width: 28em;
}
.bg-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  font-size: 1rem;
  line-height: 1.3;
}
.bg-steps em {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(196,165,116,0.22);
  color: #e4c98a;
  font-style: normal;
  font-weight: 800;
  font-size: 13px;
}

.bg-mirror {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 3 / 4;
  max-height: min(72dvh, 720px);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
.bg-mirror video,
.bg-mirror canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bg-mirror video { transform: scaleX(-1); }
.bg-mirror.no-cam { background: radial-gradient(circle at 50% 40%, #243056, #0b0d12 70%); }
.bg-mirror.no-cam video,
.bg-mirror.no-cam canvas { display: none; }

.bg-orb {
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(48vw, 240px);
  height: min(48vw, 240px);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.76);
  background: radial-gradient(circle at 35% 28%, rgba(255,240,210,0.62), rgba(196,165,116,0.22) 48%, rgba(20,24,32,0.12));
  box-shadow: 0 0 90px rgba(196,165,116,0.28);
  pointer-events: none;
  transition: transform 1s linear;
}
.bg-orb.in { transform: translate(-50%, -50%) scale(1.08); }
.bg-orb.out { transform: translate(-50%, -50%) scale(0.76); }
.bg-orb.hold { transform: translate(-50%, -50%) scale(1.02); }

.bg-phase {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 16px;
  text-align: center;
  pointer-events: none;
}
.bg-phase b {
  display: block;
  font-size: clamp(1.7rem, 6vw, 2.5rem);
  letter-spacing: -0.03em;
  font-weight: 650;
}
.bg-phase .count {
  display: block;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.2rem, 8vw, 3.4rem);
  font-weight: 700;
  color: #e4c98a;
}
.bg-nadi {
  position: absolute;
  left: 50%;
  top: 16%;
  transform: translateX(-50%);
  width: min(48vw, 180px);
  pointer-events: none;
  text-align: center;
}
.bg-nadi-face { width: 120px; height: 140px; margin: 0 auto; display: block; }
.bg-nadi-dot { fill: transparent; stroke: rgba(255,255,255,0.35); stroke-width: 2; }
.bg-nadi-dot.on { fill: #e4c98a; stroke: #e4c98a; }
.bg-nadi-hand {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #e4c98a;
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}

.bg-cue {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(20, 24, 32, 0.72);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
}
.bg-cue b { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.bg-cue span { color: #b7aea0; font-size: 0.95rem; line-height: 1.35; }

.bg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 8px;
}
.bg-chip, .bg-ghost {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: #f4efe6;
  border-radius: 999px;
  min-height: 44px;
  padding: 10px 14px;
  font-weight: 650;
  cursor: pointer;
  font: inherit;
}
.bg-chip[aria-pressed="true"] {
  border-color: rgba(196, 165, 116, 0.7);
  background: rgba(196, 165, 116, 0.16);
}
.bg-status {
  margin: 8px 0 0;
  color: #b7aea0;
  font-size: 0.9rem;
  min-height: 1.3em;
}
.bg-foot {
  margin-top: 28px;
  color: #b7aea0;
  font-size: 0.9rem;
}
.bg-foot a { color: #c4a574; }

.bg-box {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(72vw, 340px);
  height: min(72vw, 340px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.bg-how .bg-box {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  margin: 4px auto 16px;
  width: min(58vw, 220px);
  height: min(58vw, 220px);
}
.bg-box svg { width: 100%; height: 100%; display: block; overflow: visible; }
.bg-box-track {
  fill: rgba(10,12,18,0.28);
  stroke: rgba(255,255,255,0.18);
  stroke-width: 6;
}
.bg-box-side {
  fill: none;
  stroke: rgba(196,165,116,0.28);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.bg-box-side.done,
.bg-box.static .bg-box-side {
  stroke: #c4a574;
  stroke-dashoffset: 0;
}
.bg-box-side.on {
  stroke: #f0d48a;
  filter: drop-shadow(0 0 8px rgba(240,212,138,0.85));
}
.bg-box-dot {
  fill: #fff8e8;
  filter: drop-shadow(0 0 8px rgba(240,212,138,1));
  offset-rotate: 0deg;
}
.bg-box-lab {
  position: absolute;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244,239,230,0.42);
  font-weight: 750;
  white-space: nowrap;
}
.bg-box-lab.on { color: #f0d48a; }
.lab-in { left: 8%; top: 50%; transform: translate(-50%, -50%) rotate(-90deg); }
.lab-out { right: 8%; top: 50%; transform: translate(50%, -50%) rotate(90deg); }
.lab-hold-top { top: 10%; left: 50%; transform: translateX(-50%); }
.lab-hold-bot { bottom: 10%; left: 50%; transform: translateX(-50%); }

.bg-mirror.is-box video { opacity: 0.32; }
.bg-mirror.is-box .bg-orb { display: none; }
.bg-mirror.is-box .bg-phase {
  top: 50%;
  transform: translateY(-48%);
}
.bg-mirror.is-wave .bg-box { display: none !important; }
.bg-mirror.is-nadi .bg-box { display: none !important; }

@media (max-width: 820px) {
  .bg-gate-grid {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: max(96px, env(safe-area-inset-top)) 18px 28px;
    align-content: start;
  }
  .bg-bill h1 { font-size: clamp(2.6rem, 14vw, 3.6rem); }
  .bg-bill .bg-lead { margin-bottom: 16px; font-size: 1.05rem; }
  .bg-gate .bg-box {
    width: min(58vw, 240px);
    margin: 0 auto;
  }
}
@media (min-width: 900px) {
  .bg-mirror { aspect-ratio: 16 / 10; max-height: 70dvh; }
}
@media (prefers-reduced-motion: reduce) {
  .bg-orb { transition: none; transform: translate(-50%, -50%) scale(1); }
  .bg-box-side { transition: none !important; }
  .bg-box-dot { transition: none !important; }
  .bg-box-loop { animation: none; stroke-dasharray: none; }
}
