/* Warm paper, near-black ink, one accent and nothing else.
   The values come from Radix Colors (MIT, github.com/radix-ui/colors): sand
   for the neutrals, tomato for the accent, bronze for the warm secondary.
   They are used because those scales are tuned for contrast, not picked by eye. */
:root {
  --bg: #f4f2ed;        /* warm paper, kept: the page stays warm */
  --s1: #fdfdfc;        /* raised: a card sitting on the paper */
  --s2: #e9eded;        /* sunken: a field, a track, a quiet fill */
  --ink: #1a2423;       /* ink with a green cast, so it sits with the accent */
  --mute: #596463;
  /* Deep petrol, chosen over the tomato red it replaced. A red accent on a
     health app reads as an alarm; this one reads as calm without going cold,
     because the paper under it stays warm. Paper on it measures 7.63:1, well
     clear of the 4.5 minimum, which matters for readers in their sixties. */
  --flame: #0f5c5c;
  --flame-d: #0b4a4a;   /* a little darker again, for small uppercase labels */
  --clay: #6e8f8b;      /* the warm secondary, cooled to match */
  --clay-l: #e4eceb;
  --paper: #fdfdfc;     /* what sits on top of the accent */
  --dark: #1a2423;      /* ink, when it sits on a coloured surface */
  --line: #d6dddc;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* kills the double-tap-to-zoom delay and the zoom with it, on touch only */
html { touch-action: manipulation; }
html { font-size: 17px; background: var(--bg); }
/* paper grain, tiled. Behind every element, so it needs no stacking context. */

body { margin: 0; background-color: var(--bg); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E"); color: var(--ink); font-family: Archivo, system-ui, -apple-system, sans-serif; line-height: 1.45; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
body.noscroll { overflow: hidden; }
/* Display is a light serif, not a heavy sans. Anything large is set in it, at
   a weight under 400 with the tracking pulled in - the thing that separates a
   sports title from an app template. */
.disp { font-family: Newsreader, Georgia, "Times New Roman", serif; font-weight: 350; font-variation-settings: "opsz" 40; letter-spacing: -.021em; line-height: 1.07; }
/* The counterweight: a small extended grotesque in caps, widely tracked and
   NOT bold. Every eyebrow, tab and unit label in the app is this. */
.lbl { font-family: Archivo, system-ui, sans-serif; font-size: .63rem; font-weight: 500; font-stretch: 118%; letter-spacing: .17em; text-transform: uppercase; }
/* Numerals keep the grotesque, stretched: a scoreboard, not a headline. */
.num { font-family: Archivo, system-ui, sans-serif; font-weight: 700; font-stretch: 118%; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
h1, h2, h3, p { margin: 0; }
/* Links in prose: the browser's default blue is unreadable on the dark theme
   (1.96:1 on the credits line) and wrong on the light one. */
a { color: inherit; text-decoration-color: var(--flame); text-underline-offset: 2px; }
/* Every heading is the display serif, whether or not it was tagged. Card
   titles too: one voice for anything that names a thing. */
h1, h2, h3, .joincard b, .jmini b, .vmeta b, .rt b, .xc b, .tile, .seg2 button, .nextcard h2 {
  font-family: Newsreader, Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.012em; }
h1, h2, .nextcard h2 { font-weight: 350; letter-spacing: -.021em; line-height: 1.07; }
.mute { color: var(--mute); }
.small { font-size: .85rem; }

main { max-width: 520px; margin: 0 auto; min-height: 100vh; padding: calc(env(safe-area-inset-top) + 20px) 20px 130px; }
.screen { animation: in .4s cubic-bezier(.2,.8,.2,1); }
@keyframes in { from { opacity: 0; transform: translateY(16px); } }
@keyframes slide { from { opacity: 0; transform: translateX(28px); } }

/* buttons */
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--flame); outline-offset: 3px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; border-radius: 6px; background: var(--flame); color: var(--paper); font-family: Archivo, sans-serif; font-weight: 500; font-stretch: 112%; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; transition: transform .15s; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.sm { width: auto; min-height: 44px; padding: 0 18px; font-size: .68rem; }
.btn[disabled] { opacity: .35; }
.round { width: 46px; height: 46px; border-radius: 50%; background: var(--s1); display: grid; place-items: center; flex: none; }
.pill { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--s1); border: 1.5px solid transparent; font-size: .95rem; white-space: nowrap; }
.pill[aria-pressed="true"] { background: var(--flame); color: var(--paper); font-weight: 600; }

/* top bar */
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; min-height: 46px; }
.top h2 { font-size: 1.5rem; }

