@font-face { font-family: 'Fraunces'; src: url(fonts/fraunces.woff2) format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url(fonts/fraunces-italic.woff2) format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url(fonts/inter.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

@property --bg1 { syntax: '<color>'; inherits: true; initial-value: #0d1530; }
@property --bg2 { syntax: '<color>'; inherits: true; initial-value: #1d2a52; }
@property --accent { syntax: '<color>'; inherits: true; initial-value: #6b7cff; }

:root {
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', -apple-system, system-ui, sans-serif;
  --ok: #4fae7b; --partial: #e0a23c; --abandoned: #e2714f; --skipped: #a3a8ae; --progress: #5b8def;
  --fg: #1c2430; --dim: rgba(28,36,48,.56); --faint: rgba(28,36,48,.34);
  --card: rgba(255,255,255,.52); --card2: rgba(255,255,255,.3); --line: rgba(28,36,48,.1);
  --shadow: 0 1px 1px rgba(20,30,50,.04), 0 10px 30px -12px rgba(20,30,50,.18);
  --veil: transparent; --ease: cubic-bezier(.2,.8,.2,1);
  --on-accent: #fff;
  transition: --bg1 600s linear, --bg2 600s linear, --accent 600s linear;
}
:root.snap { transition: none; }
:root[data-tone=dark] {
  --fg: #eef1f8; --dim: rgba(238,241,248,.6); --faint: rgba(238,241,248,.32);
  --card: rgba(255,255,255,.075); --card2: rgba(255,255,255,.045); --line: rgba(255,255,255,.1);
  --shadow: 0 10px 40px -16px rgba(0,0,0,.5); --on-accent: #0e1220;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 15.5px/1.5 var(--sans); color: var(--fg); letter-spacing: -.005em;
  background: linear-gradient(170deg, var(--bg1), var(--bg2)) fixed; overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none;
}
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }
#sky, #veil { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#veil { background: var(--veil); transition: background 60s; }
body.soft #sky { opacity: .4; filter: blur(1px); }
body.soft { --card: rgba(255,255,255,.34); }
:root[data-tone=dark] body.soft { --card: rgba(255,255,255,.05); }

#app { position: relative; max-width: 620px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 18px calc(env(safe-area-inset-bottom) + 110px); }
.view > * { animation: rise .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.view > *:nth-child(2) { --i: 1 } .view > *:nth-child(3) { --i: 2 } .view > *:nth-child(4) { --i: 3 } .view > *:nth-child(5) { --i: 4 }
.view > *:nth-child(6) { --i: 5 } .view > *:nth-child(7) { --i: 6 } .view > *:nth-child(n+8) { --i: 7 }
.view.still > * { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .view > * { animation: fade .3s both; } }

/* type */
h1 { font: 300 36px/1.08 var(--serif); letter-spacing: -.025em; margin: 10px 0 6px; font-variation-settings: 'opsz' 96; }
h1 em, .serif em { font-style: italic; font-weight: 300; }
h2 { font: 500 11px/1 var(--sans); text-transform: uppercase; letter-spacing: .16em; color: var(--dim); margin: 28px 6px 10px; }
h3 { font: 400 21px/1.2 var(--serif); letter-spacing: -.01em; margin: 0 0 6px; }
p { margin: 6px 0; } small, .dim { color: var(--dim); font-size: 13px; } .faint { color: var(--faint); }
.serif { font-family: var(--serif); } .lede { font: 300 19px/1.45 var(--serif); }
.eyebrow { font: 500 11px/1 var(--sans); text-transform: uppercase; letter-spacing: .16em; color: var(--dim); }
.big { font: 200 72px/1 var(--serif); letter-spacing: -.04em; font-variant-numeric: tabular-nums; font-variation-settings: 'opsz' 144; }
.mid { font: 300 40px/1 var(--serif); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
a { color: inherit; }

/* surfaces */
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 26px; padding: 18px; margin: 12px 0;
  -webkit-backdrop-filter: blur(26px) saturate(1.3); backdrop-filter: blur(26px) saturate(1.3); box-shadow: var(--shadow); }
.card.flat { box-shadow: none; background: var(--card2); }
.card.tap { cursor: pointer; transition: transform .25s var(--ease); } .card.tap:active { transform: scale(.985); }
.row { display: flex; align-items: center; gap: 12px; } .row > .grow, .grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 10px; } .end { justify-content: flex-end; } .between { justify-content: space-between; }
.wrap { flex-wrap: wrap; } .right { margin-left: auto; } .center { text-align: center; } .gap { height: 14px; }
.hr { height: 1px; background: var(--line); margin: 12px 0; }
.chev { color: var(--faint); font-size: 22px; font-weight: 300; }
.ic { flex: none; display: block; }

/* controls */
button, select, input, textarea { font: inherit; color: inherit; }
button { border: 0; border-radius: 999px; padding: 11px 18px; background: var(--accent); color: var(--on-accent); font-weight: 550; font-size: 15px;
  cursor: pointer; transition: transform .2s var(--ease), opacity .2s, background .3s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button:active { transform: scale(.96); }
button.ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
button.soft { background: var(--card2); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
button.sm { padding: 6px 12px; font-size: 13px; } button.icon { padding: 9px; border-radius: 50%; }
button.wide { width: 100%; padding: 16px; font-size: 16px; }
button:disabled { opacity: .4; }
input, textarea, select { width: 100%; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--card2); outline: none; transition: border-color .2s; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
input[type=range] { padding: 0; border: 0; background: none; accent-color: var(--accent); }
label { display: block; font-size: 12.5px; color: var(--dim); margin: 10px 0; } label > input, label > select, label > textarea { margin-top: 6px; color: var(--fg); font-size: 16px; }
label.inline { display: flex; align-items: center; gap: 10px; color: var(--fg); font-size: 15px; } label.inline input { margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; font-size: 12px; font-weight: 550; background: var(--card2); box-shadow: inset 0 0 0 1px var(--line); }
.seg { display: flex; gap: 4px; overflow-x: auto; margin: 10px 0; padding: 4px; border-radius: 99px; background: var(--card2); box-shadow: inset 0 0 0 1px var(--line); scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { background: transparent; color: var(--dim); padding: 8px 14px; font-weight: 500; white-space: nowrap; flex: 1; }
.seg button.on { background: var(--fg); color: var(--bg2); }
.days { display: flex; gap: 6px; } .days button { width: 38px; height: 38px; padding: 0; background: var(--card2); color: var(--dim); box-shadow: inset 0 0 0 1px var(--line); }
.days button.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.switch { position: relative; width: 50px; height: 30px; border-radius: 99px; background: var(--line); padding: 0; flex: none; transition: background .3s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .35s var(--ease); }
.switch.on { background: var(--ok); } .switch.on::after { transform: translateX(20px); }

/* status colours — same everywhere */
.st { width: 24px; height: 24px; border-radius: 50%; border: 1.6px solid var(--faint); flex: none; padding: 0; background: transparent; position: relative; transition: all .35s var(--ease); }
.st::after { content: ''; position: absolute; left: 7px; top: 3.5px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .35s var(--ease) .05s; }
.st.completed { background: var(--ok); border-color: var(--ok); } .st.completed::after { transform: rotate(45deg) scale(1); }
.st.partial { background: var(--partial); border-color: var(--partial); }
.st.abandoned { border-color: var(--abandoned); background: repeating-linear-gradient(45deg, var(--abandoned) 0 3px, transparent 3px 6px); }
.st.skipped { background: var(--skipped); border-color: var(--skipped); opacity: .7; }
.st.progress { background: var(--progress); border-color: var(--progress); animation: pulse 1.8s ease-in-out infinite; }
.st.sq { border-radius: 6px; width: 100%; height: auto; aspect-ratio: 1; border: 0; background-color: var(--line); } .st.sq::after { display: none; }
.st.sq.none { background: var(--line); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--progress) 20%, transparent); opacity: .75; } }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--dim); } .legend span { display: inline-flex; align-items: center; gap: 6px; }

/* lists */
.item { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); position: relative; }
.item:last-child { border-bottom: 0; }
.item .t { transition: color .3s; } .item.done .t { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--faint); }
.swipe { touch-action: pan-y; transition: transform .3s var(--ease); }
.swipe.dragging { transition: none; }
.prio { width: 6px; height: 6px; border-radius: 50%; } .prio.p1 { background: var(--abandoned); } .prio.p2 { background: var(--partial); } .prio.p3 { background: var(--faint); }
.handle { color: var(--faint); padding: 4px; cursor: grab; touch-action: none; }

