/* ═══════════════════════════════════════════════════════════════
   Site Immersive v7.1 — Awwwards / LAB 等級沉浸式（CSS 變數版）
   每站透過 palette.css 覆寫 --v7-* 變數客製化色系
   ═══════════════════════════════════════════════════════════════ */

:root {
  --v7-grad-c1: 255, 180, 160;   /* peach */
  --v7-grad-c2: 180, 140, 255;   /* lavender */
  --v7-grad-c3: 255, 220, 180;   /* cream */
  --v7-bg-1: #fff7f0;
  --v7-bg-2: #ffeae2;
  --v7-bg-3: #f3e6ff;
  --v7-blob-1: #ff9a8b;
  --v7-blob-2: #c084fc;
  --v7-blob-3: #fbbf77;
  --v7-curtain-from: #1a0e1f;
  --v7-curtain-mid: #4a1f4d;
  --v7-curtain-to: #c46a8d;
  --v7-cursor-glow-1: 255, 217, 163;
  --v7-cursor-glow-2: 255, 160, 200;
  --v7-cursor-shadow-1: 255, 180, 140;
  --v7-cursor-shadow-2: 220, 120, 160;
  --v7-progress: linear-gradient(90deg, #ff7eb3 0%, #ffb56b 35%, #a78bfa 70%, #38bdf8 100%);
  --v7-h2-underline: linear-gradient(90deg, #ff7eb3, #ffb56b);
  --v7-marquee-stroke: 180, 90, 140, 0.6;
  --v7-img-shadow: 80, 40, 80, 0.25;
  --v7-glyph: '◐';
}

/* 整站立即可見背景 */
body { background-color: #fafafa; position: relative; min-height: 100vh; }
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -2;
  background:
    radial-gradient(circle at 15% 25%, rgba(var(--v7-grad-c1), 0.45) 0%, transparent 35%),
    radial-gradient(circle at 85% 75%, rgba(var(--v7-grad-c2), 0.40) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(var(--v7-grad-c3), 0.30) 0%, transparent 50%),
    linear-gradient(180deg, var(--v7-bg-1) 0%, var(--v7-bg-2) 50%, var(--v7-bg-3) 100%);
  animation: v7-hue 22s ease-in-out infinite;
}
@keyframes v7-hue {
  0%, 100% { filter: hue-rotate(0deg) saturate(1); }
  50% { filter: hue-rotate(20deg) saturate(1.15); }
}

/* Floating blobs */
.v7-blob {
  position: fixed; pointer-events: none; z-index: -1;
  width: 600px; height: 600px; border-radius: 50%;
  filter: blur(80px); opacity: 0.55; mix-blend-mode: screen;
}
.v7-blob.b1 { background: var(--v7-blob-1); top: -200px; left: -200px;
              animation: v7-blob-1 18s ease-in-out infinite; }
.v7-blob.b2 { background: var(--v7-blob-2); top: 40%; right: -200px;
              animation: v7-blob-2 24s ease-in-out infinite; }
.v7-blob.b3 { background: var(--v7-blob-3); bottom: -200px; left: 30%;
              animation: v7-blob-3 20s ease-in-out infinite; }
@keyframes v7-blob-1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(200px,300px) scale(1.3); } }
@keyframes v7-blob-2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-300px,-200px) scale(0.8); } }
@keyframes v7-blob-3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-200px,-300px) scale(1.2); } }

/* Scroll progress bar */
.v7-progress {
  position: fixed; top: 0; left: 0; height: 4px;
  background: var(--v7-progress);
  z-index: 99999; width: 0%; pointer-events: none;
  box-shadow: 0 0 16px currentColor;
}

/* Grain */
.v7-grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 9998;
  opacity: .22; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
}

/* Page curtain */
.v7-curtain {
  position: fixed; inset: 0; z-index: 99999;
  background: linear-gradient(135deg, var(--v7-curtain-from) 0%, var(--v7-curtain-mid) 60%, var(--v7-curtain-to) 100%);
  transform: translateY(100%);
  transition: transform .9s cubic-bezier(.85,0,.15,1);
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: clamp(2rem, 5vw, 4rem); font-weight: 800;
}
.v7-curtain.show { transform: translateY(0); pointer-events: auto; }
.v7-curtain.leave { transform: translateY(-100%); }
.v7-curtain::before {
  content: var(--v7-glyph);
  display: inline-block; animation: v7-spin 1s linear infinite;
}
@keyframes v7-spin { to { transform: rotate(360deg); } }

