/* Beat 5, "Two ways to call it" (js/ways.js). Clean paper, big type, real UI: the copy and the try-it control on the
   left, the rendered earbud close-up in the centre (only once the render exists), a One UI phone on the right whose
   lock screen tells the one request. The film above ends on paper and #devices below starts on paper, so the
   section needs no edge of its own: it is the same paper all the way through. */
.ways {
  --bud-ar: 1;
  position: relative; height: 420dvh; background: var(--paper);
}
.ways-pin {
  position: sticky; top: 0; height: 100dvh; overflow: clip;
  display: grid; align-items: center; gap: clamp(1.5rem, 3vw, 3.5rem);
  grid-template-columns: minmax(19rem, 30rem) minmax(0, 1fr) auto;
  grid-template-areas: "copy bud phone";
  max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding: calc(var(--bar-h) + 1rem) var(--gutter) 2rem;
}
/* no render yet: the earbud column steps aside and the phone moves in beside the copy */
.ways:not([data-bud="ready"], [data-bud="loading"]) .ways-pin { grid-template-columns: minmax(19rem, 30rem) auto; grid-template-areas: "copy phone"; justify-content: space-between; }
.ways:not([data-bud="ready"], [data-bud="loading"]) .ways-bud { display: none; }
/* wide: the phone moves in from the edge, sitting about two thirds across the space after the copy, which still
   leaves room for the notice that opens to its left */
@media (width >= 1400px) {
  .ways:not([data-bud="ready"], [data-bud="loading"]) .ways-pin { grid-template-columns: minmax(19rem, 30rem) minmax(0, 2fr) auto minmax(0, 1fr); grid-template-areas: "copy . phone ."; }
}

.ways-copy {
  grid-area: copy; display: grid; gap: clamp(0.75rem, 2.2dvh, 1.35rem); justify-items: start; align-content: center;
  h2 { font-size: var(--step-5); font-family: var(--font-display); font-weight: var(--display-wght); letter-spacing: var(--head-track); line-height: var(--head-lh); max-width: 9ch; }
}
.ways-line { font-size: var(--step-1); line-height: 1.45; color: var(--ink-2); max-width: 27rem; min-height: 4.35lh; }
.ways-try { display: grid; grid-template-areas: "ctl" "answer"; justify-content: start; justify-items: start; align-items: center; row-gap: 0.75rem; min-height: 3.5rem; margin-top: 0.4rem; }
/* the start control and the live session control share one place and morph into each other (no snap) */
.ways-try > :is(.hold-try, .hold-voice, .ways-session) { grid-area: ctl; justify-self: start; }
.ways-try > .ways-answer { grid-area: answer; }
.ways-session {
  display: inline-flex; align-items: center; gap: 0.7rem; min-height: 3.25rem; padding: 0.4rem 0.45rem 0.4rem 0.5rem;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper);
}
.ways-session-orb { display: grid; place-items: center; width: 34px; height: 34px; }
.ways-session-label { font: 500 1rem/1.2 var(--font); color: var(--ink); white-space: nowrap; }
.ways-session-end {
  /* the design system's secondary button, small (.ds-btn .ds-btn--sm, css/ds.css) */
  margin-left: 0.2rem; min-height: max(var(--target, 24px), 2.25rem); padding: 0 1rem; border: 0; border-radius: var(--ds-r-pill);
  background: var(--ds-soft); color: var(--ink); font: 500 0.88rem/1 var(--font); cursor: pointer;
  transition: background-color var(--ds-t-hover) ease-out, scale var(--ds-t-press) ease-out;
  &:hover { background: var(--ds-soft-hover); }
  &:active { scale: var(--press); }
}
/* hidden side of the morph: faded, slightly smaller, a little blurred; it can't be reached while hidden. Staged: the
   outgoing control leaves first (160 ms, accelerating), the incoming one follows 60 ms later (280 ms, decelerating) */
.ways-try > :is(.hold-try, .hold-voice, .ways-session) { transition: opacity 0.28s var(--ease-enter) 0.06s, scale 0.28s var(--ease-enter) 0.06s, filter 0.28s var(--ease-enter) 0.06s, visibility 0s; }
.ways-session, .ways[data-session] .ways-try > :is(.hold-try, .hold-voice) { opacity: 0; scale: 0.97; filter: blur(4px); visibility: hidden; pointer-events: none;
  transition: opacity 0.16s var(--ease-exit), scale 0.16s var(--ease-exit), filter 0.16s var(--ease-exit), visibility 0s 0.16s; }
