/* ============================================
   Wedding Invitation — Style
   Color palette:
     cream:      #fbf6ec
     gold/tan:   #c4b5a0
     brown:      #9a8b78
     rust:       #8b5e3c
     warm brown: #8a7d6b
   ============================================ */

/* --- Custom Font --- */
@font-face {
    font-family: 'Eskal';
    src: url('../assets/fonts/Eskal.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    background-color: #fbf6ec;
    color: #9a8b78;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Preloader --- */
#preloader {
    position: fixed;
    inset: 0;
    background: #fbf6ec;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

#preloader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(196, 181, 160, 0.2);
    border-top-color: #c4b5a0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Envelope Overlay --- */
.envelope {
    position: fixed;
    inset: 0;
    background: #fbf6ec;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.envelope.closing {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

.envelope.hidden {
    display: none;
}

.envelope-content {
    text-align: center;
    padding: 40px 30px;
    max-width: 400px;
    width: 100%;
    animation: fadeInUp 0.8s ease 0.3s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.envelope-ornament {
    margin: 0 auto 20px;
    width: 200px;
    opacity: 0.7;
}

.envelope-ornament.bottom {
    margin: 20px auto 30px;
}

.envelope-label {
    font-family: 'Raleway', sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #c4b5a0;
    margin-bottom: 6px;
}

.envelope-to,
.envelope-from {
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px;
    font-weight: 400;
    font-style: italic;
    color: #9a8b78;
    margin-bottom: 10px;
}

.envelope-divider {
    width: 120px;
    margin: 20px auto;
    opacity: 0.5;
}

.envelope-btn {
    display: inline-block;
    padding: 14px 40px;
    font-family: 'Raleway', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fbf6ec;
    background-color: #c4b5a0;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.envelope-btn:hover {
    background-color: #9e9268;
    transform: scale(1.03);
}

.envelope-btn:active {
    transform: scale(0.98);
}

/* --- Audio Controls --- */
.audio-controls {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 500;
    transition: opacity 0.4s ease;
}

.audio-controls.hidden {
    opacity: 0;
    pointer-events: none;
}

.audio-controls.visible {
    opacity: 1;
    pointer-events: auto;
}

.audio-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #c4b5a0;
    background: rgba(251, 246, 236, 0.9);
    color: #c4b5a0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    backdrop-filter: blur(8px);
}

.audio-btn:hover {
    background: rgba(196, 181, 160, 0.15);
}

.audio-btn .hidden {
    display: none;
}

/* --- Main Content --- */
.main-content {
    padding: 0 16px;
    max-width: 100%;
    overflow-x: hidden;
    transition: opacity 0.6s ease;
}

.main-content.hidden {
    display: none;
}

.main-content.visible {
    display: block;
    animation: fadeIn 0.8s ease both;
}

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

/* --- Sections --- */
.section {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.section:first-child {
    padding-top: 40px;
}

.section:last-child {
    padding-bottom: 60px;
}

/* --- Cards --- */
.card {
    background: #fbf6ec;
    border-radius: 20px;
    padding: 50px 35px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 2px 20px rgba(66, 45, 28, 0.06);
    border: 1px solid rgba(196, 181, 160, 0.15);
}

.card-accent {
    background: #9a8b78;
    color: #fbf6ec;
    border-color: transparent;
}

.card-accent .text-divider::after {
    background-color: rgba(196, 181, 160, 0.5);
}

.card-accent .section-title {
    color: #fbf6ec;
}

/* --- Ornaments --- */
.ornament-header,
.ornament-footer {
    width: 220px;
    margin: 0 auto 25px;
    opacity: 0.6;
}

.ornament-footer {
    margin: 25px auto 0;
}

/* --- Text Dividers --- */
.text-divider {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.text-divider::after {
    content: '';
    display: block;
    width: 50px;
    height: 1px;
    background-color: rgba(196, 181, 160, 0.6);
}

.text-divider.small::after {
    width: 30px;
}

/* --- Section: Welcome --- */
.section-subtitle {
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #c4b5a0;
    margin-bottom: 8px;
}

.guest-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 40px;
    font-weight: 500;
    font-style: italic;
    color: #9a8b78;
    margin-bottom: 5px;
}

.section-text {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.7;
    color: #7a6e5c;
}

.card-accent .section-subtitle {
    color: rgba(251, 246, 236, 0.7);
}

.card-accent .guest-name {
    color: #fbf6ec;
}

.card-accent .section-text {
    color: rgba(251, 246, 236, 0.9);
}

/* --- Section: Couple --- */
.couple-photo-placeholder {
    margin-bottom: 25px;
}

.photo-frame {
    width: 100%;
    max-width: 360px;
    height: 240px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
}

.photo-placeholder-inner {
    width: 100%;
    height: 100%;
    background: rgba(196, 181, 160, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Raleway', sans-serif;
    font-size: 12px;
    letter-spacing: 2px;
    color: #c4b5a0;
    text-transform: uppercase;
}

.couple-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.couple-names {
    font-family: 'Great Vibes', cursive;
    font-weight: 400;
    font-size: 42px;
    letter-spacing: 1px;
    color: #9a8b78;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.couple-names .name:first-child {
    align-self: flex-start;
    margin-left: 15%;
}

.couple-names .name:last-child {
    align-self: flex-end;
    margin-right: 15%;
}

.couple-names .amp {
    font-family: 'Great Vibes', cursive;
    font-style: normal;
    font-weight: 400;
    font-size: 34px;
    color: #c4b5a0;
}

.couple-text {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.7;
    color: #7a6e5c;
}

.card-accent .couple-names {
    color: #fbf6ec;
}

.card-accent .couple-text {
    color: rgba(251, 246, 236, 0.9);
}

/* --- Section: Date --- */
.date-label {
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #c4b5a0;
    margin-bottom: 25px;
}

.date-display {
    margin-bottom: 10px;
}

.date-big {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.date-day {
    font-family: 'Cormorant SC', serif;
    font-size: 80px;
    font-weight: 300;
    line-height: 1;
    color: #9a8b78;
}

.date-month-year {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.date-month {
    font-family: 'Cormorant Garamond', serif;
    font-size: 30px;
    font-weight: 400;
    font-style: italic;
    color: #9a8b78;
}

.date-year {
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 4px;
    color: #c4b5a0;
}

.date-weekday {
    font-family: 'Raleway', sans-serif;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #c4b5a0;
    margin-bottom: 10px;
}

/* --- Countdown --- */
.countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

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

.countdown-number {
    font-family: 'Cormorant SC', serif;
    font-size: 36px;
    font-weight: 400;
    color: #9a8b78;
    line-height: 1.2;
}

.countdown-label {
    font-family: 'Raleway', sans-serif;
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #c4b5a0;
}

.countdown-separator {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-weight: 300;
    color: #c4b5a0;
    margin-bottom: 16px;
}

.card-accent .date-label {
    color: rgba(251, 246, 236, 0.7);
}

.card-accent .date-day,
.card-accent .date-month {
    color: #fbf6ec;
}

.card-accent .date-year,
.card-accent .date-weekday {
    color: rgba(251, 246, 236, 0.7);
}

.card-accent .countdown-number {
    color: #fbf6ec;
}

.card-accent .countdown-label,
.card-accent .countdown-separator {
    color: rgba(251, 246, 236, 0.6);
}

/* --- Section: Schedule --- */
.section-title {
    font-family: 'Cormorant SC', serif;
    font-size: 32px;
    font-weight: 400;
    letter-spacing: 1px;
    color: #9a8b78;
}

.timeline {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.timeline-item {
    display: flex;
    align-items: center;
    padding: 14px 0;
    position: relative;
    width: 100%;
}

.timeline-time {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 400;
    color: #c4b5a0;
    width: 55px;
    text-align: right;
    flex-shrink: 0;
}

.timeline-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #c4b5a0;
    flex-shrink: 0;
    margin: 0 14px;
    position: relative;
    z-index: 1;
}

.timeline-content {
    text-align: left;
}

.timeline-content h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 21px;
    font-weight: 600;
    color: #9a8b78;
    margin-bottom: 3px;
}

.timeline-content p {
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #7a6e5c;
    letter-spacing: 0.5px;
}

.card-accent .timeline-content h3 {
    color: #fbf6ec;
}

.card-accent .timeline-content p {
    color: rgba(251, 246, 236, 0.75);
}

/* --- Section: Venue --- */
.venue-photo-placeholder {
    width: 100%;
    height: 200px;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid rgba(196, 181, 160, 0.2);
}

.venue-photo-placeholder .photo-placeholder-inner {
    font-size: 11px;
}

.venue-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.venue-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-weight: 400;
    color: #9a8b78;
    margin-bottom: 6px;
}

.venue-address {
    font-family: 'Raleway', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #7a6e5c;
    margin-bottom: 16px;
    line-height: 1.5;
}

.venue-map-link {
    font-family: 'Raleway', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #c4b5a0;
    text-decoration: none;
    border-bottom: 1px solid rgba(196, 181, 160, 0.4);
    padding-bottom: 2px;
    transition: border-color 0.3s ease;
}

.venue-map-link:hover {
    border-color: #c4b5a0;
}

.card-accent .venue-name {
    color: #fbf6ec;
}

.card-accent .venue-address {
    color: rgba(251, 246, 236, 0.8);
}

.card-accent .venue-map-link {
    color: rgba(251, 246, 236, 0.7);
    border-color: rgba(251, 246, 236, 0.3);
}

.card-accent .venue-map-link:hover {
    border-color: rgba(251, 246, 236, 0.7);
}

/* --- Section: Details --- */
.details-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 10px;
}

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

.detail-icon {
    margin-bottom: 10px;
}

.card-accent .detail-icon svg {
    stroke: #c4b5a0;
}

.detail-item p {
    font-size: 17px;
    font-weight: 400;
    line-height: 1.6;
    color: #7a6e5c;
}

.detail-item strong {
    font-weight: 600;
    color: #9a8b78;
}

.card-accent .detail-item p {
    color: rgba(251, 246, 236, 0.9);
}

.card-accent .detail-item strong {
    color: #fbf6ec;
}

/* --- Section: Closing --- */
.closing-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
    font-weight: 500;
    font-style: italic;
    line-height: 1.6;
    color: #8a7d6b;
    margin-bottom: 20px;
}

.card-accent .closing-text {
    color: rgba(251, 246, 236, 0.9);
}

.closing-names {
    font-family: 'Cormorant SC', serif;
    font-size: 42px;
    font-weight: 400;
    color: #c4b5a0;
    letter-spacing: 4px;
}

/* ============================================
   Scroll Reveal Animation
   ============================================ */
.section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.section.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 480px) {
    .card {
        padding: 40px 24px;
        border-radius: 16px;
    }

    .couple-names {
        font-size: 34px;
    }

    .date-day {
        font-size: 64px;
    }

    .date-month {
        font-size: 22px;
    }

    .countdown-number {
        font-size: 30px;
    }

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

    .guest-name {
        font-size: 28px;
    }

    .timeline-time {
        width: 50px;
        font-size: 18px;
    }

    .timeline-content h3 {
        font-size: 17px;
    }
}

@media (min-width: 768px) {
    .section {
        padding: 25px 0;
    }

    .card {
        padding: 60px 50px;
        max-width: 480px;
    }

    .details-grid {
        flex-direction: row;
        gap: 30px;
    }

    .detail-item {
        flex: 1;
    }
}
