/* =========================================================
   Neshimot — Daily Breath Practice
   Desert dusk palette · Cormorant Garamond + Jost
   ========================================================= */

:root {
  --night: #110e1a;
  --night-2: #17121f;
  --dusk: #221a2c;
  --plum: #3a2336;
  --rose: #d98c7a;
  --ember: #e3905a;
  --saffron: #ebc07e;
  --cream: #fff2d6;
  --sand: #efe3cf;
  --sand-2: #c4b39a;
  --sand-3: #8f806d;
  --dune-2: #3a2337;
  --dune-3: #231a2c;

  --line: rgba(235, 192, 126, 0.14);
  --line-2: rgba(235, 192, 126, 0.28);
  --glass: rgba(239, 227, 207, 0.035);

  --c-in: #ebc07e;
  --c-hold: #e0937f;
  --c-out: #92abdb;
  --c-pump: #e3905a;
  --c-rest: #b9a78f;

  --cat-foundation: #ebc07e;
  --cat-balance: #7fb5a8;
  --cat-calm: #a49ddb;
  --cat-energy: #e8915c;

  --serif: 'Cormorant Garamond', 'Iowan Old Style', 'Times New Roman', serif;
  --sans: 'Jost', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-breath: cubic-bezier(0.45, 0, 0.55, 1);
  --radius: 22px;
  --gutter: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

/* the breath level (0 = empty, 1 = full) drives every breathing figure */
@property --lvl {
  syntax: '<number>';
  inherits: true;
  initial-value: 0.3;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--sand);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: rgba(235, 192, 126, 0.35);
  color: var(--cream);
}

:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--saffron);
  color: var(--night);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  transition: top 0.3s;
}

.skip:focus {
  top: 16px;
}

.wrap {
  width: min(1200px, calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

em {
  font-style: italic;
  font-family: var(--serif);
  font-size: 1.08em;
  color: var(--cream);
}

/* ---------- Type helpers ---------- */

.eyebrow {
  margin: 0 0 18px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.74rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--saffron);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.meta {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sand-3);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cat, var(--saffron));
  box-shadow: 0 0 10px var(--cat, var(--saffron));
  flex: none;
}

.section {
  padding: clamp(88px, 12vw, 168px) 0;
  position: relative;
}

.section-head {
  max-width: 760px;
  margin-bottom: clamp(40px, 6vw, 72px);
}

.section-title {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.5rem, 5.6vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  color: var(--sand);
}

.section-lede {
  margin: 0;
  max-width: 60ch;
  font-size: clamp(1.02rem, 1.4vw, 1.15rem);
  color: var(--sand-2);
}

.pattern-bg {
  isolation: isolate;
}

.pattern-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23EBC07E' stroke-opacity='.075' stroke-width='1'%3E%3Crect x='28' y='28' width='40' height='40'/%3E%3Crect x='28' y='28' width='40' height='40' transform='rotate(45 48 48)'/%3E%3Cpath d='M48 0v19.7M48 76.3V96M0 48h19.7M76.3 48H96'/%3E%3Ccircle cx='0' cy='0' r='9'/%3E%3Ccircle cx='96' cy='0' r='9'/%3E%3Ccircle cx='0' cy='96' r='9'/%3E%3Ccircle cx='96' cy='96' r='9'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 96px 96px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
}

/* ---------- Buttons ---------- */

.btn {
  --h: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--h);
  padding: 0 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.4s var(--ease), background 0.4s, border-color 0.4s, color 0.4s, box-shadow 0.4s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, #f6d9a3, var(--saffron) 45%, #d99a55);
  color: #20150f;
  box-shadow: 0 10px 30px -12px rgba(235, 192, 126, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -14px rgba(235, 192, 126, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-ghost {
  background: rgba(239, 227, 207, 0.04);
  border-color: var(--line-2);
  color: var(--sand);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  border-color: var(--saffron);
  color: var(--cream);
  transform: translateY(-2px);
}

.btn-lg {
  --h: 58px;
  padding: 0 40px;
  font-size: 0.92rem;
}

.link-btn {
  background: none;
  border: 0;
  padding: 6px 2px;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--sand-2);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 5px;
  cursor: pointer;
  transition: color 0.3s, text-decoration-color 0.3s;
}

.link-btn:hover {
  color: var(--sand);
  text-decoration-color: var(--saffron);
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(239, 227, 207, 0.04);
  color: var(--sand);
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s, transform 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn:hover {
  border-color: var(--line-2);
  background: rgba(239, 227, 207, 0.08);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sand-2);
  cursor: pointer;
  transition: all 0.35s var(--ease);
}

.chip:hover {
  color: var(--sand);
  border-color: var(--line-2);
}

.chip.is-on {
  color: var(--night);
  background: var(--sand);
  border-color: var(--sand);
}

.chip.is-on .dot {
  box-shadow: none;
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: calc(14px + env(safe-area-inset-top)) max(var(--gutter), calc((100% - 1200px) / 2)) 14px;
  transition: background 0.5s, border-color 0.5s, padding 0.5s;
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  background: rgba(17, 14, 26, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border-color: var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--sand);
}

.brand .mark {
  color: var(--saffron);
  transition: transform 1.2s var(--ease);
}

.brand:hover .mark {
  transform: rotate(45deg);
}

.nav-links {
  display: flex;
  gap: clamp(16px, 2.4vw, 36px);
}

.nav-links a {
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sand-2);
  text-decoration: none;
  position: relative;
  padding: 6px 0;
  transition: color 0.3s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--saffron);
  transform: scaleX(0);
  transition: transform 0.4s var(--ease);
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--sand);
}

