/* ── Reset & Tokens ───────────────────────────── */

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

/* Ensure the HTML hidden attribute always wins over CSS display rules */
[hidden] { display: none !important; }

:root {
    --bg:         #0f0508;
    --bg-warm:    #5c1018;
    --gold:       #d4a843;
    --gold-light: #f0c96a;
    --gold-dim:   rgba(212, 168, 67, 0.18);
    --gold-faint: rgba(212, 168, 67, 0.06);
    --text:       #fdf5e8;
    --muted:      #9a806a;
    --serif:      'Cormorant Garant', serif;
    --script:     'Great Vibes', cursive;
    --sans:       'Jost', sans-serif;
}

html { scroll-behavior: smooth; }

/* Fixed warm glow — persists through scroll */
.page-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(ellipse 180% 60% at 50% 0%,   #220610 0%, transparent 62%),
        radial-gradient(ellipse 150% 48% at 50% 100%, #220610 0%, transparent 58%);
}

body {
    background-color: var(--bg);
    background-image:
        url("data:image/svg+xml,%3Csvg width='64' height='64' viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M32 2 L62 32 L32 62 L2 32 Z' fill='none' stroke='rgba(212%2C168%2C67%2C0.07)' stroke-width='0.8'/%3E%3C/svg%3E");
    background-size: 64px 64px;
    color: var(--text);
    font-family: var(--sans);
    font-weight: 300;
    line-height: 1.6;
}

/* ── Hero ─────────────────────────────────────── */

.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5rem 3rem;
    overflow: hidden;
    /* Background handled by body + .page-glow */
}

/* Ensure all page sections render above the fixed glow */
.hero, .details, footer { position: relative; z-index: 1; }

.hero-corners,
.om,
.hero-inner,
.scroll-hint { position: relative; z-index: 1; }

/* Music toggle button */
.music-btn {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(15, 5, 8, 0.65);
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border-color 0.2s, color 0.2s;
}

.music-icon {
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.2s;
}

.music-btn:hover { border-color: var(--gold); color: var(--gold-light); }

.music-btn.playing { border-color: var(--gold); }
.music-btn.playing .music-icon {
    animation: noteBounce 0.8s ease-in-out infinite alternate;
}

@keyframes noteBounce {
    from { transform: translateY(0) rotate(-8deg); }
    to   { transform: translateY(-3px) rotate(8deg); }
}

/* Corner ornaments */
.hero-corners {
    position: absolute;
    inset: 1.8rem;
    pointer-events: none;
}

.hero-corners span {
    position: absolute;
    width: 52px;
    height: 52px;
    border-color: rgba(212, 168, 67, 0.32);
    border-style: solid;
}

.hero-corners span:nth-child(1) { top: 0;    left: 0;  border-width: 1px 0 0 1px; }
.hero-corners span:nth-child(2) { top: 0;    right: 0; border-width: 1px 1px 0 0; }
.hero-corners span:nth-child(3) { bottom: 0; left: 0;  border-width: 0 0 1px 1px; }
.hero-corners span:nth-child(4) { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

/* Om symbol */
.om {
    font-size: 2.6rem;
    color: var(--gold);
    opacity: 0.65;
    margin-bottom: 1.8rem;
    line-height: 1;
    animation: fadeDown 1.2s ease both 0s;
    /* Broad font stack so Devanagari renders well on all devices */
    font-family: 'Noto Sans Devanagari', 'Noto Serif Devanagari', Georgia, serif;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 760px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 2rem;
    animation: fadeDown 1s ease both 0.15s;
}

.names {
    font-family: var(--serif);
    font-weight: 300;
    font-size: clamp(5rem, 16vw, 11.5rem);
    line-height: 0.92;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2.8rem;
    letter-spacing: -0.01em;
}

.name-top { animation: fadeLeft  1.2s cubic-bezier(0.16,1,0.3,1) both 0.2s; }
.name-bot { animation: fadeRight 1.2s cubic-bezier(0.16,1,0.3,1) both 0.2s; }

.ampersand {
    font-family: var(--script);
    font-size: 0.48em;
    line-height: 1.6;
    color: var(--gold);
    font-weight: 400;
    animation: fadeUp 1s ease both 0.42s;
}

.hero-meta {
    animation: fadeUp 1s ease both 0.65s;
    margin-bottom: 3rem;
}

.meta-date {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1.15rem, 2.8vw, 1.55rem);
    color: var(--muted);
    letter-spacing: 0.06em;
    margin-bottom: 0.45rem;
}

