/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Playfair Display', 'Georgia', serif;
    line-height: 1.6;
    color: #3A2024;
    background: #FFF8F0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(201, 168, 130, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(201, 168, 130, 0.06) 0%, transparent 50%);
    background-attachment: fixed;
    border: 12px solid #c9a882;
    box-shadow: 
        inset 0 0 0 2px #F2E8DC, 
        inset 0 0 0 3px #c9a882,
        inset 0 0 120px rgba(201, 168, 130, 0.04);
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3CfeColorMatrix values='0 0 0 0 0, 0 0 0 0 0, 0 0 0 0 0, 0 0 0 0.03 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noise)'/%3E%3C/svg%3E"),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(139,26,43,.02) 2px, rgba(139,26,43,.02) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,.008) 2px, rgba(0,0,0,.008) 4px);
    pointer-events: none;
    opacity: 0.4;
    z-index: 1;
}

body > *:not(.corner-ornament) {
    position: relative;
    z-index: 2;
}

::selection {
    background-color: #c9a882;
    color: #fff;
}

/* Hero Section */
.hero {
    position: relative;
    width: calc(100% - 10px);
    height: 620px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px;
}

.header-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: sepia(0.15) saturate(1.1);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(30, 20, 12, 0.35) 0%,
        rgba(30, 20, 12, 0.45) 35%,
        rgba(30, 20, 12, 0.35) 65%,
        rgba(255, 248, 240, 0.5) 100%
    );
    z-index: 1;
}

.hero-text {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    text-shadow: 
        0 2px 16px rgba(0, 0, 0, 0.6),
        0 0 50px rgba(201, 168, 130, 0.25);
    padding: 3rem 2rem 2rem;
}

/* Hero entrance animation */
@keyframes heroFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-text > * {
    animation: heroFadeIn 1s ease-out both;
}

.hero-text > :nth-child(1) { animation-delay: 0.3s; }
.hero-text > :nth-child(2) { animation-delay: 0.6s; }
.hero-text > :nth-child(3) { animation-delay: 0.9s; }
.hero-text > :nth-child(4) { animation-delay: 1.1s; }
.hero-text > :nth-child(5) { animation-delay: 1.4s; }
.hero-text > :nth-child(6) { animation-delay: 1.7s; }

.hero-intro {
    font-size: 1.15rem;
    letter-spacing: 0.04em;
    text-transform: none;
    font-weight: 400;
    opacity: 1;
    margin-bottom: 1.8rem;
    font-family: 'Playfair Display', 'Georgia', serif;
}

.hero-text h1,
.hero-name {
    font-size: 3.2rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    margin: 0.25rem 0;
    font-variant: small-caps;
    font-family: 'Cormorant SC', 'Georgia', serif;
}

.ampersand {
    font-size: 2.4rem;
    font-style: italic;
    margin: 0.6rem 0;
    font-weight: 300;
    opacity: 0.85;
    color: #c9a882;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
}

.wedding-date {
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 300;
    margin-top: 1.8rem;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
}

/* Fleur-de-lis ornament */
.fleur-de-lis {
    color: #c9a882;
    opacity: 0.5;
    filter: drop-shadow(0 0 6px rgba(201, 168, 130, 0.15));
}

.fleur-hero {
    margin-top: 2rem;
}

.fleur-hero .fleur-de-lis {
    color: rgba(255, 255, 255, 0.7);
    opacity: 0.7;
    filter: drop-shadow(0 0 8px rgba(201, 168, 130, 0.3));
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.4s ease;
}

.scroll-line {
    display: block;
    width: 1px;
    height: 48px;
    background: linear-gradient(180deg, transparent, rgba(201, 168, 130, 0.8));
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; transform: scaleY(0.7); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* Hero fade edge */
.hero-fade-edge {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(to bottom, transparent, #FFF8F0);
    z-index: 2;
    pointer-events: none;
}

/* Section Dividers */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    margin: 2.5rem 0;
    padding: 0 1rem;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 168, 130, 0.3), transparent);
    max-width: 120px;
}

.section-divider .fleur-de-lis {
    opacity: 0.45;
}

/* Main Content */
main {
    max-width: 780px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Welcome Section */
.welcome {
    text-align: center;
    padding: 0 1rem;
}

.welcome h2 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: #8a6a3e;
    letter-spacing: 0.05em;
    font-variant: small-caps;
    font-family: 'Cormorant SC', 'Georgia', serif;
    text-shadow: none;
}

.welcome p {
    font-size: 1.15rem;
    color: #5c4830;
    line-height: 1.5;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
}

.welcome-location {
    margin-top: 0.5rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.95rem !important;
    color: #8c7a5a !important;
}

/* Events Section */
.events {
    text-align: center;
    padding: 0 1rem;
}

.events h2 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 1.2rem;
    color: #8a6a3e;
    letter-spacing: 0.05em;
    font-variant: small-caps;
    font-family: 'Cormorant SC', 'Georgia', serif;
    text-shadow: none;
}

.event {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(201, 168, 130, 0.18);
}

.event:last-child {
    border-bottom: none;
}

