/**
 * MASUTO.inc デザイン改善CSS v3
 * 適用日: 2026-02
 * 追加: WHYセクション・サービスカード強化・アニメーション・動画プレースホルダー
 */

/* ===================================================
   1. CTAボタン強化（アクセントカラー活用）
   =================================================== */

/* メインCTAボタン（無料相談を予約）を目立たせる */
.hero-btn-main,
.btn.btn-primary.hero-btn-main {
    background: linear-gradient(135deg, #FF6B6B, #ff4757) !important;
    border-color: transparent !important;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4) !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease !important;
}

.hero-btn-main:hover,
.btn.btn-primary.hero-btn-main:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 30px rgba(255, 107, 107, 0.55) !important;
    background: linear-gradient(135deg, #ff4757, #FF6B6B) !important;
}

/* ヘッダーのCTAボタン */
.menu-button .btn-primary {
    background: linear-gradient(135deg, #FF6B6B, #ff4757) !important;
    border-color: transparent !important;
    box-shadow: 0 3px 12px rgba(255, 107, 107, 0.35) !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.menu-button .btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5) !important;
}

/* ===================================================
   2. ヘッダー改善（言語切替削除後のレイアウト）
   =================================================== */

.header-actions {
    gap: 0 !important;
}

/* ===================================================
   3. ヒーローセクション改善
   =================================================== */

/* eyebrowテキストを日本語化に合わせてスタイル調整 */
.hero-eyebrow {
    letter-spacing: 0.08em;
}

/* サブタイトルの行間を改善 */
.hero-subtitle {
    line-height: 1.9 !important;
    letter-spacing: 0.03em !important;
}

/* ===================================================
   4. 統計バーの視認性強化
   =================================================== */

.hero-stat-num {
    font-variant-numeric: tabular-nums;
    min-width: 2ch;
    display: inline-block;
}

/* ===================================================
   5. サービスカードのホバー改善
   =================================================== */

.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.service-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 16px 40px rgba(26, 58, 90, 0.15) !important;
}

/* ===================================================
   6. お問い合わせセクションのCTA改善
   =================================================== */

#contact .btn-primary,
.contact-section .btn-primary {
    background: linear-gradient(135deg, #FF6B6B, #ff4757) !important;
    border-color: transparent !important;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4) !important;
    padding: 1rem 2.5rem !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease !important;
}

#contact .btn-primary:hover,
.contact-section .btn-primary:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 30px rgba(255, 107, 107, 0.55) !important;
}

/* ===================================================
   7. フッターの住所改善（読みやすさ向上）
   =================================================== */

.footer-contact address,
.site-footer address {
    font-style: normal;
    line-height: 1.8;
}

/* ===================================================
   8. スクロール時のヘッダー背景強化
   =================================================== */

.site-header.scrolled {
    box-shadow: 0 2px 20px rgba(26, 58, 90, 0.12) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

/* ===================================================
   9. testimonials（お客様の声）の引用符スタイル
   =================================================== */

.testimonial-quote-mark {
    color: #4ECDC4 !important;
    opacity: 0.5;
}

.testimonial-stars .star {
    color: #FF6B6B !important;
}

/* ===================================================
   10. モバイル対応の強化
   =================================================== */

@media (max-width: 768px) {
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem !important;
    }

    .hero-btn-main,
    .hero-buttons .btn-ghost {
        width: 100%;
        max-width: 320px;
        text-align: center;
        justify-content: center;
    }

    .hero-stat-num {
        font-size: 1.8rem !important;
    }
}

/* ===================================================
   11. WHYセクション（MASUTOが選ばれる理由）
   =================================================== */

