/* ===== RESET & VARIABLES ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:   #070b14;
  --bg2:  #0c1220;
  --bg3:  #111827;
  --card: rgba(255,255,255,0.04);
  --cb:   rgba(255,255,255,0.08);

  --acc:  #6b7fd7;
  --acc2: #5ba3c9;
  --acc3: #9b8be8;
  --grn:  #5bb89a;
  --gld:  #c9a96e;

  --t:    #e2e8f4;
  --tm:   #8896aa;
  --td:   #4a5568;

  --nav-h: 68px;
  --r:     16px;
  --r2:    12px;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--t);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* ===== STARS ===== */
#starsCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ===== APP CONTAINER ===== */
#app {
  position: fixed;
  inset: 0;
  bottom: var(--nav-h);
  z-index: 1;
  overflow: hidden;
}

/* ===== SECTIONS ===== */
.section {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .3s ease, transform .3s ease;
  overflow: hidden;
}

.section.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.scroll-wrap {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.25rem 1.25rem calc(2rem + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}

.scroll-wrap::-webkit-scrollbar { display: none; }
.scroll-wrap { scrollbar-width: none; }

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 2rem 0 1.5rem;
}

.hero-moon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 1rem;
  animation: moon-float 5s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(200,175,80,0.35));
}

@keyframes moon-float {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50%       { transform: translateY(-10px) rotate(5deg); }
}

h1 {
  font-size: clamp(1.9rem, 6vw, 2.4rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.02em;
  background: linear-gradient(145deg, #ccdcff 0%, #a8bcf0 50%, #c4b0ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: .8rem;
}

.hero-sub {
  color: var(--tm);
  font-size: 1rem;
  line-height: 1.7;
}

/* ===== CARDS ===== */
.card {
  background: var(--card);
  border: 1px solid var(--cb);
  border-radius: var(--r);
  padding: 1.2rem 1.25rem;
  margin-bottom: 1rem;
}

.card h3 {
  font-size: .975rem;
  font-weight: 600;
  color: var(--t);
  margin-bottom: .5rem;
}

.card p, .card-p {
  font-size: .9rem;
  color: var(--tm);
  line-height: 1.8;
}

.reassure {
  border-color: rgba(107,127,215,0.2);
  background: rgba(107,127,215,0.06);
}

/* ===== SECTION LABEL ===== */
.section-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--td);
  margin: 1.25rem 0 .75rem;
  font-weight: 600;
}

/* ===== QUICK BUTTONS ===== */
.quick-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--cb);
  border-radius: var(--r2);
  padding: 1rem 1.1rem;
  margin-bottom: .65rem;
  cursor: pointer;
  text-align: left;
  transition: background .2s, transform .15s, border-color .2s;
  color: var(--t);
  -webkit-tap-highlight-color: transparent;
}

.quick-btn:active {
  transform: scale(.98);
  background: rgba(255,255,255,0.06);
}

.qb-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qb-icon svg { width: 22px; height: 22px; }

.qb-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.qb-text strong { font-size: .95rem; font-weight: 600; }
.qb-text small  { font-size: .82rem; color: var(--tm); }

.qb-arrow { color: var(--td); font-size: 1.4rem; line-height: 1; }

/* ===== SECTION HEADER ===== */
.sec-head {
  padding: 1.5rem 0 1.1rem;
}

.sec-head h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #ccdcff, #a8bcf0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: .3rem;
}

.sec-head p {
  color: var(--tm);
  font-size: .875rem;
}

/* ===== BREATHING ===== */
.breath-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 0 1.25rem;
}

.breath-outer {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px dashed rgba(107,127,215,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
}

.breath-inner {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at center,
    rgba(107,127,215,0.38) 0%,
    rgba(107,127,215,0.15) 55%,
    rgba(107,127,215,0.04) 100%);
  border: 1.5px solid rgba(107,127,215,0.55);
  box-shadow:
    0 0 50px rgba(107,127,215,0.22),
    inset 0 0 30px rgba(107,127,215,0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  cursor: pointer;
  animation: idle-pulse 4s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}

.breath-inner.running {
  animation: none;
}

@keyframes idle-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 40px rgba(107,127,215,0.2), inset 0 0 25px rgba(107,127,215,0.1);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 65px rgba(107,127,215,0.38), inset 0 0 40px rgba(107,127,215,0.18);
  }
}

