/* services.css: the Services page (design\components.md; the tokens of system.css only). One roofing company's evening by
   the clock. Parts: hero, path, found, ads, site, trust, leads, seen, change, mix, faq, close. */

/* =================== hero: split, the clip bleeding off the right edge =================== */
.phead--split { position: relative; min-height: min(100svh, 880px); display: grid; align-items: center; background: var(--c-ink); overflow: hidden; overflow: clip; isolation: isolate; }
.phead__stop { bottom: 22px; right: 22px; }
/* the kit's header (kit.md): the gentle change, kept as it is */
[data-kit-scene="rotate"] [data-kit-slide] { position: absolute; inset: 0; margin: 0; visibility: hidden; overflow: hidden; }
[data-kit-scene="rotate"] [data-kit-slide][data-kit-on] { visibility: visible; z-index: 2; opacity: var(--kit-move, 1); transform: translateX(var(--kit-glide, calc((1 - var(--kit-move, 1)) * 4%))); }
[data-kit-scene="rotate"]:not(:has([data-kit-slide][data-prev])) [data-kit-slide][data-kit-on] { transform: none; opacity: 1; }
[data-kit-scene="rotate"] [data-kit-slide][data-prev] { visibility: visible; z-index: 1; }
[data-kit-scene="rotate"] [data-kit-slide] video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
[data-kit-scene="rotate"]:not(:has([data-kit-slide][data-kit-on])) [data-kit-slide]:not([data-kit-slide] ~ [data-kit-slide]) { visibility: visible; }
[data-kit-scene="rotate"] [data-kit-slide] video { inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; clip-path: inset(2px); }
[data-kit-scene="rotate"] [data-kit-slide] video[data-kit-shown] { clip-path: none; }
[data-kit-scene="rotate"] [data-kit-slide][data-prev] { opacity: clamp(0, (1 - var(--kit-move, 0)) * 1000, 1); }
/* the stage: a tall clip off the page's right edge, its left edge climbing as the logo's arrow does */
.phead__stage { position: absolute; z-index: 0; top: 0; right: 0; bottom: 0; width: 56vw; clip-path: polygon(15% 0, 100% 0, 100% 100%, 0 100%); }
/* the calendar was shot from above: turned half round, its days read upright and the hand comes from below */
.phead__slide video, .phead__slide img.kit-first { transform: rotate(180deg); object-position: 46% 50%; }
.phead__stage::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(180deg, color-mix(in srgb, var(--c-ink) 62%, transparent) 0%, transparent 26%), linear-gradient(90deg, color-mix(in srgb, var(--c-ink) 42%, transparent) 0%, transparent 34%); }
.phead__glow { position: absolute; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(46% 62% at 2% 96%, var(--c-glow-red), transparent 72%), radial-gradient(44% 56% at 22% 6%, var(--c-glow-blue), transparent 72%); }
.phead__in { position: relative; z-index: 2; padding-block: 150px 72px; }
.phead__copy { display: grid; justify-items: start; gap: 0; max-width: min(44vw, 590px); }
.phead__lead { margin: 22px 0 32px; }
.phead--split .phead__scene { position: absolute; z-index: 3; overflow: visible; top: 118px; right: max(26px, calc(50% - 680px)); width: 452px; }
/* the toast hangs under the card's foot, so it lands on none of the card's words */
.phead--split .phead__scene .sd-pop { bottom: -44px; }
@media (max-width: 1080px) {
  .phead--split { display: block; min-height: 0; }
  .phead__in { padding-block: 120px 34px; }
  .phead__copy { max-width: 640px; }
  .phead__stage { position: relative; width: 100%; height: clamp(470px, 74vw, 560px); clip-path: polygon(0 6%, 100% 0, 100% 100%, 0 100%); }
  .phead--split { display: flex; flex-direction: column; }
  .phead__stage { order: 2; }
  .phead__stage::after { background: linear-gradient(180deg, color-mix(in srgb, var(--c-ink) 38%, transparent) 0%, transparent 34%); }
  .phead--split .phead__scene { order: 3; top: auto; bottom: 44px; right: auto; left: 50%; width: min(452px, calc(100% - 24px)); transform: translateX(-50%); }
  .phead__stop { top: auto; bottom: 424px; right: 14px; }
}