/* tiles for choices */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid1 { display: grid; gap: 12px; }
.tile { text-align: left; background: var(--s1); border: 2px solid transparent; border-radius: 10px; padding: 18px; min-height: 76px; font-size: 1.05rem; font-weight: 500; transition: .15s; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile[aria-pressed="true"] { border-color: var(--flame); background: var(--s2); }
.tile[aria-pressed="true"]::after { content: ""; width: 22px; height: 22px; border-radius: 50%; background: var(--flame) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fdfdfc' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/70% no-repeat; flex: none; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }

/* onboarding */
.ob { min-height: calc(100vh - 150px); display: flex; flex-direction: column; animation: slide .35s cubic-bezier(.2,.8,.2,1); }
.ob h1 { font-size: 2.5rem; margin: 18px 0 12px; }
.ob .lead { color: var(--mute); margin-bottom: 26px; }
.ob .foot { margin-top: auto; padding-top: 24px; position: sticky; bottom: 20px; }
.segs { display: flex; gap: 5px; flex: 1; }
.segs i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); position: relative; overflow: hidden; display: block; }
.segs i.on { background: var(--flame); }
.field { width: 100%; font: inherit; font-size: 1.6rem; font-weight: 600; color: var(--ink); background: none; border: 0; border-bottom: 2px solid var(--line); padding: 10px 0; border-radius: 0; }
.field:focus { outline: 0; border-color: var(--flame); }
input[type="time"], input[type="date"] { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; }
.lrow > * { min-width: 0; }
.input { width: 100%; box-sizing: border-box; font: inherit; color: var(--ink); background: var(--s1); border: 1.5px solid var(--line); border-radius: 8px; padding: 13px 14px; min-height: 48px; }
.build li { list-style: none; opacity: 0; animation: in .5s forwards; padding: 10px 0; display: flex; gap: 12px; align-items: center; }
.build li::before { content: ""; width: 20px; height: 20px; border-radius: 50%; background: var(--flame); flex: none; }
.build ul { padding: 0; margin: 30px 0; }

/* home */
/* The masthead is a photograph edge to edge, not another rounded box. It fades
   into the paper rather than stopping at a hard line. */
