/* CSS変数の定義 */
:root {
    --cta-height: 100px;
    --safe-area-inset-top: env(safe-area-inset-top);
    --safe-area-inset-bottom: env(safe-area-inset-bottom);
    --slide-height: calc(100vh - var(--cta-height));
    --slide-height-dynamic: calc(100dvh - var(--cta-height));
}

/* ベーススタイル */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans JP', sans-serif;
    overflow: hidden;
    position: relative;
    height: 100vh;
    height: 100dvh;
    touch-action: none;
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
}

/* フォントサイズの基準設定 */
html {
    font-size: 62.5%; /* 1rem = 10px */
}

/* コンテンツラッパー */
.content-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px; /* タブレット対応のため拡大 */
    height: 100vh;
    height: 100dvh;
    background-color: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 0 auto;
}

/* スライドコンテナ */
.slide-container {
    position: relative;
    height: var(--slide-height);
    height: var(--slide-height-dynamic);
    overflow: hidden;
    width: 100%;
}

/* スライドラッパー */
.slides-wrapper {
    position: relative;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.slides-wrapper.dragging {
    transition: none;
}

/* 各スライド */
.slide {
    position: relative;
    height: var(--slide-height);
    height: var(--slide-height-dynamic);
    width: 100%;
    overflow: hidden;
}

/* スライド内部のコンテンツ */
.slide-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

/* 背景画像 */
.bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* 背景動画用のスタイル */
.bg-video {
    object-fit: cover;
    pointer-events: none;
}

/* スライドコンテンツ */
.content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 10;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
}

.section-number {
    font-size: clamp(8rem, 15vw, 12rem);
    font-weight: 900;
    opacity: 0.3;
    line-height: 0.8;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.content h1 {
    font-size: clamp(2.4rem, 6vw, 4rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
}

.content p {
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    line-height: 1.6;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
    opacity: 0.95;
}

/* スワイプインジケーター */
.swipe-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    opacity: 0.8;
}

.swipe-indicator svg {
    width: 30px;
    height: 30px;
    fill: white;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* 画像読み込みエラー時のプレースホルダー */
.slide-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 0;
}

/* CTAボタン */
.cta-container {
    position: absolute;
    bottom: 0;
    bottom: env(safe-area-inset-bottom);
    left: 0;
    width: 100%;
    height: var(--cta-height);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.cta-button {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.cta-button:active {
    transform: translateY(0);
}

/* ページインジケーター */
.page-dots {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: none; /* ドットを非表示 */
}

.dot {
    display: block;
    width: 1rem;
    height: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    margin: 1rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: white;
    transform: scale(1.3);
}

/* モバイル表示時の修正 */
@media (max-width: 479px) {
    /* モバイル表示時はメニューを画面全体に */
    .nav-menu {
        position: fixed;
    }
    
    /* モバイル表示時はハンバーガーメニューも固定 */
    .hamburger-menu {
        position: fixed;
    }
}

/* レスポンシブ対応 */
@media (max-width: 414px) {
    body {
        background-color: #fff;
        display: block;
    }
    
    .content-wrapper {
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        box-shadow: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
}

/* タブレット以上の画面サイズ */
@media (min-width: 480px) {
    body {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .content-wrapper {
        position: relative;
        /* CTAの高さも含めた全体を表示 */
        height: 100vh;
        width: calc(100vh * 0.6); /* **10:16（0.625）**に近い */
        max-width: 100vw;
        margin: 0 auto;
    }
    
    /* スライドコンテナの高さを再計算 */
    .slide-container {
        height: calc(100% - var(--cta-height));
    }
    
    /* 各スライドの高さを調整 */
    .slide {
        height: 100%;
    }
    
    /* PC・タブレットで画像サイズを制御 */
    .bg-image {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    .cta-button {
        max-width: 350px;
    }
    
    /* PCでドットを表示 */
    .page-dots {
        display: block;
    }
}

/* sec10のLINEボタン */
.sec10-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.line-btn {
    position: absolute;
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 500px;
    height: auto;
    z-index: 10;
    cursor: pointer;
    transition: all 0.3s ease;
}

.line-btn:hover {
    transform: translate(-50%, -50%) scale(1.05);
    filter: brightness(1.1);
}

.line-btn:active {
    transform: translate(-50%, -50%) scale(0.98);
}

/* sec10のWebボタン */
.web-btn {
    position: absolute;
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 500px;
    height: auto;
    z-index: 10;
    cursor: pointer;
    transition: all 0.3s ease;
}

.web-btn:hover {
    transform: translate(-50%, -50%) scale(1.05);
    filter: brightness(1.1);
}

.web-btn:active {
    transform: translate(-50%, -50%) scale(0.98);
}

/* ハンバーガーメニュー */
.hamburger-menu {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    cursor: pointer;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.hamburger-menu span {
    display: block;
    width: 2.5rem;
    height: 0.3rem;
    background-color: #fff;
    border-radius: 0.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.hamburger-menu.active span:nth-child(1) {
    transform: translateY(0.8rem) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: translateY(-0.8rem) rotate(-45deg);
}

/* ナビゲーションメニュー */
.nav-menu {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 1500;
    pointer-events: none;
}

.nav-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-content {
    position: absolute;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100%;
    background-color: #fff;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
}

.nav-menu.active {
    pointer-events: auto;
}

.nav-menu.active .nav-overlay {
    opacity: 1;
}

.nav-menu.active .nav-content {
    right: 0;
}

.nav-list {
    list-style: none;
    padding: 8rem 0 2rem;
    margin: 0;
}

.nav-list li {
    border-bottom: 1px solid #eee;
}

.nav-list a {
    display: block;
    padding: 1rem 2rem;
    color: #333;
    text-decoration: none;
    font-size: 1.6rem;
    transition: background-color 0.3s ease;
}

.nav-list a:hover {
    background-color: #f5f5f5;
}

/* 大画面対応 */
@media (min-width: 1024px) {
    .content-wrapper {
        border-radius: 10px;
        margin: 20px auto;
    }
}