.why-section {
    position: relative;
    background: linear-gradient(180deg, #050d1a 0%, #060e1c 50%, #07101f 100%);
    overflow: hidden;
    padding: 6rem 0 7rem;
}

/* 背景 */
.why-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.why-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(78, 205, 196, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(78, 205, 196, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
}
.why-bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}
.why-bg-glow--1 {
    width: 500px;
    height: 500px;
    background: rgba(78, 205, 196, 0.08);
    top: -100px;
    right: -100px;
    animation: whyGlowFloat1 12s ease-in-out infinite alternate;
}
.why-bg-glow--2 {
    width: 400px;
    height: 400px;
    background: rgba(255, 107, 107, 0.06);
    bottom: -80px;
    left: -80px;
    animation: whyGlowFloat2 15s ease-in-out infinite alternate;
}
@keyframes whyGlowFloat1 {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(40px, 30px) scale(1.1); }
}
@keyframes whyGlowFloat2 {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(-30px, -20px) scale(1.08); }
}

/* グリッド */
.why-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3.5rem;
}
@media (max-width: 900px) {
    .why-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* カード */
.why-card {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(78, 205, 196, 0.12);
    border-radius: 20px;
    padding: 2.5rem 2rem 2rem;
    overflow: hidden;
    transition: background 0.35s ease, border-color 0.35s ease, transform 0.35s ease;
}
.why-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4ECDC4 50%, transparent);
    transform: scaleX(0);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}
.why-card:hover::before {
    transform: scaleX(1);
}
.why-card:hover {
    background: rgba(78, 205, 196, 0.06);
    border-color: rgba(78, 205, 196, 0.3);
    transform: translateY(-6px);
}

.why-card-icon {
    margin-bottom: 1.5rem;
    display: inline-flex;
}
.why-card-icon svg {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.why-card:hover .why-card-icon svg {
    transform: scale(1.1) rotate(-5deg);
}

.why-card-number {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
    color: rgba(78, 205, 196, 0.06);
    letter-spacing: -0.05em;
    font-variant-numeric: tabular-nums;
    transition: color 0.35s ease;
    pointer-events: none;
}
.why-card:hover .why-card-number {
    color: rgba(78, 205, 196, 0.12);
}

.why-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.85rem;
    letter-spacing: 0.01em;
}

.why-card-body {
    font-size: 0.9rem;
    line-height: 1.85;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.why-card-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #4ECDC4, #00d4a0);
    border-radius: 0 2px 2px 0;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.why-card:hover .why-card-line {
    width: 100%;
}

/* CTAエリア */
.why-cta {
    text-align: center;
    margin-top: 3.5rem;
}
.why-cta-note {
    margin-top: 0.75rem;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.05em;
}

/* ===================================================
   12. サービスカード強化（グラデーションライン・ホバー）
   =================================================== */

/* カード上部のアクセントライン（ホバーで表示） */
.service-card {
    position: relative;
    overflow: hidden;
}
.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4ECDC4, #00d4a0, transparent);
    border-radius: 0 0 4px 4px;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}
.service-card:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* アイコンのホバーアニメーション強化 */
.service-icon {
    transition: filter 0.35s ease;
}
.service-card:hover .service-icon {
    filter: drop-shadow(0 0 10px rgba(78, 205, 196, 0.5));
}

/* サービスリストのホバー */
.service-details ul li {
    transition: color 0.2s ease, padding-left 0.2s ease;
    position: relative;
}
.service-card:hover .service-details ul li {
    color: rgba(78, 205, 196, 0.9) !important;
    padding-left: 4px;
}

/* ===================================================
   13. ヒーロービデオプレースホルダー
       （動画未設定時もリッチに見える）
   =================================================== */

.hero-bg:not(:has(.hero-bg-video)):not(:has(.hero-bg-image)) {
    /* 動画・画像なし時のグラデーション強化 */
    background: radial-gradient(
        ellipse at 30% 40%,
        rgba(78, 205, 196, 0.18) 0%,
        transparent 50%
    ),
    radial-gradient(
        ellipse at 70% 60%,
        rgba(26, 58, 90, 0.8) 0%,
        transparent 50%
    );
}

