/* Stiller Water — shared brand styles (palette, breath circle, common UI). */

:root {
  --bg: #fbf6ee;
  --bg-deep: #f3ead9;
  --text: #2a2520;
  --muted: #7a6f63;
  --accent: #8a6a4a;
  --accent-soft: #d4c1a6;
  --line: #e6dcc9;
  --t-color: #5d7a5e;
  --l-color: #a8534a;
  --t-bg: #e8eee5;
  --l-bg: #f3e3df;
  --star: #d4a73a;
  --white: #ffffff;
  --breath-glow: rgba(212, 193, 166, 0.55);
  --breath-core: #efe2c8;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 17px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- Hero / breath stage ---------- */
.hero {
  position: relative;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at center, var(--bg) 0%, var(--bg-deep) 100%);
}
.breath-stage {
  position: relative;
  width: min(520px, 82vw);
  height: min(520px, 82vw);
  display: flex;
  align-items: center;
  justify-content: center;
  --stage-size: min(520px, 82vw);
  --orbit-radius: calc(var(--stage-size) / 2 + 28px);
  --label-radius: calc(var(--stage-size) / 2 + 50px);
}
.breath-circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--breath-core) 0%, var(--breath-glow) 60%, rgba(212,193,166,0) 78%);
  transform: scale(0.55);
  animation: breathe var(--cycle-duration, 11s) ease-in-out infinite;
}
.breath-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--accent-soft);
  transform: scale(0.55);
  animation: breathe var(--cycle-duration, 11s) ease-in-out infinite;
  opacity: 0.5;
}
@keyframes breathe {
  0%   { transform: scale(0.55); }
  22%  { transform: scale(1.0);  }
  46%  { transform: scale(1.0);  }
  76%  { transform: scale(0.55); }
  100% { transform: scale(0.55); }
}
.breath-text-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
  padding: 0 14%;
}
.breath-text {
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 22px;
  font-style: italic;
  color: var(--text);
  line-height: 1.45;
  text-align: center;
  max-width: 280px;
  opacity: 1;
  transition: opacity 700ms ease;
}
.breath-text.fading { opacity: 0; }

