:root {
    --bg: #f7f1e9;
    --ink: #2f2925;
    --card: rgba(255, 255, 255, 0.78);
    --accent: #d8a97c;
    --accent-strong: #c2845f;
    --text: #2f2925;
    --muted: #6c6058;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Work Sans', system-ui, sans-serif;
    background: radial-gradient(circle at 18% 18%, rgba(216, 169, 124, 0.18), transparent 30%),
        radial-gradient(circle at 80% 0%, rgba(194, 132, 95, 0.16), transparent 28%),
        linear-gradient(150deg, #fdf9f5 0%, #f6efe7 55%, #f2e7db 100%);
    color: var(--text);
    overflow-x: hidden;
    position: relative;
}

html {
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(120px 90px at 18% 22%, rgba(216, 169, 124, 0.12), transparent 55%),
        radial-gradient(160px 120px at 78% 12%, rgba(194, 132, 95, 0.1), transparent 60%),
        radial-gradient(110px 80px at 72% 68%, rgba(216, 169, 124, 0.12), transparent 55%),
        radial-gradient(130px 100px at 16% 78%, rgba(194, 132, 95, 0.08), transparent 60%),
        repeating-linear-gradient(135deg, rgba(216, 169, 124, 0.06) 0 14px, transparent 14px 28px);
    mix-blend-mode: multiply;
    opacity: 0.6;
    z-index: -1;
}

header {
    position: relative;
    padding: 96px 24px 56px;
    text-align: center;
    overflow: hidden;
}

header::before,
header::after {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    border: 1px solid rgba(216, 169, 124, 0.25);
    border-radius: 50%;
    filter: blur(1px);
    pointer-events: none;
    z-index: 0;
}

header::before {
    top: -120px;
    left: -120px;
}

header::after {
    bottom: -180px;
    right: -120px;
}

header .floral {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(90px 70px at 18% 30%, rgba(216, 169, 124, 0.28), transparent 60%),
        radial-gradient(120px 90px at 82% 18%, rgba(194, 132, 95, 0.24), transparent 60%);
    opacity: 0.6;
    mix-blend-mode: multiply;
}

nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    z-index: 1;
    position: relative;
}

nav a {
    color: var(--ink);
    text-decoration: none;
    padding: 10px 16px;
    border: 1px solid rgba(216, 169, 124, 0.35);
    border-radius: 999px;
    backdrop-filter: blur(6px);
    transition: all 0.2s ease;
}

nav a:hover {
    color: var(--ink);
    border-color: var(--accent);
    background: rgba(216, 169, 124, 0.14);
}

.hero {
    position: relative;
    max-width: 980px;
    margin: 0 auto;
    padding: 12px;
    z-index: 1;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(216, 169, 124, 0.16);
    color: var(--ink);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 13px;
}

.tag span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(230, 154, 123, 0.6);
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(42px, 6vw, 72px);
    margin: 18px 0 12px;
    letter-spacing: 1px;
}

.date {
    font-size: 18px;
    color: var(--muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 32px;
}

.cta-row {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.btn {
    border: none;
    cursor: pointer;
    padding: 14px 22px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 16px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn.primary {
    background: linear-gradient(120deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #1f120c;
    box-shadow: 0 10px 28px rgba(194, 132, 95, 0.28);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.82);
    color: var(--ink);
    border: 1px solid rgba(216, 169, 124, 0.35);
}

.btn:hover {
    transform: translateY(-2px);
}

.section {
    padding: 72px 24px;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.section::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(216, 169, 124, 0.4) 50%, transparent 100%);
    opacity: 0.8;
    pointer-events: none;
}

.section::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    bottom: -90px;
    right: 0;
    background: radial-gradient(140px 120px at 50% 50%, rgba(216, 169, 124, 0.06), transparent 70%);
    pointer-events: none;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 28px;
}

.card {
    background: var(--card);
    border: 1px solid rgba(216, 169, 124, 0.24);
    border-radius: 18px;
    padding: 22px;
    backdrop-filter: blur(8px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.card h3 {
    font-family: 'Playfair Display', serif;
    margin: 0 0 10px;
    font-size: 22px;
    color: var(--accent-strong);
}

.card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.story {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    align-items: center;
}

.story img,
.gallery img {
    width: 100%;
    border-radius: 18px;
    border: 1px solid rgba(216, 169, 124, 0.22);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.16);
    object-fit: cover;
}

.story p {
    color: var(--muted);
    line-height: 1.8;
    font-size: 17px;
}

.timeline {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 12px;
    align-items: start;
}

.timeline-date {
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.registry {
    background: radial-gradient(circle at 20% 20%, rgba(216, 169, 124, 0.22), transparent 38%),
        rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(216, 169, 124, 0.24);
    border-radius: 20px;
    padding: 38px;
    text-align: center;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.14);
}

.registry p {
    color: var(--muted);
    max-width: 700px;
    margin: 12px auto 22px;
    line-height: 1.6;
}

footer {
    text-align: center;
    padding: 48px 24px 60px;
    color: var(--muted);
    font-size: 14px;
    border-top: 1px solid rgba(216, 169, 124, 0.22);
    margin-top: 40px;
}

/* Scrollbar styling (global + modal) */
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-strong) rgba(216, 169, 124, 0.12);
}

