.services-hero {
  --services-motion-fast: 160ms;
  --services-motion-base: 280ms;
  --services-motion-story: 620ms;
  --services-ease-out: cubic-bezier(.2, .8, .2, 1);
  --services-ease-emphasized: cubic-bezier(.16, 1, .3, 1);
  padding: 106px 24px 28px;
  overflow: hidden;
  background: #f4f2ed;
}

.services-hero__shell {
  width: min(1480px, 100%);
  margin: 0 auto;
}

.services-hero__controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.services-hero__counter {
  min-width: 58px;
  color: #625f58;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
}

.services-hero__arrow {
  width: 38px;
  height: 38px;
  border: 1px solid #cbc7bf;
  border-radius: 50%;
  background: transparent;
  color: #1a1917;
  font: 500 18px/1 var(--font, sans-serif);
  cursor: pointer;
  transition: transform var(--services-motion-fast) var(--services-ease-out), background-color var(--services-motion-fast) linear, color var(--services-motion-fast) linear;
}

.services-hero__arrow:active { transform: scale(.96); }
.services-hero__arrow:focus-visible,
.services-panel__trigger:focus-visible,
.services-panel__cta:focus-visible { outline: 3px solid #ff6c35; outline-offset: 3px; }

@media (hover: hover) and (pointer: fine) {
  .services-hero__arrow:hover { background: #1a1917; color: #fff; }
}

.services-panorama {
  display: flex;
  gap: 8px;
  min-height: clamp(560px, 44vw, 680px);
  padding: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  border: 1px solid #dedad1;
  border-radius: 22px;
  background: rgba(255,255,255,.7);
  box-shadow: 0 24px 70px rgba(50,43,34,.1);
}

.services-panorama::-webkit-scrollbar { display: none; }

.services-panel {
  position: relative;
  isolation: isolate;
  flex: 0 0 92px;
  min-width: 92px;
  overflow: hidden;
  scroll-snap-align: center;
  border-radius: 14px;
  background: #282724;
  color: #fff;
  transition: flex-basis var(--services-motion-story) var(--services-ease-emphasized), transform var(--services-motion-base) var(--services-ease-out);
}

.services-panel.is-active { flex-basis: min(660px, calc(100vw - 168px)); }

.services-panel > img {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  filter: saturate(.8) contrast(1.04);
  transform: scale(1.02);
  transition: transform var(--services-motion-story) var(--services-ease-emphasized), filter var(--services-motion-base) linear;
}

/* Tune each service photograph for both the rail and expanded-panel crops. */
.services-panel:nth-child(2) > img { object-position: 18% center; }
.services-panel:nth-child(3) > img { object-position: 38% center; }
.services-panel:nth-child(4) > img { object-position: 62% center; }
.services-panel:nth-child(5) > img { object-position: 82% center; }
.services-panel:nth-child(6) > img { object-position: 45% center; }
.services-panel:nth-child(7) > img { object-position: 18% center; }
.services-panel:nth-child(8) > img { object-position: 50% center; }
.services-panel:nth-child(9) > img { object-position: 82% center; }
.services-panel:nth-child(10) > img { object-position: 76% center; }
.services-panel:nth-child(11) > img { object-position: 48% center; }

.services-panel::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(18,17,15,.22) 0%, rgba(18,17,15,.05) 35%, rgba(18,17,15,.94) 100%);
}

.services-panel::after {
  content: '';
  position: absolute;
  z-index: 4;
  inset: 1px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 13px;
  pointer-events: none;
}

.services-panel--intro {
  background: #ff4b12;
  color: #fff;
}

.services-panel--intro::before {
  opacity: .42;
  background: radial-gradient(circle at 78% 15%, rgba(255,255,255,.34), transparent 28%), linear-gradient(145deg, transparent 0 58%, rgba(44,18,6,.22));
}

.services-panel__trigger {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}

.services-panel__index {
  position: absolute;
  z-index: 3;
  top: 20px;
  left: 18px;
  color: rgba(255,255,255,.78);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .08em;
  pointer-events: none;
}

.services-panel__rail-title {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 28px;
  width: max-content;
  max-width: 520px;
  overflow: hidden;
  color: #fff;
  font-size: 18px;
  font-weight: 520;
  letter-spacing: -.025em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: translateX(-50%) rotate(180deg);
  transform-origin: center;
  transition: opacity var(--services-motion-fast) linear, transform var(--services-motion-base) var(--services-ease-emphasized);
  pointer-events: none;
}

.services-panel.is-active .services-panel__rail-title {
  opacity: 0;
  transform: translateX(-50%) rotate(180deg) translateY(10px);
}