#bPhase {
  font-size: .95rem;
  font-weight: 500;
  color: rgba(200,215,255,0.9);
  letter-spacing: .04em;
}

.b-count {
  font-size: 2.2rem;
  font-weight: 200;
  color: rgba(190,205,255,0.8);
  line-height: 1;
  min-height: 2.2rem;
  display: block;
}

.breath-ctrls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.cycles-txt {
  font-size: .875rem;
  color: var(--tm);
  min-height: 1.2rem;
}

/* ===== BUTTONS ===== */
.btn-main {
  background: linear-gradient(135deg, rgba(107,127,215,0.4), rgba(107,127,215,0.22));
  border: 1px solid rgba(107,127,215,0.5);
  border-radius: 100px;
  padding: .9rem 2.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--t);
  cursor: pointer;
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: .02em;
}

.btn-main:active { transform: scale(.97); opacity: .85; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--cb);
  border-radius: 100px;
  padding: .8rem 1.75rem;
  font-size: .925rem;
  color: var(--tm);
  cursor: pointer;
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-ghost:active { background: var(--card); }

/* ===== TECHNIQUE PICKER ===== */
.tech-picker {
  margin-bottom: 1.25rem;
  text-align: center;
}

.picker-lbl {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--td);
  margin-bottom: .75rem;
  font-weight: 600;
}

.pills {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-bottom: .75rem;
}

.pill {
  padding: .5rem 1.35rem;
  border-radius: 100px;
  border: 1px solid var(--cb);
  background: transparent;
  color: var(--tm);
  font-size: .9rem;
  cursor: pointer;
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
}

.pill.active {
  background: rgba(107,127,215,0.25);
  border-color: rgba(107,127,215,0.55);
  color: var(--t);
}

.tech-hint {
  font-size: .85rem;
  color: var(--tm);
  line-height: 1.6;
}

/* ===== SOUNDS ===== */
.sounds-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: 1.25rem;
}

.sound-card {
  background: var(--card);
  border: 1px solid var(--cb);
  border-radius: var(--r2);
  padding: 1.1rem 1rem .9rem;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  user-select: none;
}

.sound-card.on {
  background: rgba(107,127,215,0.11);
  border-color: rgba(107,127,215,0.42);
}

.sound-card:active { transform: scale(.97); }

.sc-icon { font-size: 1.8rem; line-height: 1; }

.sc-label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--t);
}

.sc-vol {
  width: 100%;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 2px;
  background: rgba(255,255,255,0.12);
  outline: none;
  cursor: pointer;
  display: none;
  margin-top: .2rem;
}

.sound-card.on .sc-vol { display: block; }

.sc-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--acc);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.sc-dot {
  position: absolute;
  top: .65rem;
  right: .65rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acc);
  opacity: 0;
  transition: opacity .2s;
  box-shadow: 0 0 8px var(--acc);
}

.sound-card.on .sc-dot { opacity: 1; }

.master-vol { padding: .75rem 0 .25rem; }

.vol-label {
  display: block;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--td);
  margin-bottom: .75rem;
  font-weight: 600;
}

#masterVol {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(to right, var(--acc) 60%, rgba(255,255,255,0.1) 60%);
}

#masterVol::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--t);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

/* ===== BODY SCAN ===== */
.bs-prog {
  height: 3px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.bs-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--acc), var(--acc3));
  border-radius: 2px;
  transition: width .6s ease;
  width: 0%;
}

.bs-step-n {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--td);
  margin-bottom: .5rem;
  font-weight: 600;
}

.bs-area {
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -.01em;
  background: linear-gradient(135deg, #ccdcff, #c4b0ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.bs-instr {
  font-size: .925rem;
  line-height: 1.9;
  color: var(--tm);
  border-color: rgba(155,139,232,0.2);
  background: rgba(155,139,232,0.06);
}

.bs-timer {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 200;
  color: rgba(107,127,215,0.5);
  min-height: 3.5rem;
  line-height: 3.5rem;
  letter-spacing: .05em;
}

.bs-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 1.1rem 0;
}

.bs-nav .btn-main { flex: 1; padding: .85rem; }
.bs-nav .btn-ghost { flex: 0 0 auto; }

