:root {
  --bg: #020305;
  --bg-soft: #090b12;
  --panel: rgba(9, 12, 20, 0.72);
  --panel-border: rgba(138, 162, 201, 0.24);
  --text: #edf4ff;
  --muted: #8a9ab5;
  --inhale: #67ffd1;
  --exhale: #7db5ff;
  --cta: #53f2c2;
  --cta-dark: #0f342b;
  --radius-xl: 28px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 16%, rgba(51, 138, 255, 0.26) 0%, transparent 40%),
    radial-gradient(circle at 88% 12%, rgba(151, 93, 255, 0.2) 0%, transparent 42%),
    radial-gradient(circle at 72% 84%, rgba(255, 131, 59, 0.16) 0%, transparent 45%),
    linear-gradient(150deg, #010103, #05070d 60%, #020307 100%);
  color: var(--text);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  width: 42vmax;
  height: 42vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.4;
  pointer-events: none;
}

.ambient-a {
  left: -18vmax;
  top: -14vmax;
  background: radial-gradient(circle, rgba(69, 255, 203, 0.95), rgba(33, 123, 255, 0.7));
  animation: floatA 16s ease-in-out infinite alternate;
}

.ambient-b {
  right: -14vmax;
  bottom: -18vmax;
  background: radial-gradient(circle, rgba(173, 98, 255, 0.95), rgba(255, 142, 64, 0.7));
  animation: floatB 19s ease-in-out infinite alternate;
}

.app {
  width: min(1100px, 92vw);
  margin: 6vh auto;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr);
  gap: 22px;
}

.hero-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(16px);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.58);
}

.hero-card {
  padding: 30px;
}

.hero-header h1 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
}

.brand {
  margin: 0 0 8px;
  color: #9ee6ff;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
}

.subtitle {
  margin: 10px 0 0;
  color: var(--muted);
}

.intro-copy {
  margin-top: 12px;
  color: #c8d8ee;
  max-width: 70ch;
}

.intro-copy p {
  margin: 0;
  line-height: 1.55;
}

.read-more {
  margin-top: 10px;
}

.read-more summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #9ed2ff;
  font-weight: 600;
  list-style: none;
  user-select: none;
}

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

.read-more summary::after {
  content: "▾";
  font-size: 0.8rem;
  transform: translateY(-1px);
  transition: transform 0.2s ease;
}

.read-more[open] summary::after {
  transform: rotate(180deg) translateY(1px);
}

.read-more p {
  margin-top: 10px;
}

.mode-top {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.breathing-stage {
  margin-top: 26px;
  position: relative;
  min-height: 380px;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.pulse-ring {
  position: absolute;
  width: 310px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(132, 174, 255, 0.32);
}

.ring-1 {
  animation: ringPulse 4s ease-in-out infinite;
}

.ring-2 {
  width: 360px;
  border-color: rgba(255, 148, 82, 0.26);
  animation: ringPulse 4.8s ease-in-out infinite reverse;
}

.breath-circle {
  --phase-duration: 2s;
  --orb-green: rgba(111, 255, 214, 0.95);
  --orb-blue: rgba(79, 149, 255, 0.95);
  --orb-orange: rgba(255, 145, 75, 0.9);
  --orb-purple: rgba(173, 89, 255, 0.9);
  --orb-sheen: rgba(255, 255, 255, 0.9);
  width: clamp(180px, 33vw, 250px);
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  isolation: isolate;
  overflow: visible;
  border: 1px solid rgba(225, 236, 255, 0.5);
  background:
    radial-gradient(circle at 30% 17%, var(--orb-sheen) 0 13%, rgba(255, 255, 255, 0.2) 34%, rgba(255, 255, 255, 0) 52%),
    radial-gradient(circle at 72% 81%, rgba(3, 8, 21, 0.38), rgba(3, 8, 21, 0) 56%),
    conic-gradient(from 165deg,
      var(--orb-blue),
      var(--orb-green),
      var(--orb-orange),
      var(--orb-purple),
      var(--orb-blue));
  box-shadow:
    0 0 0 1px rgba(208, 229, 255, 0.5),
    0 0 0 18px rgba(146, 108, 255, 0.1),
    0 0 80px rgba(90, 166, 255, 0.35),
    0 0 110px rgba(255, 136, 67, 0.22),
    inset 0 -24px 30px rgba(14, 21, 42, 0.35),
    inset 0 12px 24px rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  text-align: center;
  transform: scale(0.62);
  transition: transform var(--phase-duration) linear, box-shadow 0.4s ease, filter 0.4s ease, border-color 0.4s ease;
  z-index: 2;
}

.breath-circle::before,
.breath-circle::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.breath-circle::before {
  inset: -13%;
  z-index: -1;
  background:
    conic-gradient(from 0deg,
      rgba(88, 163, 255, 0.88),
      rgba(103, 255, 211, 0.62),
      rgba(255, 143, 64, 0.56),
      rgba(176, 92, 255, 0.6),
      rgba(88, 163, 255, 0.88));
  filter: blur(1px) saturate(145%);
  animation: auraSpin 7.8s linear infinite;
}

.breath-circle::after {
  inset: 8%;
  z-index: 1;
  border: 1px solid rgba(224, 246, 255, 0.46);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0) 60%);
  mix-blend-mode: screen;
  opacity: 0.72;
  animation: innerShimmer 4.8s ease-in-out infinite;
}

