/* The service pages, one per service, opened from the strip-down on the home page. Loads after site.css.
   The opening view carries on from the strip-down: the part lit on black, with thin red lines out to its labels. */

.svc main { padding-top: var(--head); }
/* "Book this service" jumps to the form on the same page: glide there, and stop below the fixed header. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- Opening view: the service on the left, its parts on the right ---------- */
.svc-hero {
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); align-items: center;
  column-gap: clamp(40px, 6vw, 112px);
  min-height: calc(100vh - var(--head));
  max-width: 1600px; margin: 0 auto; padding: 16px var(--edge) 40px;
}
/* The svh sizes sit in @supports: beside var(), a browser that doesn't know svh would drop the value rather than
   fall back to the vh one before it. */
@supports (height: 1svh) { .svc-hero { min-height: calc(100svh - var(--head)); } }
.svc-hero__text { max-width: 34rem; padding-bottom: 3vh; }
.svc-title {
  margin: 0 0 22px; font-size: clamp(2.3rem, 1.3rem + 2.9vw, 4.4rem); font-weight: 800;
  line-height: 1.03; letter-spacing: -0.025em; text-wrap: balance;
}
.svc-lede { margin: 0 0 30px; max-width: 30rem; color: var(--soft); font-size: clamp(1.08rem, 1rem + 0.35vw, 1.3rem); line-height: 1.5; text-wrap: pretty; }
.svc-actions { margin: 0; }

/* The picture is square and its edges are already black, so it sits on the page with no frame. */
.svc-fig { position: relative; margin: 0; justify-self: center; width: min(100%, calc(100vh - var(--head) - 72px)); }
@supports (height: 1svh) { .svc-fig { width: min(100%, calc(100svh - var(--head) - 72px)); } }
.svc-fig__stage { position: relative; aspect-ratio: 1; }
.svc-fig__img { display: block; width: 100%; height: 100%; }
.svc-fig__lines, .svc-fig__dots { position: absolute; inset: 0; pointer-events: none; }

/* A label's line is two strokes: a short level run from the words, then straight to the point on the part.
   Each is a hairline turned to its angle, so it stays crisp at any size. */
.seg {
  position: absolute; left: calc(var(--x) * 100%); top: calc(var(--y) * 100%);
  width: calc(var(--len) * 100%); height: 1.5px; margin-top: -0.75px;
  background: var(--accent); transform-origin: 0 50%; rotate: var(--deg);
}
.svc-dot {
  position: absolute; left: calc(var(--ax) * 100%); top: calc(var(--ay) * 100%);
  width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 1.5px #fff, 0 1px 6px 2px rgba(0, 0, 0, 0.6);
  font-size: 0; color: transparent; /* the numbers show on phones only */
}

.svc-parts { position: absolute; inset: 0; pointer-events: none; }
.svc-parts ol { list-style: none; margin: 0; padding: 0; }
.svc-part {
  position: absolute; left: calc(var(--lx) * 100%); top: calc(var(--ly) * 100%);
  translate: 10px -50%; width: max-content; max-width: var(--wrap, 8.5em);
  font-size: 0.875rem; font-weight: 700; line-height: 1.25; letter-spacing: 0.01em; text-wrap: balance;
  text-shadow: 0 1px 10px #000, 0 0 2px #000;
}
.svc-part[data-side="left"] { translate: calc(-100% - 10px) -50%; text-align: right; }
.svc-part__num { display: none; }

/* The one moment of motion: the lines draw out from the labels to the parts, then the points land. */
@media (prefers-reduced-motion: no-preference) {
  .svc-part { animation: part-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: calc(0.3s + var(--i) * 0.14s); }
  .seg { animation: seg-draw 0.28s cubic-bezier(0.4, 0, 0.2, 1) both; animation-delay: calc(0.4s + var(--i) * 0.14s); }
  .seg--b { animation-duration: 0.5s; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); animation-delay: calc(0.66s + var(--i) * 0.14s); }
  .svc-dot { animation: dot-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: calc(1.06s + var(--i) * 0.14s); }
}
@keyframes part-in { from { opacity: 0; } }
@keyframes seg-draw { from { scale: 0 1; } }
@keyframes dot-in { from { scale: 0; opacity: 0; } }

