/* ==========================================================================
   Pilbot — landing page
   Material Design 3 tokens matched to the Pilbot extension UI.
   ========================================================================== */

/* Tokens ------------------------------------------------------------------- */

:root {
  color-scheme: light;

  --md-primary: #535E79;
  --md-on-primary: #FFFFFF;
  --md-primary-container: #D8E2FB;
  --md-on-primary-container: #111C33;
  --md-surface-container-high: #E7E7EC;
  --md-on-surface: #1A1B21;
  --md-on-surface-variant: #45464F;
  --md-outline: #757780;
  --md-outline-variant: #C5C6D0;
  --md-error: #BA1A1A;
  --md-tertiary-container: #F3DCF4;

  --bg: #F4F3FA;
  --card: #FFFFFF;
  --pill-ring: #F3F3F7;
  --pill-seg: #E4E4EA;
  --pill-icon: #44474F;

  /* Hero animation */
  --demo-page: #FFFFFF;
  --skeleton: #E6E6EE;
  --skeleton-strong: #D5D7E2;
  --pop: #FFFFFF;
  --pop-stroke: #D9DAE2;
  --demo-sel: rgb(66 120 230 / .3);

  /* Dictation recording state (M3 error roles) */
  --rec-bg: #F9DEDC;
  --rec-fg: #B3261E;

  --shadow: 26 28 40;

  --font: "Google Sans Flex", "Google Sans", "Google Sans Text", Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --container: 1160px;
  --gutter: clamp(20px, 5vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --md-primary: #BAC6EA;
    --md-on-primary: #243048;
    --md-primary-container: #3B4660;
    --md-on-primary-container: #D8E2FB;
    --md-surface-container-high: #2B2C30;
    --md-on-surface: #E4E2E7;
    --md-on-surface-variant: #C5C6D0;
    --md-outline: #8F9099;
    --md-outline-variant: #45464F;
    --md-error: #FFB4AB;
    --md-tertiary-container: #4C3E55;
    --bg: #1B1B1F;
    --card: #26272B;
    --pill-ring: #3A3A3E;
    --pill-seg: #2B2B2F;
    --pill-icon: #C5C6D0;
    --demo-page: #1B1B1F;
    --skeleton: #2F3035;
    --skeleton-strong: #3C3D43;
    --pop: #26272B;
    --pop-stroke: #3A3B40;
    --demo-sel: rgb(138 170 255 / .32);
    --rec-bg: #F2B8B5;
    --rec-fg: #8C1D18;
    --shadow: 0 0 0;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --md-primary: #BAC6EA;
  --md-on-primary: #243048;
  --md-primary-container: #3B4660;
  --md-on-primary-container: #D8E2FB;
  --md-surface-container-high: #2B2C30;
  --md-on-surface: #E4E2E7;
  --md-on-surface-variant: #C5C6D0;
  --md-outline: #8F9099;
  --md-outline-variant: #45464F;
  --md-error: #FFB4AB;
  --md-tertiary-container: #4C3E55;
  --bg: #1B1B1F;
  --card: #26272B;
  --pill-ring: #3A3A3E;
  --pill-seg: #2B2B2F;
  --pill-icon: #C5C6D0;
  --demo-page: #1B1B1F;
  --skeleton: #2F3035;
  --skeleton-strong: #3C3D43;
  --pop: #26272B;
  --pop-stroke: #3A3B40;
  --demo-sel: rgb(138 170 255 / .32);
  --rec-bg: #F2B8B5;
  --rec-fg: #8C1D18;
  --shadow: 0 0 0;
}

/* Screenshots: show the one matching the active theme */
.only-dark { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-dark { display: block; }
  :root:not([data-theme="light"]) .only-light { display: none; }
}

:root[data-theme="dark"] .only-dark { display: block; }
:root[data-theme="dark"] .only-light { display: none; }

/* Base --------------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--md-on-surface);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

h1, h2, p, ul { margin: 0; }
/* `hidden` always wins over component display rules (e.g. .btn's inline-flex) */
[hidden] { display: none !important; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
img { display: block; }

:focus-visible {
  outline: 3px solid var(--md-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Read by screen readers, not shown */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.icon {
  display: inline-block;
  flex: none;
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--md-primary);
  color: var(--md-on-primary);
  font-weight: 500;
  text-decoration: none;
}
.skip-link:focus { top: 16px; }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Typography --------------------------------------------------------------- */

.display {
  font-size: clamp(2.25rem, 1.3rem + 3vw, 3.75rem);
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -.035em;
}

.headline {
  font-size: clamp(1.875rem, 1.3rem + 1.9vw, 2.75rem);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.lead {
  font-size: clamp(1.0625rem, 1rem + .25vw, 1.1875rem);
  line-height: 1.55;
  color: var(--md-on-surface-variant);
  text-wrap: pretty;
}

.checklist {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 1.0625rem;
}
.checklist .icon { color: var(--md-primary); }

/* Header ------------------------------------------------------------------- */

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand__icon { width: 50px; height: 37px; }
.brand__name {
  font-size: 1.625rem;
  font-weight: 650;
  letter-spacing: -.025em;
}

.topbar__end {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar__link {
  font-size: 1.0625rem;
  font-weight: 500;
  text-decoration: none;
}
.topbar__link:hover { color: var(--md-primary); }

/* Theme switch — connected button group, like the extension's Theme setting */
.theme-switch { display: none; gap: 3px; }
.js .theme-switch { display: inline-flex; }

.theme-switch__btn {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 52px;
  height: 40px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px 8px 8px 20px;
  background: var(--md-surface-container-high);
  color: var(--md-on-surface-variant);
  cursor: pointer;
  transition: border-radius .3s var(--ease), background-color .25s var(--ease), color .25s var(--ease);
}
.theme-switch__btn + .theme-switch__btn { border-radius: 8px 20px 20px 8px; }
.theme-switch__btn[aria-pressed="true"] {
  border-radius: 20px;
  background: var(--md-primary);
  color: var(--md-on-primary);
}
.theme-switch__btn .icon { width: 20px; height: 20px; }
.theme-switch__btn:focus-visible { outline-offset: 2px; }

/* Buttons & cards ---------------------------------------------------------- */

.theme-switch__btn::before,
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: currentColor;
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.theme-switch__btn:hover::before,
.btn:hover::before { opacity: .08; }
.theme-switch__btn:active::before,
.btn:active::before { opacity: .12; }

.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 56px;
  padding: 0 28px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 1.125rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-radius .3s var(--ease), box-shadow .2s var(--ease);
}
.btn:active { border-radius: 16px; }
button.btn { cursor: pointer; }
.btn--filled { background: var(--md-primary); color: var(--md-on-primary); }
.btn--text { background: transparent; color: var(--md-primary); }
.btn--filled:hover { box-shadow: 0 1px 3px rgb(var(--shadow) / .2); }
.btn--tonal { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.btn--block { display: flex; width: 100%; }

.install-card {
  width: 100%;
  max-width: 420px;
  margin-top: 32px;
  padding: 24px;
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 1px 2px rgb(var(--shadow) / .06), 0 4px 16px rgb(var(--shadow) / .05);
}
.install-card__note {
  margin-top: 14px;
  font-size: .9375rem;
  text-align: center;
  color: var(--md-on-surface-variant);
}

/* "Bring your own key" note with the key icon in front */
.byok {
  display: flex;
  align-items: center;
  gap: 8px;
}
.install-card__note.byok { justify-content: center; }
.byok .icon { width: 20px; height: 20px; }

/* Hero --------------------------------------------------------------------- */

.hero { padding: 8px 0 clamp(56px, 8vw, 104px); }

/* Bento: intro and step cards on the left, the stage spans both rows,
   scroll cue centered underneath */
.hero__bento {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  grid-template-rows: 1fr auto auto;
  grid-template-areas:
    "intro stage"
    "steps stage"
    "more  more";
  gap: 16px;
}

.hero__intro {
  grid-area: intro;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(28px, 4.2vw, 56px);
  border-radius: 40px;
  background: var(--card);
}

/* Scales with the card, so "until you need it." always stays on one line */
.hero__title { font-size: clamp(2rem, 12cqi, 3.75rem); }
.hero__intro .lead { max-width: 30em; margin-top: 20px; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-self: stretch;
  gap: 12px;
  margin-top: 36px;
}
/* Full-width button on phones */
@container (max-width: 360px) {
  .hero__actions .btn { flex: 1 1 auto; }
}
.hero__note {
  margin-top: 16px;
  font-size: .9375rem;
  color: var(--md-on-surface-variant);
}

/* Step cards — each one lights up while its scene plays in the film.
   --on (0 → 1) blends the active colors in, --fill drives the progress bar. */
@property --on { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --fill { syntax: "<number>"; inherits: true; initial-value: 0; }

.hero__steps {
  grid-area: steps;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.step {
  --on: 0;
  --fill: 0;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 100%;
  padding: 18px 18px 20px;
  overflow: hidden;
  border-radius: 28px;
  background: color-mix(in srgb, var(--md-primary-container) calc(var(--on) * 100%), var(--card));
  text-decoration: none;
  animation-duration: 25s;
  animation-iteration-count: infinite;
  animation-timing-function: var(--ease);
}
.step::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--md-on-surface);
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.step:hover::before { opacity: .06; }
.step:active::before { opacity: .1; }

/* Circle morphs into a rounded square while active */
.step__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: calc(22px - var(--on) * 8px);
  background: color-mix(in srgb, var(--md-primary) calc(var(--on) * 100%), color-mix(in srgb, var(--md-on-surface) 9%, var(--card)));
}
/* Two stacked copies cross-fade: Safari doesn't repaint <use> icons when an
   inherited color changes during an animation, but opacity always updates */
.step__icon .icon {
  grid-area: 1 / 1;
  width: 22px;
  height: 22px;
  color: var(--md-on-surface-variant);
  opacity: calc(1 - var(--on));
}
.step__icon .step__icon-on {
  color: var(--md-on-primary);
  opacity: var(--on);
}

.step__title {
  margin-top: 16px;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.step__text {
  margin: 2px 0 18px;
  font-size: .875rem;
  line-height: 1.4;
  color: var(--md-on-surface-variant);
}

/* M3 linear progress indicator */
.step__bar {
  position: relative;
  align-self: stretch;
  height: 4px;
  margin-top: auto;
  overflow: hidden;
  border-radius: 2px;
  background: color-mix(in srgb, var(--md-primary) 16%, transparent);
}
.step__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--md-primary);
  opacity: var(--on);
  transform: scaleX(var(--fill));
  transform-origin: left center;
}

/* Same 25 s timeline as the film below: A 0–29.6 %, B 29.6–56 %, C 56–83.2 % */
.step--a { animation-name: step-a; }
.step--b { animation-name: step-b; }
.step--c { animation-name: step-c; }

@keyframes step-a {
  0% { --on: 0; --fill: 0; }
  2.4% { --on: 1; --fill: 0; animation-timing-function: linear; }
  26.4% { --on: 1; --fill: 1; }
  29.6% { --on: 0; --fill: 1; }
  29.7%, 100% { --on: 0; --fill: 0; }
}
@keyframes step-b {
  0%, 29.6% { --on: 0; --fill: 0; }
  31.2% { --on: 1; --fill: 0; animation-timing-function: linear; }
  52.8% { --on: 1; --fill: 1; }
  56% { --on: 0; --fill: 1; }
  56.1%, 100% { --on: 0; --fill: 0; }
}
@keyframes step-c {
  0%, 56% { --on: 0; --fill: 0; }
  57.6% { --on: 1; --fill: 0; animation-timing-function: linear; }
  80% { --on: 1; --fill: 1; }
  83.2% { --on: 0; --fill: 1; }
  83.3%, 100% { --on: 0; --fill: 0; }
}

/* Stage: tinted panel with slowly turning M3 Expressive shapes behind the film */
.hero__stage {
  grid-area: stage;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 32px 24px;
}

/* Sized to keep the whole hero on one screen */
.hero__film {
  position: relative;
  width: clamp(300px, calc((100vh - 250px) * .815), 456px);
  width: clamp(300px, calc((100svh - 250px) * .815), 456px);
  max-width: 100%;
}

.hero__shape {
  position: absolute;
  height: auto;
  pointer-events: none;
}
.hero__shape--cookie {
  top: -14%;
  right: -24%;
  width: 62%;
  fill: color-mix(in srgb, var(--md-primary) 10%, var(--md-primary-container));
  animation: shape-spin 90s linear infinite;
}
.hero__shape--clover {
  bottom: -12%;
  left: -22%;
  width: 50%;
  fill: var(--md-tertiary-container);
  animation: shape-spin 70s linear infinite reverse;
}

@keyframes shape-spin { to { transform: rotate(1turn); } }

/* Scroll cue: a lone, gently nudging arrow (M3 standard icon button) */
.hero__more {
  position: relative;
  isolation: isolate;
  grid-area: more;
  justify-self: center;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-top: 4px;
  border-radius: 50%;
  color: var(--md-on-surface-variant);
}
.hero__more::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: currentColor;
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.hero__more:hover::before { opacity: .08; }
.hero__more:active::before { opacity: .12; }
.hero__more .icon {
  width: 28px;
  height: 28px;
  animation: arrow-nudge 2s var(--ease) infinite;
}

@keyframes arrow-nudge {
  0%, 60%, 100% { transform: none; }
  30% { transform: translateY(4px); }
}

/* Tinted media panels ------------------------------------------------------ */

.media {
  position: relative;
  overflow: hidden;
  border-radius: 40px;
}
.media--primary { background: color-mix(in srgb, var(--md-primary-container) 55%, var(--bg)); }
.media--frost { background: color-mix(in srgb, var(--md-primary-container) 55%, var(--bg)); }

/* Extension screenshots */
.shot {
  width: auto;
  border: 1px solid var(--md-outline-variant);
  border-radius: 24px;
  box-shadow: 0 2px 4px rgb(var(--shadow) / .06), 0 16px 40px -12px rgb(var(--shadow) / .22);
}

/* Hero animation ------------------------------------------------------------
   A short product film, one 25 s loop shared by every element (1 s = 4 %):
    0–30 %  A  page → zoom on the summary button (top center) → summary below it
   30–56 %  B  text → selection → Ask button → answer bottom-left
   56–83 %  C  text field → mic button below it → recording (red) → typed text
   83–100 % D  logo end card
   ------------------------------------------------------------------------- */

.demo {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 440 / 540;
  font-family: var(--font);
  filter: drop-shadow(0 18px 32px rgb(var(--shadow) / .14));
}

.d-stage { fill: var(--demo-page); }
.d-frame { fill: none; stroke: var(--md-outline-variant); }

.d-win { fill: var(--demo-page); stroke: var(--md-outline-variant); }
.d-bar { fill: var(--md-surface-container-high); }
.d-dot { fill: var(--md-outline-variant); }
.d-url { fill: var(--demo-page); }
.d-sk { fill: var(--skeleton); }
.d-sk-strong { fill: var(--skeleton-strong); }

.d-ring { fill: var(--pill-ring); }
.d-seg { fill: var(--pill-seg); }
.d-ic { fill: var(--pill-icon); }
.d-rec { fill: var(--rec-bg); }
.d-rec-stop { fill: var(--rec-fg); }
.d-pulse { fill: none; stroke: var(--rec-bg); stroke-width: 2.5; }

.d-pop { fill: var(--pop); stroke: var(--pop-stroke); }
.d-label { fill: var(--md-on-surface-variant); font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.d-line { fill: var(--md-on-surface); fill-opacity: .55; }

.d-text { fill: var(--md-on-surface); font-size: 24px; font-weight: 500; letter-spacing: -.01em; }
.d-text--sm { font-size: 20px; font-weight: 400; letter-spacing: 0; }
.d-sel { fill: var(--demo-sel); }

.d-input { fill: var(--demo-page); stroke: var(--md-outline-variant); stroke-width: 1.5; }
.d-input-focus { fill: none; stroke: var(--md-primary); stroke-width: 2.5; }
.d-placeholder { fill: var(--md-on-surface-variant); fill-opacity: .7; font-size: 20px; }
.d-cover { fill: var(--demo-page); }
.d-caret { fill: var(--md-primary); }

.d-cap {
  fill: var(--md-on-surface);
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -.015em;
  text-anchor: middle;
}

.d-logo-ring { fill: #E2E2E9; }
.d-logo-body { fill: #525F77; }
.d-wordmark { fill: var(--md-on-surface); font-size: 40px; font-weight: 650; letter-spacing: -.03em; text-anchor: middle; }
.d-tagline { fill: var(--md-on-surface-variant); font-size: 17px; text-anchor: middle; }
.d-cta { fill: var(--md-primary); }
.d-cta-ic { fill: var(--md-on-primary); }
.d-cta-text { fill: var(--md-on-primary); font-size: 16px; font-weight: 500; text-anchor: middle; }

.d-arrow { fill: var(--md-on-surface); stroke: var(--demo-page); stroke-width: 1; stroke-linejoin: round; }
.d-ripple { fill: var(--md-primary); }

/* Hidden until their moment in the film */
.s-a, .s-b, .s-c, .s-d,
.s-a-pop, .s-b-pill, .s-b-pop, .s-b-l1, .s-b-l2,
.s-c-focus, .s-c-caret, .s-c-mic, .s-c-rec, .s-c-pulse,
.s-d-logo, .s-d-name, .s-d-tag, .s-d-cta,
.s-cap-a, .s-cap-b, .s-cap-c,
.d-cursor, .d-ripple { opacity: 0; }

.demo :is(.s-a, .s-b, .s-c) { transform-box: view-box; transform-origin: 220px 270px; }
.demo .s-a-page { transform-box: view-box; transform-origin: 220px 126px; }
.demo :is(.s-a-pill, .s-b-pill, .s-c-mic, .s-c-pulse, .s-d-logo, .d-ripple) { transform-box: fill-box; transform-origin: center; }
.demo .s-a-pop { transform-box: fill-box; transform-origin: top center; }
.demo .s-b-pop { transform-box: fill-box; transform-origin: bottom left; }
.demo :is(.d-line, .s-b-sel) { transform-box: fill-box; transform-origin: left center; }
.demo .s-c-cover { transform-box: fill-box; transform-origin: right center; }

.demo * {
  animation-duration: 25s;
  animation-iteration-count: infinite;
  animation-timing-function: cubic-bezier(.2, 0, 0, 1);
}

.s-a { animation-name: s-a; }
.s-a-page { animation-name: s-a-page; animation-timing-function: cubic-bezier(.6, 0, .2, 1); }
.s-a-pill { animation-name: s-a-pill; animation-timing-function: cubic-bezier(.6, 0, .2, 1); }
.s-a-pop { animation-name: s-a-pop; }
.s-a-l1 { animation-name: s-a-l1; }
.s-a-l2 { animation-name: s-a-l2; }
.s-a-l3 { animation-name: s-a-l3; }
.s-cap-a { animation-name: s-cap-a; }

.s-b { animation-name: s-b; }
.s-b-l1 { animation-name: s-b-l1; }
.s-b-l2 { animation-name: s-b-l2; }
.s-b-sel { animation-name: s-b-sel; animation-timing-function: linear; }
.s-b-pill { animation-name: s-b-pill; }
.s-b-pop { animation-name: s-b-pop; }
.s-b-a1 { animation-name: s-b-a1; }
.s-b-a2 { animation-name: s-b-a2; }
.s-b-a3 { animation-name: s-b-a3; }
.s-cap-b { animation-name: s-cap-b; }

.s-c { animation-name: s-c; }
.s-c-focus { animation-name: s-c-focus; }
.s-c-ph { animation-name: s-c-ph; }
.s-c-cover { animation-name: s-c-cover; }
.s-c-caret { animation-name: s-c-caret; }
.s-c-mic { animation-name: s-c-mic; }
.s-c-rec { animation-name: s-c-rec; }
.s-c-pulse { animation-name: s-c-pulse; animation-timing-function: ease-out; }
.s-cap-c { animation-name: s-cap-c; }

.s-d { animation-name: s-d; }
.s-d-logo { animation-name: s-d-logo; }
.s-d-name { animation-name: s-d-name; }
.s-d-tag { animation-name: s-d-tag; }
.s-d-cta { animation-name: s-d-cta; }

.d-cursor { animation-name: d-cursor; animation-timing-function: cubic-bezier(.45, 0, .25, 1); }
.d-ripple { animation-name: d-ripple; animation-timing-function: linear; }

/* Scene A — summarize */
@keyframes s-a {
  0% { opacity: 0; transform: scale(.94); }
  2.4%, 26.4% { opacity: 1; transform: none; }
  29.6%, 100% { opacity: 0; transform: translateX(-48px); }
}
@keyframes s-a-page {
  0%, 7.2% { opacity: 1; transform: none; }
  12%, 100% { opacity: 0; transform: scale(2.4); }
}
@keyframes s-a-pill {
  0%, 7.2% { transform: none; }
  12%, 14.3% { transform: translate(0, 24px) scale(1.8); }
  14.6% { transform: translate(0, 24px) scale(1.68); }
  15.2%, 100% { transform: translate(0, 24px) scale(1.8); }
}
@keyframes s-a-pop {
  0%, 14.8% { opacity: 0; transform: translateY(-12px) scale(.96); }
  16%, 100% { opacity: 1; transform: none; }
}
@keyframes s-a-l1 { 0%, 16% { transform: scaleX(0); } 18.4%, 100% { transform: scaleX(1); } }
@keyframes s-a-l2 { 0%, 18.4% { transform: scaleX(0); } 20.8%, 100% { transform: scaleX(1); } }
@keyframes s-a-l3 { 0%, 20.8% { transform: scaleX(0); } 22.4%, 100% { transform: scaleX(1); } }
@keyframes s-cap-a {
  0%, 10% { opacity: 0; transform: translateY(10px); }
  12%, 100% { opacity: 1; transform: none; }
}

/* Scene B — ask */
@keyframes s-b {
  0%, 29.6% { opacity: 0; transform: translateX(48px); }
  31.2%, 52.8% { opacity: 1; transform: none; }
  56%, 100% { opacity: 0; transform: translateX(-48px); }
}
@keyframes s-b-l1 {
  0%, 30.4% { opacity: 0; transform: translateY(10px); }
  32%, 100% { opacity: 1; transform: none; }
}
@keyframes s-b-l2 {
  0%, 31.6% { opacity: 0; transform: translateY(10px); }
  33.2%, 100% { opacity: 1; transform: none; }
}
@keyframes s-b-sel { 0%, 34.4% { transform: scaleX(0); } 37.2%, 100% { transform: scaleX(1); } }
@keyframes s-b-pill {
  0%, 37.6% { opacity: 0; transform: scale(1); }
  38.8%, 40.3% { opacity: 1; transform: scale(1.4); }
  40.6% { opacity: 1; transform: scale(1.28); }
  41.2% { opacity: 1; transform: scale(1.4); }
  42%, 100% { opacity: 0; transform: scale(1.4); }
}
@keyframes s-b-pop {
  0%, 41.2% { opacity: 0; transform: translateY(14px) scale(.96); }
  42.8%, 100% { opacity: 1; transform: none; }
}
@keyframes s-b-a1 { 0%, 42.8% { transform: scaleX(0); } 45.2%, 100% { transform: scaleX(1); } }
@keyframes s-b-a2 { 0%, 45.2% { transform: scaleX(0); } 47.6%, 100% { transform: scaleX(1); } }
@keyframes s-b-a3 { 0%, 47.6% { transform: scaleX(0); } 48.8%, 100% { transform: scaleX(1); } }
@keyframes s-cap-b {
  0%, 32% { opacity: 0; transform: translateY(10px); }
  33.6%, 100% { opacity: 1; transform: none; }
}

/* Scene C — dictate */
@keyframes s-c {
  0%, 56% { opacity: 0; transform: translateX(48px); }
  57.6%, 80% { opacity: 1; transform: none; }
  83.2%, 100% { opacity: 0; transform: translateX(-48px); }
}
@keyframes s-c-focus { 0%, 61.2% { opacity: 0; } 61.6%, 100% { opacity: 1; } }
@keyframes s-c-ph { 0%, 65.9% { opacity: 1; } 66%, 100% { opacity: 0; } }
@keyframes s-c-cover {
  0%, 66% { transform: scaleX(1); animation-timing-function: steps(24, end); }
  74.4%, 100% { transform: scaleX(0); }
}
@keyframes s-c-caret {
  0%, 61.5% { opacity: 0; transform: translateX(0); }
  61.6%, 66% { opacity: 1; transform: translateX(0); animation-timing-function: steps(24, end); }
  74.4%, 100% { opacity: 1; transform: translateX(296px); }
}
@keyframes s-c-mic {
  0%, 62% { opacity: 0; transform: scale(1); }
  63.2%, 65% { opacity: 1; transform: scale(1.5); }
  65.2% { opacity: 1; transform: scale(1.38); }
  65.8%, 75% { opacity: 1; transform: scale(1.5); }
  75.2% { opacity: 1; transform: scale(1.38); }
  75.8%, 100% { opacity: 1; transform: scale(1.5); }
}
@keyframes s-c-rec { 0%, 65.2% { opacity: 0; } 65.6%, 75.2% { opacity: 1; } 75.6%, 100% { opacity: 0; } }
@keyframes s-c-pulse {
  0%, 65.5% { opacity: 0; transform: scale(1); }
  65.6% { opacity: .8; transform: scale(1); }
  69% { opacity: 0; transform: scale(1.4); }
  69.1% { opacity: .8; transform: scale(1); }
  72.5% { opacity: 0; transform: scale(1.4); }
  72.6% { opacity: .8; transform: scale(1); }
  75.2%, 100% { opacity: 0; transform: scale(1.3); }
}
@keyframes s-cap-c {
  0%, 58% { opacity: 0; transform: translateY(10px); }
  59.6%, 100% { opacity: 1; transform: none; }
}

/* Scene D — end card */
@keyframes s-d { 0%, 83.2% { opacity: 0; } 84%, 96.8% { opacity: 1; } 100% { opacity: 0; } }
@keyframes s-d-logo {
  0%, 83.2% { opacity: 0; transform: scale(.5); }
  85.6% { opacity: 1; transform: scale(1.06); }
  86.8%, 100% { opacity: 1; transform: scale(1); }
}
@keyframes s-d-name {
  0%, 86% { opacity: 0; transform: translateY(12px); }
  87.6%, 100% { opacity: 1; transform: none; }
}
@keyframes s-d-tag {
  0%, 87.6% { opacity: 0; transform: translateY(12px); }
  89.2%, 100% { opacity: 1; transform: none; }
}
@keyframes s-d-cta {
  0%, 89.2% { opacity: 0; transform: translateY(12px); }
  90.8%, 100% { opacity: 1; transform: none; }
}

/* Pointer path through scenes A–C */
@keyframes d-cursor {
  0%, 11.5% { opacity: 0; transform: translate(300px, 330px); }
  11.6% { opacity: 1; transform: translate(300px, 330px); }
  14%, 25.2% { opacity: 1; transform: translate(176px, 150px); }
  25.6% { opacity: 0; transform: translate(176px, 150px); }
  25.7%, 32.7% { opacity: 0; transform: translate(220px, 400px); }
  32.8% { opacity: 1; transform: translate(220px, 400px); }
  34%, 34.4% { opacity: 1; transform: translate(236px, 252px); }
  37.2%, 38.4% { opacity: 1; transform: translate(376px, 252px); }
  40%, 51.6% { opacity: 1; transform: translate(272px, 197px); }
  52% { opacity: 0; transform: translate(272px, 197px); }
  52.1%, 58.3% { opacity: 0; transform: translate(300px, 400px); }
  58.4% { opacity: 1; transform: translate(300px, 400px); }
  60.8%, 62.8% { opacity: 1; transform: translate(200px, 232px); }
  64.8%, 78.8% { opacity: 1; transform: translate(352px, 305px); }
  79.2%, 100% { opacity: 0; transform: translate(352px, 305px); }
}

/* A ripple at each tap: summary, Ask, text field, mic, stop */
@keyframes d-ripple {
  0%, 14.3% { opacity: 0; transform: scale(.2); }
  14.4% { opacity: .45; transform: scale(.2); }
  16.4%, 40.3% { opacity: 0; transform: scale(1); }
  40.4% { opacity: .45; transform: scale(.2); }
  42.4%, 61.1% { opacity: 0; transform: scale(1); }
  61.2% { opacity: .45; transform: scale(.2); }
  63.2%, 65.1% { opacity: 0; transform: scale(1); }
  65.2% { opacity: .45; transform: scale(.2); }
  67.2%, 75.1% { opacity: 0; transform: scale(1); }
  75.2% { opacity: .45; transform: scale(.2); }
  77.2%, 100% { opacity: 0; transform: scale(1); }
}

/* Reduced motion: a single still frame of the Ask scene, Ask step highlighted */
@media (prefers-reduced-motion: reduce) {
  .demo *,
  .step,
  .hero__shape,
  .hero__more .icon { animation: none !important; }
  .s-b,
  .s-b-l1,
  .s-b-l2,
  .s-b-pop,
  .s-cap-b { opacity: 1; }
  .s-b-pill { opacity: 1; transform: scale(1.4); }
  .step--b { --on: 1; }
  .step__bar { visibility: hidden; }
}

/* Features ----------------------------------------------------------------- */

.feature { padding-block: clamp(48px, 7vw, 88px); }

.feature__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(40px, 7vw, 104px);
}
.feature--flip .feature__media { order: -1; }

.feature__copy .lead { margin-top: 18px; }

.feature__media { height: clamp(360px, 34vw, 440px); }

/* Screenshot cropped at the bottom of the panel, like a phone mock-up */
.feature__media--shot {
  display: flex;
  justify-content: center;
  padding-top: 44px;
}
.feature__media--shot .shot {
  width: min(290px, 78%);
  height: auto;
  align-self: flex-start;
}
/* Short screenshot: sized by height so it still runs off the bottom edge */
.feature__media--crop .shot {
  width: auto;
  height: calc(100% + 26px);
}

/* The floating buttons Pilbot adds to pages, shown large with a legend */
.feature__media--buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 32px;
}

.fab-pill {
  display: inline-flex;
  gap: 6px;
  padding: 8px;
  border-radius: 999px;
  background: var(--pill-ring);
  box-shadow: 0 2px 4px rgb(var(--shadow) / .1), 0 18px 40px -12px rgb(var(--shadow) / .3);
}
.fab-pill__btn {
  display: grid;
  place-items: center;
  width: 92px;
  height: 72px;
  border-radius: 14px;
  background: var(--pill-seg);
  color: var(--pill-icon);
}
.fab-pill__btn:first-child { border-radius: 36px 14px 14px 36px; }
.fab-pill__btn:last-child { border-radius: 14px 36px 36px 14px; }
.fab-pill__btn:only-child { width: 116px; border-radius: 36px; }
.fab-pill__btn .icon { width: 36px; height: 36px; }

/* Dictation: mic → recording (red pill with a stop square) */
.pill-row { display: flex; align-items: center; gap: 16px; }
.pill-row__arrow { color: var(--md-on-surface-variant); }
.fab-pill__btn--rec { background: var(--rec-bg); }
.rec-stop {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--rec-fg);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.legend li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 18px 0 6px;
  border-radius: 999px;
  background: var(--card);
  font-size: .9375rem;
  font-weight: 500;
}
.legend__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}
.legend__icon .icon { width: 18px; height: 18px; }
.legend__icon--rec { background: var(--rec-bg); }
.legend__icon--rec .rec-stop { width: 10px; height: 10px; border-radius: 2px; }

/* FAQ ---------------------------------------------------------------------- */

.section { padding-block: clamp(56px, 8vw, 104px); }

.faq {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  align-items: start;
  gap: clamp(32px, 6vw, 80px);
}
.faq__title { max-width: 9em; }

.faq__list {
  overflow: hidden;
  border-radius: 28px;
  background: var(--card);
}
.faq__item + .faq__item { border-top: 1px solid var(--md-outline-variant); }
.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 28px;
  font-size: 1.125rem;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
  transition: background-color .2s var(--ease);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:hover { background: color-mix(in srgb, var(--md-on-surface) 4%, transparent); }
.faq__item summary:focus-visible { outline-offset: -3px; }
.faq__item summary .icon {
  color: var(--md-on-surface-variant);
  transition: transform .3s var(--ease);
}
.faq__item[open] summary .icon { transform: rotate(180deg); }
.faq__item p {
  padding: 0 28px 22px;
  line-height: 1.65;
  color: var(--md-on-surface-variant);
}

/* CTA ---------------------------------------------------------------------- */

.cta { padding-bottom: clamp(56px, 8vw, 104px); }

.cta__band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  align-items: center;
  gap: 48px;
  padding: clamp(28px, 6vw, 72px);
  border-radius: 40px;
  background: var(--md-primary);
  color: var(--md-on-primary);
}
.cta__copy .lead {
  margin-top: 12px;
  color: color-mix(in srgb, var(--md-on-primary) 82%, transparent);
}
.cta__band .install-card { margin-top: 0; color: var(--md-on-surface); }

/* Footer ------------------------------------------------------------------- */

.footer {
  padding: 48px 0 56px;
  border-top: 1px solid var(--md-outline-variant);
}
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.footer__copy { margin-top: 8px; font-size: .9375rem; color: var(--md-on-surface-variant); }
.footer__link {
  font-size: 1.0625rem;
  font-weight: 500;
  text-underline-offset: 4px;
}
.footer__link:hover { color: var(--md-primary); }

/* Privacy policy page ------------------------------------------------------ */

.legal { padding: 16px 0 clamp(56px, 8vw, 104px); }
.legal__inner { max-width: calc(760px + 2 * var(--gutter)); }

.legal__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--md-primary);
  text-decoration: none;
}
.legal__back:hover { text-decoration: underline; text-underline-offset: 4px; }
.legal__back .icon { width: 20px; height: 20px; }