.nav-links a:hover::after,
.nav-links a.is-active::after {
  transform: scaleX(1);
}

.nav-cta {
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(239, 227, 207, 0.04);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.35s var(--ease);
}

.nav-cta:hover {
  background: var(--saffron);
  border-color: var(--saffron);
  color: var(--night);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(180deg, #0c0a15 0%, #171127 24%, #2e1d3a 44%, #5e3247 58%, #a7575a 70%, #dd8d5d 80%, #efbd7c 90%);
  isolation: isolate;
}

.sky {
  position: absolute;
  inset: 0;
  z-index: -3;
}

.stars {
  position: absolute;
  inset: 0 0 45% 0;
}

.star {
  position: absolute;
  width: var(--s, 2px);
  height: var(--s, 2px);
  border-radius: 50%;
  background: #fff6e0;
  box-shadow: 0 0 6px rgba(255, 246, 224, 0.8);
  opacity: var(--o, 0.6);
  animation: twinkle var(--d, 5s) ease-in-out infinite var(--delay, 0s);
}

@keyframes twinkle {
  0%,
  100% {
    opacity: var(--o, 0.6);
  }
  50% {
    opacity: calc(var(--o, 0.6) * 0.25);
  }
}

.moon {
  position: absolute;
  top: 14%;
  right: 13%;
  width: 30px;
  opacity: 0.85;
  filter: drop-shadow(0 0 14px rgba(244, 230, 200, 0.55));
}

.shooting {
  position: absolute;
  top: 16%;
  left: 18%;
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 246, 224, 0.9));
  transform: rotate(-18deg);
  opacity: 0;
  animation: shoot 13s ease-in 4s infinite;
}

@keyframes shoot {
  0% {
    opacity: 0;
    translate: 0 0;
  }
  1% {
    opacity: 1;
  }
  6% {
    opacity: 0;
    translate: 340px 110px;
  }
  100% {
    opacity: 0;
    translate: 340px 110px;
  }
}

