/* The app, drawn: a phone and Driff's own screens as the app draws them in Stone, its default
   theme (src/theme.ts): the site's warm basalt ground and alabaster ink, glass under the one card
   that leads a screen, hairlines, colour only for meaning. Laid out on a 300 × 630 phone; --u is
   one of its points. Everything is scoped under .phone so short names (.ring, .now…) can't meet
   a page's own classes. A story shows screen .sN while its track has the class b-N. */

.device { position: relative; }
.device::before { /* light behind the phone */
  content: ""; position: absolute; inset: -30% -45%; z-index: -1;
  background: radial-gradient(closest-side, rgba(243, 178, 94, .16), transparent 70%);
}
.phone {
  --u: calc(100cqh / 630);
  /* Stone (src/theme.ts) */
  --p-ink: #f4ede2; --p-muted: #8c8377; --p-faint: #5d564d; --p-line: #1d1b19; --p-line-2: #2d2b29;
  --p-track: rgba(244, 237, 226, .07); --p-glass: rgba(244, 237, 226, .04); --p-edge: rgba(244, 237, 226, .1); --p-shine: rgba(244, 237, 226, .12);
  position: relative; height: min(640px, calc(100svh - 150px)); aspect-ratio: 300 / 630; container-type: size;
  border-radius: 15.5% / 7.4%; font-family: var(--sans); color: var(--p-ink);
  background: linear-gradient(150deg, #3a332c 0%, #15120f 22%, #0d0b0a 60%, #2a231d 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 228, 196, .14), inset 0 0 0 3px #0c0a09, 0 50px 120px -30px rgba(0, 0, 0, .95), 0 0 0 1px rgba(0, 0, 0, .6);
}
/* The screen: Stone's ground, with the light from above */
.phone::before {
  content: ""; position: absolute; inset: 1.45% 3.1%; border-radius: 14.4% / 6.9%;
  background: radial-gradient(120% 45% at 50% -8%, rgba(243, 178, 94, .075), transparent 70%), #0a0908;
}
.phone .island { position: absolute; z-index: 3; top: calc(var(--u) * 20); left: 50%; width: calc(var(--u) * 88); height: calc(var(--u) * 25); transform: translateX(-50%); border-radius: 99px; background: #000; box-shadow: 0 0 0 1px rgba(255, 255, 255, .05); }
.phone .scr {
  position: absolute; inset: calc(var(--u) * 62) calc(var(--u) * 24) calc(var(--u) * 80);
  font-size: calc(var(--u) * 15);
  opacity: 0; transform: translateY(calc(var(--u) * 14)); transition: opacity .55s var(--ease), transform .7s var(--ease);
}
.phone .scr.full { inset: calc(var(--u) * 9) calc(var(--u) * 9.3); border-radius: calc(var(--u) * 41); overflow: hidden; }
.b-0 .phone .s0, .b-1 .phone .s1, .b-2 .phone .s2, .b-3 .phone .s3 { opacity: 1; transform: none; }
.phone .lbl { font-size: calc(var(--u) * 9.5); letter-spacing: .16em; text-transform: uppercase; color: var(--p-muted); }
.phone .ttl { font-size: calc(var(--u) * 26); font-weight: 300; letter-spacing: -.01em; margin: calc(var(--u) * 4) 0 calc(var(--u) * 18); }
.phone .muted { color: var(--p-muted); }
.phone .faint { color: var(--p-faint); }
/* Glass: the one card that leads a screen (components/Glass.tsx) */
.phone .glass { border-radius: calc(var(--u) * 18); background: var(--p-glass); box-shadow: inset 0 0 0 1px var(--p-edge), inset 0 1px 0 var(--p-shine); }

/* Settings → Areas: a rough amount a week, nudged with − and + */
.phone .back { display: flex; align-items: center; gap: calc(var(--u) * 6); font-size: calc(var(--u) * 12); color: var(--p-muted); margin-bottom: calc(var(--u) * 18); }
.phone .back svg { width: calc(var(--u) * 13); height: calc(var(--u) * 13); fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.phone .group-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: calc(var(--u) * 8); }
.phone .group-head span:last-child { font-size: calc(var(--u) * 11.5); letter-spacing: 0; text-transform: none; color: var(--p-ink); }
.phone .amounts { list-style: none; padding: 0 calc(var(--u) * 14); }
.phone .amounts li { display: flex; align-items: center; height: calc(var(--u) * 50); border-bottom: 1px solid var(--p-line); font-size: calc(var(--u) * 15.5); }
.phone .amounts li:last-child { border-bottom: 0; }
.phone .amounts span { flex: 1; }
.phone .amounts b { width: calc(var(--u) * 34); text-align: center; font-weight: 400; font-size: calc(var(--u) * 13); }
.phone .amounts i { display: grid; place-items: center; width: calc(var(--u) * 24); height: calc(var(--u) * 24); border-radius: 50%; box-shadow: inset 0 0 0 1px var(--p-line-2); font-style: normal; font-size: calc(var(--u) * 13); line-height: 1; color: var(--p-muted); }
.phone .note { margin-top: calc(var(--u) * 10); font-size: calc(var(--u) * 11); line-height: 1.5; color: var(--p-muted); }

/* Now: what's pulling hardest, then the rest of the week ranked */
.phone .date { font-size: calc(var(--u) * 9.5); letter-spacing: .16em; text-transform: uppercase; color: var(--p-muted); margin-bottom: calc(var(--u) * 14); }
.phone .pull { position: relative; padding: calc(var(--u) * 18) calc(var(--u) * 18) calc(var(--u) * 14); }
.phone .pull .lbl { font-size: calc(var(--u) * 8.5); }
.phone .pull-name { margin-top: calc(var(--u) * 8); font-size: calc(var(--u) * 28); font-weight: 400; letter-spacing: -.02em; line-height: 1.05; }
.phone .pull-why { margin-top: calc(var(--u) * 6); max-width: 62%; font-size: calc(var(--u) * 11); line-height: 1.45; color: var(--p-muted); }
.phone .mini-ring { position: absolute; right: calc(var(--u) * 18); top: calc(var(--u) * 34); width: calc(var(--u) * 66); aspect-ratio: 1; display: grid; place-items: center; text-align: center; }
.phone .mini-ring svg { position: absolute; inset: 0; width: 100%; transform: rotate(-90deg); }
.phone .mini-ring circle { fill: none; stroke-width: 2.5; }
.phone .mini-ring .track { stroke: var(--p-track); }
.phone .mini-ring .arc { stroke: var(--alert); stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: .82; }
.phone .mini-ring b { display: block; font-weight: 400; font-size: calc(var(--u) * 13); }
.phone .mini-ring small { display: block; font-size: calc(var(--u) * 8.5); color: var(--p-muted); }
.phone .acts { display: flex; gap: calc(var(--u) * 8); margin-top: calc(var(--u) * 16); }
.phone .acts span { flex: 1; display: grid; place-items: center; height: calc(var(--u) * 36); border-radius: 99px; font-size: calc(var(--u) * 12.5); box-shadow: inset 0 0 0 1px var(--p-line-2); }
.phone .acts .solid { background: var(--p-ink); color: #15120f; box-shadow: none; }
.phone .log { margin-top: calc(var(--u) * 12); text-align: center; font-size: calc(var(--u) * 10.5); color: var(--p-muted); }
.phone .group { margin: calc(var(--u) * 20) 0 calc(var(--u) * 4); }
.phone .now { list-style: none; }
.phone .now li { padding: calc(var(--u) * 10) 0 0; }
.phone .now p { display: flex; align-items: baseline; gap: calc(var(--u) * 7); font-size: calc(var(--u) * 15.5); }
.phone .now p small { font-size: calc(var(--u) * 10.5); color: var(--p-muted); }
.phone .now p em { margin-left: auto; font-style: normal; font-size: calc(var(--u) * 11); color: var(--p-ink); }
.phone .meter { display: block; position: relative; height: 1.5px; margin-top: calc(var(--u) * 9); background: var(--p-track); }
.phone .meter::before { content: ""; position: absolute; inset: 0; background: var(--c); opacity: .3; } /* the rest of the line, in the row's colour */
.phone .meter b { position: relative; display: block; height: 100%; width: var(--w); background: var(--c); transform-origin: left; transform: scaleX(0); transition: transform 1.1s var(--ease); }
.b-1 .phone .meter b { transform: none; }
.phone .now li:nth-child(2) .meter b { transition-delay: .08s; }
.phone .now li:nth-child(3) .meter b { transition-delay: .16s; }

/* A session's ring (app/(tabs)/index.tsx, components/Ring.tsx) */
.phone .ring { position: relative; width: calc(var(--u) * 236); margin: calc(var(--u) * 30) auto 0; aspect-ratio: 1; }
.phone .ring svg { width: 100%; transform: rotate(-90deg); overflow: visible; }
.phone .ring circle { fill: none; stroke-width: 2.5; }
.phone .ring .track { stroke: var(--p-track); }
.phone .ring .arc { stroke: var(--rc, var(--alert)); stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--fill, 0)); filter: drop-shadow(0 0 calc(var(--u) * 6) var(--rc, var(--alert))); }
.phone .ring .face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.phone .ring .area { color: var(--p-muted); font-size: calc(var(--u) * 14); margin-top: calc(var(--u) * 5); }
.phone .ring .clock { font-size: calc(var(--u) * 54); font-weight: 200; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.phone .ring .to { color: var(--p-muted); font-size: calc(var(--u) * 11); }
.phone .bellpill { display: flex; align-items: center; gap: calc(var(--u) * 6); width: fit-content; margin: calc(var(--u) * 30) auto 0; padding: calc(var(--u) * 7) calc(var(--u) * 13); border-radius: 99px; box-shadow: inset 0 0 0 1px var(--p-line-2); font-size: calc(var(--u) * 11); color: var(--p-muted); }
.phone .bellpill svg, .phone .ctl svg { width: calc(var(--u) * 12); height: calc(var(--u) * 12); fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.phone .ctl { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: calc(var(--u) * 10); }
.phone .ctl i { flex: none; display: grid; place-items: center; width: calc(var(--u) * 42); height: calc(var(--u) * 42); border-radius: 50%; box-shadow: inset 0 0 0 1px var(--p-line-2); }
.phone .ctl i svg { width: calc(var(--u) * 15); height: calc(var(--u) * 15); }
.phone .ctl span { flex: 1; display: grid; place-items: center; height: calc(var(--u) * 42); border-radius: 99px; box-shadow: inset 0 0 0 1px var(--p-line-2); font-size: calc(var(--u) * 13); }
/* The kit's buttons: solid (ink) and outline, full width at the foot of a screen */
.phone .foot-btn { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; padding: calc(var(--u) * 12) 0; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--p-line-2); font-size: calc(var(--u) * 14); }
.phone .foot-btn.solid { background: var(--p-ink); color: #15120f; box-shadow: none; }

/* Tab bar: Now, Calendar, Capture, Journal, Rhythm */
.phone .tabs { position: absolute; z-index: 2; left: calc(var(--u) * 30); right: calc(var(--u) * 30); bottom: calc(var(--u) * 30); display: flex; justify-content: space-between; }
.phone .tabs i { position: relative; width: calc(var(--u) * 20); }
.phone .tabs svg { display: block; width: 100%; fill: none; stroke: var(--p-faint); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.phone .tabs .on svg { stroke: var(--p-ink); }
.phone .tabs .cap svg { stroke: var(--p-ink); } /* Capture is an action, always lit */
.phone .tabs .on::after { content: ""; position: absolute; left: 50%; bottom: calc(var(--u) * -9); width: calc(var(--u) * 4); height: calc(var(--u) * 4); margin-left: calc(var(--u) * -2); border-radius: 50%; background: var(--p-ink); }

/* Rows of a list (foods, sets…), hairline separated */
.phone .rows { list-style: none; }
.phone .rows li { display: flex; justify-content: space-between; align-items: baseline; gap: calc(var(--u) * 10); padding: calc(var(--u) * 11) 0; border-bottom: 1px solid var(--p-line); font-size: calc(var(--u) * 14.5); }
.phone .rows small { display: block; color: var(--p-muted); font-size: calc(var(--u) * 11); margin-top: calc(var(--u) * 2); }
.phone .rows .kcal { font-weight: 300; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .phone .scr, .phone .meter b { transition-duration: .01s !important; transition-delay: 0s !important; }
}
