/* ==========================================================================
   Custom Fonts
   ========================================================================== */

@font-face {
    font-family: 'Andes';
    src: url('fonts/Andes.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   Global Styles & Art Deco Foundations
   ========================================================================== */

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

:root {
    --color-bg: #0b0b0f;
    --color-bg-card: #0e0e14;
    --color-gold: #c9a84c;
    --color-gold-light: #d4bf7a;
    --color-gold-dark: #3d2f14;
    --color-ivory: #f5f0e8;
    --color-cream: #e8dcc8;
    --color-text: #e8e0d0;
    --color-text-dim: #9e927a;
    --color-border: rgba(201, 168, 76, 0.35);

    /* Layout */
    --section-width: 780px;
    /* Elegant, not full width — uses generous surrounding whitespace */
    --facts-width: 1000px;
    /* Wider for the 4-column facts grid */
    --container-width: 1100px;
    /* Outer container */

    /* Font Roles */
    --font-heading: 'Andes', 'Cinzel', serif;
    /* Primary Display: Elegant, normal case */
    --font-accent: 'Cinzel', 'Playfair Display', serif;
    /* Secondary Display: Structural, uppercase, wide */
    --font-body: 'Playfair Display', Georgia, serif;
    /* Reading Text: Highly legible, stylish serif */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.8;
    font-size: 18px;
    /* Increased base size for better readability */
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

/* Subtle film grain texture overlay — CSS only */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.035;
    background-image:
        repeating-radial-gradient(circle at 17% 32%, rgba(255, 255, 255, 0.06) 0px, transparent 1px),
        repeating-radial-gradient(circle at 83% 67%, rgba(255, 255, 255, 0.04) 0px, transparent 1px),
        repeating-radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.03) 0px, transparent 2px);
    background-size: 3px 3px, 4px 4px, 5px 5px;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
}

/* ==========================================================================
   Art Deco Decorative Elements
   ========================================================================== */

/* ---- Section Divider ---- */
.deco-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    height: 50px;
    position: relative;
    background: var(--color-bg);
}

.deco-divider::before {
    content: '';
    position: absolute;
    width: 60%;
    max-width: 400px;
    height: 1px;
    background: var(--color-gold);
    top: 50%;
}

.deco-divider::after {
    content: '';
    position: relative;
    width: 12px;
    height: 12px;
    border: 1.5px solid var(--color-gold);
    transform: rotate(45deg);
    background: var(--color-bg);
    z-index: 1;
}

/* ---- Art Deco Fan / Sunburst Ornament ---- */
.deco-fan {
    width: 80px;
    height: 40px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.deco-fan::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 1.5px solid var(--color-gold);
    background: transparent;
}

.deco-fan::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(201, 168, 76, 0.4);
    background: transparent;
}

/* ---- Stepped Art Deco Line ---- */
.deco-stepped-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 25px auto;
    width: 260px;
}

.deco-stepped-line::before,
.deco-stepped-line::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-gold);
}

.deco-stepped-line span {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    padding: 0 10px;
}

.deco-stepped-line span::before {
    content: '';
    width: 3px;
    height: 10px;
    background: var(--color-gold);
}

.deco-stepped-line span::after {
    content: '';
    width: 3px;
    height: 18px;
    background: var(--color-gold);
}

/* ---- Corner Accents (for framed sections) ---- */
.deco-corner {
    position: absolute;
    width: 24px;
    height: 24px;
}

.deco-corner::before,
.deco-corner::after {
    content: '';
    position: absolute;
    background: var(--color-gold);
}

.deco-corner::before {
    width: 24px;
    height: 1.5px;
}

.deco-corner::after {
    width: 1.5px;
    height: 24px;
}

/* Corner positions */
.deco-corner-tl {
    top: -1px;
    left: -1px;
}

.deco-corner-tl::before {
    top: 0;
    left: 0;
}

.deco-corner-tl::after {
    top: 0;
    left: 0;
}