/* =================== path: the type on the ribbon, on the designed ground =================== */
.path { background: radial-gradient(52% 58% at 6% 96%, color-mix(in srgb, var(--c-red) 32%, transparent), transparent 72%), radial-gradient(40% 50% at 96% 8%, color-mix(in srgb, var(--c-accent) 16%, transparent), transparent 72%), radial-gradient(60% 60% at 62% 58%, color-mix(in srgb, var(--c-brand-light) 26%, transparent), transparent 72%), var(--c-ink); overflow: hidden; overflow: clip; padding-block: clamp(70px, 7vw, 100px); }
.path__field { position: absolute; left: -6vw; bottom: -14vw; width: 76vw; opacity: .05; pointer-events: none; }
.path__stage { position: relative; }
.path__stop { top: 0; right: 0; }
.path__in { position: relative; }
.path__head { position: absolute; z-index: 2; left: 0; top: 0; max-width: 700px; margin: 0; }
.path__head .sec-line { max-width: 42ch; }
.path__head .gold, .leads__head .gold, .change .sec-head .gold { display: block; }
.path__scene { display: block; }
@media (max-width: 760px) {
  .path__head { position: static; margin-bottom: 26px; }
}

/* =================== chapters on footage: the scene on the side clear of the face, the services in the picture =================== */
.ch { position: relative; isolation: isolate; overflow: hidden; overflow: clip; background: var(--c-ink); }
.ch__stage { position: relative; }
.ch__stage > .ch__stop { top: -14px; right: -14px; }
.ads__frame > .ch__stop, .leads__frame > .ch__stop, .change__frame > .ch__stop { top: 22px; right: 22px; }
.ch__media { z-index: -2; }
.ch__media video, .ch__media img { inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; }
.ch__shade { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.ch__in { position: relative; padding-block: clamp(80px, 8vw, 118px) clamp(56px, 5vw, 76px); }
.ch .sec-head { max-width: 640px; margin-bottom: 26px; }

/* found: Dana on her sofa at the right, the map at the left, the four services along the foot */
.ch--found .ch__media { --pos: 0% 40%; }
.ch--found .ch__shade { background: linear-gradient(90deg, color-mix(in srgb, var(--c-ink) 88%, transparent) 0%, color-mix(in srgb, var(--c-ink) 66%, transparent) 42%, transparent 66%), linear-gradient(180deg, var(--c-ink) 0%, transparent 16%, transparent 68%, color-mix(in srgb, var(--c-ink) 84%, transparent) 100%); }
.found__stage { width: min(100%, 700px); }
.found__scene { height: 478px; }
.found__cards { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 22px; }
@media (max-width: 1080px) {
  .found__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch--found .ch__media { --pos: 30% 40%; }
}

/* =================== ads: a framed photo, the head above it, the scene hanging over the frame =================== */
.ads { background: var(--c-ink); padding-bottom: clamp(100px, 9vw, 140px); }
.ads__frame { position: relative; height: clamp(560px, 46vw, 640px); border-radius: var(--radius-l); box-shadow: var(--shadow-l); }
.ads__media { border-radius: inherit; --pos: 50% 30%; background: var(--c-night); }
.ads__media img { inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; }
.ads__cards { position: absolute; left: 24px; bottom: 24px; width: min(300px, 26%); }
.ads__frame .ads__scene { position: absolute; right: 30px; top: -44px; width: 460px; height: calc(100% + 76px); }
.ads__frame > .ch__stop { right: auto; left: 22px; }
/* gold fills take dark text (the plan's note on funnel) */
.ads__scene .fn-ring { color: var(--c-on-gold); }

/* =================== site: the rebuild, large, on the designed ground =================== */
.site { background: radial-gradient(70% 62% at 50% 100%, color-mix(in srgb, var(--c-brand-light) 38%, transparent), transparent 72%), radial-gradient(40% 40% at 8% 12%, color-mix(in srgb, var(--c-red) 16%, transparent), transparent 72%), var(--c-night); overflow: hidden; overflow: clip; }
.site__field { position: absolute; right: -8vw; top: 3vw; width: 66vw; opacity: .07; pointer-events: none; }
.site__in { position: relative; }
.site__stage { position: relative; width: min(100%, 1040px); margin-inline: auto; }
.site__scene { height: clamp(540px, 45vw, 640px); }
.site__stop { top: -14px; right: -14px; }
.site__cards { position: relative; z-index: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 1040px); margin: 18px auto 0; }

/* =================== trust: the head above the photo, Jamie at the left, the scene at the right =================== */
.ch--trust .ch__media { inset: 176px 0 0 0; --pos: 50% 62%; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16%); mask-image: linear-gradient(180deg, transparent 0, #000 16%); }
.ch--trust .ch__shade { background: linear-gradient(180deg, transparent 78%, var(--c-ink) 100%), linear-gradient(270deg, color-mix(in srgb, var(--c-ink) 44%, transparent) 0%, transparent 48%); }
.ch--trust .ch__in { padding-top: clamp(70px, 6vw, 92px); }
.ch--trust .sec-head { max-width: none; margin-bottom: 10px; }
.ch--trust .sec-line { max-width: none; }
.trust__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 720px); align-items: end; gap: 28px; }
.trust__cards { align-self: end; max-width: 320px; }
.trust__scene { height: 580px; }

