/* ========================================
   基本スタイル
======================================== */
:root {
    --primary-color: #10b981;
    --secondary-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --text-color: #4b5563;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', 'Inter', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* ========================================
   ユーティリティクラス
======================================== */
.section-padding {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* ========================================
   ヘッダー
======================================== */
header {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

header.scrolled {
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0;
}

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

.nav-link {
    position: relative;
    font-weight: 500;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

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

/* ========================================
   ヒーローセクション
======================================== */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.text-gradient {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* デジタルグリッド効果 */
.digital-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(16, 185, 129, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 185, 129, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

/* パーティクルキャンバス */
#particles-canvas {
    opacity: 0.5;
}

/* ========================================
   アニメーション
======================================== */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fade-in 1s ease-out;
}

.animate-fade-in-delay {
    animation: fade-in 1s ease-out 0.3s both;
}

.animate-fade-in-delay-2 {
    animation: fade-in 1s ease-out 0.6s both;
}

/* ========================================
   カード
======================================== */
.service-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-5px);
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    transition: all 0.5s ease;
}

.stat-card:hover::after {
    top: -100%;
    right: -100%;
}

/* ========================================
   ニュースアイテム
======================================== */
.news-item {
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.news-item:hover {
    border-left-color: var(--primary-color);
    transform: translateX(5px);
}

/* ========================================
   フォーム
======================================== */
input:focus,
textarea:focus,
select:focus {
    outline: none;
}

input,
textarea,
select {
    transition: all 0.3s ease;
}

/* ========================================
   ボタン
======================================== */
.btn-primary,
.btn-secondary {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before,
.btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
    z-index: -1;
}

.btn-primary:hover::before,
.btn-secondary:hover::before {
    width: 300px;
    height: 300px;
}

/* ========================================
   スクロールトップボタン
======================================== */
#scroll-top {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#scroll-top.show {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   カウンターアニメーション
======================================== */
.counter {
    display: inline-block;
}

/* ========================================
   スクロールアニメーション
======================================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease;
}

.slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ========================================
   モバイル対応
======================================== */
@media (max-width: 768px) {
    .section-padding {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .digital-grid {
        background-size: 30px 30px;
    }
}

/* ========================================
   ローディングアニメーション
======================================== */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0ea56f;
}

/* モバイルでのアニメーション最適化 */
@media (max-width: 768px) {
    .service-card {
        transition: all 0.2s ease; /* アニメーション時間を短縮 */
    }
    
    .service-card:hover {
        transform: translateY(-2px); /* 移動距離を短縮 */
    }
    
    .stat-card {
        transition: all 0.2s ease;
    }
    
    .news-item {
        transition: all 0.2s ease;
    }
    
    .news-item:hover {
        transform: translateX(2px); /* 移動距離を短縮 */
    }
    
    /* パーティクルキャンバスの透明度を下げる */
    #particles-canvas {
        opacity: 0.3;
    }
}

/* モバイルでのGPU最適化 */
@media (max-width: 768px) {
    * {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
}