:root {
    --bg-color: #FDFBF7;
    --bg-alt-color: #F7F3EB;
    --text-primary: #2C3E50;
    --text-secondary: #5D6D7E;
    --accent-red: #E74C3C;
    --accent-blue: #3498DB;
    --accent-yellow: #F1C40F;
    --accent-green: #2ECC71;
    --font-serif: 'Sawarabi Mincho', serif;
    --font-sans: 'Noto Sans JP', sans-serif;
    --font-rounded: 'M PLUS Rounded 1c', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    background-image: 
        radial-gradient(circle at 2px 2px, rgba(0,0,0,0.02) 1px, transparent 0);
    background-size: 40px 40px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 30px;
}

.section-padding {
    padding: 100px 0;
}

.bg-alt {
    background-color: var(--bg-alt-color);
}

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

/* Header */
.main-header {
    background-color: rgba(253, 251, 247, 0.95);
    padding: 15px 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    backdrop-filter: blur(5px);
}

.header-inner {
    padding: 0 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    height: 36px;
    width: auto;
}

.header-text-group {
    display: flex;
    flex-direction: column;
}

.school-name {
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    line-height: 1.2;
}

.project-tag {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.1em;
}

/* Moving Bus Track */
.decorative-bus-track {
    position: fixed;
    bottom: 20px;
    left: 0;
    width: 100%;
    height: 60px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.8;
}

.moving-bus {
    height: 120px; /* Changed from 90px */
    width: auto;
    position: absolute;
    right: -300px; /* Start from right for reversed motion */
    transition: right 0.1s linear, filter 0.3s ease; /* Added filter to transition */
    object-fit: contain;
    top: 50%; /* New property */
    transform: translateY(-50%) scaleX(-1); /* Modified transform */
    border-radius: 4px;
    background-color: transparent;
    padding: 0;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.15));
    cursor: pointer; /* New property */
}

.moving-bus:hover {
    filter: brightness(1.1) drop-shadow(0 0 10px rgba(241, 196, 15, 0.5));
}

/* Hero Section */
.hero {
    min-height: 120vh; /* Increased to fit the large photo */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 0;
    text-align: center;
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(241, 196, 15, 0.1) 0%, transparent 70%);
}

.hero-main-title {
    font-family: var(--font-serif);
    font-size: 52px; /* Slightly larger */
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    margin-bottom: 60px;
}

.hero-photo-area {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    position: relative; /* For emblem positioning */
}

/* 70th Anniversary Emblem */
.anniversary-emblem-container {
    position: absolute;
    top: -20px;
    right: -30px;
    z-index: 10;
}

.emblem-70th {
    background: var(--accent-yellow);
    color: var(--text-primary);
    padding: 15px;
    border-radius: 50%;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-weight: 700;
    font-size: 14px;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    animation: float 3s ease-in-out infinite;
    line-height: 1.2;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.album-style {
    background-color: #fff;
    padding: 15px 15px 60px 15px; /* Polaroid/Album look */
    box-shadow: 0 40px 100px rgba(0,0,0,0.1);
    border-radius: 2px;
    transform: rotate(1.5deg);
    transition: transform 1.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.main-photo {
    width: 100%;
    height: auto;
    display: block;
    filter: sepia(1) grayscale(0.3) brightness(0.9);
    transition: filter 2.5s ease;
}

.main-photo.colored {
    filter: none;
}

.reveal-on-scroll.active .album-style {
    transform: rotate(0deg);
}

/* Message Section */
.message-card {
    background-color: #fff;
    padding: 80px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
}

.message-card::before {
    content: '✿';
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 40px;
    color: var(--accent-red);
    opacity: 0.1;
}

.message-card::after {
    content: '✿';
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 40px;
    color: var(--accent-blue);
    opacity: 0.1;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 28px;
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 1px;
    background-color: var(--accent-red);
}

.message-body {
    font-family: var(--font-rounded);
    text-align: center;
    font-size: 21px;
    line-height: 2.2;
    letter-spacing: 0.05em;
    color: #333;
    max-width: 650px;
    margin: 0 auto;
}

.message-body p {
    margin-bottom: 45px;
}

/* Group Photo */
.photo-frame {
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.06);
    border-radius: 4px;
    position: relative;
    transform: rotate(-1deg);
    transition: transform 1s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal-on-scroll.active .photo-frame {
    transform: rotate(0deg);
}

.main-photo {
    width: 100%;
    height: auto;
    display: block;
    filter: brightness(1.05);
}

/* Bus Decorations */
.bus-decoration {
    margin-top: 50px;
    display: flex;
    justify-content: center;
}

.mini-bus {
    width: 220px;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.1));
    animation: simpleFloat 3s ease-in-out infinite;
}