.legal__title { margin-top: 28px; }
.legal__meta { margin-top: 14px; color: var(--md-on-surface-variant); }

.legal__summary {
  margin-top: 36px;
  padding: clamp(22px, 4vw, 32px);
  border-radius: 28px;
  background: color-mix(in srgb, var(--md-primary-container) 55%, var(--bg));
}
.legal__summary h2 {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -.01em;
}
.legal__summary .checklist { margin-top: 16px; }

.legal__section { margin-top: 48px; }
.legal__section h2 {
  font-size: 1.5rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -.02em;
  scroll-margin-top: 24px;
}
.legal__section p,
.legal__list {
  margin-top: 14px;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--md-on-surface-variant);
  text-wrap: pretty;
}
.legal__section strong { font-weight: 600; color: var(--md-on-surface); }
.legal__section a {
  font-weight: 500;
  color: var(--md-primary);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.legal__list {
  display: grid;
  gap: 10px;
  padding-left: 1.25em;
  list-style: disc;
}
.legal__list li::marker { color: var(--md-primary); }

/* Install guide -------------------------------------------------------------
   A modal <dialog> opened by every "Install for Chrome" button. js/install.js shows
   one step at a time and fills the progress bars; colors come from the theme
   tokens, so it follows light and dark mode like the rest of the page.
   ------------------------------------------------------------------------- */

html:has(.guide[open]) { overflow: hidden; }

.guide {
  width: min(520px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 28px;
  background: var(--card);
  color: var(--md-on-surface);
  box-shadow: 0 4px 12px rgb(0 0 0 / .1), 0 24px 64px -16px rgb(0 0 0 / .35);
}
.guide::backdrop { background: rgb(12 14 22 / .5); }

@media (prefers-reduced-motion: no-preference) {
  .guide,
  .guide::backdrop {
    transition: opacity .25s var(--ease), transform .4s var(--ease), overlay .4s allow-discrete, display .4s allow-discrete;
  }
  .guide:not([open]) { opacity: 0; transform: translateY(24px) scale(.97); }
  .guide:not([open])::backdrop { opacity: 0; }
  @starting-style {
    .guide[open] { opacity: 0; transform: translateY(24px) scale(.97); }
    .guide[open]::backdrop { opacity: 0; }
  }
}

.guide__inner { padding: 24px; }

.guide__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.guide__title {
  font-size: 1.5rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.02em;
}

/* Round icon button (close) with the M3 state layer */
.icon-btn {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-right: -8px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--md-on-surface-variant);
  cursor: pointer;
}
.icon-btn::before,
.guide__copy-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: currentColor;
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.icon-btn:hover::before,
.guide__copy-btn:hover::before { opacity: .08; }
.icon-btn:active::before,
.guide__copy-btn:active::before { opacity: .12; }
.icon-btn:focus-visible { border-radius: 50%; }

/* Progress: one bar per step, filled up to the current one */
.guide__progress {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 6px;
  margin-top: 16px;
}
.guide__bar {
  position: relative;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--md-outline-variant);
}
.guide__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--md-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease);
}
.guide__bar.is-on::after { transform: none; }