/* rings, bars */
.ring { transform: rotate(-90deg); flex: none; } .ring circle { fill: none; }
.ring-fill { stroke-dashoffset: var(--c); animation: ringIn 1.2s var(--ease) .15s forwards; }
@keyframes ringIn { to { stroke-dashoffset: var(--off); } }
.bar { height: 5px; border-radius: 5px; background: var(--line); overflow: hidden; } .bar > i { display: block; height: 100%; border-radius: 5px; background: var(--ok); transition: width .8s var(--ease); }
.glass { position: relative; width: 46px; height: 62px; border-radius: 6px 6px 14px 14px; border: 1.5px solid var(--faint); overflow: hidden; flex: none; }
.glass i { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(#7cc4f0, #4c9bd8); transition: height 1s var(--ease); }
.glass i::before { content: ''; position: absolute; left: -50%; top: -6px; width: 200%; height: 12px; border-radius: 45%; background: rgba(255,255,255,.35); animation: wave 3s linear infinite; }
@keyframes wave { to { transform: translateX(25%); } }

/* tabs */
#tabs { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 12px); transform: translateX(-50%); display: flex; gap: 2px;
  padding: 6px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 12px 40px -12px rgba(0,0,0,.3);
  -webkit-backdrop-filter: blur(30px) saturate(1.4); backdrop-filter: blur(30px) saturate(1.4); z-index: 5; transition: transform .5s var(--ease), opacity .4s; }
#tabs a { display: grid; place-items: center; gap: 2px; width: 62px; padding: 7px 0 5px; border-radius: 99px; text-decoration: none; font-size: 10px; font-weight: 550; color: var(--dim); transition: all .35s var(--ease); }
#tabs a.on { background: var(--fg); color: var(--bg2); }
body.full #tabs { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; } body.full #app { padding-bottom: 40px; }
.fab { position: fixed; right: 18px; bottom: calc(env(safe-area-inset-bottom) + 86px); width: 56px; height: 56px; border-radius: 50%; padding: 0; z-index: 4; box-shadow: 0 12px 30px -8px rgba(0,0,0,.35); }
body.full .fab { display: none; }

/* dialogs & toasts */
dialog { border: 0; border-radius: 28px; padding: 22px; width: min(94vw, 520px); max-height: 86vh; color: var(--fg); background: color-mix(in srgb, var(--bg2) 30%, #fbfaf7);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); }
:root[data-tone=dark] dialog { background: color-mix(in srgb, var(--bg1) 70%, #1a1f2e); }
dialog[open] { animation: pop .45s var(--ease); } dialog::backdrop { background: rgba(10,14,25,.4); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.97); } }
dialog h3 { margin-bottom: 12px; } dialog .row.end { margin-top: 16px; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 92px); transform: translateX(-50%); display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 18px; border-radius: 99px; background: var(--fg); color: var(--bg2); font-size: 14px; z-index: 50; animation: pop .4s var(--ease); transition: opacity .4s, transform .4s; }
.toast button { color: var(--bg2); box-shadow: inset 0 0 0 1px currentColor; } .toast.out { opacity: 0; transform: translate(-50%, 10px); }

/* home hero */
.hero { padding: 28px 6px 14px; } .hero .big { font-size: 104px; margin: 6px 0 0 -4px; }
.hero-meta { display: flex; flex-direction: column; gap: 6px; padding-bottom: 12px; }
.greet { font: 300 italic 22px/1.2 var(--serif); color: var(--dim); }

/* media frames (workout follow-along) */
.frames { position: relative; aspect-ratio: 4/3; border-radius: 20px; overflow: hidden; background: #fff; margin: 4px 0 14px; }
.frames img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .5s; }
.frames img.on { opacity: 1; }
.frames .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #9aa; }
.guide { counter-reset: g; } .guide li { list-style: none; position: relative; padding: 8px 0 8px 34px; color: var(--dim); transition: color .4s; }
.guide li::before { counter-increment: g; content: counter(g); position: absolute; left: 0; top: 8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.guide li.on { color: var(--fg); } .guide li.on::before { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.caption { font: 300 italic 20px/1.4 var(--serif); text-align: center; min-height: 2.8em; transition: opacity .6s; }
.timer-ring { position: relative; width: 220px; height: 220px; margin: 10px auto; display: grid; place-items: center; }
.timer-ring svg { position: absolute; inset: 0; } .timer-ring .ring-fill { animation: none; stroke-dashoffset: var(--off); transition: stroke-dashoffset 1s linear; }

/* sadhna */
.orb-wrap { position: relative; width: 260px; height: 260px; margin: 26px auto 10px; display: grid; place-items: center; }
.orb { position: absolute; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 50%, #fff), var(--accent));
  box-shadow: 0 0 80px 10px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform 1s var(--ease); will-change: transform; }
.orb-halo { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--line); }
.orb-label { position: relative; font: 300 20px var(--serif); color: var(--on-accent); }
.nostril { display: flex; justify-content: space-between; width: 180px; margin: 0 auto; color: var(--faint); font-size: 13px; }
.nostril .on { color: var(--fg); font-weight: 600; }
.practice-card { display: grid; grid-template-columns: 54px 1fr auto; gap: 14px; align-items: center; }
.practice-ic { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: var(--card2); box-shadow: inset 0 0 0 1px var(--line); }

/* writer */
.writer { width: 100%; min-height: 70vh; border: 0; background: transparent; resize: none; outline: none; padding: 10px 2px;
  font: 300 21px/1.75 var(--serif); letter-spacing: -.005em; color: var(--fg); caret-color: var(--accent); }
.wc { transition: opacity 1.2s; } .wc.hide { opacity: 0; }

/* stage view */
body.stage { background: #000; color: #fff; } body.stage #sky, body.stage #veil { display: none; }
.cue { font: 400 32px/1.2 var(--serif); padding: 18px 0; border-bottom: 1px solid #222; } .cue small { color: #888; font: 14px var(--sans); display: block; margin-top: 6px; }

/* grids */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tiles .card { margin: 0; display: flex; flex-direction: column; gap: 22px; text-decoration: none; min-height: 112px; }
.tiles .card b { font: 400 19px var(--serif); }
.grid { display: grid; grid-template-columns: 64px repeat(28, 1fr); gap: 3px; align-items: center; font-size: 11.5px; color: var(--dim); }
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.heat .st.sq { border-radius: 8px; }
.heat small { text-align: center; font-size: 10px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 110px; } .bars > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.bars i { display: block; width: 100%; border-radius: 6px 6px 2px 2px; min-height: 3px; transition: height 1s var(--ease); }
.bars small { font-size: 9.5px; }

/* body map */
.bodymap { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .bodymap svg { width: 100%; height: auto; }
.bodymap path, .bodymap ellipse, .bodymap rect { transition: fill .8s var(--ease); cursor: pointer; stroke: var(--bg2); stroke-width: 1.2; }
.bodymap .skin { fill: var(--card2); stroke: var(--line); cursor: default; }

/* alarm dial */
.dial { display: flex; align-items: center; justify-content: center; gap: 4px; font: 200 76px/1 var(--serif); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.dial .col { align-items: center; gap: 0; } .dial button.step { background: none; color: var(--faint); padding: 2px 16px; font-size: 18px; }
.ampm { display: flex; flex-direction: column; gap: 4px; margin-left: 10px; } .ampm button { padding: 5px 10px; font-size: 13px; background: var(--card2); color: var(--dim); }
.ampm button.on { background: var(--fg); color: var(--bg2); }
.art { width: 100%; aspect-ratio: 1; border-radius: 22px; object-fit: cover; box-shadow: 0 20px 50px -20px rgba(0,0,0,.5); background: var(--card2); }
.ring-screen { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 30px; text-align: center; gap: 14px;
  background: linear-gradient(170deg, var(--bg1), var(--bg2)); }
.ring-screen .big { font-size: 110px; animation: breathe 4s ease-in-out infinite; } @keyframes breathe { 50% { opacity: .65; } }
.yt { width: 100%; aspect-ratio: 16/9; border-radius: 16px; overflow: hidden; } .yt iframe { width: 100%; height: 100%; border: 0; }

/* camera mission */
.cam { position: relative; width: 100%; aspect-ratio: 3/4; border-radius: 26px; overflow: hidden; background: #000; }
.cam video, .cam canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam .count { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: #fff; font: 200 90px/1 var(--serif); text-shadow: 0 4px 20px rgba(0,0,0,.5); }

/* brief */
.brief-sec { animation: rise .7s var(--ease) both; } .brief-sec.on { box-shadow: 0 0 0 1.5px var(--accent), var(--shadow); }
.brief-sec h3 { display: flex; align-items: center; gap: 10px; } .brief-sec h3 .n { font: 500 11px var(--sans); color: var(--dim); }
.dd { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; } .dd ul { margin: 6px 0 0; padding-left: 16px; } .dd li { margin: 4px 0; font-size: 14px; }
.player { position: sticky; top: calc(env(safe-area-inset-top) + 8px); z-index: 3; }
.mic-live { animation: pulse 1.2s infinite; background: var(--abandoned) !important; }
@media (max-width: 380px) { .hero .big { font-size: 80px; } h1 { font-size: 32px; } #tabs a { width: 56px; } }
