/* ==========================================================================
   滝杜神社（Takimori Shrine）コンセプトサイト スタイルシート
   ========================================================================== */

/* --- デザインシステム & 変数定義 --- */
:root {
    /* カラーパレット */
    --bg-base: #fcfaf2;           /* 乳白色/アイボリー（基本背景） */
    --bg-card: #ffffff;           /* 純白（カード・ブロックの背景） */
    --text-primary: #1a2530;      /* 深い藍色に近い黒（メインテキスト・ロゴ） */
    --text-secondary: #5a6670;    /* 薄い藍墨（サブテキスト） */
    --accent-green: #5f7055;      /* くすんだ緑（抹茶色・自然・セカンダリ） */
    --accent-vermilion: #b24f37;  /* 落ち着いた朱色（アクセント・プライマリ） */
    --accent-vermilion-hover: #923a23; /* 深みのある朱赤（ホバー時） */
    --border-color: rgba(95, 112, 85, 0.15); /* くすんだ緑の薄いボーダー */
    
    /* タイポグラフィ */
    --font-serif: 'Cormorant Garamond', 'Noto Serif JP', serif;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* トランジション & アニメーション */
    --transition-smooth: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    --transition-fast: all 0.3s ease;
}

/* --- 基本リセット & 共通スタイル --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.8;
    letter-spacing: 0.03em;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

/* --- コンテナ & 共通レイアウト --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* セクション全体の余白設定 */
section {
    padding: 8rem 0;
    position: relative;
}

/* 共通の見出しスタイル */
.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-subtitle {
    display: inline-block;
    font-family: var(--font-serif);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--accent-green);
    margin-bottom: 0.75rem;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.section-intro {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    font-weight: 300;
}

/* --- ボタンコンポーネント --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 2.2rem;
    font-family: var(--font-serif);
    font-size: 1.05rem;
    letter-spacing: 0.15em;
    border-radius: 0;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-primary {
    background-color: var(--accent-vermilion);
    color: #ffffff;
    border: 1px solid var(--accent-vermilion);
}

.btn-primary:hover {
    background-color: var(--accent-vermilion-hover);
    border-color: var(--accent-vermilion-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(178, 79, 55, 0.15);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--text-primary);
    color: var(--bg-base);
    transform: translateY(-2px);
}

/* --- 1. Header (ヘッダー) --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition-fast);
    padding: 1.5rem 0;
}

/* スクロール時にJSで付与されるクラス */
.site-header.scrolled {
    background-color: rgba(252, 250, 242, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(26, 37, 48, 0.03);
    padding: 1rem 0;
}

.header-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-primary);
}

.site-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-link {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    position: relative;
    padding: 0.25rem 0;
}

/* ナビリンクのアンダーラインアニメーション */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent-vermilion);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-vermilion);
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* モバイルメニュー用トグルボタン（通常は非表示） */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    width: 30px;
    height: 24px;
    justify-content: center;
    z-index: 1001;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition-fast);
}

/* --- 2. Hero (ヒーローセクション) --- */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0;
    color: #ffffff;
}

.hero-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.hero-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.05);
    animation: zoomOutHero 12s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* ヒーロー背景画像のズームアウトアニメーション */
@keyframes zoomOutHero {
    to {
        transform: scale(1);
    }
}

/* ヒーロー下の本文エリア全体に背景画像を敷く */
main {
    position: relative;
    background-image: url('./images/back_ground.webp');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* 背景の上に薄いベールを重ねて文字の可読性を確保（closingは除く） */
main::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(252, 250, 242, 0.78);
    z-index: 0;
    pointer-events: none;
}

/* 各セクションをベールより前面に出す */
main > section {
    position: relative;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(26, 37, 48, 0.45) 0%,
        rgba(26, 37, 48, 0.25) 50%,
        rgba(252, 250, 242, 0.15) 100%
    );
    z-index: 2;
}

