/* --- Global Styles --- */
:root {
    --primary-bg: #fdfcfb;
    /* 洗練された温かみのあるシャンパンホワイト */
    --primary-text: #2c3e50;
    /* 誠実さを感じさせる深い藍色 */
    --secondary-text: #5d6d7e;

    /* 信頼と安らぎの「セージテイル」- NPOとしての専門性と優しさを両立 */
    --accent-main: #5fa4a4;
    --accent-light: #e6f2f2;
    --accent-dark: #3d6b6b;

    /* 希望と心（ハート）を象徴する「ソフトコーラル」- 親しみやすさと活気のアクセント */
    --accent-warm: #ff8b94;
    --accent-warm-light: #fff0f1;

    /* 良いご縁と成功を祝う「サンシャインゴールド」- ルートわんわんファイブを照らす光 */
    --accent-gold: #ffd452;
    --accent-gold-dark: #f1c40f;

    --border-color: #e2e8f0;
    --shadow-color: rgba(95, 164, 164, 0.1);
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--primary-bg);
    /* 視認性と清潔感を重視した、目に優しい微細なドットパターン */
    background-image: radial-gradient(var(--accent-light) 1.5px, transparent 1.5px);
    background-size: 30px 30px;
    background-attachment: fixed;
    color: var(--primary-text);
    font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
    overflow-x: hidden;
    line-height: 1.8;
}

h1,
h2,
h3 {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    letter-spacing: 0.5px;
}

a {
    text-decoration: underline;
    color: var(--accent-dark);
    transition: var(--transition);
}

a:hover {
    color: var(--accent-warm);
    background: var(--accent-warm-light);
}

/* --- Navigation --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 2000;
}

.glass-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 5px solid var(--accent-main);
    padding: 15px 30px;
}

.logo {
    display: flex;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 900;
}

.logo-text.pink {
    color: var(--accent-main);
}

.logo-text.gold {
    color: var(--accent-warm);
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--primary-text);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 15px;
}

.nav-links a:hover {
    background: var(--accent-light);
    color: var(--accent-dark);
    transform: translateY(-2px);
}

.cta-button {
    background: var(--accent-main);
    color: #fff;
    padding: 10px 25px;
    border: 3px outset #fff;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    box-shadow: 0 4px 0 var(--accent-dark);
}

/* --- Marquee --- */
.top-marquee {
    background: var(--accent-warm-light);
    border-bottom: 2px solid var(--accent-warm);
    overflow: hidden;
    margin-top: 100px;
    /* 大胆にマージンを取り、重なりを確実に防止 */
    display: flex;
    align-items: center;
    padding: 14px 0;
    /* 固定の高さをやめ、パディングで中央配置を安定させる */
    font-size: 1rem;
    font-weight: bold;
    color: var(--accent-warm);
    z-index: 1500;
}

.marquee-content {
    display: inline-block;
    white-space: nowrap;
    animation: marquee 35s linear infinite;
    padding-left: 100%;
    /* line-heightはブラウザのデフォルトに任せてflexでセンター寄せ */
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* --- Container & Sections --- */
section {
    padding: 80px 6%;
}

.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.85);
    /* さりげない透明感 */
    backdrop-filter: blur(10px);
    /* 高級感のあるグラスモーフィズム */
    border: 3px solid rgba(95, 164, 164, 0.3);
    /* 線を細く上品に */
    padding: 50px;
    border-radius: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.container:hover {
    box-shadow: 0 30px 60px rgba(95, 164, 164, 0.1);
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 40px;
    color: var(--accent-dark);
    display: inline-block;
    background: linear-gradient(transparent 75%, var(--accent-light) 75%);
}

/* --- Hero --- */
.welcome-box {
    text-align: center;
    border-color: var(--accent-gold) !important;
    background: linear-gradient(to bottom, #fff, var(--primary-bg));
}

.sparkle-title {
    font-size: 4rem;
    background: linear-gradient(90deg, var(--accent-main), var(--accent-warm), var(--accent-gold), var(--accent-main));
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    /* 標準プロパティを追加 */
    -webkit-text-fill-color: transparent;
    animation: shine 8s linear infinite, sparkleFloat 4s ease-in-out infinite alternate;
    text-shadow: 0 10px 30px rgba(95, 164, 164, 0.2);
    margin-bottom: 20px;
    font-weight: 900;
}

@keyframes shine {
    to {
        background-position: 300% center;
    }
}

@keyframes sparkleFloat {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.02);
    }
}

