/* ====================================================
   INVITO BRIDGERTON — LUXURY PDF CARD STYLE
   ==================================================== */

:root {
    --navy:          #0f0e1e;
    --navy-light:    #1a1833;
    --cream:         #f5ead0;
    --cream-mid:     #ede0c0;
    --cream-dark:    #d4c9a8;
    --parchment:     #faf3e3;
    --gold:          #b8943e;
    --gold-light:    #d4b96a;
    --gold-bright:   #e8d48b;
    --gold-dark:     #7a5e1e;
    --burgundy:      #5c1a2a;
    --dusty-blue:    #6b8ca6;
    --lavender:      #9b8ec4;
    --blush:         #c9a0a0;
    --ink:           #2a1f14;
    --ink-light:     #4a3f30;

    --font-script:   'Great Vibes', cursive;
    --font-display:  'Playfair Display', serif;
    --font-body:     'Cormorant Garamond', serif;
    --font-text:     'EB Garamond', serif;
}

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

body {
    background: var(--navy);
    color: var(--ink);
    font-family: var(--font-body);
    overflow: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

/* ====================================================
   PHASES
   ==================================================== */
.phase {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .8s ease;
}
.phase.active { opacity: 1; pointer-events: auto; }

/* ====================================================
   PHASE 1: ENVELOPE
   ==================================================== */
#envelope-phase {
    background: #07060f;
    flex-direction: column;
}
#envelope-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #07060f;
}
.seal-tap-area {
    position: absolute;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}
.seal-pulse {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid rgba(201,168,76,.4);
    animation: sealPulse 2s ease-in-out infinite;
}
.seal-pulse.delay { animation-delay: 1s; }
@keyframes sealPulse {
    0%   { transform: scale(.8); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}
.envelope-cta {
    position: absolute;
    bottom: 12%;
    left: 0; right: 0;
    text-align: center;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.cta-icon { font-size: 1.4rem; animation: ctaFloat 2s ease-in-out infinite; }
@keyframes ctaFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
.cta-text {
    font-family: var(--font-body);
    font-size: .85rem;
    font-weight: 500;
    color: var(--cream);
    letter-spacing: 1.5px;
    text-shadow: 0 2px 8px rgba(0,0,0,.8);
    background: rgba(15,14,30,.5);
    padding: 6px 18px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* ====================================================
   PHASE 2: INVITATION
   ==================================================== */
#invite-phase {
    overflow-y: auto;
    overflow-x: hidden;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Damask subtle background */
.damask-bg {
    position: fixed;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 40px,
            rgba(107,140,166,.02) 40px,
            rgba(107,140,166,.02) 41px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 40px,
            rgba(155,142,196,.02) 40px,
            rgba(155,142,196,.02) 41px
        ),
        radial-gradient(ellipse at 50% 20%, rgba(107,140,166,.06) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 80%, rgba(155,142,196,.04) 0%, transparent 60%),
        var(--navy);
    z-index: 0;
}

#sparkle-canvas {
    position: fixed;
    inset: 0;
    width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
}

.invite-scroll {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 30px 14px 30px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
}
#invite-phase.active .invite-scroll {
    opacity: 1;
    transform: translateY(0);
}

/* ====================================================
   THE CARD (Parchment PDF Style)
   ==================================================== */
.card {
    position: relative;
    background:
        linear-gradient(135deg,
            rgba(250,243,227,1) 0%,
            rgba(245,234,208,1) 30%,
            rgba(237,224,192,.95) 70%,
            rgba(250,243,227,1) 100%
        );
    border-radius: 4px;
    box-shadow:
        0 2px 4px rgba(0,0,0,.1),
        0 8px 30px rgba(0,0,0,.25),
        0 20px 60px rgba(0,0,0,.3),
        inset 0 0 80px rgba(184,148,62,.06);
    overflow: hidden;
}

