/* The hero's live demo (demo.js): the app, drawn from the site's theme variables, so picking Peach or dark
   mode changes it like the app. A phone with three screens: Cubi listening, the plan, Today. */

/* the hero holds the words and the phone: stacked on phones, side by side from 960 px */
.hero.v2 .hero-grid { display: flex; flex-direction: column; align-items: stretch; }
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; }
.chip.proof.below { margin-top: var(--s3); }
@media (min-width: 960px) {
  .hero.v2 .hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--s5); align-items: center; }
}

.demo-stage { position: relative; margin: var(--s5) auto 0; width: min(300px, 78vw); }
@media (min-width: 960px) { .demo-stage { margin: 0 auto; width: 320px; } }

.d-phone {
  aspect-ratio: 300 / 620; padding: 9px; border-radius: 46px; background: #0f120f;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 40px 70px -36px rgba(0, 0, 0, 0.5), 0 14px 30px -18px rgba(0, 0, 0, 0.3);
}
.d-screen {
  position: relative; height: 100%; border-radius: 37px; overflow: hidden;
  background: var(--bg); color: var(--text); font-family: var(--body); font-size: 14px; line-height: 1.35;
}
/* a soft glow of the theme behind it all, like the app's silk */
.d-screen::before { content: ""; position: absolute; inset: -20% -20% auto; height: 60%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent); pointer-events: none; }
.d-view { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 46px 16px 20px; opacity: 0; visibility: hidden; }
.d-view.on { opacity: 1; visibility: visible; }

/* Everything below mirrors the app's own components (app/src: VoiceCoachScreen, CoachScreen's CardView, TodayView's
   Row and parts.tsx), at the app's sizes, so the demo is our UI, not a drawing of it. */
.d-screen { background: linear-gradient(180deg, var(--wash) 0%, var(--bg) 38%); }
.d-screen::before { display: none; }
.ic { width: 1em; height: 1em; fill: currentColor; flex: none; }
.d-tile { width: 30px; height: 30px; display: grid; place-items: center; color: var(--text); font-size: 20px; flex: none; }

/* ---- 1. voice mode: Cubi, the nameplate, the words, the tray ---- */
.d-voice { align-items: center; text-align: center; padding-top: 18px; }
.d-icon-btn { align-self: flex-start; width: 34px; height: 34px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 16px; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.d-cubi { position: relative; width: 92px; margin-top: 6px; }
.d-cubi svg { display: block; width: 100%; height: auto; transform: rotate(-8deg); }
.d-cubi-shadow { display: block; width: 64px; height: 9px; margin: 6px auto 0; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, 0.14), transparent); }
.d-plate { display: flex; flex-direction: column; align-items: center; gap: 1px; margin-top: 10px; padding: 6px 12px; border-radius: 14px; background: var(--surface); }
.d-plate b { font-size: 13.5px; font-weight: 600; }
.d-name-txt { font-size: 11.5px; color: var(--muted); }
.d-hello { margin: 18px 6px 0; font-size: 16.5px; color: var(--muted); }
.d-voice.talking .d-hello, .d-voice.thinking .d-hello { display: none; }
.d-captions { margin: 14px 6px 0; font-size: 18px; line-height: 1.35; color: var(--text); }
.d-captions .w { opacity: 0; transition: opacity 0.25s var(--curve-standard); }
.d-captions .w.heard { opacity: 1; }
.d-tray { margin-top: auto; display: flex; gap: 8px; padding: 6px; border-radius: 999px; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.d-tb { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface2); color: var(--text); font-size: 17px; }
.d-tb.on { background: var(--cta); color: var(--on-cta); }
.d-voice.talking .d-tb.on { animation: d-listen 1.2s var(--curve-standard) infinite; }
.d-tb.end { background: #b83238; color: #fff; }
@keyframes d-listen { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--cta) 40%, transparent); } 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--cta) 0%, transparent); } }

