/* AI Search: the page's own layout (plan.md "AI Search"). Components and tokens from design\components.css and
   design\system.css; the scenes lay out their own cards. */

/* #top, split reversed: the homeowner at her laptop on the left half, edge to edge and full height, her AI answer in a
   glass card over the table under her face; the words and the form box on the right, on the ink with faint traces */
.ais-top { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: min(calc(100svh - var(--header-h)), 980px); background: var(--c-ink); }
.ais-top__pic { position: relative; overflow: hidden; min-height: 560px; scroll-margin-top: var(--header-h); }
/* the crop keeps her face at about 30 to 46% of the height at every size, so the card under it never reaches it */
.ais-top__photo { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 50% 45%; }
.ais-top__pic::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(4, 9, 14, .5) 0%, transparent 18%, transparent 46%, rgba(4, 9, 14, .55) 100%), linear-gradient(90deg, transparent 72%, rgba(4, 9, 14, .6) 100%); }
.ais-top__answer { position: absolute; left: 50%; bottom: 5%; width: min(90%, 620px); height: 42%; transform: translateX(-50%); z-index: 2; }
.ais-top__stop { position: absolute; left: 14px; top: 14px; z-index: 5; }
.ais-top__side { position: relative; display: flex; align-items: center; padding: clamp(20px, 4svh, 48px) clamp(24px, 4.4vw, 72px); }
.ais-top__in { position: relative; z-index: 1; width: 100%; max-width: 560px; }
.ais-top__title { margin: 0; font-size: min(clamp(2.3rem, 1.2rem + 2.3vw, 3.5rem), 7.4svh); font-weight: 800; line-height: 1.04; letter-spacing: -.03em; text-wrap: balance; }
.ais-top__lead { margin: clamp(12px, 1.8svh, 18px) 0 clamp(18px, 3svh, 28px); font-size: var(--fs-lead); line-height: 1.5; color: rgba(246, 251, 253, .88); text-wrap: pretty; }
@media (min-width: 901px) and (max-height: 820px) {
  .ais-top__form.formbox { padding: 18px 20px; }
  .ais-top__form .tile { min-height: 62px; padding-block: 6px; }
  .ais-top__form .tile__pic { height: 46px; }
  .ais-top__form .formbox__q { margin-bottom: 10px; }
  .ais-top__form .formbox__note { margin-top: 10px; }
}
@media (max-width: 1100px) {
  .ais-top__side { padding-inline: 28px; }
}
/* the phone and the small tablet: the words and the box first, the picture under them */
@media (max-width: 900px) {
  .ais-top { grid-template-columns: 1fr; min-height: 0; }
  .ais-top__side { order: -1; padding: 24px var(--gutter, 16px) 24px; }
  .ais-top__in { max-width: 640px; margin: 0 auto; }
  .ais-top__title { font-size: clamp(2.05rem, 1.2rem + 4.2vw, 2.7rem); }
  .ais-top__lead { font-size: 1.02rem; }
  .ais-top__pic { min-height: 0; height: clamp(600px, 180vw, 780px); }
  /* drawn 128% tall from its foot: her face stands 24 to 40% down, clear of the card from 50% */
  .ais-top__photo { top: auto; bottom: -1px; height: 128%; }
  .ais-top__pic::after { background: linear-gradient(180deg, transparent 46%, rgba(4, 9, 14, .55) 100%); }
  .ais-top__answer { width: calc(100% - 24px); bottom: 12px; height: 50%; }
  .ais-top__stop { top: 12px; left: 12px; }
}

/* #ba: twelve questions and the company each answer names, before and with SBOWiz (the switch), on a board over a
   technician on a rooftop at dusk */