.catchphrase {
    font-weight: bold;
    color: var(--accent-dark);
    font-size: 1.5rem;
    margin-bottom: 30px;
    opacity: 0.8;
}

.hero-btns {
    display: flex;
    gap: 25px;
    justify-content: center;
    margin-top: 35px;
}

.primary-btn,
.secondary-btn {
    padding: 16px 40px;
    border-radius: 40px;
    font-weight: 900;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.primary-btn {
    background: var(--accent-gold);
    color: #4a3c10;
    border: 3px solid #fff;
    box-shadow: 0 5px 0 var(--accent-gold-dark), 0 10px 20px rgba(0, 0, 0, 0.05);
}

.secondary-btn {
    background: #fff;
    color: var(--primary-text);
    border: 3px solid var(--accent-main);
}

.primary-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 0 var(--accent-gold-dark), 0 15px 25px rgba(0, 0, 0, 0.1);
}

.secondary-btn:hover {
    background: var(--accent-light);
    transform: translateY(-5px);
}

/* --- Officer Cards --- */
.officer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.person-box {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 30px;
    padding: 35px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    text-align: left;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.person-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(95, 164, 164, 0.1);
    border-color: var(--accent-main);
}

.person-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-main), var(--accent-warm));
}

.person-box .name {
    color: var(--accent-dark);
    margin-bottom: 10px;
    font-size: 1.5rem;
    font-weight: 800;
}

.person-box .role {
    font-size: 1rem;
    color: var(--secondary-text);
    margin-bottom: 15px;
    display: block;
}

.bio ul {
    list-style: none;
    padding-left: 0;
}

.bio li {
    margin-bottom: 12px;
    position: relative;
    padding-left: 28px;
    font-size: 0.95rem;
}

.bio li::before {
    content: "●";
    color: var(--accent-main);
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

.caution-note {
    font-size: 0.85rem;
    color: #855a2a;
    background: #fff8f0;
    padding: 15px 20px;
    border-radius: 18px;
    margin-top: 20px;
    border-left: 6px solid var(--accent-gold);
    line-height: 1.6;
}

.etc-officers {
    background: #fff;
    border: 3px dashed var(--accent-light);
    padding: 30px;
    border-radius: 25px;
}

.officer-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--accent-light);
    display: flex;
    justify-content: space-between;
    font-weight: 600;
}

.stats-text {
    margin-top: 35px;
    font-size: 1rem;
    color: #aeb6bf;
    text-align: center;
}

/* --- Services / Activity --- */
.services-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-block {
    padding: 40px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 30px;
    position: relative;
    transition: all 0.4s ease;
}

.service-block.active {
    background: linear-gradient(135deg, var(--accent-light), #fff);
    border: 2px solid var(--accent-main);
}

.service-block:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 35px rgba(95, 164, 164, 0.12);
}

.block-number {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 3rem;
    opacity: 0.2;
    font-weight: 900;
    color: var(--accent-dark);
}

/* --- History Log --- */
.log-box {
    padding: 35px;
}

.history-list li {
    padding: 18px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 1.05rem;
}

.history-list li span {
    color: var(--accent-main);
    font-weight: 800;
    margin-right: 25px;
}

/* --- Contact --- */
.bubble-box {
    border-radius: 45px;
    border: 5px solid var(--accent-warm-light);
}

input,
textarea {
    width: 100%;
    padding: 16px;
    margin-bottom: 25px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    font-family: inherit;
    font-size: 1.05rem;
    transition: var(--transition);
}

input:focus,
textarea:focus {
    border-color: var(--accent-warm);
    box-shadow: 0 0 10px var(--accent-warm-light);
    outline: none;
}

/* --- Footer --- */
footer {
    background: linear-gradient(to bottom, var(--primary-text), #1a252f);
    padding: 60px 20px;
    text-align: center;
    border-top: 8px solid var(--accent-main);
    color: #fff;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: "🍀";
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-bg);
    padding: 10px 20px;
    border-radius: 50px;
    border: 3px solid var(--accent-main);
    font-size: 1.5rem;
}

