@import url("vendor/fonts.css");

/* Styled after calm/meditation apps (Calm, Headspace, Balance, Reveri, "I am"):
   picture-led rounded tiles, a bottom tab bar, a full-screen player.
   Each practice type has its own scene colors, set in app.js (SCENES). */
:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --ink: #1d2230;
  --ink-2: #5d6272;
  --ink-3: #9a9eab;
  --line: #e7e2d9;
  --accent: #5b5bd6;
  --good: #3f9d6b;
  --warn: #c98a1b;
  --bad: #c4573f;
  --shadow: 0 6px 20px rgba(29, 34, 48, .08);
  --sans: "Figtree", -apple-system, system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --r: 20px;
  --pad: 20px;
  --tabs: 64px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e1324; --card: #19203a; --ink: #eef0f7; --ink-2: #aab0c4; --ink-3: #6e7591;
  --line: #262e4c; --accent: #9d9dff; --shadow: none; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0e1324; --card: #19203a; --ink: #eef0f7; --ink-2: #aab0c4; --ink-3: #6e7591;
    --line: #262e4c; --accent: #9d9dff; --shadow: none; color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.45 var(--sans); min-height: 100dvh;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

main { max-width: 640px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 18px) var(--pad) calc(var(--tabs) + env(safe-area-inset-bottom) + 30px); }
body.immersive main { padding: 0; max-width: none; }

/* headings */
.hello { font: 700 30px/1.15 var(--sans); letter-spacing: -.02em; margin: 6px 0 2px; }
.date { color: var(--ink-2); font-size: 15px; margin: 0 0 20px; }
h1 { font: 700 30px/1.15 var(--sans); letter-spacing: -.02em; margin: 6px 0 18px; }
h2 { font: 700 20px/1.25 var(--sans); margin: 28px 0 12px; display: flex; align-items: baseline; justify-content: space-between; }
h2 a { font-size: 15px; font-weight: 600; color: var(--accent); }
.sub { color: var(--ink-2); font-size: 15px; }
.tiny { color: var(--ink-3); font-size: 13px; }
p { margin: 0 0 12px; }