.deco-corner-tr {
    top: -1px;
    right: -1px;
}

.deco-corner-tr::before {
    top: 0;
    right: 0;
}

.deco-corner-tr::after {
    top: 0;
    right: 0;
}

.deco-corner-bl {
    bottom: -1px;
    left: -1px;
}

.deco-corner-bl::before {
    bottom: 0;
    left: 0;
}

.deco-corner-bl::after {
    bottom: 0;
    left: 0;
}

.deco-corner-br {
    bottom: -1px;
    right: -1px;
}

.deco-corner-br::before {
    bottom: 0;
    right: 0;
}

.deco-corner-br::after {
    bottom: 0;
    right: 0;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1,
h2 {
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: none;
    /* Andes requires normal casing */
    letter-spacing: 0.1em;
}

h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    /* Slightly smaller for better fit */
    line-height: 1.25;
    color: var(--color-gold);
    transition: opacity 1s ease;
    min-height: 1.25em;
}

/* Quote display state */
h1.fading {
    opacity: 0;
}

/* Quote Rotation Timer as Ornament */
.quote-timer-track {
    width: 200px;
    /* Slightly wider */
    height: 1px;
    background: rgba(201, 168, 76, 0.3);
    margin: 35px auto 30px;
    /* More spacing */
    position: relative;
    /* Removed overflow: hidden to allow ornament to break out */
}

.quote-timer-track::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border: 1.5px solid var(--color-gold);
    background: var(--color-bg);
    transform: rotate(45deg);
    left: 50%;
    top: 50%;
    margin-left: -5px;
    margin-top: -5px;
    z-index: 5;
}

.quote-timer-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--color-gold);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    /* Increased size */
    margin-bottom: 3.5rem;
    color: var(--color-gold);
    position: relative;
    display: inline-block;
    font-weight: 500;
    letter-spacing: 0.15em;
}

/* Flanking ruled lines for h2 */
h2::before,
h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 1px;
    background: var(--color-gold);
    top: 50%;
}

h2::before {
    right: calc(100% + 28px);
}

h2::after {
    left: calc(100% + 28px);
}

strong {
    color: var(--color-gold);
    font-weight: 600;
}

/* ==========================================================================
   Hero Section — Printed Invitation Card
   ========================================================================== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 80px 30px;
    background: var(--color-bg);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 900px;
    width: 90%;
    /* Fully responsive height - fits content fluidly */
    padding: 80px 60px 60px;
    border: 1px solid var(--color-gold);
    background: var(--color-bg);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    margin: 0 auto;
}

#heroQuote {
    margin-top: 0;
    margin-bottom: 0;
    min-height: 120px;
    /* Base height for 1-2 lines */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.quote-timer-track {
    margin: 35px auto;
    /* Perfectly balanced 35px gap top/bottom */
}

.hero-ornament-top {
    margin-bottom: 20px;
}

/* Outer double-border frame */
.hero-content::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(201, 168, 76, 0.5);
    pointer-events: none;
}

/* Inner accent frame 1 */
.hero-content::after {
    content: '';
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(201, 168, 76, 0.3);
    pointer-events: none;
}

/* Inner accent frame 2 (only for hero for max impact) */
.hero-content-inner-frame {
    position: absolute;
    inset: 22px;
    border: 1px solid rgba(201, 168, 76, 0.1);
    pointer-events: none;
    z-index: 0;
    animation: pulseFrameDeep 6s ease-in-out infinite;
    animation-delay: 4.5s;
}

/* ====== Shared Art Deco Card Style ====== */
/* Reusable triple-border card container matching the hero */
.deco-card {
    position: relative;
    max-width: var(--section-width);
    width: 100%;
    margin: 0 auto;
    padding: 60px 50px;
    border: 1px solid var(--color-gold);
    background: var(--color-bg);
    box-sizing: border-box;
}

.deco-card::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(201, 168, 76, 0.5);
    pointer-events: none;
    z-index: 0;
}

