/* Hallmark · shape: Thread and Clock (a live chat on a wine stage, a tour of the real portal by capability, the clinic's day scrubbed by scroll, four languages, the client app playing five real flows, three promises, the walkthrough) · genre: modern-minimal · theme: custom (brand: Rumman D243/D244) · job: sign up (ask for a walkthrough) · idea: "One clinic's WhatsApp, answered in the dietitian's voice and at the right hour: the page is a conversation and a clock" · vibe: "warm, trusted, local, alive, quietly premium"
 * paper: oklch(97.73% 0.0102 81.8) · accent: oklch(45.57% 0.1467 10.53) · display: Rethink Sans · body: Figtree · arabic: IBM Plex Sans Arabic · hero: the head left; right, a wine stage with the gradient pomegranate where a sample WhatsApp thread plays (photo, voice note, Arabizi) and the client's message glides into the portal strip, where it becomes the record · nav: sticky, lockup left, four anchors, sign in and one quiet action · footer: the bilingual lockup and the links · imagery: the product (portal and client-app captures with demo data, clinic renamed "Your clinic"), the meal bank's own dish photos multiplied onto their surfaces · signature: the thread the visitor drives, landing its result in the dietitian's portal
 * axes: light/grotesk-sans/chromatic-garnet · posture: committed (the hero stage, quiet hours and the promise band carry the Rumman dark roles; garnet stays a signal) · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S5 R3 V4 · weakest: R, the owner asked for more wow; kept every new piece to real product material (captures, real times, real facts) and cut decoration that says nothing */
/* Hallmark · waive 47b · four client-app captures, no device chrome · the Rumman client app is the thing being shown */
/* Hallmark · waive 24b · one 13px nudge centres the slider thumb on its 2px track · the day slider needs its thumb on the line */
/* Hallmark · answered F5 · the portal strip's state marks: waiting is the portal's lemon, done is the herb check */
/* Hallmark · answered F7 · the round tiles are the clinic avatar, the voice note's play button and the strip's state marks, all round in the product too */
/* Hallmark · dismissed 25 · the 24ch measure is on the three promises set at display size, one sentence each */
/* Hallmark · dismissed 49 · each tour tab is a capability's name with its one-line explanation, read as a list, so it wraps on purpose */
/* Hallmark · dismissed 58 · the extra words are the one-line explanation under each portal tab and app chapter, which the owner asked for so every capability is stated plainly */
/* Hallmark · dismissed 29 · the nav's blur sits over ivory sections and product captures; it is a reading aid, not a glow */
@import url("./tokens.css");
@import url("./base.css");

:root { --nav-h: 72px; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + var(--space-lg)); }
body { font-size: var(--text-md); line-height: 1.6; font-synthesis: none; }
[lang="ar"], [dir="rtl"] { font-family: var(--font-outlier); }
h1, h2, h3 { font-weight: 600; letter-spacing: var(--tracking-display); color: var(--color-ink); }
h2 { font-size: var(--text-section); line-height: 1.04; max-width: 18ch; }
h3 { font-size: var(--text-title); line-height: 1.2; letter-spacing: -0.015em; }
strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }

.skip { position: absolute; left: var(--space-md); top: var(--space-md); z-index: var(--z-toast); padding: var(--space-xs) var(--space-md); background: var(--color-ink); color: var(--color-paper); border-radius: var(--radius-pill); transform: translateY(-200%); }
.skip:focus-visible { transform: none; }

/* Buttons: one filled style; the nav's is outlined and quieter. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); min-height: 52px; padding: 0 var(--space-lg); border-radius: var(--radius-control); font-weight: 600; font-size: var(--text-md); text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.btn-primary { background: var(--color-accent); color: var(--color-accent-ink); }
.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-1px); }
.btn-primary:active { background: var(--color-accent-pressed); transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-quiet { white-space: nowrap; min-height: 44px; padding: 0 var(--space-md); color: var(--color-accent); border-color: var(--color-control); background: transparent; font-size: var(--text-sm); }
.btn-quiet:hover { border-color: var(--color-accent); background: var(--color-accent-tint); }
.btn-quiet:active { transform: translateY(1px); }
.link-more { font-weight: 600; color: var(--color-ink); text-decoration: underline; text-decoration-color: var(--color-control); text-underline-offset: 0.3em; padding-block: var(--space-sm); border-radius: var(--space-2xs); transition: text-decoration-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.link-more:hover { color: var(--color-accent); text-decoration-color: var(--color-accent); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }

/* Nav */
.nav { position: sticky; top: 0; z-index: var(--z-sticky-nav); height: var(--nav-h); background: var(--color-scrim); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); box-shadow: 0 1px 0 transparent; transition: box-shadow var(--dur-short) var(--ease-out); }
.nav.is-scrolled { box-shadow: 0 1px 0 var(--color-rule); }
.nav-row { height: 100%; display: flex; align-items: center; gap: var(--space-xl); }
.nav-home { display: block; flex-shrink: 0; border-radius: var(--space-xs); }
.nav-home img { height: 36px; width: auto; }
.nav-links { display: flex; gap: var(--space-lg); margin-inline-start: auto; }
.nav-links a, .nav-signin { font-size: var(--text-sm); color: var(--color-ink-2); text-decoration: none; padding-block: var(--space-xs); border-radius: var(--space-2xs); transition: color var(--dur-micro) var(--ease-out); }
.nav-links a:hover, .nav-signin:hover { color: var(--color-accent); }
.nav-links a[aria-current="true"] { color: var(--color-accent); }
.nav-actions { display: flex; align-items: center; gap: var(--space-lg); }
.lang-switch { display: flex; gap: var(--space-3xs); }
.lang-switch a { display: grid; place-items: center; min-width: 32px; min-height: 32px; padding: 0 var(--space-2xs); border-radius: var(--radius-pill); font-size: var(--text-sm); color: var(--color-ink-2); text-decoration: none; transition: color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out); }
.lang-switch a[lang="ar"] { font-family: var(--font-outlier); font-size: var(--text-md); }
.lang-switch a:hover { color: var(--color-accent); }
.lang-switch a[aria-current="true"] { background: var(--color-paper-3); color: var(--color-ink); font-weight: 600; }
/* Arabic: no negative tracking (it breaks the joins), a looser line for the taller script, the time axis left to right. */
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3, :lang(ar) .say blockquote, :lang(ar) .promises p, :lang(ar) .tt-name, :lang(ar) .ch-name, :lang(ar) .points dt { letter-spacing: 0; }
:lang(ar) .hero h1 { line-height: 1.2; max-width: 13ch; }
:lang(ar) h2, :lang(ar) .promises p { line-height: 1.3; }
/* Times and figures read left to right in every language; the clock keeps its place at the reading start. */
.clock, .reel { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .clock { text-align: right; justify-content: flex-end; }
[dir="rtl"] .langs-list button[aria-selected="true"] { transform: translateX(calc(var(--space-md) * -1)); }
[dir="rtl"] .tour-tabs button { border-radius: var(--space-xs) 0 0 var(--space-xs); }

/* ---------- Hero ---------- */
.hero { min-height: calc(100dvh - var(--nav-h)); display: grid; align-items: center; padding-block: var(--space-lg) var(--space-2xl); }
.hero-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); align-items: center; }
.hero-copy { grid-column: 1 / span 6; display: grid; gap: var(--space-lg); align-content: center; }
.hero h1 { font-size: clamp(2.75rem, 4.6vw + 1rem, 5.75rem); line-height: 0.98; letter-spacing: -0.04em; max-width: 11ch; }
.lede { font-size: var(--text-lead); color: var(--color-ink-2); max-width: 30ch; line-height: 1.5; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-lg); padding-top: var(--space-xs); }