.ais-ba__top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 28px; flex-wrap: wrap; margin-bottom: var(--space-5); }
.ais-ba__top .part__head { margin: 0; }
.ais-ba__pic { position: relative; scroll-margin-top: var(--header-h); }
.ais-ba__stage { position: relative; aspect-ratio: 1240 / 700; overflow: hidden; }
.ais-ba__media { position: absolute; inset: 0; overflow: hidden; }
.ais-ba__stop { position: absolute; left: 14px; top: 14px; z-index: 5; }
.ais-ba__media video { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 50% 60%; }
.ab { position: absolute; right: 2.5%; top: 50%; transform: translateY(-50%); z-index: 2; width: 450px; box-sizing: border-box; padding: 18px; background: var(--glass-strong); }
.ab p { margin: 0; }
.ab__head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ab__title { font: 700 .95rem/1.3 var(--font-ui); color: var(--c-paper); text-wrap: balance; }
.ab__fig { display: flex; align-items: baseline; gap: 8px; font: 500 .875rem/1.3 var(--font-ui); color: var(--c-quiet); white-space: nowrap; }
.ab__fig b { position: relative; display: inline-block; min-width: 1.3em; height: 2.6rem; font: 800 2.6rem/1 var(--font-display); letter-spacing: -.03em; color: var(--c-paper); text-align: center; }
.ab__fig b > span { position: absolute; left: 0; right: 0; top: 0; }
.ab__fig .ab__a { color: var(--c-brand); }
.ab__rows { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.ab__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 32px; padding: 0 4px 0 10px; box-sizing: border-box; border-radius: 8px; background: rgba(246, 251, 253, .04); }
.ab__q { font: 500 .875rem/1.3 var(--font-ui); color: rgba(246, 251, 253, .88); white-space: nowrap; }
.ab__ans { display: grid; justify-items: end; }
.ab__ans > .ab__name { grid-area: 1 / 1; }
.ab__name { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--radius-pill); background: rgba(169, 180, 186, .16); font: 600 .8125rem/1 var(--font-ui); color: var(--c-paper); white-space: nowrap; }
.ab__name--you { background: var(--c-brand); color: var(--c-ink); box-shadow: 0 0 12px rgba(2, 228, 255, .45); }
/* the switch: each answer turns in place, row by row from the top */
.ab__a, .ab__b { transition: opacity .32s var(--ease-out), transform .32s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.ab__fig .ab__a, .ab__fig .ab__b { transition-delay: 0ms; }
.ab__a { opacity: 0; transform: scale(.85); }
.ais-ba:has(.switch [value="after"]:checked) .ab__b { opacity: 0; transform: scale(.85); }
.ais-ba:has(.switch [value="after"]:checked) .ab__a { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .ab__a, .ab__b { transition: none; } }
/* the stage is under 640 px tall here: the twelve rows close up so the board keeps a margin above and below */
@media (min-width: 1101px) and (max-width: 1240px) {
  .ab { padding: 14px 16px; }
  .ab__rows { margin-top: 10px; gap: 3px; }
  .ab__row { min-height: 28px; }
}
@media (max-width: 1100px) {
  .ais-ba__stage { aspect-ratio: 16 / 9; }
  .ab { position: relative; right: auto; top: auto; transform: none; margin: -64px auto 0; }
}
@media (max-width: 760px) {
  .ais-ba__stage { aspect-ratio: 358 / 240; }
  .ais-ba__media video { object-position: 54% 70%; }
  .ab { width: 100%; max-width: 420px; padding: 14px; margin-top: -40px; }
  .ab__row { min-height: 40px; padding: 6px 4px 6px 10px; }
  .ab__q { white-space: normal; }
}

/* #how: five places the web describes the company, each set right and feeding a line of the AI answer (scene
   aissource), over its van at a customer's home, darkened */
.ais-how__head { margin-bottom: var(--space-5); }
.ais-how__stage { position: relative; aspect-ratio: 1240 / 700; overflow: hidden; scroll-margin-top: var(--header-h); }
.ais-how__media { position: absolute; inset: 0; overflow: hidden; }
.ais-how__media video { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; }
.ais-how__media::after { content: ""; position: absolute; inset: 0; background: rgba(4, 9, 14, .72); }
.ais-how__scene { position: absolute; inset: 0; z-index: 2; }
.ais-how__stop { position: absolute; right: 14px; top: 14px; z-index: 5; }
@media (max-width: 1100px) {
  .ais-how__stage { aspect-ratio: auto; height: clamp(720px, 96vw, 900px); }
}
@media (max-width: 760px) {
  .ais-how__stage { height: 860px; }
}

/* #where: four AI answers naming the company and the calls they bring, over a homeowner looking it up on her phone
   (scene aiswhere) */
.ais-where__head { margin-bottom: var(--space-5); }
.ais-where__stage { position: relative; aspect-ratio: 1240 / 700; overflow: hidden; scroll-margin-top: var(--header-h); }
.ais-where__media { position: absolute; inset: 0; overflow: hidden; }
.ais-where__media video { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 50% 40%; }
.ais-where__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4, 9, 14, .42) 0%, rgba(4, 9, 14, .08) 32%, rgba(4, 9, 14, .08) 56%, rgba(4, 9, 14, .42) 100%); }
.ais-where__scene { position: absolute; inset: 0; z-index: 2; }
.ais-where__stop { position: absolute; right: 14px; top: 14px; z-index: 5; }
@media (max-width: 1100px) {
  .ais-where__stage { aspect-ratio: 950 / 720; }
}
@media (max-width: 760px) {
  .ais-where__stage { aspect-ratio: 358 / 760; }
  .ais-where__media video { object-position: 50% 30%; }
  .ais-where__media::after { background: linear-gradient(180deg, transparent 40%, rgba(4, 9, 14, .5) 100%); }
}
