/* =========================================================
   SERVICES PAGE SECTIONS
   Everything below the hero banner, down to the footer: a deck
   of cards, one per service, dealt into a fan that the scroll
   turns, then a wine-coloured lobby where a brass lift dial
   counts the reasons. Motion is on the cards and the dial; the
   words are always fully legible. No black.
   The photographs in img/services are light copies of each
   service page's hero image. Awards, FAQ, buttons and word
   reveals are shared with the About page
   (css/about-sections.css).
   Behaviour lives in js/services-sections.js.
   ========================================================= */

.sv-wheel,
.sv-lobby {
  --ab-ink: #3d1030;
  --ab-ink-72: rgba(61, 16, 48, .72);
  --ab-ink-12: rgba(61, 16, 48, .12);
  --ab-pink: #c73689;
  --ab-pink-deep: #a32570;
  --ab-brass: #c8b18c;
  --ab-white-20: rgba(255, 255, 255, .2);
  --ab-ease: cubic-bezier(.19, 1, .22, 1);
  --ab-space: clamp(56px, 6vw, 96px);
}

/* ---------- the deck: every service, dealt into a slow-turning fan ----------
   As the section arrives the cards sit in one white stack, deal out along an arc and flip
   over to their photographs. The page scroll then turns the fan, one service at a time
   (js/services-sections.js adds .is-live). With reduced motion or without the script they
   are a plain grid, face up. */
.sv-wheel {
  --card-w: max(190px, min(54vw, 320px, 38vh));
  --radius: clamp(16px, 1.7vw, 24px);
  padding: clamp(40px, 5vw, 80px) 0 var(--ab-space);
  background:
    radial-gradient(80% 62% at 50% 100%, #f7c9e0 0%, rgba(247, 201, 224, 0) 72%),
    linear-gradient(#fff, #fdf3f8);
}

.sv-wheel__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 6px 40px;
}

.sv-wheel .sv-wheel__title {
  margin: 0;
  font-size: clamp(46px, min(7.4vw, 12vh), 108px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--ab-ink);
}

.sv-wheel__head .ab-crumb ul { margin-bottom: 8px; }

.sv-wheel .sv-wheel__cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: clamp(26px, 3vw, 40px) 0 0;
  padding: 0;
  list-style: none;
}

/* ---------- a card ---------- */
.sv-wheel .sv-deal {
  min-width: 0;
  aspect-ratio: 4 / 5;
  margin: 0;
  perspective: 1400px;
}

.sv-deal__card {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  color: #fff;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(.3, .9, .3, 1);
}

.sv-deal.is-waiting .sv-deal__card {
  transform: rotateY(-180deg);
  transition: none;
}

.sv-deal.is-tilting .sv-deal__card { transition: transform .3s ease-out; }

/* the white side, as on the home page deck */
.sv-deal__back { display: none; }

.is-live .sv-deal__back {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(199, 54, 137, .24);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 26px 44px -30px rgba(134, 29, 88, .7);
  transform: rotateY(180deg);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.sv-deal__back::before {
  content: attr(data-n);
  font-family: var(--hm-heading-font);
  font-size: clamp(76px, 8vw, 120px);
  font-style: italic;
  font-variant-numeric: lining-nums;
  font-weight: 500;
  color: transparent;
  -webkit-text-stroke: 1px rgba(199, 54, 137, .6);
}

/* the photograph side, which is the real content */
.sv-deal__face {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: #c73689;
  box-shadow: 0 30px 50px -30px rgba(94, 22, 67, .75);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.sv-deal__photo {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transition: transform 1.6s var(--ab-ease);
}

.sv-deal.is-active .sv-deal__photo { transform: scale(1.05); }

/* a wine shade behind the words */
.sv-deal__face::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(94, 22, 67, 0) 44%, rgba(94, 22, 67, .92) 100%);
}

/* a thin brass frame on the card in the middle of the fan */
.sv-deal__face::after {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 2;
  border: 1px solid var(--ab-brass);
  border-radius: calc(var(--radius) - 6px);
  opacity: 0;
  transform: scale(1.03);
  transition: opacity .5s, transform .9s var(--ab-ease);
  pointer-events: none;
}

.sv-deal.is-active .sv-deal__face::after {
  opacity: 1;
  transform: none;
}

.sv-deal__foot {
  position: absolute;
  z-index: 3;
  left: 20px;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.sv-deal__icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 8px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
}

.sv-deal__name {
  flex: 1 0 100%;
  order: 3;
  font-family: var(--hm-heading-font);
  font-size: clamp(22px, 2.1vw, 29px);
  font-weight: 500;
  line-height: 1.1;
  color: #fff;
}

.sv-deal__go {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 50%;
  color: #fff;
  transition: background .4s, border-color .4s, color .4s;
}

.sv-deal__go svg { transition: transform .6s var(--ab-ease); }

