/* ============================================
   Breathe — Guided Breathing Studio
   ============================================ */

:root {
  --bg-deep: #0d121c;
  --bg-surface: #161d2e;
  --bg-card: #1c2540;
  --bg-card-hover: #232e50;

  --accent: #7c9ae0;
  --accent-soft: #a4bbe8;
  --accent-glow: rgba(124, 154, 224, 0.35);

  --text-primary: #e6ecf7;
  --text-secondary: #99a5bf;
  --text-muted: #6b7a96;

  --line: rgba(124, 154, 224, 0.1);
  --line-strong: rgba(124, 154, 224, 0.28);

  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 100px;
  --smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* driven by JS during a session */
  --dur: 4s;
  --ease: var(--smooth);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse at 18% 25%, rgba(124, 154, 224, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 82% 15%, rgba(150, 120, 210, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 110%, rgba(90, 140, 200, 0.07) 0%, transparent 55%);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Header --- */
header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: calc(var(--safe-top) + 18px) 68px 0;
  z-index: 100;
}

.header-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  opacity: 0.9;
}

.technique-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(124, 154, 224, 0.08);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--accent-soft);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.25s var(--smooth), border-color 0.25s var(--smooth), transform 0.15s;
}
.technique-pill:hover { background: rgba(124, 154, 224, 0.15); border-color: var(--line-strong); }
.technique-pill:active { transform: scale(0.96); }

.pattern-badge {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

/* --- Burger + Sound toggle --- */
.burger-menu,
.sound-toggle {
  position: fixed;
  top: calc(var(--safe-top) + 16px);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 37, 64, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  z-index: 1001;
  cursor: pointer;
  transition: background 0.3s var(--smooth), transform 0.15s, color 0.2s;
}
.burger-menu { left: 16px; flex-direction: column; gap: 5px; }
.sound-toggle { right: 16px; }
.burger-menu:hover, .sound-toggle:hover { background: rgba(124, 154, 224, 0.16); color: var(--text-primary); }
.burger-menu:active, .sound-toggle:active { transform: scale(0.92); }

.burger-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: all 0.3s var(--smooth);
}
.burger-menu:hover .burger-bar { color: var(--text-primary); }

.sound-toggle .icon-sound-off { display: none; }
.sound-toggle.muted .icon-sound-on { display: none; }
.sound-toggle.muted .icon-sound-off { display: block; }
.sound-toggle.muted { color: var(--text-muted); }

/* --- Sidebar overlay --- */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 22, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--smooth);
}
.sidebar-overlay.visible { opacity: 1; pointer-events: auto; }

/* --- Sidebar --- */
.sidebar-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 340px;
  max-width: 88vw;
  height: 100dvh;
  background: rgba(20, 27, 44, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  color: var(--text-primary);
  border-right: 1px solid var(--line);
  z-index: 2000;
  transform: translateX(-100%);
  transition: transform 0.42s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 24px) 22px calc(var(--safe-bottom) + 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.sidebar-menu.open { transform: translateX(0); }

.sidebar-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--accent-soft);
  letter-spacing: 0.06em;
  margin-bottom: 26px;
}

.close-sidebar {
  position: absolute;
  top: calc(var(--safe-top) + 16px);
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 154, 224, 0.08);
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 2010;
  transition: background 0.2s, color 0.2s;
}
.close-sidebar:hover { background: rgba(124, 154, 224, 0.18); color: var(--text-primary); }

.sidebar-section { margin-bottom: 26px; }

.sidebar-menu h2 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
  color: var(--text-muted);
}

/* --- Technique cards --- */
.technique-list { display: flex; flex-direction: column; gap: 8px; }

.technique-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px 15px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  color: var(--text-primary);
  font-family: var(--font-body);
  transition: all 0.22s var(--smooth);
}
.technique-card:hover { background: var(--bg-card-hover); border-color: var(--line-strong); }
.technique-card.active {
  background: rgba(124, 154, 224, 0.14);
  border-color: var(--line-strong);
  box-shadow: 0 0 24px rgba(124, 154, 224, 0.1);
}
.technique-card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.technique-card__name { font-size: 0.95rem; font-weight: 500; color: var(--text-primary); }
.technique-card.active .technique-card__name { color: var(--accent-soft); }
.technique-card__pattern {
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.technique-card__desc { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.4; }

/* --- Animation grid --- */
.anim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.anim-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.22s var(--smooth);
}
.anim-btn:hover { background: var(--bg-card-hover); border-color: var(--line-strong); }
.anim-btn.active {
  background: rgba(124, 154, 224, 0.14);
  border-color: var(--line-strong);
  color: var(--accent-soft);
}
.anim-icon { font-size: 1.05rem; color: var(--accent); line-height: 1; }