.deco-card::after {
    content: '';
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(201, 168, 76, 0.3);
    pointer-events: none;
    z-index: 0;
}

/* ====== Subtle Frame Pulses ====== */
@keyframes pulseFrameOuter {

    0%,
    100% {
        border-color: var(--color-gold);
    }

    50% {
        border-color: rgba(201, 168, 76, 0.5);
    }
}

@keyframes pulseFrameMid {

    0%,
    100% {
        border-color: rgba(201, 168, 76, 0.5);
    }

    50% {
        border-color: rgba(201, 168, 76, 0.15);
    }
}

@keyframes pulseFrameInner {

    0%,
    100% {
        border-color: rgba(201, 168, 76, 0.3);
    }

    50% {
        border-color: rgba(201, 168, 76, 0.1);
    }
}

@keyframes pulseFrameDeep {

    0%,
    100% {
        border-color: rgba(201, 168, 76, 0.1);
    }

    50% {
        border-color: rgba(201, 168, 76, 0.02);
    }
}

.hero-content,
.deco-card,
.facts-card-wrapper,
.rsvp-form {
    animation: pulseFrameOuter 6s ease-in-out infinite;
}

.hero-content::before,
.deco-card::before,
.facts-card-wrapper::before,
.rsvp-form::before {
    animation: pulseFrameMid 6s ease-in-out infinite;
    animation-delay: 1.5s;
    /* Offset for a shifting shimmer effect */
}

.hero-content::after,
.deco-card::after,
.facts-card-wrapper::after,
.rsvp-form::after {
    animation: pulseFrameInner 6s ease-in-out infinite;
    animation-delay: 3s;
}

/* Hero Ornaments — stepped Art Deco lines */
.hero-ornament {
    position: relative;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    width: 220px;
    flex-shrink: 0;
    /* Prevent squishing */
    z-index: 5;
}

.hero-ornament::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border: 1.5px solid var(--color-gold);
    background: transparent;
    transform: rotate(45deg);
    left: 50%;
    margin-left: -5px;
    z-index: 1;
}

.hero-ornament::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    background: var(--color-gold);
    left: 0;
}

.hero-ornament-top {
    margin-bottom: 30px;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    /* Centered below the card within the hero container */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    animation: fadeInArrow 1s ease forwards 2s, gentleBounce 3s ease-in-out infinite 2s;
    z-index: 20;
}

.scroll-arrow {
    font-size: 5rem;
    /* Balanced size */
    color: var(--color-gold);
    line-height: 1;
    letter-spacing: 0;
    text-decoration: none;
    text-shadow: 0 0 20px rgba(201, 168, 76, 0.4);
    transition: all 0.3s ease;
}

.scroll-arrow:hover {
    opacity: 1;
}

@keyframes fadeInArrow {
    to {
        opacity: 0.8;
    }
}

@keyframes gentleBounce {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(12px);
    }
}

.headline {
    color: var(--color-gold);
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 1.4s ease forwards;
    position: relative;
    /* Once visible, allow fade transitions for quote rotation */
    animation-fill-mode: forwards;
}

/* After initial animation completes, transition takes over */
.headline.loaded {
    animation: none;
    opacity: 1;
    transition: opacity 0.8s ease;
}

.headline.fading {
    opacity: 0;
}

.subheadline {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    /* Slightly larger */
    color: var(--color-cream);
    font-weight: 500;
    letter-spacing: 0.25em;
    /* Wider spacing for accent */
    opacity: 0;
    animation: fadeInUp 1.4s ease 0.5s forwards;
    font-family: var(--font-accent);
    /* Changed to accent font */
    text-transform: uppercase;
    line-height: 1.9;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Countdown Section — Art Deco Pedestals
   ========================================================================== */

.countdown-section {
    padding: 100px 30px;
    text-align: center;
    background: var(--color-bg);
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 50px;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 140px;
    /* Fixed width to prevent jumping */
    padding: 30px 20px 20px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-card);
    position: relative;
}

