/* =====================================
   基本設定・リセット・変数定義
   ===================================== */
:root {
    --primary-bg: #f8f8f7;        /* 生成り色 */
    --text-primary: #333;          /* メインテキスト */
    --accent-forest: #3a5340;      /* 森の緑 */
    --accent-earth: #7a6e61;       /* 土の色 */
    --accent-indigo: #29335c;      /* 藍色 */
    --divider: rgba(58, 83, 64, 0.2); /* 区切り線 */
    --max-width: 900px;
    --section-padding: 80px 0;
    --font-serif: 'Noto Serif JP', serif;
    --font-sans: 'Noto Sans JP', sans-serif;
}

/* =====================================
   基本スタイルとリセット
   ===================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1rem; /* 16px */
    line-height: 1.8;
    color: var(--text-primary);
    background-color: var(--primary-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.preload * {
    transition: none !important;
}

img, svg {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* =====================================
   プログレスバー
   ===================================== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 2000;
    pointer-events: none;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-forest), var(--accent-indigo));
    width: 0%;
    transition: width 0.1s ease-out;
}

/* =====================================
   タイポグラフィ
   ===================================== */
h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.4;
    color: var(--accent-forest);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    text-align: center;
    margin: 0 0 2.5rem 0;
}

h3, .section-title--small {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 1.8rem);
    color: var(--accent-earth);
    text-align: center;
    margin: 0 0 1.5rem 0;
}

p {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

/* =====================================
   レイアウトコンポーネント
   ===================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* =====================================
   ヒーローセクション
   ===================================== */
.hero {
    min-height: auto;
    display: flex;
    align-items: center;
    padding: 100px 24px;
    background-color: var(--primary-bg);
    position: relative;
    overflow: hidden;
}

.hero__container {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 40px;
}

.hero__text {
    text-align: left;
}

.hero__title {
    margin: 0 0 1rem;
}

.hero__subtitle {
    font-size: 1.25rem;
    color: var(--accent-earth);
    margin: 0 0 1.5rem;
    max-width: 500px;
}

.hero__tagline {
    font-size: 1rem;
    color: var(--text-primary);
    opacity: 0.8;
    margin: 0;
}

.hero__visual {
    text-align: center;
}

.hero__book-cover {
    max-width: 350px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(58, 83, 64, 0.15), 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.hero__book-cover:hover {
    transform: translateY(-5px) scale(1.03);
}

/* =====================================
   ヒーローアニメーション
   ===================================== */
.hero-animations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    /* overflow: hidden; を削除して虹の切れを解消 */
}

.balloons-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.balloon {
    position: absolute;
    bottom: -100px;
    width: 40px;
    height: 55px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    opacity: 0.6;
    animation: float 20s ease-in-out infinite;
}

.balloon-1 { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); left: 10%; animation-delay: 0s; animation-duration: 25s; }
.balloon-2 { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); left: 80%; animation-delay: 5s; animation-duration: 20s; }
.balloon-3 { background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%); left: 50%; animation-delay: 10s; animation-duration: 30s; }

@keyframes float {
    from { bottom: -100px; transform: translateX(0) rotate(0deg); }
    to { bottom: 100%; transform: translateX(20vw) rotate(360deg); }
}

/* SVG虹アニメーション */
.rainbow-arch {
    position: absolute;
    bottom: 10%; /* 書籍カバーの後ろに来るように調整 */
    left: 0;
    width: 100%;
    height: 50%;
    opacity: 0;
    animation: rainbow-appear 4s ease-out 1s forwards;
}

.rainbow-arch svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.rainbow-stroke {
    fill: none;
    stroke: url(#rainbow-gradient);
    stroke-width: 12; /* 以前より1.5倍太く */
    stroke-linecap: round;
    animation: rainbow-shimmer 5s ease-in-out infinite alternate;
}

@keyframes rainbow-appear {
    to {
        opacity: 1;
    }
}

@keyframes rainbow-shimmer {
    0% {
        opacity: 0.6;
        filter: brightness(1) blur(1px);
    }
    100% {
        opacity: 1;
        filter: brightness(1.2) blur(0px);
    }
}

/* =====================================
   メインコンテンツ
   ===================================== */
.main-content section {
    padding: var(--section-padding);
    border-bottom: 1px solid var(--divider);
}

.main-content section:last-of-type {
    border-bottom: none;
}

.problem-text {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    line-height: 2;
}

/* =====================================
   UI コンポーネント
   ===================================== */
.learning-list, .target-list {
    list-style: none;
    padding-left: 0;
    max-width: 750px;
    margin: 0 auto;
}

.learning-list li, .target-list li {
    position: relative;
    padding-left: 32px;
    margin-bottom: 1.25rem;
    font-size: 1.125rem;
}

.learning-list li::before, .target-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 4px;
    color: var(--accent-forest);
    font-weight: bold;
    font-size: 1.2rem;
}