.sun {
  position: absolute;
  left: 50%;
  top: 73%;
  width: min(46vw, 380px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  z-index: -2;
  pointer-events: none;
}

.sun-disc,
.sun-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.sun-disc {
  background: radial-gradient(circle, #fff3d9 0%, #ffdca0 30%, #f4ab62 52%, rgba(244, 171, 98, 0) 66%);
  animation: sunBreath 11s var(--ease-breath) infinite;
}

.sun-glow {
  inset: -70%;
  background: radial-gradient(circle, rgba(255, 210, 150, 0.4) 0%, rgba(240, 150, 100, 0.16) 30%, rgba(240, 150, 100, 0) 60%);
  animation: sunGlow 11s var(--ease-breath) infinite;
}

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

@keyframes sunGlow {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.dunes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.dune {
  will-change: transform;
}

.hero-inner {
  position: relative;
  text-align: center;
  padding: calc(clamp(84px, 13vh, 140px) + env(safe-area-inset-top)) var(--gutter) 0;
  max-width: 820px;
}

.hero-eyebrow {
  color: var(--sand-2);
  animation: rise 1.4s var(--ease) both 0.1s;
}

.hero-eyebrow::before {
  display: none;
}

.hero-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(4.4rem, min(15vw, 18vh), 10.5rem);
  line-height: 0.9;
  letter-spacing: 0.04em;
  color: var(--cream);
  text-shadow: 0 0 60px rgba(235, 192, 126, 0.25);
  animation: rise 1.6s var(--ease) both 0.2s;
}

.hero-scripts {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin: 10px 0 26px;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: var(--saffron);
  animation: rise 1.6s var(--ease) both 0.35s;
}

.hero-scripts [lang='he'] {
  font-family: 'Frank Ruhl Libre', var(--serif);
}

.hero-scripts [lang='ar'] {
  font-family: 'Amiri', var(--serif);
  font-size: 1.12em;
}

.hero-scripts i {
  width: 5px;
  height: 5px;
  background: var(--saffron);
  transform: rotate(45deg);
  opacity: 0.7;
}

.hero-sub {
  margin: 0 auto 36px;
  max-width: 34em;
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  color: var(--sand);
  text-shadow: 0 1px 18px rgba(17, 14, 26, 0.75), 0 0 2px rgba(17, 14, 26, 0.5);
  animation: rise 1.6s var(--ease) both 0.5s;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  animation: rise 1.6s var(--ease) both 0.65s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(26px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.scroll-cue {
  position: absolute;
  bottom: calc(22px + env(safe-area-inset-bottom));
  left: 50%;
  width: 1px;
  height: 56px;
  background: rgba(239, 227, 207, 0.18);
  overflow: hidden;
  transform: translateX(-50%);
}

.scroll-cue span {
  position: absolute;
  left: 0;
  top: -40%;
  width: 1px;
  height: 40%;
  background: var(--saffron);
  animation: cue 2.4s var(--ease) infinite;
}

@keyframes cue {
  to {
    top: 100%;
  }
}

/* ---------- How ---------- */

.how {
  padding: clamp(56px, 8vw, 96px) 0 clamp(24px, 4vw, 40px);
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 4vw, 56px);
}

.how-item {
  border-top: 1px solid var(--line);
  padding-top: 26px;
}

.how-n {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--saffron);
  margin-bottom: 8px;
}

.how-item h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.8rem;
  line-height: 1.1;
}

.how-item p {
  margin: 0;
  color: var(--sand-2);
}

/* ---------- Practice cards ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 268px), 1fr));
  gap: 18px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px 22px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--cat) 9%, transparent), transparent 60%),
    linear-gradient(180deg, rgba(239, 227, 207, 0.045), rgba(239, 227, 207, 0.012));
  transition: transform 0.6s var(--ease), border-color 0.6s, box-shadow 0.6s, opacity 0.5s;
}

.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--cat) 45%, transparent);
  box-shadow: 0 30px 60px -36px color-mix(in srgb, var(--cat) 55%, transparent);
}

.card.is-hidden {
  display: none;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.card-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--sand-3);
}

.card-icon {
  width: 50px;
  height: 50px;
  color: var(--cat);
}

.card-icon .icon {
  width: 100%;
  height: 100%;
}

.icon .draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.card:hover .icon .draw,
.card:focus-within .icon .draw {
  animation: draw 1.8s var(--ease) both;
}

@keyframes draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.card .meta {
  margin-bottom: 8px;
}

.card-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.62rem;
  line-height: 1.12;
}

.card-link {
  text-decoration: none;
}

.card-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.card-link:focus-visible {
  outline: none;
}

.card:has(.card-link:focus-visible) {
  outline: 2px solid var(--saffron);
  outline-offset: 3px;
}

.card-alt {
  margin: 2px 0 10px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.08rem;
  color: var(--cat);
}

.card-tag {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--sand-2);
}

.card-graph {
  height: 56px;
  margin: auto 0 14px;
  padding-top: 18px;
  box-sizing: content-box;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.card-pattern {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--sand-3);
}

.card-begin {
  position: relative;
  z-index: 2;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--cat) 50%, transparent);
  background: color-mix(in srgb, var(--cat) 8%, transparent);
  color: var(--cat);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.35s var(--ease);
}

.card-begin svg {
  width: 14px;
  height: 14px;
}

.card-begin:hover {
  background: var(--cat);
  color: var(--night);
}

/* ---------- Pattern graph ---------- */

.pattern-graph {
  width: 100%;
  height: auto;
  overflow: visible;
}

.pattern-graph.is-mini {
  height: 100%;
}

.pg-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.is-mini .pg-line {
  stroke-width: 1.7;
  vector-effect: non-scaling-stroke;
}

.pg-in {
  stroke: var(--c-in);
}
.pg-out {
  stroke: var(--c-out);
}
.pg-hold {
  stroke: var(--c-hold);
}
.pg-pump {
  stroke: var(--c-pump);
}
.pg-rest {
  stroke: var(--c-rest);
}

.pg-label {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.06em;
  fill: var(--sand-2);
}

.pg-t-in {
  fill: var(--c-in);
}
.pg-t-out {
  fill: var(--c-out);
}
.pg-t-hold {
  fill: var(--c-hold);
}
.pg-t-pump {
  fill: var(--c-pump);
}
.pg-t-rest {
  fill: var(--c-rest);
}

.pg-sep {
  stroke: var(--line);
  stroke-dasharray: 2 4;
}

.pg-base {
  stroke: var(--line);
}

.pg-head {
  fill: var(--cream);
  stroke: var(--ph, var(--saffron));
  stroke-width: 3;
  transition: stroke 0.6s;
}

.pg-axis {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.06em;
  fill: var(--sand-3);
}

.sw {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: middle;
}

.sw-in {
  background: var(--c-in);
}
.sw-out {
  background: var(--c-out);
}
.sw-hold {
  background: var(--c-hold);
}
.sw-pump {
  background: var(--c-pump);
}
.sw-rest {
  background: var(--c-rest);
}
.sw-hr {
  background: var(--rose);
}

/* ---------- Chapters ---------- */

.chapters {
  padding-bottom: clamp(40px, 6vw, 80px);
}

.chapter {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.1fr);
  gap: clamp(36px, 6vw, 100px);
  align-items: start;
  padding: clamp(72px, 10vw, 140px) 0;
  border-top: 1px solid var(--line);
}

.chapter:nth-child(even) .ch-visual {
  order: 2;
}

.ch-visual {
  position: sticky;
  top: 110px;
}

.ch-visual {
  --ph: var(--c-in);
  --ph-rgb: 235 192 126;
}

.ch-figure {
  --lvl: 0.3;
  width: min(100%, 340px);
  margin: 0 auto 30px;
  text-align: center;
}

.ch-emblem {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 38%, rgba(235, 192, 126, 0.08), transparent 62%),
    linear-gradient(180deg, rgba(42, 29, 51, 0.7), rgba(17, 14, 26, 0.3));
  overflow: hidden;
}

.ch-emblem .fig {
  position: absolute;
  inset: 5%;
  width: 90%;
  height: 90%;
}

.ch-phase {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 0;
  min-height: 1.4em;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sand-2);
}

