﻿/* Services section ---------------------------------------------------------- */
.services-section {
  --services-title-opacity: 1;
  --services-title-y: 0svh;
  --services-title-scale: 1;
  --services-title-blur: 0px;
  --services-tunnel-progress: 0;
  --services-tunnel-opacity: 0;
  --services-tunnel-plate-width: clamp(520px, 32vw, 690px);
  --services-time-opacity: 0;
  --services-blackout-opacity: 0;
  --services-card-progress: 0;
  --services-card-opacity: 0;
  --services-card-y: 7svh;
  --services-card-scale: 0.985;
  --services-card-blur: 14px;
  --services-outro: 0;
  --services-portal-reveal: 0;
  --services-portal-expand: 0;
  --services-portal-progress: 0;
  --services-portal-scale: 1;
  --services-portal-width: 30vw;
  --services-portal-height: 22svh;
  --services-portal-radius: 10px;
  --services-portal-glow: 18px;
  --services-portal-aura: 19px;
  --services-portal-stroke-opacity: 0.06;
  position: relative;
  z-index: 3;
  min-height: 760svh;
  margin-top: 0;
  background: #050607;
  color: #f8fffd;
  overflow: clip;
  isolation: isolate;
}

html.is-dark-stage,
body.is-dark-stage {
  background: #050607;
}

html.services-sequence-playing,
body.services-sequence-playing {
  scroll-behavior: auto !important;
}

body.is-dark-stage::before,
body.is-dark-stage::after {
  opacity: 0;
}

html.is-warm-stage {
  background: #f7f4ee;
}

html[lang="en"] .services-section {
  --services-tunnel-plate-width: clamp(430px, 30vw, 620px);
}

.services-section::before,
.services-section::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  z-index: 0;
  pointer-events: none;
}

.services-section::before {
  top: -18svh;
  height: 42svh;
  background: linear-gradient(180deg, rgba(5, 6, 7, 0), #050607 72%);
}

.services-section::after {
  bottom: -1px;
  height: 34svh;
  background: linear-gradient(180deg, rgba(5, 6, 7, 0), #050607 88%);
}

.services-sticky {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 100svh;
  display: grid;
  grid-template: "stage" minmax(100svh, auto) / minmax(0, 1fr);
  place-items: stretch;
  background:
    #050607;
  overflow: hidden;
}

.services-sticky::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 50%, rgba(22, 30, 26, 0.52), rgba(0, 0, 0, 0.92) 58%, #000 100%),
    #000;
  opacity: var(--services-blackout-opacity);
  pointer-events: none;
}

.services-sticky::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 0 40%, rgba(0, 0, 0, 0.14) 58%, rgba(0, 0, 0, 0.58) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.24), transparent 30% 70%, rgba(0, 0, 0, 0.32));
  opacity: calc(var(--services-card-progress) * (1 - var(--services-outro)) * 0.56);
  pointer-events: none;
}

.services-prismatic-canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: var(--services-portal-width);
  height: var(--services-portal-height);
  display: block;
  background: #000;
  mix-blend-mode: normal;
  opacity: var(--services-tunnel-opacity);
  border-radius: var(--services-portal-radius);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, var(--services-portal-stroke-opacity)),
    0 0 var(--services-portal-glow) rgba(0, 0, 0, 0.84),
    0 0 var(--services-portal-aura) rgba(30, 223, 210, 0.12);
  filter:
    saturate(calc(1.06 - var(--services-card-progress) * 0.08))
    brightness(calc(1 + var(--services-tunnel-progress) * 0.18))
    contrast(calc(1.02 + var(--services-card-progress) * 0.02))
    blur(calc(var(--services-card-progress) * 2px));
  transform:
    translate3d(calc(-50% + var(--services-tunnel-progress) * -1.6vw), -50%, 0)
    scale(calc(var(--services-portal-scale) + var(--services-tunnel-progress) * 0.035 + var(--services-card-progress) * 0.035));
  transform-origin: 50% 50%;
  pointer-events: none;
  clip-path: inset(0 round var(--services-portal-radius));
}
.services-time-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  opacity: var(--services-time-opacity);
  filter: blur(calc(var(--services-card-progress) * 2.5px));
  transform: scale(calc(1 + var(--services-card-progress) * 0.018));
  transform-origin: 54% 52%;
  mix-blend-mode: normal;
  pointer-events: none;
}

.services-title-stage,
.services-card-stage {
  grid-area: stage;
  position: relative;
  z-index: 3;
}

.services-title-stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(80px, 10svh, 140px) clamp(24px, 7vw, 128px);
  text-align: center;
  opacity: var(--services-title-opacity);
  transform:
    translate3d(0, var(--services-title-y), 0)
    scale(var(--services-title-scale));
  filter: blur(var(--services-title-blur));
  transform-origin: 50% 54%;
  pointer-events: none;
}

