/* Scroll-driven story for the Designer Positioning section. */
.intro {
  --intro-surround-opacity: 1;
  --intro-stack-opacity: 1;
  --intro-focus-opacity: 0;
  --intro-focus-scale: 1;
  --intro-focus-rotate: 0deg;
  --intro-focus-rotate-x: 68deg;
  --intro-focus-rotate-y: -18deg;
  --intro-focus-lift: 28px;
  --intro-open-progress: 0;
  --intro-open-opacity: 0;
  --intro-bloom-progress: 0;
  --intro-book-center-y: 0px;
  min-height: 390vh;
  display: block;
  overflow: visible;
  background: #f6f6f9;
}

.intro-scroll-stage {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  min-height: 680px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  perspective: 1400px;
  isolation: isolate;
  background: #f6f6f9;
}

.intro-scroll-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
  /* Figma node 573:221 rebuilt in CSS: segmented guides and registration crosses. */
  background:
    linear-gradient(#afafaf 0 0) calc(2.956% - 5.675px) 29.537% / 12px 1px no-repeat,
    linear-gradient(#afafaf 0 0) 2.956% calc(29.537% - 2.751px) / 1px 12px no-repeat,
    linear-gradient(#afafaf 0 0) calc(34.359% - 2.220px) 29.537% / 12px 1px no-repeat,
    linear-gradient(#afafaf 0 0) 34.359% calc(29.537% - 2.751px) / 1px 12px no-repeat,
    linear-gradient(#afafaf 0 0) calc(65.709% + 1.228px) 29.537% / 12px 1px no-repeat,
    linear-gradient(#afafaf 0 0) 65.709% calc(29.537% - 2.751px) / 1px 12px no-repeat,
    linear-gradient(#afafaf 0 0) calc(97.111% + 4.682px) 29.537% / 12px 1px no-repeat,
    linear-gradient(#afafaf 0 0) 97.111% calc(29.537% - 2.751px) / 1px 12px no-repeat,
    linear-gradient(#afafaf 0 0) calc(2.956% - 5.675px) 60.185% / 12px 1px no-repeat,
    linear-gradient(#afafaf 0 0) 2.956% calc(60.185% + .620px) / 1px 12px no-repeat,
    linear-gradient(#afafaf 0 0) calc(34.359% - 2.220px) 60.185% / 12px 1px no-repeat,
    linear-gradient(#afafaf 0 0) 34.359% calc(60.185% + .620px) / 1px 12px no-repeat,
    linear-gradient(#afafaf 0 0) calc(65.709% + 1.228px) 60.185% / 12px 1px no-repeat,
    linear-gradient(#afafaf 0 0) 65.709% calc(60.185% + .620px) / 1px 12px no-repeat,
    linear-gradient(#afafaf 0 0) calc(97.111% + 4.682px) 60.185% / 12px 1px no-repeat,
    linear-gradient(#afafaf 0 0) 97.111% calc(60.185% + .620px) / 1px 12px no-repeat,
    linear-gradient(to right, #d0d0d0 0 calc(2.956% - 12px), transparent calc(2.956% - 12px) calc(2.956% + 12px), #d0d0d0 calc(2.956% + 12px) calc(34.359% - 12px), transparent calc(34.359% - 12px) calc(34.359% + 12px), #d0d0d0 calc(34.359% + 12px) calc(65.709% - 12px), transparent calc(65.709% - 12px) calc(65.709% + 12px), #d0d0d0 calc(65.709% + 12px) calc(97.111% - 12px), transparent calc(97.111% - 12px) calc(97.111% + 12px), #d0d0d0 calc(97.111% + 12px) 100%) 0 29.537% / 100% 1px no-repeat,
    linear-gradient(to right, #d0d0d0 0 calc(2.956% - 12px), transparent calc(2.956% - 12px) calc(2.956% + 12px), #d0d0d0 calc(2.956% + 12px) calc(34.359% - 12px), transparent calc(34.359% - 12px) calc(34.359% + 12px), #d0d0d0 calc(34.359% + 12px) calc(65.709% - 12px), transparent calc(65.709% - 12px) calc(65.709% + 12px), #d0d0d0 calc(65.709% + 12px) calc(97.111% - 12px), transparent calc(97.111% - 12px) calc(97.111% + 12px), #d0d0d0 calc(97.111% + 12px) 100%) 0 60.185% / 100% 1px no-repeat,
    linear-gradient(to bottom, #d0d0d0 0 calc(29.537% - 12px), transparent calc(29.537% - 12px) calc(29.537% + 12px), #d0d0d0 calc(29.537% + 12px) calc(60.185% - 12px), transparent calc(60.185% - 12px) calc(60.185% + 12px), #d0d0d0 calc(60.185% + 12px) 100%) 2.956% 0 / 1px 100% no-repeat,
    linear-gradient(to bottom, #d0d0d0 0 calc(29.537% - 12px), transparent calc(29.537% - 12px) calc(29.537% + 12px), #d0d0d0 calc(29.537% + 12px) calc(60.185% - 12px), transparent calc(60.185% - 12px) calc(60.185% + 12px), #d0d0d0 calc(60.185% + 12px) 100%) 34.359% 0 / 1px 100% no-repeat,
    linear-gradient(to bottom, #d0d0d0 0 calc(29.537% - 12px), transparent calc(29.537% - 12px) calc(29.537% + 12px), #d0d0d0 calc(29.537% + 12px) calc(60.185% - 12px), transparent calc(60.185% - 12px) calc(60.185% + 12px), #d0d0d0 calc(60.185% + 12px) 100%) 65.709% 0 / 1px 100% no-repeat,
    linear-gradient(to bottom, #d0d0d0 0 calc(29.537% - 12px), transparent calc(29.537% - 12px) calc(29.537% + 12px), #d0d0d0 calc(29.537% + 12px) calc(60.185% - 12px), transparent calc(60.185% - 12px) calc(60.185% + 12px), #d0d0d0 calc(60.185% + 12px) 100%) 97.111% 0 / 1px 100% no-repeat;
}

.intro-scroll-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: calc(var(--intro-open-opacity) * .13);
  background: radial-gradient(circle at 50% 50%, transparent 20%, rgba(10, 16, 22, .32) 100%);
}

.intro.is-visible .intro-scroll-stage h2,
.intro.is-visible .intro-scroll-stage .intro-designer-subtitle,
.intro.is-visible .intro-scroll-stage .sticker,
.intro.is-visible .intro-scroll-stage .green {
  opacity: var(--intro-surround-opacity);
  filter: blur(calc((1 - var(--intro-surround-opacity)) * 9px));
  pointer-events: auto;
  transition: none;
}

.intro-scroll-stage h2 { position: relative; z-index: 2; }

/* Keep a consistent 12px gap between the two Chinese heading lines. */
html[lang="zh-CN"] .intro-scroll-stage h2 { line-height: calc(1em + 12px); }

.intro.is-visible .intro-scroll-stage h2 {
  transform: translateY(calc(-24px + (1 - var(--intro-surround-opacity)) * 34px)) scale(calc(.92 + var(--intro-surround-opacity) * .08));
  transform-origin: 50% 50%;
}

.intro-designer-subtitle {
  position: relative;
  z-index: 2;
  margin: 0;
  color: #191919;
  font: 500 20px/1.4 "DM Sans", "Noto Sans SC", sans-serif;
  letter-spacing: .01em;
  transform: translateY(32px);
}

.intro.is-visible .intro-scroll-stage .intro-designer-subtitle {
  transform: translateY(calc(32px + (1 - var(--intro-surround-opacity)) * 26px));
}

@media (min-width: 801px) {
  .intro-scroll-stage .s3 { left: 17%; }
  .intro-scroll-stage .s4 { right: 17%; }
}

.intro.is-visible .intro-scroll-stage .sticker {
  transform: rotate(var(--sticker-rotate, 0deg)) scale(calc(.82 + var(--intro-surround-opacity) * .18));
}

.intro-scroll-stage .s1 { --sticker-rotate: -26deg; }
.intro-scroll-stage .s2 { --sticker-rotate: 30deg; }
.intro-scroll-stage .s3 { --sticker-rotate: -19deg; }
.intro-scroll-stage .s4 { --sticker-rotate: 13deg; }

.intro.is-visible .intro-scroll-stage .green {
  transform: translateY(calc((1 - var(--intro-surround-opacity)) * 26px)) scale(calc(.9 + var(--intro-surround-opacity) * .1));
}

.intro-scroll-stage .intro-books {
  z-index: 8;
  align-self: center;
  opacity: 1;
  transform: none;
  transition: none;
  will-change: transform, opacity;
}

.intro.is-visible .intro-scroll-stage .intro-books {
  transform: translate3d(0, var(--intro-book-center-y), 0);
}

.intro-book-stack {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.intro-book-stack {
  opacity: var(--intro-stack-opacity);
}

.intro-book-webgl {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100vw;
  height: 100vh;
  max-width: none;
  transform: translate(-50%, -50%);
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity .24s ease;
}

.intro.is-webgl-books .intro-book-webgl {
  opacity: 1;
}

.intro.is-webgl-books .intro-book-stack {
  opacity: 0;
}

.intro.is-webgl-books .intro-open-book {
  display: none;
}

.intro-book-model {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(31vw, 390px);
  aspect-ratio: 1.42;
  opacity: var(--intro-focus-opacity);
  transform: translate(-50%, -50%) translateY(var(--intro-focus-lift)) rotateZ(var(--intro-focus-rotate)) rotateX(var(--intro-focus-rotate-x)) rotateY(var(--intro-focus-rotate-y)) scale(var(--intro-focus-scale));
  transform-style: preserve-3d;
  transform-origin: center center;
  will-change: transform, opacity;
}

.intro-book-shell {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  filter: drop-shadow(0 30px 26px rgba(8, 36, 57, .25));
}

.intro-book-cover,
.intro-book-pages,
.intro-book-spine,
.intro-book-page-top,
.intro-book-page-bottom {
  position: absolute;
  display: block;
  backface-visibility: hidden;
}

.intro-book-cover {
  inset: 0;
  border-radius: 18px 8px 8px 18px;
  border: 2px solid #074c80;
  background:
    repeating-linear-gradient(8deg, rgba(255,255,255,.035) 0 1px, rgba(0,18,38,.035) 1px 3px),
    radial-gradient(circle at 22% 18%, rgba(105,194,245,.35), transparent 28%),
    linear-gradient(128deg, #187ab8 0%, #095889 56%, #063c66 100%);
  box-shadow: inset 0 0 0 2px rgba(117,196,239,.36), inset -20px -20px 38px rgba(0,25,47,.28);
}

.intro-book-cover-front {
  transform: translateZ(19px);
}

.intro-book-cover-front::before {
  content: "";
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(142,212,250,.38);
  border-radius: 13px;
  box-shadow: inset 0 0 0 3px rgba(2,47,79,.18);
}

.intro-book-cover-back {
  transform: translateZ(-19px) rotateY(180deg);
}

.intro-book-title {
  position: absolute;
  left: 12%;
  top: 13%;
  text-align: left;
  color: rgba(238,248,255,.96);
  font: 600 clamp(17px, 1.8vw, 26px)/1.06 Arial, sans-serif;
  letter-spacing: -.04em;
  text-shadow: none;
}

.intro-book-mark {
  position: absolute;
  right: 11%;
  bottom: 10%;
  color: rgba(211,239,255,.82);
  font: 700 clamp(9px, .8vw, 12px)/1 Arial, sans-serif;
  letter-spacing: .18em;
}

.intro-book-spine {
  top: 9px;
  bottom: 9px;
  left: -19px;
  width: 38px;
  transform: rotateY(-90deg);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 3px),
    linear-gradient(90deg, #063657, #0d659e 42%, #08456f);
  border: 1px solid #063657;
}

.intro-book-spine b {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(230,247,255,.78);
  font: 600 7px/1 Arial, sans-serif;
  letter-spacing: .1em;
  writing-mode: vertical-rl;
}

.intro-book-pages {
  top: 12px;
  right: -17px;
  bottom: 12px;
  width: 36px;
  transform: rotateY(90deg);
  background: repeating-linear-gradient(0deg, #fbfaf3 0 2px, #d9d7cc 2px 3px);
  box-shadow: inset 7px 0 12px rgba(91,103,106,.18);
}

.intro-book-page-top,
.intro-book-page-bottom {
  left: 16px;
  right: 14px;
  height: 38px;
  background: repeating-linear-gradient(90deg, #fffef8 0 3px, #dedcd1 3px 4px);
}

.intro-book-page-top {
  top: -19px;
  transform: rotateX(90deg);
}

.intro-book-page-bottom {
  bottom: -19px;
  transform: rotateX(-90deg);
}

.intro-open-book {
  position: absolute;
  z-index: 10;
  top: 50%;
  left: 50%;
  width: min(76vw, 980px);
  aspect-ratio: 1.78;
  opacity: var(--intro-open-opacity);
  transform: translate(-50%, -50%) scale(calc(.92 + var(--intro-open-progress) * .08));
  transform-style: preserve-3d;
  perspective: 1500px;
  pointer-events: none;
  will-change: transform, opacity;
}

.intro-page {
  position: absolute;
  top: 0;
  width: 50.15%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, rgba(73, 83, 76, .2), transparent 44%),
    linear-gradient(135deg, #0a0e0d 0%, #151a18 58%, #080a09 100%);
  border: clamp(5px, .55vw, 9px) solid #184e78;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.3), 0 26px 55px rgba(6, 20, 29, .24);
  backface-visibility: visible;
  will-change: transform;
}

.intro-page-left {
  right: 50%;
  border-radius: 22px 5px 5px 22px;
  transform-origin: right center;
  transform: rotateY(calc((1 - var(--intro-open-progress)) * -179deg));
  z-index: 2;
}

.intro-page-left::after {
  content: "DESIGNING\A AI EXPERIENCES";
  position: absolute;
  inset: -9px;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  padding: 18% 13%;
  border: clamp(5px, .55vw, 9px) solid #236fb0;
  border-radius: 5px 22px 22px 5px;
  color: rgba(244, 249, 255, .96);
  white-space: pre;
  text-align: left;
  font: 600 clamp(16px, 2vw, 31px)/1.08 Arial, sans-serif;
  background:
    radial-gradient(circle at 24% 18%, rgba(120, 195, 255, .26), transparent 30%),
    linear-gradient(135deg, #368bd5, #2b78c8 58%, #1c61aa);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.16), 0 22px 48px rgba(18, 67, 108, .24);
  transform: rotateY(180deg) translateZ(2px);
  backface-visibility: hidden;
}

.intro-page-right {
  left: 50%;
  border-radius: 5px 22px 22px 5px;
  transform-origin: left center;
  transform: rotateY(0deg);
  z-index: 1;
}

.intro-book-seam {
  position: absolute;
  z-index: 3;
  top: 1.5%;
  bottom: 1.5%;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
  opacity: var(--intro-open-progress);
  background: linear-gradient(180deg, rgba(150,194,224,.9), rgba(5,22,34,.85), rgba(150,194,224,.82));
  box-shadow: 0 0 13px rgba(0,0,0,.55);
}

.intro-book-bloom {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 51%;
  width: min(47vw, 590px);
  opacity: var(--intro-bloom-progress);
  transform: translate(-50%, -46%) translateY(calc((1 - var(--intro-bloom-progress)) * 68px)) scale(calc(.48 + var(--intro-bloom-progress) * .52));
  transform-origin: center bottom;
  filter: drop-shadow(0 26px 28px rgba(0,0,0,.48));
  will-change: transform, opacity;
  display: block;
  height: auto;
  object-fit: contain;
}

@media (max-width: 800px) {
  .intro { min-height: 330vh; }
  .intro-scroll-stage { min-height: 620px; }
  .intro-open-book { width: 94vw; }
  .intro-book-bloom { width: 65vw; }
  .intro-book-model { width: min(58vw, 320px); }
}

@media (prefers-reduced-motion: reduce) {
  .intro {
    min-height: 100vh;
    --intro-surround-opacity: 1 !important;
    --intro-stack-opacity: 1 !important;
    --intro-focus-opacity: 0 !important;
    --intro-open-opacity: 0 !important;
  }

  .intro-scroll-stage { position: relative; }
}