.hero-content-wrapper {
    position: relative;
    z-index: 3;
    max-width: 800px;
    padding: 0 2rem;
    margin-top: 2rem;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 4.5rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* 日本語サブタイトル「滝杜神社」 */
.hero-subtitle-jp {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 300;
    letter-spacing: 0.35em;
    margin-bottom: 1.8rem;
    margin-left: 0.35em; /* 字間で右にずれる分を視覚的に中央寄せ */
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

@media (max-width: 768px) {
    .hero-subtitle-jp {
        font-size: 1.2rem;
        letter-spacing: 0.3em;
    }
}

.hero-tagline {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.hero-description {
    font-size: 1.05rem;
    font-weight: 300;
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto 3rem;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.04em;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.scroll-text {
    font-family: var(--font-serif);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
}

.scroll-line {
    width: 1px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 15px;
    background-color: var(--accent-vermilion);
    animation: scrollAnimation 2s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

@keyframes scrollAnimation {
    0% {
        transform: translateY(-20px);
    }
    100% {
        transform: translateY(60px);
    }
}

/* --- 3. About Takimori Shrine (紹介セクション) --- */
.about-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 5rem;
    align-items: center;
}

.about-image-wrapper {
    position: relative;
    overflow: hidden;
}

.about-image {
    width: 100%;
    height: 500px;
    object-fit: cover;
    box-shadow: 0 15px 40px rgba(26, 37, 48, 0.06);
    transition: var(--transition-smooth);
}

.about-image-wrapper:hover .about-image {
    transform: scale(1.03);
}

.about-content {
    padding-left: 1rem;
}

.about-content .section-title {
    text-align: left;
    margin-bottom: 2rem;
}

.about-text-block p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.about-text-block p:last-child {
    margin-bottom: 0;
}

/* --- 4. The Shrine Through the Seasons (四季の移り変わり) --- */
.seasons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.season-card {
    background-color: var(--bg-card);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 5px 25px rgba(26, 37, 48, 0.02);
    border: 1px solid var(--border-color);
}

.season-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(95, 112, 85, 0.08);
}

.season-card-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/5;
}

.season-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.season-card:hover .season-card-image {
    transform: scale(1.05);
}

.season-card-content {
    padding: 2rem 1.8rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.season-name {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--accent-green);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.season-card-title {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

.season-card-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.6;
    margin-top: auto;
}

/* --- 5. Sacred Experiences (神聖な体験) --- */
.experiences-section {
    background-color: rgba(95, 112, 85, 0.03);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.experiences-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.experience-card {
    background-color: var(--bg-card);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(26, 37, 48, 0.02);
    height: 100%;
    border: 1px solid var(--border-color);
}

.experience-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(26, 37, 48, 0.05);
}

.experience-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.experience-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.experience-card:hover .experience-image {
    transform: scale(1.04);
}

.experience-content {
    padding: 2.2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.experience-card-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

.experience-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.7;
}

/* --- 6. Seasonal Festivals (季節の祭り) --- */
.festivals-list {
    display: flex;
    flex-direction: column;
    gap: 6rem;
}

.festival-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

/* 左右反転レイアウト */
.festival-item.alternate {
    direction: rtl;
}

.festival-item.alternate .festival-content {
    direction: ltr; /* テキスト方向を左横書きにリセット */
}

.festival-image-wrapper {
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(26, 37, 48, 0.04);
}

.festival-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.festival-image-wrapper:hover .festival-image {
    transform: scale(1.03);
}

.festival-content {
    padding: 0 1rem;
}

.festival-season {
    display: inline-block;
    font-family: var(--font-serif);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-vermilion);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.festival-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    letter-spacing: 0.03em;
}

.festival-description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.8;
}

/* --- 7. Closing Message (結びのメッセージ) --- */
.closing-section {
    text-align: center;
    background-color: var(--text-primary);
    color: #ffffff;
    padding: 10rem 0;
    overflow: hidden;
}

/* 和風のうっすらとした背景装飾パターン */
.closing-bg-decor {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}

.closing-bg-decor::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    right: 10%;
    bottom: 10%;
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 50%;
}

.closing-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}

.closing-title {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    margin-bottom: 2.5rem;
}

.closing-text-block {
    margin-bottom: 4rem;
}

.closing-text-block p {
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 2;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
}

.closing-text-block p:last-child {
    margin-bottom: 0;
}

.closing-section .btn-secondary {
    border-color: rgba(255, 255, 255, 0.7);
    color: #ffffff;
}

.closing-section .btn-secondary:hover {
    background-color: #ffffff;
    color: var(--text-primary);
    border-color: #ffffff;
}

/* --- 8. Footer (フッター) --- */
.site-footer {
    background-color: #f7f4eb;
    padding: 5rem 0 3rem;
    border-top: 1px solid var(--border-color);
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4rem;
}

.footer-brand {
    max-width: 400px;
}

.footer-logo {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-concept-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 300;
    font-style: italic;
    line-height: 1.6;
}

.footer-nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.footer-nav-link {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    color: var(--text-primary);
    font-weight: 400;
}

.footer-nav-link:hover {
    color: var(--accent-vermilion);
}