/* style.css forces a dark pink on every a:hover, which disappears on the photographs */
.sv-deal__card:hover,
.sv-deal__card:focus { color: #fff !important; }

.sv-deal__card:focus { outline: none; }

.sv-deal__card:focus-visible .sv-deal__face::after {
  opacity: 1;
  transform: none;
  border-width: 2px;
}

@media (hover: hover) {
  .sv-deal__card:hover .sv-deal__photo { transform: scale(1.08); }

  .sv-deal__card:hover .sv-deal__go {
    color: #a32570;
    background: #fff;
    border-color: #fff;
  }

  .sv-deal__card:hover .sv-deal__go svg { transform: rotate(-45deg); }
}

/* ---------- the pinned stage and the fan ---------- */
.sv-wheel.is-live { padding: 0; }

.sv-wheel.is-live .sv-wheel__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  padding-top: clamp(98px, 13vh, 124px);
}

.sv-wheel.is-live .sv-wheel__cards {
  position: absolute;
  left: 50%;
  display: block;
  width: 0;
  height: 0;
  margin: 0;
}

/* --arc is the brass line that runs round the outside of the fan */
.sv-wheel.is-live .sv-wheel__cards::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: var(--arc, 0);
  height: var(--arc, 0);
  border: 1px solid var(--ab-brass);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.sv-wheel.is-live .sv-deal {
  position: absolute;
  left: calc(var(--card-w) / -2);
  top: calc(var(--card-w) * -.65);
  width: var(--card-w);
  height: calc(var(--card-w) * 1.3);
  aspect-ratio: auto;
  will-change: transform;
}

.sv-wheel__count {
  position: absolute;
  z-index: 200;
  left: 50%;
  bottom: clamp(12px, 3vh, 26px);
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--hm-heading-font);
  font-size: 21px;
  font-style: italic;
  font-variant-numeric: lining-nums;
  color: var(--ab-ink);
  transform: translateX(-50%);
}

.sv-wheel__rail {
  position: relative;
  display: block;
  width: clamp(110px, 22vw, 260px);
  height: 1px;
  background: rgba(61, 16, 48, .22);
}

.sv-wheel__rail i {
  position: absolute;
  inset: 0;
  background: var(--ab-pink);
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
}

/* ---------- the lobby and its lift dial ---------- */
.sv-lobby {
  padding: var(--ab-space) 0;
  color: #fff;
  background: linear-gradient(160deg, #8a2060 0%, #6a1a4b 62%, #5e1643 100%);
}

.sv-lobby__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(36px, 6vw, 100px);
  align-items: center;
}

.sv-lift {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 0 0 clamp(24px, 3vw, 40px);
  overflow: visible;
}

.sv-lift__arc,
.sv-lift__tick {
  fill: none;
  stroke: var(--ab-brass);
  stroke-width: 1.5;
}

.sv-lift__arc--inner {
  stroke-width: 1;
  opacity: .5;
}

.sv-lift__floor {
  font-family: var(--hm-heading-font);
  font-size: 24px;
  font-style: italic;
  font-variant-numeric: lining-nums;
  text-anchor: middle;
  fill: rgba(255, 255, 255, .78);
  transition: fill .6s;
}

.sv-lift__floor.is-floor { fill: var(--ab-brass); }

/* --a is the needle's angle, set by the script; it rests on floor 5 without one */
.sv-lift__needle {
  stroke: var(--ab-brass);
  stroke-width: 2.5;
  stroke-linecap: round;
  transform-box: view-box;
  transform-origin: 170px 180px;
  transform: rotate(var(--a, 60deg));
}

.sv-lift__hub { fill: var(--ab-brass); }
.sv-lift__pip { fill: #6a1a4b; }

.sv-lobby .sv-lobby__title {
  margin: 0 0 clamp(22px, 2.6vw, 34px);
  font-size: clamp(44px, 5.4vw, 80px);
  font-weight: 500;
  line-height: 1;
  color: #fff;
}

.sv-lobby .sv-lobby__title em { color: #f28cc3; }

.sv-lobby .sv-lobby__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sv-lobby .sv-lobby__list li {
  position: relative;
  margin: 0;
  padding: clamp(12px, 1.4vw, 18px) clamp(12px, 1.4vw, 20px);
  border-top: 1px solid var(--ab-white-20);
}

.sv-lobby .sv-lobby__list li:first-child { border-top: 0; }

/* soft light on the floor the needle is pointing at */
.sv-lobby__list li::before {
  content: "";
  position: absolute;
  inset: 3px 0;
  z-index: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, .09);
  opacity: 0;
  transition: opacity .7s;
}

.sv-lobby__list li.is-floor::before { opacity: 1; }

.sv-lobby .sv-lobby__reason {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.6vw, 22px);
  margin: 0;
  font-size: clamp(24px, 2.5vw, 35px);
  font-weight: 500;
  line-height: 1.16;
  color: #fff;
}

.sv-lobby__reason img {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  padding: 12px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(200, 177, 140, 0);
  transition: box-shadow 1.1s var(--ab-ease);
}

.sv-lobby__list li.is-lit .sv-lobby__reason img { box-shadow: 0 0 0 5px rgba(200, 177, 140, .5); }

/* ---------- smaller screens ---------- */
@media (max-width: 991px) {
  .sv-wheel .sv-wheel__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sv-lobby__grid { grid-template-columns: minmax(0, 1fr); }
  .sv-lift { margin-left: auto; margin-right: auto; }
}

@media (max-width: 575px) {
  .sv-deal__foot {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .sv-deal__icon,
  .sv-deal__go {
    width: 36px;
    height: 36px;
  }

  .sv-deal__icon { padding: 7px; }
  .sv-deal__name { font-size: 21px; }
}