.ch-phase i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ph);
  box-shadow: 0 0 12px var(--ph);
  transition: background 0.6s, box-shadow 0.6s;
}

/* ---------- The breathing figure ---------- */

.fig {
  overflow: visible;
}

.fig .sun-a {
  stop-color: #fff3d9;
  stop-opacity: 0.95;
}
.fig .sun-b {
  stop-color: #f6c27e;
  stop-opacity: 0.58;
}
.fig .sun-c {
  stop-color: #e3905a;
  stop-opacity: 0.16;
}
.fig .sun-d {
  stop-color: #e3905a;
  stop-opacity: 0;
}

.fig-sun {
  transform-origin: 0px -22px;
  transform: scale(calc(0.7 + var(--lvl) * 0.36));
  opacity: calc(0.55 + var(--lvl) * 0.45);
}

.fig-ground {
  fill: none;
  stroke: rgba(235, 192, 126, 0.3);
  stroke-width: 0.8;
}

.fig-sil {
  fill: #1a1422;
  stroke: rgba(239, 227, 207, 0.36);
  stroke-width: 0.9;
  stroke-linejoin: round;
}

.fig-shin {
  fill: none;
  stroke: rgba(239, 227, 207, 0.2);
  stroke-width: 0.8;
  stroke-linecap: round;
}

.fig-limb,
.fig-limb-o {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fig-limb {
  stroke: #1a1422;
  stroke-width: 7;
}

.fig-limb-o {
  stroke: rgba(239, 227, 207, 0.36);
  stroke-width: 8.7;
}

.fig .air-a {
  stop-color: var(--ph);
  stop-opacity: 0.85;
}
.fig .air-b {
  stop-color: var(--ph);
  stop-opacity: 0.45;
}
.fig .air-c {
  stop-color: var(--ph);
  stop-opacity: 0;
}
.fig .heart-a {
  stop-color: #fff3d9;
  stop-opacity: 0.9;
}
.fig .heart-b {
  stop-color: var(--ph);
  stop-opacity: 0.45;
}
.fig .heart-c {
  stop-color: var(--ph);
  stop-opacity: 0;
}

/* breath light fills the body from the belly upward, with a soft rising edge */
.fig-air {
  transform-origin: 0px 28px;
  transform: scaleY(calc(var(--lvl) * 1.12));
  opacity: calc(0.25 + var(--lvl) * 0.9);
}

.fig-heart {
  transform-origin: 0px -20px;
  transform: scale(calc(0.6 + var(--lvl) * 0.6));
  opacity: calc(var(--lvl) * 1.15 - 0.2);
}

/* the body itself breathes: ribs widen, shoulders and head rise */
.fig-torso {
  transform-origin: 0px 30px;
  transform: translateY(calc(var(--lvl) * -1.2px)) scale(calc(1 + var(--lvl) * 0.055), calc(1 + var(--lvl) * 0.03));
}

.fig-head {
  transform: translateY(calc(var(--lvl) * -2.6px));
}

.fig-arms {
  transform: translateY(calc(var(--lvl) * -1.2px));
}

.fig-arms-front {
  transform: translateY(calc(var(--lvl) * -1.8px));
}

.fig .arm-belly,
.fig .arm-nose,
.fig .arm-ear {
  display: none;
}

.fig[data-pose='belly'] .arm-belly,
.fig[data-pose='nose'] .arm-nose,
.fig[data-pose='hum'] .arm-ear {
  display: inline;
}

.fig[data-pose='belly'] .arm-rest-l,
.fig[data-pose='belly'] .arm-rest-r,
.fig[data-pose='nose'] .arm-rest-l,
.fig[data-pose='hum'] .arm-rest-l,
.fig[data-pose='hum'] .arm-rest-r {
  display: none;
}

.fig-hum path {
  fill: none;
  stroke: var(--ph);
  stroke-width: 1.3;
  stroke-linecap: round;
  opacity: 0;
}

[data-phase='out'] .fig[data-pose='hum'] .fig-hum path {
  animation: hum 1.5s ease-out infinite;
}

[data-phase='out'] .fig[data-pose='hum'] .fig-hum path:nth-child(2) {
  animation-delay: 0.25s;
}

[data-phase='out'] .fig[data-pose='hum'] .fig-hum path:nth-child(3) {
  animation-delay: 0.5s;
}

@keyframes hum {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }
  35% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateY(-7px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.ch-graph {
  margin: 0;
  padding: 18px 18px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(239, 227, 207, 0.02);
}

.ch-graph figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 10px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--sand-2);
}

.fc-note {
  margin-left: auto;
  color: var(--sand-3);
}

.ch-num {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--cat);
}

.ch-num span {
  color: var(--sand-3);
}

.ch-title {
  margin: 14px 0 4px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.5rem, 4.6vw, 3.7rem);
  line-height: 1.02;
}

.ch-alt {
  margin: 0 0 26px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--cat);
}

.ch-summary {
  margin: 0 0 34px;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--sand);
}

.ch-h {
  margin: 0 0 16px;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--sand-2);
}

.steps {
  list-style: none;
  counter-reset: s;
  margin: 0 0 30px;
  padding: 0;
}

.steps li {
  counter-increment: s;
  position: relative;
  padding: 0 0 16px 52px;
  color: var(--sand);
}