.meta-time {
    font-size: 0.75rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--gold);
}

/* Countdown */
.countdown {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin: 2rem 0 2.5rem;
    animation: fadeUp 1s ease both 0.78s;
}

.cd-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.cd-num {
    font-family: var(--serif);
    font-weight: 300;
    font-size: clamp(2rem, 5vw, 2.8rem);
    line-height: 1;
    min-width: 2ch;
    text-align: center;
}

.cd-label {
    font-size: 0.65rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--gold);
}

.cd-dot {
    color: var(--gold);
    opacity: 0.35;
    font-size: 0.65rem;
    padding-bottom: 1.2rem;
}

/* RSVP trigger button */
.rsvp-open {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-family: var(--sans);
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.45em;
    text-transform: uppercase;
    padding: 1rem 3.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: color 0.35s;
    animation: fadeUp 1s ease both 1s;
}

.rsvp-open .btn-fill {
    position: absolute;
    inset: 0;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
}

.rsvp-open .btn-label {
    position: relative;
    z-index: 1;
}

.rsvp-open:hover { color: var(--bg); }
.rsvp-open:hover .btn-fill { transform: scaleX(1); }

.scroll-hint {
    position: absolute;
    bottom: 1.6rem;
    font-size: 0.65rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--muted);
    animation: fadeUp 1s ease both 1.4s, pulse 3s ease-in-out infinite 2.2s;
}

/* ── Keyframes ────────────────────────────────── */

@keyframes fadeUp    { from { opacity: 0; transform: translateY(22px);  } to { opacity: 1; transform: none; } }
@keyframes fadeDown  { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
@keyframes fadeLeft  { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes fadeRight { from { opacity: 0; transform: translateX(24px);  } to { opacity: 1; transform: none; } }
@keyframes pulse     { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.55; } }
@keyframes modalIn   { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }

/* ── Scroll reveal ────────────────────────────── */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

/* ── Details section ──────────────────────────── */

.details {
    max-width: 680px;
    margin: 0 auto;
    padding: 7rem 2.5rem;
    text-align: center;
}

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.div-line {
    flex: 1;
    height: 1px;
    background-image: repeating-linear-gradient(
        to right,
        var(--gold-dim) 0px,
        var(--gold-dim) 4px,
        transparent 4px,
        transparent 10px
    );
    -webkit-mask-image: linear-gradient(to right, transparent, black 30%, black 70%, transparent);
    mask-image:         linear-gradient(to right, transparent, black 30%, black 70%, transparent);
}

.div-glyph {
    color: var(--gold);
    font-size: 0.6rem;
    opacity: 0.65;
    flex-shrink: 0;
    padding: 0 0.2rem;
}

.section-heading {
    font-family: var(--serif);
    font-weight: 300;
    font-size: clamp(2.2rem, 5.5vw, 3.6rem);
    letter-spacing: 0.08em;
    margin-bottom: 3rem;
}

.event-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.info-date {
    font-family: var(--serif);
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 300;
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
}

.info-time {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1.15rem, 2.8vw, 1.45rem);
    color: var(--muted);
    letter-spacing: 0.04em;
}

/* Calendar button */
.cal-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0.4rem 0;
    margin-top: 0.8rem;
    transition: color 0.2s;
}

.cal-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.cal-btn:hover { color: var(--gold); }

.info-sep {
    display: block;
    color: var(--gold);
    opacity: 0.4;
    font-size: 0.6rem;
    letter-spacing: 0.5em;
    margin: 1.8rem 0;
}

