/* ads.css: places and sizes the page's parts (plan.md, "Ads that bring buyers"), with system.css's tokens. The header
   and the close are the shared components (components.css). */

/* the main button and its note (the header and the close) */
.hero__cta, .close__cta { margin-top: var(--space-4); }
.cta-note { margin: var(--space-2) 0 0; font-size: var(--fs-small); color: color-mix(in srgb, var(--c-on-ink) 78%, transparent); }

/* a designed scene's frame on the ink, lit from its top (#month; Get found's frame) */
.ads-frame {
  position: relative; padding: clamp(10px, 1.4vw, 18px); border-radius: var(--radius-l);
  background: radial-gradient(90% 70% at 72% 0%, color-mix(in srgb, var(--c-accent) 9%, transparent), transparent 70%), color-mix(in srgb, var(--c-on-ink) 4%, var(--c-ink));
  border: 1px solid color-mix(in srgb, var(--c-on-ink) 12%, transparent); box-shadow: var(--shadow-l);
}

/* 1. Header: the remodelers' photo, moving slowly (a long push-in, held by the stop icon, still under reduced motion);
   their faces at 15 to 31% across and 10 to 33% down, so the words stand low at the left, under them, and the card at
   the right over the bare wall, the window between. On the phone the stage stands above the words and the card stands
   on its lower part, under the faces. */
.paid-top { align-items: end; }
.paid-top__img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 30% 40%; transform-origin: 30% 32%; animation: ads-drift 24s ease-in-out infinite alternate; }
@keyframes ads-drift { from { transform: scale(1.02); } to { transform: scale(1.09) translate3d(-0.8%, 0, 0); } }
.paid-top:has(.hero__stop[aria-pressed="true"]) .paid-top__img { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .paid-top__img { animation: none; transform: scale(1.03); } }
.paid-top .hero__stage::after {
  background:
    linear-gradient(0deg, color-mix(in srgb, var(--c-ink) 94%, transparent) 0%, color-mix(in srgb, var(--c-ink) 74%, transparent) 30%, color-mix(in srgb, var(--c-ink) 22%, transparent) 54%, transparent 66%),
    linear-gradient(90deg, color-mix(in srgb, var(--c-ink) 50%, transparent) 0%, transparent 52%),
    radial-gradient(42% 60% at 84% 36%, color-mix(in srgb, var(--c-ink) 26%, transparent), transparent 72%);
}
.paid-top .hero__words { padding-block: var(--space-5) clamp(2.5rem, 5vw, 4rem); }
.paid-top .hero__words h1 { max-width: 11.5em; }
/* (two classes: a scene's host rule and the shared stop icon's) */
.paid-top .paid-top__lead { position: absolute; z-index: 5; top: 13%; right: max(var(--gutter), calc(50% - 640px)); width: clamp(340px, 27vw, 380px); height: 330px; }
/* the stop icon beside the card's top left, over the window (the top bar would cover it above the card) */
.paid-top .paid-top__stop { top: 13%; bottom: auto; left: auto; right: calc(max(var(--gutter), calc(50% - 640px)) + clamp(340px, 27vw, 380px) + 12px); }
@media (max-width: 767px) {
  .paid-top .hero__stage { height: 480px; }
  .paid-top__img { object-position: 7% 40%; transform-origin: 20% 30%; }
  .paid-top .paid-top__lead { top: 186px; left: 14px; right: 14px; width: auto; height: 280px; }
  .paid-top .paid-top__stop { top: 132px; right: 14px; }
}

/* 2. Search ads: the homeowner at her kitchen table with her phone (her face at 33 to 42% across, grown from the left
   so it stands clear of the words); the words at the left on the shade, the ads panel at the right over the laptop.
   Under 1200 px the words come first, then the footage with the panel on its right part; under 900 px the footage
   stands tall around her and the panel sits on its lower part. */
