/* XUSOI Layer 1 — HeroParallax
   Premium minimal: white field, black type, architectural grid, restrained motion */

.hero-parallax {
  --hp-bg: #ffffff;
  --hp-ink: #0a0a0a;
  --hp-ink-muted: #525252;
  --hp-radius: 0.5rem;
  --hp-card-w: min(30rem, calc(100vw - 2.5rem));
  --hp-gap: clamp(1.25rem, 3.5vw, 5rem);
  --hp-row-gap: clamp(1.75rem, 4vw, 5rem);
  --hp-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hp-duration: 220ms;
  --hp-duration-lift: 420ms;

  position: relative;
  display: flex;
  flex-direction: column;
  height: 210vh;
  padding: clamp(3rem, 7vw, 7rem) 0 clamp(1.25rem, 3vw, 2.5rem);
  overflow: hidden;
  background: var(--hp-bg);
  perspective: 1000px;
  transform-style: preserve-3d;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 768px) {
  .hero-parallax {
    height: 230vh;
    --hp-card-w: 30rem;
  }
}

.hero-parallax__header {
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 7rem) clamp(1rem, 3vw, 1.5rem) clamp(1.5rem, 4vw, 3.5rem);
  z-index: 2;
}

.hero-parallax__reveal {
  width: min(58rem, 100%);
}

.hero-parallax__reveal .scroll-reveal {
  margin: 0;
}

.hero-parallax__reveal .scroll-reveal-text {
  font-family: "Noto Sans TC", "Noto Sans SC", "Noto Sans JP", sans-serif;
  font-size: clamp(1.65rem, 4.2vw, 3.05rem);
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--hp-ink);
  text-wrap: balance;
}

.hero-parallax__reveal .scroll-reveal-text br {
  display: block;
  content: "";
  margin-top: 0.55em;
}

.hero-parallax__stage {
  position: relative;
  will-change: transform, opacity;
  transform-style: preserve-3d;
  transform-origin: center center;
}

.hero-parallax__row {
  display: flex;
  margin-bottom: var(--hp-row-gap);
  gap: var(--hp-gap);
  will-change: transform;
}

.hero-parallax__row--reverse {
  flex-direction: row-reverse;
}

.hero-parallax__row:last-child {
  margin-bottom: 0;
}

.hero-parallax__card {
  position: relative;
  flex-shrink: 0;
  width: var(--hp-card-w);
  aspect-ratio: 16 / 9;
  height: auto;
  will-change: transform;
  transition: transform var(--hp-duration-lift) var(--hp-ease);
}

.hero-parallax__card-link {
  display: block;
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: var(--hp-radius);
  outline: none;
  transition:
    box-shadow var(--hp-duration) var(--hp-ease),
    transform var(--hp-duration) var(--hp-ease);
}

.hero-parallax__card-link:focus-visible {
  box-shadow:
    0 0 0 2px var(--hp-bg),
    0 0 0 4px var(--hp-ink);
}

.hero-parallax__card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.001);
  transition: transform 650ms var(--hp-ease);
}

.hero-parallax__card-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgb(0 0 0 / 0.72) 0%,
    rgb(0 0 0 / 0.18) 42%,
    transparent 70%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--hp-duration) var(--hp-ease);
}

.hero-parallax__card-title {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.9rem;
  margin: 0;
  color: #fff;
  font-family: "Noto Sans TC", "Noto Sans SC", "Noto Sans JP", sans-serif;
  font-size: clamp(0.9rem, 1.4vw, 1.05rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
  opacity: 0;
  transform: translate3d(0, 0.35rem, 0);
  transition:
    opacity var(--hp-duration) var(--hp-ease),
    transform var(--hp-duration) var(--hp-ease);
  pointer-events: none;
}

/* Hover + keyboard focus + touch active */
.hero-parallax__card:hover,
.hero-parallax__card:focus-within {
  transform: translate3d(0, -0.85rem, 0);
}

.hero-parallax__card:hover .hero-parallax__card-link,
.hero-parallax__card:focus-within .hero-parallax__card-link {
  box-shadow: 0 18px 36px -18px rgb(0 0 0 / 0.28);
}

.hero-parallax__card:hover .hero-parallax__card-img,
.hero-parallax__card:focus-within .hero-parallax__card-img {
  transform: scale(1.04);
}

.hero-parallax__card:hover .hero-parallax__card-veil,
.hero-parallax__card:focus-within .hero-parallax__card-veil {
  opacity: 1;
}

.hero-parallax__card:hover .hero-parallax__card-title,
.hero-parallax__card:focus-within .hero-parallax__card-title {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Touch: no hover — keep a light persistent caption so cards stay legible */
@media (hover: none) {
  .hero-parallax__card-veil {
    opacity: 0.55;
  }

  .hero-parallax__card-title {
    opacity: 0.95;
    transform: none;
  }

  .hero-parallax__card:active {
    transform: translate3d(0, -0.35rem, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-parallax {
    height: auto;
    min-height: 0;
    padding-bottom: 1.5rem;
    perspective: none;
  }

  .hero-parallax__stage,
  .hero-parallax__row,
  .hero-parallax__card,
  .hero-parallax__card-img,
  .hero-parallax__card-veil,
  .hero-parallax__card-title,
  .hero-parallax__card-link {
    transition: none !important;
    transform: none !important;
    will-change: auto;
  }

  .hero-parallax__stage {
    opacity: 1 !important;
  }

  .hero-parallax__row {
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 1.25rem;
  }

  .hero-parallax__card {
    width: min(22rem, calc(50vw - 1.5rem));
  }

  .hero-parallax__card-veil {
    opacity: 0.5;
  }

  .hero-parallax__card-title {
    opacity: 1;
  }
}
