main {
  max-width: 40rem;
}

.subtitle {
  text-align: center;
  color: var(--muted);
  margin: 0 auto 1.75rem;
  max-width: 30rem;
}

/* Pattern picker */
.patterns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.pattern-btn {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 1.1rem;
  background: var(--btn);
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.pattern-btn:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.pattern-btn.is-active {
  background: var(--pick-bg);
  border-color: var(--pick-border);
}

.pattern-name {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
}

.pattern-detail {
  font-size: 0.78rem;
  color: var(--muted);
}

/* The breathing orb */
.stage {
  display: flex;
  justify-content: center;
  margin: 1rem 0 2rem;
}

.orb-wrap {
  position: relative;
  width: 340px;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* A soft halo that breathes on its own for a calm, ambient feel. */
.orb-wrap::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 220, 0.28) 0%, rgba(255, 200, 220, 0) 70%);
  animation: aura 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes aura {
  0%, 100% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 0.85; }
}

.orb {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 28%, #fff2f7 0%, #ffb8d2 28%, #ff93ba 65%, #f876a6 100%);
  box-shadow:
    0 0 70px 10px rgba(255, 150, 188, 0.55),
    inset 0 -14px 30px rgba(220, 95, 145, 0.35),
    inset 0 12px 26px rgba(255, 255, 255, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  color: var(--ink);
  text-align: center;
  transform: scale(1);
  transition: transform cubic-bezier(0.45, 0, 0.55, 1);
  will-change: transform;
}

/* Gentle idle float when not actively guiding a breath. */
.orb.is-idle {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.orb-phase {
  font-family: "Fredoka", sans-serif;
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.7);
}

.orb-count {
  font-size: 0.85rem;
  opacity: 0.7;
  min-height: 1em;
  color: var(--muted);
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.7);
}

/* Controls */
.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--primary);
  border-radius: 999px;
  padding: 0.7rem 2.4rem;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.15s, transform 0.1s;
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-primary:active {
  transform: scale(0.97);
}

.sound-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
}

.cycles {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 1.25rem;
}

/* Expandable "why this helps" */
.why {
  max-width: 32rem;
  margin: 2.5rem auto 0;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.why summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-family: "Fredoka", sans-serif;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.why summary::-webkit-details-marker { display: none; }

.why summary::after {
  content: "\203A";
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 0.25s ease;
}

.why[open] summary::after {
  transform: rotate(90deg);
}

.why-body {
  padding: 0 1.25rem 1.25rem;
  color: var(--ink);
  line-height: 1.6;
  font-size: 0.95rem;
  animation: fade-in 0.4s ease;
}

.why-body p {
  margin: 0 0 0.85rem;
}

.why-list {
  margin: 0 0 0.85rem;
  padding-left: 1.1rem;
}

.why-list li {
  margin-bottom: 0.5rem;
}

.why-note {
  color: var(--muted);
  font-size: 0.88rem;
  font-style: italic;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Settle the whole page in gently */
main {
  animation: fade-in 0.5s ease;
}

/* Honor reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .orb-wrap::before,
  .orb.is-idle,
  main,
  .why-body {
    animation: none;
  }
}

/* dark mode: the breathing orb is always pink, so its text needs a fixed dark colour to read */
html.dark .orb-phase { color: #3a2030; }
html.dark .orb-count { color: #6e3a56; }