/* ---- 2. the chat: Cubi's bubble, one plan card, Reject and Approve under it ---- */
.d-plan { gap: 10px; padding-top: 24px; }
.d-bubble { align-self: flex-start; max-width: 88%; padding: 10px 13px; border-radius: 18px 18px 18px 6px; background: var(--surface2); font-size: 14px; line-height: 1.4; }
.d-plancard { padding: 2px 14px; border-radius: 20px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--surface3) 65%, var(--accent)); }
.d-pitem { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.d-pitem + .d-pitem { border-top: 1px solid var(--line); }
.d-pitem b { display: block; font-size: 14.5px; font-weight: 600; }
.d-when { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.d-acts { display: flex; gap: 8px; }
.d-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; font-weight: 700; font-size: 13.5px; }
.d-btn .ic { font-size: 14px; }
.d-btn.sec { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.d-btn.pri { flex: 1; background: var(--cta); color: var(--on-cta); cursor: pointer; }
.d-plan.ok .d-btn.sec { visibility: hidden; }
.d-plan.ok .d-btn.pri { background: var(--wash); color: var(--text); }

/* ---- 3. Today: the streak pill, the title and ring, sections of grouped rows with the circle on the right ---- */
.d-today { padding-top: 16px; }
.d-top { display: flex; align-items: center; }
.d-streak { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 11px 0 7px; border-radius: 999px; background: var(--surface); font-size: 14px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.d-flame { width: 18px; height: 18px; }
.d-flame .out { fill: var(--muted); }
.d-flame .lit { fill: #ff7b3a; opacity: 0; transform-box: fill-box; transform-origin: 50% 80%; }
.d-today.lit .d-flame .lit { opacity: 1; }
.d-today.lit .d-flame .out { opacity: 0; }
.d-head { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.d-title { margin: 0; font-family: var(--display); font-weight: 600; font-size: 32px; letter-spacing: -0.02em; line-height: 1.05; }
.d-date { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.d-ring { width: 50px; height: 50px; flex: none; }
.d-ring circle { fill: none; stroke: var(--surface3); stroke-width: 5; }
.d-ring .fill { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transform: rotate(-90deg); transform-origin: center; transition: stroke-dashoffset 0.7s var(--curve-decelerate); }
.d-ring text { font: 600 15px var(--body); fill: var(--text); }
.d-ring .d-of { font-size: 11px; font-weight: 400; fill: var(--muted); }
.d-section { margin-top: 12px; }
.d-sec { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.d-sec .ic { font-size: 14px; }
.d-group { margin-top: 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.d-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 10px; }
.d-row-body { flex: 1; min-width: 0; }
.d-row b { display: block; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.d-tag { display: inline-flex; align-items: center; gap: 4px; }
.d-tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--tag); }
.d-tick { flex: none; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--muted) 70%, transparent); background: transparent; display: grid; place-items: center; cursor: pointer; }
.d-tick svg { width: 15px; height: 15px; fill: none; stroke: var(--on-cta); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.d-row.done .d-tick { background: var(--accent); border-color: var(--accent); }
.d-row.done .d-tick svg { opacity: 1; }
.d-row.done b { color: var(--muted); text-decoration: line-through; }
.d-row.done .d-tile { opacity: 0.65; }

/* replay, once the story has played (and for keyboard and screen-reader users, always reachable) */
.d-replay { display: block; margin: 14px auto 0; height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 600 13px/1 var(--body); cursor: pointer; }
.d-replay:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* print, or no script: the finished Today */
@media print { .d-view { display: none; } }

@keyframes d-talk { from { transform: scaleY(0.6); } to { transform: scaleY(var(--amp, 3)); } }
@media (prefers-reduced-motion: reduce) { .d-tb { animation: none !important; } }
html.a11y-motion .d-tb { animation: none !important; }
.d-replay[hidden] { display: none; }

/* beside the phone (960 px and up): the headline sized to its column, two lines for the longest ending */
@media (min-width: 960px) {
  .hero.v2 .rotator { font-size: clamp(48px, 5vw, 72px); max-width: none; }
}

/* the Gentle setup (the page's "Check marks instead of a flame" switch, on by default): the app's gentle pill,
   a check mark and the days showed up in the last 30, never a streak that resets (parts.tsx StreakPill) */
.d-checkmark { display: none; width: 18px; height: 18px; border-radius: 50%; place-items: center; box-shadow: inset 0 0 0 1.8px var(--surface3); }
.d-checkmark svg { width: 11px; height: 11px; fill: none; stroke: var(--on-cta); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.d-today.lit .d-checkmark, .frag-streak .d-checkmark { background: var(--accent); box-shadow: none; }
.d-today.lit .d-checkmark svg, .frag-streak .d-checkmark svg { opacity: 1; }
/* gentle by default (even before scripts run); html.streak-mode when someone turns check marks off */
.d-streak .d-flame, .d-streak .n-flame { display: none; }
.d-streak .d-checkmark { display: grid; }
html.streak-mode .d-streak .d-flame { display: block; }
html.streak-mode .d-streak .n-flame { display: inline; }
html.streak-mode .d-streak .d-checkmark, html.streak-mode .d-streak .n-check { display: none; }

/* the phone's frame stays visible on a dark page: a lighter bezel and a thin light edge */
:root[data-theme="dark"] .d-phone { background: #2a3027; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.10), 0 40px 70px -36px rgba(0, 0, 0, 0.8); }
 :root .d-phone { background: #2a3027; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.10), 0 40px 70px -36px rgba(0, 0, 0, 0.8); } 

/* ---- the hero's phone is the feature tabs' phone (owner, Oct 24): an iPhone screenshot's shape (590 × 1280), an even
   8px bezel, screen corners 38px inside the frame's 46px, no inner highlight; near-black with a fine edge in dark ---- */
.d-phone { aspect-ratio: auto; padding: 8px; border-radius: 46px; background: #0f120f; box-shadow: 0 40px 70px -36px rgba(0, 0, 0, 0.5), 0 14px 30px -18px rgba(0, 0, 0, 0.3); }
.d-screen { height: auto; aspect-ratio: 590 / 1280; border-radius: 38px; }
:root[data-theme="dark"] .d-phone { background: #050605; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 40px 70px -36px rgba(0, 0, 0, 0.8); }
 :root .d-phone { background: #050605; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 40px 70px -36px rgba(0, 0, 0, 0.8); } 
/* dark: the app's own screen, as in the screenshots: a soft grey at the top easing to near-black, no green glow */
:root[data-theme="dark"] .d-screen { background: linear-gradient(180deg, #211f27 0%, #201f24 16%, #1c1b20 24%, #141316 35%, #0e0e0e 47%, #0e0e0e 100%); }
:root[data-theme="dark"] .d-screen::before { display: none; }
  :root .d-screen { background: linear-gradient(180deg, #211f27 0%, #201f24 16%, #1c1b20 24%, #141316 35%, #0e0e0e 47%, #0e0e0e 100%); }
  :root .d-screen::before { display: none; }


/* ---- the app's own colours inside the pictures of it (owner, Oct 25): Goalify's Clean look is one set of quiet
   neutrals for every theme, with the theme's colour only on accents. The site's page colours are tinted toward the
   theme, so the demo screens, the built screens and the "How it works" pieces take the app's neutrals instead
   (app/src/core/theme/tokens.ts, CLEAN). ---- */
.d-screen, .feat-device > .app-screen, .frag {
  --bg: #f7f7f5; --surface: #ffffff; --surface2: #efefec; --surface3: #e0e0dc; --muted: #5b5b57; --line: #e7e7e3; --border: rgba(20, 24, 18, 0.06);
}
:root[data-theme="dark"] .d-screen, :root[data-theme="dark"] .feat-device > .app-screen, :root[data-theme="dark"] .frag {
  --bg: #0e0e0f; --surface: #18181a; --surface2: #222224; --surface3: #2e2e31; --text: #f2f2f0; --muted: #a9a9a5; --line: #28282a; --border: rgba(255, 255, 255, 0.08);
}
  :root .d-screen, :root .feat-device > .app-screen, :root .frag {
    --bg: #0e0e0f; --surface: #18181a; --surface2: #222224; --surface3: #2e2e31; --text: #f2f2f0; --muted: #a9a9a5; --line: #28282a; --border: rgba(255, 255, 255, 0.08);
  }


/* ---- Liquid Glass (owner, Oct 25): the app's glass on iOS 26, drawn for the web. Frosted (blur and saturation of
   what is behind), a light edge that catches from the top left, a soft inner glow along the bottom, a specular
   sheen, and a shadow under it. Pressing swells it and a glint follows the finger (demo.js). Slow soft light
   drifts behind the screen, so there is something under the glass to bend and tint. ---- */
.d-screen { --lg-fill: rgba(255, 255, 255, 0.62); --lg-top: rgba(255, 255, 255, 0.95); --lg-rim: rgba(20, 24, 18, 0.07); --lg-glow: rgba(255, 255, 255, 0.55); --lg-shadow: rgba(20, 24, 18, 0.22); --lg-sheen: 0.5; }
:root[data-theme="dark"] .d-screen { --lg-fill: rgba(255, 255, 255, 0.09); --lg-top: rgba(255, 255, 255, 0.32); --lg-rim: rgba(255, 255, 255, 0.12); --lg-glow: rgba(255, 255, 255, 0.14); --lg-shadow: rgba(0, 0, 0, 0.55); --lg-sheen: 0.38; }
 :root .d-screen { --lg-fill: rgba(255, 255, 255, 0.09); --lg-top: rgba(255, 255, 255, 0.32); --lg-rim: rgba(255, 255, 255, 0.12); --lg-glow: rgba(255, 255, 255, 0.14); --lg-shadow: rgba(0, 0, 0, 0.55); --lg-sheen: 0.38; } 

.lg, .d-plate, .d-icon-btn, .d-tray, .d-streak, .d-tabbar, .d-plus {
  position: relative; isolation: isolate; overflow: hidden;
  background: linear-gradient(150deg, var(--lg-fill), color-mix(in srgb, var(--lg-fill) 45%, transparent) 60%, var(--lg-fill));
  -webkit-backdrop-filter: blur(16px) saturate(1.9); backdrop-filter: blur(16px) saturate(1.9);
  box-shadow:
    inset 0 1px 0 var(--lg-top),
    inset 0 0 0 1px var(--lg-rim),
    inset 0 -8px 14px -10px var(--lg-glow),
    0 10px 22px -12px var(--lg-shadow);
  transition: box-shadow 0.3s var(--curve-standard);
}
/* the sheen: a bright wash from the top left, and the glint that follows a touch */
.lg::after, .d-plate::after, .d-icon-btn::after, .d-tray::after, .d-streak::after, .d-tabbar::after, .d-plus::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(circle at var(--gx, 50%) var(--gy, -20%), rgba(255, 255, 255, calc(var(--lg-sheen) * var(--touch, 0.55))), transparent 62%),
    linear-gradient(160deg, rgba(255, 255, 255, calc(var(--lg-sheen) * 0.5)), transparent 42%);
  transition: opacity 0.3s var(--curve-standard);
}
.d-tray .d-tb:not(.on):not(.end) { background: transparent; box-shadow: none; }
.d-icon-btn { box-shadow: inset 0 1px 0 var(--lg-top), inset 0 0 0 1px var(--lg-rim), inset 0 -6px 10px -8px var(--lg-glow), 0 6px 14px -8px var(--lg-shadow); }
.d-streak { box-shadow: inset 0 1px 0 var(--lg-top), inset 0 0 0 1px var(--lg-rim), inset 0 -6px 10px -8px var(--lg-glow), 0 6px 14px -8px var(--lg-shadow); }

/* the tab bar and its plus, floating over the list */
.d-tabbar { position: absolute; left: 10px; right: 74px; bottom: 14px; height: 56px; padding: 5px; display: flex; gap: 2px; border-radius: 999px; z-index: 3; }
.d-plus { position: absolute; right: 10px; bottom: 14px; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: var(--text); z-index: 3; }
.d-plus svg, .d-tab svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.d-tab { position: relative; flex: 1; display: grid; place-items: center; align-content: center; gap: 1px; border-radius: 999px; color: var(--muted); font-size: 9.5px; font-weight: 600; letter-spacing: 0; }
.d-tab span { display: block; line-height: 1; }
/* the chosen tab: a lens of denser glass */
.d-tab.on { color: var(--text); background: linear-gradient(160deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06)); box-shadow: inset 0 1px 0 var(--lg-top), inset 0 0 0 1px var(--lg-rim), 0 4px 10px -6px var(--lg-shadow); }
.d-tab.on svg { color: var(--accent); }

/* light behind the glass */
.d-screen::before, .d-screen::after { content: ""; position: absolute; z-index: 0; border-radius: 50%; pointer-events: none; filter: blur(34px); opacity: 0.5; }
.d-screen::before { display: block; inset: auto; width: 150px; height: 150px; left: -40px; top: 36%; background: color-mix(in srgb, var(--accent) 55%, transparent); animation: d-drift-a 16s ease-in-out infinite alternate; height: 150px; }
.d-screen::after { width: 130px; height: 130px; right: -34px; top: 14%; background: color-mix(in srgb, var(--pastel, var(--accent)) 60%, transparent); animation: d-drift-b 19s ease-in-out infinite alternate; }
.d-view { z-index: 1; }
@keyframes d-drift-a { from { transform: translate(0, 0); } to { transform: translate(120px, 90px); } }
@keyframes d-drift-b { from { transform: translate(0, 0); } to { transform: translate(-90px, 150px); } }
@media (prefers-reduced-motion: reduce) { .d-screen::before, .d-screen::after { animation: none; } }
html.a11y-motion .d-screen::before, html.a11y-motion .d-screen::after { animation: none; }

/* the chat bubble and cards: a hairline edge so they read against the screen in both modes */
.d-bubble { box-shadow: inset 0 0 0 1px var(--border); background: color-mix(in srgb, var(--surface2) 88%, var(--text)); }
.d-plancard, .d-subcard, .d-row { box-shadow: inset 0 0 0 1px var(--border); }
