:root {
    --bg-color: #F8F6F1; /* Ivory / Alabaster */
    --text-primary: #252220; /* Deep Charcoal Taupe, increased contrast */
    --text-muted: #7A726D;
    --accent: #B08B73; /* Richer Dusty Rose / Taupe */
    --accent-light: #D5C6BA;
    --white: #FFFFFF;
    
    --font-heading: 'Cinzel', serif;
    --font-script: 'Pinyon Script', cursive;
    --font-serif: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    line-height: 1.6;
    background-color: var(--bg-color);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
}

/* Stationery Frame */
.stationery-frame {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    border: 1px solid var(--accent-light);
    pointer-events: none;
    z-index: 9000;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.02);
}

/* Elegant Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 1.2s;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.loader-arch path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: drawArch 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes drawArch {
    to { stroke-dashoffset: 0; }
}

.loader-names {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-style: italic;
    color: var(--text-primary);
    margin-top: 20px;
    opacity: 0;
    transform: translateY(15px);
    animation: fadeUpFade 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.8s;
}

.loader-date {
    font-family: var(--font-body);
    font-size: 0.8rem;
    letter-spacing: 5px;
    color: var(--accent);
    margin-top: 10px;
    opacity: 0;
    transform: translateY(15px);
    animation: fadeUpFade 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards 1.1s;
}

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

/* Background & Particles */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-color);
}

.bg-image {
    position: absolute;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    background-image: url('bg-floral.png');
    background-size: cover;
    background-position: center;
    opacity: 0.6; /* Perfectly visible but soft */
    filter: contrast(1.05) brightness(1.02);
    animation: slowBreath 40s infinite alternate ease-in-out;
}

@keyframes slowBreath {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.03) translate(-1%, -1%); }
}

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

.particle {
    position: absolute;
    background: rgba(176, 139, 115, 0.25);
    border-radius: 50%;
    filter: blur(3px);
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    50% { opacity: 0.8; }
    100% { transform: translateY(-20vh) scale(1); opacity: 0; }
}

/* Seal Button (Upload) */
.seal-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 105px;
    height: 105px;
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 99;
    box-shadow: 0 12px 30px rgba(176, 139, 115, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.seal-icon {
    font-size: 1.8rem;
    position: absolute;
    z-index: 2;
}

.seal-text {
    width: 100%;
    height: 100%;
    position: absolute;
    animation: spinSlow 20s linear infinite;
}

.seal-text text {
    font-family: var(--font-body);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 2.8px;
    fill: var(--white);
}

@keyframes spinSlow {
    100% { transform: rotate(360deg); }
}

.seal-btn:hover {
    transform: scale(1.08);
    background: #99745C;
    box-shadow: 0 15px 40px rgba(176, 139, 115, 0.6);
}

/* Main Content */
.content-wrapper {
    position: relative;
    max-width: 650px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Scroll Animation Classes */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.4s cubic-bezier(0.2, 0.8, 0.2, 1), 
                transform 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Staggered Premium Reveals */
.hero.reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
}

.hero-content > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.5s cubic-bezier(0.19, 1, 0.22, 1), transform 1.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.hero.visible .pre-title { opacity: 1; transform: translateY(0); transition-delay: 0.3s; }
.hero.visible .names-asymmetric { opacity: 1; transform: translateY(0); transition-delay: 0.6s; }
.hero.visible .svg-divider { opacity: 1; transform: translateY(0); transition-delay: 0.9s; }
.hero.visible .invite-text { opacity: 1; transform: translateY(0); transition-delay: 1.2s; }
.hero.visible .families-text { opacity: 1; transform: translateY(0); transition-delay: 1.5s; }

.hero-content {
    text-align: center;
    width: 100%;
    margin-top: -5vh;
}

.pre-title {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 6px;
    color: var(--text-muted);
    margin-bottom: 50px;
    text-transform: uppercase;
}

.names-asymmetric {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    animation: gentleFloat 6s ease-in-out infinite alternate;
}

@keyframes gentleFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

.names-asymmetric .bride {
    font-family: var(--font-serif);
    font-size: 7rem;
    font-weight: 400;
    font-style: italic;
    color: var(--text-primary);
    line-height: 0.9;
    transform: translateX(-40px);
    text-shadow: 2px 2px 10px rgba(255,255,255,0.5);
}

.names-asymmetric .groom {
    font-family: var(--font-serif);
    font-size: 7rem;
    font-weight: 400;
    font-style: italic;
    color: var(--text-primary);
    line-height: 0.9;
    transform: translateX(40px);
    text-shadow: 2px 2px 10px rgba(255,255,255,0.5);
}

.names-asymmetric .ampersand-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.names-asymmetric .ampersand {
    font-family: var(--font-script);
    font-size: 6rem;
    color: var(--accent);
    opacity: 0.85;
}

.svg-divider {
    margin: 50px 0;
    display: flex;
    justify-content: center;
}

.svg-divider path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 2s cubic-bezier(0.19, 1, 0.22, 1);
}