/* Illustration panel at the top of each step */
.guide__art {
  position: relative;
  display: grid;
  place-items: center;
  height: 188px;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 20px;
  background: color-mix(in srgb, var(--md-primary-container) 55%, var(--bg));
}

.guide__eyebrow {
  margin-top: 20px;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--md-primary);
}
.guide__step-title {
  margin: 4px 0 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.guide__text {
  margin-top: 8px;
  line-height: 1.6;
  color: var(--md-on-surface-variant);
  text-wrap: pretty;
}
.guide__text strong { font-weight: 600; color: var(--md-on-surface); }

/* Step 1: address to copy */
.guide__copy {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 6px 6px 6px 18px;
  border-radius: 18px;
  background: var(--md-surface-container-high);
}
.guide__code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .9375rem;
  white-space: nowrap;
  user-select: all;
}
.guide__copy-btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px 0 14px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  font-family: inherit;
  font-size: .9375rem;
  font-weight: 500;
  cursor: pointer;
}
.guide__copy-btn .icon { width: 18px; height: 18px; }
.guide__copied-icon,
.guide__copy-btn.is-copied .guide__copy-icon { display: none; }
.guide__copy-btn.is-copied .guide__copied-icon { display: inline-block; }

/* Step 3: consent + download */
.guide__agree {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  font-size: .9375rem;
  line-height: 1.5;
  cursor: pointer;
}
.guide__error {
  margin: 6px 0 0 34px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--md-error);
}

