@font-face {
    font-family: 'Alistair Signature';
    src: url('Alistair Signature.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

:root {
    --bg-dark: #000000;
    --bg-surface: #000000;
    --text-primary: #e0e0e0;
    --text-muted: #888888;
    --bg-accent: #111111;

    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'Inter', sans-serif;
    --font-script: 'Alistair Signature', cursive;

    /* Typographic System */
    --size-h1: clamp(4rem, 15vw, 7.5rem);
    --size-h2: 2.8rem;
    --size-h3: 1.25rem;
    --size-body: 1.05rem;
}

html {
    overflow-x: clip;
    max-width: 100%;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    overflow-x: clip;
    max-width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-font-smoothing: antialiased;
}
@media (min-width: 501px) {
    body {
        max-width: 820px; /* Widened desktop layout */
        margin: 0 auto;
        box-shadow: 0 0 100px rgba(0,0,0,0.5);
        position: relative;
        background: #000;
    }
    html {
        background: #111;
    }
}

/* Hide scrollbars for iframe realism */
::-webkit-scrollbar {
    display: none;
}

section {
    background-color: var(--bg-dark); /* Ensure uniform background for all sections */
    overflow-x: hidden;
    max-width: 100%;
}

/* Typography Basics */
.serif-title {
    font-family: var(--font-serif);
    font-weight: 300;
    font-size: var(--size-h2);
    line-height: 1.1;
    margin-bottom: 2.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.body-text, .story-para, .info-text {
    font-family: var(--font-sans);
    font-size: var(--size-body);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 300;
    line-height: 1.8;
}

.mono-subtitle {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem; /* Reduced from 3.5rem */
}

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

/* Animation Reveal Mechanism */
.reveal-item {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(8px);
    transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1.4s cubic-bezier(0.16, 1, 0.3, 1),
                filter 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity, filter;
}

.reveal-item.revealed {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* 1. Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background-color: #000;
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.2) 0%,
            rgba(0, 0, 0, 0.5) 50%,
            rgba(10, 10, 10, 0.8) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4rem;
}

/* Names Styling */
.hero-names {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-name {
    font-family: var(--font-serif);
    font-size: clamp(4rem, 15vw, 7.5rem);
    font-weight: 200;
    line-height: 0.8;
    letter-spacing: 0.05em;
    color: #fff;
    margin: 0;
}

.hero-and {
    font-family: var(--font-script);
    font-size: clamp(2rem, 6vw, 3.5rem);
    color: #fff;
    margin: -1.5rem 0;
    z-index: 2;
    transform: rotate(-5deg);
}

/* Date Styling */
.hero-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.date-month,
.date-year {
    font-size: 0.85rem;
    letter-spacing: 0.4em;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 300;
}

.date-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
}

.date-line {
    display: none;
}

.date-day-name,
.date-time {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: #fff;
    white-space: nowrap;
}

.date-day-num {
    font-family: var(--font-serif);
    font-size: 3rem;
    color: #fff;
    line-height: 1;
}

/* Venue Styling */
.hero-venue {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.venue-name {
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    color: #fff;
}

.venue-city {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.6);
}

.enter-btn {
    display: inline-block;
    padding: 1.1rem 3.5rem;
    border: 0.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 100px;
    color: #fff;
    text-decoration: none;
    font-size: 0.65rem;
    letter-spacing: 0.4em;
    margin-top: 2.5rem;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
    animation: btnPulse 4s infinite ease-in-out;
}

.enter-btn:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
    transform: scale(1.05);
    box-shadow: 0 10px 40px rgba(255, 255, 255, 0.15);
}

@keyframes btnPulse {

    0%,
    100% {
        border-color: rgba(255, 255, 255, 0.2);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
        transform: scale(1);
    }

    50% {
        border-color: rgba(255, 255, 255, 0.5);
        box-shadow: 0 0 25px 0 rgba(255, 255, 255, 0.1);
        transform: scale(1.03);
    }
}

/* 2. Story Section */
.story-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    padding-top: 8rem;
    padding-bottom: 8rem;
}