/* ---------- What the service is ---------- */
.svc-body { max-width: 1120px; margin: 0 auto; padding: clamp(16px, 4vh, 48px) var(--edge) 0; }
.svc-sec {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); column-gap: clamp(24px, 5vw, 72px); row-gap: 14px;
  padding: 30px 0 48px; border-top: 1px solid var(--rule);
}
.svc-sec h2 { margin: 0; font-size: clamp(1.2rem, 1.05rem + 0.45vw, 1.45rem); font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; }
.svc-sec p { margin: 0 0 1em; max-width: 62ch; color: var(--soft); font-size: 1.0625rem; line-height: 1.7; text-wrap: pretty; }
.svc-sec p:last-child { margin-bottom: 0; }
.svc-signs, .svc-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 62ch; }
.svc-signs li, .svc-steps li { position: relative; padding-left: 32px; color: var(--soft); font-size: 1.0625rem; line-height: 1.6; }
.svc-signs li::before {
  content: ""; position: absolute; left: 3px; top: 0.8em; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85);
}
.svc-steps { counter-reset: step; }
.svc-steps li { counter-increment: step; }
.svc-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0.05em;
  color: var(--accent); font-weight: 800; font-variant-numeric: tabular-nums;
}

/* ---------- Booking: the same form as the home page, set in the same two columns as the sections above ---------- */
.svc .book {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); column-gap: clamp(24px, 5vw, 72px);
  max-width: 1120px; margin: clamp(24px, 5vh, 56px) auto 0; padding: 0 var(--edge) clamp(64px, 10vh, 112px);
  scroll-margin-top: var(--head);
}
.svc .book::before { content: ""; grid-column: 1 / -1; height: 1px; margin-bottom: 30px; background: var(--rule); }
.svc .book h2 { font-size: clamp(1.45rem, 1.2rem + 0.9vw, 1.9rem); letter-spacing: -0.015em; }
.svc .book__note { margin-bottom: 0; }