/* M3 checkbox: the real <input> sits on top (invisible) so clicks, keyboard
   and screen readers all use it; the box below only draws its state. */
.checkbox {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
}
.checkbox__input {
  position: absolute;
  inset: -9px;
  z-index: 1;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.checkbox__box {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 2px solid var(--md-on-surface-variant);
  border-radius: 2px;
  color: var(--md-on-primary);
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.checkbox__box .icon { width: 16px; height: 16px; opacity: 0; transform: scale(.6); transition: opacity .15s var(--ease), transform .2s var(--ease); }
.checkbox__input:checked + .checkbox__box { border-color: var(--md-primary); background: var(--md-primary); }
.checkbox__input:checked + .checkbox__box .icon { opacity: 1; transform: none; }
.checkbox__input[aria-invalid="true"] + .checkbox__box { border-color: var(--md-error); }
.checkbox__input:focus-visible + .checkbox__box {
  outline: 3px solid var(--md-primary);
  outline-offset: 3px;
}

.guide__download-row {
  display: flex;
  margin-top: 16px;
}
.guide__download {
  height: 48px;
  padding: 0 24px 0 20px;
  font-size: 1rem;
}
.guide__download .icon { width: 20px; height: 20px; }
/* M3 disabled button until the visitor agrees */
.guide__download[aria-disabled="true"] {
  background: color-mix(in srgb, var(--md-on-surface) 12%, transparent);
  color: color-mix(in srgb, var(--md-on-surface) 38%, transparent);
  cursor: not-allowed;
}
.guide__download[aria-disabled="true"]::before { display: none; }
.guide__download[aria-disabled="true"]:active { border-radius: 999px; }

/* Step 4: pin tip */
.guide__tip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--md-surface-container-high);
  font-size: .9375rem;
  line-height: 1.45;
  color: var(--md-on-surface-variant);
}
.guide__tip .icon { width: 20px; height: 20px; color: var(--md-primary); }
.guide__link {
  font-weight: 500;
  color: var(--md-primary);
  text-underline-offset: 3px;
}

