* { box-sizing: border-box; }

:root {
    --accent: #7a2b3e;
    --accent-soft: #f6ece9;
    --gold: #b3893f;
    --bg: #f3ede4;
    --paper: #fffdfa;
    --ink: #2c2620;
    --muted: #8a7f72;
}

body {
    margin: 0;
    font-family: "Cormorant Garamond", "Georgia", serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 18px;
}
body.gated { overflow: hidden; }

a { color: inherit; }

h1, h2, .gate-title {
    font-family: "Playfair Display", "Georgia", serif;
}

/* Ornamental divider */
.orn {
    text-align: center;
    color: var(--gold);
    font-size: 20px;
    margin: 22px 0;
    letter-spacing: 6px;
}
.orn::before, .orn::after {
    content: "";
    display: inline-block;
    width: 42px;
    height: 1px;
    background: var(--gold);
    opacity: 0.55;
    vertical-align: middle;
    margin: 0 10px 4px;
}

.card-wrap {
    max-width: 480px;
    margin: 0 auto;
    background: var(--paper);
    min-height: 100vh;
    box-shadow: 0 0 60px rgba(0,0,0,0.10);
    position: relative;
    overflow: hidden;
}

.cover {
    height: 300px;
    background-size: cover;
    background-position: center;
    position: relative;
}
.cover::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 90px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), var(--paper));
}

.card-body {
    padding: 40px 28px 64px;
    text-align: center;
    opacity: 0;
    transform: translateY(14px);
}
body.opened .card-body {
    animation: rise-in 0.9s ease forwards;
}
@keyframes rise-in {
    to { opacity: 1; transform: translateY(0); }
}

h1 { font-size: 32px; font-weight: 700; margin: 0 0 10px; color: var(--accent); }
.subtitle {
    color: var(--gold);
    margin: 0 0 4px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 14px;
    font-family: "Cormorant Garamond", serif;
    font-weight: 600;
}
.date { font-size: 19px; color: var(--muted); margin: 6px 0 4px; }

.countdown {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 28px 0 8px;
}
.countdown div {
    background: var(--accent-soft);
    border: 1px solid rgba(179,137,63,0.35);
    border-radius: 12px;
    padding: 14px 8px;
    min-width: 64px;
}
.countdown span {
    display: block;
    font-size: 26px;
    font-weight: 700;
    font-family: "Playfair Display", serif;
    color: var(--accent);
}
.countdown small { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; letter-spacing: 1px; }

.description { line-height: 1.8; color: #4a423a; text-align: left; margin-bottom: 4px; font-size: 19px; }

.location { text-align: left; }
.location h2 { font-size: 20px; margin-bottom: 8px; text-align: center; color: var(--accent); }
.location p { margin: 2px 0; color: #4a423a; text-align: center; }
.location .btn { margin-top: 14px; }

.rsvp { text-align: left; }
.rsvp h2 { font-size: 21px; text-align: center; margin-bottom: 18px; color: var(--accent); }
.rsvp label { display: block; margin-bottom: 14px; font-size: 15px; color: #4a423a; font-family: "Cormorant Garamond", serif; }
.rsvp input, .rsvp select, .rsvp textarea {
    width: 100%;
    padding: 11px 12px;
    margin-top: 6px;
    border: 1px solid #e0d6c8;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background: #fffdfb;
}
.rsvp input:focus, .rsvp select:focus, .rsvp textarea:focus {
    outline: none;
    border-color: var(--gold);
}

.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 13px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-decoration: none;
    width: 100%;
    text-align: center;
    font-family: "Cormorant Garamond", serif;
    font-weight: 600;
    transition: opacity 0.2s;
}
.btn:hover { opacity: 0.9; }

.alert { padding: 12px 14px; border-radius: 8px; font-size: 15px; text-align: center; }
.alert-error { background: #fde2e2; color: #b42318; }
.alert-success { background: #d8f5e3; color: #147a3c; }

/* Opening gate */
.gate {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 32px;
    background: linear-gradient(160deg, var(--bg), var(--accent-soft));
    transition: opacity 0.7s ease, visibility 0.7s ease;
}
.gate-closing { opacity: 0; visibility: hidden; pointer-events: none; }
.gate-orn { font-size: 30px; color: var(--gold); margin-bottom: 18px; }
.gate-eyebrow {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 14px;
}
.gate-title {
    font-size: 34px;
    color: var(--accent);
    margin: 0 0 10px;
    line-height: 1.25;
}
.gate-date { color: var(--muted); font-size: 18px; margin: 0 0 34px; }
.gate-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 15px 34px;
    border-radius: 999px;
    font-size: 16px;
    font-family: "Cormorant Garamond", serif;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(122,43,62,0.28);
    transition: transform 0.2s;
}
.gate-btn:active { transform: scale(0.96); }

/* Falling petals animation */
.petals {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 5;
}
.petal {
    position: absolute;
    top: -10vh;
    display: inline-block;
    line-height: 1;
    opacity: 0;
    animation-name: petal-fall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    will-change: transform, opacity;
}
@keyframes petal-fall {
    0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
    8% { opacity: 0.9; }
    50% { transform: translate3d(var(--drift), 55vh, 0) rotate(180deg); }
    92% { opacity: 0.85; }
    100% { transform: translate3d(0, 115vh, 0) rotate(360deg); opacity: 0; }
}

/* Background music toggle */
.music-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    font-size: 22px;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}
.music-btn.playing {
    animation: spin 4s linear infinite;
    box-shadow: 0 4px 16px rgba(0,0,0,0.28);
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Themes */
.theme-gold {
    --accent: #8a6524;
    --accent-soft: #faf4e6;
    --gold: #c9a24a;
    --bg: #f4ecd8;
}

.theme-floral {
    --accent: #a3355a;
    --accent-soft: #fbeef3;
    --gold: #c9789a;
    --bg: #fbeef0;
}
