/* ========================================
   animations.css - アニメーション全定義
   民泊 ヒトと木
   ======================================== */

/* ========================================
   ローディング画面
   ======================================== */
#loading-screen {
    position: fixed;
    inset: 0;
    background: #FFF8F3;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-logo {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 900;
    color: #5C4033;
    letter-spacing: 4px;
    margin-bottom: 30px;
    opacity: 0;
    animation: loaderFadeIn 0.6s ease 0.2s forwards;
}

.loader-ring {
    width: 56px;
    height: 56px;
    border: 3px solid #E0D5C7;
    border-top-color: #E8A76A;
    border-radius: 50%;
    animation: loaderSpin 1s linear infinite;
}

.loader-dots {
    display: flex;
    gap: 8px;
    margin-top: 24px;
}

.loader-dot {
    width: 8px;
    height: 8px;
    background: #E8A76A;
    border-radius: 50%;
    opacity: 0;
    animation: loaderDotPulse 1.4s ease infinite;
}
.loader-dot:nth-child(1) { animation-delay: 0s; }
.loader-dot:nth-child(2) { animation-delay: 0.2s; }
.loader-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes loaderFadeIn {
    to { opacity: 1; }
}
@keyframes loaderSpin {
    to { transform: rotate(360deg); }
}
@keyframes loaderDotPulse {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.2); }
}

/* ========================================
   スクロール進行バー
   ======================================== */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #E8A76A, #D97706, #E8A76A);
    background-size: 200% 100%;
    width: 0%;
    z-index: 2000;
    transition: width 0.1s linear;
    animation: progressShimmer 2s linear infinite;
}

@keyframes progressShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========================================
   カスタムカーソル（デスクトップのみ）
   ======================================== */
#cursor {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #E8A76A;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background 0.2s;
    mix-blend-mode: multiply;
}

#cursor-follower {
    position: fixed;
    width: 36px;
    height: 36px;
    border: 2px solid rgba(232, 167, 106, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9997;
    transform: translate(-50%, -50%);
    transition: transform 0.12s ease, width 0.2s, height 0.2s, border-color 0.2s;
}

body.cursor-hover #cursor {
    width: 16px;
    height: 16px;
    background: #D97706;
}

body.cursor-hover #cursor-follower {
    width: 50px;
    height: 50px;
    border-color: rgba(217, 119, 6, 0.5);
}

@media (max-width: 768px) {
    #cursor, #cursor-follower { display: none; }
}

/* ========================================
   ナビゲーション スクロールアニメーション
   ======================================== */
.navbar {
    transition: padding 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
}

.navbar.scrolled {
    padding: 8px 0;
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.navbar.scrolled .logo-image {
    height: 52px;
    transition: height 0.4s ease;
}

.navbar.nav-hidden {
    transform: translateY(-100%);
}

/* ナビリンク アンダーライン アニメーション */
.nav-link:not(.cta-link) {
    position: relative;
}

.nav-link:not(.cta-link)::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: #E8A76A;
    transition: width 0.3s ease;
}

.nav-link:not(.cta-link):hover::after {
    width: 100%;
}

/* CTAリンク シマー */
.cta-link {
    overflow: hidden;
    position: relative;
}

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

.cta-link:hover::before {
    left: 150%;
    transition: left 0.6s ease;
}

/* ========================================
   ヒーロー パララックス & エントランス
   ======================================== */
.hero {
    overflow: hidden;
    position: relative;
}

.hero-image {
    will-change: transform;
    transform-origin: center center;
    transition: none;
}

/* ヒーロー オーバーレイ */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.15) 0%,
        rgba(0,0,0,0.3) 50%,
        rgba(0,0,0,0.5) 100%
    );
    z-index: 5;
}

/* ヒーローコンテンツ 初期アニメーション */
.hero-content {
    opacity: 0;
    animation: heroContentEnter 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

@keyframes heroContentEnter {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 30px));
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.hero-title {
    opacity: 0;
    animation: heroTitleEnter 1s ease 0.6s forwards;
}

@keyframes heroTitleEnter {
    from { opacity: 0; transform: translateY(20px); letter-spacing: 8px; }
    to   { opacity: 1; transform: translateY(0);    letter-spacing: normal; }
}

.hero-subtitle {
    opacity: 0;
    animation: heroSubEnter 1s ease 0.9s forwards;
}