/* Stepped top accent */
.countdown-item::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 1px;
    background: var(--color-gold);
}

.countdown-item::after {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 20%;
    height: 1px;
    background: var(--color-gold);
}

.countdown-value {
    font-size: clamp(3rem, 6vw, 4.5rem);
    /* Increased size */
    font-family: var(--font-heading);
    color: var(--color-gold);
    line-height: 1;
    display: block;
    margin-bottom: 12px;
    font-weight: 400;
    letter-spacing: 0.05em;
}

.countdown-label {
    font-size: 0.85rem;
    /* Increased size */
    text-transform: uppercase;
    letter-spacing: 0.35em;
    color: var(--color-text-dim);
    font-weight: 500;
    font-family: var(--font-accent);
    /* Changed to accent font */
}

/* ==========================================================================
   Intro Text Section
   ========================================================================== */

.intro-text {
    padding: 100px 30px;
    max-width: var(--section-width);
    margin: 0 auto;
    text-align: center;
    box-sizing: border-box;
}

.intro-text p {
    margin-bottom: 2.2rem;
    font-size: clamp(1.1rem, 2.2vw, 1.3rem);
    /* Increased base size */
    line-height: 2.1;
    color: var(--color-text-dim);
    letter-spacing: 0.03em;
    font-family: var(--font-body);
    position: relative;
}

/* Decorative diamond bullets between paragraphs */
.intro-text p:not(:last-child)::after {
    content: '◆';
    position: absolute;
    bottom: -1.6rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-gold-dark);
    font-size: 0.7rem;
}

/* ==========================================================================
   Facts Section — Vintage Menu Card
   ========================================================================== */

.facts-section {
    padding: 100px 30px;
    text-align: center;
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Wrap the grid in a deco-card style */
.facts-card-wrapper {
    position: relative;
    max-width: var(--facts-width);
    width: 100%;
    margin: 0 auto;
    padding: 0;
    /* No padding — the grid fills the card, items provide their own padding */
    border: 1px solid var(--color-gold);
    background: var(--color-bg);
    box-sizing: border-box;
    overflow: hidden;
    /* Clips grid content to border */
}

.facts-card-wrapper::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(201, 168, 76, 0.5);
    pointer-events: none;
    z-index: 2;
}

.facts-card-wrapper::after {
    content: '';
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(201, 168, 76, 0.2);
    pointer-events: none;
    z-index: 2;
}

/* Equal-width columns — prevent unequal gaps */
.facts-grid {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    margin: 0;
    /* Removed margin, now the wrapper provides padding */
    border: none;
    /* Removed -- wrapper card provides the border */
    position: relative;
    background: transparent;
    box-sizing: border-box;
    align-items: stretch;
    /* Force equal-height rows */
}

/* Outer decorative frame -- now removed (replaced by facts-card-wrapper) */
.facts-grid::before {
    display: none;
}

/* Mobile: 1 column */
@media (max-width: 599px) {
    .facts-grid {
        grid-template-columns: 1fr;
    }

    /* On mobile, vertical dividers don't make sense */
    .fact-item:not(:last-child)::after {
        right: auto;
        top: auto;
        bottom: 0;
        left: 10%;
        width: 80%;
        height: 1px;
    }
}

/* Tablet: 2 columns */
@media (min-width: 600px) and (max-width: 899px) {
    .facts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* On 2-col layout, hide vertical dividers on 1st and 3rd items which wrap */
    .fact-item:nth-child(2n)::after {
        display: none;
    }
}

/* Desktop: 4 columns */
@media (min-width: 900px) {
    .facts-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .fact-item:last-child::after {
        display: none;
    }
}

.fact-item {
    padding: 60px 20px;
    /* Reduced horizontal padding to give text more room */
    background: var(--color-bg);
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Vertically center content so height differences don't show */
}