.services-entry-title {
  width: min(92vw, 1500px);
  max-width: calc(100vw - 72px);
  margin: 0;
  color: rgba(255, 255, 255, 0.94);
  font-family: "SkyHeart Clear Serif SC", "MiSans", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(4.2rem, 8vw, 10rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  display: grid;
  grid-template-columns: minmax(0, max-content) clamp(320px, 32vw, 560px) minmax(0, max-content);
  align-items: center;
  justify-content: center;
  column-gap: clamp(18px, 2.4vw, 46px);
  user-select: none;
}

.services-title-part {
  display: block;
  white-space: nowrap;
}

.services-title-part--left {
  grid-column: 1;
  justify-self: end;
}

.services-title-part--right {
  grid-column: 3;
  justify-self: start;
}


html[lang="en"] .services-entry-title {
  width: min(92vw, 1520px);
  max-width: calc(100vw - 72px);
  grid-template-columns: minmax(0, max-content) clamp(300px, 30vw, 520px) minmax(0, max-content);
  font-family: "Outfit", "Satoshi", system-ui, sans-serif;
  font-style: normal;
  font-size: clamp(2.6rem, 5.2vw, 7.6rem);
  font-weight: 520;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.services-card-stage {
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: clamp(82px, 10svh, 132px) clamp(28px, 7vw, 116px) clamp(94px, 11svh, 148px);
  opacity: var(--services-card-opacity);
  transform:
    translate3d(0, var(--services-card-y), 0)
    scale(var(--services-card-scale));
  filter: blur(var(--services-card-blur));
  transform-origin: 50% 56%;
  pointer-events: none;
}

.services-text-track {
  position: relative;
  z-index: 2;
  width: min(980px, 100%);
  min-height: min(62svh, 680px);
  display: grid;
  align-items: center;
  margin: 0 auto;
}

.service-text-panel {
  --service-panel-progress: 0;
  --service-panel-offset: 0;
  --service-panel-y: 0svh;
  --service-panel-scale: 0.82;
  --service-panel-engrave: 0;
  --service-panel-blur: 12px;
  position: relative;
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: minmax(92px, 0.24fr) minmax(0, 1fr);
  column-gap: clamp(26px, 5vw, 82px);
  align-items: start;
  width: min(860px, 78vw);
  max-width: 860px;
  color: #f3efe7;
  opacity: calc(var(--service-panel-progress) * (1 - var(--services-outro)));
  transform:
    translate3d(0, var(--service-panel-y), 0)
    scale(var(--service-panel-scale));
  filter: blur(var(--service-panel-blur));
  transform-origin: 50% 50%;
  pointer-events: none;
  mix-blend-mode: normal;
  transition: none;
}

.service-text-index {
  color: rgba(93, 198, 191, calc(0.18 + var(--service-panel-engrave) * 0.54));
  font-family: "Major Mono Display", "MiSans", monospace;
  font-size: clamp(3.2rem, 8.4vw, 9.8rem);
  line-height: 0.82;
}

.service-text-title {
  margin: 0;
  color: rgba(248, 245, 239, calc(0.42 + var(--service-panel-engrave) * 0.52));
  font-family: "SkyHeart Clear Serif SC", "SimSun", "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: clamp(2.9rem, 5.9vw, 7.4rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0;
  text-wrap: balance;
}

html[lang="en"] .service-text-title {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-style: italic;
  font-size: clamp(2.6rem, 5.1vw, 6.4rem);
}

.service-text-body {
  grid-column: 2;
  max-width: 48ch;
  margin: clamp(20px, 3.2svh, 34px) 0 0;
  color: rgba(238, 233, 223, calc(0.1 + var(--service-panel-progress) * 0.76));
  font-family: "MiSans", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(0.92rem, 1vw, 1.08rem);
  line-height: 1.86;
}

html[lang="en"] .service-text-body {
  font-family: "Outfit", "Satoshi", system-ui, sans-serif;
  line-height: 1.72;
}

@media (max-width: 860px) {
  .services-section {
    min-height: 760svh;
  }

  .services-title-stage {
    padding: clamp(76px, 10svh, 110px) 22px;
  }

  .services-entry-title {
    max-width: calc(100vw - 34px);
    width: min(94vw, 640px);
    grid-template-columns: minmax(0, max-content) clamp(132px, 38vw, 220px) minmax(0, max-content);
    column-gap: clamp(8px, 2vw, 16px);
    font-size: clamp(2.75rem, 13vw, 4.8rem);
  }
  html[lang="en"] .services-entry-title {
    max-width: calc(100vw - 34px);
    width: min(94vw, 680px);
    grid-template-columns: minmax(0, max-content) clamp(128px, 36vw, 210px) minmax(0, max-content);
    font-size: clamp(1.38rem, 6.4vw, 2.65rem);
  }

  .services-title-part {
    white-space: normal;
    text-wrap: balance;
  }

  .services-card-stage {
    padding: clamp(72px, 10svh, 102px) 22px clamp(104px, 13svh, 138px);
  }

  .services-text-track {
    min-height: 48svh;
  }

  .service-text-panel {
    grid-template-columns: 1fr;
    row-gap: 12px;
    transform:
      translate3d(0, calc(var(--service-panel-offset) * -18px + (1 - var(--service-panel-progress)) * 34px), 0)
      scale(calc(0.98 + var(--service-panel-progress) * 0.02));
  }

  .service-text-index {
    font-size: clamp(2.5rem, 17vw, 5.2rem);
  }

  .service-text-title {
    font-size: clamp(2.2rem, 12.5vw, 4.5rem);
  }

  html[lang="en"] .service-text-title {
    font-size: clamp(2rem, 10.5vw, 4rem);
  }

  .service-text-body {
    grid-column: 1;
    max-width: 34ch;
    font-size: 0.92rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  .services-section {
    min-height: auto;
  }

  .services-sticky {
    position: relative;
    min-height: auto;
    overflow: visible;
  }

  .services-title-stage {
    min-height: 72svh;
    opacity: 1;
    transform: none;
    filter: none;
  }

  .services-card-stage {
    min-height: auto;
    opacity: 1;
    transform: none;
    filter: none;
  }

  .services-text-track {
    min-height: auto;
    display: grid;
    gap: 42px;
    transform: none;
  }

  .service-text-panel {
    grid-area: auto;
    opacity: 1;
    transform: none;
    filter: none;
    pointer-events: auto;
  }

}