/* =================== leads: the head above the frame, at the right; the scene over his arm, clear of his face =================== */
.leads { background: var(--c-ink); padding-top: clamp(70px, 7vw, 100px); padding-bottom: clamp(70px, 7vw, 100px); }
.leads__head { margin-left: auto; max-width: 780px; }
.leads__frame { position: relative; height: clamp(600px, 50vw, 680px); border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-l); background: var(--c-night); }
.leads__media { --pos: 50% 50%; }
/* drawn a little wider from its left edge: his face moves clear of the scene */
.leads__media video { transform: scale(1.15); transform-origin: 0% 40%; }
.leads__media video { inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; }
.leads__frame .leads__scene { position: absolute; left: 22px; top: 22px; bottom: 22px; width: min(56%, 710px); border-radius: var(--radius-m); overflow: hidden; }
.leads__cards { position: absolute; right: 22px; bottom: 22px; width: min(340px, 30%); }

/* =================== seen: the owner at the right, the report at the left =================== */
.ch--seen .ch__media { --pos: 50% 33%; }
.ch--seen .ch__shade { background: linear-gradient(90deg, color-mix(in srgb, var(--c-ink) 92%, transparent) 0%, color-mix(in srgb, var(--c-ink) 74%, transparent) 40%, transparent 62%), linear-gradient(180deg, var(--c-ink) 0%, transparent 16%, transparent 72%, color-mix(in srgb, var(--c-ink) 86%, transparent) 100%); }
.seen__stage { width: min(100%, 700px); }
.seen__scene { height: 400px; }
.seen__cards { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 22px; }

/* =================== change: two pictures in one frame =================== */
.change { background: var(--c-ink); padding-top: clamp(70px, 7vw, 100px); }
.change__frame { position: relative; aspect-ratio: 1280 / 660; border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-l); background: var(--c-night); isolation: isolate; }
.change__pic { z-index: 0; }
.change__pic img, .change__pic video { inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; }
.change__pic--before { --pos: 50% 22%; }
.change__pic--before img { filter: saturate(.72) brightness(.82); }
.change__pic--after { z-index: 1; clip-path: polygon(0 0, 0 0, 0 0); }
.change__pic--after video { transform: scale(1.3); transform-origin: 50% 100%; filter: saturate(1.12) brightness(1.08); }
.change__frame .change__scene { position: absolute; inset: 0; z-index: 2; }
.change__frame .ch__stop { z-index: 6; }

/* =================== mix: the signature, on the designed ground =================== */
.mix { background: radial-gradient(60% 60% at 90% 10%, color-mix(in srgb, var(--c-accent) 14%, transparent), transparent 72%), radial-gradient(64% 70% at 4% 96%, color-mix(in srgb, var(--c-red) 26%, transparent), transparent 72%), var(--c-night); overflow: hidden; overflow: clip; }
.mix__field { position: absolute; left: 50%; bottom: -8vw; width: 92vw; margin-left: -46vw; opacity: .05; pointer-events: none; }
.mix__stop { top: 14px; right: 14px; }
.mix__panel { position: relative; padding: clamp(18px, 3vw, 44px); border-radius: var(--radius-l); background: linear-gradient(160deg, color-mix(in srgb, var(--c-brand) 72%, var(--c-ink)), var(--c-ink)); box-shadow: var(--shadow-l), inset 0 0 0 1px color-mix(in srgb, var(--c-on-ink) 14%, transparent); }
.mix__scene { display: block; }

/* =================== close: the crew at the left, the words over the sky =================== */
.svc-close .band__media { --pos: 40% 40%; }
.svc-close .pclose__card { left: max(24px, calc(50% - 620px)); bottom: clamp(52px, 8vw, 110px); }
.svc-close .pclose__ribbon { left: auto; right: max(16px, calc(50% - 680px)); bottom: 6px; width: clamp(170px, 19vw, 270px); }

