:root {
    --primary-color: #8b0000; /* Dark Red for Kanreki */
    --accent-color: #d4af37;  /* Gold */
    --text-color: #333;
    --bg-color: #fcfcfc;
    --section-bg: #ffffff;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable; /* Reserve scrollbar space to prevent width shifting */
}

body {
    font-family: 'Noto Serif JP', serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.8;
    overflow-x: hidden;
}

/* Typography helper for clean Japanese wrapping on mobile */
.nobr {
    display: inline-block;
    white-space: nowrap;
}

/* ==========================================================================
   Cinematic Opening
   ========================================================================== */
.site-intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background-color: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* -- Removed old absolute skip btn styles -- */

.intro-prelude {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    z-index: 5;
    pointer-events: none;
    transition: opacity 2s ease;
}

.prelude-text {
    position: absolute;
    color: #fff;
    font-size: 1.8rem;
    font-family: 'Noto Serif JP', serif;
    letter-spacing: 0.2em;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 2.5s ease, transform 2.5s ease;
    text-align: center;
    width: 90%;
    line-height: 1.8;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
}

.prelude-text.show {
    opacity: 1;
    transform: scale(1);
}

/* Global Navigation */
.global-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10001; /* Show above site-intro */
}

.nav-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 5px 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* -- removed stealth-link header styles -- */

/* Sound Toggle Button & Skip Button Sizing */
.sound-toggle, .skip-intro-nav-btn {
    width: 115px;
    height: 38px;
    padding: 0;
    justify-content: center;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.3s;
    border: none;
    white-space: nowrap; /* Prevent wrapping under any circumstances */
}

.sound-toggle {
    background: var(--accent-color);
    gap: 4px;
    padding-right: 4px; /* Nudge content slightly left to visually center emoji + text */
}

.sound-toggle:hover {
    background: #e6c23b;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.sound-icon {
    font-size: 1.1rem;
}

/* Hamburger Icon */
.hamburger {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 101;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--primary-color);
    margin: 5px 0;
    transition: all 0.3s ease;
}

.nav-links {
    display: flex;
    justify-content: center;
    list-style: none;
    max-width: 800px;
    margin: 0 auto;
}

.nav-links li {
    flex: 1;
    text-align: center;
}

.nav-links a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
    transition: background 0.3s;
}

.nav-links a:hover {
    background: rgba(139, 0, 0, 0.05);
}

.nav-btn-wrapper {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 15px;
    align-items: center;
    z-index: 10002;
}

/* Skip Intro Button in Nav */
.skip-intro-nav-btn {
    background: #555;
    font-family: 'Noto Serif JP', serif;
}

.skip-intro-nav-btn:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

/* Top Hero Section (Fixed for Parallax) */
.hero {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1; /* Below content */
}

/* Slideshow Background */
.slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    opacity: 0;
    transform: scale(1);
    transition: none; /* No transition before intro finishes */
}

.slide.first-slide {
    background-position: center center;
}

body.start-anim .slide {
    /* When slide becomes inactive, it smoothly fades out over 2s.
       We delay the transform reset by 2s so it doesn't zoom out or snap while fading! */
    opacity: 0;
    transform: scale(1);
    transition: opacity 2s ease-in-out, transform 0s linear 2s;
}

body.start-anim .slide.active {
    opacity: 1;
    transform: scale(1.1);
    transition: opacity 2s ease-in-out, transform 15s ease-out; /* Smooth zoom in */
}

body.start-anim .slide.first-slide {
    /* We attach the animation to the slide itself (not just .active) 
       so it continues to run and doesn't snap while it fades out! */
    animation: firstPanZoom 15s forwards;
}

body.start-anim .slide.first-slide.active {
    opacity: 1;
}

@keyframes firstPanZoom {
    0% {
        transform: scale(1.3) translateY(12%);
        animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1); /* Smooth deceleration for the pan */
    }
    30% { /* Reached at 4.5 seconds */
        transform: scale(1.33) translateY(0);
        animation-timing-function: linear; /* Slow continuous zoom afterwards */
    }
    100% {
        transform: scale(1.4) translateY(0);
    }
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.8);
    margin-top: 50px;
    opacity: 0;
}

body.start-anim .hero-content {
    animation: fadeIn 2s ease-out forwards;
}

h1 {
    font-size: 3rem;
    letter-spacing: 0.15em;
    line-height: 1.5;
}

/* Scroll Down Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
}

body.start-anim .scroll-indicator {
    /* Fade in after the initial pan effect settles (4s delay) */
    animation: fadeInScrollIndicator 2s ease-out 4s forwards;
}

body.scrolled .scroll-indicator {
    opacity: 0 !important;
    transition: opacity 0.5s ease-out;
}

.scroll-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.7rem;
    letter-spacing: 0.4em;
    margin-bottom: 12px;
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.scroll-arrow {
    width: 1px;
    height: 35px;
    background: rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.scroll-arrow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 15px;
    background: #fff;
    box-shadow: 0 0 4px #fff;
    animation: scrollLine 2s infinite ease-in-out;
}

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

@keyframes scrollLine {
    0% {
        top: -15px;
    }
    60% {
        top: 35px;
    }
    100% {
        top: 35px;
    }
}