.search { position: relative; display: grid; align-items: center; min-height: clamp(600px, 50vw, 720px); padding-block: 0; overflow: hidden; }
.search__media { position: absolute; inset: 0; overflow: hidden; }
.search__media .search__video { object-position: 40% 35%; transform: scale(1.15); transform-origin: 0 50%; }
.search__media::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c-ink) 90%, transparent) 0%, color-mix(in srgb, var(--c-ink) 70%, transparent) 22%, color-mix(in srgb, var(--c-ink) 15%, transparent) 33%, transparent 38%);
}
/* (a grid item with auto margins shrinks to its content and centers: the words take the whole row, as .hero__words) */
.search__words { position: relative; z-index: 2; box-sizing: border-box; width: 100%; max-width: calc(var(--max-w) + 2 * var(--gutter)); padding-block: var(--space-5); }
.search__words h2 { max-width: 23rem; font-size: clamp(1.8rem, 1rem + 1.6vw, 2.5rem); }
.search__words .lede { max-width: 23rem; margin: 0; color: color-mix(in srgb, var(--c-on-ink) 86%, transparent); }
.search .search__scene { position: absolute; z-index: 3; top: 50%; right: max(var(--gutter), calc(50% - 640px)); width: 460px; height: 470px; translate: 0 -50%; }
.search__stop { position: absolute; z-index: 4; top: calc(50% - 235px); right: calc(max(var(--gutter), calc(50% - 640px)) + 472px); }
@media (max-width: 1199px) {
  .search { display: flex; flex-direction: column; align-items: stretch; min-height: 0; padding-block: var(--space-5) 0; }
  .search__words { order: 1; padding-block: 0 var(--space-4); }
  .search__media { order: 2; position: relative; inset: auto; aspect-ratio: 16 / 9; min-height: 540px; }
  .search__media .search__video { transform: none; }
  .search__media::after { background: linear-gradient(180deg, var(--c-ink) 0%, transparent 14%); }
  .search .search__scene { top: auto; bottom: 24px; right: var(--gutter); translate: none; }
  .search__stop { top: 16px; right: var(--gutter); }
}
@media (max-width: 899px) {
  .search__media { aspect-ratio: auto; min-height: 0; height: 860px; }
  .search__media .search__video { object-position: 38% 50%; }
  .search .search__scene { left: 50%; right: auto; bottom: 16px; width: min(460px, calc(100% - 24px)); height: 460px; translate: -50% 0; }
  .search__stop { top: auto; bottom: 486px; right: max(12px, calc(50% - 230px)); }
}
@media (max-width: 599px) {
  .search__media { height: 830px; }
  .search__media .search__video { object-position: 36% 50%; }
}

/* 3. Local Services: the estimate at the homeowner's table (her face at 30 to 39% across, his at 59 to 73%, both in
   the upper 41%); the listing in glass over the table at the lower left, under the faces. Under 900 px the frame is
   smaller and the card hangs from its foot, more than half on the photo, in solid paper. */
.local__frame { position: relative; aspect-ratio: 16 / 10; }
.local__pic { position: absolute; inset: 0; overflow: hidden; border-radius: var(--radius-l); box-shadow: var(--shadow-m); }
.local__pic img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.local .local__scene { position: absolute; z-index: 2; left: clamp(16px, 2.5%, 32px); top: 48%; bottom: 3%; width: 360px; --anchor: foot; }
.local__stop { position: absolute; z-index: 3; left: calc(clamp(16px, 2.5%, 32px) + 372px); bottom: calc(3% + 330px); }
@media (max-width: 1199px) {
  .local__frame { aspect-ratio: 4 / 3; }
  .local .local__scene { top: 42%; }
}
@media (max-width: 899px) {
  .local { padding-bottom: calc(var(--space-6, 6rem) + 200px); }
  .local .local__scene { top: calc(100% - 230px); bottom: auto; height: 420px; --anchor: top; --lc-bg: var(--c-paper); }
  .local__stop { left: auto; right: 14px; bottom: auto; top: calc(100% - 282px); }
}
@media (max-width: 599px) {
  .local__frame { aspect-ratio: 4 / 5; }
  .local__pic img { object-position: 52% 0%; }
  .local .local__scene { left: 10px; right: 10px; width: auto; top: calc(100% - 220px); }
  .local__stop { top: calc(100% - 272px); }
}