/* The stage: the Rumman dark roles, the gradient pomegranate (marketing use, D243) bleeding off its corner. */
.stage { grid-column: 7 / -1; position: relative; margin: 0; padding: var(--space-xl) var(--space-xl) var(--space-lg); background: var(--color-night); border-radius: 40px; overflow: clip; display: grid; gap: var(--space-md); isolation: isolate; }
.stage-mark { position: absolute; z-index: -1; width: 380px; height: auto; inset-inline-end: -110px; bottom: -90px; opacity: 0.95; pointer-events: none; }
.thread-chat { position: relative; background: var(--color-paper-2); border-radius: calc(40px - var(--space-xl) + var(--space-md)); box-shadow: 0 30px 60px -30px var(--color-shadow-night); overflow: hidden; }
.thread-head { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--color-rule); }
.tile { flex-shrink: 0; width: 40px; height: 40px; border-radius: var(--radius-pill); display: grid; place-items: center; background: var(--color-ink); color: var(--color-paper); font-size: var(--text-xs); font-weight: 600; }
.tile-s { width: 28px; height: 28px; font-size: 0.6875rem; }
.thread-who { display: grid; line-height: 1.25; min-width: 0; }
.thread-who strong { font-size: var(--text-md); }
.thread-state { font-size: var(--text-xs); color: var(--color-muted); transition: color var(--dur-short) var(--ease-out); }
.thread-state.is-typing { color: var(--color-success); }
.thread-log { list-style: none; margin: 0; padding: var(--space-lg) var(--space-lg) var(--space-3xl); height: 430px; display: flex; flex-direction: column; justify-content: flex-end; gap: var(--space-sm); background: var(--color-paper); overflow: hidden; }

.msg { max-width: 84%; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-inner); font-size: var(--text-sm); line-height: 1.5; color: var(--color-ink); }
.msg-client { align-self: flex-end; background: var(--color-bubble-in); border-end-end-radius: var(--space-2xs); }
.msg-clinic { align-self: flex-start; background: var(--color-bubble-out); border: 1px solid var(--color-rule); border-end-start-radius: var(--space-2xs); }
.msg-photo { padding: var(--space-xs); display: grid; gap: var(--space-xs); width: 210px; }
.msg-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: calc(var(--radius-inner) - var(--space-xs)); }
.msg-photo span { padding: 0 var(--space-xs) var(--space-2xs); }
.msg-voice { display: grid; gap: var(--space-xs); width: 260px; }
.voice-row { display: flex; align-items: center; gap: var(--space-sm); }
.voice-play { flex-shrink: 0; width: 32px; height: 32px; border-radius: var(--radius-pill); background: var(--color-ink); display: grid; place-items: center; }
.voice-play svg { width: 14px; height: 14px; fill: var(--color-paper); }
.wave { display: flex; align-items: center; gap: var(--space-2xs); height: 28px; flex: 1; }
.wave i { display: block; width: 3px; height: 100%; border-radius: 2px; background: var(--color-ink-2); transform: scaleY(var(--h)); opacity: 0.7; }
.voice-time { font-size: var(--text-xs); color: var(--color-muted); }
.voice-text { font-size: var(--text-sm); color: var(--color-ink-2); border-top: 1px solid var(--color-rule); padding-top: var(--space-xs); }
.msg[dir="rtl"] { text-align: right; }
.msg.is-new { animation: msg-in var(--dur-long) var(--ease-out) both; }
.msg-client.is-new { transform-origin: 100% 100%; }
.msg-clinic.is-new { transform-origin: 0% 100%; }
@keyframes msg-in { from { opacity: 0; transform: translateY(14px) scale(0.94); } to { opacity: 1; transform: none; } }
.msg.is-leaving { animation: msg-out 180ms var(--ease-in) both; }
@keyframes msg-out { to { opacity: 0; transform: translateY(-8px); filter: blur(4px); } }

