/* XUSOI — 網站設計服務 (layer 2 scroll storytelling) */

.xwd {
  --xwd-fg: #0a0a0a;
  --xwd-muted: #5c5c5c;
  --xwd-soft: rgba(10, 10, 10, 0.06);
  --xwd-glass: rgba(255, 255, 255, 0.55);
  --xwd-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  background: #fff;
  color: var(--xwd-fg);
  isolation: isolate;
  overflow: clip;
  scroll-margin-top: 0.5rem;
}

/* Avoid smooth-scroll fighting ScrollTrigger pin measurements on this page */
body.is-xusoi-story {
  scroll-behavior: auto;
}
html:has(body.is-xusoi-story) {
  scroll-behavior: auto;
}

.xwd__intro {
  position: relative;
  z-index: 2;
  display: grid;
  place-content: center;
  min-height: min(72svh, 42rem);
  padding:
    calc(var(--nav-island-top, 0.9rem) + var(--nav-h, 3.85rem) + 2.5rem)
    clamp(1.25rem, 5vw, 3.5rem)
    clamp(3rem, 8vw, 5.5rem);
  text-align: center;
}

.xwd__eyebrow {
  margin: 0 0 1.4rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--xwd-muted);
}

.xwd__title {
  margin: 0;
  font-size: clamp(2.6rem, 8.5vw, 6.4rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.xwd__title-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.xwd__title-line > span {
  display: block;
  transform: translateY(110%);
  will-change: transform;
}

.xwd.is-ready .xwd__title-line > span,
.xwd.is-static .xwd__title-line > span {
  transform: none;
}

.xwd__pin-space {
  position: relative;
  /* height set by GSAP pinSpacing; fallback for no-js / reduced motion handled in .is-static */
}

.xwd__stage {
  position: relative;
  height: 100svh;
  width: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
}

.xwd__atmosphere {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
}

.xwd__arc {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(10, 10, 10, 0.06);
  background: radial-gradient(
    circle at 50% 40%,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(245, 245, 245, 0.35) 48%,
    rgba(255, 255, 255, 0) 72%
  );
}

.xwd__arc--a {
  width: min(120vw, 64rem);
  height: min(120vw, 64rem);
  left: 50%;
  top: 58%;
  transform: translate(-50%, -42%);
  opacity: 0.9;
}

.xwd__arc--b {
  width: min(80vw, 42rem);
  height: min(80vw, 42rem);
  right: -12%;
  top: 8%;
  opacity: 0.55;
  background: radial-gradient(
    circle at 30% 40%,
    rgba(255, 255, 255, 0.75),
    rgba(250, 250, 250, 0.2) 55%,
    transparent 70%
  );
  backdrop-filter: blur(0px);
}

.xwd__glass {
  position: absolute;
  width: min(36rem, 78vw);
  height: min(22rem, 46vh);
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  border-radius: 2.6rem;
  background: var(--xwd-glass);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 30px 60px rgba(10, 10, 10, 0.04);
  backdrop-filter: blur(18px) saturate(1.05);
  -webkit-backdrop-filter: blur(18px) saturate(1.05);
  opacity: 0.55;
}

.xwd__viewport {
  position: relative;
  z-index: 1;
  width: min(46rem, calc(100% - 2.5rem));
  min-height: min(28rem, 58svh);
  display: grid;
  place-items: center;
  text-align: center;
}

.xwd__act {
  grid-area: 1 / 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.85rem, 2vw, 1.25rem);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: transform, opacity, filter, clip-path;
}

.xwd__act.is-active {
  pointer-events: auto;
}

.xwd__kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--xwd-muted);
}

