:root {
  --color-inhale: #8fe3c0;
  --color-hold:   #9db9f5;
  --color-exhale: #f5b0c9;
  --glow-white:   rgba(255,255,255,0.85);
  --text-soft:    rgba(255,255,255,0.92);
  --text-dim:     rgba(255,255,255,0.62);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
  color: var(--text-soft);
  min-height: 100vh;
  overflow-x: hidden;
  background: linear-gradient(180deg, #16172e 0%, #2b2358 32%, #6b4b83 62%, #d99cad 84%, #f4c9a8 100%);
  position: relative;
}

/* ---------------------------------------------------------- sky / clouds */

.sky {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 15%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1.5px 1.5px at 65% 8%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 40% 25%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 85% 20%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 10% 35%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.5px 1.5px at 92% 40%, rgba(255,255,255,0.4), transparent);
  opacity: 0.9;
  animation: twinkle 6s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.5; }
  to   { opacity: 1; }
}

.cloud-layer { position: absolute; inset: 0; }

.cloud {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.95), rgba(255,255,255,0.15) 70%);
  filter: blur(6px);
  opacity: 0.55;
}

.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

/* far layer: small, slow, faint */
.layer-far .cloud { filter: blur(10px); opacity: 0.35; }
.c1 { width: 220px; height: 60px; top: 12%; left: -20%; animation: drift 90s linear infinite; }
.c2 { width: 160px; height: 46px; top: 28%; left: -40%; animation: drift 120s linear infinite; animation-delay: -30s; }
.c3 { width: 260px; height: 70px; top: 6%;  left: -60%; animation: drift 140s linear infinite; animation-delay: -70s; }

/* mid layer */
.layer-mid .cloud { filter: blur(7px); opacity: 0.5; }
.c4 { width: 320px; height: 90px; top: 42%; left: -30%; animation: drift 70s linear infinite; animation-delay: -10s; }
.c5 { width: 240px; height: 70px; top: 58%; left: -55%; animation: drift 85s linear infinite; animation-delay: -45s; }

/* near layer: big, fast, soft */
.layer-near .cloud { filter: blur(4px); opacity: 0.65; }
.c6 { width: 420px; height: 120px; top: 70%; left: -40%; animation: drift 50s linear infinite; animation-delay: -5s; }
.c7 { width: 340px; height: 100px; top: 82%; left: -70%; animation: drift 62s linear infinite; animation-delay: -25s; }

@keyframes drift {
  from { transform: translateX(0); }
  to   { transform: translateX(160vw); }
}

@media (prefers-reduced-motion: reduce) {
  .cloud, .stars { animation: none; }
}

/* ---------------------------------------------------------------- layout */

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 24px;
}

.site-header {
  text-align: center;
  margin-bottom: 28px;
}

.glow-text {
  font-weight: 600;
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  margin: 0;
  letter-spacing: 0.02em;
  text-shadow:
    0 0 8px rgba(255,255,255,0.55),
    0 0 22px rgba(180,190,255,0.45),
    0 0 44px rgba(150,170,255,0.3);
}

.glow-text .accent {
  color: #ffe3b0;
  text-shadow:
    0 0 8px rgba(255,227,176,0.7),
    0 0 26px rgba(255,200,140,0.5);
}

.tagline {
  color: var(--text-dim);
  font-size: 1rem;
  margin-top: 8px;
  font-weight: 500;
}

.screen {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.hidden { display: none !important; }

/* ---------------------------------------------------------- program cards */

.programs {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  margin-top: 12px;
}

.program-card {
  font-family: inherit;
  text-align: left;
  color: var(--text-soft);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 20px;
  padding: 20px 22px;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(20,10,40,0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.program-card:hover, .program-card:focus-visible {
  transform: translateY(-3px);
  background: rgba(255,255,255,0.14);
  box-shadow: 0 12px 40px rgba(140,150,255,0.25);
  outline: none;
}

.program-card h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 600;
  text-shadow: 0 0 16px rgba(255,255,255,0.25);
}

.program-card .sub {
  margin: 0 0 10px;
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.4;
}

.program-card .meta {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.02em;
}

/* -------------------------------------------------------- breathing screen */

.breathe-title {
  margin: 8px 0 0;
  font-weight: 600;
  text-shadow: 0 0 18px rgba(255,255,255,0.4);
}

.breathe-round {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 0.9rem;
  min-height: 1.2em;
}

.btn-back {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 6px 4px;
  margin-bottom: 4px;
}
.btn-back:hover { color: var(--text-soft); }

.circle-wrap {
  position: relative;
  width: min(60vw, 280px);
  height: min(60vw, 280px);
  margin: 36px 0 18px;
}

.circle-wrap {
  cursor: pointer;
  will-change: transform;
}
.circle-wrap.paused .circle-svg { opacity: 0.55; }

/* The actual circle + fill live in SVG, which clips via a vector <clipPath>
   instead of CSS overflow:hidden/border-radius. SVG rendering isn't tiled
   the way a scaled, repeatedly-repainted HTML layer is, so it doesn't
   produce the compositor seam. */
.circle-svg {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.circle-ring {
  fill: rgba(255,255,255,0.06);
  stroke: rgba(255,255,255,0.35);
  stroke-width: 1.5;
}

.circle-fill-rect {
  fill: var(--color-inhale);
  transition: fill 0.6s ease;
}

.circle-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}

.circle-count {
  font-size: clamp(2.2rem, 10vw, 3.2rem);
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0 18px rgba(255,255,255,0.6), 0 0 40px rgba(255,255,255,0.35);
}

.circle-label {
  margin-top: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-soft);
  text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.circle-accum {
  margin-top: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  min-height: 1.2em;
}

.circle-hint {
  color: var(--text-dim);
  font-size: 0.88rem;
  min-height: 1.4em;
  text-align: center;
  max-width: 320px;
}

.btn-stop, .btn-primary {
  margin-top: 22px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-soft);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  padding: 10px 28px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-stop:hover, .btn-primary:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

#screen-done {
  justify-content: center;
  text-align: center;
  gap: 4px;
}

#screen-done h2 {
  text-shadow: 0 0 18px rgba(255,255,255,0.4);
}

#screen-done .sub {
  color: var(--text-dim);
  max-width: 340px;
}

/* --------------------------------------------------------------- footer */

.site-footer {
  margin-top: 32px;
  padding-top: 8px;
}

.kofi-link {
  display: inline-block;
  color: var(--text-soft);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(10px);
  transition: background 0.2s ease, transform 0.2s ease;
}

.kofi-link:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

@media (max-width: 420px) {
  .program-card { padding: 16px 18px; }
}