.highlight-red {
    color: #ff3333;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3), 0 0 10px rgba(255, 0, 0, 0.5);
}

/* Main Content Layout (Scrolls over Hero) */
.content {
    position: relative;
    z-index: 2;
    background: var(--bg-color);
    margin-top: 100vh; /* Push below the viewport for parallax */
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3); /* Shadow over hero */
}

.section {
    padding: 80px 20px;
    border-bottom: 1px solid #eee;
}

.section:nth-child(even) {
    background: #f7f7f7;
}

.section-inner {
    max-width: 800px;
    margin: 0 auto;
}

h2 {
    text-align: center;
    margin-bottom: 40px;
}

.font-ttl {
    font-family: 'Libre Baskerville', serif;
    font-size: 2.5rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 15px;
}

.font-ttl::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background-color: var(--accent-color);
}

/* Message Section */
.message-body {
    background: var(--section-bg);
    padding: 50px 40px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.message-p {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    line-height: 1.8;
}

.greeting {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.greeting.text-right {
    text-align: right;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.signature {
    margin-top: 40px;
    text-align: right;
}

/* Events Section */
.event-card {
    background: var(--section-bg);
    padding: 40px;
    border-top: 5px solid var(--primary-color);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.event-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.event-datetime {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #ccc;
}

.event-datetime .date {
    font-size: 2rem;
    font-family: 'Libre Baskerville', serif;
    color: var(--primary-color);
}

.event-datetime .day {
    font-size: 1.2rem;
}

.event-datetime .time {
    font-size: 1.2rem;
    margin-top: 10px;
}

.event-datetime .reception {
    font-size: 0.9rem;
    color: #666;
}

.event-place {
    margin-bottom: 40px;
}

.place-name {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.place-address, .place-tel {
    margin-bottom: 5px;
}

.place-url {
    display: inline-block;
    margin-top: 10px;
    margin-bottom: 20px;
    color: #0056b3;
    text-decoration: none;
    border-bottom: 1px solid #0056b3;
}

.map-wrapper {
    margin-top: 20px;
}

.map-link {
    margin-top: 10px;
    text-align: right;
}

.map-link a {
    color: #0056b3;
    font-size: 0.9rem;
}

.event-details h4 {
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 10px;
    border-left: 4px solid var(--accent-color);
    padding-left: 10px;
}

/* Countdown Section */
.goal-time {
    text-align: center;
    font-family: 'Libre Baskerville', serif;
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #555;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.time-block {
    text-align: center;
    background: var(--section-bg);
    padding: 20px;
    border-radius: 8px;
    min-width: 100px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
}

.time-block .number {
    display: block;
    font-family: 'Libre Baskerville', serif;
    font-size: 2.5rem;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 10px;
}

.time-block .label {
    font-size: 0.8rem;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* RSVP Section */
.section.rsvp-section {
    background: var(--primary-color);
    color: #fff;
    padding: 80px 20px;
}

.rsvp-section .font-ttl {
    color: #fff;
}

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

.rsvp-lead {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #fff;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.rsvp-deadline {
    font-size: 1rem;
    margin-bottom: 40px;
    color: #ffeb3b;
    font-weight: bold;
}

.cta-button {
    display: inline-block;
    background-color: #fff;
    color: var(--primary-color);
    padding: 20px 60px;
    text-decoration: none;
    border-radius: 40px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.3);
}

.cta-ja {
    display: block;
    font-size: 1.4rem;
    font-weight: bold;
}

.cta-en {
    display: block;
    font-size: 0.8rem;
    font-family: 'Libre Baskerville', serif;
    margin-top: 5px;
    color: #666;
}

/* Footer */
.global-footer {
    text-align: center;
    padding: 30px;
    background: #222;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.footer-copyright {
    margin-top: 20px;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: #888;
}

.stealth-link {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.stealth-link:hover {
    text-decoration: none;
    opacity: 0.8;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: #fff;
    text-align: center;
    line-height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.back-to-top:hover {
    background-color: #6a0000;
}

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

/* Mobile Adjustments */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .countdown-timer { flex-wrap: wrap; gap: 10px; }
    .time-block { min-width: 45%; padding: 15px; }
    .message-body { padding: 30px 20px; }
    
    /* Hamburger Menu Styles */
    .hamburger {
        display: block;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        border-top: 1px solid #eee;
    }

    .nav-links.active {
        display: flex;
    }
    
    .nav-header {
        position: relative; /* Establish positioning context for nav-btn-wrapper on mobile */
    }

    .nav-links li {
        width: 100%;
    }
    
    .nav-links a {
        padding: 15px;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-btn-wrapper {
        position: absolute;
        right: 70px; /* Position to the left of the hamburger button */
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        gap: 8px;
        z-index: 10002;
    }
    
    .sound-toggle, .skip-intro-nav-btn {
        width: 85px;
        height: 30px;
        font-size: 0.65rem; /* Shrunk slightly to ensure BGM OFF fits on a single line */
        letter-spacing: -0.02em;
    }

    .sound-toggle {
        gap: 3px;
        padding-right: 2px; /* Centers emoji + text nicely on mobile */
    }

    .sound-icon {
        font-size: 0.85rem;
    }
    
    .skip-intro-nav-btn {
        position: static;
        left: auto;
        top: auto;
    }
}