/* Back / Next */
.guide__nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
}
.guide__nav .btn { height: 48px; padding: 0 20px; font-size: 1rem; }
.guide__nav .btn--text { margin-left: -12px; padding: 0 16px 0 12px; }
.guide__nav .guide__next { margin-left: auto; padding: 0 20px 0 24px; }
.guide__nav .icon { width: 20px; height: 20px; }
.guide__next[data-last] { padding: 0 28px; }
.guide__next[data-last] .icon { display: none; }

/* All steps share one grid cell, so the dialog keeps the height of the
   tallest step and doesn't jump. Inactive steps are invisible, which also
   takes them out of the tab order and the accessibility tree. */
.guide__steps { display: grid; }
.guide__step { grid-area: 1 / 1; min-width: 0; }
.guide__step:not(.is-active) { visibility: hidden; }

/* Step change: slide in from the side you're heading to */
@media (prefers-reduced-motion: no-preference) {
  .guide__step.is-active { animation: guide-step .4s var(--ease) both; }
  .guide[data-dir="back"] .guide__step.is-active { animation-name: guide-step-back; }
}
@keyframes guide-step { from { opacity: 0; transform: translateX(28px); } }
@keyframes guide-step-back { from { opacity: 0; transform: translateX(-28px); } }

/* Illustrations — small replicas of what the visitor will see in Chrome */
.art-window,
.art-toggle,
.art-load,
.art-key,
.art-file {
  background: var(--card);
  box-shadow: 0 2px 6px rgb(var(--shadow) / .08), 0 14px 32px -12px rgb(var(--shadow) / .28);
}

