/* Ads: the page's own layout (plan.md "Ads"). Components and tokens from design\components.css and design\system.css;
   the scenes lay out their own cards. Each photo with a screen is zoomed by its stage's own shape (a box of its own
   aspect inside the stage), so the screen is drawn as large as the stage allows at every width. */

/* #top, stacked: the words centered on the ink; under them a wide stage with the laptop, the search turning into a
   booked estimate on its screen (scene adsfunnel, 560x350), and the form box over the stage's lower right corner */
.ads-top { position: relative; padding: clamp(20px, 3.6svh, 44px) 0 clamp(28px, 4svh, 56px); background: var(--c-ink); }
.ads-top__head { position: relative; z-index: 1; max-width: 900px; margin: 0 auto clamp(16px, 2.6svh, 30px); text-align: center; }
.ads-top__title { margin: 0; font-size: min(var(--fs-h1), 7svh); font-weight: 800; line-height: var(--lh-tight); letter-spacing: var(--track-tight); text-wrap: balance; }
.ads-top__lead { max-width: 760px; margin: clamp(10px, 1.6svh, 16px) auto 0; font-size: var(--fs-lead); line-height: 1.5; color: rgba(246, 251, 253, .88); text-wrap: balance; }
.ads-top__row { position: relative; z-index: 1; display: flex; align-items: flex-end; justify-content: center; }
/* the stage keeps the first screen: never taller than the screen leaves under the words */
.ads-top__pic { position: relative; flex: 0 1 auto; width: min(100%, calc((100svh - var(--header-h) - 270px) / .56)); min-width: 0; margin-right: -80px; scroll-margin-top: var(--header-h); }
.ads-top__stage { position: relative; aspect-ratio: 1 / .56; overflow: hidden; }
/* the laptop's screen from 7 to 70% across and 11 to 80% down, clear of the form box over the right 80 px */
.ads-top__zoom { position: absolute; left: -33.46%; top: -47.27%; width: 141.6%; height: 168.57%; }
.ads-top__photo, .ads-funnel__photo, .ads-fb__photo { position: absolute; inset: 0; margin: 0; }
.ads-top__photo > img, .ads-funnel__photo > img, .ads-fb__photo > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.ads-top__photo .screen > [data-scene], .ads-fb__photo .screen > [data-scene] { position: absolute; inset: 0; }
.ads-top__photo .screen { background: var(--c-deep); }
.ads-top__stop { position: absolute; right: 14px; top: 14px; z-index: 5; }
.ads-top__form { position: relative; z-index: 3; flex: 0 0 460px; }
@media (min-width: 1101px) and (max-height: 820px) {
  .ads-top__form.formbox { padding: 18px 20px; }
  .ads-top__form .tile { min-height: 62px; padding-block: 6px; }
  .ads-top__form .tile__pic { height: 46px; }
  .ads-top__form .formbox__q { margin-bottom: 10px; }
  .ads-top__form .formbox__note { margin-top: 10px; }
}
/* tablets and phones: the words, the box, then the stage with the laptop centered */
@media (max-width: 1100px) {
  .ads-top__row { flex-direction: column; align-items: center; gap: 20px; }
  .ads-top__form { order: -1; flex: none; width: 100%; max-width: 560px; }
  .ads-top__pic { width: 100%; margin-right: 0; }
  .ads-top__stage { aspect-ratio: 1 / .52; }
  .ads-top__zoom { left: -23.1%; top: -53.85%; width: 143.85%; height: 184.4%; }
}
@media (max-width: 760px) {
  .ads-top__title { font-size: clamp(2rem, 1.2rem + 4vw, 2.6rem); }
  .ads-top__lead { font-size: 1.02rem; }
  /* the screen across 92% of the stage, the stop icon under it on the keyboard */
  .ads-top__stage { aspect-ratio: 1 / .76; }
  .ads-top__zoom { left: -55.08%; top: -57.16%; width: 206.8%; height: 181.4%; }
  .ads-top__stop { top: auto; bottom: 10px; right: 10px; }
}

/* #lsa: the verified ad and the lead it brings, as glass cards (scene adslsa) over the remodeler on the job */
.ads-lsa__head { margin-bottom: var(--space-5); }
.ads-lsa__stage { position: relative; aspect-ratio: 1240 / 700; overflow: hidden; scroll-margin-top: var(--header-h); }
.ads-lsa__media { position: absolute; inset: 0; overflow: hidden; }
.ads-lsa__media video { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 50% 40%; }
.ads-lsa__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 48%, rgba(4, 9, 14, .4) 100%); }
.ads-lsa__scene { position: absolute; inset: 0; z-index: 2; }
.ads-lsa__stop { position: absolute; left: 14px; top: 14px; z-index: 5; }
@media (max-width: 1100px) {
  .ads-lsa__stage { aspect-ratio: 692 / 520; }
}
@media (max-width: 760px) {
  .ads-lsa__stage { aspect-ratio: 358 / 600; }
  .ads-lsa__media video { object-position: 53% 40%; }
  .ads-lsa__media::after { background: linear-gradient(180deg, transparent 44%, rgba(4, 9, 14, .5) 100%); }
}