/* Parchment texture overlay */
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.7' numOctaves='4' type='fractalNoise'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
    opacity: .5;
    pointer-events: none;
    z-index: 0;
}

/* ---------- GOLD ORNATE BORDER ---------- */
.card-border {
    position: absolute;
    inset: 6px;
    border: 2px solid var(--gold);
    border-radius: 2px;
    pointer-events: none;
    z-index: 1;
}

/* Corner flourishes using CSS */
.corner-flourish {
    position: absolute;
    width: 28px;
    height: 28px;
    z-index: 2;
}
.corner-flourish::before,
.corner-flourish::after {
    content: '';
    position: absolute;
    background: var(--gold);
}
.corner-flourish::before {
    width: 20px; height: 2px;
}
.corner-flourish::after {
    width: 2px; height: 20px;
}
/* Positions */
.corner-flourish.tl { top: -1px; left: -1px; }
.corner-flourish.tl::before { top: 0; left: 0; }
.corner-flourish.tl::after { top: 0; left: 0; }

.corner-flourish.tr { top: -1px; right: -1px; }
.corner-flourish.tr::before { top: 0; right: 0; }
.corner-flourish.tr::after { top: 0; right: 0; }

.corner-flourish.bl { bottom: -1px; left: -1px; }
.corner-flourish.bl::before { bottom: 0; left: 0; }
.corner-flourish.bl::after { bottom: 0; left: 0; }

.corner-flourish.br { bottom: -1px; right: -1px; }
.corner-flourish.br::before { bottom: 0; right: 0; }
.corner-flourish.br::after { bottom: 0; right: 0; }

/* Inner border line */
.card-inner-border {
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(184,148,62,.3);
    border-radius: 1px;
    pointer-events: none;
    z-index: 1;
}

/* ====================================================
   CARD CONTENT
   ==================================================== */
.card-content {
    position: relative;
    z-index: 3;
    padding: 32px 22px 28px;
    text-align: center;
}

/* Crown */
.crown-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(184,148,62,.3));
}

/* ---------- WHISTLEDOWN BANNER ---------- */
.wh-banner {
    margin-bottom: 16px;
}
.wh-line {
    height: 1.5px;
    background: linear-gradient(90deg, transparent 5%, var(--gold) 30%, var(--gold-bright) 50%, var(--gold) 70%, transparent 95%);
    margin: 6px 20px;
}
.wh-title {
    font-family: var(--font-display);
    font-size: .5rem;
    letter-spacing: 3.5px;
    text-transform: uppercase;
    color: var(--gold-dark);
    font-weight: 700;
    margin: 6px 0 2px;
}
.wh-edition {
    font-family: var(--font-body);
    font-size: .75rem;
    color: var(--dusty-blue);
    font-style: italic;
    letter-spacing: 1px;
}

/* ---------- INTRO TEXT ---------- */
.intro-text {
    font-family: var(--font-text);
    font-size: .95rem;
    line-height: 1.7;
    color: var(--ink-light);
    margin-bottom: 14px;
    padding: 0 8px;
    font-style: italic;
}
.drop-cap {
    font-family: var(--font-script);
    font-size: 2.8rem;
    float: left;
    line-height: .75;
    margin-right: 4px;
    margin-top: 4px;
    color: var(--gold);
}

/* ---------- FLORAL DIVIDER ---------- */
.floral-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 12px 0;
    color: var(--gold);
    font-size: .8rem;
    opacity: .6;
}
.fd-dot { font-size: .5rem; }
.fd-leaf.flip { transform: scaleX(-1); }

/* ---------- HONOREE ---------- */
.honoree-label {
    font-family: var(--font-text);
    font-size: .8rem;
    color: var(--ink-light);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.honoree-name {
    font-family: var(--font-script);
    font-size: 2.8rem;
    color: var(--gold-dark);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 6px;
    text-shadow: 0 1px 2px rgba(184,148,62,.15);
}

/* ---------- AGE SECTION ---------- */
.age-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 14px;
}
.age-line {
    flex: 1;
    max-width: 50px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.age-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.age-number {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--gold-dark);
    line-height: 1;
    letter-spacing: 3px;
}
.age-word {
    font-family: var(--font-script);
    font-size: 1.4rem;
    color: var(--ink-light);
    margin-top: -2px;
}

