/* ==========================================
   ZMEDIA - CREATIVE EXCELLENCE v10.0
   ==========================================
   Concept: Cutting-edge Creative Agency
   Vibe: Apple meets Awwwards
   Features: Micro-interactions, Fluid Design
   ========================================== */

/* ========== ENHANCED COLORS ========== */
:root {
    --purple-glow: rgba(124, 58, 237, 0.4);
    --purple-soft: rgba(124, 58, 237, 0.1);
    --purple-bright: #9F7AEA;
}

/* ========== FLUID GRADIENT BACKGROUND ========== */
.creative-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.creative-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(124, 58, 237, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(159, 122, 234, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 40% 80%, rgba(124, 58, 237, 0.08) 0%, transparent 40%);
    animation: fluid-move 20s ease-in-out infinite;
}

@keyframes fluid-move {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(5%, 5%) rotate(120deg); }
    66% { transform: translate(-5%, 5%) rotate(240deg); }
}

/* ========== MORPHING SHAPES ========== */
.shape-morph {
    position: fixed;
    pointer-events: none;
    z-index: 1;
    opacity: 0.03;
}

.shape-1 {
    top: 10%;
    left: 10%;
    width: 300px;
    height: 300px;
    background: linear-gradient(45deg, var(--color-primary), var(--purple-bright));
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: morph-1 15s ease-in-out infinite;
}

.shape-2 {
    bottom: 10%;
    right: 10%;
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--purple-bright), var(--color-primary));
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: morph-2 18s ease-in-out infinite;
}

@keyframes morph-1 {
    0%, 100% { 
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
        transform: rotate(0deg) scale(1);
    }
    50% { 
        border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
        transform: rotate(180deg) scale(1.1);
    }
}

@keyframes morph-2 {
    0%, 100% { 
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: rotate(0deg) scale(1);
    }
    50% { 
        border-radius: 30% 60% 70% 40% / 40% 70% 30% 60%;
        transform: rotate(-180deg) scale(0.9);
    }
}

/* ========== MAGNETIC CURSOR ========== */
.magnetic-cursor {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transition: all 0.15s ease;
    mix-blend-mode: difference;
}

.magnetic-cursor::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.2s ease;
}

.magnetic-cursor.hover {
    width: 60px;
    height: 60px;
    background: var(--purple-glow);
    border-color: var(--purple-bright);
}

.magnetic-cursor.hover::before {
    width: 12px;
    height: 12px;
}

/* Cursor Label */
.cursor-label {
    position: fixed;
    padding: 8px 16px;
    background: rgba(124, 58, 237, 0.95);
    color: white;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 20px;
    pointer-events: none;
    z-index: 10001;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
}

.cursor-label.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ========== SPLIT SCREEN REVEAL ========== */
.split-reveal {
    position: relative;
    overflow: hidden;
}

.split-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(124, 58, 237, 0.2) 50%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.split-reveal:hover::before {
    transform: translateX(100%);
}

/* ========== VIDEO PREVIEW CARDS ========== */
.video-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.video-card video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.video-card:hover video {
    opacity: 1;
}

.video-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(124, 58, 237, 0.3) 0%,
        rgba(10, 10, 10, 0.7) 100%
    );
    transition: opacity 0.5s ease;
}

.video-card:hover .video-card-overlay {
    opacity: 0.5;
}

/* ========== CINEMATIC TEXT REVEALS ========== */
/* ========== CINEMATIC TEXT REVEAL ========== */
.cinematic-reveal {
    overflow: visible; /* hiddenだとテキストが切れる可能性 */
    display: inline-block;
}

.cinematic-reveal span {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: reveal-text 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

/* JSが失敗した場合の保険：services-hero-titleのみ */
.services-hero-title.cinematic-reveal {
    opacity: 1 !important;
}

.services-hero-title.cinematic-reveal span {
    opacity: 1;
    transform: translateY(0);
}

/* ヒーロータイトルは常に明確に表示（cinematic-revealなし） */
.hero-simple-title {
    opacity: 1 !important;
    transform: none !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@keyframes reveal-text {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== NUMBER COUNTER WITH ANIMATION ========== */
.counter-number {
    position: relative;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
}

.counter-number::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    transform: translateX(-100%);
    animation: counter-line 1.5s ease-out;
}

@keyframes counter-line {
    to {
        transform: translateX(100%);
    }
}

/* ========== FLOATING ELEMENTS ========== */
.float-element {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* ========== ENHANCED CARDS ========== */
.creative-card {
    position: relative;
    background: rgba(20, 15, 30, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.creative-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        45deg,
        var(--color-primary),
        var(--purple-bright),
        var(--color-primary)
    );
    background-size: 300% 300%;
    border-radius: 16px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.5s ease;
    animation: gradient-rotate 3s linear infinite;
}

.creative-card:hover::before {
    opacity: 1;
}

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

.creative-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 30px 80px rgba(124, 58, 237, 0.3);
}

/* ========== MAGNETIC BUTTONS ========== */
.magnetic-btn {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ========== SECTION TRANSITIONS ========== */
.section-enter {
    opacity: 0;
    transform: translateY(60px);
}

.section-enter.active {
    opacity: 1;
    transform: translateY(0);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========== SCROLL INDICATOR ========== */
.scroll-indicator {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 50px;
    border: 2px solid var(--color-primary);
    border-radius: 20px;
    opacity: 0.5;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.scroll-indicator::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    width: 4px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 2px;
    transform: translateX(-50%);
    animation: scroll-down 2s ease-in-out infinite;
}

@keyframes scroll-down {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, 20px); opacity: 0; }
}

/* ========== ENHANCED HOVER STATES ========== */
.hover-lift {
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.hover-lift:hover {
    transform: translateY(-12px);
}

/* ========== PARALLAX LAYERS ========== */
.parallax-layer {
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ========== STAGGER ANIMATIONS ========== */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    animation: stagger-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes stagger-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* ========== BLUR REVEAL ========== */
.blur-reveal {
    filter: blur(10px);
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.blur-reveal.visible {
    filter: blur(0);
    opacity: 1;
    transform: scale(1);
}

/* ========== GLOW PULSE ========== */
.glow-pulse {
    position: relative;
}

.glow-pulse::after {
    content: '';
    position: absolute;
    inset: -10px;
    background: radial-gradient(circle, var(--purple-glow) 0%, transparent 70%);
    opacity: 0;
    animation: pulse-glow 3s ease-in-out infinite;
    z-index: -1;
    border-radius: inherit;
}

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

/* ========== TEXT GRADIENT SHIFT ========== */
.gradient-text {
    background: linear-gradient(
        90deg,
        var(--color-white) 0%,
        var(--color-primary) 50%,
        var(--color-white) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-text-shift 4s linear infinite;
}

/* ヒーロータイトルには適用しない（常に白色で表示） */
.hero-simple-title.gradient-text {
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    -webkit-text-fill-color: var(--color-white) !important;
    color: var(--color-white) !important;
    animation: none !important;
}

@keyframes gradient-text-shift {
    to { background-position: 200% center; }
}

/* ========== MOBILE OPTIMIZATIONS ========== */
@media (max-width: 768px) {
    .creative-bg::before,
    .shape-morph,
    .magnetic-cursor,
    .cursor-label,
    .scroll-indicator {
        display: none;
    }
    
    .creative-card:hover {
        transform: none;
    }
}

/* ========== PERFORMANCE ========== */
.creative-card,
.magnetic-btn,
.hover-lift {
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