.hero.visible .svg-divider path,
.reveal-on-scroll.visible .svg-divider path {
    stroke-dashoffset: 0;
    transition-delay: 1s;
}

.invite-text {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-primary);
    max-width: 85%;
    margin: 0 auto;
    line-height: 1.8;
}

.families-text {
    margin-top: 35px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.scroll-indicator {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transition: opacity 1.5s ease 2s;
}

.hero.visible ~ .scroll-indicator, /* fallback if ~ works */
.hero.visible .scroll-indicator /* If it's inside hero */ {
    opacity: 1;
}

.scroll-indicator p {
    font-family: var(--font-body);
    font-size: 0.7rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.scroll-indicator .line {
    width: 1px;
    height: 50px;
    background: var(--accent);
    animation: dropLine 2.5s infinite cubic-bezier(0.65, 0, 0.35, 1);
    transform-origin: top;
}

@keyframes dropLine {
    0% { transform: scaleY(0); opacity: 0; }
    50% { transform: scaleY(1); opacity: 1; }
    100% { transform: translateY(20px) scaleY(0); opacity: 0; }
}

/* Arch Card Design */
.details-section {
    padding: 100px 0;
    display: flex;
    justify-content: center;
}

.arch-card {
    background: var(--white);
    padding: 15px;
    border-radius: 200px 200px 0 0;
    box-shadow: 0 40px 80px rgba(0,0,0,0.06);
    width: 100%;
    max-width: 420px;
    position: relative;
}

/* Inner dashed border for physical card effect */
.arch-card::before {
    content: '';
    position: absolute;
    top: 8px; left: 8px; right: 8px; bottom: 8px;
    border: 1px dashed var(--accent-light);
    border-radius: 192px 192px 0 0;
    pointer-events: none;
    z-index: 2;
}

.arch-inner {
    border: 1px solid var(--accent-light);
    border-radius: 185px 185px 0 0;
    padding: 70px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--white);
    position: relative;
    z-index: 1;
}

.arch-inner > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s cubic-bezier(0.19, 1, 0.22, 1), transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.reveal-on-scroll.visible .arch-inner > *:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0.2s; }
.reveal-on-scroll.visible .arch-inner > *:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.4s; }
.reveal-on-scroll.visible .arch-inner > *:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.6s; }
.reveal-on-scroll.visible .arch-inner > *:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 0.8s; }
.reveal-on-scroll.visible .arch-inner > *:nth-child(5) { opacity: 1; transform: translateY(0); transition-delay: 1.0s; }
.reveal-on-scroll.visible .arch-inner > *:nth-child(6) { opacity: 1; transform: translateY(0); transition-delay: 1.2s; }

.arch-icon {
    margin-bottom: 35px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 45px;
}

/* Details */
.detail-group {
    margin-bottom: 25px;
}

.detail-heading {
    font-family: var(--font-script);
    font-size: 2.2rem;
    color: var(--accent);
    font-weight: 400;
    margin-bottom: 12px;
}

.primary-text {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.secondary-text {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.6;
}

.small-divider {
    width: 1px;
    height: 40px;
    background: var(--accent-light);
    margin: 25px auto 35px;
}

.action-row {
    margin-top: 50px;
    width: 100%;
}

.btn-outline {
    display: inline-block;
    padding: 18px 35px;
    border: 1px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    transition: all 0.4s ease;
}

.btn-outline:hover {
    background: var(--accent);
    color: var(--white);
}

/* Countdown */
.countdown-section {
    padding: 60px 0 100px;
    text-align: center;
}

.countdown-elegant {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
}

.time-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-num {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    color: var(--text-primary);
    font-weight: 400;
    line-height: 1;
    margin-bottom: 12px;
}

.time-label {
    font-family: var(--font-body);
    font-size: 0.7rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--accent);
}