/* ---------- ELEGANT DIVIDER ---------- */
.elegant-divider {
    font-size: 1.2rem;
    color: var(--gold);
    margin: 10px 0;
    opacity: .5;
}

/* ---------- DATE & TIME ---------- */
.datetime-block {
    margin-bottom: 16px;
    padding: 14px 0;
    border-top: 1px solid rgba(184,148,62,.2);
    border-bottom: 1px solid rgba(184,148,62,.2);
}
.dt-day {
    font-family: var(--font-text);
    font-size: .8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--dusty-blue);
    margin-bottom: 4px;
}
.dt-date-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.dt-num {
    font-family: var(--font-display);
    font-size: 3.2rem;
    font-weight: 900;
    color: var(--gold-dark);
    line-height: 1;
}
.dt-month-year {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.dt-month {
    font-family: var(--font-script);
    font-size: 1.6rem;
    color: var(--ink);
    line-height: 1.1;
}
.dt-year {
    font-family: var(--font-display);
    font-size: .55rem;
    letter-spacing: 4px;
    color: var(--gold);
    font-weight: 700;
}
.dt-time {
    font-family: var(--font-text);
    font-size: .9rem;
    color: var(--ink-light);
    margin-top: 6px;
    font-style: italic;
}

/* ---------- LOCATION ---------- */
.location-block {
    margin-bottom: 16px;
}
.loc-icon {
    font-size: 1.2rem;
    margin-bottom: 4px;
}
.loc-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 1px;
}
.loc-city {
    font-family: var(--font-text);
    font-size: .85rem;
    color: var(--ink-light);
    font-style: italic;
}

/* ---------- DRESS CODE ---------- */
.dresscode-block {
    margin-bottom: 14px;
    padding: 12px 0;
}
.dc-label {
    font-family: var(--font-display);
    font-size: .5rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 4px;
}
.dc-value {
    font-family: var(--font-script);
    font-size: 1.8rem;
    color: var(--ink);
}
.dc-hint {
    font-family: var(--font-text);
    font-size: .75rem;
    color: var(--ink-light);
    font-style: italic;
    margin-top: 4px;
    letter-spacing: .5px;
}

/* ---------- PROGRAM ---------- */
.program-block {
    margin-bottom: 18px;
}
.prog-label {
    font-family: var(--font-display);
    font-size: .5rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--dusty-blue);
    font-weight: 700;
    margin-bottom: 10px;
}
.prog-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-width: 240px;
    margin: 0 auto;
}
.prog-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 6px;
    background: rgba(184,148,62,.06);
    border: 1px solid rgba(184,148,62,.15);
    border-radius: 6px;
}
.prog-icon { font-size: .9rem; }
.prog-text {
    font-family: var(--font-body);
    font-size: .85rem;
    color: var(--ink);
    font-weight: 500;
}

/* ---------- RSVP ---------- */
.rsvp-block {
    margin-bottom: 18px;
    padding: 4px 0;
}
.rsvp-border {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 10px 30px;
    opacity: .3;
}
.rsvp-text {
    font-family: var(--font-text);
    font-size: .8rem;
    font-style: italic;
    color: var(--ink-light);
    margin: 8px 0 2px;
}
.rsvp-deadline {
    font-family: var(--font-text);
    font-size: .8rem;
    color: var(--ink-light);
    margin-bottom: 12px;
}
.rsvp-deadline strong {
    color: var(--ink);
}
.rsvp-btn {
    display: inline-block;
    font-family: var(--font-display);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    text-decoration: none;
    padding: 10px 26px;
    border: 1.5px solid var(--gold);
    border-radius: 100px;
    color: var(--gold-dark);
    background: rgba(184,148,62,.08);
    cursor: pointer;
    transition: all .3s ease;
}
.rsvp-btn:hover {
    background: var(--gold);
    color: var(--parchment);
}