@keyframes heroSubEnter {
    from { opacity: 0; transform: translateY(15px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero .cta-button {
    opacity: 0;
    animation: heroBtnEnter 1s ease 1.2s forwards;
}

@keyframes heroBtnEnter {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ヒーロー パーティクル */
.hero-particles {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(232, 167, 106, 0.6);
    animation: particleFloat linear infinite;
}

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

/* スクロールインジケーター */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: heroBtnEnter 1s ease 1.5s forwards;
    opacity: 0;
}

.scroll-indicator span {
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.scroll-mouse {
    width: 22px;
    height: 36px;
    border: 2px solid rgba(255,255,255,0.7);
    border-radius: 11px;
    display: flex;
    justify-content: center;
    padding-top: 6px;
}

.scroll-wheel {
    width: 3px;
    height: 8px;
    background: rgba(255,255,255,0.9);
    border-radius: 2px;
    animation: scrollWheel 1.8s ease infinite;
}

@keyframes scrollWheel {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(12px); opacity: 0; }
}

/* ========================================
   スクロールトリガー アニメーション基底
   ======================================== */

/* 共通: 初期状態（非表示） */
[data-aos] {
    opacity: 0;
    transition-property: opacity, transform;
    transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    transition-duration: 0.8s;
}

[data-aos].aos-animate {
    opacity: 1;
}

/* フェードアップ */
[data-aos="fade-up"] {
    transform: translateY(50px);
}
[data-aos="fade-up"].aos-animate {
    transform: translateY(0);
}

/* フェードダウン */
[data-aos="fade-down"] {
    transform: translateY(-40px);
}
[data-aos="fade-down"].aos-animate {
    transform: translateY(0);
}

/* フェード左→右 */
[data-aos="fade-right"] {
    transform: translateX(-60px);
}
[data-aos="fade-right"].aos-animate {
    transform: translateX(0);
}

/* フェード右→左 */
[data-aos="fade-left"] {
    transform: translateX(60px);
}
[data-aos="fade-left"].aos-animate {
    transform: translateX(0);
}

/* ズームイン */
[data-aos="zoom-in"] {
    transform: scale(0.85);
}
[data-aos="zoom-in"].aos-animate {
    transform: scale(1);
}

/* フリップアップ */
[data-aos="flip-up"] {
    transform: perspective(800px) rotateX(30deg) translateY(40px);
}
[data-aos="flip-up"].aos-animate {
    transform: perspective(800px) rotateX(0deg) translateY(0);
}

/* ディレイ定義 */
[data-delay="100"] { transition-delay: 0.1s; }
[data-delay="200"] { transition-delay: 0.2s; }
[data-delay="300"] { transition-delay: 0.3s; }
[data-delay="400"] { transition-delay: 0.4s; }
[data-delay="500"] { transition-delay: 0.5s; }
[data-delay="600"] { transition-delay: 0.6s; }
[data-delay="700"] { transition-delay: 0.7s; }
[data-delay="800"] { transition-delay: 0.8s; }

/* ========================================
   セクションタイトル アンダーライン演出
   ======================================== */
.section-title {
    overflow: hidden;
}

.section-title::after {
    width: 0;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s;
}

.section-title.title-animated::after {
    width: 80px;
}

/* ========================================
   カード ホバー 3D ティルト
   ======================================== */
.room-card,
.amenity-card,
.attraction-card,
.review-card,
.feature-item {
    transform-style: preserve-3d;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

/* ========================================
   部屋カード 画像ズーム
   ======================================== */
.room-card {
    overflow: hidden;
}

.room-card .room-image {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.room-card:hover .room-image {
    transform: scale(1.07);
}

/* ========================================
   観光地カード 画像オーバーレイ
   ======================================== */
.attraction-card {
    overflow: hidden;
}

.attraction-card .attraction-image {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.attraction-card:hover .attraction-image {
    transform: scale(1.08);
}

.attraction-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(92,64,51,0.6) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.attraction-card {
    position: relative;
}

.attraction-card:hover::after {
    opacity: 1;
}

/* ========================================
   アメニティカード アイコン バウンス
   ======================================== */
.amenity-card:hover .amenity-icon-large {
    animation: iconBounce 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.25) rotate(-5deg); }
    60% { transform: scale(0.95) rotate(3deg); }
    80% { transform: scale(1.05); }
}

/* ========================================
   フィーチャーアイテム ホバー
   ======================================== */
.feature-item {
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-left-color 0.35s ease;
}

.feature-item:hover {
    transform: translateX(8px);
    border-left-color: #D97706;
}

.feature-item .feature-icon {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
}

.feature-item:hover .feature-icon {
    transform: scale(1.2) rotate(10deg);
}

/* ========================================
   CTAボタン シマー & パルス
   ======================================== */
.cta-button {
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: skewX(-20deg);
}

.cta-button:hover::before {
    left: 150%;
    transition: left 0.6s ease;
}

/* CTAセクション パルスリング */
.cta-section {
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    animation: ctaPulseRing 3s ease infinite;
    pointer-events: none;
}

.cta-section::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 50%;
    animation: ctaPulseRing 3s ease 1s infinite;
    pointer-events: none;
}

@keyframes ctaPulseRing {
    0%   { transform: translate(-50%,-50%) scale(0.8); opacity: 0.5; }
    100% { transform: translate(-50%,-50%) scale(1.6); opacity: 0; }
}

/* ========================================
   フロアプランセクション
   ======================================== */
.floor-plan-image {
    transition: transform 0.6s ease, box-shadow 0.6s ease;
}

.floor-plan-image:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

/* ========================================
   レビューカード 引用マーク
   ======================================== */
.review-card {
    position: relative;
    overflow: hidden;
}

.review-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    right: 20px;
    font-family: 'Playfair Display', serif;
    font-size: 100px;
    color: rgba(232, 167, 106, 0.12);
    line-height: 1;
    pointer-events: none;
    transition: color 0.4s ease, transform 0.4s ease;
}

.review-card:hover::before {
    color: rgba(232, 167, 106, 0.22);
    transform: scale(1.1);
}

/* ========================================
   施設セクション 画像ホバー
   ======================================== */
.facility-image {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.facility-item:hover .facility-image {
    transform: scale(1.03);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* ========================================
   フッター リンク ホバー
   ======================================== */
.footer-section a {
    position: relative;
    padding-left: 0;
    transition: padding-left 0.3s ease, color 0.3s ease;
}

.footer-section a::before {
    content: '›';
    position: absolute;
    left: -15px;
    opacity: 0;
    transition: left 0.3s ease, opacity 0.3s ease;
    color: #E8A76A;
}

.footer-section a:hover {
    padding-left: 15px;
    color: #E8A76A !important;
}

.footer-section a:hover::before {
    left: 0;
    opacity: 1;
}

/* ========================================
   テキスト スプリット アニメーション
   ======================================== */
.split-text .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px) rotate(5deg);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.split-text.animated .char {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
}

/* ========================================
   "民泊について" セクション装飾
   ======================================== */
.about {
    position: relative;
    overflow: hidden;
}

.about::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(232, 167, 106, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

/* ========================================
   鉄板セクション 炎エフェクト
   ======================================== */
.teppan-experience {
    position: relative;
    overflow: hidden;
}

.teppan-experience::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, #E8A76A, #D97706, #E8A76A, transparent);
    animation: flameLine 3s ease infinite;
}

@keyframes flameLine {
    0%, 100% { opacity: 0.5; transform: scaleX(0.8); }
    50% { opacity: 1; transform: scaleX(1); }
}

/* ========================================
   セクション 背景パターン（アメニティ）
   ======================================== */
.amenities {
    position: relative;
}

.amenities::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(232, 167, 106, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(92, 64, 51, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

/* ========================================
   スムーズスクロールトップボタン
   ======================================== */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: #E8A76A;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease;
    box-shadow: 0 4px 20px rgba(232, 167, 106, 0.5);
}

#back-to-top.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

#back-to-top:hover {
    background: #D97706;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(217, 119, 6, 0.5);
}

#back-to-top svg {
    width: 20px;
    height: 20px;
    fill: white;
    transition: transform 0.3s ease;
}

#back-to-top:hover svg {
    transform: translateY(-2px);
}

/* ========================================
   セクション タイトル ホバー
   ======================================== */
.section-title {
    cursor: default;
    transition: color 0.3s ease;
}

/* ========================================
   アバウト画像 フロート
   ======================================== */
.about-img {
    animation: floatImage 6s ease-in-out infinite;
    transition: box-shadow 0.4s ease;
}

@keyframes floatImage {
    0%, 100% { transform: translateY(0px); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
    50% { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.15); }
}

/* ========================================
   ページ全体 フォントスムース
   ======================================== */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   観光地グリッド マスキー効果
   ======================================== */
.attraction-card h3,
.attraction-card p {
    transition: transform 0.3s ease;
}

.attraction-card:hover h3 {
    transform: translateY(-3px);
}

/* ========================================
   レスポンシブ対応
   ======================================== */
@media (max-width: 768px) {
    .hero-content {
        animation-duration: 0.8s;
    }
    [data-aos] {
        transition-duration: 0.6s;
    }
    .about-img {
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ========================================
   FIX: ナビリンクのクリック/hover阻害を防止
   （疑似要素が上に被さってイベントを奪うケース対策）
   ======================================== */
.nav-link::after,
.cta-link::before {
    pointer-events: none;
}