/* The portal strip: ivory on the stage, overlapping the chat's foot. */
.thread-desk { position: relative; z-index: 2; margin: calc(var(--space-3xl) * -1 + var(--space-md)) var(--space-lg) 0; min-height: 72px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: var(--space-md); padding: var(--space-sm) var(--space-lg); background: var(--color-paper-3); color: var(--color-ink); border-radius: var(--radius-inner); box-shadow: 0 18px 36px -18px var(--color-shadow-night); }
.thread-desk.is-landed { animation: desk-pulse 520ms var(--ease-out); }
@keyframes desk-pulse { 0% { transform: scale(1); } 40% { transform: scale(1.02); } 100% { transform: scale(1); } }
.desk-where { font-size: var(--text-xs); color: var(--color-muted); white-space: nowrap; }
.desk-line { font-size: var(--text-sm); line-height: 1.4; display: flex; align-items: center; gap: var(--space-sm); min-width: 0; }
.desk-line.is-new { animation: desk-in var(--dur-long) var(--ease-out) both; }
@keyframes desk-in { from { opacity: 0; transform: translateY(6px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.desk-icon { flex-shrink: 0; width: 28px; height: 28px; border-radius: var(--radius-pill); display: grid; place-items: center; background: var(--color-success-surface); }
.desk-icon svg { width: 16px; height: 16px; fill: none; stroke: var(--color-success); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.desk-icon.is-waiting { background: var(--color-lemon); }
.desk-icon.is-waiting svg { stroke: var(--color-ink); }

/* Rumman's micro-mark at work (D249): it rocks on its base while the seed ripens and empties. */
.mark-wait { flex-shrink: 0; width: 22px; height: 25px; }
.mark-wait .fruit { fill: var(--color-accent); transform-box: fill-box; transform-origin: 50% 100%; animation: rock 2.4s var(--ease-in-out) infinite; }
.mark-wait .seed { fill: var(--color-seed); transform-box: fill-box; transform-origin: 50% 50%; animation: seed 2.4s var(--ease-in-out) infinite; }
@keyframes rock { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes seed { 0%, 100% { opacity: 0; transform: scale(0.55); } 50% { opacity: 1; transform: scale(1); } }

.thread-pick { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: var(--space-xs); padding-top: var(--space-xs); }
.pick { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: 44px; padding: 0 var(--space-md); border-radius: var(--radius-pill); border: 1px solid var(--color-night-rule); background: var(--color-night); color: var(--color-night-ink); font-size: var(--text-sm); cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.pick svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.pick:hover { border-color: var(--color-night-accent); }
.pick:active { transform: translateY(1px); }
.pick[aria-pressed="true"] { background: var(--color-night-ink); border-color: var(--color-night-ink); color: var(--color-ink); }
.pick:focus-visible, .stage :focus-visible { outline-color: var(--color-night-focus); }

/* The hero's one settle. */
.settle { animation: settle 700ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 80ms); }
@keyframes settle { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* The one reveal (visible without script). */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* Section heads */
.section-head { display: grid; gap: var(--space-md); }
.section-head p { font-size: var(--text-lead); color: var(--color-ink-2); max-width: 40ch; line-height: 1.5; }
.section-head.split { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); align-items: end; margin-bottom: var(--space-3xl); }
.section-head.split h2 { grid-column: 1 / span 7; }
.section-head.split p { grid-column: 9 / span 4; }

/* ---------- The dietitian's side: a tour of the portal ---------- */
.tour { background: var(--color-paper-2); padding-block: var(--section-gap) var(--section-gap-s); }
.tour-body { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); align-items: start; }
.tour-tabs { grid-column: 1 / span 4; display: grid; gap: var(--space-2xs); position: sticky; top: calc(var(--nav-h) + var(--space-xl)); }
.tour-tabs button { display: grid; gap: var(--space-2xs); text-align: start; background: none; border: 0; border-inline-start: 2px solid var(--color-rule); padding: var(--space-md) var(--space-lg); color: var(--color-ink); cursor: pointer; border-radius: 0 var(--space-xs) var(--space-xs) 0; transition: border-color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out); }
.tour-tabs button:hover { background: var(--color-paper-3); }
.tt-name { font-family: var(--font-display); font-weight: 600; font-size: var(--text-title); letter-spacing: -0.015em; color: var(--color-ink-2); transition: color var(--dur-short) var(--ease-out); }
.tt-line { color: var(--color-muted); max-width: 36ch; transition: color var(--dur-short) var(--ease-out); }
.tour-tabs button[aria-selected="true"] { border-inline-start-color: var(--color-accent); }
.tour-tabs button[aria-selected="true"] .tt-name { color: var(--color-ink); }
.tour-tabs button[aria-selected="true"] .tt-line { color: var(--color-ink-2); }
.unveil { grid-column: 5 / -1; position: relative; perspective: 1800px; --p: 1; }
.screen { margin: 0; position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-card); box-shadow: 0 0 0 1px var(--color-rule), 0 60px 120px -60px var(--color-shadow-deep); overflow: hidden; background: var(--color-paper); transform-origin: 50% 0%; transform: rotateX(calc((1 - var(--p)) * 20deg)) scale(calc(0.92 + var(--p) * 0.08)); }
.shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: opacity 500ms var(--ease-out), transform var(--dur-spring, 900ms) var(--ease-spring, var(--ease-out)); }
.js .shot { opacity: 0; transform: scale(1.03); }
.js .shot.is-on { opacity: 1; transform: none; }

/* ---------- The day ---------- */
.day { position: relative; height: 260svh; }
.day-stage { position: sticky; top: var(--nav-h); height: calc(100svh - var(--nav-h)); overflow: clip; display: grid; align-items: center; background: var(--color-paper-3); color: var(--color-ink); --day-ink: var(--color-ink); --day-muted: var(--color-ink-2); --day-rule: var(--color-rule); --day-accent: var(--color-accent); }
.day-night { position: absolute; inset: 0; background: var(--color-night); opacity: var(--night, 0); pointer-events: none; }
.day-stage.is-night { --day-ink: var(--color-night-ink); --day-muted: var(--color-night-muted); --day-rule: var(--color-night-rule); --day-accent: var(--color-night-accent); }
.day-stage.is-night :focus-visible { outline-color: var(--color-night-focus); }
.day-grid { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); row-gap: var(--space-2xl); align-items: end; }
.day-copy { grid-column: 1 / span 4; grid-row: 1; display: grid; gap: var(--space-md); justify-items: start; align-self: center; }
.day-copy h2, .day h3, .clock { color: var(--day-ink); transition: color var(--dur-long) var(--ease-out); }
.day-copy p, .moment p { color: var(--day-muted); transition: color var(--dur-long) var(--ease-out); }
.day-copy > p { font-size: var(--text-lead); max-width: 34ch; }
.day-now { grid-column: 5 / span 3; grid-row: 1; align-self: center; display: grid; gap: var(--space-xs); }
/* The client's WhatsApp through the day: what Rumman sends, and what the client sends back, at its hour. */
.day-phone { grid-column: 8 / span 5; grid-row: 1; margin: 0; align-self: center; }
.day-chat { box-shadow: 0 30px 60px -30px var(--color-shadow-night); }
.day-log { height: min(56svh, 500px); padding-bottom: var(--space-lg); }
.day-log .msg { display: none; }
.day-log .msg.is-shown { display: block; animation: msg-in var(--dur-long) var(--ease-out) both; }
.day-log .msg-client.is-shown { transform-origin: 100% 100%; }
.day-log .msg-photo.is-shown { display: grid; }
.msg-time { display: block; margin-top: var(--space-2xs); font-size: 0.75rem; line-height: 1; color: var(--color-muted); text-align: end; font-variant-numeric: tabular-nums; }
.msg-divider { align-self: center; max-width: none; padding: var(--space-2xs) var(--space-md); border-radius: var(--radius-pill); background: var(--color-paper-3); color: var(--color-ink-2); font-size: var(--text-xs); }
.plan-card { display: grid; gap: var(--space-xs); width: 250px; padding: var(--space-xs); }
.plan-card .plan-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2xs); }
.plan-card figure { margin: 0; display: grid; gap: var(--space-3xs); }
.plan-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: calc(var(--radius-inner) - var(--space-xs)); }
.plan-card figcaption { font-size: 0.6875rem; line-height: 1.2; color: var(--color-ink-2); }
.plan-card p { padding: 0 var(--space-2xs); }
:lang(ar) .msg-time { text-align: start; }
.clock { font-family: var(--font-display); font-weight: 600; font-size: clamp(4rem, 7.5vw, 7.5rem); line-height: 0.9; letter-spacing: -0.05em; }
.moment { min-height: 7.5rem; display: grid; gap: var(--space-xs); align-content: start; }
.moment p { max-width: 40ch; }
.moment.is-swapping { animation: moment-in var(--dur-long) var(--ease-out) both; }
@keyframes moment-in { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.switch { display: inline-flex; align-items: center; gap: var(--space-sm); min-height: 44px; padding: 0; background: none; border: 0; color: var(--day-ink); font-weight: 600; font-size: var(--text-sm); cursor: pointer; border-radius: var(--radius-pill); }
.switch-track { width: 48px; height: 28px; border-radius: var(--radius-pill); border: 1px solid var(--color-control); background: var(--color-paper-2); position: relative; transition: background-color var(--dur-short) var(--ease-in-out), border-color var(--dur-short) var(--ease-in-out); }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: var(--radius-pill); background: var(--color-ink-2); transition: transform var(--dur-short) var(--ease-in-out), background-color var(--dur-short) var(--ease-in-out); }
.switch[aria-checked="true"] .switch-track { background: var(--color-accent); border-color: var(--color-accent); }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(20px); background: var(--color-accent-ink); }
.switch:hover .switch-track { border-color: var(--color-accent); }
.day-track { grid-column: 1 / -1; display: grid; gap: var(--space-md); }
.day-track input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; cursor: pointer; }
.day-track input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--day-rule); border-radius: 2px; }
.day-track input[type="range"]::-moz-range-track { height: 2px; background: var(--day-rule); border-radius: 2px; }
.day-track input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -13px; border-radius: var(--radius-pill); background: var(--day-accent); border: 4px solid var(--color-paper-2); box-shadow: 0 2px 6px var(--color-shadow); }
.day-track input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: var(--radius-pill); background: var(--day-accent); border: 4px solid var(--color-paper-2); }
.day-track input[type="range"]:focus-visible { outline-offset: 0; }
.ticks { list-style: none; margin: 0 14px; padding: 0; position: relative; height: 72px; }
.ticks li { position: absolute; top: 0; transform: translateX(-50%); }
.ticks li.is-low { top: 34px; }
.tick { display: grid; justify-items: center; gap: var(--space-3xs); background: none; border: 0; padding: var(--space-2xs) var(--space-xs); color: var(--day-muted); font-size: var(--text-xs); line-height: 1.3; cursor: pointer; border-radius: var(--space-xs); white-space: nowrap; transition: color var(--dur-micro) var(--ease-out); }
.tick b { font-weight: 600; color: var(--day-ink); font-variant-numeric: tabular-nums; }
.tick:hover, .tick[aria-current="true"] { color: var(--day-accent); }
.tick[aria-current="true"] b { color: var(--day-accent); }
.day-static { padding-block: var(--space-xl); }