/* 1 · Browser window with the address typed in */
.art-window {
  width: min(320px, 84%);
  padding: 12px 14px 16px;
  border-radius: 16px;
}
.art-window__dots { display: flex; gap: 6px; }
.art-window__dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--md-outline-variant);
}
.art-omnibox {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  margin-top: 12px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--md-surface-container-high);
  font-size: .9375rem;
}
.art-omnibox__icon {
  flex: none;
  width: 18px;
  height: 18px;
  fill: var(--md-on-surface-variant);
}
.art-omnibox__text { overflow: hidden; white-space: nowrap; }
.art-omnibox__caret {
  flex: none;
  width: 2px;
  height: 18px;
  margin-left: -9px;
  border-radius: 1px;
  background: var(--md-primary);
}

/* 2 · Developer mode switch (M3 switch, like Chrome's) */
.art-toggle {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 20px 18px 26px;
  border-radius: 20px;
  font-size: 1.25rem;
  color: var(--md-on-surface-variant);
}
.art-switch {
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  border-radius: 16px;
  background: var(--md-primary);
}
.art-switch__thumb {
  position: absolute;
  top: 4px;
  left: 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--md-on-primary);
}

/* 3 · ZIP → folder */
.art-files { display: flex; align-items: center; gap: 20px; }
.art-file {
  position: relative;
  display: grid;
  place-items: end center;
  width: 72px;
  height: 92px;
  padding-bottom: 12px;
  border-radius: 12px 26px 12px 12px;
}
.art-file__zip {
  position: absolute;
  top: 0;
  left: 50%;
  width: 12px;
  height: 44px;
  translate: -50% 0;
  background:
    linear-gradient(var(--md-outline) 50%, transparent 0) 0 0 / 6px 8px repeat-y,
    linear-gradient(var(--md-outline) 50%, transparent 0) 6px 4px / 6px 8px repeat-y;
}
.art-file__ext {
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--md-primary);
}
.art-files__arrow { color: var(--md-primary); }
.art-folder { display: grid; justify-items: center; gap: 2px; }
.art-folder .icon { width: 84px; height: 84px; color: var(--md-primary); }
.art-folder__name { font-size: .875rem; font-weight: 500; }