.services-panel__content {
  position: absolute;
  z-index: 3;
  right: clamp(24px, 4vw, 48px);
  bottom: clamp(26px, 4vw, 48px);
  left: clamp(24px, 4vw, 48px);
  max-width: 570px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--services-motion-base) linear 80ms, transform var(--services-motion-story) var(--services-ease-emphasized);
  pointer-events: none;
}

.services-panel.is-active .services-panel__content {
  opacity: 1;
  transform: none;
}

.services-panel.is-active > img {
  filter: saturate(.95) contrast(1.02);
  transform: scale(1.055);
}

.services-panel__eyebrow {
  margin: 0 0 18px;
  color: rgba(255,255,255,.72);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.services-panel__content h1,
.services-panel__content h2 {
  margin: 0 0 18px;
  max-width: 620px;
  color: #fff;
  font-weight: 520;
  letter-spacing: -.055em;
  line-height: .98;
  text-wrap: balance;
}

.services-panel__content h1 { font-size: clamp(42px, 4.4vw, 66px); }
.services-panel__content h2 { font-size: clamp(42px, 4.4vw, 62px); }
.services-panel__content h1 em { color: #1a1917; font-style: normal; }

.services-panel__content > p:not(.services-panel__eyebrow) {
  max-width: 540px;
  margin: 0 0 26px;
  color: rgba(255,255,255,.82);
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.58;
  text-wrap: pretty;
}

.services-panel__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.services-panel__cta {
  position: relative;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid rgba(255,255,255,.46);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  pointer-events: auto;
  transition: transform var(--services-motion-fast) var(--services-ease-out), background-color var(--services-motion-fast) linear, color var(--services-motion-fast) linear;
}

.services-panel__cta--primary,
.services-panel__cta--light { background: #fff; color: #1a1917; border-color: #fff; }
.services-panel__cta--quiet { background: transparent; }
.services-panel__cta:active { transform: scale(.98); }

@media (hover: hover) and (pointer: fine) {
  .services-panel:not(.is-active):hover { transform: translateY(-3px); }
  .services-panel__cta:hover { transform: translateY(-2px); }
  .services-panel__cta--primary:hover,
  .services-panel__cta--light:hover { background: #1a1917; border-color: #1a1917; color: #fff; }
  .services-panel__cta--quiet:hover { background: #fff; color: #1a1917; }
}

.services-hero__hint {
  margin: 0;
  color: #77736b;
  font-size: 12px;
}

.services-hero__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  margin-top: 14px;
}

@media (max-width: 1024px) {
  .services-hero { padding-top: 102px; }
  .services-panel { flex-basis: 82px; min-width: 82px; }
  .services-panel.is-active { flex-basis: min(600px, calc(100vw - 150px)); }
}

@media (max-width: 760px) {
  .services-hero { padding: 68px 14px 32px; }
  .services-panorama {
    display: flex;
    min-height: 0;
    max-height: none;
    flex-direction: column;
    overflow: visible;
    scroll-snap-type: none;
    padding: 6px;
    border-radius: 18px;
  }
  .services-panel,
  .services-panel.is-active {
    flex: none;
    width: 100%;
    min-width: 0;
    min-height: 72px;
  }
  .services-panel.is-active { min-height: min(560px, calc(100svh - 122px)); }
  .services-panel__index { top: 50%; left: 16px; transform: translateY(-50%); }
  .services-panel.is-active .services-panel__index { top: 18px; transform: none; }
  .services-panel__rail-title {
    top: 50%;
    right: 18px;
    bottom: auto;
    left: 52px;
    width: auto;
    max-width: calc(100% - 82px);
    font-size: 16px;
    writing-mode: horizontal-tb;
    transform: translateY(-50%);
  }
  .services-panel.is-active .services-panel__rail-title { transform: translateY(calc(-50% + 8px)); }
  .services-panel__content { right: 22px; bottom: 88px; left: 22px; }
  .services-panel__content h1,
  .services-panel__content h2 { font-size: clamp(34px, 10vw, 48px); }
  .services-panel__content > p:not(.services-panel__eyebrow) { font-size: 14px; }
  .services-panel__actions { flex-direction: column; align-items: stretch; }
  .services-panel__cta { width: 100%; }
  .services-hero__footer { justify-content: space-between; margin-top: 12px; }
}

@media (max-width: 390px) {
  .services-hero { padding-inline: 10px; }
  .services-panel.is-active { min-height: 570px; }
  .services-panel__content { right: 18px; bottom: 88px; left: 18px; }
  .services-panel__content h1,
  .services-panel__content h2 { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .services-panorama { scroll-behavior: auto; }
  .services-panel,
  .services-panel > img,
  .services-panel__rail-title,
  .services-panel__content,
  .services-panel__cta,
  .services-hero__arrow { transition-duration: 1ms; }
  .services-panel.is-active > img { transform: none; }
}