/* 4. Facebook and Instagram (F3: a yoga studio; Part 2's was the remodeler photographing his kitchen): the class in a
   bright studio, every face in the photo's left half (the instructor's at 29 to 33% across, the students' at 32 to 52%,
   low); the week of ads in glass over its right part (the students' legs, the marble wall and the palm), from the
   studio's own photo. Under 1200 px the frame stands tall on the photo's right part, the week over its upper part and
   the one face left in view low at its left. On the phone no crop of the class leaves room for the week over it
   without a face under it, so the frame shows the studio's own photo the ads are made from (`ads-print-yoga`, upright:
   the instructor's face at 19 to 34% down, drawn 1280 px tall with its top 120 px cut off), the frame 1160 px tall,
   the week in glass over its lower part from 420 px (her arms, the student folded on the mat, the floor), its stop
   icon at the week's top corner. */
.social__frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-l); box-shadow: var(--shadow-m); }
.social__frame > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 40%; }
.social .social__scene { position: absolute; z-index: 2; right: 2%; top: 3.4%; bottom: 3.4%; width: 45%; }
.social__stop { position: absolute; z-index: 3; right: calc(47% + 12px); top: 3.4%; }
.social__frame > .social__phone-photo { display: none; }
@media (max-width: 1199px) {
  .social__frame { aspect-ratio: 4 / 5; }
  .social__frame > img { object-position: 100% 50%; }
  .social .social__scene { left: 24px; right: 24px; top: 24px; bottom: auto; width: auto; height: 480px; }
  .social__stop { right: 24px; top: calc(24px + 480px + 12px); }
}
@media (max-width: 899px) {
  .social .social__scene { height: 440px; }
  .social__stop { top: calc(24px + 440px + 12px); }
}
@media (max-width: 599px) {
  .social__frame { aspect-ratio: auto; height: 1160px; margin-inline: calc(12px - var(--gutter)); }
  .social__frame > img { display: none; }
  .social__frame > .social__phone-photo { display: block; top: -120px; height: calc(100% + 120px); object-position: 65% 0%; }
  .social .social__scene { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 740px; }
  .social__stop { right: 14px; top: calc(100% - 740px + 14px); }
}

/* 5. The signature: the month on the spike line, on the ink, centered under its head. */
.month__head { margin-inline: auto; text-align: center; }
.month__frame { max-width: 1240px; margin-inline: auto; }
.month__scene { height: 580px; }
.month__stop { position: absolute; right: 0; top: -56px; z-index: 3; }
@media (max-width: 931px) { .month__scene { height: 820px; } }
@media (max-width: 599px) {
  .month__frame { margin-inline: calc(12px - var(--gutter)); padding: 6px; }
}

/* 6. Close: the couple at their new cabinets stand at the clip's right; the clip stands at the right of the part, its
   left edge falling into the ink, so his hand on the cabinet door stays clear of the words. Under 1200 px the clip is a
   band across the top and the words stand under it. */
.ads-close .close__media { inset: 0 0 0 auto; width: 64%; }
.ads-close .close__video { object-position: 64% 20%; }
.ads-close .close__media::after { background: linear-gradient(90deg, var(--c-ink) 0%, color-mix(in srgb, var(--c-ink) 55%, transparent) 14%, transparent 34%), linear-gradient(0deg, color-mix(in srgb, var(--c-ink) 40%, transparent), transparent 30%); }
.ads-close .close__in h2, .ads-close .close__in .lede { max-width: 30rem; }
.ads-close .close__stop { top: 16px; right: var(--gutter); }
@media (max-width: 1199px) {
  .ads-close { padding-block: 0 clamp(4.5rem, 8vw, 6.5rem); }
  .ads-close .close__media { position: relative; inset: auto; width: 100%; aspect-ratio: 16 / 9; max-height: 560px; }
  .ads-close .close__video { object-position: 62% 10%; }
  .ads-close .close__media::after { background: linear-gradient(0deg, var(--c-ink) 0%, color-mix(in srgb, var(--c-ink) 35%, transparent) 24%, transparent 48%); }
  .ads-close .close__in { margin-top: calc(-1 * var(--space-4)); }
}
@media (max-width: 599px) {
  .ads-close .close__media { aspect-ratio: 4 / 5; }
  .ads-close .close__video { object-position: 68% 10%; }
}
