/**
 * Joryee Fluid Glass Architecture Styles
 * 巧翼設計 - 流體毛玻璃、光學邊框與極致切入動態樣式
 * 遵循 DESIGN.md 規範與 PSR-12/現代前端標準
 */

/* 1. 流體環境光暈光斑 (Ambient Fluid Blobs) */
.fluid-blob-1 {
  background: radial-gradient(circle, rgba(168, 85, 247, 0.45) 0%, rgba(236, 72, 153, 0.35) 45%, rgba(59, 130, 246, 0.2) 75%, transparent 100%);
  filter: blur(75px);
}

.fluid-blob-2 {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.5) 0%, rgba(129, 140, 248, 0.4) 40%, rgba(244, 114, 182, 0.3) 75%, transparent 100%);
  filter: blur(85px);
}

.fluid-blob-3 {
  background: radial-gradient(circle, rgba(251, 146, 60, 0.35) 0%, rgba(244, 63, 94, 0.35) 50%, rgba(168, 85, 247, 0.2) 80%, transparent 100%);
  filter: blur(75px);
}

.fluid-blob-mesh {
  filter: blur(80px);
  opacity: 0.55;
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* 2. 擬態毛玻璃鏡面表面 (Chrome & Frosted Glass Surfaces) */
.chrome-surface {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.78) 0%, rgba(248, 250, 255, 0.52) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 20px 50px -12px rgba(138, 143, 204, 0.18), inset 0 0 1px 1px rgba(255, 255, 255, 0.9);
}

.shadow-glass {
  box-shadow: 0 20px 50px -12px rgba(138, 143, 204, 0.18), 0 0 1px 1px rgba(255, 255, 255, 0.9) inset;
}

.shadow-glass-hover:hover {
  box-shadow: 0 30px 60px -12px rgba(100, 116, 215, 0.28), 0 0 2px 1px rgba(255, 255, 255, 1) inset;
}

.chrome-surface:hover {
  box-shadow: 0 30px 60px -12px rgba(100, 116, 215, 0.28), inset 0 0 2px 1px rgba(255, 255, 255, 1);
}

.chrome-pill {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px -2px rgba(112, 128, 176, 0.12);
}

.specular-card {
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 40px -15px rgba(9, 13, 22, 0.06), 0 0 50px -10px rgba(168, 85, 247, 0.08), inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* 3. 3D 透視與傾斜特效 (Perspective & 3D Tilt) */
.hero-perspective {
  perspective: 1400px;
}

.card-3d-tilt {
  transform: rotateX(16deg) rotateY(-10deg) rotateZ(4deg);
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.6s ease;
}

.card-3d-tilt:hover {
  transform: rotateX(8deg) rotateY(-4deg) rotateZ(1deg) translateY(-8px);
}

/* 4. 動態漸層與關鍵幀動畫 */
@keyframes floatSlow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(1.2deg); }
}

@keyframes floatRev {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(12px) rotate(-1.2deg); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 0.95; transform: scale(1.08); }
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes shineSweep {
  0% { transform: translateX(-150%) skewX(-25deg); }
  100% { transform: translateX(250%) skewX(-25deg); }
}

@keyframes badgePop {
  0% { transform: scale(0.85); opacity: 0; }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.animate-float-slow {
  animation: floatSlow 8s ease-in-out infinite;
}

.animate-float-reverse {
  animation: floatRev 9s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulseGlow 6s ease-in-out infinite;
}

/* 流體虹彩標題動態流光 (Shimmering Gradient Text) */
.animate-gradient-text {
  background-size: 250% 250%;
  animation: gradientFlow 7s ease infinite;
}

/* 膠囊徽章光芒掃過 (Shine Sweep) */
.shine-sweep-wrapper {
  position: relative;
  overflow: hidden;
}

.shine-sweep-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: shineSweep 4.5s ease-in-out infinite;
  pointer-events: none;
}