.photo-lace-frame {
    position: relative;
    width: 280px;
    height: auto;
    margin: 0 auto 1.5rem; /* Reduced from 3rem */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease-out;
    transform-style: preserve-3d;
    filter: drop-shadow(0 0 30px rgba(184, 158, 111, 0.2));
    animation: gold-radiance 6s ease-in-out infinite;
}

.photo-lace-frame::before,
.photo-lace-frame::after {
    display: none;
}

.story-main-img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}

@keyframes gold-radiance {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(184, 158, 111, 0.15)); }
    50% { filter: drop-shadow(0 0 50px rgba(184, 158, 111, 0.35)); }
}

.story-content-box {
    max-width: 550px;
    margin: 0 auto;
}

.story-para {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5; /* Reduced line-height */
    margin-bottom: 2rem;
    font-weight: 300;
}

.story-signature {
    margin-top: 1rem; /* Reduced from 2rem */
}

.sig-with-love {
    font-family: var(--font-serif); /* Changed to Cormorant */
    font-size: 1.8rem;
    font-style: italic; /* Added italic for a signature feel in serif */
    letter-spacing: 0.1em;
    color: #fff;
    margin-bottom: 0.5rem;
}

.sig-names {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    letter-spacing: 0.2em;
    color: #fff;
    font-weight: 200;
}

/* 2.5 Countdown Section */
.countdown-section {
    position: relative;
    padding: 6rem 0;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: inset(0); /* Crucial for clipping the fixed background */
    z-index: 1;
}

.countdown-section::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('2.webp');
    background-size: cover;
    background-position: center;
    z-index: -1;
    pointer-events: none;
}

.relative {
    position: relative;
    z-index: 2;
}

.white {
    color: #fff !important;
}

.script-small {
    font-family: var(--font-script);
    font-size: 2.5rem;
    color: #fff;
    display: block;
    margin-bottom: -1rem;
    opacity: 0.8;
}

.countdown-grid {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 1.5rem;
    margin-top: 4rem;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.count-num {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    color: #fff;
    line-height: 1;
    font-weight: 200;
}

.count-label {
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 1rem;
    font-weight: 300;
}

.countdown-sep {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.3);
    padding-top: 0.5rem;
}

@media (max-width: 768px) {
    .countdown-section {
        padding: 6rem 0;
        min-height: auto;
    }
    .countdown-grid {
        gap: 0.8rem;
    }
    .countdown-item {
        min-width: 60px;
    }
    .countdown-sep {
        font-size: 1.5rem;
        gap: 0.5rem;
    }
}

/* 3. Event Details */
.order-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem; /* Reduced from 6rem */
}

.order-title {
    font-family: var(--font-serif);
    font-size: var(--size-h2);
    font-weight: 200;
    letter-spacing: 0.1em;
    line-height: 1;
    color: #fff;
    text-transform: uppercase;
}

.order-script {
    font-family: var(--font-script);
    font-size: 2.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin: -0.5rem 0;
    transform: rotate(-3deg);
}

.timeline-v-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4rem;
    position: relative;
    max-width: 320px;
    margin: 0 auto;
    padding-left: 2.5rem;
}

/* The vertical dotted line */
.timeline-v-list::before {
    display: none;
}

.timeline-v-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.2rem;
    width: 100%;
    position: relative;
}

/* Individual gold dot marker */
.timeline-v-item::before {
    content: '';
    position: absolute;
    left: -2.5rem;
    top: 15px;
    width: 8px;
    height: 8px;
    background-color: #b89e6f;
    border-radius: 50%;
    transform: translateX(-50%) scale(0);
    box-shadow: 0 0 15px #b89e6f;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
}

.timeline-v-item.revealed::before {
    transform: translateX(-50%) scale(1);
    box-shadow: 0 0 25px rgba(184, 158, 111, 0.6);
}

.time-box {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 200;
    color: #fff;
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
}

.event-name {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    letter-spacing: 0.25em;
    color: rgba(255,255,255,0.7);
    text-align: left;
    font-weight: 300;
    text-transform: uppercase;
}