/* ---------- Languages ---------- */
.langs { padding-block: var(--section-gap-l) var(--section-gap); }
.langs-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); row-gap: var(--space-2xl); align-items: center; }
.langs-title { grid-column: 1 / -1; max-width: 16ch; }
.langs-stage { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); row-gap: var(--space-2xl); align-items: center; }
.langs-list { grid-column: 1 / span 5; display: grid; justify-items: start; gap: var(--space-2xs); }
.langs-list button { background: none; border: 0; padding: var(--space-2xs) 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(2.25rem, 3.6vw + 0.5rem, 4.25rem); line-height: 1.1; letter-spacing: -0.035em; color: var(--color-muted); opacity: 0.55; cursor: pointer; border-radius: var(--space-xs); transition: color var(--dur-short) var(--ease-out), opacity var(--dur-short) var(--ease-out), transform var(--dur-long) var(--ease-out); }
.langs-list button[lang="ar"] { font-family: var(--font-outlier); letter-spacing: 0; }
.langs-list button:hover { opacity: 1; color: var(--color-ink-2); }
.langs-list button[aria-selected="true"] { opacity: 1; color: var(--color-accent); transform: translateX(var(--space-md)); }
.say { grid-column: 6 / -1; margin: 0; display: grid; gap: var(--space-md); border-radius: var(--radius-card); }
.say-q { justify-self: end; max-width: 30ch; margin: 0; padding: var(--space-sm) var(--space-lg); border-radius: var(--radius-card); border-end-end-radius: var(--space-2xs); background: var(--color-bubble-in); font-size: var(--text-lg); line-height: 1.45; color: var(--color-ink); }
.say-q[lang="ar"] { font-family: var(--font-outlier); }
.say-q.is-swapping { animation: say-in 480ms var(--ease-out) both; }
.say-bubble { background: var(--color-paper-2); border-radius: 36px; border-end-start-radius: var(--space-xs); padding: var(--space-xl); box-shadow: 0 0 0 1px var(--color-rule), 0 40px 80px -48px var(--color-shadow); display: grid; gap: var(--space-lg); min-height: 20rem; align-content: start; }
.say-from { display: inline-flex; align-items: center; gap: var(--space-xs); font-size: var(--text-sm); color: var(--color-muted); }
.say blockquote { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: var(--text-display-s); line-height: 1.1; letter-spacing: -0.03em; color: var(--color-ink); text-wrap: balance; }
.say blockquote[lang="ar"] { font-family: var(--font-outlier); letter-spacing: 0; line-height: 1.4; text-align: right; }
.say blockquote.is-swapping { animation: say-in 560ms var(--ease-out) both; }
@keyframes say-in { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.say figcaption { font-size: var(--text-xs); color: var(--color-muted); }

/* ---------- The app: five real flows on one phone ---------- */
.pocket { padding-block: var(--section-gap) var(--section-gap); background: var(--color-paper-3); overflow: clip; }
.pocket-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); align-items: start; }
.pocket-copy { grid-column: 1 / span 6; display: grid; gap: var(--space-2xl); align-content: start; }
.chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2xs); }
.chapters button { position: relative; display: grid; gap: var(--space-2xs); width: 100%; text-align: start; background: none; border: 0; padding: var(--space-md) var(--space-lg) var(--space-md) 0; color: var(--color-ink); cursor: pointer; border-radius: var(--space-xs); }
.ch-name { font-family: var(--font-display); font-weight: 600; font-size: var(--text-title); letter-spacing: -0.015em; color: var(--color-muted); transition: color var(--dur-short) var(--ease-out); }
.ch-line { color: var(--color-muted); max-width: 44ch; transition: color var(--dur-short) var(--ease-out); }
.chapters button:hover .ch-name { color: var(--color-ink-2); }
.chapters button[aria-selected="true"] .ch-name { color: var(--color-ink); }
.chapters button[aria-selected="true"] .ch-line { color: var(--color-ink-2); }
.ch-bar { display: block; height: 2px; margin-top: var(--space-xs); background: var(--color-rule); border-radius: 2px; overflow: hidden; }
[dir="rtl"] .ch-bar i { transform-origin: 100% 50%; }
.ch-bar i { display: block; height: 100%; background: var(--color-accent); transform-origin: 0 50%; transform: scaleX(var(--played, 0)); }
.clip-pause { justify-self: start; display: inline-flex; align-items: center; gap: var(--space-xs); min-height: 44px; padding: 0 var(--space-md); border: 1px solid var(--color-control); border-radius: var(--radius-pill); background: transparent; color: var(--color-ink); font-size: var(--text-sm); cursor: pointer; transition: border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.clip-pause:hover { border-color: var(--color-accent); color: var(--color-accent); }
.clip-pause svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.clip-pause .i-play { display: none; fill: currentColor; stroke: none; }
.clip-pause[aria-pressed="true"] .i-pause { display: none; }
.clip-pause[aria-pressed="true"] .i-play { display: block; }
.handset-wrap { grid-column: 8 / span 5; display: grid; justify-items: center; gap: var(--space-md); position: sticky; top: calc(var(--nav-h) + var(--space-xl)); align-self: start; isolation: isolate; }
.handset-wrap::before { content: ""; position: absolute; z-index: -1; width: 118%; aspect-ratio: 1; top: 50%; left: 50%; translate: -50% -54%; border-radius: 50%; background: var(--color-accent-tint); }
.handset { position: relative; margin: 0; width: min(100%, 340px, calc((100svh - var(--nav-h) - 140px) * 750 / 1624)); aspect-ratio: 750 / 1624; border-radius: 44px; overflow: hidden; background: var(--color-paper); box-shadow: 0 0 0 8px var(--color-paper-2), 0 0 0 9px var(--color-rule), 0 60px 100px -50px var(--color-shadow-deep); }
/* The hand-off between flows (D266): every flow starts on the same Today screen, so a plain crossfade read as no change
   at all. Now the screen that is leaving settles back and softens (280 ms), and the next one, held until its first frame
   is ready, rises into place on the spring a beat later, with the flow's name on a small label for a moment. */
.clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.js .clip { opacity: 0; transform: translateY(18px) scale(0.985); filter: blur(8px); transition: opacity 420ms var(--ease-out) 60ms, transform var(--dur-spring, 900ms) var(--ease-spring, var(--ease-out)) 60ms, filter 420ms var(--ease-out) 60ms; }
.js .clip.is-on { opacity: 1; transform: none; filter: none; z-index: 1; }
.js .clip.is-leaving { opacity: 0; transform: scale(0.94); filter: blur(6px); transition: opacity 280ms var(--ease-out), transform 280ms var(--ease-out), filter 280ms var(--ease-out); }
.clip-label { position: absolute; z-index: 2; left: 50%; bottom: 13%; translate: -50% 0; padding: 0.5em 1.1em; border-radius: var(--radius-pill); background: oklch(from var(--color-ink) l c h / 0.82); color: var(--color-paper); font-size: var(--text-sm); font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; transform: translateY(8px); transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.clip-label.is-shown { opacity: 1; transform: none; transition-delay: 260ms; }
@media (prefers-reduced-motion: reduce) {
  .js .clip, .js .clip.is-leaving { transform: none; filter: none; transition: opacity 200ms linear; }
  .clip-label { transform: none; }
}

/* ---------- Promises: the night band ---------- */
.promise { position: relative; background: var(--color-night); color: var(--color-night-ink); padding-block: var(--section-gap) var(--section-gap); overflow: clip; isolation: isolate; }
.promise-mark { position: absolute; z-index: -1; width: min(46vw, 640px); height: auto; inset-inline-end: -12%; top: 50%; transform: translateY(-50%); opacity: 0.9; pointer-events: none; }
.promise :focus-visible { outline-color: var(--color-night-focus); }
.promises { list-style: none; margin: 0; padding: 0; display: grid; }
.promises li { border-top: 1px solid var(--color-night-rule); padding-block: var(--space-xl); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); }
.promises li:last-child { border-bottom: 1px solid var(--color-night-rule); }
.promises p { grid-column: 1 / span 8; font-family: var(--font-display); font-weight: 600; font-size: var(--text-display-s); line-height: 1.08; letter-spacing: -0.03em; max-width: 24ch; color: var(--color-night-ink); text-wrap: balance; }
.promises li:nth-child(2) p { grid-column: 2 / span 8; }
.promises li:nth-child(3) p { grid-column: 3 / span 8; }

/* ---------- Walkthrough ---------- */
.walk { padding-block: var(--section-gap) var(--section-gap); }
.walk-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); row-gap: var(--space-2xl); align-items: start; }
.walk .section-head { grid-column: 1 / span 5; }
.walk-signin { font-size: var(--text-sm) !important; color: var(--color-muted) !important; padding-top: var(--space-md); }
.walk-signin a { color: var(--color-accent); display: inline-block; padding-block: var(--space-2xs); }
.form { grid-column: 7 / span 6; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-md); row-gap: var(--space-2xs); padding: var(--space-xl); background: var(--color-paper-2); border-radius: var(--radius-card); box-shadow: 0 0 0 1px var(--color-rule), 0 40px 80px -56px var(--color-shadow); }
.field { display: grid; gap: var(--space-xs); align-content: start; }
.field label { font-size: var(--text-sm); font-weight: 600; }
.optional { font-weight: 400; color: var(--color-muted); }
.field input { min-height: 52px; padding: 0 var(--space-md); border: 1px solid var(--color-control); border-radius: 14px; background: var(--color-paper-2); color: var(--color-ink); font-size: 1rem; transition: border-color var(--dur-micro) var(--ease-out); }
.field input:hover { border-color: var(--color-ink-2); }
.field input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -1px; }
.field input[aria-invalid="true"] { border-color: var(--color-danger); }
.field-help { min-height: 1lh; font-size: var(--text-xs); color: var(--color-danger); display: flex; gap: var(--space-2xs); align-items: center; }
.field-help:not(:empty)::before { content: ""; flex-shrink: 0; width: 14px; height: 14px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat; }
.trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.form .btn { grid-column: 1 / -1; margin-top: var(--space-sm); }
.form-status { grid-column: 1 / -1; min-height: 1lh; font-size: var(--text-sm); color: var(--color-ink-2); padding-top: var(--space-xs); }
/* D274: the same settle as the apps' toasts. */
.form-status.is-new { animation: toast-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .form-status.is-new { animation-name: toast-fade; } @keyframes toast-fade { from { opacity: 0; } } }

