/* ==========================================================================
   Yoggia - feuille de style unique, partagée par toutes les pages
   Mobile first. Aucune dépendance, aucun build.
   ========================================================================== */

:root {
  /* Palette : minéral, calme, un peu végétal. Laiton pour les moments forts. */
  --pine-900: #10201b;
  --pine-700: #1e4034;
  --pine-500: #2f6352;
  --sage-100: #e7ebe4;
  --sage-200: #d6ddd1;
  --linen: #f4f6f1;
  --ink: #16211c;
  --ink-soft: #4d5d55;
  --brass: #c39a3e;
  --brass-soft: #f0e2bf;
  --plum: #7c6a9c;
  --coral: #c2674f;

  --bg: var(--linen);
  --surface: #ffffff;
  --surface-2: var(--sage-100);
  --text: var(--ink);
  --text-soft: var(--ink-soft);
  --line: rgba(22, 33, 28, 0.12);
  --accent: var(--pine-700);
  --accent-text: #ffffff;

  --r-s: 8px;
  --r-m: 14px;
  --r-l: 24px;
  --r-full: 999px;

  --shadow-soft: 0 1px 2px rgba(16, 32, 27, .06), 0 8px 24px rgba(16, 32, 27, .06);

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1080px;
  --gap: 16px;
  --tabbar: 66px;
}

[data-theme="dark"] {
  --bg: #0d1512;
  --surface: #14201b;
  --surface-2: #1b2b24;
  --text: #e9efe9;
  --text-soft: #a3b3aa;
  --line: rgba(233, 239, 233, .14);
  --accent: #6fbfa0;
  --accent-text: #0d1512;
  --brass-soft: #3a3219;
  --shadow-soft: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px));
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 7vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 4.6vw, 2rem); }
h3 { font-size: 1.12rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; max-width: 68ch; }
a { color: inherit; }

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

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

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 18px; }
.stack > * + * { margin-top: var(--gap); }
.muted { color: var(--text-soft); }
.small { font-size: .875rem; }
.center { text-align: center; }
.hide { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Barre du haut ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .inner {
  max-width: var(--wrap); margin: 0 auto; padding: 10px 18px;
  display: flex; align-items: center; gap: 14px;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  text-decoration: none; letter-spacing: -0.02em;
}
.brand .mark {
  width: 26px; height: 26px; border-radius: 9px;
  background: var(--pine-700); color: #fff;
  display: grid; place-items: center; font-size: 14px;
}
[data-theme="dark"] .brand .mark { background: var(--accent); color: var(--accent-text); }
.topnav { display: none; margin-left: auto; gap: 4px; }
.topnav a {
  text-decoration: none; padding: 8px 12px; border-radius: var(--r-full);
  font-size: .94rem; color: var(--text-soft);
}
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.topnav a[aria-current="page"] { background: var(--pine-700); color: #fff; }
[data-theme="dark"] .topnav a[aria-current="page"] { background: var(--accent); color: var(--accent-text); }
.topbar-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.topnav + .topbar-tools { margin-left: 0; }

.icon-btn {
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text); width: 38px; height: 38px; border-radius: var(--r-full);
  display: grid; place-items: center; cursor: pointer; font-size: .82rem; font-weight: 600;
}
.icon-btn:hover { background: var(--surface-2); }

/* ---------- Barre d'onglets mobile ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar a {
  text-decoration: none; color: var(--text-soft);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 9px 2px 7px; font-size: .68rem; min-height: var(--tabbar);
}
.tabbar a svg { width: 21px; height: 21px; }
.tabbar a[aria-current="page"] { color: var(--accent); font-weight: 600; }
[data-theme="dark"] .tabbar a[aria-current="page"] { color: var(--accent); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 13px 22px; border-radius: var(--r-full);
  border: 1px solid transparent; background: var(--pine-700); color: #fff;
  text-decoration: none; transition: transform .12s ease, background .15s ease;
}
[data-theme="dark"] .btn { background: var(--accent); color: var(--accent-text); }
.btn:active { transform: scale(.98); }
.btn:hover { background: var(--pine-500); }
[data-theme="dark"] .btn:hover { background: #8fd3b8; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.brass { background: var(--brass); color: #20180a; }
.btn.brass:hover { background: #d4ab4c; }
.btn.block { width: 100%; }
.btn.small { padding: 9px 16px; font-size: .9rem; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- Cartes ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-l); padding: 18px;
}
.card.flat { box-shadow: none; }
.card.raised { box-shadow: var(--shadow-soft); border-color: transparent; }

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: 1fr; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* ---------- Accueil ---------- */
.hero { padding: 26px 0 8px; }
.hero-figure {
  background: linear-gradient(170deg, var(--pine-900), var(--pine-700) 70%);
  border-radius: var(--r-l);
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.hero-figure svg { width: 100%; height: 230px; }
.hero-figure .caption {
  position: absolute; left: 18px; bottom: 14px; color: #dfe9e2;
  font-size: .82rem; letter-spacing: .01em;
}
.hero-lede { font-size: 1.06rem; color: var(--text-soft); }

.coach-box {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-l); padding: 14px;
}
.coach-box label { font-weight: 600; display: block; margin-bottom: 8px; }
.coach-row { display: flex; gap: 8px; }
.coach-row input {
  flex: 1; min-width: 0; font: inherit; padding: 12px 14px;
  border-radius: var(--r-full); border: 1px solid var(--line);
  background: var(--bg); color: var(--text);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text); border-radius: var(--r-full);
  padding: 8px 14px; font: inherit; font-size: .88rem; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"], .chip.on {
  background: var(--pine-700); color: #fff; border-color: transparent;
}
[data-theme="dark"] .chip[aria-pressed="true"], [data-theme="dark"] .chip.on {
  background: var(--accent); color: var(--accent-text);
}

