:root {
  color: #3a403c;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --ink: #3a403c;
  --leaf: #5f6d5c;
  --leaf-soft: rgba(95, 109, 92, 0.16);
  --paper: rgba(255, 255, 255, 0.5);
  --line: rgba(58, 64, 60, 0.22);
  --sage: linear-gradient(
    180deg,
    #eef2ee 0% 11%,
    #e3ebe4 11% 22%,
    #d7e1d6 22% 36%,
    #e6eee5 36% 48%,
    #d3ddd2 48% 61%,
    #e0e8df 61% 73%,
    #c9d4c8 73% 86%,
    #b7c4b6 86% 100%
  );
}

* { box-sizing: border-box; }

html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  padding:
    max(1.5rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    calc(4.6rem + env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  color: var(--ink);
  background-color: #d5ddd4;
  background-image: var(--sage);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}

body.practising { overflow: hidden; }

h1, h2, h3, p { margin: 0; font-weight: 400; }

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

/* ---- Overview ---- */

.overview {
  width: min(40rem, 100%);
  margin: 0 auto;
}

.head { text-align: center; }

.mark-wrap {
  display: block;
  width: min(7.5rem, 34vw);
  margin: 0 auto 0.4rem;
}

.mark {
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
}

h1 {
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  font-weight: 450;
  letter-spacing: 0.16em;
}

.role,
.sequences h2 {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.role { margin-top: 0.45rem; }

.intro {
  margin: 1.8rem 0 0;
  line-height: 1.65;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.intro-text p + p { margin-top: 0.8rem; }

.steps {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 0.75rem 0.95rem 0.75rem 3.1rem;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  line-height: 1.45;
  font-size: 0.95rem;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0.85rem;
  top: 50%;
  width: 1.6rem;
  height: 1.6rem;
  margin-top: -0.8rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  color: var(--leaf);
  border: 1px solid rgba(95, 109, 92, 0.45);
}

.steps span { font-weight: 600; }

.sequences { margin-top: 2.2rem; }

.sequences h2 {
  text-align: center;
  margin-bottom: 0.9rem;
}

.list {
  display: grid;
  gap: 0.75rem;
}

.card {
  background: var(--paper);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(58, 64, 60, 0.08);
  overflow: hidden;
}

.card-main {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1rem 0.9rem;
}

.card-text { flex: 1; min-width: 0; }

.card-name {
  font-size: 1.08rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.card-meta {
  margin-top: 0.25rem;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.begin {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 1.15rem;
  border: 0;
  border-radius: 999px;
  background: var(--leaf);
  color: #f4f6f3;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
}

.begin:hover { background: #55634f; }

.flow {
  border-top: 1px solid rgba(58, 64, 60, 0.1);
}

.flow summary {
  list-style: none;
  cursor: pointer;
  padding: 0.75rem 1rem;
  min-height: 44px;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.8;
}

.flow summary::-webkit-details-marker { display: none; }
.flow summary::after { content: " +"; }
.flow[open] summary::after { content: " –"; }

.flow ol {
  margin: 0;
  padding: 0 1rem 0.9rem 2.4rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.flow li { padding: 0.3rem 0; }

.flow li span {
  float: right;
  margin-left: 0.8rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}

.status {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.5;
  min-height: 1.2em;
}

/* ---- Timer ---- */

.timer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    env(safe-area-inset-bottom)
    env(safe-area-inset-left);
  background-color: #dfe7de;
  background-image: var(--sage);
  overscroll-behavior: none;
}

.timer[hidden] { display: none; }

.timer-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.6rem 0.3rem;
  flex-shrink: 0;
}

.timer-head {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.timer-name {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timer-position {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
}

.icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
}

.icon:hover { background: rgba(255, 255, 255, 0.35); }

svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#sound .sound-off,
#sound[aria-pressed="false"] .sound-on { display: none; }
#sound[aria-pressed="false"] .sound-off { display: block; }

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0.5rem 1.4rem;
  overflow: hidden;
}

.breath {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(115vw, 34rem);
  height: auto;
  margin: calc(min(115vw, 34rem) / -2) 0 0 calc(min(115vw, 34rem) / -2);
  opacity: 0.2;
  pointer-events: none;
}

.timer.running .breath { animation: breathe 11s ease-in-out infinite; }

@keyframes breathe {
  0%, 100% { transform: scale(0.94); opacity: 0.16; }
  45% { transform: scale(1.04); opacity: 0.26; }
}

.practice,
.done {
  position: relative;
  width: min(26rem, 100%);
  max-height: 100%;
  overflow-y: auto;
  text-align: center;
  scrollbar-width: none;
}

.practice::-webkit-scrollbar { display: none; }

.phase {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.75;
  min-height: 1em;
}

.pose {
  margin-top: 0.7rem;
  font-size: clamp(1.25rem, 5.6vw, 1.7rem);
  font-weight: 450;
  line-height: 1.3;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.clock {
  margin-top: 1rem;
  font-size: clamp(3.6rem, 21vw, 6.2rem);
  font-weight: 200;
  line-height: 1;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: #4b5948;
}

.progress {
  width: min(18rem, 80%);
  height: 3px;
  margin: 1.3rem auto 0;
  border-radius: 2px;
  background: rgba(58, 64, 60, 0.13);
  overflow: hidden;
}

.bar {
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: var(--leaf);
  transition: width 0.25s linear;
}

.hint {
  margin-top: 1.2rem;
  font-size: 0.95rem;
  line-height: 1.55;
  opacity: 0.85;
}

.upnext {
  margin-top: 1.1rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  opacity: 0.65;
  min-height: 1em;
}

.done[hidden] { display: none; }

.namaste {
  font-size: clamp(2.2rem, 11vw, 3.2rem);
  font-weight: 300;
  letter-spacing: 0.2em;
}

.thanks {
  margin: 1.1rem auto 0;
  max-width: 22rem;
  line-height: 1.6;
}

.soft {
  margin-top: 1.6rem;
  min-height: 48px;
  padding: 0 1.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  letter-spacing: 0.08em;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(0.6rem, 4vw, 1.2rem);
  padding: 0.8rem 1rem 1.4rem;
  flex-shrink: 0;
}

.controls[hidden] { display: none; }

.ctrl {
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  display: grid;
  place-items: center;
}

.ctrl:hover { background: rgba(255, 255, 255, 0.6); }
.ctrl:disabled { opacity: 0.35; cursor: default; }

.ctrl.main {
  width: 76px;
  height: 76px;
  border: 0;
  background: var(--leaf);
  color: #f4f6f3;
  box-shadow: 0 10px 26px rgba(75, 89, 72, 0.3);
}

.ctrl.main svg { width: 30px; height: 30px; }
.ctrl.main .when-paused { fill: currentColor; stroke-width: 1.2; margin-left: 3px; }
.ctrl.main .when-paused,
.timer.running .ctrl.main .when-running { display: block; }
.ctrl.main .when-running,
.timer.running .ctrl.main .when-paused { display: none; }

.ctrl-spacer { width: 52px; height: 52px; }

@media (max-height: 640px) {
  .clock { font-size: clamp(3rem, 16vw, 4.6rem); margin-top: 0.6rem; }
  .hint { margin-top: 0.8rem; font-size: 0.9rem; }
  .controls { padding-bottom: 0.9rem; }
}

@media (min-width: 720px) {
  .card-main { padding: 1.15rem 1.3rem 1rem; }
  .flow summary { padding-inline: 1.3rem; }
  .flow ol { padding-inline: 2.7rem 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .timer.running .breath { animation: none; }
  .bar { transition: none; }
}