/* #funnel: Westbrook's landing page on a phone in two hands, before and after the funnel review (the switch), its
   four changes numbered on the screen and noted beside the phone */
.ads-funnel__top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 28px; flex-wrap: wrap; margin-bottom: var(--space-5); }
.ads-funnel__top .part__head { margin: 0; }
.ads-funnel__pic { position: relative; scroll-margin-top: var(--header-h); }
.ads-funnel__stage { position: relative; aspect-ratio: 1240 / 700; overflow: hidden; }
/* the phone's screen from 50 to 75% across, 6 to 94% down */
.ads-funnel__zoom { position: absolute; left: -2.58%; top: -16.86%; width: 136.05%; height: 160.8%; }
.ads-funnel__photo .screen { box-sizing: border-box; padding: 2px; background: var(--c-white) content-box; }
.ads-funnel__photo .screen > .lp { position: absolute; inset: 2px; }
/* the page on the screen, at its design size (300x640) */
.lp { overflow: hidden; border-radius: 24px; background: var(--c-white); color: var(--c-navy); font-family: var(--font-ui); }
.lp p { margin: 0; }
.lp__bar { position: relative; display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 20px 0 24px; font: 700 19px/1 var(--font-ui); color: var(--c-navy); }
.lp__notch { position: absolute; left: 25%; right: 25%; top: 0; height: 24px; border-radius: 0 0 14px 14px; background: var(--c-ink); }
.lp__batt { display: block; width: 26px; height: 13px; padding: 2px; box-sizing: border-box; border-radius: 4px; box-shadow: inset 0 0 0 2px var(--c-navy); }
.lp__batt i { display: block; width: 70%; height: 100%; border-radius: 2px; background: var(--c-navy); }
.lp__nav { display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 16px 0 42px; box-shadow: inset 0 -1px 0 var(--c-paper-alt); }
.lp__name { font: 800 21px/1 var(--font-display); letter-spacing: -.02em; color: var(--c-navy); }
.lp__burger { display: grid; gap: 4px; width: 24px; }
.lp__burger i { display: block; height: 3px; border-radius: 2px; background: var(--c-navy); }
.lp__hero { position: relative; height: 162px; overflow: hidden; }
.lp__hero img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 28%; }
.lp__body { display: grid; gap: 12px; padding: 14px 16px 0 42px; }
.lp__swap { display: grid; }
.lp__swap > * { grid-area: 1 / 1; }
.lp__swap--rev { margin-top: 16px; }
.lp__h { font: 800 25px/1.18 var(--font-display); letter-spacing: -.02em; color: var(--c-navy); }
.lp__p { font: 400 19px/1.4 var(--font-ui); color: var(--c-text-on-paper); }
.lp__p b { font-weight: 800; color: var(--c-navy); }
.lp__btns { display: grid; gap: 8px; align-content: start; }
.lp__btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border-radius: 22px; font: 700 19px/1 var(--font-ui); }
.lp__btn svg { width: 18px; height: 18px; }
.lp__btn--call { background: var(--c-accent); color: var(--c-ink); }
.lp__btn--quote { box-shadow: inset 0 0 0 2px var(--c-navy); color: var(--c-navy); }
.lp__rev { display: flex; align-items: center; gap: 5px; align-self: start; white-space: nowrap; font: 600 19px/1.2 var(--font-ui); color: var(--c-text-on-paper); }
.lp__rev b { font-weight: 800; color: var(--c-navy); }
.lp__stars { display: inline-flex; gap: 0; color: var(--c-star); }
.lp__stars svg { display: block; width: 15px; height: 15px; }
/* the four marks, at the screen's left edge */
.lp__mk { position: absolute; left: 6px; top: var(--y); display: grid; width: 30px; height: 30px; margin-top: -15px; }
.lp__mk > span { grid-area: 1 / 1; display: grid; place-items: center; border-radius: 50%; font: 800 19px/1 var(--font-ui); }
.lp__mk .lp__b { background: var(--c-fix); color: var(--c-white); }
.lp__mk .lp__a { background: var(--c-brand); color: var(--c-ink); box-shadow: 0 0 10px rgba(2, 228, 255, .6); }
/* the notes, from 1101 px on the stage's left, each joined to its mark by a trace */
.fn { margin: 0; padding: 0; list-style: none; }
.fn p { margin: 0; }
.fn__lines { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.fn__lines path { fill: none; stroke-width: 2; stroke-linecap: round; transition: stroke .32s var(--ease-out); stroke: var(--c-fix); }
.fn__note { display: flex; align-items: center; gap: 12px; padding: 12px 14px; box-sizing: border-box; border-radius: var(--radius-m); background: var(--glass-strong); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3); backdrop-filter: blur(var(--glass-blur)) saturate(1.3); box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 0 0 1px rgba(255, 59, 82, .4), 0 14px 30px rgba(0, 0, 0, .4); transition: box-shadow .32s var(--ease-out); }
.fn__n { flex: none; display: grid; width: 30px; height: 30px; }
.fn__n > span { grid-area: 1 / 1; display: grid; place-items: center; border-radius: 50%; font: 800 .9375rem/1 var(--font-ui); }
.fn__n .fn__b { background: var(--c-fix); color: var(--c-white); }
.fn__n .fn__a { background: var(--c-brand); color: var(--c-ink); }
.fn__n svg { width: 16px; height: 16px; }
.fn__words { display: grid; gap: 3px; min-width: 0; }
.fn__pair { display: grid; }
.fn__pair > * { grid-area: 1 / 1; }
.fn__pair b { font: 700 .9375rem/1.3 var(--font-ui); color: var(--c-paper); }
.fn__pair span { font: 500 .875rem/1.35 var(--font-ui); color: var(--c-quiet); }
@media (min-width: 1101px) {
  .fn { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
  .fn__note { position: absolute; left: 4%; width: 36%; top: var(--y); transform: translateY(-50%); pointer-events: auto; }
  .fn__note:nth-child(1) { --y: 15.14%; }
  .fn__note:nth-child(2) { --y: 44%; }
  .fn__note:nth-child(3) { --y: 59.14%; }
  .fn__note:nth-child(4) { --y: 76.86%; }
}
/* the switch: the page and the notes turn in place, the notes one after another from the top */
.ads-funnel .lp__a, .ads-funnel .fn__a { opacity: 0; visibility: hidden; }
.lp__a, .lp__b, .fn__a, .fn__b { transition: opacity .32s var(--ease-out), visibility .32s; }
.fn__note .fn__a, .fn__note .fn__b { transition-delay: calc(var(--i, 0) * 90ms); }
.ads-funnel:has(.switch [value="after"]:checked) .lp__b, .ads-funnel:has(.switch [value="after"]:checked) .fn__b { opacity: 0; visibility: hidden; }
.ads-funnel:has(.switch [value="after"]:checked) .lp__a, .ads-funnel:has(.switch [value="after"]:checked) .fn__a { opacity: 1; visibility: visible; }
.ads-funnel:has(.switch [value="after"]:checked) .fn__lines path { stroke: var(--c-brand); }
.ads-funnel:has(.switch [value="after"]:checked) .fn__note { box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 0 0 1px rgba(2, 228, 255, .5), 0 0 22px rgba(2, 228, 255, .14), 0 14px 30px rgba(0, 0, 0, .4); }
@media (prefers-reduced-motion: reduce) { .lp__a, .lp__b, .fn__a, .fn__b, .fn__lines path, .fn__note { transition: none; } }
@media (max-width: 1100px) {
  .fn__lines { display: none; }
  .fn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
  /* the phone centered, its screen 37% of the stage's width */
  .ads-funnel__stage { aspect-ratio: 1 / .86; }
  .ads-funnel__zoom { left: -45%; top: -14.59%; width: 200%; height: 155.1%; }
}
@media (max-width: 760px) {
  .fn { grid-template-columns: 1fr; }
  .ads-funnel__stage { aspect-ratio: 358 / 520; }
  .ads-funnel__zoom { left: -117.88%; top: -17.31%; width: 353.35%; height: 162.12%; }
}

/* #facebook: the feed on a phone held up in the evening (scene adsfeed, 300x650) and the lead it brings on the
   owner's side (scene adsfblead): beside the phone from 1101 px, over the photo's foot under its screen below */
.ads-fb__grid { container-type: inline-size; display: grid; grid-template-columns: minmax(0, 1fr) 520px; gap: 32px 56px; align-items: start; }
.ads-fb__head { padding-top: clamp(24px, 4vw, 56px); }
.ads-fb__pic { position: relative; scroll-margin-top: var(--header-h); }
.ads-fb__stage { position: relative; aspect-ratio: 520 / 650; overflow: hidden; }
.ads-fb__zoom { position: absolute; inset: 0; }
.ads-fb__photo .screen { background: var(--c-white); }
.ads-fb__stop { position: absolute; right: 14px; top: 14px; z-index: 5; }
.ads-fb__lead { position: absolute; right: calc(100% + 56px); bottom: 40px; width: calc(100cqw - 576px); height: 300px; }
@media (max-width: 1100px) {
  .ads-fb__grid { grid-template-columns: minmax(0, 1fr); }
  .ads-fb__head { padding-top: 0; }
  .ads-fb__pic { width: min(100%, 520px); margin: 0 auto; }
  .ads-fb__stage { aspect-ratio: 520 / 720; }
  .ads-fb__lead { left: 4%; right: 4%; bottom: 8px; width: auto; height: 76px; z-index: 3; }
}
@media (max-width: 760px) {
  .ads-fb__pic { width: 100%; }
  .ads-fb__stage { aspect-ratio: 358 / 720; }
  .ads-fb__zoom { inset: auto; left: -36.31%; top: -5.56%; width: 172.91%; height: 107.5%; }
  .ads-fb__lead { height: 64px; }
}