/* art: generated SVG scenes */
.art { position: relative; overflow: hidden; border-radius: var(--r); background: #ccc; }
.art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* affirmation card ("I am" style) */
.aff { position: relative; display: flex; margin: 0 0 6px; align-items: center; justify-content: center; text-align: center; min-height: 230px; padding: 34px 28px 54px; color: #fff; }
.aff q { position: relative; font: 400 28px/1.25 var(--serif); quotes: none; text-shadow: 0 1px 12px rgba(0,0,0,.18); }
.aff .tools { position: absolute; bottom: 12px; right: 14px; display: flex; gap: 6px; }
.glassbtn { width: 38px; height: 38px; border-radius: 50%; background: rgba(0,0,0,.18); color: #fff; display: inline-grid; place-items: center; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.glassbtn svg { width: 18px; height: 18px; }

/* tiles */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.tile { display: block; text-align: left; width: 100%; align-self: start; }
.tile .art { aspect-ratio: 1 / 1; box-shadow: var(--shadow); }
.tile .t { display: block; font-weight: 650; font-size: 16px; line-height: 1.25; margin-top: 8px; }
.tile .m { display: block; color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
.tile.wide .art { aspect-ratio: 2.1 / 1; }
.tile .badge { position: absolute; left: 10px; top: 10px; background: rgba(255,255,255,.88); color: #1d2230; font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 20px; }
.row { display: flex; gap: 12px; overflow-x: auto; margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad) 4px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.row::-webkit-scrollbar { display: none; }
.row .tile { flex: 0 0 42%; scroll-snap-align: start; }

.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 6px; }
.cat { position: relative; height: 84px; border-radius: 16px; overflow: hidden; color: #fff; text-align: left; }
.cat svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cat span { position: absolute; left: 14px; bottom: 11px; font-weight: 700; font-size: 17px; text-shadow: 0 1px 8px rgba(0,0,0,.25); }
.cat[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }

/* list rows */
.list { list-style: none; margin: 0; padding: 0; }
.li { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 10px 0; }
.li .art { flex: 0 0 64px; height: 64px; border-radius: 14px; }
.li .main { flex: 1; min-width: 0; }
.li .t { display: block; font-weight: 650; font-size: 16px; line-height: 1.25; }
.li .m { display: block; color: var(--ink-2); font-size: 13.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--ink-3); font-size: 20px; }

.ev { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.ev::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.ev-strong::before { background: var(--good); } .ev-moderate::before { background: #4f8fd6; }
.ev-limited::before { background: var(--warn); } .ev-none::before { background: var(--ink-3); }

/* cards and groups */
.card { display: block; width: 100%; text-align: left; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin: 0 0 12px; }
.continue { display: flex; align-items: center; gap: 14px; padding: 12px; }
.continue .art { flex: 0 0 56px; height: 56px; border-radius: 14px; }
.continue .main { flex: 1; min-width: 0; }
.continue .t { font-weight: 650; display: block; }
.playdot { flex: 0 0 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.playdot svg { width: 16px; height: 16px; }

.group { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); margin: 0 0 22px; overflow: hidden; }
.group > * + * { border-top: 1px solid var(--line); }
.gl { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; width: 100%; text-align: left; min-height: 52px; }
.gl .v { color: var(--ink-2); }
.gl input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; transition: background .2s; flex: 0 0 auto; margin: 0; }
.gl input[type=checkbox]::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.gl input[type=checkbox]:checked { background: var(--good); }
.gl input[type=checkbox]:checked::after { transform: translateX(20px); }
.gl select { background: none; border: 0; color: var(--ink-2); text-align: right; max-width: 60%; }
.gl.col { flex-direction: column; align-items: stretch; }
.glabel { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin: 0 0 8px 4px; }
.danger { color: var(--bad); }

.seg { display: flex; background: var(--line); border-radius: 10px; padding: 2px; }
.seg button { flex: 1; padding: 7px 10px; border-radius: 8px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--pad)) 14px; padding: 2px var(--pad) 6px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 8px 14px; border-radius: 20px; background: var(--card); font-size: 14.5px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 22px; border-radius: 25px; font-weight: 650; background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.block { width: 100%; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0; }

input[type=text], textarea {
  width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; font-size: 17px;
}
textarea { min-height: 120px; line-height: 1.5; resize: vertical; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.field { display: block; margin: 0 0 16px; }
.field > span { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px 2px; }

/* detail page */
.hero { position: relative; height: 300px; margin: calc(-1 * env(safe-area-inset-top) - 18px) calc(-1 * var(--pad)) 18px; }
.hero .art { position: absolute; inset: 0; border-radius: 0 0 28px 28px; }
.floatback { position: absolute; top: calc(env(safe-area-inset-top) + 12px); left: 14px; z-index: 2; }
.backbtn { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--ink-2); padding: 6px 0; margin: 0 0 6px; }
.detail h1 { margin-bottom: 4px; }
.with { color: var(--ink-2); margin: 0 0 12px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--ink-2); font-size: 14.5px; margin: 0 0 20px; }
.heart { width: 50px; height: 50px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-2); flex: 0 0 auto; }
.heart svg { width: 22px; height: 22px; }
.heart.on { color: #e0566b; }
.heart.on svg path { fill: currentColor; }

/* reading */
.prose p { font: 400 18.5px/1.6 var(--serif); }
.sources { list-style: none; padding: 0; margin: 4px 0 0; font-size: 14.5px; }
.sources li { margin: 0 0 8px; }
.sources a { color: var(--accent); }

/* session: full-screen scene */
.stage { position: relative; min-height: 100dvh; color: #fff; }
.stage > .bg { position: fixed; inset: 0; z-index: 0; }
.stage > .bg svg { width: 100%; height: 100%; display: block; }
.stage > .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.05), rgba(0,0,0,.35)); }
.stage .in { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 12px) 22px calc(env(safe-area-inset-bottom) + 24px); }
.stage .top { display: flex; align-items: center; justify-content: space-between; height: 44px; }
.stage .dots { display: flex; gap: 6px; }
.stage .dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.35); }
.stage .dots i.on { background: #fff; }
.stage .grow { flex: 1; min-height: 16px; }
.stage .ttl { font: 700 26px/1.2 var(--sans); margin: 14px 0 4px; text-shadow: 0 1px 14px rgba(0,0,0,.2); }
.stage .with { color: rgba(255,255,255,.82); }
.stage .q { font-weight: 650; font-size: 15px; color: rgba(255,255,255,.85); margin: 22px 0 10px; }
.stage input[type=text], .stage textarea { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.stage textarea { min-height: 80px; }
.stage input::placeholder, .stage textarea::placeholder { color: rgba(255,255,255,.6); }
.stage .chip { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.25); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.stage .chip[aria-pressed="true"] { background: #fff; color: #1d2230; }
.stage .chips { margin-left: -22px; margin-right: -22px; padding: 2px 22px 6px; }
.feel { display: flex; gap: 10px; justify-content: space-between; }
.feel button { flex: 1; aspect-ratio: 1; max-width: 58px; border-radius: 50%; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); font-weight: 700; font-size: 18px; color: #fff; }
.feel button[aria-pressed="true"] { background: #fff; color: #1d2230; }
.feelends { display: flex; justify-content: space-between; font-size: 12.5px; color: rgba(255,255,255,.7); margin-top: 6px; }
.stage .btn { background: rgba(255,255,255,.18); color: #fff; border: 0; box-shadow: none; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.stage .btn.primary { background: #fff; color: #1d2230; }
.stage .textbtn { color: rgba(255,255,255,.85); font-weight: 600; padding: 12px; }
.stage .center { text-align: center; }
.stage .ctl { display: flex; align-items: center; justify-content: space-between; }
.stage .glassbtn { width: 40px; height: 40px; }
.stage .toggle { display: flex; align-items: center; justify-content: space-between; color: rgba(255,255,255,.85); font-size: 15px; margin: 6px 0 0; }
.stage .toggle input { width: 22px; height: 22px; accent-color: #fff; }
.intent { font: italic 400 21px/1.35 var(--serif); color: rgba(255,255,255,.9); margin: 10px 0 0; }

.big { width: 92px; height: 92px; border-radius: 50%; background: #fff; color: #1d2230; display: grid; place-items: center; margin: 0 auto; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.big svg { width: 32px; height: 32px; }
.prog { margin: 28px 0 6px; }
.prog .bar { position: relative; height: 4px; background: rgba(255,255,255,.3); border-radius: 2px; }
.prog .fill { position: absolute; left: 0; top: 0; bottom: 0; background: #fff; border-radius: 2px; }
.prog .arrow { position: absolute; top: 50%; width: 28px; height: 16px; margin: -8px 0 0 -26px; color: #fff; overflow: visible; }
.prog .times { display: flex; justify-content: space-between; font-size: 13px; color: rgba(255,255,255,.8); margin-top: 10px; font-variant-numeric: tabular-nums; }
.nowline { font: 400 19px/1.45 var(--serif); color: rgba(255,255,255,.9); min-height: 3em; text-align: center; margin: 20px 0 0; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; box-shadow: 0 10px 30px rgba(0,0,0,.3); margin: 18px 0 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Coué: twenty knots on a string */
.knots { width: 100%; height: 110px; display: block; margin: 26px 0 8px; overflow: visible; }
.knots path { stroke: rgba(255,255,255,.55); stroke-width: 2; fill: none; }
.knots circle { fill: rgba(255,255,255,.18); stroke: #fff; stroke-width: 1.5; transition: fill .25s; }
.knots circle.done { fill: #fff; }
.formula { font: 400 30px/1.25 var(--serif); text-align: center; margin: 24px 0 0; text-shadow: 0 1px 14px rgba(0,0,0,.2); }
.count { text-align: center; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.tapzone { flex: 1; display: flex; flex-direction: column; justify-content: center; width: 100%; text-align: center; color: #fff; }

/* tab bar */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-around;
  height: calc(var(--tabs) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tabs a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.tabs a svg { width: 24px; height: 24px; }
.tabs a[aria-current="page"] { color: var(--ink); }
body.immersive .tabs { display: none; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 16px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 22px; font-size: 15px; font-weight: 600; z-index: 30; pointer-events: none; }
body.immersive .toast { bottom: calc(env(safe-area-inset-bottom) + 24px); }
.strip { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.strip .grow { flex: 1; }
.strip .x { color: var(--ink-3); font-size: 20px; padding: 0 4px; }
.feelpill { font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 12px; background: var(--line); color: var(--ink-2); white-space: nowrap; }
.feelpill.up { background: rgba(63,157,107,.16); color: var(--good); }
.feelpill.down { background: rgba(196,87,63,.14); color: var(--bad); }
.stat { display: grid; grid-template-columns: 1fr auto auto; gap: 8px 14px; align-items: baseline; font-size: 15px; }
.rec-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.legal { color: var(--ink-3); font-size: 12.5px; text-align: center; margin: 30px 10px 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); } .row .tile { flex-basis: 28%; } }