.auto-lbl {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .875rem;
  color: var(--tm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  margin-top: .5rem;
}

.auto-lbl input { display: none; }

.tog-track {
  width: 44px;
  height: 26px;
  background: rgba(255,255,255,0.1);
  border-radius: 13px;
  position: relative;
  flex-shrink: 0;
  transition: background .3s;
}

.auto-lbl input:checked + .tog-track {
  background: rgba(107,127,215,0.6);
}

.tog-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform .3s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.auto-lbl input:checked + .tog-track .tog-thumb {
  transform: translateX(18px);
}

/* Done card */
.done-card {
  text-align: center;
  padding: 2.5rem 1rem 1rem;
}

.done-star {
  font-size: 3rem;
  color: var(--gld);
  display: block;
  margin-bottom: 1.1rem;
  animation: star-glow 3s ease-in-out infinite;
}

@keyframes star-glow {
  0%, 100% { text-shadow: 0 0 10px rgba(201,169,110,0.4); transform: scale(1); }
  50%       { text-shadow: 0 0 30px rgba(201,169,110,0.8); transform: scale(1.1); }
}

.done-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--t);
  margin-bottom: .75rem;
}

.done-card p {
  color: var(--tm);
  line-height: 1.85;
  font-size: .95rem;
}

/* ===== MIND ===== */
.mind-tabs {
  display: flex;
  gap: .4rem;
  margin-bottom: 1.25rem;
  background: rgba(255,255,255,0.04);
  border-radius: 100px;
  padding: .3rem;
}

.mtab {
  flex: 1;
  padding: .6rem .4rem;
  border-radius: 100px;
  border: none;
  background: transparent;
  color: var(--tm);
  font-size: .825rem;
  cursor: pointer;
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
  font-weight: 500;
}

.mtab.active {
  background: rgba(107,127,215,0.3);
  color: var(--t);
}

.affirm-item {
  padding: 1.2rem 1.25rem;
  border-radius: var(--r);
  margin-bottom: .7rem;
  background: var(--card);
  border: 1px solid var(--cb);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--tm);
  cursor: pointer;
  transition: all .25s;
  -webkit-tap-highlight-color: transparent;
}

.affirm-item.lit {
  background: rgba(107,127,215,0.1);
  border-color: rgba(107,127,215,0.35);
  color: var(--t);
  font-size: 1.05rem;
}

.fact-card {
  padding: 1.2rem 1.25rem;
  border-radius: var(--r);
  margin-bottom: .7rem;
  background: var(--card);
  border-left: 3px solid rgba(91,163,201,0.5);
  border-right: 1px solid var(--cb);
  border-top: 1px solid var(--cb);
  border-bottom: 1px solid var(--cb);
}

.fact-card h4 {
  font-size: .95rem;
  font-weight: 600;
  color: var(--t);
  margin-bottom: .5rem;
}

.fact-card p {
  font-size: .875rem;
  color: var(--tm);
  line-height: 1.8;
}

.let-item {
  padding: 1.5rem 1.25rem;
  border-radius: var(--r);
  margin-bottom: .7rem;
  background: linear-gradient(135deg, rgba(107,127,215,0.07), rgba(155,139,232,0.04));
  border: 1px solid rgba(155,139,232,0.2);
  font-size: .975rem;
  line-height: 2;
  color: var(--tm);
  font-style: italic;
}

/* ===== BOTTOM NAV ===== */
.bnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: rgba(7,11,20,0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nb {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  background: none;
  border: none;
  color: var(--td);
  cursor: pointer;
  padding: .5rem 0;
  transition: color .2s;
  -webkit-tap-highlight-color: transparent;
}

.nb svg {
  width: 22px;
  height: 22px;
}

.nb span {
  font-size: .67rem;
  letter-spacing: .02em;
}

.nb.active { color: var(--acc); }

/* ===== RESPONSIVE ===== */
@media (max-height: 600px) {
  .hero { padding: 1rem 0 1rem; }
  .hero-moon { font-size: 2.5rem; }
  h1 { font-size: 1.7rem; }
  .breath-outer { width: 220px; height: 220px; }
  .breath-inner { width: 120px; height: 120px; }
}

@media (min-width: 480px) {
  .scroll-wrap { padding-left: 1.5rem; padding-right: 1.5rem; }
  h1 { font-size: 2.6rem; }
}