/* Unique Staggered Animation for Timeline */
.timeline-v-item.reveal-item {
    opacity: 0;
    transform: perspective(1000px) rotateX(-80deg) translateY(100px) scale(0.9);
    filter: blur(20px);
    transform-origin: top;
    transition: all 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-v-item.reveal-item.revealed {
    opacity: 1;
    transform: perspective(1000px) rotateX(0deg) translateY(0) scale(1);
    filter: blur(0);
}

@media (max-width: 768px) {
    .timeline-v-item {
        gap: 0.3rem;
    }
    .time-box {
        font-size: 2.2rem;
    }
    .event-name {
        font-size: 0.9rem;
    }
}

/* 3.5 Date & Location Standalone */
.location-standalone-section {
    padding: 2rem 0; /* Reduced from 4rem */
    background-color: var(--bg-dark);
}

.location-details {
    margin-bottom: 3rem;
}

.loc-date {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.loc-time {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    letter-spacing: 0.3em;
    color: rgba(255, 255, 255, 0.6);
}

.venue-gallery-stack {
    position: relative;
    width: 280px;
    height: 380px;
    margin: 3rem auto 6rem; /* Increased bottom margin specifically to prevent overlap with hint */
    perspective: 1500px;
    cursor: pointer;
}

.gallery-card {
    position: absolute;
    inset: 0;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.4);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
    background: #111;
    transform-origin: center center;
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.9) contrast(1.1);
}

/* Stacked Positions */
.card-1 { transform: rotate(-6deg) translateZ(0); z-index: 3; }
.card-2 { transform: rotate(3deg) translateZ(-50px); z-index: 2; opacity: 0.9; }
.card-3 { transform: rotate(8deg) translateZ(-100px); z-index: 1; opacity: 0.8; }

/* Spread / Fan-out State */
.venue-gallery-stack.is-spread .card-1 { transform: translateX(-150px) rotate(-8deg) translateZ(0); }
.venue-gallery-stack.is-spread .card-2 { transform: translateX(0) rotate(0deg) translateZ(0); opacity: 1; }
.venue-gallery-stack.is-spread .card-3 { transform: translateX(150px) rotate(8deg) translateZ(0); opacity: 1; }

/* Active (Foreground) State */
.gallery-card.is-active {
    z-index: 20 !important;
    transform: translateX(0) rotate(0deg) translateZ(200px) scale(1.1) !important;
    opacity: 1 !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    filter: brightness(1.1);
}

/* Offset other cards when one is active to create space */
.venue-gallery-stack.is-spread:has(.is-active) .gallery-card:not(.is-active) {
    opacity: 0.4;
    filter: blur(4px) brightness(0.6);
    transform: scale(0.9) !important;
}

.gallery-overlay {
    position: absolute;
    bottom: -4rem;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    z-index: 10;
    transition: opacity 0.5s ease;
}

.is-spread .gallery-overlay {
    opacity: 0;
    pointer-events: none;
}

.tap-hint {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .venue-gallery-stack {
        width: 220px;
        height: 300px;
    }
    .venue-gallery-stack.is-spread .card-1 { transform: translateY(-40px) rotate(-5deg) translateZ(20px); }
    .venue-gallery-stack.is-spread .card-2 { transform: translateY(0) rotate(0deg) translateZ(40px); }
    .venue-gallery-stack.is-spread .card-3 { transform: translateY(40px) rotate(5deg) translateZ(20px); }
}

.venue-info {
    margin-bottom: 2rem; /* Reduced from 4rem for better flow to the button */
}

.venue-title {
    font-family: var(--font-serif);
    font-size: var(--size-h2);
    font-weight: 300;
    letter-spacing: 0.1em;
    color: #fff;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.venue-address {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
}

.venue-desc {
    font-size: 0.85rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.05em;
}

.map-btn {
    display: inline-block;
    padding: 1.1rem 3.5rem;
    border: 0.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 100px;
    color: #fff;
    text-decoration: none;
    font-size: 0.75rem;
    letter-spacing: 0.2rem;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 1rem; /* Reduced from 1.5rem */
}

.map-btn:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

