/* exhale · a breathing pacer you can feel */
:root {
  --bg: #ebe5e3;
  --surface: #e1dad7;
  --paper: #f6f2f0;
  --ink: #2b2622;
  --muted: #6a615d;
  --accent: #0f7d45;
  --accent-ink: #ffffff;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1.03rem + 0.25vw, 1.25rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 2.6vw, 3.75rem);
  --step-mark: clamp(6rem, 13.6vw, 16rem);

  --m: 24px;          /* outer margin, both sides, everywhere */
  --stage-w: 47vw;
  --pad: clamp(40px, 4.6vw, 72px);
  --gap: clamp(120px, 12vw, 200px);
  --ease: cubic-bezier(.22, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; overflow-x: clip; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; overflow-x: hidden; overflow-x: clip;
  background: var(--bg); color: var(--ink);
  font-family: "STIX Two Text", "Times New Roman", serif;
  font-size: var(--step-body); line-height: 1.45;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
img, video { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--paper); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: var(--m); top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 16px; }
.skip:focus { top: var(--m); }
section[id] { scroll-margin-top: 16px; }

h2 { font-size: var(--step-head); font-weight: 400; line-height: 1.04; letter-spacing: -0.026em; text-wrap: balance; }
h3 { font-size: var(--step-lead); font-weight: 600; line-height: 1.2; }

/* Buttons: square, one fill */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 26px; border: 0; border-radius: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-size: var(--step-body);
  transition: transform .18s var(--ease), background-color .2s;
}
.btn:hover { background: #0b6a3a; }
.btn:active { transform: scale(.97); }
.btn-text {
  background: none; border: 0; padding: 10px 4px; cursor: pointer; min-height: 44px;
  text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px;
  transition: color .2s, transform .18s var(--ease);
}
.btn-text:hover { color: var(--accent); }
.btn-text:active { transform: scale(.96); }
.link { text-underline-offset: .2em; transition: color .2s; }
.link:hover { color: var(--accent); }

/* Top bar: plain links over the reading column */
.bar { position: absolute; top: 0; right: 0; z-index: 4; padding: 28px var(--m) 0 0; }
.bar nav { display: flex; gap: 28px; font-size: var(--step-small); font-size: 15px; }
.bar a { text-decoration: none; padding: 6px 0; transition: color .2s; }
.bar a:hover, .bar a[aria-current="true"] { color: var(--accent); text-decoration: underline; text-underline-offset: .3em; }

/* The split */
.split { display: grid; grid-template-columns: var(--stage-w) minmax(0, 1fr); }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; padding: var(--m) 0 var(--m) var(--m); z-index: 2; }
.stage-frame { position: relative; height: 100%; overflow: hidden; background: #111; }
.stage-pic {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.4s ease; transform: scale(1.02);
}
.stage-pic.is-on { opacity: 1; }
.stage-pic[data-pic="patterns"], .stage-pic[data-pic="body"] { object-position: 50% 18%; filter: contrast(1.08); }
.tide {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 101%;
  background: var(--surface); transform-origin: 50% 100%; transform: scaleY(.22);
  will-change: transform;
}
.readout { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 clamp(20px, 2.4vw, 36px) clamp(18px, 2vw, 28px); }
.readout-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.readout-row + .readout-row { align-items: center; margin-top: 10px; }
.phase, .count { font-size: var(--step-head); line-height: 1; letter-spacing: -0.026em; white-space: nowrap; }
.count { font-variant-numeric: tabular-nums lining-nums; }
.meta { font-size: var(--step-small); font-size: 15px; color: var(--muted); }
.go-group { display: flex; align-items: center; gap: 14px; }
#go { min-width: 120px; }

/* Hero, in the reading column */
.read { min-width: 0; }
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 var(--m) 0 var(--pad); }
.hero-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 120px 0 88px; max-width: 34rem; }
.lede { font-size: var(--step-lead); line-height: 1.3; max-width: 31ch; text-wrap: pretty; }
.controls { margin-top: 40px; display: grid; gap: 20px; }
legend { font-size: 15px; color: var(--muted); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chips span, .chip-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  background: var(--surface); font-size: var(--step-body); border: 0; border-radius: 0; cursor: pointer;
  transition: background-color .2s, color .2s, transform .18s var(--ease);
}
.chips label:hover span, .chip-btn:hover { background: #d6cdc9; }
.chips label:active span, .chip-btn:active { transform: scale(.96); }
.chips input:checked + span { background: var(--ink); color: var(--paper); }
.chips input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.cue-note { margin-top: 10px; font-size: 15px; color: var(--muted); max-width: 36ch; }
.wordmark {
  position: relative; z-index: 3; margin: 0 0 0 -0.06em;
  font-weight: 400; line-height: .78; letter-spacing: -0.045em; white-space: nowrap;
  font-size: var(--step-mark); padding-bottom: 40px; transform-origin: 100% 100%;
  pointer-events: none; text-align: right;
}
.wordmark .mark { display: block; }

/* The pulses: what each signal feels like */
.feel { padding: var(--gap) var(--m) var(--gap) var(--pad); }
.feel-intro { margin-top: 32px; max-width: 34ch; font-size: var(--step-lead); line-height: 1.3; }
.code { margin-top: 72px; display: grid; gap: 48px; }
.code li { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 12px 40px; align-items: center; }
.pulses { display: flex; align-items: center; gap: 12px; height: 32px; }
.pulses i { display: block; height: 22px; width: max(calc(var(--w) * 1.7px), 22px); background: var(--ink); border-radius: 11px; transform-origin: 0 50%; }
.code-text { font-size: var(--step-lead); line-height: 1.3; max-width: 26ch; }
.code-text strong { font-weight: 600; }
.feel-btn { grid-column: 2; justify-self: start; margin-top: -6px; }
.code li.is-feeling .pulses i { animation: buzz .32s ease-in-out 3; }
@keyframes buzz { 50% { transform: translateX(3px); } }
.feel-foot { margin-top: 40px; max-width: 46ch; }

/* Six ways to breathe: one printed sheet on a dark field */
.patterns { background: var(--ink); padding: var(--gap) var(--m) var(--gap) var(--pad); }
.sheet {
  --scal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='9'%3E%3Ccircle cx='9' cy='0' r='9' fill='%232b2622'/%3E%3C/svg%3E");
  position: relative; max-width: 640px; background: var(--paper); padding: 72px clamp(24px, 4vw, 64px) 64px; text-align: center;
}
.sheet::before, .sheet::after { content: ""; position: absolute; left: 0; right: 0; height: 9px; background: var(--scal) repeat-x; background-size: 18px 9px; }
.sheet::before { top: 0; }
.sheet::after { bottom: 0; transform: scaleY(-1); }

.sheet-note { margin-top: 12px; font-size: 15px; color: var(--muted); }
.group { margin-top: 56px; }
.group h3 { font-size: var(--step-lead); margin-bottom: 18px; }
.group li + li { margin-top: 6px; }
.item {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 20px; width: 100%; max-width: 440px; margin: 0 auto;
  background: none; border: 0; padding: 12px 14px; text-align: left; cursor: pointer;
  transition: background-color .2s, transform .18s var(--ease);
}
.item:hover { background: var(--bg); }
.item:active { transform: scale(.985); }
.item[aria-pressed="true"], .item[aria-pressed="true"]:hover { background: var(--ink); color: var(--paper); }
.item[aria-pressed="true"] .item-desc { color: #d9d1cd; }
.item-name { font-size: var(--step-body); font-weight: 600; }
.item-count { font-size: var(--step-body); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.item-desc { grid-column: 1 / -1; font-size: var(--step-small); font-size: 15px; line-height: 1.4; color: var(--muted); }
.sheet-close { margin-top: 56px; font-size: 15px; line-height: 1.6; }

/* What one slow breath does: a printed slip */
.body { background: var(--surface); padding: var(--gap) var(--m) var(--gap) var(--pad); }
.body-text p { margin-top: 28px; max-width: 40ch; }
.slip {
  --zig: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='8'%3E%3Cpath d='M0 8 8 0 16 8Z' fill='%23e1dad7'/%3E%3C/svg%3E");
  position: relative; margin: 64px 0 0 auto; max-width: 500px; background: var(--paper); padding: 40px 32px 56px;
  font-size: var(--step-body); font-variant-numeric: tabular-nums lining-nums;
}
.slip::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--zig) repeat-x; background-size: 16px 8px; }
.slip h3 { font-size: var(--step-body); margin: 28px 0 10px; }
.slip h3:first-child { margin-top: 0; }
.slip li { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; }
.slip li > span:first-child { max-width: 30ch; }
.slip li i {
  flex: 1; min-width: 24px; height: 4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4'%3E%3Ccircle cx='2' cy='2' r='2' fill='%236a615d'/%3E%3C/svg%3E") repeat-x left center;
}
.slip .t { white-space: nowrap; }
.slip-total { display: flex; justify-content: space-between; align-items: center; margin: 32px -32px 0; min-height: 48px; padding: 0 32px; background: var(--ink); color: var(--paper); }

/* Questions: breaks the split, full width */
.faq { display: grid; grid-template-columns: 5fr 7fr; gap: 0 clamp(32px, 6vw, 96px); padding: 0 var(--m); position: relative; }
.faq-text { padding: var(--gap) 0 80px; }
.facts { margin-top: 32px; }
.facts li + li { margin-top: 6px; }
.qs { margin-top: 48px; }
details + details { margin-top: 12px; }
summary {
  position: relative; list-style: none; cursor: pointer; padding: 10px 40px 10px 0; min-height: 44px;
  transition: color .2s;
}
summary::-webkit-details-marker { display: none; }
summary:hover { color: var(--accent); }
summary::before, summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 10px; height: 2px; background: currentColor;
  transition: transform .25s var(--ease);
}
summary::before { transform: translate(-6px, 0) rotate(45deg); }
summary::after { transform: translate(0, 0) rotate(-45deg); }
details[open] summary::before { transform: translate(-6px, 0) rotate(-45deg); }
details[open] summary::after { transform: translate(0, 0) rotate(45deg); }
details p { max-width: 52ch; padding: 4px 0 12px; }
.faq-actions { margin-top: 48px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.faq-pics { position: relative; padding-bottom: 80px; }
.faq-tall { width: 100%; aspect-ratio: 3 / 4; max-height: 980px; overflow: hidden; background: #111; }
.faq-tall video { width: 100%; height: 100%; object-fit: cover; object-position: 40% 50%; transform: scale(1.02); }
.faq-square { position: absolute; width: 34%; aspect-ratio: 1; left: -40px; bottom: 40px; overflow: hidden; background: #111; }
.faq-square img { width: 100%; height: 100%; object-fit: cover; }

/* Footer: one quiet line */
.foot { padding: 30vh var(--m) 30px; }
.foot-line { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 24px; font-size: 15px; }
.foot-line p { color: var(--muted); }
.foot-line nav { display: flex; gap: 24px; }
.foot-line nav a { text-decoration: none; }
.foot-line nav a:hover { color: var(--accent); text-decoration: underline; }
.foot-right { text-align: right; }
.credits { margin-top: 18px; font-size: 15px; line-height: 1.5; color: var(--muted); max-width: 70ch; }

/* Dark screen for eyes-closed sessions */
.dark-screen {
  position: fixed; inset: 0; z-index: 60; background: #000; color: #3a3532;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; cursor: pointer;
}
.dark-screen[hidden] { display: none; }
.dark-phase { font-size: var(--step-lead); }
.dark-hint { font-size: 13px; color: #2a2624; }
.haptic { position: fixed; left: -9999px; top: 0; opacity: 0; pointer-events: none; }


/* ——— Phones and narrow screens ——— */
@media (max-width: 860px) {
  :root { --m: 12px; --pad: 20px; --gap: 104px; --step-mark: 25vw; }
  .split { display: block; }
  .stage { position: relative; height: 58svh; padding: var(--m) var(--m) 0; }
  body.is-running .stage { position: sticky; top: 0; height: 46svh; padding-bottom: 6px; background: var(--bg); }
  .bar { padding: 24px 24px 0 0; }
  .bar .hide-s { display: none; }
  .bar nav { gap: 20px; }
  .hero { min-height: 0; padding: 0 20px; }
  .hero-body { order: 2; padding: 8px 0 72px; }
  .wordmark { order: 1; margin: 20px 0 0 -0.05em; padding-bottom: 0; line-height: .9; transform-origin: 0 0; }
  .lede { font-size: 20px; }
  .controls { margin-top: 28px; }
  .feel, .patterns, .body { padding-left: 20px; padding-right: 20px; }
  .code li { grid-template-columns: 1fr; gap: 12px; }
  .feel-btn { grid-column: 1; }
  .wordmark { text-align: left; }
  .code-text { font-size: 20px; }
  .patterns { padding-left: 10px; padding-right: 10px; }
  .sheet { padding: 56px 18px 48px; margin: 0 auto; }
  .item { padding: 12px 8px; }
  .slip { margin-top: 48px; padding: 32px 20px 48px; font-size: 17px; }
  .slip-total { margin: 28px -20px 0; padding: 0 20px; }
  .faq { display: flex; flex-direction: column; padding: 0 20px; }
  .faq-pics { order: -1; margin: var(--gap) 0 0; padding-bottom: 0; }
  .faq-tall { aspect-ratio: 4 / 5; }
  .faq-square { width: 38%; left: auto; right: -8px; bottom: -32px; }
  .faq-text { padding-top: 72px; }
  .faq-actions .btn { width: 100%; }
  .foot { padding: 20vh 20px 24px; }
  .foot-line { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
  .foot-right { text-align: left; }
}
@media (min-width: 600px) and (max-width: 860px) {
  .code li { grid-template-columns: 12rem minmax(0, 1fr); gap: 12px 32px; }
  .feel-btn { grid-column: 2; }
  .slip { margin-right: auto; }
}
@media (hover: none) {
  .item:hover { background: none; }
  .chips label:hover span, .chip-btn:hover { background: var(--surface); }
}