/* --- Background sound grid --- */
.bg-sound-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.bg-sound-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.22s var(--smooth);
}
.bg-sound-btn:hover { background: var(--bg-card-hover); border-color: var(--line-strong); }
.bg-sound-btn.active {
  background: rgba(124, 154, 224, 0.14);
  color: var(--accent-soft);
  border-color: var(--line-strong);
  box-shadow: 0 0 20px rgba(124, 154, 224, 0.08);
}
.sound-icon { font-size: 1.4rem; line-height: 1; }

/* --- Preferences --- */
.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
}
.pref-row.pref-col { flex-direction: column; align-items: stretch; gap: 12px; }
.pref-label { display: flex; flex-direction: column; gap: 3px; font-size: 0.9rem; color: var(--text-primary); }
.pref-hint { font-size: 0.74rem; color: var(--text-muted); }

/* Switch */
.switch {
  flex-shrink: 0;
  width: 46px;
  height: 27px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--line);
  cursor: pointer;
  position: relative;
  transition: background 0.25s var(--smooth), border-color 0.25s;
}
.switch.on { background: rgba(124, 154, 224, 0.35); border-color: var(--line-strong); }
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--text-secondary);
  transition: transform 0.25s var(--smooth), background 0.25s;
}
.switch.on .switch-thumb { transform: translateX(19px); background: #fff; }

/* Goal grid */
.goal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.goal-btn {
  padding: 10px 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s var(--smooth);
}
.goal-btn:hover { background: var(--bg-card-hover); }
.goal-btn.active {
  background: rgba(124, 154, 224, 0.16);
  border-color: var(--line-strong);
  color: var(--accent-soft);
}

/* --- Instructions --- */
.instructions { display: flex; flex-direction: column; gap: 10px; }
.instruction-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.instruction-step strong { color: var(--accent-soft); font-weight: 500; }
.step-number {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 154, 224, 0.1);
  color: var(--accent);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 500;
}

/* --- Main --- */
main { flex: 1; display: flex; align-items: center; justify-content: center; }
.breathe-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding: 20px;
}

/* --- Cycle counter --- */
.cycle-counter {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  min-height: 22px;
  margin-bottom: 34px;
  opacity: 0;
  transition: opacity 0.6s;
}
.cycle-counter.visible { opacity: 1; }

/* ============================================
   VISUALIZER
   ============================================ */