.event h3 {
    font-size: 1.8rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
    color: #4a3b27;
    letter-spacing: 0.03em;
    font-family: 'Cormorant SC', 'Georgia', serif;
}

.event-date {
    font-size: 1.15rem;
    color: #4a3b27;
    margin: 0.3rem 0;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    letter-spacing: 0.04em;
}

.event-year {
    font-size: 1rem;
    color: #6e5838;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    letter-spacing: 0.06em;
    margin: 0.15rem 0;
}

.event-time {
    font-size: 1rem;
    color: #5c4830;
    font-style: italic;
    margin: 0.4rem 0 0;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
}

.event-location-block {
    margin: 1rem 0 0;
}

.event-location {
    font-size: 1.05rem;
    color: #4a3b27;
    margin: 0;
    line-height: 1.6;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    letter-spacing: 0.03em;
}

.event-city {
    font-size: 0.95rem;
    color: #6e5838;
    margin: 0.15rem 0 0;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    letter-spacing: 0.06em;
}

.event-attire {
    color: #8c7a5a;
    font-style: italic;
    margin: 1.2rem 0 0 0;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.8rem;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
}

.event-description {
    font-size: 1rem;
    color: #5c4830;
    margin-top: 0.5rem;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
}

/* RSVP Section */
.rsvp {
    text-align: center;
    padding: 0 1rem;
}

.rsvp h2 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: #8a6a3e;
    letter-spacing: 0.05em;
    font-variant: small-caps;
    font-family: 'Cormorant SC', 'Georgia', serif;
    text-shadow: none;
}

.rsvp-intro {
    font-size: 1.2rem;
    color: #5c4830;
    margin-bottom: 0.3rem;
    line-height: 1.5;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
}

.rsvp-sub {
    font-size: 1rem;
    color: #8c7a5a;
    font-style: italic;
    margin-bottom: 1.8rem;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    letter-spacing: 0.03em;
}

.rsvp-button {
    display: inline-block;
    padding: 1rem 3rem;
    background-color: #c9a882;
    color: #FFF8F0;
    text-decoration: none;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
    border: 2px solid #c9a882;
    transition: all 0.4s ease;
    font-variant: small-caps;
    font-family: 'Cormorant SC', 'Georgia', serif;
    box-shadow: 0 0 20px rgba(201, 168, 130, 0.18);
}

.rsvp-button:hover {
    background-color: transparent;
    color: #c9a882;
    box-shadow: 0 0 30px rgba(201, 168, 130, 0.3);
}

/* Registry Section */
.registry {
    text-align: center;
    padding: 0 1rem;
}

.registry h2 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: #8a6a3e;
    letter-spacing: 0.05em;
    font-variant: small-caps;
    font-family: 'Cormorant SC', 'Georgia', serif;
    text-shadow: none;
}

.registry-intro {
    font-size: 1.2rem;
    color: #5c4830;
    margin-bottom: 0.3rem;
    line-height: 1.5;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
}

.registry-sub {
    font-size: 1rem;
    color: #8c7a5a;
    font-style: italic;
    margin-bottom: 1.8rem;
    line-height: 1.5;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    letter-spacing: 0.03em;
}

.registry-button {
    display: inline-block;
    padding: 1rem 3rem;
    background-color: transparent;
    color: #c9a882;
    text-decoration: none;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
    border: 2px solid #c9a882;
    transition: all 0.4s ease;
    font-variant: small-caps;
    font-family: 'Cormorant SC', 'Georgia', serif;
    box-shadow: 0 0 20px rgba(201, 168, 130, 0.1);
}

.registry-button:hover {
    background-color: #c9a882;
    color: #FFF8F0;
    box-shadow: 0 0 30px rgba(201, 168, 130, 0.3);
}

/* Footer */
footer {
    background-color: transparent;
    text-align: center;
    padding: 2.5rem 2.5rem 2rem;
    color: #8c7a5a;
    font-size: 0.9rem;
    letter-spacing: 0.2em;
}

.footer-fleur {
    margin-bottom: 1.2rem;
}

.footer-fleur .fleur-de-lis {
    opacity: 0.35;
}

.footer-monogram {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-size: 1.8rem;
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.2em;
    color: #8a6a3e;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.footer-date {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-size: 0.85rem;
    letter-spacing: 0.25em;
    color: #8c7a5a;
    text-transform: none;
}

/* Fade-in Animation */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s cubic-bezier(0.23, 1, 0.32, 1), transform 0.9s cubic-bezier(0.23, 1, 0.32, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}