.mast { position: relative; margin: calc(-1 * (env(safe-area-inset-top) + 20px)) -20px 18px; height: 208px; overflow: hidden; }
.mast img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mast::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(28,24,18,.5) 0%, rgba(28,24,18,.12) 40%, rgba(244,242,237,.55) 76%, var(--bg) 99%); }
.mast .m-t { position: absolute; z-index: 2; left: 20px; right: 20px; top: calc(env(safe-area-inset-top) + 18px); color: #fff; }
.mast .m-d { font-family: Archivo, sans-serif; font-size: .64rem; font-weight: 500; font-stretch: 118%; letter-spacing: .2em; text-transform: uppercase; opacity: .92; }
.mast .m-h { display: block; font-size: 1.4rem; line-height: 1.12; margin-top: 3px; text-shadow: 0 2px 16px rgba(0,0,0,.35); }
.mast .pill { position: absolute; z-index: 2; left: 20px; bottom: 26px; background: rgba(253,253,252,.9); border-color: transparent; backdrop-filter: blur(6px); }
.mast .pill[aria-pressed="true"] { background: var(--flame); color: var(--paper); }

/* The next session: figure on the left, words on the right. Deliberately a
   different shape from everything under it. */
.nextcard { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--tone); color: var(--dark); border-radius: 12px; padding: 16px 16px 16px 10px; position: relative; }
.nextcard .nt { flex: 1; min-width: 0; }
.nextcard .k { display: block; font-family: Archivo, sans-serif; font-size: .63rem; font-stretch: 118%; letter-spacing: .18em; text-transform: uppercase; opacity: .8; font-weight: 500; }
.nextcard h2 { font-size: 1.45rem; line-height: 1.08; margin-top: 4px; }
.nextcard .nm { display: block; font-size: .85rem; color: #514b44; margin-top: 5px; }
.play { width: 54px; height: 54px; flex: none; border-radius: 50%; background: var(--flame); color: var(--paper); display: grid; place-items: center; transition: transform .15s; }
.play:active { transform: scale(.92); }
.play svg { width: 25px; height: 25px; fill: currentColor; margin-left: 2px; }

/* The week is a line of type, not another card. */
.weekline { margin: 28px 0 2px; }
.weekline .wn { font-size: 2.5rem; line-height: 1; }
.weekline .wo { color: var(--mute); font-size: .92rem; margin-left: 6px; }
.weekline .wbar { height: 7px; border-radius: 4px; background: var(--s2); margin: 12px 0 14px; overflow: hidden; }
.weekline .wbar b { display: block; height: 100%; border-radius: 4px; background: var(--flame); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.hello { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.hello small { color: var(--mute); display: block; }
.hello strong { font-size: 1.15rem; }
.sec { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin: 30px 0 13px; }
.sec h3 { font-size: 1.3rem; }
.sec .mute { display: block; margin-top: 2px; }
.sec button.mute { padding: 12px 0 12px 10px; margin: -12px 0 -12px -10px; min-height: 44px; }
/* "View all" is writing, not a button: no fill, no border, no pill. It sits
   above the rail and stays put while the rail scrolls under it. */
/* Written, not a button - but a 21px tap target is a 21px tap target. The
   padding grows the touch area to 44px without moving a pixel of the text. */
.viewall { flex: none; color: var(--flame-d); font-weight: 600; font-size: .88rem; padding: 12px 0 12px 10px; margin: -12px 0 -12px -10px; }
.viewall::after { content: " ›"; font-weight: 700; }

/* ---- explore cards ---- */
.xc { position: relative; flex: 0 0 170px; scroll-snap-align: start; text-align: left; color: inherit; text-decoration: none; display: flex; flex-direction: column; }
.xi { display: block; height: 104px; border-radius: 8px; overflow: hidden; background: var(--s2); position: relative; }
.xi img { width: 100%; height: 100%; object-fit: cover; display: block; border: 0; }
/* A routine's art is the drawing, not a photograph: tinted panel, ink figure,
   the same line language as the session screen. */
.xf { display: grid; place-items: center; background: var(--clay-l); padding: 6px; }
.xf svg { width: 100%; height: 100%; color: var(--ink); opacity: .9; }
.xf path { display: none; }
/* nothing to show: the title moves up instead of sitting under a grey hole */
.xc.noart .xm { margin-top: 0; }
.xp { position: absolute; right: 8px; bottom: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(20,18,14,.72); color: #fff; font-size: .62rem; display: grid; place-items: center; padding-left: 2px; }
.xm { display: block; font-family: Archivo, sans-serif; font-size: .62rem; font-stretch: 118%; letter-spacing: .18em; text-transform: uppercase; font-weight: 500; color: var(--flame-d); margin: 10px 0 3px; }
.xc b { font-size: .98rem; line-height: 1.2; }
.xb { display: block; font-size: .76rem; color: var(--mute); margin-top: 3px; text-transform: capitalize; }
.xc.add { border: 1.5px dashed var(--line); border-radius: 8px; min-height: 150px; align-items: center; justify-content: center; gap: 6px; color: var(--mute); }
.xgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.xgrid .xc { flex: initial; }
.xgrid .xi { height: 96px; }
/* the rail deals itself out, left to right. Decorative, so the reduced-motion
   block at the bottom of this file switches it off. */
.rail .xc { animation: xin .5s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes xin { from { opacity: 0; transform: translateY(16px); } }
.days { display: flex; gap: 6px; flex: 1 1 100%; justify-content: space-between; margin-top: 6px; }
.day { text-align: center; font-size: .72rem; color: var(--mute); min-height: 44px; }
.day i { display: block; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line); margin: 5px auto 0; }
.day.on i { background: var(--flame); border-color: var(--flame); }
.day.now i { border-color: var(--flame); border-width: 2.5px; }
.rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -20px; padding: 0 20px 4px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
/* A routine card shows the movement, not the logo. height is a minimum, not a
   fixed value: two-line titles used to be cut off by it. */
.rt { position: relative; overflow: hidden; flex: 0 0 152px; min-height: 172px; scroll-snap-align: start; border-radius: 10px; padding: 16px 15px 16px; background: var(--s1); border: 1px solid var(--line); color: var(--ink); display: flex; flex-direction: column; text-align: left; }
.grid2 .rt { flex: initial; }
.rt .rtn { display: block; font-family: Archivo, sans-serif; font-weight: 700; font-stretch: 118%; font-variant-numeric: tabular-nums; font-size: 2.9rem; line-height: .95; letter-spacing: -.03em; color: var(--flame); }
.rt .rtn small { font-size: .62rem; font-weight: 500; font-stretch: 118%; letter-spacing: .18em; text-transform: uppercase; margin-left: 4px; color: var(--mute); }
.rt b { font-size: 1.05rem; line-height: 1.18; margin-top: auto; }
.rt .ra { display: block; font-size: .76rem; color: var(--mute); margin-top: 3px; text-transform: capitalize; }
.nextcard .nf { width: auto; height: auto; flex: none; font-family: Archivo, sans-serif; font-weight: 700; font-stretch: 118%; font-variant-numeric: tabular-nums; font-size: 3.1rem; line-height: .9; letter-spacing: -.03em; padding-left: 8px; }
.nextcard .nf small { display: block; font-size: .62rem; font-weight: 500; font-stretch: 118%; letter-spacing: .18em; text-transform: uppercase; opacity: .78; margin-top: 3px; }
.rt .m { font-family: Archivo, sans-serif; font-size: .62rem; font-stretch: 118%; letter-spacing: .18em; text-transform: uppercase; color: var(--flame-d); font-weight: 500; margin-top: auto; }
.rt .star { position: absolute; right: 11px; top: 10px; font-size: 1rem; color: var(--flame); }
.rt.add { background: transparent; border: 1.5px dashed var(--line); color: var(--mute); align-items: center; justify-content: center; gap: 6px; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--s1); border-radius: 10px; padding: 12px 14px 12px 18px; margin-bottom: 14px; font-size: .92rem; }

/* team journey */
.joincard, .jmini { display: block; width: 100%; text-align: left; background: var(--s1); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-top: 24px; }
.joincard b, .jmini b { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.jmini { background: var(--s2); border-color: transparent; }
.jcard { background: var(--coral); color: var(--dark); border-radius: 12px; padding: 22px; margin-bottom: 14px; }
.jtop { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; opacity: .75; }
.jkm { font-size: 3rem; margin: 2px 0 6px; }
.jkm small { font-size: 1rem; font-weight: 600; opacity: .7; }
.jbar { position: relative; height: 10px; border-radius: 5px; background: rgba(0,0,0,.16); margin: 14px 0 10px; }
.jmini .jbar { background: var(--s1); }
.jbar b { display: block; height: 100%; border-radius: 5px; background: var(--dark); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.jmini .jbar b { background: var(--flame); }
.jbar i { position: absolute; top: 50%; width: 10px; height: 10px; border-radius: 50%; background: rgba(0,0,0,.25); transform: translate(-50%,-50%); }
.jmini .jbar i { background: var(--s1); box-shadow: 0 0 0 2px var(--s2); }
.jbar i.on { background: var(--dark); }
.jmini .jbar i.on { background: var(--flame); }
.jnext { font-size: .92rem; font-weight: 500; margin: 0; }
.jmini .jnext { color: var(--mute); }

/* videos */
.seg2 { display: flex; gap: 4px; background: var(--s1); border-radius: 999px; padding: 4px; margin-bottom: 16px; }
.seg2 button { flex: 1; min-height: 44px; border-radius: 999px; color: var(--mute); font-size: .95rem; font-weight: 500; }
.seg2 button[aria-pressed="true"] { background: var(--flame); color: var(--paper); font-weight: 700; }
.vc { background: var(--s1); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.vthumb { position: relative; display: block; aspect-ratio: 16/9; background: var(--s2); }
.vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; border: 0; }
.vplay { position: absolute; inset: 0; margin: auto; width: 60px; height: 60px; border-radius: 50%; background: rgba(14,27,23,.72); display: grid; place-items: center; color: var(--flame); }
.vplay svg { width: 26px; height: 26px; margin-left: 3px; }
/* a dark pill wants light type on it. This was ink on near-black, 1.08:1,
   left over from the green theme and invisible on every video card. */
.vlen { position: absolute; right: 10px; bottom: 10px; background: rgba(14,16,20,.86); color: #fdfdfc; font-family: Archivo, sans-serif; font-size: .64rem; font-weight: 500; font-stretch: 118%; letter-spacing: .12em; text-transform: uppercase; padding: 4px 9px; border-radius: 4px; }
.vmeta { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.vmeta b { font-size: 1.05rem; line-height: 1.25; }
.vmeta .pill { margin-top: 10px; background: var(--s2); border-color: var(--line); }
.vmeta .pill[disabled] { opacity: .5; }
.watch { display: flex; gap: 12px; align-items: center; background: var(--s2); border-radius: 10px; padding: 10px; margin-bottom: 16px; color: inherit; text-decoration: none; }
.watch img { width: 104px; height: 59px; object-fit: cover; border-radius: 12px; flex: none; background: var(--s1); }

/* ---- reading and tools ---- */
/* An article offer is a line of writing under a rule, not another filled card.
   It has to be able to appear five times across the app without any one of
   them feeling like an advert. */
.rl { display: block; width: 100%; text-align: left; border-top: 1px solid var(--line); margin-top: 22px; padding: 14px 0 2px; color: inherit; }
.rl .lbl { display: block; color: var(--flame-d); margin-bottom: 5px; }
.rl b { display: block; font-family: Newsreader, Georgia, serif; font-weight: 400; font-size: 1.22rem; line-height: 1.2; letter-spacing: -.015em; }
.rl .small { display: block; margin-top: 3px; }
.rl::after { content: "›"; float: right; margin-top: -42px; color: var(--flame-d); font-size: 1.3rem; }

.ac { display: block; width: 100%; text-align: left; color: inherit; padding: 18px 0; border-top: 1px solid var(--line); }
.ac:last-of-type { border-bottom: 1px solid var(--line); }
.ac .lbl { display: block; color: var(--flame-d); }
.ac b { display: block; font-family: Newsreader, Georgia, serif; font-weight: 400; font-size: 1.42rem; line-height: 1.16; letter-spacing: -.018em; margin: 7px 0 5px; }

.tools { display: grid; gap: 12px; }
.tl { display: block; width: 100%; text-align: left; color: inherit; background: var(--s1); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.tl .lbl { display: block; color: var(--flame-d); }
.tl b { display: block; font-family: Newsreader, Georgia, serif; font-weight: 400; font-size: 1.22rem; margin: 6px 0 3px; }

/* The reader is the one screen that is only words, so it gets a real measure
   and real leading rather than app spacing. */
.art { max-width: 34em; }
.art h1 { font-size: 2.3rem; margin-bottom: 14px; }
.art .lede { font-family: Newsreader, Georgia, serif; font-size: 1.32rem; font-weight: 300; line-height: 1.38; color: var(--ink); margin-bottom: 22px; }
.art p { margin-bottom: 16px; line-height: 1.62; }
.art p + p { text-indent: 0; }
.art .src { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 26px; font-size: .88rem; color: var(--mute); }
.art .src .lbl { color: var(--flame-d); margin-right: 8px; }
.art .src a { color: var(--ink); }

.ctot { display: flex; gap: 26px; }
.ctot .lbl { display: block; color: var(--mute); margin-top: 4px; }
.num.big { font-size: 2.9rem; line-height: 1; display: block; }
.ctab { width: 100%; border-collapse: collapse; font-size: .95rem; }
.ctab td { border-top: 1px solid var(--line); padding: 12px 0; vertical-align: baseline; }
.ctab td:nth-child(2) { text-align: right; white-space: nowrap; padding-right: 14px; font-size: .82rem; }
.ctab td:last-child { text-align: right; width: 3.4em; font-size: 1.05rem; }

/* ---- Me ---- */
/* The header is the only thing on this screen that is information rather than
   a control, so it is the only thing that looks like a card. */
.mehead { background: var(--clay-l); border-radius: 12px; padding: 18px 18px 16px; margin-bottom: 30px; }
.mehead .mh-n { font-size: 2rem; line-height: 1; }
.mehead .mh-s { display: flex; gap: 22px; margin-top: 16px; }
.mehead .mh-s .lbl { font-size: .54rem; letter-spacing: .13em; }
.mehead .mh-s span { display: block; }
.mehead .mh-s b { display: block; font-size: 1.65rem; line-height: 1; }
.mehead .mh-s .lbl { display: block; color: var(--mute); margin-top: 5px; }

/* A group is a run of hairlines, not a filled box: the eye reads the labels,
   not the container. */
.sgl { display: block; color: var(--flame-d); margin: 0 0 6px 2px; }
.sgroup { border-top: 1px solid var(--line); margin-bottom: 28px; }
.srow { border-bottom: 1px solid var(--line); }
.sr-h { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; color: inherit; padding: 15px 2px; min-height: 54px; }
.sr-l { flex: 1; font-size: 1.02rem; }
.sr-v { color: var(--mute); font-size: .92rem; text-align: right; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-h::after { content: ""; width: 9px; height: 9px; flex: none; border-right: 1.6px solid var(--mute); border-bottom: 1.6px solid var(--mute); transform: rotate(-45deg) translate(-1px, -1px); transition: transform .22s cubic-bezier(.2,.8,.2,1); }
.srow.open .sr-h::after { transform: rotate(45deg) translate(-2px, -2px); }
.srow.open .sr-v { color: var(--flame-d); }
.sr-b { padding: 2px 2px 18px; animation: unfold .26s cubic-bezier(.2,.8,.2,1); }
.sr-b .lbl { display: block; margin-top: 16px; }
.sr-b .rl { margin-top: 16px; }
@keyframes unfold { from { opacity: 0; transform: translateY(-7px); } }

/* tab bar */
#tabs { position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 10px); max-width: 496px; margin: 0 auto; display: flex; background: rgba(253,253,252,.88); box-shadow: 0 6px 24px rgba(33,32,28,.1); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 13px; padding: 5px; z-index: 10; }
#tabs[hidden] { display: none; }
/* The selected tab takes the room it needs and the others give way. The name
   only appears on the one you are on, which is what makes the width change
   mean something rather than just being a wider box.
   flex-grow animates; width on the label does the rest. */
#tabs button { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 0; padding: 11px 0; border-radius: 9px; color: var(--mute); font-family: Archivo, sans-serif; font-size: .6rem; font-weight: 500; font-stretch: 112%; letter-spacing: .11em; text-transform: uppercase; overflow: hidden; transition: flex-grow .36s cubic-bezier(.2,.9,.25,1), background-color .24s, color .24s, gap .36s cubic-bezier(.2,.9,.25,1); }
#tabs button span { max-width: 0; opacity: 0; white-space: nowrap; overflow: hidden; transition: max-width .36s cubic-bezier(.2,.9,.25,1), opacity .22s; }
#tabs button.on { flex-grow: 2.45; gap: 7px; color: var(--paper); background: var(--flame); }
#tabs button.on span { max-width: 92px; opacity: 1; transition: max-width .36s cubic-bezier(.2,.9,.25,1), opacity .3s .1s; }
/* the icon gives a small kick on the way in */
#tabs button.on svg { animation: tabpop .42s cubic-bezier(.2,.9,.25,1); }
@keyframes tabpop { 0% { transform: scale(.72); } 55% { transform: scale(1.1); } 100% { transform: none; } }
#tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* bottom sheet */
.back { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 20; animation: fade .25s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto; max-height: 86vh; overflow: auto; background: var(--s1); border-radius: 10px 18px 0 0; padding: 14px 22px calc(env(safe-area-inset-bottom) + 24px); z-index: 21; animation: up .35s cubic-bezier(.2,.8,.2,1); }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 18px; }
.sheet ol { padding: 0; margin: 16px 0 22px; list-style: none; counter-reset: n; }
.sheet li { counter-increment: n; display: flex; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: .95rem; }
.sheet li::before { content: counter(n); color: var(--flame); font-weight: 700; width: 18px; flex: none; }
.sheet li span { margin-left: auto; color: var(--mute); }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

/* session */
.sess { position: fixed; inset: 0; z-index: 30; background: var(--tone); color: var(--dark); display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 14px) 22px calc(env(safe-area-inset-bottom) + 26px); animation: fade .4s; overflow: hidden; }
.sess .segs { flex: none; }
.sess .segs i { background: rgba(0,0,0,.14); }
.sess .segs i.on, .sess .segs i b { background: var(--dark); }
.sess .segs i b { position: absolute; inset: 0 auto 0 0; display: block; transition: width 1s linear; }
.s-top { position: relative; display: flex; justify-content: space-between; align-items: center; margin: 14px 0; font-weight: 600; }
/* The cross fills as you hold it. isolation keeps the fill's z-index inside the
   button so it paints under the glyph instead of over it. */
.s-top .x { width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.1); font-size: 1.1rem; position: relative; overflow: hidden; isolation: isolate; touch-action: none; }
.s-top .x .hf { position: absolute; inset: 0; z-index: -1; background: rgba(0,0,0,.3); transform: scaleX(0); transform-origin: left center; }
.s-top .x.holding { background: rgba(0,0,0,.16); }
.s-hint { position: absolute; left: 2px; top: 46px; font-size: .76rem; font-weight: 600; white-space: nowrap; opacity: 0; transform: translateY(-5px); transition: opacity .2s, transform .2s; pointer-events: none; }
.s-hint.on { opacity: .85; transform: none; }
.s-mid { position: relative; flex: none; height: 270px; display: grid; place-items: center; margin-top: 4px; }
.breath { position: absolute; width: 250px; height: 250px; border-radius: 50%; background: rgba(255,255,255,.3); animation: breath 6s ease-in-out infinite; }
.sess.paused .breath { animation-play-state: paused; }
@keyframes breath { 50% { transform: scale(.78); } }
.ring { position: absolute; width: 230px; height: 230px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .t { stroke: rgba(0,0,0,.12); }
.ring .p { stroke: var(--dark); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
#s-num { font-size: 5rem; line-height: 1; position: relative; }
/* The drawn move, above the timer. It takes whatever height is left over, so a
   small phone gives it less rather than pushing the controls off screen. */
.s-fig { flex: 1 1 auto; min-height: 90px; display: grid; place-items: center; margin: 8px 0 0; }
.s-fig svg { width: 100%; height: 100%; max-height: 200px; color: var(--dark); }
.s-fig path { display: none; }
.sess:has(.s-fig) .s-mid { height: 186px; }
.sess:has(.s-fig) .ring { width: 164px; height: 164px; }
.sess:has(.s-fig) .breath { width: 178px; height: 178px; }
.sess:has(.s-fig) #s-num { font-size: 3.4rem; }
.sess:has(.s-fig) .s-step { font-size: 1.5rem; min-height: 2.4em; margin-top: 12px; }
.s-step { font-size: 1.8rem; text-align: left; margin-top: 16px; min-height: 3.2em; }
.s-next { text-align: left; opacity: .82; font-size: .9rem; margin-top: 4px; }
.s-next .lbl { color: var(--flame-d); margin-right: 7px; }
.s-ctl { margin-top: auto; display: flex; justify-content: center; align-items: center; gap: 22px; }
.s-ctl .sb { width: 54px; height: 54px; border-radius: 50%; background: rgba(0,0,0,.1); display: grid; place-items: center; }
.s-ctl .pb { width: 88px; height: 88px; border-radius: 50%; background: var(--dark); color: var(--flame); display: grid; place-items: center; }
.s-ctl svg { width: 28px; height: 28px; fill: currentColor; }
.fin { display: flex; flex-direction: column; min-height: calc(100vh - 150px); justify-content: center; text-align: center; gap: 14px; }
.fin .big { font-size: 6rem; color: var(--flame); }

/* forms and chat */
.card { background: var(--s1); border-radius: 12px; padding: 18px; margin-bottom: 14px; }
.card h3 { font-size: 1.15rem; margin-bottom: 12px; }
.card .lbl { margin: 14px 0 8px; font-size: .88rem; color: var(--mute); }
.lrow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.walkhero { position: relative; overflow: hidden; background: var(--clay-l); color: var(--ink); border-radius: 12px; padding: 22px; margin-bottom: 14px; min-height: 210px; display: flex; flex-direction: column; justify-content: flex-end; }
.walkhero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.walkhero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(28,24,18,.5) 0%, rgba(28,24,18,.08) 32%, rgba(28,24,18,.74) 100%); }
.walkhero > *:not(img) { position: relative; z-index: 2; color: #fff; }
.walkhero h2 { font-size: 2.1rem; margin: 6px 0; }
.msgs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.b { max-width: 86%; padding: 12px 16px; border-radius: 10px; background: var(--s1); align-self: flex-start; border-bottom-left-radius: 6px; }
.b.me { align-self: flex-end; background: var(--flame); color: var(--paper); border-radius: 10px; border-bottom-right-radius: 6px; }
.b .btn { margin-top: 10px; min-height: 44px; font-size: .92rem; }
.chatbar { position: sticky; bottom: calc(env(safe-area-inset-bottom) + 84px); display: flex; gap: 8px; background: var(--bg); padding: 8px 0; }
.chatbar .input { border-radius: 999px; }
.chatbar .btn { width: 52px; min-height: 52px; padding: 0; flex: none; }
.dots3 span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: var(--mute); animation: bl 1s infinite; }
.dots3 span:nth-child(2) { animation-delay: .15s; } .dots3 span:nth-child(3) { animation-delay: .3s; }
@keyframes bl { 50% { opacity: .2; transform: translateY(-3px); } }
.stepedit { display: flex; align-items: center; gap: 8px; background: var(--s1); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.stepedit .nm { flex: 1; font-size: .95rem; }
.stepedit button { width: 36px; height: 36px; border-radius: 50%; background: var(--s2); flex: none; }

/* numbers: Archivo stretched wide, like a scoreboard, with digits that do not
   jiggle as they count down */
.num, #s-num, .rt .m, .jkm, .fin .big, .week .big { font-family: Archivo, system-ui, sans-serif; font-weight: 700; font-stretch: 125%; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* splash */
/* Black, because the supplied film is black to its own edges: letterboxing it
   on anything else would draw a visible rectangle around the logo. */
#splash { position: fixed; inset: 0; z-index: 100; background: #000; display: grid; place-items: center; transition: opacity .45s; }
#splash.out { opacity: 0; pointer-events: none; }

/* The film, as one tall image of 35 stacked frames, played by stepping the
   background down it. An image animates unconditionally; a video has to ask.
   The box is given the frames' own aspect ratio so each step lands exactly on
   a frame rather than halfway between two. */
#sp-i {
  width: min(58vw, 38vh); aspect-ratio: 384 / 513; border-radius: 12%;
  background: url(belz-splash.jpg) center top / 100% 3500% no-repeat;
  transform-origin: 50% 46%; will-change: transform, background-position;
  animation: sp-run 2.4s steps(35, jump-none) forwards,
             sp-zoom 2.4s cubic-bezier(.55, .02, .88, .24) forwards;
  animation-play-state: paused;          /* until the strip has decoded */
}
#splash.go #sp-i { animation-play-state: running; }

/* jump-none is what makes the last step land on the last frame instead of one
   short of it: it spreads 35 values from 0 to 1 inclusive. */
@keyframes sp-run { to { background-position: center bottom; } }

/* Still for the first half, then pulled towards you - slow at first, fast at
   the end. An ease-IN, the opposite of the usual curve, which is what makes it
   feel like it is coming at you rather than settling down. */
@keyframes sp-zoom { 0%, 50% { transform: scale(1); } to { transform: scale(2.9); } }

@media (prefers-reduced-motion: reduce) {
  #sp-i { animation: none !important; }
  *, *::before, *::after { animation-duration: .01s !important; animation-delay: 0s !important; transition-duration: .01s !important; }
}

/* Dark: navy rather than neutral black, so it stays warm next to the photos.
   The accent goes brighter here and its labels go dark, because paper on a
   bright orange measures 2.8:1 while ink on it measures 7:1. */
:root[data-theme="dark"] {
  /* The first dark theme was a warm orange over warm beige panels on navy:
     three temperatures fighting, which is what read as assembled rather than
     chosen. This one holds a single cool axis - ink navy through to off-white -
     and spends the warmth only on the accent. */
  --bg: #0d1414;
  --s1: #151e1e;
  --s2: #1e2928;
  --ink: #e6ecea;
  --mute: #90a09e;
  /* The same petrol, lifted enough to read on near-black while still
     carrying white text at 4.66:1 on the active tab and the pressed pills. */
  --flame: #17807f;
  --flame-d: #5fc3bf;   /* small labels, which need the lighter step */
  --clay: #7fa4a0;
  --clay-l: #16201f;
  --paper: #fdfdfc;     /* what sits on top of the accent */
  --dark: #e6ecea;      /* tone panels are dark here, so their text is light */
  --line: #243030;
}
:root[data-theme="dark"] body { background-image: none; }
:root[data-theme="dark"] #tabs { background: rgba(21,30,30,.92); box-shadow: 0 6px 24px rgba(0,0,0,.45); }
:root[data-theme="dark"] .mast::after { background: linear-gradient(180deg, rgba(6,12,12,.45) 0%, rgba(6,12,12,.1) 38%, rgba(13,20,20,.6) 76%, var(--bg) 99%); }
:root[data-theme="dark"] .rt { background: var(--s1); }
:root[data-theme="dark"] .mast .pill { background: rgba(21,30,30,.9); color: var(--ink); }
/* Everything below assumed a pale tone panel: a tinted track, a white breath
   ring, a dark scrim on the buttons. On a dark panel each one has to flip. */
:root[data-theme="dark"] .ring .t { stroke: rgba(255,255,255,.14); }
:root[data-theme="dark"] .breath { background: rgba(255,255,255,.05); }
:root[data-theme="dark"] .s-top .x { background: rgba(255,255,255,.1); }
:root[data-theme="dark"] .s-top .x .hf { background: rgba(255,255,255,.26); }
:root[data-theme="dark"] .s-top .x.holding { background: rgba(255,255,255,.16); }
:root[data-theme="dark"] .s-ctl .sb { background: rgba(255,255,255,.1); }
:root[data-theme="dark"] .segs i { background: rgba(255,255,255,.16); }
:root[data-theme="dark"] .sess .segs i { background: rgba(255,255,255,.16); }
:root[data-theme="dark"] .sess .segs i.on, :root[data-theme="dark"] .sess .segs i b { background: var(--ink); }
:root[data-theme="dark"] .xf { background: var(--s2); }
:root[data-theme="dark"] .mehead { background: var(--s1); }
:root[data-theme="dark"] .jbar { background: rgba(255,255,255,.16); }
:root[data-theme="dark"] .nextcard .nm { color: var(--mute); }