/* WebKit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(216, 169, 124, 0.08);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-strong) 0%, #a96a47 100%);
}

/* Modal content specific scrollbar to match card aesthetics */
.modal-content::-webkit-scrollbar {
    width: 10px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(216, 169, 124, 0.10);
    border-radius: 12px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.92) 100%);
    border: 1px solid rgba(216, 169, 124, 0.3);
    border-radius: 18px;
    padding: 20px 18px;
    max-width: min(460px, 92vw);
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    position: relative;
    backdrop-filter: blur(10px);
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 12px 0;
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--muted);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

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

.modal-header {
    text-align: center;
    margin-bottom: 32px;
}

.modal-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    margin: 0 0 8px;
    color: var(--accent-strong);
}

.modal-header p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.convite-info {
    display: grid;
    gap: 20px;
    margin: 28px 0;
}

.convite-field {
    background: rgba(216, 169, 124, 0.08);
    border-left: 4px solid var(--accent);
    padding: 16px;
    border-radius: 8px;
}

.convite-field label {
    display: block;
    font-weight: 600;
    color: var(--accent-strong);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.convite-field p {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
}

.convite-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(216, 169, 124, 0.3);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--text);
    transition: border-color 0.2s ease;
}

.convite-field input:focus {
    outline: none;
    border-color: var(--accent);
}

.modal-footer {
    text-align: center;
    margin-top: auto;
    display: flex;
    gap: 12px;
    justify-content: center;
    position: sticky;
    bottom: 0;
    background: transparent;
    border: none;
    padding: 12px;
    box-shadow: none;
    z-index: 1;
}

.modal-btn {
    border: none;
    cursor: pointer;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-btn.primary {
    background: linear-gradient(120deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #1f120c;
}

.modal-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(194, 132, 95, 0.18);
}

.modal-btn.secondary {
    background: rgba(216, 169, 124, 0.14);
    color: var(--accent-strong);
}

.modal-btn.secondary:hover {
    background: rgba(216, 169, 124, 0.24);
}

.modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.convite-card {
    background: linear-gradient(135deg, rgba(253, 249, 245, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
    border: 2px solid var(--accent);
    border-radius: 14px;
    padding: 24px 18px;
    text-align: center;
    position: relative;
    overflow-y: auto;
    margin: 0 0 16px;
    max-height: calc(80vh - 200px);
}

.convite-card::before,
.convite-card::after {
    content: "✦";
    position: absolute;
    font-size: 20px;
    color: var(--accent);
    opacity: 0.4;
}

.convite-card::before {
    top: 16px;
    left: 16px;
}

.convite-card::after {
    bottom: 16px;
    right: 16px;
}

.convite-card-decoration {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    margin: 16px 0;
}

.convite-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 12px;
    letter-spacing: 3px;
    color: var(--accent-strong);
    text-transform: uppercase;
    margin: 12px 0 4px;
    font-weight: 400;
}

.noivos-names {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    color: var(--accent-strong);
    margin: 12px 0 8px;
    font-weight: 600;
    letter-spacing: 1px;
}

.noivos-and {
    font-size: 18px;
    color: var(--accent);
    margin: -6px 0 12px;
    font-style: italic;
}

.convite-card-subtitle {
    font-size: 13px;
    color: var(--muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 20px;
}

.convite-details {
    margin: 20px 0;
    display: grid;
    gap: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
}

.detail-icon {
    font-size: 18px;
    margin-bottom: 4px;
    opacity: 0.7;
}

.detail-label {
    font-size: 10px;
    color: var(--accent-strong);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 3px;
}

.detail-value {
    font-size: 14px;
    color: var(--text);
    line-height: 1.4;
}

.guest-name-section {
    background: rgba(216, 169, 124, 0.06);
    padding: 16px;
    border-radius: 10px;
    margin: 20px 0;
}

.guest-name-section label {
    display: block;
    font-size: 11px;
    color: var(--accent-strong);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 8px;
}

.guest-name-display {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    text-align: center;
    color: var(--text);
    font-weight: 500;
}

.convite-footer-text {
    font-size: 13px;
    color: var(--muted);
    font-style: italic;
    margin-top: 20px;
    line-height: 1.6;
}

.rsvp-status {
    margin-top: 14px;
    background: rgba(216, 169, 124, 0.08);
    border-left: 4px solid var(--accent);
    padding: 12px;
    border-radius: 8px;
    color: var(--accent-strong);
    font-weight: 600;
    text-align: center;
}

@media (max-width: 768px) {
    header {
        padding: 72px 18px 48px;
    }

    .hero {
        padding: 0 6px;
    }

    nav {
        gap: 10px;
    }

    .cta-row {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .section {
        padding: 56px 18px;
    }

    .timeline-item {
        grid-template-columns: 1fr;
    }

    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .section::after {
        display: none;
    }

    .modal-content {
        max-width: 94vw;
    }
}