.visualizer {
  --size: min(260px, 62vw);
  --scale-in: 1.28;
  --scale-out: 0.8;
  position: relative;
  width: var(--size);
  height: var(--size);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* per-state easing (duration comes from --dur inline) */
.visualizer.state-inhale { --ease: cubic-bezier(0.22, 0.61, 0.36, 1); }
.visualizer.state-exhale { --ease: cubic-bezier(0.55, 0.06, 0.68, 0.19); }
.visualizer.state-hold,
.visualizer.state-hold-empty { --ease: ease; }

/* progress ring (shared) */
.progress-ring {
  position: absolute;
  top: -14px;
  left: -14px;
  width: calc(100% + 28px);
  height: calc(100% + 28px);
  pointer-events: none;
  z-index: 5;
  transform: rotate(-90deg);
}
.progress-ring__bg { fill: none; stroke: rgba(124, 154, 224, 0.08); stroke-width: 2; }
.progress-ring__fill {
  fill: none;
  stroke: var(--accent-soft);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 565.48;
  stroke-dashoffset: 565.48;
  transition: stroke-dashoffset 0.3s linear, opacity 0.5s ease;
  opacity: 0;
}
.progress-ring__fill.active { opacity: 0.8; }

/* ambient glow (shared) */
.viz-glow {
  position: absolute;
  inset: -25%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  transform: scale(1);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.visualizer.state-inhale .viz-glow,
.visualizer.state-hold .viz-glow { opacity: 0.75; transform: scale(1.25); }
.visualizer.state-exhale .viz-glow,
.visualizer.state-hold-empty .viz-glow { opacity: 0.3; transform: scale(0.85); }

/* --- Core shape (breathes via scale) --- */
.viz-core {
  position: relative;
  z-index: 3;
  width: 92%;
  height: 92%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(1);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.visualizer.state-inhale .viz-core,
.visualizer.state-hold .viz-core { transform: scale(var(--scale-in)); }
.visualizer.state-exhale .viz-core,
.visualizer.state-hold-empty .viz-core { transform: scale(var(--scale-out)); }

/* countdown number */
.countdown-number {
  position: relative;
  z-index: 4;
  font-family: var(--font-display);
  font-size: 2.9rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.countdown-number.visible { opacity: 1; }

/* decorative layers hidden by default */
.viz-ripple, .viz-petals { position: absolute; inset: 0; pointer-events: none; display: none; }

/* ===== ANIM: ORB ===== */
.visualizer[data-anim="orb"] .viz-core {
  background: linear-gradient(145deg, #5a74b8 0%, #7c9ae0 50%, #a4bbe8 100%);
  box-shadow: 0 0 60px 12px var(--accent-glow), 0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 -6px 16px rgba(0, 0, 0, 0.18), inset 0 6px 14px rgba(255, 255, 255, 0.12);
}
.visualizer[data-anim="orb"].state-exhale .viz-core,
.visualizer[data-anim="orb"].state-hold-empty .viz-core {
  background: linear-gradient(145deg, #3a4d7a 0%, #4f6699 50%, #6b82b3 100%);
}

/* ===== ANIM: RIPPLE ===== */
.visualizer[data-anim="ripple"] .viz-core {
  background: radial-gradient(circle at 50% 45%, #a4bbe8 0%, #7c9ae0 45%, #4f6699 100%);
  box-shadow: 0 0 50px 8px var(--accent-glow), inset 0 0 30px rgba(255, 255, 255, 0.15);
}
.visualizer[data-anim="ripple"] .viz-ripple { display: block; z-index: 1; }
.visualizer[data-anim="ripple"] .viz-ripple span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--accent-soft);
  opacity: 0;
  animation: rippleOut 4.5s ease-out infinite;
}
.visualizer[data-anim="ripple"] .viz-ripple span:nth-child(2) { animation-delay: 1.5s; }
.visualizer[data-anim="ripple"] .viz-ripple span:nth-child(3) { animation-delay: 3s; }
@keyframes rippleOut {
  0% { transform: scale(0.7); opacity: 0.55; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* ===== ANIM: AURORA ===== */
/* gradient + blur live on ::before so the countdown text stays sharp */
.visualizer[data-anim="aurora"] .viz-core {
  background: none;
  box-shadow: 0 0 70px 18px var(--accent-glow);
  border-radius: 50%;
}
.visualizer[data-anim="aurora"] .viz-core::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(164, 187, 232, 0.9) 0%, transparent 55%),
    radial-gradient(circle at 70% 65%, rgba(150, 120, 210, 0.75) 0%, transparent 55%),
    conic-gradient(from 0deg, #5a74b8, #7c9ae0, #9678d2, #5a74b8);
  filter: blur(6px);
  animation: auroraSpin 18s linear infinite;
}
@keyframes auroraSpin { to { transform: rotate(360deg); } }
.visualizer[data-anim="aurora"] .countdown-number { text-shadow: 0 0 18px rgba(0, 0, 0, 0.45); }

/* ===== ANIM: BLOOM (petals) ===== */
.visualizer[data-anim="bloom"] .viz-core {
  background: radial-gradient(circle, rgba(164, 187, 232, 0.35) 0%, transparent 70%);
  box-shadow: none;
}
.visualizer[data-anim="bloom"] .viz-petals { display: block; z-index: 2; }
.visualizer[data-anim="bloom"] .viz-petals span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30%;
  height: 50%;
  /* center the petal box on the container center, then push it up so its
     bottom edge sits exactly at the center — that point becomes the pivot */
  margin-left: -15%;
  margin-top: -50%;
  background: linear-gradient(180deg, rgba(164, 187, 232, 0.7), rgba(124, 154, 224, 0.9));
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(124, 154, 224, 0.3);
  transform-origin: 50% 100%;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
  opacity: 0.85;
}
.visualizer[data-anim="bloom"] .viz-petals span:nth-child(1) { transform: rotate(0deg) scale(0.6); }
.visualizer[data-anim="bloom"] .viz-petals span:nth-child(2) { transform: rotate(60deg) scale(0.6); }
.visualizer[data-anim="bloom"] .viz-petals span:nth-child(3) { transform: rotate(120deg) scale(0.6); }
.visualizer[data-anim="bloom"] .viz-petals span:nth-child(4) { transform: rotate(180deg) scale(0.6); }
.visualizer[data-anim="bloom"] .viz-petals span:nth-child(5) { transform: rotate(240deg) scale(0.6); }
.visualizer[data-anim="bloom"] .viz-petals span:nth-child(6) { transform: rotate(300deg) scale(0.6); }
/* open petals on inhale/hold */
.visualizer[data-anim="bloom"].state-inhale .viz-petals span:nth-child(1),
.visualizer[data-anim="bloom"].state-hold .viz-petals span:nth-child(1) { transform: rotate(0deg) scale(1); }
.visualizer[data-anim="bloom"].state-inhale .viz-petals span:nth-child(2),
.visualizer[data-anim="bloom"].state-hold .viz-petals span:nth-child(2) { transform: rotate(60deg) scale(1); }
.visualizer[data-anim="bloom"].state-inhale .viz-petals span:nth-child(3),
.visualizer[data-anim="bloom"].state-hold .viz-petals span:nth-child(3) { transform: rotate(120deg) scale(1); }
.visualizer[data-anim="bloom"].state-inhale .viz-petals span:nth-child(4),
.visualizer[data-anim="bloom"].state-hold .viz-petals span:nth-child(4) { transform: rotate(180deg) scale(1); }
.visualizer[data-anim="bloom"].state-inhale .viz-petals span:nth-child(5),
.visualizer[data-anim="bloom"].state-hold .viz-petals span:nth-child(5) { transform: rotate(240deg) scale(1); }
.visualizer[data-anim="bloom"].state-inhale .viz-petals span:nth-child(6),
.visualizer[data-anim="bloom"].state-hold .viz-petals span:nth-child(6) { transform: rotate(300deg) scale(1); }

/* --- Breathing text --- */
.breathe-text {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--text-secondary);
  text-align: center;
  user-select: none;
  margin-top: 40px;
  letter-spacing: 0.02em;
  transition: color 0.8s, opacity 0.4s ease;
  opacity: 0.92;
}
.breathe-text.fade-out { opacity: 0; }

.breathe-subtext {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: 10px;
  user-select: none;
  transition: opacity 0.4s ease;
}
.breathe-subtext.hidden { opacity: 0; }

/* --- Idle pulse --- */
@keyframes idlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}
.visualizer.idle .viz-core { animation: idlePulse 6s ease-in-out infinite; }
.visualizer.starting .viz-core { animation: none !important; transform: scale(1); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  h1 { font-size: 1.25rem; }
  .visualizer { --size: min(240px, 62vw); }
  .breathe-text { font-size: 1.45rem; margin-top: 34px; }
  .countdown-number { font-size: 2.5rem; }
}

@media (max-width: 480px) {
  header { padding: calc(var(--safe-top) + 14px) 60px 0; }
  h1 { font-size: 1.1rem; }
  .burger-menu, .sound-toggle { top: calc(var(--safe-top) + 12px); width: 40px; height: 40px; }
  .burger-menu { left: 12px; }
  .sound-toggle { right: 12px; }
  .visualizer { --size: min(210px, 66vw); }
  .breathe-text { font-size: 1.3rem; margin-top: 28px; }
  .countdown-number { font-size: 2.2rem; }
  .cycle-counter { font-size: 0.75rem; margin-bottom: 26px; }
  .sidebar-menu { padding: calc(var(--safe-top) + 20px) 18px calc(var(--safe-bottom) + 22px); }
}

@media (max-width: 360px) {
  .visualizer { --size: 190px; }
  .breathe-text { font-size: 1.15rem; }
  .countdown-number { font-size: 2rem; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .visualizer { --size: min(150px, 34vh); }
  .breathe-text { font-size: 1.1rem; margin-top: 14px; }
  .breathe-subtext { margin-top: 6px; }
  .cycle-counter { margin-bottom: 12px; }
  .countdown-number { font-size: 1.7rem; }
  header { padding-top: 8px; }
  h1 { font-size: 1rem; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .viz-ripple span, .visualizer[data-anim="aurora"] .viz-core, .visualizer.idle .viz-core {
    animation: none !important;
  }
}