/* ---------- Footer ---------- */
/* The footer (D279): the lockup and the two links on one centred row, then one quiet bar with the copyright and the
   analytics setting. Compact: it closes the page, it does not compete with it. */
.foot { background: var(--color-paper-3); padding-block: var(--space-2xl) var(--space-lg); }
.foot-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: var(--space-xl); row-gap: var(--space-xl); }
.foot-mark { height: 56px; width: auto; }
.foot-links { justify-self: end; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-lg); font-size: var(--text-sm); }
.foot-links a { color: var(--color-ink); text-decoration: none; padding-block: var(--space-xs); }
.foot-links a:hover { color: var(--color-accent); text-decoration: underline; }
.foot-bar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2xs) var(--space-lg); padding-top: var(--space-md); border-top: 1px solid var(--color-rule); font-size: var(--text-xs); color: var(--color-muted); }
.foot-legal { margin: 0; }
@media (max-width: 40rem) {
  .foot-grid { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-lg); }
  .foot-mark { height: 48px; }
  .foot-links { justify-self: start; }
}
.analytics-settings { padding: var(--space-2xs) 0; border: 0; background: none; color: var(--color-muted); font: inherit; text-decoration: underline; text-decoration-color: var(--color-rule); text-underline-offset: 0.25em; cursor: pointer; transition: color var(--dur-micro) var(--ease-out), text-decoration-color var(--dur-micro) var(--ease-out); }
.analytics-settings:hover { color: var(--color-accent); text-decoration-color: currentColor; }
/* The analytics choice (D278): a calm card that settles in like the toasts (D274), never a blob. The two choices weigh
   the same (no nudge toward Allow). Desktop: a compact card in the reading-end corner. Phones: a sheet across the bottom
   with the choices side by side at full width, clear of the home bar. */