/* 動画セクションのスタイル強化 */
.video-section {
    position: relative;
    overflow: hidden;
}
.video-section__player {
    width: 100%;
    max-height: 80vh;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

/* ===================================================
   14. スクロールリビール: テキストキャラクターアニメ
   =================================================== */

/* 文字単位で分割されたspan要素のスタイル */
.char-split-word {
    display: inline-block;
    overflow: hidden;
    line-height: 1.1;
}
.char-split-char {
    display: inline-block;
    will-change: transform, opacity;
}

/* ミッションタイトルの行アニメーション */
.about-mission-line {
    display: block;
    overflow: hidden;
}
.about-mission .about-mission-text-inner {
    display: block;
    will-change: transform, opacity;
}

/* ===================================================
   15. スクロール進行度インジケーター
   =================================================== */
#scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #4ECDC4, #00d4a0, #FF6B6B, #4ECDC4);
    background-size: 300% 100%;
    z-index: 9999;
    transition: width 0.1s linear;
    animation: progressBarShimmer 3s linear infinite;
}
@keyframes progressBarShimmer {
    0%   { background-position: 0% 0; }
    100% { background-position: 300% 0; }
}

/* ===================================================
   16. GSAPリビール初期状態（フラッシュ防止）
   =================================================== */
.js-loaded .gsap-reveal,
.js-loaded .gsap-reveal-left,
.js-loaded .gsap-reveal-right,
.js-loaded .gsap-reveal-scale,
.js-loaded .gsap-reveal-up,
.js-loaded .gsap-stagger-item {
    opacity: 0;
    will-change: opacity, transform;
}

/* WHYカードのGSAP初期状態 */
.js-loaded .why-card {
    opacity: 0;
}

/* ===================================================
   17. ページ内アニメーション: フローティングバッジ
   =================================================== */
.hero-eyebrow {
    animation: floatBadge 4s ease-in-out infinite;
}
@keyframes floatBadge {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-4px); }
}

/* ===================================================
   18. ヒーロースクロールインジケーター
   =================================================== */
.hero-scroll-arrow {
    animation: scrollArrowBounce 1.8s ease-in-out infinite;
}
@keyframes scrollArrowBounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(8px); }
}

/* ===================================================
   19. スマートヘッダー
   =================================================== */
.site-header {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.35s ease,
                box-shadow 0.35s ease !important;
}
.site-header.header-hidden {
    transform: translateY(-100%);
}
.site-header.header-visible {
    transform: translateY(0);
}
.site-header.scrolled {
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(16px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
    box-shadow:
        0 1px 0 rgba(15, 23, 42, 0.06),
        0 4px 20px rgba(15, 23, 42, 0.06) !important;
}

/* ===================================================
   20. ボタンリップルエフェクト
   =================================================== */
.ripple-wave {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
    transform: scale(0);
    animation: rippleWave 0.65s linear forwards;
    pointer-events: none;
    z-index: 0;
}
@keyframes rippleWave {
    to { transform: scale(2.5); opacity: 0; }
}

/* ===================================================
   21. セクションタイトル下線
   =================================================== */
.section-title-anim {
    position: relative;
    display: inline-block;
}
.section-title-anim::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #4ECDC4, #00d4a0);
    border-radius: 2px;
    transition: width 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}
.section-title-anim.line-revealed::after {
    width: 60px;
}

/* ===================================================
   22. TOPへ戻るボタン
   =================================================== */
.back-to-top.visible,
#back-to-top.visible {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ===================================================
   23. カスタムスクロールバー
   =================================================== */
