/**
 * Stella Creation - Custom Styles
 * カラフル＆ダイナミックなアニメーション
 */

/* ===========================================
   グラデーションテキスト
   =========================================== */
.gradient-text {
    background: linear-gradient(135deg, #0071e3 0%, #8b5cf6 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientText 5s ease infinite;
}

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

/* ===========================================
   ヒーロー背景グラデーションアニメーション
   =========================================== */
.hero-bg {
    background: linear-gradient(
        -45deg,
        #ffffff,
        #e0e7ff,
        #fce7f3,
        #cffafe,
        #ffffff
    );
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    25% { background-position: 50% 100%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 50% 0%; }
}

/* ===========================================
   浮遊するオーブ
   =========================================== */
.floating-orbs {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #0071e3, #06b6d4);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    bottom: -50px;
    left: -50px;
    animation-delay: -5s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #06b6d4, #0071e3);
    top: 50%;
    left: 20%;
    animation-delay: -10s;
}

.orb-4 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    top: 30%;
    right: 20%;
    animation-delay: -15s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.05);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        transform: translate(-30px, -20px) scale(1.02);
    }
}

/* ===========================================
   フローティングアニメーション
   =========================================== */
.animate-float {
    animation: floatLogo 6s ease-in-out infinite;
}

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

/* ===========================================
   スクロールマウスアニメーション
   =========================================== */
.scroll-mouse {
    width: 26px;
    height: 40px;
    border: 2px solid rgba(134, 134, 139, 0.5);
    border-radius: 13px;
    position: relative;
}

.scroll-wheel {
    width: 4px;
    height: 8px;
    background: linear-gradient(180deg, #0071e3, #8b5cf6);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s ease-in-out infinite;
}

@keyframes scrollWheel {
    0%, 100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    50% {
        opacity: 0.3;
        transform: translateX(-50%) translateY(10px);
    }
}

.scroll-indicator {
    animation: fadeInUp 1s ease 1.5s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===========================================
   回転するグラデーション背景
   =========================================== */
@keyframes spin-slow {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.animate-spin-slow {
    animation: spin-slow 30s linear infinite;
}

.bg-gradient-conic {
    background: conic-gradient(from 0deg, var(--tw-gradient-from), var(--tw-gradient-via), var(--tw-gradient-to), var(--tw-gradient-from));
}

/* ===========================================
   ナビゲーション
   =========================================== */
#navbar {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #0071e3, #8b5cf6);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 1px;
}

.nav-link:hover::after {
    width: 100%;
}

/* ===========================================
   ヒーロー初期状態（JSでアニメーション）
   =========================================== */
.hero-logo,
.hero-title,
.hero-subtitle,
.hero-cta-wrapper {
    opacity: 0;
    transform: translateY(50px);
}

/* ===========================================
   セクション要素の初期状態
   =========================================== */
.section-label,
.section-title,
.service-card,
.about-left,
.about-right,
.about-item,
.contact-text,
.contact-btn {
    opacity: 0;
    transform: translateY(60px);
}

/* ===========================================
   サービスカードホバーエフェクト
   =========================================== */
.service-card {
    cursor: default;
    position: relative;
}

.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
    padding: 2px;
    background: linear-gradient(135deg, transparent, rgba(139, 92, 246, 0.2), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
}

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

/* ===========================================
   ボタンスタイル
   =========================================== */
.hero-cta {
    position: relative;
    overflow: hidden;
}

.hero-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.hero-cta:hover::before {
    left: 100%;
}

.hero-cta-secondary:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
}

/* ===========================================
   About セクションのラインアニメーション
   =========================================== */
.about-item {
    position: relative;
    transition: all 0.3s ease;
}

.about-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #0071e3, #8b5cf6, #ec4899);
    transition: width 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    border-radius: 1px;
}

.about-item:hover {
    padding-left: 12px;
}

.about-item:hover::after {
    width: 100%;
}

/* ===========================================
   カスタムスクロールバー
   =========================================== */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #0071e3, #8b5cf6);
    border-radius: 5px;
    border: 3px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0071e3, #ec4899);
    background-clip: content-box;
}

/* ===========================================
   セレクション
   =========================================== */
::selection {
    background: rgba(139, 92, 246, 0.2);
    color: #1d1d1f;
}

/* ===========================================
   フォーカス
   =========================================== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 4px;
    border-radius: 4px;
}

/* ===========================================
   スムーススクロール
   =========================================== */
html {
    scroll-behavior: smooth;
}

/* ===========================================
   パフォーマンス最適化
   =========================================== */
.hero-title,
.hero-subtitle,
.hero-cta,
.service-card,
.contact-btn,
.orb {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* ===========================================
   レスポンシブ調整
   =========================================== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.75rem;
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .orb {
        opacity: 0.4;
    }

    .orb-1 { width: 250px; height: 250px; }
    .orb-2 { width: 200px; height: 200px; }
    .orb-3 { width: 150px; height: 150px; }
    .orb-4 { width: 120px; height: 120px; }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2.25rem;
    }
}

/* ===========================================
   パーティクル効果（JSで生成）
   =========================================== */
.particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #0071e3, #8b5cf6);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 10s ease-in-out infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) scale(1);
    }
}

/* ===========================================
   フッターリンクホバー
   =========================================== */
footer a {
    position: relative;
}

footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #0071e3, #8b5cf6);
    transition: width 0.3s ease;
}

footer a:hover::after {
    width: 100%;
}

/* ===========================================
   追加のユーティリティ
   =========================================== */
.section-label {
    letter-spacing: 0.3em;
}

/* グロー効果 */
.glow {
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.3);
}

/* 光沢エフェクト */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}