.steps li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: -1px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--cat) 55%, transparent);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--cat);
}

.steps li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 16px;
  top: 36px;
  bottom: 4px;
  width: 1px;
  background: var(--line);
}

.benefits {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.benefits li {
  position: relative;
  padding: 12px 14px 12px 38px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--cat) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--cat) 16%, transparent);
  font-size: 0.93rem;
  line-height: 1.4;
  color: var(--sand);
}

.benefits li::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  background: var(--cat);
  transform: translateY(-50%) rotate(45deg);
  opacity: 0.85;
}

.fold {
  border-top: 1px solid var(--line);
}

.fold:last-of-type {
  border-bottom: 1px solid var(--line);
}

.fold summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--sand);
}

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

.fold summary::after {
  content: '';
  width: 12px;
  height: 12px;
  border-right: 1px solid var(--saffron);
  border-bottom: 1px solid var(--saffron);
  transform: rotate(45deg) translate(-3px, -3px);
  transition: transform 0.4s var(--ease);
}

.fold[open] summary::after {
  transform: rotate(-135deg) translate(-3px, -3px);
}

.fold p,
.fold ul {
  margin: 0 0 20px;
  color: var(--sand-2);
}

.fold ul {
  padding-left: 20px;
}

.fold li {
  margin-bottom: 6px;
}

.fold li::marker {
  color: var(--cat);
}

.caution {
  margin: 24px 0 0;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(227, 144, 90, 0.3);
  background: rgba(227, 144, 90, 0.07);
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--sand);
}

.caution strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ember);
}

.ch-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 34px;
}

.ch-pattern {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--sand-3);
}

/* ---------- Rituals ---------- */

.rituals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}

.ritual {
  display: flex;
  flex-direction: column;
  padding: 26px 26px 24px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(58, 35, 54, 0.45), rgba(23, 18, 31, 0.6));
  transition: transform 0.6s var(--ease), border-color 0.6s;
}

.ritual:hover {
  transform: translateY(-4px);
  border-color: var(--line-2);
}

.sun-arc {
  width: 100%;
  margin: -6px 0 18px;
  border-radius: 14px;
}

.ritual .eyebrow {
  margin-bottom: 6px;
}

.ritual-title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 2.6rem;
  line-height: 1;
}

.ritual-blurb {
  margin: 0 0 20px;
  color: var(--sand-2);
}

.ritual-list {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
}

.ritual-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.97rem;
}

.ritual-list a {
  text-decoration: none;
  color: var(--sand);
  transition: color 0.3s;
}

.ritual-list a:hover {
  color: var(--saffron);
}

.ritual-list span {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--sand-3);
  white-space: nowrap;
}

.ritual-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ritual-total {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--saffron);
}

.ritual .btn {
  --h: 44px;
  padding: 0 18px;
  font-size: 0.74rem;
}

/* ---------- Science lab ---------- */

.lab {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  border-radius: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(58, 35, 54, 0.35), rgba(17, 14, 26, 0.4));
  overflow: hidden;
  margin-bottom: clamp(56px, 8vw, 96px);
}

.lab-main {
  padding: clamp(20px, 3vw, 34px);
}

.lab-legend {
  display: flex;
  gap: 22px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sand-2);
  margin-bottom: 8px;
}

.lab-chart {
  width: 100%;
  height: auto;
}

.lab-chart .grid {
  stroke: var(--line);
  stroke-dasharray: 2 5;
}

.lab-chart .rsa-breath {
  fill: none;
  stroke: var(--c-in);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.lab-chart .rsa-breath-fill {
  fill: rgba(235, 192, 126, 0.08);
}

.lab-chart .rsa-hr {
  fill: none;
  stroke: var(--rose);
  stroke-width: 2;
  stroke-linecap: round;
}

.lab-chart .axis {
  font-family: var(--sans);
  font-size: 11px;
  fill: var(--sand-3);
  letter-spacing: 0.06em;
}

.lab-control {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}

.lab-control label {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sand-2);
}

.lab-control output {
  min-width: 52px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--saffron);
}

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  cursor: pointer;
}

input[type='range']::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--saffron) var(--fill, 50%), rgba(239, 227, 207, 0.18) var(--fill, 50%));
}

input[type='range']::-moz-range-track {
  height: 2px;
  border-radius: 2px;
  background: rgba(239, 227, 207, 0.18);
}

input[type='range']::-moz-range-progress {
  height: 2px;
  background: var(--saffron);
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--cream);
  border: 5px solid var(--saffron);
  box-shadow: 0 0 0 6px rgba(235, 192, 126, 0.14), 0 4px 14px rgba(0, 0, 0, 0.4);
}

input[type='range']::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cream);
  border: 5px solid var(--saffron);
  box-shadow: 0 0 0 6px rgba(235, 192, 126, 0.14);
}

.lab-side {
  padding: clamp(20px, 3vw, 34px);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(17, 14, 26, 0.35);
}

.lab-stat {
  margin: 0;
  font-family: var(--serif);
  font-size: 3.6rem;
  line-height: 1;
  font-weight: 300;
  color: var(--rose);
}

.lab-stat small {
  display: block;
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sand-2);
}

.lab-curve {
  width: 100%;
  height: auto;
}

.lab-curve .curve {
  fill: none;
  stroke: var(--rose);
  stroke-width: 2;
}