/* ---------- Phase timer (orbit around breathing circle) ---------- */
.phase-track {
  position: absolute;
  width: calc(var(--orbit-radius) * 2);
  height: calc(var(--orbit-radius) * 2);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.phase-track circle {
  fill: none;
  stroke: var(--accent-soft);
  stroke-width: 0.4;
  stroke-dasharray: 0.5 2;
  opacity: 0.55;
}
.phase-orbit {
  position: absolute;
  width: calc(var(--orbit-radius) * 2);
  height: calc(var(--orbit-radius) * 2);
  top: 50%;
  left: 50%;
  margin: calc(var(--orbit-radius) * -1) 0 0 calc(var(--orbit-radius) * -1);
  animation: orbit var(--cycle-duration, 11s) linear infinite;
  pointer-events: none;
}
.phase-dot {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(138, 106, 74, 0.45);
}
@keyframes orbit {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.phase-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(
    calc(sin(var(--angle)) * var(--label-radius) - 50%),
    calc(cos(var(--angle)) * var(--label-radius) * -1 - 50%)
  );
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.4;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 500ms ease, color 500ms ease;
}
.phase-label.active {
  opacity: 1;
  color: var(--accent);
}
@media (max-width: 480px) {
  .breath-stage {
    --orbit-radius: calc(var(--stage-size) / 2 + 18px);
    --label-radius: calc(var(--stage-size) / 2 + 36px);
  }
  .phase-label { font-size: 9px; letter-spacing: 0.18em; }
  .phase-dot { width: 8px; height: 8px; top: -4px; margin-left: -4px; }
}

/* ---------- Speed + sound controls ---------- */
.speed-control {
  position: absolute;
  top: 22px;
  right: 26px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: rgba(251, 246, 238, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 4px 6px;
}
.speed-control .label {
  padding: 0 8px 0 6px;
  text-transform: lowercase;
  opacity: 0.7;
}
.sound-toggle {
  position: absolute;
  top: 22px;
  left: 26px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 246, 238, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: none;
  border-radius: 999px;
  padding: 8px 9px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.sound-toggle:hover { color: var(--text); }
.sound-toggle.active { color: var(--accent); }
.sound-toggle svg { width: 16px; height: 16px; display: block; }
.sound-toggle .icon-on { display: none; }
.sound-toggle.active .icon-on { display: block; }
.sound-toggle.active .icon-off { display: none; }
@media (max-width: 480px) {
  .sound-toggle { top: 14px; left: 16px; padding: 7px 8px; }
  .sound-toggle svg { width: 15px; height: 15px; }
  .speed-control { top: 14px; right: 16px; }
}
.speed-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.speed-btn:hover { color: var(--text); }
.speed-btn.active {
  background: var(--accent-soft);
  color: var(--text);
}

/* ---------- Brand mark ---------- */
.brand-mark {
  position: absolute;
  top: 6vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.brand-mark .ripple {
  width: 22px;
  height: 22px;
  color: var(--accent);
  opacity: 0.85;
}
.brand-mark .brand-name {
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text);
  margin-top: 2px;
  line-height: 1;
}
.brand-mark .brand-tagline {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.9;
  line-height: 1;
}
@media (max-width: 480px) {
  .brand-mark { top: 4.5vh; gap: 5px; }
  .brand-mark .ripple { width: 20px; height: 20px; }
  .brand-mark .brand-name { font-size: 14px; }
  .brand-mark .brand-tagline { font-size: 10px; letter-spacing: 0.24em; }
}

/* ---------- Continue + scroll hints ---------- */
.continue-cta {
  position: absolute;
  bottom: 18vh;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.4s ease, transform 1.4s ease;
  transform: translate(-50%, 12px);
}
.continue-cta.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}
.continue-cta button {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--white);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(138, 106, 74, 0.18);
  transition: opacity 0.15s, transform 0.15s;
}
.continue-cta button:hover { opacity: 0.9; transform: translateY(-1px); }

.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: system-ui, sans-serif;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.7;
  animation: bob 2.4s ease-in-out infinite;
  cursor: pointer;
  user-select: none;
}
.scroll-hint:hover { opacity: 1; color: var(--accent); }
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 6px); }
}
.scroll-hint .arrow { display: block; margin-top: 4px; font-size: 14px; }

/* ---------- Info section ---------- */
.info {
  max-width: 620px;
  margin: 0 auto;
  padding: 90px 28px 60px;
}
.info h1 {
  font-size: 32px;
  font-weight: 500;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.info .lede {
  color: var(--muted);
  font-style: italic;
  font-size: 19px;
  margin: 0 0 28px;
}
.info p { margin: 16px 0; }
.info .pull {
  border-left: 2px solid var(--accent-soft);
  padding: 4px 0 4px 16px;
  margin: 26px 0;
  font-style: italic;
  color: var(--text);
}
.paper-note {
  background: var(--bg-deep);
  border-radius: 10px;
  padding: 18px 22px;
  margin: 28px 0;
  font-family: system-ui, sans-serif;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.65;
}
.paper-note strong { color: var(--text); font-weight: 500; }
.start-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 36px;
}
.small-foot {
  margin-top: 70px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-family: system-ui, sans-serif;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Exercise container ---------- */
.exercise {
  max-width: 640px;
  margin: 0 auto;
  padding: 56px 28px 100px;
  display: none;
}
.exercise.active { display: block; }

h2 {
  font-size: 24px;
  font-weight: 500;
  margin: 0 0 14px;
  letter-spacing: -0.005em;
}
.step-label {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 6px;
}
.hint {
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
  margin: 6px 0 22px;
}
.progress {
  display: flex;
  gap: 6px;
  margin-bottom: 28px;
}
.progress-dot {
  height: 4px;
  flex: 1;
  background: var(--line);
  border-radius: 2px;
}
.progress-dot.done, .progress-dot.current { background: var(--accent); }
.breadcrumb {
  font-family: system-ui, sans-serif;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
}
.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px dotted var(--accent-soft);
}
.breadcrumb a:hover { color: var(--accent); }