@keyframes simpleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Ending Sections */
.today-text, .cs-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.cs-title {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Footer */
.main-footer {
    padding: 60px 0;
    text-align: center;
    background-color: var(--bg-alt-color);
}

.footer-message {
    font-family: var(--font-serif);
    font-size: 18px;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.footer-info {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Decorations & Motifs */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

.decoration-motifs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
}

.motif {
    position: absolute;
    font-size: 24px;
    opacity: 0.1; /* Lowered opacity to not interfere with reading */
    user-select: none;
    animation: drift 15s linear infinite;
    filter: blur(0.5px); /* Soften the look */
}

.motif-flower-2 { top: 25%; right: 15%; color: var(--accent-red); animation-delay: -3s; font-size: 28px; }
.motif-flower-3 { top: 60%; left: 12%; color: var(--accent-yellow); animation-delay: -7s; font-size: 24px; }
.motif-flower-4 { top: 80%; right: 20%; color: var(--accent-green); animation-delay: -1s; font-size: 22px; }
.motif-star-3 { top: 10%; left: 80%; color: var(--accent-yellow); animation-delay: -4s; font-size: 20px; }
.motif-flower-5 { top: 45%; left: 5%; color: var(--accent-blue); animation-delay: -9s; font-size: 32px; opacity: 0.08; }

@keyframes drift {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(25px, 30px) rotate(15deg); }
    66% { transform: translate(-15px, 50px) rotate(-10deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes sway {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    50% { transform: translateX(20px) rotate(20deg); }
}

@keyframes petal-fall {
    0% { transform: translateY(-10vh) translateX(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(110vh) translateX(50px) rotate(360deg); opacity: 0; }
}

.dynamic-petal {
    position: fixed;
    top: -50px;
    z-index: 40;
    pointer-events: none;
    animation: petal-fall 12s linear infinite;
    font-size: 20px;
    opacity: 0.05; /* Even thinner as requested */
    filter: blur(0.2px);
}

.petal-red { color: var(--accent-red); }
.petal-blue { color: var(--accent-blue); }
.petal-yellow { color: var(--accent-yellow); }
.petal-pink { color: #FFB7C5; }
.petal-green { color: var(--accent-green); }

@keyframes drift-crayon {
    0% { transform: translate(0, 0) rotate(-15deg); }
    50% { transform: translate(25px, -15px) rotate(-10deg); }
    100% { transform: translate(0, 0) rotate(-15deg); }
}

/* Marker Highlights */
.marker {
    background: linear-gradient(transparent 60%, rgba(241, 196, 15, 0.3) 0%);
    display: inline-block;
    padding: 0 4px;
    position: relative;
}

.marker::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 0;
    height: 40%;
    background-color: rgba(241, 196, 15, 0.4);
    z-index: -1;
    transition: width 1s cubic-bezier(0.19, 1, 0.22, 1);
}

.message-body.active .marker::after {
    width: 100%;
}

.message-body.active .marker:nth-of-type(1)::after { transition-delay: 0.8s; }
.message-body.active .marker:nth-of-type(2)::after { transition-delay: 1.2s; }

/* Enhanced Interactions */
.header-logo:hover {
    animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

/* Footer Accent */
.footer-message::before {
    content: '❤︎';
    display: block;
    font-size: 14px;
    color: var(--accent-red);
    margin-bottom: 10px;
    animation: heartBeat 2s infinite;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}
/* Magic Intro Styles */
.magic-intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fdfaf5;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 1s ease, visibility 1s ease;
}

.magic-intro.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-bus-container {
    position: relative;
    width: 80%;
    max-width: 600px;
    margin-bottom: 50px;
}

.intro-bus-image {
    width: 100%;
    height: auto;
    object-fit: contain; /* Prevents zooming/cropping on narrow screens */
    filter: grayscale(1) brightness(0.9) opacity(0.7);
    transition: filter 0.8s ease, opacity 0.8s ease;
}

.intro-bus-image.wrapped {
    filter: none;
    opacity: 1;
}

#intro-bus {
    cursor: pointer; /* Bus itself is now a trigger */
}

#sparkle-canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.magic-button {
    background: #FFB7C5; /* Cute Pastel Pink */
    color: #fff;
    border: 4px solid #fff;
    padding: 25px 50px;
    border-radius: 60px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(255, 183, 197, 0.4);
    animation: magic-float 3s ease-in-out infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.magic-button:hover {
    transform: scale(1.1) rotate(2deg);
    background: #ffc2cf;
}

.magic-button:active {
    transform: scale(0.95);
}

.magic-btn-text {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-weight: 700;
    font-size: 28px;
    letter-spacing: 0.08em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@keyframes magic-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes magic-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 10px 25px rgba(255, 183, 197, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 15px 35px rgba(255, 183, 197, 0.6); }
}

.site-hidden {
    opacity: 0;
    transition: opacity 1.5s ease;
}

.site-visible {
    opacity: 1;
}

/* Bus Modal */
.bus-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000; /* Extremely high to cover everything */
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.4s ease;
    backdrop-filter: blur(8px);
    pointer-events: none; /* Prevent interaction when hidden */
}

.bus-modal.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto;
}

.modal-content {
    background: #fff;
    padding: 50px 30px;
    border-radius: 30px;
    max-width: 500px;
    width: 85%;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 70px rgba(0,0,0,0.3);
    border: 6px solid var(--accent-yellow);
    transform: scale(0.8) translateY(20px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bus-modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: #f0f0f0;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-title {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    color: var(--accent-red);
    font-size: 28px;
    margin-bottom: 15px;
}

.modal-text {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-primary);
}

.modal-decoration {
    font-size: 40px;
    margin-top: 30px;
}
/* Footer Logo Accent */
.f-kinder {
    position: relative;
    font-weight: 700;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.5s ease, transform 1.5s ease;
}

.reveal-on-scroll {
    opacity: 0;
    transform: scale(0.98);
    filter: blur(5px);
    transition: all 2s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal-on-scroll.active,
.fade-in.active,
.section-title.active,
.today-text.active,
.cs-title.active,
.cs-text.active,
.message-body.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.section-title,
.today-text,
.cs-title,
.cs-text {
    opacity: 0;
    transform: translateY(20px);
    transition: all 1.2s ease-out;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 0 20px;
    }
    .hero-main-title {
        font-size: 34px;
        line-height: 1.4;
    }
    .section-title {
        font-size: 26px;
    }
    .message-body {
        font-size: 19px;
        line-height: 2.0;
    }
    /* Restoring line breaks for rhythm */
    .hero-main-title br, .message-body br, .today-text br, .cs-text br {
        display: block;
    }
    .moving-bus {
        height: 80px; /* Smaller bus for mobile */
    }
}