.lab-curve .curve-fill {
  fill: rgba(217, 140, 122, 0.1);
}

.lab-curve .marker {
  fill: var(--cream);
  stroke: var(--rose);
  stroke-width: 3;
  transition: cx 0.3s var(--ease), cy 0.3s var(--ease);
}

.lab-curve .zone {
  fill: rgba(235, 192, 126, 0.07);
}

.lab-curve text {
  font-family: var(--sans);
  font-size: 10px;
  fill: var(--sand-3);
  letter-spacing: 0.05em;
}

.lab-note {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.35;
  color: var(--sand);
  min-height: 3.4em;
}

.lab-fine {
  margin: auto 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--sand-3);
}

.principles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
}

.principle {
  border-top: 1px solid var(--line-2);
  padding-top: 22px;
}

.principle-num {
  font-family: var(--serif);
  font-style: italic;
  color: var(--saffron);
}

.principle h3 {
  margin: 6px 0 10px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1.15;
}

.principle p {
  margin: 0;
  font-size: 0.97rem;
  color: var(--sand-2);
}

/* ---------- Progress ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.stat {
  padding: 22px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(239, 227, 207, 0.025);
}

.stat-v {
  display: block;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  line-height: 1;
  color: var(--saffron);
  font-variant-numeric: lining-nums tabular-nums;
}

.stat-l {
  display: block;
  margin-top: 8px;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sand-2);
}

.progress-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: clamp(20px, 3vw, 30px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(239, 227, 207, 0.025);
}

.panel-title {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1.15;
}

.panel-sub {
  margin: 0;
  font-size: 0.92rem;
  color: var(--sand-2);
}

.week-chart {
  width: 100%;
  height: auto;
  margin-top: 18px;
}

.week-chart .bar {
  fill: url(#barg);
}

.week-chart .bar-empty {
  fill: rgba(239, 227, 207, 0.06);
}

.week-chart .bar-today {
  stroke: var(--saffron);
  stroke-width: 1;
}

.week-chart text {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  fill: var(--sand-3);
}

.week-chart .val {
  fill: var(--sand);
  font-size: 12px;
}

.cp-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.cp-icon {
  flex: none;
  width: 46px;
  height: 46px;
  color: var(--saffron);
}

.cp-steps {
  margin: 0 0 18px;
  padding-left: 20px;
  font-size: 0.93rem;
  color: var(--sand-2);
}

.cp-steps li {
  margin-bottom: 6px;
}

.cp-steps li::marker {
  color: var(--saffron);
  font-family: var(--serif);
}

.cp-steps strong {
  font-weight: 500;
  color: var(--sand);
}

.cp-timer {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.cp-time {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 4rem;
  line-height: 1;
  min-width: 2.4ch;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--cream);
}

.cp-unit {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--sand-3);
  margin-right: auto;
}

.cp.is-timing .cp-time {
  color: var(--saffron);
}

.cp-result {
  margin: 10px 0 6px;
  min-height: 1.7em;
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--sand);
}

.cp-chart {
  width: 100%;
  height: auto;
  margin: 6px 0 12px;
}

.cp-chart .band {
  opacity: 0.08;
}

.cp-chart .cp-line {
  fill: none;
  stroke: var(--saffron);
  stroke-width: 2;
}

.cp-chart .cp-dot {
  fill: var(--night);
  stroke: var(--saffron);
  stroke-width: 2;
}

.cp-chart text {
  font-family: var(--sans);
  font-size: 10px;
  fill: var(--sand-3);
  letter-spacing: 0.05em;
}

.reset-row {
  margin: 24px 0 0;
  text-align: right;
}

/* ---------- Safety ---------- */

.safety-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 6vw, 90px);
  align-items: start;
}

.safety-grid .section-head {
  margin-bottom: 0;
}

.safety-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.safety-list li {
  position: relative;
  padding: 18px 0 18px 40px;
  border-top: 1px solid var(--line);
  color: var(--sand);
}

.safety-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.safety-list li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 28px;
  width: 9px;
  height: 9px;
  border: 1px solid var(--saffron);
  transform: rotate(45deg);
}

/* ---------- Footer ---------- */

.footer {
  padding: 72px 0 calc(56px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(58, 35, 54, 0.25));
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.footer-line {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--sand);
}

.footer-fine {
  margin: 0;
  font-size: 0.8rem;
  color: var(--sand-3);
}

/* ---------- Reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* =========================================================
   Practice overlay
   ========================================================= */

.practice {
  --ph: var(--c-rest);
  --ph-rgb: 185 167 143;
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  color: var(--sand);
  background: var(--night);
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}

.practice[hidden] {
  display: none;
}

.practice.is-open {
  opacity: 1;
}

[data-phase='in'] {
  --ph: var(--c-in);
  --ph-rgb: 235 192 126;
}

[data-phase='hold'] {
  --ph: var(--c-hold);
  --ph-rgb: 224 147 127;
}

[data-phase='out'] {
  --ph: var(--c-out);
  --ph-rgb: 146 171 219;
}

[data-phase='pump'] {
  --ph: var(--c-pump);
  --ph-rgb: 227 144 90;
}

[data-phase='rest'],
[data-phase='prep'],
[data-phase='interlude'] {
  --ph: var(--c-rest);
  --ph-rgb: 185 167 143;
}