/* Responsive Design — Tablet & small laptops */
@media (max-width: 768px) {
    body {
        border-width: 8px;
    }

    .hero {
        height: 440px;
    }

    .hero-text {
        padding: 2.5rem 1.5rem 1.5rem;
    }

    .hero-text h1,
    .hero-name {
        font-size: 2rem;
        letter-spacing: 0.05em;
    }

    .hero-intro {
        font-size: 0.85rem;
        margin-bottom: 1.2rem;
    }

    .ampersand {
        font-size: 1.8rem;
        margin: 0.4rem 0;
    }

    .wedding-date {
        font-size: 0.8rem;
        letter-spacing: 0.14em;
        margin-top: 1.2rem;
    }

    .fleur-hero {
        margin-top: 1.2rem;
    }

    .scroll-indicator {
        bottom: 1.2rem;
    }

    .scroll-line {
        height: 32px;
    }

    main {
        padding: 2rem 1.5rem;
    }

    .welcome,
    .events,
    .rsvp,
    .registry {
        padding: 0 0.5rem;
    }

    .welcome h2,
    .events h2,
    .rsvp h2,
    .registry h2 {
        font-size: 2rem;
    }

    .welcome p,
    .rsvp-intro,
    .registry-intro {
        font-size: 1.05rem;
    }

    .event-date {
        font-size: 1.05rem;
    }

    .rsvp-button,
    .registry-button {
        padding: 0.9rem 2.4rem;
        font-size: 1rem;
    }

    .section-divider {
        margin: 2rem 0;
    }

    .divider-line {
        max-width: 90px;
    }

    footer {
        padding: 2rem 1.5rem 1.5rem;
    }

    .footer-monogram {
        font-size: 1.5rem;
    }
}

/* Responsive Design — Mobile phones */
@media (max-width: 480px) {
    body {
        border-width: 6px;
    }

    .hero {
        height: 400px;
    }

    .hero-text {
        padding: 2rem 1rem 1rem;
    }

    .hero-text h1,
    .hero-name {
        font-size: 1.55rem;
        letter-spacing: 0.03em;
    }

    .hero-intro {
        font-size: 0.75rem;
        margin-bottom: 1rem;
        letter-spacing: 0.02em;
    }

    .ampersand {
        font-size: 1.4rem;
        margin: 0.3rem 0;
    }

    .wedding-date {
        font-size: 0.7rem;
        letter-spacing: 0.1em;
        margin-top: 1rem;
    }

    .fleur-hero {
        margin-top: 0.8rem;
    }

    .fleur-hero .fleur-de-lis {
        width: 30px;
        height: 36px;
    }

    .scroll-indicator {
        bottom: 0.8rem;
    }

    .scroll-line {
        height: 24px;
    }

    .hero-fade-edge {
        height: 50px;
    }

    main {
        padding: 1.5rem 1rem;
    }

    .welcome,
    .events,
    .rsvp,
    .registry {
        padding: 0 0.25rem;
    }

    .welcome h2,
    .events h2,
    .rsvp h2,
    .registry h2 {
        font-size: 1.6rem;
        letter-spacing: 0.03em;
    }

    .welcome p,
    .rsvp-intro,
    .registry-intro {
        font-size: 0.95rem;
    }

    .rsvp-sub,
    .registry-sub {
        font-size: 0.9rem;
    }

    .event-date {
        font-size: 1rem;
    }

    .event-time {
        font-size: 0.9rem;
    }

    .event-location {
        font-size: 0.95rem;
    }

    .event-city {
        font-size: 0.85rem;
    }

    .event-attire {
        font-size: 0.75rem;
        letter-spacing: 0.08em;
    }

    .rsvp-button,
    .registry-button {
        display: block;
        width: 100%;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
        padding: 0.85rem 1.5rem;
        font-size: 0.95rem;
        text-align: center;
    }

    .section-divider {
        margin: 1.5rem 0;
        gap: 0.8rem;
    }

    .divider-line {
        max-width: 60px;
    }

    .section-divider .fleur-de-lis {
        width: 22px;
        height: 26px;
    }

    footer {
        padding: 1.5rem 1rem 1.2rem;
    }

    .footer-monogram {
        font-size: 1.3rem;
    }

    .footer-date {
        font-size: 0.75rem;
    }
}

/* Very small phones (iPhone SE, Galaxy S series, etc.) */
@media (max-width: 360px) {
    body {
        border-width: 5px;
    }

    .hero {
        height: 360px;
    }

    .hero-text h1,
    .hero-name {
        font-size: 1.35rem;
    }

    .hero-intro {
        font-size: 0.7rem;
    }

    .ampersand {
        font-size: 1.2rem;
    }

    .wedding-date {
        font-size: 0.65rem;
        letter-spacing: 0.08em;
    }

    .welcome h2,
    .events h2,
    .rsvp h2,
    .registry h2 {
        font-size: 1.4rem;
    }
}

/* Landscape orientation on phones */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        height: 100vh;
        min-height: 280px;
    }

    .hero-text {
        padding: 1rem;
    }

    .hero-text h1,
    .hero-name {
        font-size: 1.4rem;
        margin: 0.1rem 0;
    }

    .hero-intro {
        margin-bottom: 0.5rem;
        font-size: 0.75rem;
    }

    .ampersand {
        font-size: 1.2rem;
        margin: 0.15rem 0;
    }

    .wedding-date {
        margin-top: 0.5rem;
    }

    .fleur-hero {
        margin-top: 0.5rem;
    }

    .scroll-indicator {
        display: none;
    }
}

/* Safe area insets for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    footer {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {
    .rsvp-button,
    .registry-button {
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fade-in {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .scroll-line {
        animation: none;
    }

    .hero-text > * {
        animation: none;
        opacity: 1;
    }
}