footer p {
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 2px;
    opacity: 0.8;
}

/* --- Back to Top --- */
#back-to-top {
    position: fixed;
    bottom: 40px;
    left: 40px;
    width: 60px;
    height: 60px;
    background: var(--accent-main);
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(95, 164, 164, 0.3);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    transform: translateY(-8px) scale(1.1);
    background: var(--accent-dark);
}

/* --- Floating Fairy Sprite --- */
#fairy-sprite {
    position: fixed;
    bottom: 40px;
    right: 20px;
    width: 430px;
    height: auto;
    z-index: 10000;
    pointer-events: none;
    /* fadeInContentを追加し、既存のループアニメーションと共存させる */
    animation:
        fadeInContent 2s cubic-bezier(0.19, 1, 0.22, 1) forwards,
        fairyFloat 3s ease-in-out infinite alternate 1s,
        /* 少し遅れて浮遊開始 */
        fairyGlow 3.5s ease-in-out infinite alternate 1s;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8));
    opacity: 0;
    /* 最初は透明 */
    transition: transform 0.3s ease;
}

@keyframes fairyGlow {
    0% {
        filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.6)) brightness(1.0);
    }

    100% {
        filter: drop-shadow(0 0 35px rgba(255, 255, 255, 1)) brightness(1.25);
    }
}

#fairy-sprite img {
    width: 100%;
    height: auto;
}

/* --- Scroll Reveal Animations --- */
.reveal-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

@keyframes fairyFloat {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-30px);
    }
}

/* --- Global Fade In from White --- */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 99999;
    pointer-events: none;
    animation: fadeOutWhite 1.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

body>*:not(#page-loader):not(#fairy-sprite) {
    animation: fadeInContent 2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes fadeOutWhite {
    0% {
        opacity: 1;
    }

    40% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes fadeInContent {
    0% {
        opacity: 0;
        filter: blur(5px);
    }

    40% {
        opacity: 0;
    }

    100% {
        opacity: 1;
        filter: blur(0);
    }
}

/* --- Responsive Overhaul (Tablet Specific) --- */
@media (min-width: 601px) and (max-width: 1024px) {
    .glass-nav {
        padding: 15px 25px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .logo {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }

    .nav-links {
        gap: 15px;
    }

    .top-marquee {
        margin-top: 145px;
        /* Adjust for wrapped header */
        height: 50px;
    }

    .container {
        max-width: 90%;
        padding: 35px;
    }

    .sparkle-title {
        font-size: 3rem;
    }

    .catchphrase {
        font-size: 1.2rem;
    }

    /* Tablet-perfect Fairy Mascot scaling */
    #fairy-sprite {
        width: 280px;
        bottom: 40px;
        right: 10px;
        opacity: 0.9;
        /* Ensure it doesn't overlap key buttons too much */
        z-index: 5000;
    }

    .officer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* --- Responsive Overhaul (Mobile Specific) --- */
@media (max-width: 600px) {
    .glass-nav {
        padding: 15px;
        flex-direction: column;
        gap: 12px;
    }

    .logo {
        font-size: 1.3rem;
    }

    /* 横スクロール型のナビゲーションで見やすさを確保 */
    .nav-links {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        justify-content: flex-start;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
        gap: 10px;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links a {
        padding: 6px 12px;
        font-size: 0.85rem;
        background: var(--accent-light);
    }

    .cta-button {
        width: 100%;
        text-align: center;
        padding: 10px;
    }

    .top-marquee {
        margin-top: 210px;
        /* スタックされたヘッダー（お問い合わせボタン等）との重なりを完全に解消 */
        height: 50px;
        padding: 0;
        display: flex;
        align-items: center;
    }

    section {
        padding: 40px 15px;
    }

    .container {
        padding: 25px 20px;
        border-radius: 25px;
        border-width: 4px;
    }

    .sparkle-title {
        font-size: 2.2rem;
    }

    .catchphrase {
        font-size: 1rem;
        line-height: 1.5;
    }

    .pc-only-br {
        display: none;
    }

    .hero-btns {
        flex-direction: column;
        gap: 12px;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
    }

    #fairy-sprite {
        width: 140px;
        bottom: 5px;
        /* さらに下の方へ配置 */
        right: 0px;
        opacity: 0.85;
    }
}