/* 5. 滾動進場切入動畫 - 漸進增強設計 (預設完全可見，杜絕任何協議/環境下白屏) */
.reveal,
.reveal-left,
.reveal-right,
.reveal-scale {
  opacity: 1;
  transform: none;
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

/* 僅當 JS 成功載入並標記 motion-ready 時，尚未滾入視野的元素才進入預備動畫狀態 */
.motion-ready .reveal:not(.revealed) {
  opacity: 0;
  transform: translateY(28px);
}

.motion-ready .reveal-left:not(.revealed) {
  opacity: 0;
  transform: translateX(-36px);
}

.motion-ready .reveal-right:not(.revealed) {
  opacity: 0;
  transform: translateX(36px);
}

.motion-ready .reveal-scale:not(.revealed) {
  opacity: 0;
  transform: scale(0.94);
}

/* 元素進入視野後的活躍狀態 */
.revealed,
.motion-ready .revealed {
  opacity: 1 !important;
  transform: translateY(0) translateX(0) scale(1) !important;
}

/* 階梯遞延 (Staggered Delays) */
.delay-100 { transition-delay: 80ms; }
.delay-200 { transition-delay: 160ms; }
.delay-300 { transition-delay: 240ms; }
.delay-400 { transition-delay: 320ms; }
.delay-500 { transition-delay: 400ms; }
.delay-600 { transition-delay: 480ms; }

/* 6. 首頁 3D 擬態瀏覽器多頁輪播展示器 (Interactive 3D Webpage Showcase) */
.showcase-window {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 
    0 25px 60px -15px rgba(24, 28, 77, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.85) inset,
    0 10px 25px -5px rgba(6, 182, 212, 0.12);
  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.showcase-window:hover {
  box-shadow: 
    0 35px 75px -15px rgba(24, 28, 77, 0.25),
    0 0 0 1.5px rgba(255, 255, 255, 1) inset,
    0 15px 35px -5px rgba(168, 85, 247, 0.2);
}

/* 網頁截圖滑入切換狀態 (Webpage Slide Transitions) */
.webpage-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(0.95) translateY(12px);
  pointer-events: none;
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.webpage-slide.active {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
  z-index: 10;
}

/* 切換按鈕樣式 (Tab Pill Buttons) */
.tab-switcher-btn {
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tab-switcher-btn.active {
  background: #0F172A;
  color: #ffffff;
  box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.35);
  transform: translateY(-1px);
}

.tab-switcher-btn:not(.active) {
  background: rgba(255, 255, 255, 0.7);
  color: #475569;
}

.tab-switcher-btn:not(.active):hover {
  background: #ffffff;
  color: #0F172A;
}

/* 浮動動態徽章 (Floating Status Badge with Pop Effect) */
.pop-badge {
  animation: badgePop 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 互動卡片微互動 */
.interactive-card {
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.interactive-card:hover {
  transform: translateY(-6px);
  border-color: rgba(6, 182, 212, 0.4);
}

/* 5. 頁面滾動動態收合中島與 Logo (Sticky Navbar Dynamic Shrink on Scroll) */
header.sticky {
  transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#navbarIsland {
  transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, background 0.3s ease;
}

#siteLogo {
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-scrolled {
  padding-top: 0.65rem !important;
  padding-bottom: 0.65rem !important;
}

.header-scrolled #navbarIsland {
  padding-top: 0.45rem !important;
  padding-bottom: 0.45rem !important;
  box-shadow: 0 16px 36px -10px rgba(100, 116, 215, 0.24), inset 0 0 1px 1px rgba(255, 255, 255, 0.95) !important;
}

.header-scrolled #siteLogo {
  height: 2rem !important; /* 32px on mobile, width ~96px */
}

@media (min-width: 640px) {
  .header-scrolled #siteLogo {
    height: 2.25rem !important; /* 36px on tablet & desktop, width ~108px */
  }
}