.analytics-panel { position: fixed; z-index: var(--z-toast); inset-inline-end: var(--space-lg); inset-block-end: max(var(--space-lg), env(safe-area-inset-bottom)); width: min(25rem, calc(100% - 2 * var(--space-md))); max-height: calc(100dvh - 2 * var(--space-md)); overflow: auto; padding: var(--space-lg); border-radius: var(--radius-card); background: var(--color-paper); color: var(--color-ink); box-shadow: 0 0 0 1px oklch(from var(--color-ink) l c h / 0.08), 0 2px 6px oklch(from var(--color-ink) l c h / 0.06), 0 24px 60px -18px oklch(from var(--color-ink) l c h / 0.35); animation: consent-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.analytics-panel h2 { margin: 0 0 var(--space-2xs); max-width: none; font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.25; letter-spacing: -0.01em; }
.analytics-panel p { margin: 0; color: var(--color-ink-2); font-size: var(--text-sm); line-height: 1.5; }
.analytics-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs); margin-top: var(--space-md); }
.analytics-actions .btn { width: 100%; min-height: 44px; padding: 0 var(--space-md); border-radius: calc(var(--radius-card) - var(--space-lg)); color: var(--color-ink); border-color: oklch(from var(--color-ink) l c h / 0.18); background: var(--color-paper-2); font-weight: 600; }
.analytics-actions .btn:hover { border-color: var(--color-accent); color: var(--color-accent); background: var(--color-accent-tint); }
:lang(ar) .analytics-panel h2 { font-family: var(--font-outlier); letter-spacing: 0; }
@keyframes consent-in { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 40rem) {
  .analytics-panel { inset-inline: var(--space-sm); inset-block-end: max(var(--space-sm), env(safe-area-inset-bottom)); width: auto; padding: var(--space-md) var(--space-md) var(--space-md); border-radius: 24px; }
  .analytics-actions .btn { border-radius: calc(24px - var(--space-md)); }
}
/* Clear of the section rail (D272) where it replaces the scrollbar. */
@media (min-width: 64.01rem) and (pointer: fine) { .analytics-panel { inset-inline-end: 44px; } [dir="rtl"] .analytics-panel { inset-inline-end: var(--space-lg); } }
@media (prefers-reduced-motion: reduce) { .analytics-panel { animation-name: consent-fade; } @keyframes consent-fade { from { opacity: 0; } } }