.xwd__headline {
  margin: 0;
  max-width: 18em;
  font-size: clamp(1.85rem, 4.8vw, 3.35rem);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

/* Break CJK (and EN) titles only between phrases — never orphan 1–2 glyphs. */
.xwd__phrase {
  white-space: nowrap;
}

.xwd__line {
  margin: 0;
  max-width: 28em;
  font-size: clamp(1.02rem, 2.1vw, 1.28rem);
  font-weight: 300;
  line-height: 1.7;
  color: var(--xwd-muted);
}

.xwd__price-wrap {
  position: relative;
  overflow: hidden;
  margin: 0.35rem 0 0.15rem;
  padding: 0.15em 0.1em;
}

.xwd__price {
  display: block;
  margin: 0;
  font-size: clamp(3.2rem, 10vw, 6.2rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  transform-origin: center bottom;
}

.xwd__plan {
  margin: 0;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.xwd__revisions {
  margin: 0.15rem 0 0;
  font-size: clamp(0.98rem, 1.9vw, 1.15rem);
  font-weight: 400;
  color: var(--xwd-fg);
  opacity: 0;
}

.xwd__cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.85rem;
  min-height: 3.1rem;
  padding: 0 1.7rem;
  border-radius: 999px;
  border: 1px solid #0a0a0a;
  background: #0a0a0a;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  overflow: hidden;
  transform-origin: center center;
  transition: background 0.35s var(--xwd-ease), color 0.35s var(--xwd-ease);
}

.xwd__cta:hover {
  background: #fff;
  color: #0a0a0a;
}

.xwd__cta-label {
  white-space: nowrap;
}

.xwd__dots {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: max(1.4rem, env(safe-area-inset-bottom, 0px) + 0.8rem);
  transform: translateX(-50%);
  display: flex;
  gap: 0.45rem;
  pointer-events: none;
}

.xwd__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.18);
  transition: background 0.4s var(--xwd-ease), transform 0.4s var(--xwd-ease);
}

.xwd__dot.is-on {
  background: #0a0a0a;
  transform: scale(1.25);
}

/* Mobile type + spacing */
@media (max-width: 720px) {
  .xwd__intro {
    min-height: min(58svh, 28rem);
    padding-bottom: 2.5rem;
  }

  .xwd__title {
    font-size: clamp(2.2rem, 11vw, 3.2rem);
  }

  .xwd__glass {
    width: min(92vw, 24rem);
    height: min(52vh, 18rem);
    border-radius: 1.8rem;
    opacity: 0.4;
  }

  .xwd__headline {
    font-size: clamp(1.55rem, 7.2vw, 2.05rem);
    max-width: 15.5em;
  }

  .xwd__line {
    font-size: 0.98rem;
    max-width: 22em;
  }

  .xwd__price {
    font-size: clamp(2.6rem, 14vw, 3.6rem);
  }

  .xwd__cta {
    min-height: 2.85rem;
    font-size: 0.9rem;
    padding: 0 1.35rem;
  }
}

/* Reduced motion / static readable stack */
.xwd.is-static .xwd__pin-space {
  height: auto !important;
}

.xwd.is-static .xwd__stage {
  position: relative !important;
  height: auto;
  min-height: 0;
  display: block;
  padding: 0 clamp(1.25rem, 5vw, 3.5rem) clamp(4rem, 10vw, 6rem);
  overflow: visible;
  transform: none !important;
}

.xwd.is-static .xwd__atmosphere {
  display: none;
}

.xwd.is-static .xwd__viewport {
  display: flex;
  flex-direction: column;
  gap: clamp(3.5rem, 10vw, 5.5rem);
  width: min(40rem, 100%);
  margin: 0 auto;
  min-height: 0;
}

.xwd.is-static .xwd__act {
  position: relative;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  filter: none !important;
  clip-path: none !important;
  pointer-events: auto;
}

.xwd.is-static .xwd__revisions,
.xwd.is-static .xwd__cta {
  opacity: 1 !important;
  transform: none !important;
  width: auto !important;
}

.xwd.is-static .xwd__dots {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .xwd__title-line > span {
    transform: none !important;
  }
}