.pr-sky {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 70% at 50% 108%, rgba(var(--sky-rgb, 167 87 90) / 0.55), transparent 60%),
    linear-gradient(180deg, #0b0913 0%, #151025 45%, #2a1a33 78%, #3d2338 100%);
}

.pr-sky .stars {
  inset: 0 0 35% 0;
}

.pr-sand {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pr-dunes {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 30vh;
  pointer-events: none;
}

.pr-top {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: calc(18px + env(safe-area-inset-top)) max(var(--gutter), 3vw, env(safe-area-inset-right)) 0 max(var(--gutter), 3vw, env(safe-area-inset-left));
}

.pr-titles .eyebrow {
  margin-bottom: 6px;
}

.pr-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  line-height: 1.1;
}

/* views */
.practice[data-view='setup'] .pr-stage,
.practice[data-view='setup'] .pr-bar,
.practice[data-view='setup'] .pr-done,
.practice[data-view='stage'] .pr-setup,
.practice[data-view='stage'] .pr-done,
.practice[data-view='done'] .pr-setup,
.practice[data-view='done'] .pr-stage,
.practice[data-view='done'] .pr-bar {
  display: none;
}

/* setup */
.pr-setup {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 16px var(--gutter) calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  grid-row: 2 / 4;
}

.setup-card {
  width: min(540px, 100%);
  padding: clamp(22px, 4vw, 34px);
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(23, 18, 31, 0.72);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.6);
  animation: rise 0.9s var(--ease) both;
}

.setup-pattern {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.35;
  color: var(--sand);
}

.setup-pattern b {
  font-weight: 500;
  color: var(--saffron);
}

.setup-plan {
  margin-bottom: 14px;
}

.setup-plan:empty {
  display: none;
}

.setup-plan ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.setup-plan li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.97rem;
}

.setup-plan li span:last-child {
  color: var(--sand-3);
  font-size: 0.85rem;
}

.setup-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.setup-label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sand-2);
}

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seg button {
  min-width: 64px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 0.85rem;
  color: var(--sand-2);
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.seg button:hover {
  border-color: var(--line-2);
  color: var(--sand);
}

.seg button[aria-checked='true'] {
  background: var(--sand);
  border-color: var(--sand);
  color: var(--night);
}

.pace {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--sand-3);
}

.setup-calc {
  margin: 4px 0 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(239, 227, 207, 0.04);
  font-size: 0.85rem;
  color: var(--sand-2);
  text-align: center;
}

.setup-calc b {
  font-weight: 500;
  color: var(--sand);
}

.toggles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 22px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 0.86rem;
  color: var(--sand-2);
  cursor: pointer;
  text-align: left;
  transition: all 0.3s var(--ease);
}

.toggle .tg {
  flex: none;
  position: relative;
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: rgba(239, 227, 207, 0.14);
  transition: background 0.3s;
}

.toggle .tg::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sand-2);
  transition: transform 0.35s var(--ease), background 0.3s;
}

.toggle[aria-pressed='true'] {
  color: var(--sand);
  border-color: var(--line-2);
}

.toggle[aria-pressed='true'] .tg {
  background: var(--saffron);
}

.toggle[aria-pressed='true'] .tg::after {
  transform: translateX(12px);
  background: var(--night);
}

.setup-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.setup-actions .btn-lg {
  width: 100%;
}

/* stage */
.pr-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px var(--gutter) 0;
  min-height: 0;
}

.orb {
  --lvl: 0.32;
  --size: min(76vw, 46vh, 440px);
  position: relative;
  width: var(--size);
  height: var(--size);
  flex: none;
}

.orb-halo {
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(244, 171, 98, 0.22), rgba(244, 171, 98, 0.07) 55%, transparent 100%);
  transform: scale(calc(0.6 + var(--lvl) * 0.5));
  opacity: calc(0.4 + var(--lvl) * 0.6);
}

.orb-fig {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.orb-ring {
  position: absolute;
  inset: -5%;
  width: 110%;
  height: 110%;
  max-width: none;
  transform: rotate(-90deg);
  overflow: visible;
}

.ring-track {
  fill: none;
  stroke: rgba(239, 227, 207, 0.08);
  stroke-width: 0.5;
}

.ring-prog {
  fill: none;
  stroke: var(--ph);
  stroke-width: 0.9;
  stroke-linecap: round;
  stroke-dasharray: 307.876;
  stroke-dashoffset: 307.876;
  transition: stroke 1.2s var(--ease);
  filter: drop-shadow(0 0 3px rgb(var(--ph-rgb) / 0.8));
}

.orb-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: clamp(10px, 2.2vh, 22px);
}

.cue {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 5.4vw, 2.7rem);
  line-height: 1.05;
  color: var(--cream);
  text-shadow: 0 2px 30px rgba(17, 14, 26, 0.85);
  transition: opacity 0.5s;
}

.cue.swap {
  animation: cueIn 0.7s var(--ease);
}

