/* ===========================
   Home Page - Animations
   見た目はそのまま、動きだけ追加
   =========================== */

/* ---- Migrated Inline Styles from index.html ---- */
.stats-row {
    display: flex;
    gap: 48px;
    justify-content: center;
    margin-top: 48px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 40px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 14px;
    color: var(--text-sub);
    margin-top: 4px;
}

.app-screenshot-area {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 48px;
}

.screenshot-phone {
    width: 240px;
    height: 480px;
    background: var(--bg-light);
    border-radius: 32px;
    border: 3px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--primary);
    box-shadow: 0 16px 48px rgba(0,0,0,0.08);
}

@media (max-width: 768px) {
    .stats-row {
        flex-direction: column;
        gap: 24px;
        align-items: center;
    }
    .screenshot-phone {
        width: 180px;
        height: 360px;
    }
}

/* ================================================
   SECTION A: Hero Entrance Animations
   ================================================ */

/* Ken Burns effect on hero slideshow backgrounds */
.home-page .hero-bg {
    animation: homeKenBurns 35s ease-in-out infinite alternate;
    transform-origin: center center;
}

.home-page .hero-bg:nth-child(1) { animation-delay: 0s; transform-origin: center bottom; }
.home-page .hero-bg:nth-child(2) { animation-delay: -5s; transform-origin: left center; }
.home-page .hero-bg:nth-child(3) { animation-delay: -10s; transform-origin: right top; }
.home-page .hero-bg:nth-child(4) { animation-delay: -15s; transform-origin: center top; }
.home-page .hero-bg:nth-child(5) { animation-delay: -20s; transform-origin: left bottom; }
.home-page .hero-bg:nth-child(6) { animation-delay: -25s; transform-origin: right center; }
.home-page .hero-bg:nth-child(7) { animation-delay: -30s; transform-origin: center center; }

@keyframes homeKenBurns {
    0%   { transform: scale(1); }
    100% { transform: scale(1.12); }
}

/* Hero title: slide up from below with blur clear */
.home-page .hero-title {
    opacity: 0;
    transform: translateY(50px);
    filter: blur(4px);
    animation: homeHeroTitleIn 1s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}

@keyframes homeHeroTitleIn {
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Hero subtitle: fade in after title */
.home-page .hero-subtitle {
    opacity: 0;
    transform: translateY(30px);
    animation: homeHeroSubIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.7s forwards;
}

@keyframes homeHeroSubIn {
    to {
        opacity: 0.9;
        transform: translateY(0);
    }
}

/* Hero CTA buttons: staggered pop in */
.home-page .hero-cta .btn:nth-child(1) {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    animation: homeHeroBtnPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 1.1s forwards;
}

.home-page .hero-cta .btn:nth-child(2) {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    animation: homeHeroBtnPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 1.3s forwards;
}

@keyframes homeHeroBtnPop {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Hero app-screens image: float up */
.home-page .hero-app-screens {
    opacity: 0;
    transform: translateY(60px);
    animation: homeHeroAppFloat 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
}

@keyframes homeHeroAppFloat {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Continuous gentle float on app screens */
.home-page .hero-app-screens img {
    animation: homeHeroAppBreath 4s ease-in-out 1.7s infinite;
}

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

/* Hero scroll-down indicator */
.home-page .hero-scroll-hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    animation: homeBounceDown 1.5s ease-in-out 2s infinite;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 2;
}

.home-page .hero-scroll-hint.show {
    opacity: 1;
}

@keyframes homeBounceDown {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

/* Section-level decorative bubbles */
.home-page .section {
    position: relative;
    overflow: hidden;
}

.home-page .section::before {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: 0.04;
    pointer-events: none;
    width: 250px;
    height: 250px;
    background: var(--primary);
    top: -80px;
    right: -60px;
    animation: homeSectionBubble1 10s ease-in-out infinite;
}

.home-page .section:nth-of-type(even)::before {
    left: -60px;
    right: auto;
    animation: homeSectionBubble2 12s ease-in-out infinite;
}

@keyframes homeSectionBubble1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-20px, 15px) scale(1.08); }
}

@keyframes homeSectionBubble2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(15px, -10px) scale(1.05); }
}

/* ================================================
   SECTION C: Base Animation State
   ================================================ */

.home-page .home-anim {
    opacity: 0;
}

/* ================================================
   SECTION D: Section Header - Blur In
   ================================================ */

.home-page .home-blur-in {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(30px);
}