/* Vertical divider between grid items */
.fact-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(201, 168, 76, 0.3);
}



.fact-ornament {
    width: 30px;
    height: 30px;
    margin: 0 auto 18px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fact-ornament::before,
.fact-ornament::after {
    content: '';
    position: absolute;
    transform: rotate(45deg);
    border: 1.5px solid var(--color-gold);
}

.fact-ornament::before {
    width: 22px;
    height: 22px;
}

.fact-ornament::after {
    width: 12px;
    height: 12px;
}

.fact-label {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    /* Significantly Increased size */
    letter-spacing: 0.05em;
    color: var(--color-gold);
    margin-bottom: 8px;
    font-weight: 500;
    font-family: var(--font-heading);
    text-transform: none;
    /* Andes is normal case */
}

.fact-value {
    font-family: var(--font-accent);
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    /* Increased size */
    color: var(--color-cream);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ==========================================================================
   RSVP Section — Elegant Invitation Response Card
   ========================================================================== */

.rsvp-section {
    padding: 100px 30px 120px;
    max-width: none;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Give the RSVP form the deco-card treatment */
.rsvp-form {
    /* Now uses the shared deco-card style */
    position: relative;
    max-width: var(--section-width);
    width: 100%;
    padding: 60px 50px;
    /* Generous padding from deco-card */
    border: 1px solid var(--color-gold);
    background: var(--color-bg);
    /* Use base bg color for deco-card */
    box-sizing: border-box;
    text-align: left;
}

.rsvp-form::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(201, 168, 76, 0.5);
    pointer-events: none;
    z-index: 0;
}

.rsvp-form::after {
    content: '';
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(201, 168, 76, 0.2);
    pointer-events: none;
    z-index: 0;
}

.rsvp-intro {
    color: var(--color-text-dim);
    margin-bottom: 50px;
    font-size: clamp(1.1rem, 2.2vw, 1.3rem);
    /* Increased size */
    letter-spacing: 0.03em;
    font-family: var(--font-body);
    line-height: 1.9;
    font-style: italic;
    /* Elegant touch */
}

/* Success Message */
.success-message {
    background: var(--color-bg-card);
    border: 1px solid var(--color-gold);
    padding: 60px 45px;
    text-align: center;
    animation: fadeInScale 0.6s ease forwards;
    position: relative;
}

.success-message::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(201, 168, 76, 0.3);
    pointer-events: none;
}

.success-icon {
    width: 60px;
    height: 60px;
    border: 2px solid var(--color-gold);
    color: var(--color-gold);
    background: transparent;
    border-radius: 0;
    transform: rotate(45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 30px;
}

.success-icon::after {
    content: '✓';
    transform: rotate(-45deg);
}

.success-message h3 {
    font-family: var(--font-heading);
    /* Andes font */
    font-size: 2.8rem;
    /* Increased Size */
    color: var(--color-gold);
    margin-bottom: 25px;
    letter-spacing: 0.1em;
    font-weight: 500;
    text-transform: none;
}

.success-message p {
    color: var(--color-text-dim);
    margin-bottom: 12px;
    line-height: 1.9;
    font-size: 1.1rem;
    /* Increased Size */
    letter-spacing: 0.03em;
    font-family: var(--font-body);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================================================
   Form Styles — Art Deco Card
   ========================================================================== */

.rsvp-form {
    text-align: left;
    background: var(--color-bg);
    /* Use base bg color for deco-card */
    padding: 60px 50px;
    /* Generous padding from deco-card */
    border: 1px solid var(--color-gold);
    position: relative;
}

/* Inner frame */
.rsvp-form::before {
    content: '';
    position: absolute;
    inset: 8px;
    /* Matches deco-card inset */
    border: 1px solid rgba(201, 168, 76, 0.5);
    /* Matches deco-card border */
    pointer-events: none;
}

.rsvp-form::after {
    content: '';
    position: absolute;
    inset: 14px;
    /* Matches deco-card inset */
    border: 1px solid rgba(201, 168, 76, 0.2);
    /* Matches deco-card border */
    pointer-events: none;
}

.form-group {
    margin-bottom: 28px;
}

label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.8rem;
    /* Increased size */
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--color-gold);
    font-weight: 500;
    font-family: var(--font-accent);
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 16px 10px;
    /* More padding */
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1.1rem;
    /* Increased text size */
    transition: all 0.3s ease;
    letter-spacing: 0.03em;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-bottom: 2px solid var(--color-gold);
    /* Thicker focus border */
    background: rgba(201, 168, 76, 0.03);
    /* Subtle focus background */
}

/* Fix browser autofill styling */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #0e0e14 inset !important;
    -webkit-text-fill-color: var(--color-text) !important;
    transition: background-color 5000s ease-in-out 0s;
    font-family: var(--font-body) !important;
}