/* 4 · "Load unpacked" outlined button with a pointer */
.art-load {
  position: relative;
  padding: 26px 30px;
  border-radius: 20px;
}
.art-load__btn {
  display: inline-flex;
  align-items: center;
  height: 52px;
  padding: 0 28px;
  border: 1px solid var(--md-outline);
  border-radius: 999px;
  color: var(--md-primary);
  font-size: 1.0625rem;
  font-weight: 600;
}
.art-load__cursor {
  position: absolute;
  right: 34px;
  bottom: 12px;
  width: 18px;
  height: 27px;
  fill: var(--md-on-surface);
  stroke: var(--card);
  stroke-width: 1.5;
}

/* 5 · API key field, styled like the fields in Pilbot's setup panel */
.art-key {
  display: grid;
  justify-items: start;
  gap: 8px;
  width: min(320px, 84%);
  padding: 16px 18px 18px;
  border-radius: 20px;
}
.art-key__label {
  font-size: .875rem;
  font-weight: 500;
  color: var(--md-on-surface-variant);
}
.art-key__field {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  background: var(--md-surface-container-high);
}
.art-key__field .icon { width: 20px; height: 20px; color: var(--md-on-surface-variant); }
.art-key__dots {
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: .1em;
  color: var(--md-on-surface);
}
.art-key__caret {
  flex: none;
  width: 2px;
  height: 18px;
  margin-left: -11px;
  border-radius: 1px;
  background: var(--md-primary);
}
.art-key__ok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--md-primary);
}
.art-key__ok .icon { width: 18px; height: 18px; }