.ways[data-session] .ways-session { opacity: 1; scale: 1; filter: none; visibility: visible; pointer-events: auto;
  transition: opacity 0.28s var(--ease-enter) 0.06s, scale 0.28s var(--ease-enter) 0.06s, filter 0.28s var(--ease-enter) 0.06s, visibility 0s; }
.ways-session-label.is-new { animation: ways-label-in 0.32s var(--ease-out) both; }
@keyframes ways-label-in { from { opacity: 0; filter: blur(4px); } }
@media (prefers-reduced-motion: reduce) { .ways-try > *, .ways-session-label.is-new { transition: none !important; animation: none !important; } }
html[data-motion="off"] :is(.ways-try > *, .ways-session-label.is-new) { transition: none !important; animation: none !important; }
.ways-says { min-height: 2.9em; line-height: 1.45; font-size: 1rem; color: var(--ink-2); max-width: 22rem; }   /* clear of the permissions notice beside the phone */
.ways-fine { font: var(--ds-fine); color: var(--ink-3); }   /* type role: fine (css/ds.css) */

/* ---- the earbud close-up: a canvas drawing the rendered frames; it sits on the paper with no frame of its own */
.ways-bud {
  grid-area: bud; position: relative; align-self: stretch; min-height: 0;
  display: grid; place-items: center; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
/* absolutely placed so the canvas's own pixel size never feeds back into the layout */
.ways-bud-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
[data-mode="gesture"] .ways[data-bud="ready"] .ways-bud { cursor: pointer; }
/* Vivi's own small blue light on the touch area while the finger is on it */
.ways-bloom {
  position: absolute; left: 50%; top: 50%; width: 3.25rem; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, color-mix(in oklch, var(--accent) 55%, transparent), color-mix(in oklch, var(--accent) 18%, transparent) 60%, transparent);
  transition: opacity 0.3s var(--ease-enter);
  &[data-on] { opacity: 0.7; }
  &[data-held] { opacity: 1; }
}
/* js/ways.js places it with translate (left/top stay 0); it grows in from 0.97, never from a dot */
.ways-bloom { left: 0; top: 0; }
@media (prefers-reduced-motion: no-preference) {
  [data-motion="on"] .ways-bloom { scale: 0.97; transition: opacity 0.3s var(--ease-enter), scale 0.3s var(--ease-enter); }
  [data-motion="on"] .ways-bloom[data-held] { scale: 1; }
  /* breathing: ease-in-out both ways, so the loop never snaps at either end */
  [data-motion="on"] .ways-bloom[data-held] { animation: ways-bloom 1.2s ease-in-out infinite alternate; }
}
@keyframes ways-bloom { to { scale: 1.18; } }

