/* =============================================
   WEDDING INVITATION - MAIN STYLES
   ============================================= */

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* CSS Variables - Elegant Champagne/Beige Palette */
:root {
    /* Colors - Warm Champagne/Beige */
    --cream: #E8E0D5;
    --cream-light: #F5F0EA;
    --cream-dark: #D5CFC3;
    --champagne: #C9C1B3;
    --brown-dark: #6B5B4F;
    --brown-medium: #8B7B6B;
    --brown-light: #A89888;
    --gold: #C9A86C;
    --gold-light: #D4BC8A;
    --border-light: #D5CFC3;

    /* Typography (Vietnamese-friendly, elegant) */
    --font-serif: 'Lora', 'Times New Roman', serif;
    --font-display: 'Lora', 'Times New Roman', serif;
    --font-script: 'Dancing Script', 'Lora', cursive;
    --font-sans: 'Be Vietnam Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Base Styles */
html {
    font-size: 16px;
}

body {
    font-family: var(--font-serif);
    background: linear-gradient(180deg,
            var(--cream-light) 0%,
            var(--cream) 30%,
            var(--cream-dark) 70%,
            var(--champagne) 100%);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    overflow-x: hidden;
    position: relative;
    font-variant-numeric: lining-nums tabular-nums;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Soft glow overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center,
            rgba(201, 168, 108, 0.08) 0%,
            transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Music Control Button */
.music-control {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cream-light) 0%, var(--cream-dark) 100%);
    border: 1px solid var(--border-light);
    box-shadow:
        0 4px 15px rgba(107, 91, 79, 0.15),
        0 2px 6px rgba(107, 91, 79, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
}

.music-control:hover {
    transform: scale(1.1);
    box-shadow:
        0 6px 20px rgba(107, 91, 79, 0.2),
        0 3px 8px rgba(107, 91, 79, 0.12);
}

.music-control:active {
    transform: scale(0.95);
}

.music-icon {
    font-size: 20px;
    transition: all 0.3s ease;
}

.music-control.playing .music-icon {
    animation: musicPulse 1s ease-in-out infinite;
}

@keyframes musicPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* Responsive music button */
@media screen and (max-width: 480px) {
    .music-control {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .music-icon {
        font-size: 18px;
    }
}

/* Container */
.container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    perspective: 1500px;
}

/* Invitation Card */
.invitation-card {
    position: relative;
    width: 100%;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    animation: fadeInUp 1.2s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Names - Elegant Serif Uppercase */
.names {
    font-family: var(--font-serif);
    font-size: clamp(16px, 5.5vw, 56px);
    font-weight: 400;
    color: var(--brown-dark);
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    animation: fadeIn 1.5s ease-out 0.3s both;
    line-height: 1.3;
    white-space: nowrap;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

.ampersand {
    font-family: var(--font-script);
    font-size: 0.5em;
    margin: 0 15px;
    text-transform: lowercase;
    letter-spacing: 0;
    color: var(--brown-medium);
    display: inline-block;
}

/* Date */
.date {
    font-family: var(--font-display);
    font-size: clamp(18px, 4vw, 32px);
    font-weight: 400;
    font-style: italic;
    color: var(--brown-medium);
    letter-spacing: 0.2em;
    margin-bottom: 50px;
    animation: fadeIn 1.5s ease-out 0.6s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* CTA Text - Below Envelope, Centered */
.cta-text {
    position: absolute;
    bottom: -70px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    text-align: center;
    font-family: var(--font-serif);
    font-size: clamp(12px, 2.5vw, 18px);
    font-weight: 400;
    color: var(--brown-dark);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.85;
    }

    50% {
        opacity: 1;
    }
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

/* Extra Large Desktop (1400px+) */
@media screen and (min-width: 1400px) {
    .invitation-card {
        padding: 80px 60px;
        min-height: 700px;
    }

    .names {
        font-size: 56px;
        letter-spacing: 0.2em;
    }

    .date {
        font-size: 36px;
        margin-bottom: 60px;
    }
}

/* Large Desktop (1200px - 1399px) */
@media screen and (min-width: 1200px) and (max-width: 1399px) {
    .invitation-card {
        padding: 70px 50px;
    }

    .names {
        font-size: 48px;
        letter-spacing: 0.18em;
    }
}

/* Desktop (992px - 1199px) */
@media screen and (min-width: 992px) and (max-width: 1199px) {
    .invitation-card {
        padding: 60px 40px;
    }

    .names {
        font-size: 42px;
        letter-spacing: 0.15em;
    }
}

/* Tablet Landscape (768px - 991px) */
@media screen and (min-width: 768px) and (max-width: 991px) {
    body {
        padding: 15px;
    }

    .invitation-card {
        padding: 50px 30px;
        min-height: 550px;
    }

    .names {
        font-size: 36px;
        letter-spacing: 0.12em;
    }

    .ampersand {
        margin: 0 10px;
    }

    .date {
        font-size: 26px;
        letter-spacing: 0.25em;
        margin-bottom: 40px;
    }

    .cta-text {
        bottom: -60px;
        letter-spacing: 0.3em;
    }
}

/* Tablet Portrait (600px - 767px) */
@media screen and (min-width: 600px) and (max-width: 767px) {
    body {
        padding: 15px;
    }

    .invitation-card {
        padding: 40px 25px;
        min-height: 500px;
    }

    .names {
        font-size: 30px;
        letter-spacing: 0.1em;
    }

    .ampersand {
        margin: 0 8px;
    }

    .date {
        font-size: 22px;
        letter-spacing: 0.2em;
        margin-bottom: 35px;
    }

    .cta-text {
        bottom: -55px;
        letter-spacing: 0.25em;
    }
}

/* Large Phone (480px - 599px) */
@media screen and (min-width: 480px) and (max-width: 599px) {
    body {
        padding: 12px;
    }

    .invitation-card {
        padding: 35px 20px;
        min-height: 450px;
    }

    .names {
        font-size: 24px;
        letter-spacing: 0.08em;
        margin-bottom: 12px;
    }

    .ampersand {
        margin: 0 6px;
        font-size: 0.6em;
    }

    .date {
        font-size: 18px;
        letter-spacing: 0.15em;
        margin-bottom: 30px;
    }

    .cta-text {
        bottom: -50px;
        letter-spacing: 0.15em;
        font-size: 12px;
    }
}

/* Medium Phone (375px - 479px) */
@media screen and (min-width: 375px) and (max-width: 479px) {
    body {
        padding: 10px;
    }

    .invitation-card {
        padding: 30px 10px;
        min-height: 420px;
    }

    .names {
        font-size: 20px;
        letter-spacing: 0.06em;
        margin-bottom: 10px;
    }

    .ampersand {
        margin: 0 5px;
        font-size: 0.55em;
    }

    .date {
        font-size: 16px;
        letter-spacing: 0.12em;
        margin-bottom: 25px;
    }

    .cta-text {
        bottom: -45px;
        letter-spacing: 0.1em;
        font-size: 11px;
    }
}

/* Small Phone (320px - 374px) */
@media screen and (max-width: 374px) {
    body {
        padding: 8px;
    }

    .invitation-card {
        padding: 25px 8px;
        min-height: 380px;
    }

    .names {
        font-size: 16px;
        letter-spacing: 0.04em;
        margin-bottom: 8px;
    }

    .ampersand {
        margin: 0 4px;
        font-size: 0.5em;
    }

    .date {
        font-size: 14px;
        letter-spacing: 0.08em;
        margin-bottom: 20px;
    }

    .cta-text {
        bottom: -40px;
        letter-spacing: 0.08em;
        font-size: 10px;
    }
}

/* Landscape Mode for Mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 10px;
        align-items: flex-start;
    }

    .invitation-card {
        padding: 20px 30px;
        min-height: auto;
    }

    .names {
        font-size: 24px;
        letter-spacing: 0.1em;
        margin-bottom: 8px;
    }

    .date {
        font-size: 16px;
        margin-bottom: 20px;
    }

    .cta-text {
        bottom: -35px;
        font-size: 11px;
    }
}

/* Touch device optimization */
@media (hover: none) and (pointer: coarse) {
    .cta-text {
        animation: pulse 2s ease-in-out infinite;
    }
}

/* High DPI / Retina displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    .names,
    .date,
    .cta-text {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}