@keyframes cueIn {
  from {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.count {
  margin: 6px 0 0;
  min-height: 1.4em;
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
  color: var(--ph);
  transition: color 1.2s var(--ease);
}

.hint {
  margin: clamp(6px, 1.4vh, 14px) 0 0;
  max-width: 30em;
  min-height: 1.6em;
  text-align: center;
  font-size: clamp(0.95rem, 2.4vw, 1.05rem);
  color: var(--sand-2);
}

.nostrils {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sand-3);
}

.nostrils[hidden] {
  display: none;
}

.nostrils span[data-side] {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  transition: all 0.6s var(--ease);
}

.nostrils span.is-on {
  color: var(--night);
  background: var(--ph);
  border-color: var(--ph);
}

.ns-bridge {
  width: 26px;
  height: 1px;
  background: var(--line-2);
}

.pr-round {
  margin: 8px 0 0;
  min-height: 1.4em;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--sand-3);
}

/* done */
.pr-done {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--gutter) calc(40px + env(safe-area-inset-bottom));
  grid-row: 2 / 4;
  animation: rise 1.2s var(--ease) both;
}

.done-mark {
  margin-bottom: 6px;
}

.done-fig {
  width: 180px;
  height: 180px;
  animation: idleBreath 9s ease-in-out infinite;
}

@keyframes idleBreath {
  0%,
  100% {
    --lvl: 0.2;
  }
  50% {
    --lvl: 0.9;
  }
}

.done-title {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.8rem, 8vw, 4.4rem);
  line-height: 1;
}

.done-sub {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--sand);
}

.done-note {
  margin: 0 0 30px;
  color: var(--sand-2);
}

/* bar */
.pr-bar {
  position: relative;
  z-index: 3;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  width: min(560px, 100%);
  margin: 0 auto;
}

.pr-progress {
  height: 2px;
  border-radius: 2px;
  background: rgba(239, 227, 207, 0.12);
  overflow: hidden;
  margin-bottom: 14px;
}

.pr-progress-fill {
  height: 100%;
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--saffron), var(--rose));
}

.pr-controls {
  display: grid;
  grid-template-columns: 1fr auto auto auto 1fr;
  align-items: center;
  gap: 14px;
}

.pr-time {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--sand-3);
}

.pr-time-r {
  text-align: right;
}

.play {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, #f6d9a3, var(--saffron) 50%, #d99a55);
  color: #20150f;
  cursor: pointer;
  box-shadow: 0 12px 30px -10px rgba(235, 192, 126, 0.55);
  transition: transform 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.play:hover {
  transform: scale(1.05);
}

.play svg {
  width: 26px;
  height: 26px;
}

.play .i-play,
.practice.is-paused .play .i-pause {
  display: none;
}

.practice.is-paused .play .i-play {
  display: block;
}

#btn-sound .i-off,
#btn-sound[aria-pressed='true'] .i-on {
  display: none;
}

#btn-sound[aria-pressed='true'] .i-off {
  display: block;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1080px) {
  .principles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .nav-links {
    display: none;
  }
  .chapter {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .chapter:nth-child(even) .ch-visual {
    order: 0;
  }
  .ch-visual {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
    gap: 24px;
    align-items: center;
  }
  .ch-figure {
    margin: 0;
  }
  .lab {
    grid-template-columns: 1fr;
  }
  .lab-side {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .progress-grid,
  .safety-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 1rem;
  }
  .how-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .ch-visual {
    grid-template-columns: 1fr;
  }
  .ch-figure {
    width: min(78%, 280px);
    margin: 0 auto;
  }
  .benefits {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .stat {
    padding: 16px 14px;
  }
  .stat-l {
    font-size: 0.64rem;
    letter-spacing: 0.1em;
  }
  .principles {
    grid-template-columns: 1fr;
  }
  .fc-note {
    margin-left: 0;
    width: 100%;
  }
  .lab-control {
    grid-template-columns: 1fr auto;
  }
  .lab-control label {
    grid-column: 1 / -1;
  }
  .hero-inner {
    padding-top: calc(clamp(76px, 10vh, 110px) + env(safe-area-inset-top));
  }
  .hero-sub {
    margin-bottom: 28px;
  }
  .sun {
    top: 72%;
    width: 70vw;
  }
  .moon {
    right: 9%;
    top: 12%;
  }
  .reset-row {
    text-align: left;
  }
  .setup-card {
    padding: 20px 18px;
    border-radius: 24px;
  }
  .setup-pattern {
    font-size: 1.12rem;
    margin-bottom: 12px;
  }
  .setup-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 0;
  }
  .seg button {
    height: 36px;
  }
  .setup-calc {
    margin: 2px 0 12px;
    padding: 8px 10px;
    font-size: 0.8rem;
  }
  .toggles {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 16px;
  }
  .toggle {
    padding: 9px 10px;
    font-size: 0.82rem;
  }
  .pr-setup {
    place-items: start center;
    padding-top: 10px;
  }
}

@media (max-width: 380px) {
  .brand {
    font-size: 1.3rem;
  }
  .nav-cta {
    padding: 0 12px;
    font-size: 0.68rem;
  }
  .hero-cta .btn {
    width: 100%;
  }
  .toggles {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .orb {
    --size: min(56vh, 360px);
  }
  .hint {
    margin-top: 6px;
  }
  .pr-dunes {
    height: 22vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
  .sun-disc,
  .sun-glow,
  .star,
  .shooting,
  .scroll-cue span {
    animation: none !important;
  }
  .js .reveal {
    transform: none;
    transition: opacity 0.6s;
  }
}
