/* The Services page: places and sizes its parts, with the tokens of system.css. Every scene that stands on a photo
   on the computer stays at least half on it at every width, below the faces. */

/* Every scene's place: the runtime's own rules make a scene's box relative, so its place here keeps the absolute
   position that gives it its size. */
.found__scene, .week__scene, .grp__host, .mix__scene { position: absolute !important; inset: 0; }

/* The header: the clip full-bleed, the words on the left, one customer's path along its foot */
.svc-hero { position: relative; overflow: hidden; display: grid; min-height: clamp(660px, calc(100svh - 84px), 840px); background: var(--c-ink); color: var(--c-on-ink); }
.svc-hero__stage { position: absolute; inset: 0; overflow: hidden; }
.svc-hero__stage video { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; }
.svc-hero__stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, color-mix(in srgb, var(--c-ink) 88%, transparent) 0%, color-mix(in srgb, var(--c-ink) 66%, transparent) 34%, transparent 54%); }
.svc-hero__stop { top: var(--space-4); right: var(--gutter); }
.svc-hero__in { position: relative; z-index: 2; display: grid; grid-template-rows: 1fr auto; gap: var(--space-4); padding-block: var(--space-5) var(--space-4); }
.svc-hero__words { align-self: center; display: grid; gap: var(--space-3); max-width: 34rem; }
.svc-hero__words h1 { color: var(--c-on-ink); }
.svc-hero__line { font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.3125rem); line-height: 1.5; color: var(--c-on-ink); text-wrap: pretty; }
.svc-hero__go, .svc-close__go { display: grid; justify-items: start; gap: var(--space-2); margin-top: var(--space-1); }
.svc-hero__go .promise, .svc-close__go .promise { justify-content: flex-start; }

/* Getting found */
.found { padding-top: var(--section-y); }
.found__band { position: relative; overflow: hidden; background: var(--c-ink); }
.found__ground { position: absolute; inset: 0; overflow: hidden; }
.found__ground img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 30% 50%; }
.found__stop { top: var(--space-3); left: var(--gutter); }
.found__in { position: relative; display: flex; justify-content: flex-end; padding-block: var(--space-5); }
.found__side { display: grid; gap: 12px; width: 440px; }
.found__map { position: relative; height: 530px; }
.found__cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; padding: 0; list-style: none; }

/* The week, before and after */
.week__frame { container-type: inline-size; }
.week__stage { position: relative; width: 100%; max-width: 1040px; margin-inline: auto; aspect-ratio: 1040 / 560; }
.week__stop { top: -58px; right: 0; }
@container (width < 700px) { .week__stage { max-width: 420px; aspect-ratio: 360 / 980; } }