/* ---------- Buttons ---------- */
.button-row {
  display: flex;
  gap: 10px;
  margin-top: 32px;
  flex-wrap: wrap;
  align-items: center;
}
button.primary, .btn-primary {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--white);
  cursor: pointer;
  transition: opacity 0.15s;
}
button.primary:hover, .btn-primary:hover { opacity: 0.88; }
button.primary:disabled { opacity: 0.4; cursor: not-allowed; }
button.secondary {
  font-family: system-ui, sans-serif;
  font-size: 15px;
  padding: 12px 22px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
}
button.secondary:hover { background: rgba(138, 106, 74, 0.08); }
button.ghost, a.ghost {
  font-family: system-ui, sans-serif;
  font-size: 14px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 10px 8px;
  text-decoration: none;
}
button.ghost:hover, a.ghost:hover { color: var(--text); }

/* ---------- Pacing overlay ---------- */
.pace-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 37, 32, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  animation: pace-in 0.35s ease-out;
}
.pace-overlay.show { display: flex; }
@keyframes pace-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.pace-card {
  background: var(--bg);
  border-radius: 14px;
  padding: 36px 32px 28px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}
.pace-breath {
  width: 70px;
  height: 70px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--breath-core), var(--breath-glow));
  animation: breathe 11s ease-in-out infinite;
}
.pace-card h3 {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 12px;
  color: var(--text);
}
.pace-card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 10px 0;
  font-family: system-ui, sans-serif;
}
.pace-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}
.pace-actions button { width: 100%; }

/* ---------- Shared closing card ---------- */
.closing-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px 28px 22px;
  margin: 22px 0;
}
.closing-card h3 {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 14px;
  color: var(--text);
}
.closing-card p {
  margin: 12px 0;
  color: var(--text);
}
.closing-card .integrate {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-family: system-ui, sans-serif;
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.7;
}
.closing-card .integrate em { font-style: italic; color: var(--text); }

@media (max-width: 480px) {
  .info { padding: 70px 22px 50px; }
  .info h1 { font-size: 26px; }
  .exercise { padding: 40px 22px 80px; }
}

/* ===================================================================
   SHARED CHROME (injected by chrome.js on every page)
   - Top header: hamburger | brand
   - Nav drawer (slide-in)
   The .breath-overlay / .settings-card styles further below are NOT injected
   globally any more — they are reused by breath.html's standalone breathing
   stage. They live here because they're shared brand UI.
   =================================================================== */

body.no-scroll { overflow: hidden; }

