/* every-call-answered.css: places and sizes the page's parts (plan.md, "Every call answered"), 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 (#books; Get found's and Ads' frame) */
.ec-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 plumber under the sink, the photo moving slowly (a long push-in, held by the stop icon, still under
   reduced motion). His face at 67 to 75% across and 22 to 40% down, his body at 44 to 87%, the bright kitchen at the
   left; so the words stand high at the left on the shade, and the day's calls at the foot, over the floor and his
   knees, growing upward. Under 1024 px the stage stands above the words, the calls at its foot on the left; on the
   phone the stage frames him and the calls stand under his face. */
.ec-top { align-items: start; }
.ec-top__img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 60% 45%; transform-origin: 70% 36%; animation: ec-drift 26s ease-in-out infinite alternate; }
@keyframes ec-drift { from { transform: scale(1.02); } to { transform: scale(1.085) translate3d(0.6%, 0, 0); } }
.ec-top:has(.hero__stop[aria-pressed="true"]) .ec-top__img { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .ec-top__img { animation: none; transform: scale(1.03); } }
.ec-top .hero__stage::after {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--c-ink) 90%, transparent) 0%, color-mix(in srgb, var(--c-ink) 76%, transparent) 26%, color-mix(in srgb, var(--c-ink) 30%, transparent) 44%, transparent 56%),
    linear-gradient(180deg, color-mix(in srgb, var(--c-ink) 38%, transparent) 0%, transparent 30%),
    linear-gradient(0deg, color-mix(in srgb, var(--c-ink) 46%, transparent) 0%, transparent 32%);
}
.ec-top .hero__words { padding-block: clamp(2.5rem, 5vw, 4rem) var(--space-5); }
.ec-top .hero__words h1 { max-width: 10.5em; }
.ec-top .hero__lede { max-width: 27em; }
/* (two classes: a scene's host rule and the shared stop icon's); the card stands on the host's foot and grows up */
.ec-top .ec-top__calls { position: absolute; z-index: 5; left: 34%; bottom: 24px; width: 420px; height: 290px; display: flex; flex-direction: column; justify-content: flex-end; }
.ec-top .ec-top__stop { left: calc(34% + 432px); right: auto; bottom: 24px; }
@media (max-width: 1023px) {
  .ec-top { display: block; min-height: 0; }
  .ec-top .hero__stage { position: relative; height: 560px; }
  .ec-top .hero__stage::after { background: linear-gradient(0deg, var(--c-ink) 0%, color-mix(in srgb, var(--c-ink) 30%, transparent) 16%, transparent 34%); }
  .ec-top__img { object-position: 64% 40%; }
  .ec-top .ec-top__calls { left: 24px; bottom: 24px; }
  .ec-top .ec-top__stop { left: 456px; top: auto; bottom: 24px; }
  .ec-top .hero__words { padding-block: var(--space-3) var(--space-5); }
}
@media (max-width: 767px) {
  .ec-top .hero__stage { height: 520px; }
  .ec-top__img { object-position: 77% 40%; transform-origin: 72% 30%; }
  /* (under 360 px wide the card takes its tighter rows, where "After hours · 9:47 PM" fits whole: filmed 16 Nov, at
     362 px it was cut to "9:4...") */
  .ec-top .ec-top__calls { left: 50%; right: auto; top: 225px; bottom: auto; width: min(358px, calc(100% - 28px)); translate: -50% 0; justify-content: flex-start; }
  .ec-top .ec-top__stop { left: auto; right: 14px; top: 173px; bottom: auto; }
  .ec-top .hero__words { margin-top: 0; }
}

/* 2. The signature: the night over the rooftops, full width under its head on the ink. */
.night { padding-bottom: 0; }
.night__head { margin-inline: auto; text-align: center; }
.night__head .lede { margin-inline: auto; max-width: 34rem; }
.night__stage { position: relative; }
.night__scene { height: 540px; }
.night__stop { position: absolute; z-index: 3; top: 18px; right: var(--gutter); }
@media (max-width: 1023px) { .night__scene { height: 560px; } }
@media (max-width: 599px) { .night__scene { height: 600px; } }

/* 3. Missed or booked: the same 6:10 PM call, its two endings side by side on the paper, each over its own plumber
   busy on a job (the lost one's face at the top middle: his card in the lower right; the booked one seen from behind
   at the middle: his card in the lower left, over the sink). The scene sizes itself (1100 : 480 of its width; under
   600 px wide, 720 px high, the lanes stacked). */
.missed__frame { position: relative; }
.missed__stop { position: absolute; z-index: 3; right: 0; top: -56px; }