/* ---------- The motion layer (motion.js): springs, the message-to-record move and reels ---------- */
.motion .settle { animation-timing-function: var(--ease-spring); animation-duration: var(--dur-spring); }
.motion .reveal { transition-timing-function: var(--ease-spring); transition-duration: var(--dur-spring); }
.stage { transform-origin: 50% 50%; will-change: transform; }
/* The message that becomes a record: a copy of the client's bubble glides into the portal strip (motion.js). */
.ghost { position: fixed; margin: 0; max-width: none; z-index: var(--z-toast); transform-origin: 0 0; pointer-events: none; overflow: hidden; }
.motion .desk-line.is-new > span:last-child { animation: record-in 620ms var(--ease-out) both; }
@keyframes record-in { from { clip-path: inset(0 100% 0 0); opacity: 0.4; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
.motion .desk-line.is-new .desk-icon { animation: icon-in var(--dur-spring) var(--ease-spring) both; }
@keyframes icon-in { from { transform: scale(0.4); } to { transform: none; } }
.motion .desk-line.is-new .desk-icon svg path, .motion .desk-line.is-new .desk-icon svg circle { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 700ms var(--ease-out) 120ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.reel { display: inline-flex; align-items: flex-start; line-height: 1; }
.reel-col { display: inline-block; height: 1em; overflow: clip; }
.reel-strip { display: flex; flex-direction: column; }
.reel-strip > span { display: block; height: 1em; line-height: 1; text-align: center; }
.reel-sep { display: inline-block; height: 1em; line-height: 1; }
.motion .clock { line-height: 1; }

/* ---------- Tablet and phone ---------- */
@media (max-width: 64rem) {
  .nav-links { display: none; }
  .nav-actions { margin-inline-start: auto; gap: var(--space-md); }
  .hero { min-height: auto; padding-block: var(--space-2xl); }
  .hero-copy { grid-column: 1 / -1; }
  .stage { grid-column: 1 / -1; margin-top: var(--space-2xl); max-width: 640px; }
  .section-head.split h2, .section-head.split p { grid-column: 1 / -1; }
  .section-head.split { margin-bottom: var(--space-2xl); }
  .tour-tabs, .unveil { grid-column: 1 / -1; }
  .pocket-copy, .handset-wrap { grid-column: 1 / -1; }
  .langs-list, .say { grid-column: 1 / -1; }
  .langs-stage { row-gap: var(--space-lg); }
  .walk .section-head, .form { grid-column: 1 / -1; }
  .promises li p, .promises li:nth-child(2) p, .promises li:nth-child(3) p { grid-column: 1 / -1; }
  .promise-mark { width: 70vw; inset-inline-end: -30%; opacity: 0.35; }
}
/* Laptops: the room is the window's height, not its width. Pinned and first-screen content scale with it, so nothing
   is cut off below the fold or under a pinned stage (checked at 1280x570 to 1536x730, the space inside a browser). */
@media (min-width: 64.01rem) {
  .hero h1 { font-size: clamp(2.5rem, min(4.6vw + 1rem, 10.5svh), 5.75rem); }
  :lang(fr) .hero h1 { max-width: 13ch; }
  .thread-log { height: clamp(220px, calc(100svh - 72px - 330px), 430px); }
  .day-copy h2 { font-size: clamp(1.75rem, min(2.6vw + 1rem, 6.5svh), 3.6rem); }
  .clock { font-size: clamp(3rem, min(5.6vw, 11svh), 6.5rem); }
  .day-log { height: clamp(220px, calc(100svh - 72px - 290px), 500px); }
  .day-grid { row-gap: clamp(16px, 4svh, 64px); }
  .tour-tabs button { padding-block: var(--space-sm); }
  .tt-line { font-size: var(--text-sm); }
}
@media (min-width: 64.01rem) and (max-height: 760px) {
  .day-log { height: clamp(200px, calc(100svh - 72px - 300px), 500px); }
  .day-grid { row-gap: var(--space-sm); }
  .day-track { gap: var(--space-2xs); }
  .day-copy > p { font-size: var(--text-md); }
  .moment p { font-size: var(--text-sm); }
  .ticks { height: 60px; }
}
/* The tour's tabs stay pinned only where the whole list fits beside the screen. */
@media (max-height: 940px) { .tour-tabs { position: static; } }
/* A very short window: the day scrolls as a normal section, driven by its slider and times. */
@media (max-height: 599px) {
  .day { height: auto; }
  .day-stage { position: relative; top: auto; height: auto; padding-block: var(--section-gap-s); }
  .day-log { height: 380px; }
}

/* Sections whose tabs follow the scroll (D271): while the section passes, its tabs and their content stay on screen
   and each stretch of scrolling brings the next tab; app.js turns it on only where the block fits the window, and adds
   the scroll room after it. The tabs still work by tap, click and keyboard, and move the page to their stretch. */
.is-stepping { position: sticky; top: calc(var(--nav-h) + var(--space-lg)); }
.is-stepping .tour-tabs { position: static; }
.steps-edge { grid-column: 1 / -1; height: 0; }
/* Short laptop windows: the tour's other tabs show their names only, so the tabs and the screen fit and follow the scroll. */
@media (min-width: 64.01rem) and (max-height: 860px) {
  .tour-tabs button:not([aria-selected="true"]) .tt-line { display: none; }
}

/* The page's own scrollbar (D272): a rail cut into the page's sections on desktop with a mouse, a line of the same
   pieces under the top bar elsewhere. Pieces are as long as their sections, with a small gap between them. */
.rail, .rail-line { display: none; }
@media (min-width: 64.01rem) and (pointer: fine) {
  html { scrollbar-width: none; }
  html::-webkit-scrollbar { display: none; }
  .rail { display: block; position: fixed; z-index: var(--z-sticky-nav); top: calc(var(--nav-h) + 20px); bottom: 20px; right: 0; width: 28px; cursor: pointer; touch-action: none; }
  .rail-track { position: absolute; inset: 0 auto 0 50%; width: 4px; translate: -50% 0; }
  .rail-piece { position: absolute; left: 0; right: 0; top: calc(var(--at) + 2px); height: calc(var(--size) - 4px); border-radius: var(--radius-pill); background: oklch(from var(--color-ink) l c h / 0.12); box-shadow: 0 0 0 1px oklch(from var(--color-paper) l c h / 0.5); overflow: hidden; transition: background-color var(--dur-short) var(--ease-out), width var(--dur-short) var(--ease-out); }
  .rail-piece i { display: block; height: 100%; background: var(--color-accent); transform-origin: 50% 0; transform: scaleY(var(--fill, 0)); }
  .rail:hover .rail-track, .rail.is-dragging .rail-track { width: 6px; }
  .rail-thumb { position: absolute; left: 50%; top: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: var(--radius-pill); background: var(--color-accent); box-shadow: 0 0 0 3px var(--color-paper), 0 2px 6px var(--color-shadow); transform: translateY(var(--y, 0px)); }
}
@media not ((min-width: 64.01rem) and (pointer: fine)) {
  .rail-line { display: block; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; }
  .rail-bit { position: absolute; top: 0; bottom: 0; left: calc(var(--at) + 1px); width: calc(var(--size) - 2px); background: oklch(from var(--color-ink) l c h / 0.1); overflow: hidden; }
  .rail-bit i { display: block; height: 100%; background: var(--color-accent); transform-origin: 0 50%; transform: scaleX(var(--fill, 0)); }
}
@media (prefers-reduced-motion: reduce) {
}

/* The tour's full-size viewer (D277). */
#tour-screen .shot { cursor: zoom-in; }
.screen-open { position: absolute; z-index: 2; top: var(--space-sm); right: var(--space-sm); display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--radius-pill); background: oklch(from var(--color-ink) l c h / 0.72); color: var(--color-paper); cursor: pointer; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 6px 18px -8px var(--color-shadow-deep); transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out); }
.screen-open:hover { transform: scale(1.06); background: var(--color-ink); }
.screen-open svg, .viewer svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.viewer { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--color-night); color: var(--color-night-ink); overflow: hidden; }
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: viewer-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.viewer::backdrop { background: transparent; }
@keyframes viewer-in { from { opacity: 0; } }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); padding: max(var(--space-md), env(safe-area-inset-top)) var(--space-lg) var(--space-sm); }
.viewer-title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: var(--text-title); color: var(--color-night-ink); }
.viewer-close, .viewer-step { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--color-night-rule); border-radius: var(--radius-pill); background: transparent; color: var(--color-night-ink); cursor: pointer; }
.viewer-close:hover, .viewer-step:hover { background: oklch(from var(--color-night-ink) l c h / 0.1); }
.viewer :focus-visible { outline: 2px solid var(--color-night-focus); outline-offset: 2px; }
.viewer-scroll { display: grid; place-items: center; overflow: auto; padding: 0 var(--space-lg); overscroll-behavior: contain; touch-action: pan-x pan-y pinch-zoom; direction: ltr; }
/* The portal screens are in English: in Arabic they still open at their left edge. */
.viewer-img { display: block; max-width: 100%; max-height: calc(100dvh - 156px); width: auto; height: auto; border-radius: 14px; box-shadow: 0 30px 80px -30px oklch(0% 0 0 / 0.7); }
.viewer-img.is-in { animation: viewer-img-in 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes viewer-img-in { from { opacity: 0; transform: scale(0.985); } }
.viewer-nav { display: flex; align-items: center; justify-content: center; gap: var(--space-lg); padding: var(--space-sm) var(--space-lg) max(var(--space-md), env(safe-area-inset-bottom)); }
[dir="rtl"] .viewer-step svg { transform: scaleX(-1); }
.viewer-count { min-width: 3.5em; text-align: center; font-size: var(--text-sm); color: var(--color-night-muted); }
.viewer-hint { display: none; }
/* Phones held upright: the screen at a height that reads, dragged sideways; a hint says so for a moment. */
@media (max-width: 48rem) and (orientation: portrait) {
  .viewer-scroll { display: block; padding: 0; }
  .viewer-img { max-width: none; max-height: none; height: min(100%, 560px); margin: auto 0; border-radius: 0; }
  .viewer-scroll { display: flex; align-items: center; }
  .viewer-hint { display: block; position: absolute; left: 50%; bottom: 84px; translate: -50% 0; margin: 0; padding: 0.5em 1em; border-radius: var(--radius-pill); background: oklch(from var(--color-ink) l c h / 0.85); color: var(--color-paper); font-size: var(--text-sm); white-space: nowrap; opacity: 0; pointer-events: none; }
  .viewer.is-hinted .viewer-hint { animation: viewer-hint 3.2s ease-in-out both; }
  @keyframes viewer-hint { 0% { opacity: 0; } 12%, 78% { opacity: 1; } 100% { opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  .viewer[open], .viewer-img.is-in { animation: none; }
  .viewer.is-hinted .viewer-hint { animation: none; opacity: 1; }
}

/* The chosen chip's line, shown only where the lists become chips. */
.tab-note { display: none; }

/* Tablets and phones (D270): every choice in a section is in view at once, as a grid of chips (never a row that runs
   off the screen), the chosen one filled; the chosen item's one line sits under the grid (.tab-note, from app.js). */
@media (max-width: 64rem) {
  .tour-tabs, .langs-list, .chapters { position: static; display: grid; grid-auto-flow: row; gap: var(--space-xs); margin: 0; padding: 0; overflow: visible; }
  .tour-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .langs-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .chapters { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .chapters > li { grid-column: span 2; }
  .chapters > li:nth-child(4), .chapters > li:nth-child(5) { grid-column: span 3; }
  .tour-tabs button, .langs-list button, .chapters button { position: relative; display: grid; place-items: center; width: 100%; min-height: 48px; margin: 0; padding: var(--space-xs) var(--space-sm); border: 1px solid var(--color-rule); border-radius: 16px; background: var(--color-paper); color: var(--color-ink-2); text-align: center; font-family: var(--font-body); font-size: var(--text-sm); font-weight: 600; line-height: 1.25; letter-spacing: 0; transform: none; opacity: 1; transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out); }
  [dir="rtl"] .tour-tabs button { border-radius: 16px; }
  .tour-tabs button:hover, .langs-list button:hover, .chapters button:hover { background: var(--color-paper-2); }
  .tour-tabs button[aria-selected="true"], .langs-list button[aria-selected="true"], .chapters button[aria-selected="true"] { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); transform: none; }
  .tt-name, .ch-name { font: inherit; letter-spacing: 0; color: inherit; }
  .tour-tabs button[aria-selected="true"] .tt-name, .chapters button[aria-selected="true"] .ch-name { color: inherit; }
  .tt-line, .ch-line { display: none; }
  .langs-list button[lang="ar"] { font-family: var(--font-outlier); font-size: var(--text-md); }
  /* The flow playing: its progress runs along the chip's lower edge. */
  .ch-bar { position: absolute; inset-inline: 14px; bottom: 6px; margin: 0; height: 2px; background: oklch(from var(--color-accent-ink) l c h / 0.28); }
  .chapters button:not([aria-selected="true"]) .ch-bar { visibility: hidden; }
  .chapters button[aria-selected="true"] .ch-bar i { background: var(--color-accent-ink); }
  [dir="rtl"] .ch-bar i { transform-origin: 100% 50%; }
  .tab-note { display: block; grid-column: 1 / -1; margin: var(--space-md) 0 0; min-height: calc(2 * 1.5em); color: var(--color-ink-2); font-size: var(--text-md); line-height: 1.5; max-width: 44ch; }
  .tab-note.is-swapping { animation: moment-in var(--dur-long) var(--ease-out) both; }
  .tour-body { row-gap: 0; }
  .unveil { margin-top: var(--space-lg); }
  /* A desktop screen shrunk to a phone is unreadable: show its left part, where each view starts, at a size that reads
     (the portal is in English, so it stays anchored left in Arabic too). */
  .screen { aspect-ratio: 4 / 3; }
  .shot { inset: 0 auto auto 0; width: 128%; max-width: none; height: auto; object-fit: initial; --pan: -21.875%; }
  /* D276: during its turn the screen glides from its left edge to its right, held a moment at each end, so the whole
     page passes at a size that reads. The chip playing carries the turn's line along its lower edge. */
  .shot.is-on.is-panning { animation: tour-pan 6.5s cubic-bezier(0.45, 0, 0.55, 1) both; }
  @keyframes tour-pan { 0%, 14% { translate: 0 0; } 86%, 100% { translate: var(--pan) 0; } }
  .tour-tabs button.is-playing::after { content: ""; position: absolute; inset-inline: 14px; bottom: 6px; height: 2px; border-radius: 2px; background: var(--color-accent-ink); transform-origin: 0 50%; animation: tour-turn 6.5s linear both; opacity: 0.9; }
  [dir="rtl"] .tour-tabs button.is-playing::after { transform-origin: 100% 50%; }
  @keyframes tour-turn { from { transform: scaleX(0); } }

  /* The client app: the heading, the five flows, the line, then the phone with its pause under it. */
  .pocket-grid { grid-template-columns: minmax(0, 1fr); }
  .pocket-copy { display: contents; }
  .pocket-copy > .section-head { order: 1; margin-bottom: var(--space-xl); }
  .chapters { order: 2; }
  .pocket .tab-note { order: 3; }
  .handset-wrap { order: 4; position: relative; top: auto; margin-top: var(--space-xl); grid-column: 1; }
  .handset { width: min(100%, 300px); }
  /* The tint behind the phone follows the phone, not the column, so it never covers the line above or Pause. */
  .handset-wrap::before { width: min(118%, 440px); }
  .clip-pause { order: 5; justify-self: center; margin-top: var(--space-lg); }
  .clip-label { display: none; }

  /* The day: the heading and switch, the four moments as chips that play through the day, the clock beside what
     happens, then the chat at a fixed height with the newest message at the bottom, and the footnote last. */
  .day-grid { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-lg); }
  .day-copy { display: contents; }
  .day-copy h2 { order: 1; }
  .day-copy > p { order: 2; margin-top: calc(-1 * var(--space-sm)); }
  .switch { order: 3; align-self: flex-start; }
  .day-track { order: 4; }
  .day-now { order: 5; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-md); align-items: center; }
  .day-phone { order: 6; align-self: stretch; width: 100%; }
  .day-track input[type="range"] { display: none; }
  .ticks { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-xs); height: auto; margin: 0; }
  .ticks li, .ticks li.is-low { position: static; top: auto; left: auto !important; transform: none; }
  .tick { width: 100%; min-height: 56px; padding: var(--space-xs) var(--space-2xs); border: 1px solid var(--day-rule); border-radius: 16px; background: oklch(from var(--color-paper) l c h / 0.55); text-align: center; }
  .tick span { display: block; font-size: 0.6875rem; line-height: 1.2; }
  .tick[aria-current="true"] { background: var(--day-accent); border-color: var(--day-accent); color: var(--color-accent-ink); }
  .tick[aria-current="true"] b { color: var(--color-accent-ink); }
  .clock { font-size: clamp(2.75rem, 13vw, 3.75rem); }
  .moment { min-height: 0; }
  .moment h3 { font-size: var(--text-lg); }
  .moment p { font-size: var(--text-sm); }
  /* The chat holds as much of the day as the desktop one: taller, with the meal photos at a phone's size, and the
     older messages fading out under the header as a real chat scrolls. */
  .day .day-log { height: clamp(380px, 56svh, 470px); padding: var(--space-md); gap: var(--space-xs); justify-content: flex-end; overflow: hidden; -webkit-mask: linear-gradient(to bottom, transparent, black 48px); mask: linear-gradient(to bottom, transparent, black 48px); }
  .day .day-log .msg-photo { width: 148px; }
  .day .day-log .plan-card { width: 216px; }
  .day .day-log .msg { font-size: var(--text-xs); line-height: 1.45; }
}
/* A phone held sideways: a shorter headline and less air, so the action stays on the first screen. */
@media (max-height: 560px) and (orientation: landscape) {
  .hero { padding-block: var(--space-md) var(--space-xl); }
  .hero-copy { gap: var(--space-sm); }
  .hero h1 { font-size: clamp(2rem, 8vh + 0.75rem, 3rem); max-width: 18ch; }
  :lang(ar) .hero h1 { max-width: 20ch; }
  .lede { max-width: 48ch; }
}
@media (max-width: 30rem) {
  /* The hero's own action is right below; the nav keeps the brand and the languages. */
  .nav-actions .btn-quiet { display: none; }
}
@media (max-width: 40rem) {
  .shot { width: 170%; --pan: -41.18%; }
  .nav-signin { display: none; }
  .stage { padding: var(--space-md) var(--space-md) var(--space-md); border-radius: 32px; }
  .thread-chat { border-radius: calc(32px - var(--space-md)); }
  .thread-log { height: 380px; padding: var(--space-md) var(--space-md) var(--space-3xl); }
  .thread-desk { margin-inline: var(--space-xs); grid-template-columns: minmax(0, 1fr); row-gap: var(--space-2xs); }
  .stage-mark { width: 260px; inset-inline-end: -90px; bottom: -70px; }
  .msg-photo { width: 170px; }
  .form { grid-template-columns: minmax(0, 1fr); padding: var(--space-lg); }
  .say-bubble { padding: var(--space-lg); min-height: 14rem; border-radius: 28px; border-end-start-radius: var(--space-xs); }
  .say blockquote { font-size: clamp(1.75rem, 7.5vw, 2.5rem); }
}

/* Reduced motion: nothing drifts, scrubs, tilts or rocks; the day is a plain section driven by the slider. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .shot.is-on.is-panning, .tour-tabs button.is-playing::after { animation: none; }
  .day { height: auto; }
  .day-stage { position: relative; top: auto; height: auto; padding-block: var(--section-gap-s); }
  .js .reveal { opacity: 1; transform: none; }
  .unveil { --p: 1 !important; }
  .mark-wait .fruit, .mark-wait .seed { animation: none; }
  .mark-wait .seed { opacity: 0; }
}
.no-scrub .day { height: auto; }
.no-scrub .day-stage { position: relative; top: auto; height: auto; padding-block: var(--section-gap-s); }
html:not(.js) .day { height: auto; }
html:not(.js) .day-stage { position: relative; top: auto; height: auto; padding-block: var(--section-gap-s); }