/* Seen, chosen, booked */
.groups__list { display: grid; gap: clamp(3rem, 2rem + 3vw, 5.5rem); }
.grp { display: grid; gap: var(--space-3); }
.grp__title { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.grp--2 .grp__title { text-align: right; }
.grp__frame { aspect-ratio: 1320 / 740; }
.grp__stage { position: absolute; inset: 0; }
.grp__pic { position: absolute; inset: 0; overflow: hidden; }
.grp__pic img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; }
.grp--1 .grp__pic img { object-position: 30% 50%; }
.grp--2 .grp__pic img { transform: scaleX(-1); }
.grp__scene { position: absolute; z-index: 2; top: 24px; bottom: 24px; right: 24px; width: min(40%, 540px); }
.grp--2 .grp__scene { right: auto; left: 24px; }
.grp__cards { position: absolute; z-index: 2; left: 24px; bottom: 24px; right: calc(min(40%, 540px) + 48px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 12px; margin: 0; padding: 0; list-style: none; }
.grp--2 .grp__cards { left: calc(min(40%, 540px) + 48px); right: 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.groups__stop { top: 24px; left: 24px; }

/* The mix */
.mix__in { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 760px); gap: clamp(2rem, 4vw, 4.5rem); align-items: center; }
.mix__words { margin: 0; }
.mix__frame { container-type: inline-size; }
.mix__stage { position: relative; width: 100%; aspect-ratio: 760 / 500; }
.mix__stop { top: calc(100% + 12px); right: 0; }
@container (width < 600px) { .mix__stage { max-width: 400px; margin-inline: auto; aspect-ratio: 360 / 560; } }

/* The close */
.svc-close .close__ground video { object-position: 62% 50%; }
.svc-close__go { margin-top: var(--space-2); }

/* Narrower screens */
@media (max-width: 1100px) {
  /* The header: the clip fills the part below its top fifth; the words above it, the path card at its foot, the phone between */
  .svc-hero { min-height: 0; }
  .svc-hero__stage { inset: 22% 0 0 0; }
  .svc-hero__stage video { object-position: 78% 50%; }
  .svc-hero__stage::after { background: linear-gradient(180deg, var(--c-ink) 0%, transparent 24%, transparent 50%, color-mix(in srgb, var(--c-ink) 72%, transparent) 100%); }
  .svc-hero__stop { top: calc(22% + 12px); right: 12px; }
  .svc-hero__in { grid-template-rows: auto auto; gap: clamp(220px, 44vw, 380px); padding-block: var(--space-4); }
  .svc-hero__words { align-self: start; }
  .svc-hero__path { width: 100%; max-width: 520px; }
  /* The groups: the photo above, the scene on its far side, the services under the photo */
  .grp__frame { aspect-ratio: auto; background: var(--c-paper-alt); }
  .grp__stage { position: relative; inset: auto; aspect-ratio: 4 / 3; }
  .grp__scene { top: 64px; width: 52%; }
  .grp--3 .grp__pic img { object-position: 60% 50%; }
  .groups__stop { top: 12px; left: auto; right: 12px; }
  .grp__cards, .grp--2 .grp__cards { position: static; padding: 16px; }
  .mix__in { grid-template-columns: 1fr; }
  .mix__words { max-width: 46rem; }
}
@media (max-width: 1000px) {
  /* Getting found: the photo above, the map half over its foot, below the face */
  .found__band { --ph: 600px; --mh: 530px; background: var(--c-paper-alt); }
  .found__ground { position: relative; inset: auto; height: var(--ph); }
  .found__ground img { object-position: 34% 50%; }
  .found__in { display: block; margin-top: calc(var(--mh) * -0.55); padding-block: 0 var(--space-5); }
  .found__side { width: auto; max-width: 560px; margin-inline: auto; }
  .found__map { height: var(--mh); }
  .found__stop { top: calc(var(--ph) - var(--mh) * 0.55 - 56px); left: auto; right: var(--gutter); }
}
@media (max-width: 760px) {
  /* The phone: the words on Ink, then the clip at a set height, so its phone's lit screen (the frame's 42 to 49%)
     always shows above the path card, and the card stands more than half on the clip */
  .svc-hero { --sh: 600px; --sa: 306px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto var(--sa) auto; padding-bottom: var(--space-4); }
  .svc-hero__in { display: contents; }
  .svc-hero__words { grid-row: 1; grid-column: 1; padding: var(--space-4) var(--gutter) var(--space-3); }
  .svc-hero__stage { position: relative; inset: auto; grid-row: 2 / 4; grid-column: 1; align-self: start; height: var(--sh); }
  .svc-hero__stage video { object-position: 73% 50%; }
  .svc-hero__stage::after { background: linear-gradient(180deg, var(--c-ink) 0, transparent 110px, transparent 60%, var(--c-ink) 100%); }
  .svc-hero__stop { grid-row: 2; grid-column: 1; top: 12px; right: 12px; }
  .svc-hero__path { position: relative; z-index: 2; grid-row: 3; grid-column: 1; width: auto; margin-inline: var(--gutter); }
  /* The groups: each photo tall enough that its scene stands over its foot, below the face */
  .grp--1 { --ph: 640px; --sh: 470px; }
  .grp--2 { --ph: 320px; --sh: 340px; }
  .grp--3 { --ph: 440px; --sh: 360px; }
  .grp__stage { aspect-ratio: auto; height: calc(var(--ph) + var(--sh) * 0.45); }
  .grp__pic { inset: 0 0 auto 0; height: var(--ph); }
  .grp__scene, .grp--2 .grp__scene { top: auto; bottom: 0; left: 0; right: 0; width: auto; height: var(--sh); }
  .grp--1 .grp__pic img { object-position: 22% 50%; }
  .grp--3 .grp__pic img { object-position: 37% 50%; }
  .groups__stop { top: calc(var(--ph) - var(--sh) * 0.55 - 56px); right: 12px; }
  .grp__cards, .grp--2 .grp__cards { grid-template-columns: 1fr; }
  .grp--2 .grp__title { text-align: left; }
  .week__stop { top: -54px; }
  /* the ground's hum lines above the headline, never through its letters */
  .week .ground__hum { top: 6px; width: 44px; }
}
@media (max-width: 640px) {
  .svc-close .close__ground video { object-position: 74% 40%; }
}
@media (max-width: 480px) {
  .found__band { --ph: 580px; --mh: 500px; }
  .found__cards { grid-template-columns: 1fr; }
}