/* ---------- FOOTER QUOTE ---------- */
.footer-quote {
    margin-bottom: 14px;
    padding: 0 10px;
}
.fq-text {
    font-family: var(--font-text);
    font-size: .8rem;
    font-style: italic;
    color: var(--ink-light);
    line-height: 1.6;
    opacity: .7;
}
.fq-author {
    font-family: var(--font-display);
    font-size: .6rem;
    letter-spacing: 2px;
    color: var(--dusty-blue);
    margin-top: 6px;
    font-weight: 700;
}

/* ---------- MONOGRAM ---------- */
.monogram {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 1.5px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-script);
    font-size: 1.4rem;
    color: var(--gold-dark);
}

/* ---------- BOTTOM FLOURISH ---------- */
.bottom-flourish {
    text-align: center;
    margin-top: 16px;
    font-size: .8rem;
    color: var(--gold-light);
    letter-spacing: 8px;
    opacity: .4;
}

/* ====================================================
   ANIMATIONS
   ==================================================== */
.seal-tap-area.breaking {
    animation: sealBreak .6s ease forwards;
}
@keyframes sealBreak {
    0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    30%  { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}
.flash-overlay {
    position: fixed;
    inset: 0;
    background: rgba(201,168,76,.3);
    z-index: 100;
    animation: flashFade .8s ease forwards;
}
@keyframes flashFade {
    0% { opacity: 1; } 100% { opacity: 0; }
}

/* Staggered entrance */
.card-content > * {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity .5s ease, transform .5s ease;
}
#invite-phase.active .card-content > * {
    opacity: 1;
    transform: translateY(0);
}
#invite-phase.active .card-content > *:nth-child(1)  { transition-delay: .3s; }
#invite-phase.active .card-content > *:nth-child(2)  { transition-delay: .5s; }
#invite-phase.active .card-content > *:nth-child(3)  { transition-delay: .7s; }
#invite-phase.active .card-content > *:nth-child(4)  { transition-delay: .9s; }
#invite-phase.active .card-content > *:nth-child(5)  { transition-delay: 1s; }
#invite-phase.active .card-content > *:nth-child(6)  { transition-delay: 1.1s; }
#invite-phase.active .card-content > *:nth-child(7)  { transition-delay: 1.2s; }
#invite-phase.active .card-content > *:nth-child(8)  { transition-delay: 1.3s; }
#invite-phase.active .card-content > *:nth-child(9)  { transition-delay: 1.5s; }
#invite-phase.active .card-content > *:nth-child(10) { transition-delay: 1.6s; }
#invite-phase.active .card-content > *:nth-child(11) { transition-delay: 1.7s; }
#invite-phase.active .card-content > *:nth-child(12) { transition-delay: 1.8s; }
#invite-phase.active .card-content > *:nth-child(13) { transition-delay: 1.9s; }
#invite-phase.active .card-content > *:nth-child(14) { transition-delay: 2s; }
#invite-phase.active .card-content > *:nth-child(15) { transition-delay: 2.1s; }
#invite-phase.active .card-content > *:nth-child(16) { transition-delay: 2.2s; }
#invite-phase.active .card-content > *:nth-child(17) { transition-delay: 2.3s; }
#invite-phase.active .card-content > *:nth-child(18) { transition-delay: 2.4s; }

/* ====================================================
   RESPONSIVE
   ==================================================== */
@media (max-height: 700px) {
    .honoree-name { font-size: 2.2rem; }
    .age-number { font-size: 2rem; }
    .dt-num { font-size: 2.6rem; }
    .card-content { padding: 24px 18px 22px; }
}