/* ---------- The other services ---------- */
.svc-more { max-width: 1120px; margin: 0 auto; padding: 8px var(--edge) 96px; }
.svc-more h2 { margin: 0 0 20px; font-size: clamp(1.45rem, 1.2rem + 0.9vw, 1.9rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.015em; }
.svc-list {
  list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(5, auto); grid-auto-flow: column;
  column-gap: clamp(24px, 4vw, 56px); border-top: 1px solid var(--rule);
}
.svc-list li { border-bottom: 1px solid var(--rule); }
.svc-list a { display: grid; grid-template-columns: 2.4em minmax(0, 1fr) 18px; align-items: center; column-gap: 10px; padding: 15px 0; text-decoration: none; }
.svc-list__num { color: var(--accent); font-size: 0.85rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.svc-list__name { font-weight: 700; line-height: 1.35; }
.svc-list .i-arrow { width: 16px; height: 16px; color: var(--muted); transition: translate 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s; }
.svc-list a:hover .svc-list__name, .svc-list a:focus-visible .svc-list__name { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.svc-list a:hover .i-arrow, .svc-list a:focus-visible .i-arrow { color: var(--accent); translate: 3px 0; }
.svc-list a[aria-current="page"] { color: var(--muted); }
.svc-list a[aria-current="page"] .svc-list__num { color: var(--muted); }
.svc-list a[aria-current="page"] .i-arrow { visibility: hidden; }

/* ---------- Phones: the picture first, numbered points on the parts and the names under it ---------- */
@media (max-width: 959px) {
  .svc-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 4px; row-gap: 28px; }
  /* A wider crop of the square picture (its top and bottom tenth are empty black), so the words sit higher.
     The crop cuts inside the picture's own edge fade, so the fade is drawn again at the new top and bottom. */
  .svc-fig { order: -1; width: 100%; justify-self: stretch; } /* the picture and its names start on the same edge as the words */
  .svc-fig__stage { width: min(100%, 70vh); width: min(100%, 70svh); aspect-ratio: 5 / 4; overflow: hidden; }
  .svc-fig__img {
    object-fit: cover;
    -webkit-mask-image: linear-gradient(transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(transparent, #000 8%, #000 92%, transparent);
  }
  .svc-fig__lines { display: none; }
  .svc-dot {
    /* The point's height in the cropped picture: the square picture is as tall as the stage is wide, a tenth of that
       is cut off at the top, and the stage is four fifths of it, so the picture's full height is 125% of the stage's. */
    top: calc((var(--ay) - 0.1) * 125%);
    width: 20px; height: 20px; margin: -10px 0 0 -10px; display: grid; place-items: center;
    font-size: 11px; font-weight: 700; line-height: 1; color: #fff; box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.55);
  }
  .svc-parts { position: static; margin-top: 6px; pointer-events: auto; } /* tied to the picture, well clear of the heading */
  .svc-parts ol { display: flex; flex-wrap: wrap; gap: 6px 18px; }
  .svc-part {
    position: static; translate: none; width: auto; max-width: none; display: flex; align-items: center; gap: 7px;
    text-align: left; color: var(--soft); font-size: 0.85rem; text-shadow: none; animation: none;
  }
  .svc-part[data-side="left"] { translate: none; text-align: left; }
  .svc-part__num {
    display: grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 50%;
    background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; line-height: 1;
  }
  .svc-hero__text { padding-bottom: 0; }
  .svc-title { margin-bottom: 14px; }
  .svc-lede { margin-bottom: 22px; }
  .svc-sec { grid-template-columns: minmax(0, 1fr); padding: 26px 0 36px; }
  .svc .book { grid-template-columns: minmax(0, 1fr); }
  .svc .book::before { margin-bottom: 26px; }
  .svc .book__intro { margin-bottom: 24px; }
  .svc .book__form { max-width: none; }
  .svc-list { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
}

/* Short phones (an older or smaller phone with the browser bars showing): a smaller picture, its names in two
   columns across the full width, and a smaller heading, so the name, its line and the button land in the first screen. */
@media (max-width: 959px) and (orientation: portrait) and (max-height: 600px) {
  .svc-hero { row-gap: 12px; }
  .svc-fig__stage { width: min(100%, 38vh); width: min(100%, 38svh); }
  .svc-parts ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 14px; }
  .svc-title { font-size: clamp(1.6rem, 1.1rem + 3vw, 2rem); margin-bottom: 8px; }
  .svc-lede { margin-bottom: 16px; font-size: 1rem; line-height: 1.45; }
}

/* Phones on their side: too short to stack, so the words sit on the left and the picture on the right. */
@media (max-width: 959px) and (orientation: landscape) and (max-height: 520px) {
  .svc-hero { grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; align-items: start; padding-top: 12px; }
  .svc-fig { order: 0; width: min(46vw, calc((100vh - var(--head) - 28px) * 1.25)); }
  @supports (height: 1svh) { .svc-fig { width: min(46vw, calc((100svh - var(--head) - 28px) * 1.25)); } }
  .svc-fig__stage { width: 100%; }
  .svc-title { font-size: clamp(1.8rem, 1rem + 3vw, 2.4rem); }
}

/* ---------- Page not found (404.html): the heading, one line and the way home, where an opening view would be ---------- */
.nf {
  display: flex; flex-direction: column; justify-content: center;
  min-height: calc(100vh - var(--head));
  max-width: 1600px; margin: 0 auto; padding: 16px var(--edge) 10vh;
}
@supports (height: 1svh) { .nf { min-height: calc(100svh - var(--head)); } }