/* ---- the phone: the Galaxy frame from css/screens.css, a soft contact shadow, no card */
.ways-phone {
  grid-area: phone; justify-self: center;
  .vs-demo { width: min(276px, 21vw, calc((100dvh - var(--bar-h) - 5rem) / 2.17)); }
}
/* the lock screen's Vivi notification: One UI note style from screens.css, plus the words as they're heard */
.vs-demo--ways {
  .ways-note { animation: none; }
  .ways-you { font-size: calc(12.5 * var(--u)) !important; color: var(--vs-ink-2); margin-top: calc(8 * var(--u)) !important; }
  .ways-quote { margin-top: calc(2 * var(--u)) !important; font-size: calc(17 * var(--u)) !important; line-height: 1.25; text-wrap: pretty; }
  .ways-note .vs-say { margin-top: calc(10 * var(--u)) !important; font-size: calc(13.5 * var(--u)); }
  .ways-caption { color: var(--vs-ink-2); }
  .ways-caption[data-words] { color: var(--vs-ink); font-weight: 500; }
  .vs-note--ask .aui-ap-cmd { margin-top: calc(9 * var(--u)); font-size: calc(16 * var(--u)); }
  .ways-send { color: var(--hb-text); flex: 0 auto; min-height: calc(40 * var(--u)); padding-inline: calc(18 * var(--u)); font: 600 calc(14 * var(--u)) / 1 var(--vs-ui); }
}
@media (prefers-reduced-motion: no-preference) {
  /* a new notification arrives the One UI way: it drops in from above and settles; the swap blurs a little */
  [data-motion="on"] .vs-demo--ways .ways-note { animation: ways-note-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
}
@keyframes ways-note-in { from { opacity: 0; translate: 0 calc(-14 * var(--u)); filter: blur(6px); } }

/* ---- Messages, as Vivi drives it on its background screen (shown in the Vivi app's live small view) */
.vs-demo--ways {
  .wm-app { background: var(--vs-bg); }
  .wm-hero { padding: calc(64 * var(--u)) calc(24 * var(--u)) calc(24 * var(--u)); text-align: center; }
  .wm-hero h3 { font-size: calc(30 * var(--u)); font-weight: 700; letter-spacing: -0.02em; }
  .wm-hero small { display: block; margin-top: calc(6 * var(--u)); font-size: calc(13 * var(--u)); color: var(--vs-ink-2); }
  .wm-tools { display: flex; justify-content: flex-end; gap: calc(16 * var(--u)); padding: 0 calc(20 * var(--u)) calc(10 * var(--u)); }
  .wm-tools .vs-i { width: calc(22 * var(--u)); height: calc(22 * var(--u)); }
  .wm-list { padding: calc(4 * var(--u)) 0; }
  .wm-row { position: relative; display: flex; align-items: center; gap: calc(12 * var(--u)); padding: calc(12 * var(--u)) calc(16 * var(--u)); font-size: calc(15 * var(--u)); }
  .wm-row.is-pressed { background: color-mix(in oklch, var(--vs-ink) 7%, transparent); }
  .wm-row .vs-avatar { width: calc(40 * var(--u)); height: calc(40 * var(--u)); }
  .wm-name { flex: 1; min-width: 0; font-weight: 600; }
  .wm-name small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 400; font-size: calc(13 * var(--u)); color: var(--vs-ink-2); }
  .wm-row time { align-self: flex-start; font-size: calc(11.5 * var(--u)); color: var(--vs-ink-2); }
  .wm-badge { position: absolute; right: calc(16 * var(--u)); bottom: calc(14 * var(--u)); display: grid; place-items: center; min-width: calc(18 * var(--u)); height: calc(18 * var(--u)); border-radius: 999px; background: var(--vs-danger); color: var(--vs-danger-ink); font-size: calc(11 * var(--u)); }
  .wm-in, .wm-composer { position: relative; }
  .wm-composer.has-text span { color: var(--vs-ink); }
  .wm-send { display: grid; place-items: center; width: calc(32 * var(--u)); height: calc(32 * var(--u)); border-radius: 50%; background: var(--vs-accent-deep); color: var(--vs-accent-ink); }
  .wm-send .aui-i { width: calc(18 * var(--u)); height: calc(18 * var(--u)); }
  .work-pip.ways-pip { pointer-events: none; width: calc(164 * var(--u)); bottom: calc(84 * var(--u)); }
  /* the receipt: once you confirm, healing light runs round the sheet's own outline (js/ui/approve-fx.js, pixelfx
     holy/vivi-approve); its canvas stays inside the sheet's stacking context */
  .ways-sheet { isolation: isolate; }
}

/* the answer: at Vivi's question the start control steps aside for a VoicePill that stands in for speaking */
.ways-answer {
  display: none; align-items: center; gap: 0.9rem; min-height: 44px;
  .hold-voice-label { font: 500 1rem/1.2 var(--font); color: var(--ink); transition: opacity 0.15s ease-out; }
  &:has(.ui-voice-pill[data-state="listening"]) .hold-voice-label { opacity: 0; }
}
/* the answer appears under the live session at Vivi's question; its row is always reserved so nothing jumps */
.ways-try > .ways-answer { display: inline-flex; visibility: hidden; opacity: 0; scale: 0.97; transition: opacity 0.16s var(--ease-exit), scale 0.16s var(--ease-exit), visibility 0s 0.16s; }
.ways[data-session][data-step="ask"] .ways-try > .ways-answer { visibility: visible; opacity: 1; scale: 1; transition: opacity 0.28s var(--ease-enter) 0.24s, scale 0.28s var(--ease-enter) 0.24s, visibility 0s; }
.vs-demo--ways {
  .vs-bar-title .aui-dm { display: inline-grid; width: calc(12 * var(--u)); height: calc(12 * var(--u)); margin-right: calc(5 * var(--u)); vertical-align: calc(-1.5 * var(--u)); }
  .ways-listen { margin-top: calc(10 * var(--u)) !important; font-size: calc(13 * var(--u)); color: var(--vs-ink-2); }
  /* One UI info row: an icon and one line of secondary text, no pill */
  .ways-perm { display: flex; gap: calc(8 * var(--u)); align-items: flex-start; margin-top: calc(10 * var(--u)) !important; padding-top: calc(10 * var(--u)); border-top: 1px solid var(--vs-line); font-size: calc(12 * var(--u)); line-height: 1.4; color: var(--vs-ink-2); }
  .ways-perm .vs-i { width: calc(15 * var(--u)); height: calc(15 * var(--u)); margin-top: calc(1 * var(--u)); }
  .work-speaking { margin-top: calc(-4 * var(--u)) !important; padding-left: calc(32 * var(--u)) !important; }
}