@media (max-width: 768px) {
    .venue-image-wrapper {
        max-width: 280px;
        border-radius: 30px;
    }
    .venue-title {
        font-size: 2rem;
    }
}


/* 4. Additional Information */
.additional-info-section {
    padding: 2rem 0 0; /* Reduced from 4rem */
    background-color: var(--bg-dark);
}

.additional-title-mix {
    margin-bottom: 2.5rem;
    line-height: 0.9;
}

.additional-title-mix .serif-label {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    /* Reduced from 2.2rem to be more delicate */
    letter-spacing: 0.15em;
    font-weight: 300;
    color: var(--text-primary);
    display: block;
}

.additional-title-mix .script-label {
    font-family: var(--font-script);
    font-size: 3.2rem;
    /* Reduced from 4.8rem to match user preference for smaller text */
    color: #fff;
    display: block;
    margin-top: -0.8rem;
    text-transform: none;
    font-weight: normal;
}

.info-block {
    margin-bottom: 4rem; /* Reduced from 6rem */
}

.info-title {
    font-family: var(--font-serif);
    font-size: var(--size-h3);
    letter-spacing: 0.3em;
    color: #fff;
    margin-bottom: 1.5rem;
    font-weight: 300;
    text-transform: uppercase;
}

.info-text {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    font-weight: 300;
}

.color-palette {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.swatch {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.swatch:hover {
    transform: scale(1.1);
}

.registry-btn {
    display: inline-block;
    padding: 1.1rem 3.5rem;
    border: 0.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 100px;
    color: #fff;
    text-decoration: none;
    font-family: var(--font-serif);
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 1rem;
}

.registry-btn:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.footer-contacts p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.footer-sticker {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.sticker-img {
    width: 100px;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
    transition: transform 0.1s ease-out; /* Match script responsiveness */
    cursor: pointer;
}

.footer-sig {
    margin-bottom: 2rem;
}

.sig-script {
    font-family: var(--font-script);
    font-size: 1.8rem;
    color: #fff;
}

.sig-serif {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    color: #fff;
    font-weight: 300;
}

@media (max-width: 768px) {
    .info-title {
        font-size: 1.3rem;
    }
    .color-palette {
        gap: 1rem;
    }
    .swatch {
        width: 35px;
        height: 35px;
    }
}

.footer-contact {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 4rem 1.5rem;
    }

    .hero-title {
        font-size: 4rem;
    }

    .serif-title {
        font-size: 2.5rem;
    }

    .grid-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .timeline-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

/* Extra Narrow Responsive for Mockups & Small Devices */
@media (max-width: 380px) {
    .container {
        padding: 3rem 1rem;
    }

    .hero-name {
        font-size: clamp(2.5rem, 11vw, 4rem);
    }

    .hero-and {
        font-size: 1.5rem;
        margin: -0.8rem 0;
    }

    .hero-content {
        padding: 1rem;
        gap: 1.5rem;
    }

    .count-num {
        font-size: 1.8rem;
    }

    .countdown-grid {
        gap: 0.3rem;
    }

    .countdown-item {
        min-width: 40px;
    }

    .countdown-sep {
        font-size: 1rem;
    }

    .serif-title {
        font-size: 1.8rem !important;
        letter-spacing: 0.05em !important;
    }

    .order-title {
        font-size: 1.8rem !important;
        letter-spacing: 0.1em !important;
    }
    
    .photo-lace-frame {
        width: 180px;
    }

    .info-title {
        font-size: 1.1rem;
    }
}

/* Audio Player Toggle */
.audio-toggle-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    z-index: 9999;
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(184, 158, 111, 0.4);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.audio-toggle-btn:hover {
    transform: scale(1.1);
    border-color: rgba(184, 158, 111, 1);
}

.audio-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

/* Vinyl rotation animation when playing */
.audio-toggle-btn.playing .audio-icon {
    animation: vinyl-spin 10s linear infinite;
}

@keyframes vinyl-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .audio-toggle-btn {
        top: 1rem;
        right: 1.5rem;
        width: 50px;
        height: 50px;
    }
}
