/* ═══════════════════════════════════════════════════
   HERO — full-viewport carousel with Ken Burns
   前衛東方官網
   ═══════════════════════════════════════════════════ */

/* ── Container ── */
.hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
  background: var(--dark);
}

/* ── Slides wrapper ── */
.hero-slides {
  position: absolute;
  inset: 0;
}

/* ── Individual slide ── */
.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.5s var(--ease-out);
  will-change: opacity;
}

.hero-slide.active {
  opacity: 1;
}

/* ── Slide image with Ken Burns ── */
.hero-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.05);
  transition: transform 8s linear;
  will-change: transform;
}

.hero-slide.active img {
  transform: scale(1.12);
}

/* ── Gradient overlay - 雙層加強對比 ── */
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to right,
      rgba(28, 27, 24, 0.55) 0%,
      rgba(28, 27, 24, 0.25) 40%,
      transparent 70%
    ),
    linear-gradient(
      to bottom,
      rgba(28, 27, 24, 0.15) 0%,
      rgba(28, 27, 24, 0.45) 55%,
      rgba(28, 27, 24, 0.85) 100%
    );
  pointer-events: none;
}

/* ── Caption (案例名稱 右下角) ── */
.hero-caption {
  position: absolute;
  right: 8%;
  bottom: 80px;
  z-index: 8;
  text-align: right;
  color: rgba(255, 255, 255, 0.85);
  font-family: 'Noto Sans TC', sans-serif;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.8s var(--ease-out) 0.3s, transform 0.8s var(--ease-out) 0.3s;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}
.hero-slide.active .hero-caption {
  opacity: 1;
  transform: translateY(0);
}
.caption-tag {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--accent);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.caption-name {
  display: block;
  font-size: 0.95rem;
  font-weight: 300;
  letter-spacing: 0.05em;
}

/* ── Content block ── */
.hero-content {
  position: absolute;
  bottom: 18%;
  left: 8%;
  z-index: 10;
  max-width: 640px;
}

/* ── Title - 手動斷句 ── */
.hero-title {
  font-family: 'Noto Serif TC', 'Noto Sans TC', serif;
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 400;
  color: #ffffff;
  line-height: 1.25;
  letter-spacing: 0.06em;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.hero-title .title-line {
  display: inline-block;
}
.hero-title .title-line + .title-line {
  margin-left: 0.25em;
}
/* 手機版：強制換行 */
@media (max-width: 640px) {
  .hero-title .title-line {
    display: block;
  }
  .hero-title .title-line + .title-line {
    margin-left: 0;
    margin-top: 0.1em;
  }
}

/* ── Subtitle ── */
.hero-subtitle {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.25em;
  margin: 20px 0 36px;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

/* ── CTA Buttons ── */
.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-btn {
  display: inline-block;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  transition:
    background var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.hero-btn--primary {
  background: var(--accent);
  color: var(--card);
  border: 1.5px solid var(--accent);
}

.hero-btn--primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  transform: translateY(-2px);
}

.hero-btn--ghost {
  background: transparent;
  color: var(--card);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
}

.hero-btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

/* ── Dot navigation ── */
.hero-dots {
  position: absolute;
  bottom: 40px;
  right: 8%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition:
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.hero-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.3);
}

.hero-dot:hover:not(.active) {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.25);
}

/* ── Progress bar ── */
.hero-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: 3px;
  background: rgba(200, 191, 176, 0.2);
}

.hero-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transform-origin: left;
  transition: none;
}

.hero-progress-bar.running {
  animation: heroProgressFill 5s linear forwards;
}

@keyframes heroProgressFill {
  from { width: 0%; }
  to   { width: 100%; }
}

/* ── Mobile adjustments ── */
@media (max-width: 768px) {
  .hero-content {
    left: 7%;
    right: 7%;
    bottom: 22%;
    max-width: none;
  }

  .hero-caption {
    right: 7%;
    bottom: 70px;
    max-width: 60%;
  }
  .caption-tag {
    font-size: 0.65rem;
  }
  .caption-name {
    font-size: 0.8rem;
  }

  .hero-title {
    font-size: clamp(2.2rem, 9vw, 3.2rem);
    line-height: 1.2;
  }

  .hero-subtitle {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    margin: 16px 0 28px;
    letter-spacing: 0.12em;
  }

  .hero-dots {
    flex-direction: row;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    bottom: 60px;
  }

  .hero-actions {
    gap: 12px;
  }

  .hero-btn {
    padding: 10px 20px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }

  .hero-content {
    bottom: 20%;
  }

  .hero-btn--ghost {
    display: none;
  }
}