textarea {
    resize: vertical;
    min-height: 100px;
    border: 1px solid var(--color-border);
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.2);
}

textarea:focus {
    border-color: var(--color-gold);
}

/* Honeypot field - hidden from real users */
.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* Radio buttons — Art Deco treatment */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Inactive radio labels — clearly dimmed */
.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 18px 20px;
    background: transparent;
    border: 1px solid rgba(201, 168, 76, 0.2);
    /* Dimmer border when inactive */
    transition: all 0.3s ease;
    margin: 0;
    text-transform: none;
    letter-spacing: 0.02em;
    font-size: 1.1rem;
    color: rgba(232, 224, 208, 0.45);
    /* 45% opacity for inactive text */
    font-family: var(--font-body);
    position: relative;
}

/* Inner frame for double outline effect */
.radio-label::before {
    content: '';
    position: absolute;
    inset: 5px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    pointer-events: none;
}

.radio-label:hover {
    border-color: var(--color-gold);
    background: rgba(201, 168, 76, 0.08);
    color: var(--color-text);
    /* Restore full text on hover */
}

/* Active / selected state — restore full text color */
.radio-label:has(input:checked) {
    color: var(--color-text);
    font-weight: 500;
}

.radio-label input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    margin-right: 18px;
    cursor: pointer;
    width: 22px;
    /* Matched the fact-ornament outer size */
    height: 22px;
    border: 1.5px solid rgba(201, 168, 76, 0.4);
    transform: rotate(45deg);
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Add the inner outline when active (to look like fact-ornament) */
.radio-label input[type="radio"]:checked {
    border: 1.5px solid var(--color-gold);
    /* Brighter gold for outer box */
    background: transparent;
    /* Ensure background is transparent for inner border */
}

.radio-label input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    width: 10px;
    /* Matched the fact-ornament inner size */
    height: 10px;
    border: 1.5px solid var(--color-gold);
    background: var(--color-gold);
    /* Fill the inner rhombus */
}

/* Double Outline Box when selected */
.radio-label:has(input[type="radio"]:checked) {
    border-color: var(--color-gold);
    background: rgba(201, 168, 76, 0.03);
    /* Subtle dark background */
}

/* Show inner frame when active */
.radio-label:has(input[type="radio"]:checked)::before {
    border: 1px solid rgba(201, 168, 76, 0.4);
}

.radio-label:has(input[type="radio"]:checked) span {
    color: var(--color-gold);
    font-weight: 600;
}

.radio-label span {
    flex: 1;
}

/* Submit button — Art Deco outlined */
.submit-btn {
    width: 100%;
    padding: 22px 40px;
    /* Larger */
    background: transparent;
    color: var(--color-gold);
    border: 2px solid var(--color-gold);
    font-family: var(--font-heading);
    /* Andes font */
    font-size: 1.6rem;
    /* Much larger */
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all 0.4s ease;
    margin-top: 25px;
    position: relative;
    overflow: hidden;
    /* For hover effect */
}

/* Decorative border expansion on hover */
.submit-btn::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid transparent;
    transition: border-color 0.4s ease;
}