/* Each illustration plays once when its step becomes active */
@media (prefers-reduced-motion: no-preference) {
  .is-active .art-omnibox__text { animation: art-type 1.1s steps(19, end) .35s both; }
  .is-active .art-omnibox__caret { animation: art-blink 1s steps(1) infinite; }
  .is-active .art-switch { animation: art-switch-track .35s var(--ease) .75s both; }
  .is-active .art-switch__thumb { animation: art-switch-thumb .35s var(--ease) .75s both; }
  .is-active .art-folder { animation: art-pop .45s var(--ease) .45s both; }
  .is-active .art-files__arrow { animation: art-nudge .45s var(--ease) .2s both; }
  .is-active .art-load__cursor { animation: art-cursor 1.1s var(--ease) .25s both; }
  .is-active .art-load__btn { animation: art-press .5s var(--ease) 1s both; }
  .is-active .art-key__dots { animation: art-type 1s steps(16, end) .3s both; }
  .is-active .art-key__caret { animation: art-blink 1s steps(1) infinite; }
  .is-active .art-key__ok { animation: art-pop .4s var(--ease) 1.45s both; }
}
@keyframes art-type { from { max-width: 0; } to { max-width: 220px; } }
@keyframes art-blink { 50% { opacity: 0; } }
@keyframes art-switch-track {
  from { background: var(--md-surface-container-high); box-shadow: inset 0 0 0 2px var(--md-outline); }
}
@keyframes art-switch-thumb {
  from { transform: translateX(-20px) scale(.667); background: var(--md-outline); }
}
@keyframes art-pop { from { opacity: 0; transform: scale(.8); } }
@keyframes art-nudge { from { opacity: 0; transform: translateX(-8px); } }
@keyframes art-cursor {
  from { opacity: 0; transform: translate(40px, 30px); }
  70% { opacity: 1; transform: none; }
  82% { transform: scale(.88); }
  to { transform: none; }
}
@keyframes art-press {
  50% { background: color-mix(in srgb, var(--md-primary) 16%, transparent); }
}

@media (max-width: 640px) {
  .guide { border-radius: 24px; }
  .guide__inner { padding: 20px; }
  .guide__art { height: 160px; margin-top: 16px; }
  .art-toggle { gap: 18px; padding: 14px 16px 14px 20px; font-size: 1.0625rem; }
}

/* Responsive --------------------------------------------------------------- */

/* Short laptop screens: tighter hero so the step cards stay above the fold */
@media (min-width: 961px) and (max-height: 820px) {
  .hero__bento { gap: 12px; }
  .hero__intro { padding: 36px 44px; }
  .hero__actions { margin-top: 28px; }
  .hero__more { width: 44px; height: 44px; margin-top: 0; }
  .hero__note { margin-top: 12px; }
  .step { padding: 14px 16px 16px; }
  .step__icon { width: 40px; height: 40px; border-radius: calc(20px - var(--on) * 8px); }
  .step__title { margin-top: 12px; }
  .step__text { margin-bottom: 14px; }
}

@media (min-width: 961px) and (max-height: 700px) {
  .hero__title { font-size: clamp(2rem, 10cqi, 3rem); }
  .hero__intro .lead { margin-top: 16px; }
  .step__title { margin-bottom: 14px; }
  .step__text { display: none; }
  .hero__intro { padding: 30px 40px; }
}

@media (max-width: 960px) {
  .feature__grid,
  .faq,
  .cta__band { grid-template-columns: minmax(0, 1fr); }

  /* Stacked: intro → film → steps right under the film they follow */
  .hero__bento {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas:
      "intro"
      "stage"
      "steps";
  }
  .hero__film { width: 100%; max-width: 440px; }
  /* The stacked hero is taller than the screen anyway — no scroll cue */
  .hero__more { display: none; }

  .feature--flip .feature__media { order: 0; }
  .faq__title { max-width: none; }
}

@media (max-width: 640px) {
  .topbar__inner { height: 72px; }
  .topbar__end { gap: 12px; }
  .brand__icon { width: 43px; height: 32px; }
  .brand__name { font-size: 1.375rem; }
  .theme-switch__btn { width: 44px; height: 36px; }

  .install-card { padding: 20px; }

  .media,
  .cta__band,
  .hero__intro { border-radius: 28px; }

  .hero__bento { gap: 12px; }
  .hero__intro { padding: 28px 22px 26px; }
  .hero__title { line-height: 1.1; }
  .hero__intro .lead { line-height: 1.6; }
  .hero__actions { margin-top: 28px; }
  .hero__stage { padding: 28px 16px; }

  /* Compact steps: icon + title + progress */
  .hero__steps { gap: 8px; }
  .step { padding: 14px 12px 16px; border-radius: 20px; }
  .step__icon { width: 40px; height: 40px; border-radius: calc(20px - var(--on) * 8px); }
  .step__icon .icon { width: 20px; height: 20px; }
  .step__title { margin: 12px 0 14px; font-size: 1rem; }
  .step__text { display: none; }

  .feature__media { height: 360px; }

  .fab-pill__btn { width: 76px; height: 60px; }
  .fab-pill__btn:first-child { border-radius: 30px 12px 12px 30px; }
  .fab-pill__btn:last-child { border-radius: 12px 30px 30px 12px; }
  .fab-pill__btn:only-child { width: 96px; border-radius: 30px; }
  .fab-pill__btn .icon { width: 30px; height: 30px; }

  .faq__item summary { padding: 20px 22px; font-size: 1.0625rem; }
  .faq__item p { padding: 0 22px 20px; }
}

@media (max-width: 400px) {
  .topbar__link { display: none; }
}
