/* ============================================
   簡單歌唱 Singple — Apple-style LP
   Custom styles complementing Tailwind CDN
   ============================================ */

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 56px;
}

body {
  font-family: 'Inter', 'Noto Sans TC', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* 中文標題：負字距 + 字重控制 */
h1, h2, h3, h4 {
  font-feature-settings: 'palt';
  letter-spacing: -0.015em;
}

/* === Reveal 動畫（IntersectionObserver 觸發）=== */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 連續元素的階梯式延遲 */
.reveal:nth-child(1) { transition-delay: 0ms; }
.reveal:nth-child(2) { transition-delay: 80ms; }
.reveal:nth-child(3) { transition-delay: 160ms; }
.reveal:nth-child(4) { transition-delay: 240ms; }
.reveal:nth-child(5) { transition-delay: 320ms; }
.reveal:nth-child(6) { transition-delay: 400ms; }

/* === 學員卡片 === */
.student-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  overflow: hidden;
  background: #f0f0f0;
  cursor: default;
  isolation: isolate;
}

.student-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  display: block;
}

.student-card:hover img {
  transform: scale(1.06);
}

/* hover 浮現名字與註記 */
.student-card::after {
  content: attr(data-name) ' · ' attr(data-note);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.15) 50%, rgba(0,0,0,0) 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  letter-spacing: 0.02em;
}

.student-card:hover::after {
  opacity: 1;
}

/* 手機版直接顯示文字底欄（沒有 hover）*/
@media (max-width: 768px) {
  .student-card::after {
    opacity: 1;
    padding: 10px;
    font-size: 11px;
  }
}

/* === 聲波 Canvas === */
#wave {
  filter: drop-shadow(0 0 12px rgba(245, 166, 35, 0.15));
}

/* === Nav blur 動態強度 === */
nav {
  transition: backdrop-filter 0.3s, background-color 0.3s, border-color 0.3s;
}

nav.scrolled {
  background-color: rgba(255, 255, 255, 0.85);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* === 圖片載入過渡 === */
img {
  transition: opacity 0.6s ease;
}

img[loading='lazy']:not([src]) {
  opacity: 0;
}

/* === 滾動提示動畫 === */
@keyframes float-down {
  0%, 100% { transform: translateY(0) translateX(-50%); opacity: 0.6; }
  50% { transform: translateY(8px) translateX(-50%); opacity: 1; }
}

.absolute.bottom-8.left-1\/2 {
  animation: float-down 2.4s ease-in-out infinite;
}

/* === 課程卡 hover 效果 === */
#courses .group .aspect-\[4\/5\] {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease;
}

#courses .group:hover .aspect-\[4\/5\] {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.12);
}

/* === Mentor 區塊光暈漸變 === */
#mentor .blur-3xl {
  animation: pulse-glow 8s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.1); }
}

/* === 按鈕 hover 微動 === */
a[href='#cta-final'],
a[href='#'].rounded-full {
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.3s ease;
}

a[href='#'].rounded-full.bg-warm:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(245, 166, 35, 0.4);
}

/* === Selection === */
::selection {
  background: rgba(245, 166, 35, 0.25);
  color: #1d1d1f;
}

/* === Scrollbar (subtle) === */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 5px;
  border: 2px solid #fff;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