/* Upload Modal (Arch Design) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(248, 246, 241, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content.arch-modal {
    width: 90%;
    max-width: 480px;
    background: var(--white);
    padding: 60px 40px;
    border-radius: 200px 200px 0 0;
    border: 1px solid var(--accent-light);
    box-shadow: 0 40px 80px rgba(0,0,0,0.08);
    text-align: center;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 40px;
    right: 40px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
}

.close-btn:hover { color: var(--text-primary); }

.upload-desc {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 35px;
    line-height: 1.7;
}

.uploader-name-field input {
    width: 100%;
    padding: 18px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--accent-light);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    text-align: center;
    transition: border-color 0.3s;
    margin-bottom: 35px;
    outline: none;
}

.uploader-name-field input:focus {
    border-color: var(--accent);
}

.upload-area {
    padding: 25px 0;
    cursor: pointer;
    transition: opacity 0.3s;
}

.upload-area:hover {
    opacity: 0.6;
}

.upload-prompt {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 15px;
}

.upload-line {
    width: 50px;
    height: 1px;
    background: var(--text-primary);
    margin: 0 auto;
}

.preview-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
}

.preview-chip {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.preview-chip .fa-times {
    cursor: pointer;
    color: var(--accent);
    font-size: 1.2rem;
}

.btn-solid {
    display: inline-block;
    width: 100%;
    margin-top: 35px;
    padding: 18px 35px;
    background: var(--accent);
    color: var(--white);
    border: none;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    transition: all 0.4s ease;
    cursor: pointer;
}

.btn-solid:hover {
    background: var(--text-primary);
}

.btn-solid.disabled {
    background: var(--accent-light);
    pointer-events: none;
}

.success-message {
    display: none;
    margin-top: 25px;
    padding: 20px;
    color: var(--accent);
    font-family: var(--font-body);
    font-size: 0.95rem;
    animation: simpleFadeInOut 0.5s ease forwards;
}

/* Footer */
footer {
    text-align: center;
    padding: 60px 0 120px;
}

.footer-names {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    letter-spacing: 6px;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.footer-love {
    font-family: var(--font-script);
    font-size: 1.8rem;
    color: var(--accent);
}

/* Tablet & Mobile Layout Enhancements */
@media (max-width: 768px) {
    .names-asymmetric .bride, .names-asymmetric .groom { font-size: 5.5rem; }
    .names-asymmetric .ampersand { font-size: 5rem; }
    .invite-text { font-size: 1.1rem; width: 90%; max-width: 100%; }
    .seal-btn { width: 90px; height: 90px; }
    .seal-text text { font-size: 11px; }
    .countdown-elegant { gap: 25px; }
    .time-num { font-size: 3rem; }
}

@media (max-width: 480px) {
    .stationery-frame { top: 12px; left: 12px; right: 12px; bottom: 12px; }
    .hero-content { margin-top: -10vh; }
    .pre-title { font-size: 0.7rem; letter-spacing: 4px; margin-bottom: 30px; }
    
    .names-asymmetric .bride { font-size: 4.8rem; transform: translateX(-15px); }
    .names-asymmetric .groom { font-size: 4.8rem; transform: translateX(15px); }
    .names-asymmetric .ampersand { font-size: 4.5rem; }
    
    .invite-text { font-size: 1.05rem; line-height: 1.6; }
    .svg-divider { margin: 30px 0; }
    
    .details-section { padding: 60px 0; }
    .arch-card { padding: 10px; max-width: 90%; }
    .arch-inner { padding: 50px 20px; }
    .section-title { font-size: 1.2rem; letter-spacing: 2px; }
    .detail-heading { font-size: 1.8rem; }
    .primary-text { font-size: 1.1rem; }
    
    .countdown-section { padding: 40px 0 80px; }
    .countdown-elegant { gap: 15px; }
    .time-num { font-size: 2.2rem; }
    
    /* Simplified Seal Button for Mobile Readability */
    .seal-btn { 
        width: 65px; 
        height: 65px; 
        bottom: 20px; 
        right: 20px; 
    }
    .seal-text { display: none; } /* Hide spinning text on mobile */
    .seal-icon { font-size: 1.5rem; }
    
    .footer-names { font-size: 1.5rem; letter-spacing: 4px; }
    .footer-love { font-size: 1.4rem; }
    
    /* Perfect Mobile Modal (Bottom Sheet Style) */
    .modal-overlay {
        align-items: flex-end;
    }
    .modal-content.arch-modal { 
        padding: 40px 25px 40px; 
        width: 100%; 
        border-radius: 40px 40px 0 0; /* iOS style bottom sheet */
        border-bottom: none;
        border-left: none;
        border-right: none;
        transform: translateY(100%); /* Slide up from bottom */
        box-shadow: 0 -20px 40px rgba(0,0,0,0.08);
    }
    .modal-overlay.active .modal-content.arch-modal {
        transform: translateY(0);
    }
    .close-btn {
        top: 20px;
        right: 25px;
        background: rgba(0,0,0,0.04);
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 1rem;
    }
    .arch-icon { margin-bottom: 20px; }
    .uploader-name-field input { padding: 15px; font-size: 0.95rem; }
}