.info-venue {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--serif);
    font-size: clamp(1.15rem, 2.5vw, 1.35rem);
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--gold-dim);
    padding-bottom: 3px;
    transition: color 0.25s, border-color 0.25s;
}

.info-venue:hover {
    color: var(--gold-light);
    border-color: var(--gold);
}

.arrow-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.info-venue:hover .arrow-icon {
    transform: translateX(3px);
}

/* ── Footer ───────────────────────────────────── */

footer {
    text-align: center;
    padding: 2.5rem;
    border-top: 1px solid var(--gold-dim);
}

.footer-mark {
    color: var(--gold);
    opacity: 0.3;
    font-size: 0.65rem;
    letter-spacing: 0.5em;
    margin-bottom: 0.8rem;
}

footer p {
    font-size: 0.72rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ── Modal overlay ────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 3, 5, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.modal-overlay.open {
    opacity: 1;
}

/* ── Modal card ───────────────────────────────── */

.modal-card {
    position: relative;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 100% 80% at 50% 0%, #20080e 0%, transparent 60%),
        url("data:image/svg+xml,%3Csvg width='64' height='64' viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M32 2 L62 32 L32 62 L2 32 Z' fill='none' stroke='rgba(212%2C168%2C67%2C0.07)' stroke-width='0.8'/%3E%3C/svg%3E");
    background-size: auto, 64px 64px;
    border: 1px solid var(--gold-dim);
    padding: 3.5rem 3rem;
    width: 100%;
    max-width: 440px;
    text-align: center;
    animation: modalIn 0.4s cubic-bezier(0.16,1,0.3,1) both;
}

/* Modal corner ornaments */
.modal-corners {
    position: absolute;
    inset: 1rem;
    pointer-events: none;
}

.modal-corners span {
    position: absolute;
    width: 28px;
    height: 28px;
    border-color: rgba(212, 168, 67, 0.3);
    border-style: solid;
}

.modal-corners span:nth-child(1) { top: 0;    left: 0;  border-width: 1px 0 0 1px; }
.modal-corners span:nth-child(2) { top: 0;    right: 0; border-width: 1px 1px 0 0; }
.modal-corners span:nth-child(3) { bottom: 0; left: 0;  border-width: 0 0 1px 1px; }
.modal-corners span:nth-child(4) { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

/* Close button */
.modal-close {
    position: absolute;
    top: 1.2rem;
    right: 1.3rem;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.3rem;
    transition: color 0.2s;
    z-index: 1;
}

.modal-close:hover { color: var(--gold); }

/* ── Modal steps ──────────────────────────────── */

.modal-step {
    animation: fadeUp 0.4s ease both;
}

.modal-ornament {
    color: var(--gold);
    font-size: 0.7rem;
    opacity: 0.55;
    letter-spacing: 0.4em;
    margin-bottom: 1.8rem;
}

.modal-ornament.large {
    font-size: 1.6rem;
    display: block;
    margin-bottom: 1.5rem;
}

.modal-heading {
    font-family: var(--serif);
    font-weight: 300;
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    line-height: 1.2;
    letter-spacing: 0.04em;
    margin-bottom: 2.5rem;
}

.modal-heading--italic {
    font-style: italic;
    margin-bottom: 1rem;
}

.modal-sub {
    font-family: var(--serif);
    font-style: italic;
    color: var(--muted);
    font-size: 1.25rem;
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* ── Choice buttons (step 1) ──────────────────── */

.choice-btns {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.choice-btn {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-family: var(--serif);
    font-size: 1.3rem;
    letter-spacing: 0.06em;
    padding: 1rem 2rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: color 0.3s;
}

.choice-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.choice-btn span,
.choice-btn { position: relative; }

.choice-btn:hover { color: var(--bg); }
.choice-btn:hover::before { transform: scaleX(1); }

.choice-btn--ghost {
    border-color: var(--gold-dim);
    color: var(--muted);
}

.choice-btn--ghost::before { background: rgba(212,168,67,0.12); }
.choice-btn--ghost:hover { color: var(--text); }
.choice-btn--ghost:hover::before { transform: scaleX(1); }

/* ── Form inside modal ────────────────────────── */

#rsvpForm {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: left;
    margin-top: 0.5rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.field label,
.field-label {
    font-size: 0.72rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold);
}

input[type="text"] {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--gold-dim);
    color: var(--text);
    font-family: var(--serif);
    font-size: 1.2rem;
    padding: 0.5rem 0;
    outline: none;
    width: 100%;
    transition: border-color 0.25s;
}

input[type="text"]::placeholder {
    color: var(--muted);
    font-style: italic;
}

input[type="text"]:focus { border-bottom-color: var(--gold); }

/* Pax stepper */
.pax-field { animation: fadeUp 0.4s ease both; }

.stepper {
    display: flex;
    align-items: center;
    gap: 1.6rem;
}

.step-btn {
    width: 34px;
    height: 34px;
    background: transparent;
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}

.step-btn:hover {
    background: rgba(212, 168, 67, 0.1);
    border-color: var(--gold);
}

.step-val {
    font-family: var(--serif);
    font-weight: 300;
    font-size: 2.4rem;
    color: var(--text);
    min-width: 2ch;
    text-align: center;
    line-height: 1;
}

/* Form actions row */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.back-link {
    background: none;
    border: none;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.back-link:hover { color: var(--gold); }

/* Submit button */
.submit-btn {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-family: var(--sans);
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    padding: 0.9rem 2.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: color 0.35s;
}

.btn-fill {
    position: absolute;
    inset: 0;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
}

.btn-label {
    position: relative;
    z-index: 1;
}

.submit-btn:hover:not(:disabled) { color: var(--bg); }
.submit-btn:hover:not(:disabled) .btn-fill { transform: scaleX(1); }
.submit-btn:disabled { opacity: 0.35; cursor: default; pointer-events: none; }

.modal-error {
    color: #b07070;
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.05rem;
    margin-top: 1rem;
    text-align: center;
}

/* ── Mobile ───────────────────────────────────── */

@media (max-width: 560px) {
    /* Hero */
    .hero { padding: 4rem 1.5rem 5rem; }
    .hero-corners { inset: 1rem; }
    .hero-corners span { width: 30px; height: 30px; }

    .om { font-size: 2rem; }

    .names { font-size: clamp(3.6rem, 14vw, 5rem); }

    /* RSVP trigger — full width, easier to tap */
    .rsvp-open {
        width: 100%;
        max-width: 280px;
        padding: 1.1rem 2rem;
    }

    /* Details */
    .details { padding: 4.5rem 1.5rem; }

    .info-venue {
        /* Bigger tap target */
        padding: 0.6rem 0;
    }

    /* Modal — bottom sheet on mobile */
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal-card {
        max-width: 100%;
        width: 100%;
        padding: 2.5rem 1.8rem 2.5rem;
        border-left: none;
        border-right: none;
        border-bottom: none;
        border-radius: 12px 12px 0 0;
        /* Prevent content from going under home indicator on iOS */
        padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
    }

    .modal-corners { display: none; }

    /* Add a drag handle visual */
    .modal-card::before {
        content: '';
        display: block;
        width: 36px;
        height: 3px;
        background: var(--gold-dim);
        border-radius: 2px;
        margin: 0 auto 2rem;
    }

    /* Touch-friendly tap targets */
    .step-btn {
        width: 44px;
        height: 44px;
    }

    .back-link {
        padding: 0.8rem 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .choice-btn {
        padding: 1.1rem 2rem;
        min-height: 52px;
    }

    .submit-btn {
        padding: 1.1rem 2.5rem;
        min-height: 48px;
    }

    footer p {
        letter-spacing: 0.08em;
    }

    .music-btn {
        width: 32px;
        height: 32px;
        top: 1rem;
        right: 1rem;
        opacity: 0.55;
    }

    .music-icon { font-size: 0.9rem; }
}