/* 4. The call books itself: the words at the left, the call in its frame at the right; under 1024 px the frame stands
   under the words. Its host keeps the scene's own shape: 820 x 600, upright (360 x 724) under 600 px wide. */
.books__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); gap: clamp(2rem, 4.5vw, 4.5rem); align-items: center; }
.books__words h2 { max-width: 11em; }
.books__words .lede { max-width: 24rem; margin: 0; color: color-mix(in srgb, var(--c-on-ink) 86%, transparent); }
.books__frame { container-type: inline-size; }
.books__scene { aspect-ratio: 41 / 30; }
@container (width < 600px) { .books__scene { aspect-ratio: 360 / 724; } }
.books__stop { position: absolute; z-index: 3; top: 12px; right: 12px; }
@media (max-width: 1023px) {
  .books__grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
}
@media (max-width: 599px) {
  .books__frame { margin-inline: calc(12px - var(--gutter)); padding: 6px; }
}

/* 5. Answered in seconds (F3: a landscaper at her truck; Part 2's was the plumber in his van): her face at 64 to 75%
   across, her phone at 52 to 60%, the truck bed and its plants at the left; the message and its answer in glass over
   the plants, clear of her face and her phone. The words at the right; under 1024 px they stand under the photo; on
   the phone the photo stands taller, held on her, her face in its upper part and the chat under it. */
.seconds__grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 5fr); gap: clamp(2rem, 4.5vw, 4.5rem); align-items: center; }
.seconds__frame { position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius-l); box-shadow: var(--shadow-m); }
.seconds__frame > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 40%; }
.seconds .seconds__scene { position: absolute; z-index: 2; top: 5%; left: 2.5%; width: min(330px, 40%); height: 90%; }
.seconds__stop { position: absolute; z-index: 3; top: 5%; left: calc(2.5% + min(330px, 40%) + 10px); }
.seconds__words .lede { max-width: 26rem; margin: 0; }
@media (max-width: 1023px) {
  .seconds__grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .seconds .seconds__scene { width: min(360px, 40%); }
  .seconds__stop { left: calc(2.5% + min(360px, 40%) + 10px); }
}
@media (max-width: 699px) {
  .seconds__frame { aspect-ratio: auto; height: 640px; margin-inline: calc(12px - var(--gutter)); }
  .seconds__frame > img { object-position: 80% 0%; }
  .seconds .seconds__scene { top: 300px; right: 12px; left: 12px; width: auto; height: 330px; }
  .seconds__stop { top: 252px; left: auto; right: 12px; }
}

/* 6. Close: the plumber at a homeowner's door at dusk (he walks in from the left; the door at 55 to 65% of the clip,
   where she opens it). The clip stands in the left 70% of the part, its right edge falling into the ink, and the words
   at the right on the ink (filmed 16 Nov: with the clip full width, the words' edge stood at her face). Under 1200 px
   the clip is a band across the top and the words stand under it. */
.ec-close .close__in { display: flex; justify-content: flex-end; }
.ec-close__words { width: min(30rem, 100%); }
.ec-close .close__media { inset: 0 auto 0 0; width: 70%; }
.ec-close .close__video { object-position: 30% 40%; }
.ec-close .close__media::after { background: linear-gradient(270deg, var(--c-ink) 0%, color-mix(in srgb, var(--c-ink) 55%, transparent) 12%, transparent 32%), linear-gradient(0deg, color-mix(in srgb, var(--c-ink) 40%, transparent), transparent 30%); }
.ec-close .close__stop { left: var(--gutter); right: auto; top: 24px; }
@media (max-width: 1199px) {
  .ec-close { padding-block: 0 clamp(4.5rem, 8vw, 6.5rem); }
  .ec-close .close__media { position: relative; inset: auto; width: 100%; aspect-ratio: 16 / 9; max-height: 560px; }
  .ec-close .close__video { object-position: 45% 40%; }
  .ec-close .close__media::after { background: linear-gradient(0deg, var(--c-ink) 0%, color-mix(in srgb, var(--c-ink) 35%, transparent) 24%, transparent 48%); }
  .ec-close .close__in { display: block; margin-top: calc(-1 * var(--space-4)); }
  .ec-close__words { width: auto; }
  .ec-close__words h2, .ec-close__words .lede { max-width: 30rem; }
  .ec-close .close__stop { left: auto; right: var(--gutter); top: 16px; }
}
@media (max-width: 599px) {
  .ec-close .close__media { aspect-ratio: 4 / 5; }
  .ec-close .close__video { object-position: 40% 50%; }
}