.footer-bottom {
    border-top: 1px solid rgba(95, 112, 85, 0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: center;
}

.footer-copyright {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* --- スクロールアニメーション関連 --- */
/* JSで付与される表示アニメーション */
.reveal-fade, .reveal-slide-right, .reveal-card, .reveal-item {
    opacity: 0;
    transition: opacity 1.4s cubic-bezier(0.25, 1, 0.5, 1), transform 1.4s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: opacity, transform;
}

.reveal-fade {
    transform: translateY(30px);
}

.reveal-slide-right {
    transform: translateX(-40px);
}

.reveal-card {
    transform: translateY(40px);
}

.reveal-item {
    transform: translateY(50px);
}

/* アクティブ時のクラス */
.reveal-fade.visible,
.reveal-slide-right.visible,
.reveal-card.visible,
.reveal-item.visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* ヒーローセクション専用のアニメーションクラス（初回読み込み用） */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.hero-content .fade-in-up:nth-child(1) { animation-delay: 0.2s; }
.hero-content .fade-in-up:nth-child(2) { animation-delay: 0.4s; }
.hero-content .fade-in-up:nth-child(3) { animation-delay: 0.6s; }
.hero-content .fade-in-up:nth-child(4) { animation-delay: 0.8s; }

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


/* ==========================================================================
   メディアクエリ (レスポンシブデザイン)
   ========================================================================== */

/* --- タブレットサイズ (1024px以下) --- */
@media (max-width: 1024px) {
    section {
        padding: 6rem 0;
    }
    
    .seasons-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .experiences-grid {
        gap: 1.5rem;
    }
    
    .about-grid {
        gap: 3rem;
    }
    
    .about-image {
        height: 400px;
    }
    
    .festival-item {
        gap: 3rem;
    }
    
    .festival-image {
        height: 320px;
    }
}

/* --- モバイル・縦 (768px以下) --- */
@media (max-width: 768px) {
    /* ナビゲーションメニューのモバイル展開 */
    .mobile-menu-toggle {
        display: flex;
    }
    
    .site-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--bg-base);
        box-shadow: -10px 0 30px rgba(0,0,0,0.05);
        padding: 6rem 3rem;
        transition: right 0.5s cubic-bezier(0.25, 1, 0.5, 1);
        z-index: 1000;
        display: block;
    }
    
    .site-nav.active {
        right: 0;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 2rem;
    }
    
    .nav-link {
        font-size: 1.3rem;
    }
    
    /* ハンバーガーメニューのアニメーション */
    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    /* タイポグラフィ調整 */
    .hero-title {
        font-size: 3.2rem;
    }
    
    .hero-tagline {
        font-size: 1.4rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    /* レイアウトの1カラム化 */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .about-content {
        padding-left: 0;
    }
    
    .experiences-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .festival-item {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .festival-item.alternate {
        direction: ltr;
    }
    
    .festival-image {
        height: 280px;
    }
    
    .closing-title {
        font-size: 2.2rem;
    }
    
    .footer-top {
        flex-direction: column;
        gap: 3rem;
        align-items: center;
        text-align: center;
    }
    
    .footer-nav-list {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* --- 小さなモバイルサイズ (480px以下) --- */
@media (max-width: 480px) {
    .hero-title {
        font-size: 2.6rem;
    }
    
    .hero-tagline {
        font-size: 1.25rem;
    }
    
    .seasons-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 1.5rem;
    }
    
    .closing-title {
        font-size: 1.8rem;
    }
    
    .btn {
        width: 100%;
    }
}


/* ==========================================
   紅葉が舞い散るエフェクト（Falling Maple Leaves）
   ========================================== */

/* 紅葉レイヤー：画面全体を覆い、クリックは透過させる */
.maple-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;       /* 下の要素を操作できるように */
    overflow: hidden;
    z-index: 900;               /* ヘッダー(1000)より下、コンテンツより上 */
}

/* 1枚の紅葉 */
.maple-leaf {
    position: absolute;
    top: -8%;                   /* 画面上端の少し外から登場 */
    will-change: transform;
    /* 落下と横揺れを別アニメーションで重ねる */
    animation-name: maple-fall, maple-sway;
    animation-timing-function: linear, ease-in-out;
    animation-iteration-count: 1, infinite;
    animation-direction: normal, alternate;
    animation-fill-mode: both, none;
    /* sway の長さは fall と独立させて自然に揺らす */
    animation-duration: 12s, 3.5s;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.12));
}

/* 落下＋回転（縦移動と回転を担当） */
@keyframes maple-fall {
    0% {
        transform: translateY(0) translateX(0)
                   rotate(var(--start-rotate, 0deg));
    }
    100% {
        transform: translateY(115vh) translateX(var(--drift, 0))
                   rotate(calc(var(--start-rotate, 0deg) + (360deg * 3 * var(--spin-dir, 1))));
    }
}

/* 横方向のゆらゆら（木の葉が風で揺れる質感） */
@keyframes maple-sway {
    0%   { margin-left: 0; }
    100% { margin-left: var(--sway-distance, 18px); }
}

/* 動きを減らす設定の人には紅葉を出さない */
@media (prefers-reduced-motion: reduce) {
    .maple-layer { display: none; }
}