.submit-btn:hover {
    background: var(--color-gold);
    color: var(--color-bg);
}

.submit-btn:hover::before {
    border-color: var(--color-bg);
}

.submit-btn:active {
    transform: scale(0.98);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    text-align: center;
    padding: 70px 30px 80px;
    background: var(--color-bg);
    position: relative;
}

.back-to-top {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 40px;
    /* Placed below footer text */
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    text-decoration: none;
}

.back-to-top:hover {
    opacity: 1;
}

.back-to-top .scroll-arrow {
    transform: rotate(180deg);
    font-size: 6rem;
    /* Doubled size relative to previous 3rem */
    color: var(--color-gold);
    line-height: 1;
}

.footer p {
    color: var(--color-text-dim);
    font-size: 1.1rem;
    /* Increased size */
    font-style: italic;
    letter-spacing: 0.05em;
    font-family: var(--font-body);
    line-height: 1.9;
}

/* ==========================================================================
   Scroll Reveal Animation
   ========================================================================== */

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

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {

    h2::before,
    h2::after {
        width: 30px;
    }

    h2::before {
        right: calc(100% + 12px);
    }

    h2::after {
        left: calc(100% + 12px);
    }

    .hero-content {
        padding: 55px 30px 45px;
    }

    .hero-content::after {
        inset: 10px;
    }

    .hero-ornament {
        width: 160px;
    }

    .countdown {
        gap: 20px;
    }

    .countdown-item {
        width: 110px;
        padding: 22px 14px 16px;
    }

    .facts-grid {
        grid-template-columns: 1fr;
    }

    .fact-item:not(:last-child)::after {
        right: 20%;
        top: auto;
        bottom: 0;
        height: 1px;
        width: 60%;
        left: 20%;
    }

    .intro-text,
    .rsvp-section {
        padding: 60px 10px !important;
        /* Reduced from 100px 30px to save space and widen content */
        width: 100% !important;
        max-width: none !important;
        box-sizing: border-box !important;
    }

    .rsvp-form {
        padding: 40px 28px;
    }

    .deco-divider::before {
        width: 80%;
    }
}

@media (max-width: 480px) {
    .countdown-value {
        font-size: 2rem;
        /* Scaled down to fit on one line */
    }

    .countdown-label {
        font-size: 0.6rem;
    }

    .countdown {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        gap: 5px !important;
        width: 100% !important;
        padding: 0 5px !important;
        box-sizing: border-box !important;
    }

    .countdown-item {
        width: 24% !important;
        /* Force 4 in a row */
        padding: 12px 2px !important;
        min-width: 0 !important;
        border-width: 1px !important;
    }

    .countdown-value {
        font-size: 1.5rem !important;
        /* Balance visibility with space */
    }

    h1 {
        font-size: clamp(0.9rem, 4.5vw, 1.15rem);
        /* Minimum size to ensure 4-6 words per line on iPhone */
        letter-spacing: -0.01em;
        line-height: 1.45;
    }

    h2 {
        font-size: 1.8rem;
    }

    h2::before,
    h2::after {
        display: none;
    }

    .hero-content {
        width: 98%;
        /* Extreme width for narrow viewports */
        padding: 20px 8px;
        /* Minimal padding */
    }

    .hero-content::before {
        inset: 5px;
    }

    .hero-content::after {
        inset: 9px;
    }

    .hero-ornament {
        width: 120px;
    }

    .quote-timer-track {
        margin: 20px auto;
        /* Smaller gaps on mobile to save vertical height */
    }

    .scroll-indicator {
        bottom: 90px !important;
        /* Lifted even more to ensure safe visibility on iOS */
    }

    h1 {
        font-size: clamp(1.2rem, 5.5vw, 1.6rem);
        /* Increased for better impact as requested */
        letter-spacing: 0.02em;
        line-height: 1.4;
    }


    .subheadline {
        font-size: 0.9rem;
    }
}