/* =================== the phone =================== */
@media (max-width: 760px) {
  .ch__in { padding-top: 66px; }
  .ch { display: grid; grid-template-columns: minmax(0, 1fr); }
  .ch .ch__shade { display: none; }
  .ch .ch__in, .trust__row { display: contents; }
  .ch .sec-head { grid-row: 1; width: min(100% - 2 * var(--gutter), var(--max-w)); margin: 66px auto 22px; }
  .ch .ch__media { position: relative; inset: auto; grid-row: 2; grid-column: 1; z-index: 0; -webkit-mask-image: none; mask-image: none; }
  .ch__stage { grid-row: 2; grid-column: 1; z-index: 1; width: min(100% - 2 * var(--gutter), 460px); margin: 262px auto 18px; }
  .found__stage, .seen__stage { width: min(100% - 2 * var(--gutter), 460px); }
  .ch__stage > .ch__stop { top: -54px; right: 0; }
  .found__scene { height: 540px; }
  .seen__scene { height: 640px; }
  .trust__stage { width: min(100% - 12px, 460px); }
  .trust__scene { height: 610px; }
  .found__cards, .seen__cards, .trust__cards { grid-row: 3; grid-template-columns: 1fr; width: min(100% - 2 * var(--gutter), 460px); max-width: none; margin: 16px auto 56px; }
  .ch--found .ch__media { --pos: 72% 0%; }
  /* the pictures are drawn taller than their box and lifted, so the face stands above the scene */
  .ch--seen .ch__media { --pos: 58% 0%; }
  .ch--seen .ch__media img { height: 122%; top: -34%; }
  .ch--trust .ch__media { --pos: 28% 0%; }
  .ch--trust .ch__media img { height: 122%; top: -22%; }

  .ads__frame, .leads__frame { display: grid; grid-template-columns: minmax(0, 1fr); height: auto; overflow: visible; box-shadow: none; background: none; border-radius: 0; }
  .ads__media, .leads__media { position: relative; inset: auto; grid-row: 1; grid-column: 1; border-radius: var(--radius-m); overflow: hidden; }
  .ads__frame .ads__scene, .leads__frame .leads__scene { position: relative; inset: auto; left: auto; right: auto; top: auto; bottom: auto; grid-row: 1; grid-column: 1; width: auto; margin: 256px 10px 10px; }
  .ads__frame .ads__scene { height: 470px; }
  .leads__frame .leads__scene { height: 620px; }
  .ads__cards, .leads__cards { position: static; grid-row: 2; width: 100%; margin-top: 14px; }
  .ads__frame > .ch__stop, .leads__frame > .ch__stop { right: 12px; left: auto; top: 12px; z-index: 6; }
  .leads__media { --pos: 63% 0%; height: 620px; align-self: start; }
  .leads__media video { height: 130%; top: -30%; transform: none; }
  .leads__frame .leads__scene { margin-top: 290px; }
  .ads__media { --pos: 38% 0%; }
  .ads__media img { height: 125%; top: -25%; }
  .leads__head { margin-left: 0; }

  .site__stage { max-width: 420px; }
  .site__scene { height: 560px; }
  .site__stop { top: -24px; right: -6px; }
  .site__cards { grid-template-columns: 1fr; margin-top: 14px; }

  .change__frame { aspect-ratio: 360 / 640; background: var(--c-ink); box-shadow: none; }
  .change__pic { inset: 0 0 auto 0; height: 52%; border-radius: var(--radius-m); }
  .change__pic--after video { transform: scale(1.3); transform-origin: 50% 90%; }
  .change__pic--before { --pos: 34% 22%; }

  .mix__panel { padding: 14px; }
  .mix__stop { top: -20px; right: 6px; }
  .mix__scene { aspect-ratio: 360 / 660; }
  .path__scene { aspect-ratio: 360 / 660; }
  .path__stop { top: auto; bottom: 0; right: 0; }

  .svc-close .pclose__card { position: relative; left: auto; bottom: auto; margin: 0 auto 26px; }
  .svc-close { display: flex; flex-direction: column; align-items: center; }
  .svc-close .band__media { --pos: 30% 40%; }
  .svc-close.pclose { padding-top: 66vw; padding-bottom: 64px; }
  .svc-close .band__media { bottom: auto; height: 74vw; }
  .svc-close .pclose__shade { background: linear-gradient(180deg, transparent 0%, transparent 34%, var(--c-ink) 55%); }
}
@media (min-width: 761px) and (max-width: 1080px) {
  .trust__row { grid-template-columns: 1fr; }
  .trust__cards { max-width: none; order: 2; }
  .seen__cards { grid-template-columns: 1fr; max-width: 520px; }
  .ads__frame .ads__scene { width: 420px; right: 18px; }
  .ads__cards { width: 34%; }
  .leads__cards { width: 36%; }
  .site__cards { grid-template-columns: 1fr; max-width: 520px; }
  .svc-close .pclose__card { display: none; }
}