.breath-circle > * {
  position: relative;
  z-index: 2;
  text-shadow: 0 3px 18px rgba(9, 25, 61, 0.45);
}

.breath-circle.is-frozen {
  transition: none !important;
}

.breath-circle.is-frozen::before,
.breath-circle.is-frozen::after {
  animation-play-state: paused;
}

.breath-circle.is-inhale {
  --orb-green: rgba(134, 255, 214, 0.98);
  --orb-blue: rgba(86, 179, 255, 0.95);
  --orb-orange: rgba(255, 146, 86, 0.65);
  --orb-purple: rgba(153, 98, 255, 0.8);
  filter: saturate(132%) hue-rotate(-4deg);
  border-color: rgba(166, 255, 221, 0.68);
  box-shadow:
    0 0 0 1px rgba(174, 255, 223, 0.62),
    0 0 0 22px rgba(98, 255, 198, 0.14),
    0 40px 90px rgba(63, 251, 197, 0.44),
    0 0 120px rgba(84, 165, 255, 0.3),
    inset 0 -22px 28px rgba(16, 33, 67, 0.24),
    inset 0 12px 20px rgba(255, 255, 255, 0.24);
}

.breath-circle.is-exhale {
  --orb-green: rgba(100, 224, 255, 0.7);
  --orb-blue: rgba(111, 129, 255, 0.95);
  --orb-orange: rgba(255, 147, 86, 0.96);
  --orb-purple: rgba(191, 98, 255, 0.96);
  filter: saturate(120%) hue-rotate(9deg);
  border-color: rgba(234, 176, 255, 0.6);
  box-shadow:
    0 0 0 1px rgba(226, 171, 255, 0.58),
    0 0 0 20px rgba(174, 98, 255, 0.12),
    0 32px 78px rgba(255, 135, 73, 0.42),
    0 0 120px rgba(137, 102, 255, 0.3),
    inset 0 -22px 28px rgba(16, 33, 67, 0.35),
    inset 0 12px 20px rgba(255, 255, 255, 0.16);
}

.breath-circle.is-inhale::before {
  animation-duration: 5.8s;
}

.breath-circle.is-exhale::before {
  animation-duration: 8.6s;
}

.phase-text {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.time-text {
  margin: 4px 0 0;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  color: #f6fdff;
  opacity: 0.9;
}

.controls {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.2s ease, opacity 0.2s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary {
  color: #062018;
  background: linear-gradient(125deg, #9affdc, var(--cta));
}

.btn-accent {
  color: #f5f9ff;
  background: linear-gradient(135deg, rgba(106, 180, 255, 0.98), rgba(89, 126, 255, 0.98));
}

.btn-muted {
  color: #d6ecff;
  background: linear-gradient(130deg, rgba(40, 63, 97, 0.95), rgba(26, 39, 63, 0.96));
}

.btn.is-mode-active {
  box-shadow: 0 0 0 2px rgba(213, 241, 255, 0.5), 0 10px 26px rgba(63, 185, 255, 0.35);
  filter: saturate(112%);
}

.btn:disabled {
  cursor: default;
  opacity: 0.45;
}

.panel {
  padding: 22px 20px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.panel-block {
  padding: 12px;
  background: rgba(8, 19, 37, 0.46);
  border: 1px solid rgba(176, 215, 255, 0.15);
  border-radius: 12px;
}

.label {
  margin: 0;
  color: #8fb4d1;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.72rem;
}

.value {
  margin: 7px 0 0;
  font-size: 0.97rem;
}

.status {
  color: #b8ffea;
}

.sequence-list {
  list-style: none;
  margin: 9px 0 0;
  padding: 0;
  display: grid;
  gap: 7px;
  max-height: 252px;
  overflow: auto;
}

.sequence-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(11, 25, 47, 0.7);
  border: 1px solid rgba(173, 216, 255, 0.12);
  color: #c9ddf0;
  font-size: 0.88rem;
}

.sequence-list li.active {
  background: linear-gradient(120deg, rgba(81, 171, 255, 0.25), rgba(76, 244, 197, 0.2));
  border-color: rgba(154, 255, 226, 0.46);
}

.sequence-list li.done {
  color: #87a5be;
  border-color: rgba(142, 165, 188, 0.2);
}

@keyframes ringPulse {
  0% {
    transform: scale(0.87);
    opacity: 0.25;
  }
  50% {
    transform: scale(1.03);
    opacity: 0.45;
  }
  100% {
    transform: scale(0.89);
    opacity: 0.22;
  }
}

@keyframes auraSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes innerShimmer {
  0% {
    opacity: 0.48;
    transform: scale(0.93);
  }
  50% {
    opacity: 0.84;
    transform: scale(1.05);
  }
  100% {
    opacity: 0.48;
    transform: scale(0.93);
  }
}

@keyframes floatA {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(5vw, 8vh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .breath-circle::before,
  .breath-circle::after,
  .ring-1,
  .ring-2,
  .ambient-a,
  .ambient-b {
    animation: none !important;
  }
}

@keyframes floatB {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-6vw, -7vh);
  }
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
  }

  .breathing-stage {
    min-height: 320px;
  }

  .pulse-ring {
    width: 260px;
  }

  .ring-2 {
    width: 300px;
  }
}

@media (max-width: 600px) {
  .app {
    width: 94vw;
    margin: 3vh auto;
  }

  .hero-card {
    padding: 22px 18px;
  }

  .panel {
    padding: 16px;
  }

  .mode-top {
    justify-content: flex-start;
  }
}