::-webkit-scrollbar         { width: 5px; }
::-webkit-scrollbar-track   { background: #0a1628; }
::-webkit-scrollbar-thumb   {
    background: linear-gradient(180deg, #4ECDC4, #00d4a0);
    border-radius: 3px;
}

/* ===================================================
   24. フォーカスアクセシビリティ
   =================================================== */
:focus-visible {
    outline: 2px solid #4ECDC4;
    outline-offset: 3px;
    border-radius: 3px;
}

/* ===================================================
   25. 電話・メールリンクのホバー
   =================================================== */
.footer-contact-item a[href^="tel"],
.footer-contact-item a[href^="mailto"] {
    transition: color 0.2s ease;
}
.footer-contact-item a[href^="tel"]:hover,
.footer-contact-item a[href^="mailto"]:hover {
    color: #4ECDC4 !important;
}

/* ===================================================
   26. WHYセクション モバイル調整
   =================================================== */
@media (max-width: 768px) {
    .why-section {
        padding: 4rem 0 5rem;
    }
    .why-card {
        padding: 2rem 1.5rem 1.75rem;
    }
    .why-cta .btn {
        width: 100%;
        max-width: 320px;
        justify-content: center;
    }
}

/* ===================================================
   27. レイアウト修正 v4
   =================================================== */

/* ── A. ヘッダー: モバイル時CTAボタンサイズ調整 ── */
@media (max-width: 991px) {
    .menu-button .btn-primary {
        padding: 0.5rem 1rem !important;
        font-size: 0.78rem !important;
    }
}

/* ── B. WHYセクション: タブレット2列レイアウト追加 ── */
@media (min-width: 641px) and (max-width: 900px) {
    .why-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
        max-width: 100% !important;
    }
    /* 3枚目のカードを2列中央に配置 */
    .why-card:nth-child(3) {
        grid-column: 1 / -1;
        max-width: 480px;
        margin-left: auto;
        margin-right: auto;
        width: 100%;
    }
}
@media (max-width: 640px) {
    .why-grid {
        grid-template-columns: 1fr !important;
        gap: 1.2rem !important;
        max-width: 100% !important;
    }
    .why-card {
        padding: 1.5rem 1.2rem 1.2rem !important;
    }
}

/* ── C. サービスグリッド: タブレット時レイアウト改善 ── */
@media (min-width: 576px) and (max-width: 991px) {
    .services-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    .services-grid .service-card:nth-child(1),
    .services-grid .service-card:nth-child(2),
    .services-grid .service-card:nth-child(3),
    .services-grid .service-card:nth-child(4) {
        grid-column: span 2 !important;
    }
    .services-grid .service-card:nth-child(5) {
        grid-column: 2 / span 2 !important;
    }
}
@media (max-width: 575px) {
    .services-grid {
        grid-template-columns: 1fr !important;
    }
    .services-grid .service-card {
        grid-column: span 1 !important;
    }
}

/* ── D. アバウトセクション: gapをブレークポイント別に調整 ── */
@media (min-width: 992px) and (max-width: 1199px) {
    .about-body-grid {
        gap: 3rem !important;
    }
}
@media (min-width: 768px) and (max-width: 991px) {
    .about-body-grid {
        gap: 2rem !important;
    }
}

/* ── E. テスティモニアル: 小型デバイス対応 ── */
@media (max-width: 480px) {
    .testimonials-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    .testimonial-card {
        padding: 1.5rem 1.25rem 1.25rem !important;
    }
}

/* ── F. コンタクト: gapをブレークポイント別に調整 ── */
@media (min-width: 1025px) and (max-width: 1199px) {
    .contact-inline-layout {
        gap: 3rem !important;
    }
}

/* ── G. フッター: タブレット時gap調整 ── */
@media (min-width: 901px) and (max-width: 1199px) {
    .footer-inner {
        gap: 3rem !important;
    }
}
@media (max-width: 640px) {
    .footer-contact-card {
        padding: 1.5rem 1.25rem 1.25rem !important;
    }
}

/* ── H. 極小デバイス（360px以下）コンテナ余白 ── */
@media (max-width: 360px) {
    .container {
        padding-left: 0.875rem !important;
        padding-right: 0.875rem !important;
    }
}

/* ── I. ヒーローボタン: 大画面で折り返し防止 ── */
@media (min-width: 992px) {
    .hero-buttons {
        flex-wrap: nowrap !important;
        gap: 1.5rem !important;
    }
}
@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.75rem !important;
        width: 100% !important;
        max-width: 280px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    .hero-scroll-indicator {
        display: none !important;
    }
}