/* Cursor */
.v7-cursor {
  position: fixed; top: 0; left: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(circle, rgb(var(--v7-cursor-glow-1)) 0%, rgba(var(--v7-cursor-glow-2),0.5) 60%, transparent 100%);
  box-shadow: 0 0 32px 12px rgba(var(--v7-cursor-shadow-1),0.5), 0 0 80px 24px rgba(var(--v7-cursor-shadow-2),0.3);
  mix-blend-mode: screen;
  pointer-events: none; z-index: 99997;
  transform: translate(-50%, -50%);
  transition: width .25s, height .25s, opacity .25s;
}
.v7-cursor.hover-magnetic { width: 80px; height: 80px;
  background: radial-gradient(circle, rgba(var(--v7-cursor-shadow-2),.7) 0%, transparent 70%); }
.v7-cursor.hover-text { width: 6px; height: 6px; background: #fff;
  box-shadow: 0 0 24px 8px rgba(255,255,255,0.8); }

/* Text mask reveal */
.v7-mask-text { display: inline-block; overflow: hidden; vertical-align: bottom; }
.v7-mask-text .v7-mask-inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform .9s cubic-bezier(.85,0,.15,1);
}
.v7-mask-text.in .v7-mask-inner { transform: translateY(0); }

/* Image clip reveal */
.v7-clip-img {
  clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
  transition: clip-path 1.2s cubic-bezier(.7,0,.2,1);
}
.v7-clip-img.in { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }

/* 3D tilt */
.v7-tilt { transform-style: preserve-3d; transition: transform .35s cubic-bezier(.2,.9,.3,1.2), box-shadow .35s; }
.v7-tilt:hover { box-shadow: 0 30px 80px -20px rgba(var(--v7-img-shadow)); }

/* Marquee */
.v7-marquee {
  overflow: hidden; white-space: nowrap;
  font-size: clamp(2.5rem, 8vw, 7rem);
  font-weight: 800; letter-spacing: -.03em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(var(--v7-marquee-stroke));
  margin: 60px 0; padding: 12px 0;
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(var(--v7-marquee-stroke));
  border-bottom: 1px solid rgba(var(--v7-marquee-stroke));
}
.v7-marquee__track { display: inline-block; animation: v7-marquee-loop 22s linear infinite; padding-right: 60px; }
.v7-marquee__track > span { padding-right: 60px; }
@keyframes v7-marquee-loop { to { transform: translateX(-50%); } }

/* Section number badge */
.v7-section-num {
  font-size: clamp(6rem, 18vw, 18rem);
  font-weight: 900; letter-spacing: -.08em;
  color: rgba(180,120,160,0.08);
  position: absolute; top: 50%; left: -2vw;
  transform: translateY(-50%);
  z-index: 0; pointer-events: none; line-height: 0.8;
}

/* H2 underline */
h2 { position: relative; }
h2::after {
  content: ''; display: block; width: 60px; height: 4px;
  margin-top: 12px;
  background: var(--v7-h2-underline);
  border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform 1.2s cubic-bezier(.85,0,.15,1);
}
h2.v7-in::after { transform: scaleX(1); }

/* Link hover */
a, button, .wp-element-button { transition: transform .25s cubic-bezier(.2,.9,.3,1.2), filter .2s !important; }
a:hover, button:hover, .wp-element-button:hover { transform: translateY(-2px); filter: brightness(1.1); }

/* Images */
article img, .entry-content img, .wp-block-image img, .wp-block-post-featured-image img {
  border-radius: 12px;
  box-shadow: 0 12px 40px -12px rgba(var(--v7-img-shadow));
  transition: transform .35s cubic-bezier(.2,.9,.3,1.2), box-shadow .35s;
}
article img:hover, .entry-content img:hover, .wp-block-image img:hover { transform: scale(1.02); }

/* Mobile / reduced motion 退場 */
@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  .v7-marquee, .v7-section-num, .v7-blob, .v7-cursor, .v7-grain, .v7-progress { display: none !important; }
  body::before { animation: none; }
}