/* ---------- Site header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  background: rgba(251, 246, 238, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.hamburger {
  width: 38px;
  height: 38px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s, background 0.15s;
}
.hamburger:hover { border-color: var(--accent); background: var(--bg-deep); }
.hamburger span {
  width: 18px;
  height: 1.6px;
  background: var(--text);
  border-radius: 1px;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  margin-right: auto;
}
.site-brand .ripple { width: 22px; height: 22px; color: var(--accent); opacity: 0.85; }
.site-brand .brand-name {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.breath-launcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--accent);
  color: var(--white);
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(138, 106, 74, 0.18);
}
.breath-launcher:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(138, 106, 74, 0.24); }
.breath-launcher svg { width: 18px; height: 18px; display: block; }

@media (max-width: 540px) {
  .site-brand .brand-name { display: none; }
  .site-header { padding: 10px 14px; gap: 10px; }
}

/* ---------- Nav drawer ---------- */
.site-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(43, 37, 32, 0.45);
  opacity: 0;
  pointer-events: none;
  z-index: 40;
  transition: opacity 0.3s ease;
}
.site-nav-backdrop.show { opacity: 1; pointer-events: auto; }
.site-nav {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 320px;
  max-width: 86vw;
  background: var(--bg);
  border-right: 1px solid var(--line);
  z-index: 41;
  transform: translateX(-100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 22px 22px 22px;
  box-shadow: 0 0 50px rgba(43, 37, 32, 0.1);
}
.site-nav.open { transform: translateX(0); }
.site-nav-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
}
.site-nav-close:hover { color: var(--accent); background: var(--bg-deep); }
.site-nav-list { list-style: none; margin: 50px 0 0; padding: 0; }
.site-nav-list li { margin: 2px 0; }
.site-nav-list a {
  display: block;
  padding: 10px 12px;
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.site-nav-list a:hover { background: var(--bg-deep); color: var(--accent); }
.site-nav-list a.current { color: var(--accent); background: var(--bg-deep); }
.site-nav-foot {
  margin-top: auto;
  font-family: system-ui, sans-serif;
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* ===================================================================
   BREATH OVERLAY
   =================================================================== */
.breath-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: radial-gradient(ellipse at center, var(--bg) 0%, var(--bg-deep) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.breath-overlay.open { opacity: 1; pointer-events: auto; }
.overlay-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  background: rgba(251, 246, 238, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.15s, border-color 0.15s, transform 0.2s;
}
.overlay-close:hover { color: var(--accent); border-color: var(--accent); transform: rotate(90deg); }
.overlay-close svg { width: 18px; height: 18px; display: block; }

.breath-overlay .breath-stage {
  width: min(520px, 78vmin);
  height: min(520px, 78vmin);
  --stage-size: min(520px, 78vmin);
  --orbit-radius: calc(var(--stage-size) / 2 + 28px);
  --label-radius: calc(var(--stage-size) / 2 + 50px);
  margin-bottom: 56px;
  cursor: pointer;
}

/* ---------- Footer in the overlay ---------- */
.breath-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  max-width: 520px;
}
.breath-actions { display: flex; align-items: center; gap: 12px; }
.gear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  width: 42px; height: 42px;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.gear-btn:hover, .gear-btn[aria-expanded="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-deep);
}
.gear-btn svg { width: 18px; height: 18px; display: block; }
.continue-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  letter-spacing: 0.02em;
  padding: 11px 22px;
  border-radius: 999px;
  background: var(--white);
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.continue-btn:hover {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.continue-btn svg { width: 16px; height: 16px; }
.breath-hint {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  margin: 0;
  line-height: 1.55;
  max-width: 420px;
}

/* ---------- Settings card ---------- */
.settings-card {
  position: absolute;
  bottom: 170px;
  left: 50%;
  z-index: 8;
  width: 360px;
  max-width: calc(100vw - 40px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 22px 18px;
  box-shadow: 0 22px 50px rgba(43, 37, 32, 0.16);
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.settings-card.open { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.settings-card::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  margin-left: -32px;
  width: 14px;
  height: 14px;
  background: var(--white);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}
.settings-title {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 16px;
  color: var(--text);
}
.setting { margin: 14px 0; }
.setting-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: system-ui, sans-serif;
  font-size: 13.5px;
  color: var(--text);
  margin-bottom: 6px;
}
.setting-readout { color: var(--muted); font-style: italic; font-size: 12.5px; }
.setting-scale {
  display: flex;
  justify-content: space-between;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 4px;
  text-transform: lowercase;
}
.speed-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid var(--white);
  box-shadow: 0 0 0 1px var(--accent-soft);
}
.speed-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid var(--white);
  box-shadow: 0 0 0 1px var(--accent-soft);
}
.setting-toggle { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  font-family: system-ui, sans-serif;
}
.setting-row strong { font-weight: 500; font-size: 14px; color: var(--text); display: block; }
.setting-row small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track {
  position: absolute;
  inset: 0;
  background: var(--line);
  border-radius: 999px;
  transition: background 0.18s ease;
}
.switch-track::before {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: transform 0.18s ease;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::before { transform: translateX(16px); }

/* ===================================================================
   PAGE LAYOUTS
   =================================================================== */

/* ----- Breath page ----- */
.breath-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 28px 80px;
}
.breath-page h1 {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 500;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.breath-page .lede {
  font-size: 19px;
  font-style: italic;
  color: var(--muted);
  margin: 0 0 30px;
  line-height: 1.55;
}
.breath-page h2 {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 36px 0 8px;
}
.breath-page p { margin: 12px 0; font-size: 17px; line-height: 1.7; }
.breath-page .pull {
  border-left: 2px solid var(--accent-soft);
  padding: 6px 0 6px 18px;
  margin: 30px 0;
  font-style: italic;
  color: var(--text);
  font-size: 17px;
}
.breath-cta {
  margin: 40px 0 20px;
  padding: 28px 24px;
  border: 1px solid var(--accent-soft);
  border-radius: 14px;
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.breath-cta h3 {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  margin: 0;
  color: var(--text);
}
.breath-cta p { margin: 0; font-size: 15px; color: var(--muted); }
.breath-cta .breath-launcher { padding: 14px 28px; font-size: 16px; }

/* ----- Exercises page ----- */
.exercises-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 28px 80px;
}
.exercises-header { text-align: center; margin-bottom: 36px; }
.exercises-header h1 {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 500;
  margin: 0 0 10px;
  letter-spacing: -0.005em;
  color: var(--text);
}
.exercises-lede {
  font-style: italic;
  color: var(--muted);
  margin: 0;
  font-size: 17px;
}
.exercises-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.exercise-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 24px 24px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.18s, box-shadow 0.22s;
}
.exercise-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 14px 30px rgba(138, 106, 74, 0.10); }
.exercise-icon { width: 56px; height: 56px; color: var(--accent); margin-bottom: 16px; opacity: 0.85; }
.exercise-icon svg { width: 100%; height: 100%; }
.exercise-card h2 {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 6px;
  color: var(--text);
  letter-spacing: -0.005em;
}
.exercise-when { font-family: system-ui, sans-serif; font-size: 13px; color: var(--muted); margin: 0 0 10px; line-height: 1.5; }
.exercise-body { font-size: 15.5px; line-height: 1.6; margin: 0 0 16px; color: var(--text); flex-grow: 1; }
.exercise-meta {
  display: flex;
  gap: 14px;
  font-family: system-ui, sans-serif;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.exercise-meta span::before { content: "·"; margin-right: 8px; color: var(--accent-soft); }
.exercise-meta span:first-child::before { content: ""; margin-right: 0; }
.exercises-foot {
  max-width: 640px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-family: system-ui, sans-serif;
  font-size: 13.5px;
  font-style: italic;
  color: var(--muted);
  line-height: 1.6;
}

/* ===================================================================
   Responsive
   =================================================================== */
@media (max-width: 900px) {
  .exercises-grid { gap: 14px; }
}

@media (max-width: 560px) {
  .breath-overlay { padding: 28px 18px 24px; }
  .breath-overlay .breath-stage {
    width: min(360px, 82vmin);
    height: min(360px, 82vmin);
    --stage-size: min(360px, 82vmin);
    margin-bottom: 48px;
  }
  .settings-card { bottom: 150px; width: calc(100vw - 28px); }
  .overlay-close { top: 12px; right: 14px; width: 40px; height: 40px; }
  .breath-page h1 { font-size: 26px; }
}

/* Short / landscape viewports: anchor the gear panel lower and let it scroll
   internally so every control stays reachable when height is tight. */
@media (max-height: 560px) {
  .settings-card {
    bottom: 76px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .breath-overlay, .site-nav, .site-nav-backdrop, .exercise-card,
  .continue-btn, .breath-launcher, .settings-card { transition: none !important; }
  /* Stop the decorative orbiting phase dot; keep the breath pulse — the pace
     is the exercise. */
  .phase-orbit { animation: none !important; }
}