.home-page .home-blur-in.visible {
    animation: homeBlurIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes homeBlurIn {
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

/* Section label typing animation */
.home-page .section-label {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--primary);
    width: 0;
    opacity: 0;
}

.home-page .section-label.visible {
    opacity: 1;
    animation: homeTypingWidth 0.8s steps(20) 0.2s forwards,
               homeBlinkCaret 0.6s step-end 4;
}

@keyframes homeTypingWidth {
    to { width: auto; }
}

@keyframes homeBlinkCaret {
    50% { border-color: transparent; }
}

/* ================================================
   SECTION E: Feature Card Animations
   ================================================ */

.home-page .home-card-in {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
}

.home-page .home-card-in.visible {
    animation: homeCardEntrance 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes homeCardEntrance {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Feature icon bounce on card visible */
.home-page .home-card-in.visible .feature-icon {
    animation: homeIconBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s both;
}

@keyframes homeIconBounce {
    0% { transform: scale(0.3) rotate(-10deg); }
    60% { transform: scale(1.1) rotate(3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Feature card hover */
.home-page .feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
    perspective: 800px;
}

.home-page .feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1);
}


/* ================================================
   SECTION F: Screenshot Phone Animations
   ================================================ */

.home-page .home-phone-in {
    opacity: 0;
    transform: translateY(60px) scale(0.9);
}

.home-page .home-phone-in.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: homePhoneSlideUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes homePhoneSlideUp {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Glow ring on phone screenshots (drop-shadow) */
.home-page .home-phone-in.visible img {
    animation: homePhoneGlow 1.5s ease 0.5s forwards;
}

@keyframes homePhoneGlow {
    0%   { filter: drop-shadow(0 0 0px rgba(240,168,72,0)); }
    40%  { filter: drop-shadow(0 0 20px rgba(240,168,72,0.5)); }
    100% { filter: drop-shadow(0 0 0px rgba(240,168,72,0)); }
}


/* Floating after entrance */
.home-page .screenshot-phone:nth-child(1).floating {
    animation: homePhoneFloat 4.5s ease-in-out infinite;
}
.home-page .screenshot-phone:nth-child(2).floating {
    animation: homePhoneFloat 5s ease-in-out 0.5s infinite;
}
.home-page .screenshot-phone:nth-child(3).floating {
    animation: homePhoneFloat 5.5s ease-in-out 1s infinite;
}

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

/* ================================================
   SECTION G: CTA Section Animations
   ================================================ */

.home-page .home-cta-title-in {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
}

.home-page .home-cta-title-in.visible {
    animation: homeCTATitleIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes homeCTATitleIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.home-page .home-cta-desc-in {
    opacity: 0;
    transform: translateY(25px);
}

.home-page .home-cta-desc-in.visible {
    animation: homeCTADescIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

@keyframes homeCTADescIn {
    to {
        opacity: 0.9;
        transform: translateY(0);
    }
}

.home-page .home-cta-btn-in {
    opacity: 0;
    transform: translateY(20px) scale(0.85);
}

.home-page .home-cta-btn-in.visible {
    animation: homeCTABtnIn 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.4s forwards;
}

@keyframes homeCTABtnIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* CTA button pulse ring */
.home-page .cta-section .btn-dark {
    position: relative;
    overflow: visible;
}

.home-page .cta-section .btn-dark::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50px;
    border: 2px solid rgba(255,255,255,0.3);
    animation: homeCTAPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes homeCTAPulse {
    0%, 100% { transform: scale(1); opacity: 0; }
    50% { transform: scale(1.06); opacity: 1; }
}

/* ================================================
   SECTION H: Footer Animations
   ================================================ */

.home-page .home-footer-in {
    opacity: 0;
    transform: translateY(20px);
}

.home-page .home-footer-in.visible {
    animation: homeFooterFade 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes homeFooterFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.home-page .footer-bottom {
    opacity: 0;
}

.home-page .footer-bottom.visible {
    animation: homeFooterLineIn 0.8s ease 0.4s forwards;
}

@keyframes homeFooterLineIn {
    to { opacity: 1; }
}

/* ================================================
   SECTION I: Section Divider Lines
   ================================================ */

.home-page .section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    transform: translateX(-50%);
    transition: width 1.5s ease;
}

.home-page .section.line-visible::after {
    width: 80%;
}

/* ================================================
   SECTION J: Scroll Progress Bar
   ================================================ */

.home-page .scroll-progress-bar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    width: 0%;
    z-index: 999;
    transition: width 0.1s linear;
    pointer-events: none;
}

/* ================================================
   SECTION K: Smooth scroll
   ================================================ */

@media (prefers-reduced-motion: no-preference) {
    .home-page {
        scroll-behavior: smooth;
    }
}

/* ================================================
   SECTION L: Accessibility - Reduced Motion
   ================================================ */

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