/* Vivi's app is a window over the home screen; it opens from its icon (One UI's app-open zoom) */
.vs-demo--ways .ways-win { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; background: var(--vs-bg); border-radius: inherit; overflow: hidden; }
.vs-demo--ways .ways-win[data-open] { animation: ways-fade 0.3s ease-out both; }
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion="off"]) .vs-demo--ways .ways-win[data-open] { transform-origin: var(--ox) var(--oy); animation: ways-open 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
}
@keyframes ways-fade { from { opacity: 0; } }
/* scrolling back out of the app: home zooms back in under it (the reverse of the app-open zoom) */
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion="off"]) .vs-demo--ways .vs-screen[data-closing] > .hs { animation: ways-close 0.28s var(--ease-enter) both; }
}
@keyframes ways-close { from { opacity: 0.4; scale: 1.04; } }
@keyframes ways-open { from { scale: var(--s0, 0.15); opacity: 0; border-radius: 30%; } 35% { opacity: 1; } }

/* the site's notice to the visitor at Vivi's question (not part of the phone): how much Vivi asks is a setting */
.ways-phone-hold { position: relative; }
.ways-notice {
  position: absolute; right: calc(100% + clamp(1.5rem, 3vw, 3rem)); bottom: 8%; width: var(--ds-note-w);
  /* its look is the design system's note (.ds-note, css/ds.css): the same note as in #work */
  opacity: 0; translate: 0 var(--ds-enter-y); scale: 0.97; visibility: hidden;
  transition: opacity var(--ds-t-exit) var(--ease-exit), translate var(--ds-t-exit) var(--ease-exit), scale var(--ds-t-exit) var(--ease-exit), visibility 0s var(--ds-t-exit);
}
/* staged: the phone leads the beat, the notice follows 120 ms later (and the critter after that, js/companion.js) */
.ways:is([data-step="ask"], [data-step="look"], [data-step="auto"]) .ways-notice { opacity: 1; translate: 0 0; scale: 1; visibility: visible;
  transition: opacity var(--ds-t-enter) var(--ease-enter) var(--ds-stagger), translate var(--ds-t-enter) var(--ease-enter) var(--ds-stagger), scale var(--ds-t-enter) var(--ease-enter) var(--ds-stagger), visibility 0s; }
@media (prefers-reduced-motion: reduce) { .ways-notice { translate: none; scale: none; transition: none !important; } }
html[data-motion="off"] .ways-notice { translate: none; scale: none; transition: none !important; }

.vs-demo--ways .work-pip-screen:has(.gm) { background: var(--gm-bg); }
.vs-demo--ways .ways-pip:has(.gm) { border-color: var(--vs-accent); }
/* ---- Google Messages (Vivi's background screen in the small view), after reference/oneui-home/ref-1948.jpeg
   (738 px = 384 u): big centred wordmark, search + profile, a rounded sheet of conversations, two FABs. It follows the
   phone's theme like every app on it: its dark theme (the reference) on a dark phone, its official light theme on a light one. */