/* =====================================
   CTAセクション
   ===================================== */
.cta-section {
    background-color: #f4f2f0;
}

.cta-content {
    text-align: center;
}

.cta-message {
    font-size: 1.5rem;
    font-family: var(--font-serif);
    color: var(--accent-indigo);
    margin: 0 0 2rem 0;
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-forest);
    color: #fff;
    padding: 18px 48px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: 700;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.cta-button:hover, .cta-button:focus {
    background-color: #2c4031;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    outline: none;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease-out, height 0.4s ease-out;
    z-index: -1;
}

.cta-button:hover::before {
    width: 250px;
    height: 250px;
}

.cta-button-subtext {
    display: block;
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 6px;
}

/* 関連アプリへのリンクボタン */
.related-app-link {
    text-align: center;
    margin-top: 3rem;
}

.cta-button-outline {
    display: inline-block;
    padding: 14px 32px;
    border: 2px solid var(--accent-earth);
    color: var(--accent-earth);
    background-color: transparent;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.cta-button-outline:hover {
    background-color: var(--accent-earth);
    color: var(--primary-bg);
    transform: translateY(-3px);
}

/* =====================================
   先生の声セクション
   ===================================== */
.testimonials-section {
    background-color: #f4f2f0;
}

.testimonial-card {
    background-color: var(--primary-bg);
    padding: 2rem;
    border-radius: 8px;
    border-left: 5px solid var(--accent-earth);
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.testimonial-text {
    font-style: italic;
    margin: 0 0 1rem 0;
}

.testimonial-author {
    text-align: right;
    font-weight: bold;
    color: var(--accent-earth);
}

/* =====================================
   FAQセクション
   ===================================== */
.faq-accordion {
    max-width: 750px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--divider);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 1.5rem 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent-forest);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"]::after {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.faq-answer p {
    padding: 0 0 1.5rem 0;
    margin: 0;
}

/* =====================================
   シェアセクション
   ===================================== */
.share-section {
    background-color: #f4f2f0;
    text-align: center;
}

.share-section h3 {
    color: var(--accent-indigo);
    margin: 0 0 1.5rem 0;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.share-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: none;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

.share-btn.twitter { background-color: #1DA1F2; }
.share-btn.facebook { background-color: #1877F2; }
.share-btn.line { background-color: #00B900; }

/* =====================================
   AdSenseコンテナ
   ===================================== */
.ad-container {
    padding: 40px 0;
    text-align: center;
    border-bottom: 1px solid var(--divider);
}

/* =====================================
   フッター
   ===================================== */
.footer {
    padding: 40px 24px;
    background-color: #e9e7e4;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 1rem;
}

.footer-info {
    margin: 0;
    color: var(--accent-earth);
}

.social-links a {
    color: var(--accent-earth);
    transition: color 0.2s ease;
}

.social-links a:hover {
    color: var(--accent-forest);
}

.social-icon {
    width: 24px;
    height: 24px;
}

.copyright {
    margin: 0;
    font-size: 0.9rem;
    color: var(--accent-earth);
}

/* =====================================
   ページトップボタン
   ===================================== */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background-color: var(--accent-forest);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none; /* Initially hidden */
    justify-content: center;
    align-items: center;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 1000;
}

.back-to-top:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* =====================================
   アニメーション
   ===================================== */
.fade-in {
    animation: fadeIn 1.2s ease-in-out forwards;
}

.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal-up.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* =====================================
   レスポンシブデザイン
   ===================================== */
@media (min-width: 769px) {
    .hero__container {
        grid-template-columns: 1.2fr 1fr; /* テキストと画像の比率を調整 */
        gap: 60px;
    }

    .hero__text {
        text-align: left;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 1rem; /* 16px */
        line-height: 1.7;
    }

    .hero {
        padding: 60px 24px;
    }

    .hero__text {
        text-align: center;
    }

    .hero__visual {
        order: -1; /* 画像をテキストの上に表示 */
    }

    .rainbow-arch {
        bottom: 25%; /* スマホ用に位置を調整 */
    }

    .rainbow-stroke {
        stroke-width: 8; /* スマホ用に少し細く */
    }

    .balloons-container {
        display: none; /* スマホでは風船は非表示 */
    }

    .main-content section {
        padding: 60px 0;
    }

    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .learning-list li, .target-list li {
        font-size: 1rem;
    }

    .share-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .share-btn {
        width: 80%;
        max-width: 300px;
    }
}