/* ---------- Vignette posture ---------- */
.pose-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-m); padding: 10px; text-decoration: none;
  display: block; color: inherit;
}
.pose-card:hover { border-color: var(--accent); }
.pose-card .fig {
  background: var(--surface-2); border-radius: var(--r-s);
  aspect-ratio: 1 / 1; display: grid; place-items: center; margin-bottom: 8px;
}
.pose-card .fig svg { width: 100%; height: 100%; }
.pose-card h3 { font-size: .98rem; margin: 0 0 2px; }
.pose-card .meta { font-size: .76rem; color: var(--text-soft); }

.level-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-right: 5px; vertical-align: middle;
}
.level-2 .level-dot { background: var(--brass); }
.level-3 .level-dot { background: var(--coral); }

/* ---------- Séance ---------- */
.session-stage {
  display: grid; gap: 12px; grid-template-columns: 1fr;
}
.stage-panel {
  background: var(--pine-900); border-radius: var(--r-l);
  position: relative; overflow: hidden; color: #eef3ef;
  aspect-ratio: 3 / 4;
}
.stage-panel.cam { aspect-ratio: 3 / 4; background: #0b1310; }
.stage-panel svg.ref { width: 100%; height: 100%; }
.stage-panel video, .stage-panel canvas.overlay {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scaleX(-1);
}
.stage-panel video { z-index: 1; }
.stage-panel canvas.overlay { z-index: 2; }
.stage-badge {
  position: absolute; z-index: 3; top: 10px; left: 10px;
  background: rgba(10,18,15,.62); color: #eaf2ec; backdrop-filter: blur(6px);
  border-radius: var(--r-full); padding: 5px 12px; font-size: .8rem; font-weight: 600;
}
.stage-badge.right { left: auto; right: 10px; }
.cam-hint {
  position: absolute; z-index: 3; left: 10px; right: 10px; bottom: 10px;
  background: rgba(10,18,15,.72); color: #fff; border-radius: var(--r-m);
  padding: 9px 12px; font-size: .88rem; text-align: center;
}
.cam-off {
  position: absolute; inset: 0; z-index: 4; display: grid; place-items: center;
  text-align: center; padding: 20px; gap: 10px; color: #cfe0d6;
}

.timer-ring { display: grid; place-items: center; }
.timer-ring svg { width: 116px; height: 116px; }
.timer-ring .t {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 700;
}
.score-big {
  font-family: var(--font-display); font-size: 2.6rem; line-height: 1;
  font-weight: 700; color: var(--accent);
}
.session-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.session-controls .btn { flex: 1; min-width: 120px; }

.queue { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.queue .q {
  flex: 0 0 auto; width: 74px; text-align: center; font-size: .72rem;
  color: var(--text-soft); opacity: .55;
}
.queue .q.now { opacity: 1; color: var(--text); font-weight: 600; }
.queue .q.done { opacity: .3; }
.queue .q .fig { background: var(--surface-2); border-radius: var(--r-s); aspect-ratio: 1; }

/* ---------- Respiration ---------- */
.breath-stage {
  display: grid; place-items: center; min-height: 320px;
  background: radial-gradient(circle at 50% 45%, var(--surface-2), var(--bg) 70%);
  border-radius: var(--r-l); position: relative;
}
.breath-circle {
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--pine-500), var(--pine-900));
  transition: transform .25s linear;
  display: grid; place-items: center; color: #eaf2ec; font-weight: 600;
}
[data-theme="dark"] .breath-circle { background: radial-gradient(circle at 35% 30%, #6fbfa0, #1b4a3a); color: #06120d; }
.breath-word { position: absolute; bottom: 22px; font-size: 1.05rem; color: var(--text-soft); }

/* ---------- Progression ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-m); padding: 14px;
}
.stat .n { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; line-height: 1; }
.stat .l { font-size: .8rem; color: var(--text-soft); margin-top: 4px; }

.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; max-width: 320px; }
.heat i {
  aspect-ratio: 1; border-radius: 5px; background: var(--surface-2); display: block;
}
.heat i.l1 { background: color-mix(in srgb, var(--pine-700) 30%, var(--surface-2)); }
.heat i.l2 { background: color-mix(in srgb, var(--pine-700) 60%, var(--surface-2)); }
.heat i.l3 { background: var(--pine-700); }
[data-theme="dark"] .heat i.l3 { background: var(--accent); }

.badge {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface);
}
.badge .ic {
  width: 38px; height: 38px; border-radius: var(--r-full); display: grid; place-items: center;
  background: var(--surface-2); font-size: 1.1rem;
}
.badge.got .ic { background: var(--brass-soft); }
.badge.locked { opacity: .5; }

/* ---------- Divers ---------- */
.bodymap { display: grid; place-items: center; }
.bodymap svg { width: 190px; height: auto; }
.bodymap .zone { fill: var(--surface-2); stroke: var(--line); cursor: pointer; }
.bodymap .zone:hover, .bodymap .zone.on { fill: var(--pine-500); }

.seg {
  display: inline-flex; background: var(--surface-2); border-radius: var(--r-full); padding: 3px;
}
.seg button {
  border: 0; background: transparent; font: inherit; font-size: .88rem;
  padding: 7px 14px; border-radius: var(--r-full); cursor: pointer; color: var(--text-soft);
}
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-soft); }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
select, input[type="text"], input[type="number"], textarea {
  font: inherit; width: 100%; padding: 11px 13px; border-radius: var(--r-m);
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
input[type="range"] { width: 100%; accent-color: var(--pine-700); }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.list-plain li:last-child { border-bottom: 0; }

.tick { color: var(--pine-500); }
.warn { color: var(--coral); }

.day-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.day-row .n {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: var(--r-full);
  background: var(--surface-2); display: grid; place-items: center;
  font-weight: 700; font-size: .9rem;
}
.day-row.done .n { background: var(--pine-700); color: #fff; }
[data-theme="dark"] .day-row.done .n { background: var(--accent); color: var(--accent-text); }

footer.site {
  margin-top: 42px; padding: 26px 0 34px; border-top: 1px solid var(--line);
  color: var(--text-soft); font-size: .86rem;
}
footer.site a { color: var(--text-soft); }

.notice {
  background: var(--brass-soft); color: #4a3a12; border-radius: var(--r-m);
  padding: 12px 14px; font-size: .9rem;
}
[data-theme="dark"] .notice { color: var(--brass-soft); background: #2c2512; }

/* ---------- Écrans larges ---------- */
@media (min-width: 720px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .topnav { display: flex; }
  .grid.two { grid-template-columns: 1fr 1fr; }
  .session-stage { grid-template-columns: 1fr 1fr; align-items: start; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .hero { padding: 44px 0 16px; }
  .hero-figure svg { height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