.vs-demo--ways { --gm-bg: light-dark(oklch(0.95 0.008 265), oklch(0.235 0.006 270)); }
.vs-demo--ways .gm {
  --gm-sheet: light-dark(oklch(0.995 0.002 265), oklch(0.17 0.004 270)); --gm-ink: light-dark(oklch(0.2 0.01 265), oklch(0.95 0.003 270)); --gm-ink-2: light-dark(oklch(0.45 0.012 265), oklch(0.8 0.005 270));
  --gm-tonal: light-dark(oklch(0.92 0.01 265), oklch(0.31 0.006 270)); --gm-blue: light-dark(oklch(0.88 0.06 262), oklch(0.82 0.07 262)); --gm-on-blue: light-dark(oklch(0.27 0.07 262), oklch(0.25 0.06 262));
  position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--gm-bg); color: var(--gm-ink);
  font-family: var(--vs-ui);
  svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  svg .f { fill: currentColor; stroke: none; }
  .gm-i { display: grid; place-items: center; width: calc(24 * var(--u)); height: calc(24 * var(--u)); flex: none; }
  .gm-word { margin: calc(150 * var(--u)) 0 0 !important; text-align: center; font-size: calc(28 * var(--u)); font-weight: 500; letter-spacing: -0.01em; }
  .gm-tools { display: flex; justify-content: flex-end; align-items: center; gap: calc(18 * var(--u)); padding: calc(78 * var(--u)) calc(14 * var(--u)) calc(12 * var(--u)); }
  .gm-me { display: grid; place-items: center; width: calc(42 * var(--u)); height: calc(42 * var(--u)); border-radius: 50%; padding: calc(9 * var(--u));
    background: light-dark(oklch(0.86 0.03 260), oklch(0.42 0.02 260)); color: light-dark(oklch(0.4 0.03 260), oklch(0.85 0.02 260)); box-shadow: 0 0 0 calc(2.5 * var(--u)) oklch(0.62 0.16 258); }
  .gm-sheet { flex: 1; border-radius: calc(26 * var(--u)) calc(26 * var(--u)) 0 0; background: var(--gm-sheet); padding-top: calc(10 * var(--u)); }
  .gm-row { position: relative; display: flex; align-items: center; gap: calc(18 * var(--u)); padding: calc(17 * var(--u)) calc(26 * var(--u)) calc(17 * var(--u)) calc(17 * var(--u)); }
  .gm-row.is-pressed { background: color-mix(in oklch, var(--gm-ink) 7%, transparent); }
  .gm-main { flex: 1; min-width: 0; display: grid; gap: calc(3 * var(--u)); }
  .gm-main b { font-size: calc(16 * var(--u)); font-weight: 450; }
  .gm-main small { font-size: calc(14.5 * var(--u)); line-height: 1.3; color: var(--gm-ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .gm-row:has(.gm-count) .gm-main small { color: var(--gm-ink); }
  .gm-side { align-self: flex-start; display: grid; justify-items: end; gap: calc(7 * var(--u)); padding-top: calc(2 * var(--u)); }
  .gm-side time { font-size: calc(12.5 * var(--u)); white-space: nowrap; }
  .gm-count { display: grid; place-items: center; min-width: calc(21 * var(--u)); height: calc(16 * var(--u)); padding: 0 calc(5 * var(--u)); border-radius: 999px;
    background: var(--gm-blue); color: var(--gm-on-blue); font: normal 500 calc(11 * var(--u)) / 1 var(--vs-ui); }
  .gm-av { flex: none; display: grid; place-items: center; width: calc(55 * var(--u)); height: calc(55 * var(--u)); border-radius: 50%;
    background: oklch(0.55 0.06 var(--h, 260)); color: oklch(0.97 0.01 var(--h, 260)); font-size: calc(22 * var(--u)); font-weight: 400; }
  .gm-av--unknown { background: light-dark(oklch(0.88 0.006 270), oklch(0.33 0.004 270)); color: light-dark(oklch(0.55 0.006 270), oklch(0.72 0.004 270)); padding: calc(13 * var(--u)); }
  .gm-av--unknown svg { fill: currentColor; stroke: none; }
  .gm-av--sm { width: calc(36 * var(--u)); height: calc(36 * var(--u)); font-size: calc(15 * var(--u)); }
  .gm-av--xs { width: calc(28 * var(--u)); height: calc(28 * var(--u)); font-size: calc(12 * var(--u)); align-self: flex-end; }
  .gm-fab { position: absolute; right: calc(26 * var(--u)); display: grid; place-items: center; width: calc(60 * var(--u)); height: calc(60 * var(--u)); padding: calc(18 * var(--u)); }
  .gm-fab--spark { bottom: calc(110 * var(--u)); border-radius: 50%; background: var(--gm-tonal); color: light-dark(oklch(0.5 0.15 265), oklch(0.7 0.13 265)); }
  .gm-fab--compose { bottom: calc(42 * var(--u)); width: calc(62 * var(--u)); height: calc(62 * var(--u)); border-radius: calc(22 * var(--u)); background: light-dark(oklch(0.88 0.06 262), oklch(0.4 0.08 264)); color: light-dark(oklch(0.3 0.08 262), oklch(0.88 0.04 262)); }
  /* the thread */
  .gm-bar { display: flex; align-items: center; gap: calc(14 * var(--u)); padding: calc(10 * var(--u)) calc(16 * var(--u)); }
  .gm-name { flex: 1; font-size: calc(17 * var(--u)); font-weight: 500; }
  .gm-msgs { flex: 1; display: flex; flex-direction: column; gap: calc(6 * var(--u)); padding: calc(6 * var(--u)) calc(14 * var(--u)); }
  .gm-day { align-self: center; margin: calc(8 * var(--u)) 0 calc(2 * var(--u)) !important; font-size: calc(11.5 * var(--u)); color: var(--gm-ink-2); }
  .gm-b { position: relative; display: flex; align-items: flex-end; gap: calc(8 * var(--u)); max-width: 82%; }
  .gm-b p { padding: calc(10 * var(--u)) calc(15 * var(--u)); border-radius: calc(20 * var(--u)); font-size: calc(15 * var(--u)); line-height: 1.35; }
  .gm-b--in p { background: var(--gm-tonal); }
  .gm-b--out { align-self: flex-end; }
  .gm-b--out p { background: light-dark(oklch(0.5 0.15 262), oklch(0.45 0.11 262)); color: oklch(0.98 0.01 262); }
  .gm-compose { position: relative; display: flex; align-items: center; gap: calc(8 * var(--u)); padding: calc(8 * var(--u)) calc(10 * var(--u)) calc(30 * var(--u)); }
  .gm-plus { display: grid; place-items: center; width: calc(38 * var(--u)); height: calc(38 * var(--u)); padding: calc(8 * var(--u)); border-radius: 50%; background: var(--gm-tonal); flex: none; }
  .gm-field { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: calc(10 * var(--u)); height: calc(44 * var(--u)); padding: 0 calc(12 * var(--u)) 0 calc(16 * var(--u)); border-radius: 999px; background: light-dark(oklch(0.92 0.01 265), oklch(0.29 0.006 270)); }
  .gm-field > span:first-child { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: calc(14.5 * var(--u)); color: var(--gm-ink-2); }
  .gm-field.has-text > span:first-child { color: var(--gm-ink); }
  .gm-mic { display: grid; place-items: center; width: calc(44 * var(--u)); height: calc(44 * var(--u)); padding: calc(11 * var(--u)); border-radius: 50%; background: var(--gm-blue); color: var(--gm-on-blue); flex: none; }
}

/* the earbud that just spoke (assets/earbud-hd/cutout): a small transparent cut-out beside the caption, no box */
.vs-demo--ways .ways-said { display: flex; align-items: center; gap: calc(6 * var(--u)); }
.vs-demo--ways .ways-bud-cut { flex: none; display: block; width: calc(20 * var(--u)); height: calc(20 * var(--u)); }
.vs-demo--ways .ways-bud-cut :is(picture, img) { display: block; width: 100%; height: 100%; object-fit: contain; }

/* the approval's own controls (voice first, never voice only): quiet "No, wait" and the primary "Send to Sam", kept apart */
.vs-demo--ways .ways-sheet .aui-ap-actions { justify-content: space-between; flex-wrap: nowrap; gap: calc(12 * var(--u)); }
.vs-demo--ways .ways-sheet .aui-ap-once { flex: 0 1 auto; min-height: calc(44 * var(--u)); padding: 0 calc(22 * var(--u)); }
.vs-demo--ways .ways-sheet .aui-ap-once:active, .vs-demo--ways .ways-sheet .aui-ap-ghost:active { scale: 0.97; }

/* the plan under the picker is the design system's .ds-plan; here it is only placed */
.ways-plan { width: min(100%, 24rem); transition: opacity 0.18s ease-out, filter 0.18s ease-out; }
[data-mode-swap="out"] .ways-plan { opacity: 0; filter: blur(4px); }

/* the mode swap: the close-up and the phone crossfade with the copy (main.js sets data-mode-swap) */
.ways-bud-canvas, .ways-phone .vs-screen { transition: opacity 0.18s ease-out, filter 0.18s ease-out; }
[data-mode-swap="out"] :is(.ways-bud-canvas, .ways-says) { opacity: 0; filter: blur(6px); }
/* the phone's screen never goes empty during the swap: it only softens */
[data-mode-swap="out"] .ways-phone .vs-screen { opacity: 0.55; filter: blur(4px); }

/* short desktop screens: the copy's reserved lines tighten so it fits beside the phone */
@media (width >= 900px) and (height < 760px) {
  .ways-line { min-height: 3lh; }
  .ways-try { min-height: 3rem; margin-top: 0; }
  .ways-pin { padding-bottom: 1rem; }
}
/* very short (a 1080p laptop at 200% zoom): the headline goes on one line and the reserved space tightens again */
@media (width >= 900px) and (height < 560px) {
  .ways-copy { gap: 0.5rem; h2 { max-width: none; } }
  .ways-line { min-height: 2lh; }
  .ways-try { row-gap: 0.4rem; }
  .ways-pin { padding-top: calc(var(--bar-h) + 0.25rem); padding-bottom: 0.5rem; }
}

/* ---- narrow: one column; the phone comes before the try-it control so you see what your hold does */
@media (width < 900px) {
  .ways { height: auto; }
  .ways-pin, .ways:not([data-bud="ready"], [data-bud="loading"]) .ways-pin {
    position: relative; height: auto; overflow: visible;
    grid-template-columns: minmax(0, 1fr); justify-content: stretch;
    grid-template-areas: "head" "bud" "phone" "try";
    gap: 1.25rem; padding: 5rem 1.25rem 3rem;
  }
  .ways-copy { display: contents; }
  .ways-copy > h2, .ways-copy > .mode-pick, .ways-copy > .ways-plan { grid-area: auto; }
  .ways-copy > h2 { grid-row: 1; font-size: clamp(2.4rem, 11vw, 3rem); max-width: none; }
  .ways-copy > .mode-pick { grid-row: 2; }
  .ways-copy > .ways-plan { grid-row: 3; }
  .ways-bud { grid-area: auto; grid-row: 4; aspect-ratio: var(--bud-ar); max-height: 48dvh; justify-self: center; width: 100%; }
  /* a tall row: the phone sticks below the bar with the try-it control docked under it while scroll plays the story */
  .ways-phone { grid-area: auto; grid-row: 5; justify-self: stretch; height: 260dvh; margin-top: 0.5rem;
    .vs-demo { width: min(272px, 72vw, calc((100dvh - 4.5rem - 16.5rem) / 2.26)); } }
  .ways-phone-hold { position: sticky; top: 4.5rem; display: grid; justify-items: center; gap: 0.9rem; }
  .ways-dock { display: grid; justify-items: center; gap: 0.35rem; text-align: center; }
  .ways-dock .ways-try { min-height: 3.25rem; margin: 0; }
  .ways-dock { grid-template-areas: "try" "msg"; }
  .ways-dock .ways-try { grid-area: try; grid-template-areas: "ctl answer"; justify-content: center; column-gap: 0.75rem; }
  /* narrow, at Vivi's question: the session control shrinks to orb + End so the answer fits beside it */
  .ways[data-step="ask"] .ways-dock .ways-session-label { display: none; }
  .ways-dock .ways-answer { gap: 0.6rem; }
  .ways-dock .ways-try > .ways-answer { display: none; }
  /* in the live session the (hidden) start control mustn't widen the row: take it out of the layout */
  .ways[data-session] .ways-dock .ways-try > :is(.hold-try, .hold-voice) { display: none; }
  .ways[data-session][data-step="ask"] .ways-dock .ways-try > .ways-answer { display: inline-flex; }
  .ways-dock .ways-says { grid-area: msg; align-self: start; min-height: 2.9em; font-size: 0.95rem; max-width: 22rem; }
  .ways-dock .ways-notice { grid-area: msg; position: static; width: min(22rem, 100%); }   /* .ds-note--compact-auto */
  .ways:is([data-step="ask"], [data-step="look"], [data-step="auto"]) .ways-dock .ways-says { visibility: hidden; }
  .ways-copy > .ways-fine { grid-row: 6; justify-self: center; }
}

/* The hero ends on the close-up. The next section gives the phone and controls their space. */
.ways[data-film-handoff="true"] .ways-bud { display: none; }
@media (width < 900px) {
  .ways[data-film-handoff="true"] .ways-pin { grid-template-areas: none; }
  .ways[data-film-handoff="true"] .ways-phone { grid-row: 4; }
}

/* One continuous shot: the existing UI rises beside the earbud, over the film's sticky stage. */
.film > .ways[data-film-handoff="true"] {
  margin-top: 1200dvh; height: 420dvh; background: transparent; color: var(--ink); z-index: 2;
}
.film > .ways[data-film-handoff="true"] .ways-pin {
  position: sticky; top: 0; height: 100dvh; max-width: none;
  grid-template-columns: minmax(0, 32%) minmax(0, 1fr) minmax(0, 24%);
  grid-template-areas: "copy bud phone"; gap: 2vw;
  padding: calc(var(--bar-h) + 1rem) clamp(1.25rem, 5vw, 6rem) 1.5rem;
  overflow: visible;
  background: linear-gradient(90deg, color-mix(in oklch, var(--paper) 94%, transparent), color-mix(in oklch, var(--paper) 60%, transparent) 28%, transparent 43%, transparent 62%, color-mix(in oklch, var(--paper) 65%, transparent));
}
.film > .ways .ways-copy { position: relative; z-index: 1; }
.film > .ways .ways-copy h2 { font-size: clamp(2.4rem, 4.4vw, 4.5rem); }
.film > .ways .ways-phone { height: auto; margin: 0; justify-self: end; }
.film > .ways .ways-phone-hold { position: relative; top: auto; }
.film > .ways .ways-notice { left: 50%; right: auto; bottom: 1rem; width: min(22rem, 80vw); translate: -50% 0; z-index: 3; }
.film > .ways .ways-phone .vs-demo { width: min(280px, 23vw, calc((100dvh - var(--bar-h) - 5rem) / 2.17)); }
@media (width < 900px) {
  .film > .ways[data-film-handoff="true"] .ways-pin {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
    grid-template-areas: "head head" "mode mode" "plan plan" ". phone" "try try" "says says";
    gap: .5rem 1rem; padding: calc(var(--bar-h) + 1.5rem) 1rem .75rem;
    background: linear-gradient(180deg, var(--paper), color-mix(in oklch, var(--paper) 80%, transparent) 25%, transparent 43%, transparent 68%, color-mix(in oklch, var(--paper) 95%, transparent) 83%);
  }
  .film > .ways .ways-copy { display: contents; }
  .film > .ways .ways-copy h2 { grid-area: head; font-size: clamp(1.8rem, 7vw, 2.5rem); max-width: none; }
  .film > .ways .ways-copy > .mode-pick { grid-area: mode; }
  .film > .ways .ways-plan { grid-area: plan; width: 100%; font-size: .85rem; }
  .film > .ways .ways-plan li { padding-block: .2rem; }
  .film > .ways .ways-phone { grid-area: phone; align-self: center; justify-self: center; }
  .film > .ways .ways-phone .vs-demo { width: min(180px, 40vw, calc((100dvh - var(--bar-h) - 20rem) / 2.17)); }
  .film > .ways .ways-try { grid-area: try; justify-self: center; margin: 0; min-height: 0; grid-template-areas: "ctl answer"; gap: .5rem; }
  .film > .ways .ways-says { grid-area: says; text-align: center; justify-self: center; font-size: .85rem; min-height: 2.5em; }
  .film > .ways .ways-try > .ways-answer { display: none; }
  .film > .ways[data-session][data-step="ask"] .ways-try > .ways-answer { display: inline-flex; }
  .film > .ways[data-step="ask"] .ways-session-label { display: none; }
  .film > .ways .ways-answer .hold-voice-label { max-width: 7rem; font-size: .8rem; }
  .film > .ways .ways-notice { display: none; grid-area: plan; position: static; translate: none; width: 100%; }
  .film > .ways:is([data-step="ask"], [data-step="look"], [data-step="auto"]) .ways-notice { display: grid; }
  .film > .ways:is([data-step="ask"], [data-step="look"], [data-step="auto"]) .ways-plan { visibility: hidden; }
  .film > .ways:is([data-step="ask"], [data-step="look"], [data-step="auto"]) .ways-phone .vs-demo { width: min(156px, 40vw, calc((100dvh - var(--bar-h) - 27rem) / 2.17)); }
}
