/* ==========================================================================
   Valery - Bridgerton Birthday Invitation
   ========================================================================== */

/* CSS Variables - Modern Bridgerton Palette */
:root {
    --color-primary: #0a0e27;
    --color-secondary: #c9a961;
    --color-accent: #8b4b5e;
    --color-neutral: #faf8f5;
    --color-text: #1a1a1a;
    --color-white: #ffffff;
    --color-light-gold: #d4c5a3;
    --color-soft-pink: #f3e8ec;
    --color-muted-blue: #e8eaf2;

    --font-primary: 'Playfair Display', serif;
    --font-secondary: 'Montserrat', sans-serif;
    --font-script: 'Great Vibes', cursive;

    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-secondary);
    color: var(--color-text);
    background-color: var(--color-neutral);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 600;
    line-height: 1.2;
}

.script-text {
    font-family: var(--font-script);
    font-size: 2rem;
    color: var(--color-accent);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* ==========================================================================
   Letter Opening Animation - Overlay
   ========================================================================== */

.letter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #f5f0e8 0%, #e8dfd5 50%, #f0e8dc 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), visibility 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.letter-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

.envelope {
    position: relative;
    width: min(450px, 90vw);
    height: min(300px, 60vw);
    margin-bottom: 2.5rem;
    animation: floatEnvelope 4s ease-in-out infinite;
    filter: drop-shadow(0 25px 60px rgba(0, 0, 0, 0.3));
    perspective: 1200px;
    overflow: visible;
}

@keyframes floatEnvelope {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-12px);
    }
}

/* Main envelope rectangle body */
.envelope-body {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(135deg, #fdfbf7 0%, #f5f0e8 100%),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(201, 169, 97, 0.02) 2px, rgba(201, 169, 97, 0.02) 4px);
    border: 2px solid rgba(201, 169, 97, 0.4);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.2),
        0 8px 20px rgba(139, 75, 94, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 2px rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    z-index: 1;
}

.envelope-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(212, 197, 163, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(201, 169, 97, 0.08) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 6px;
}

/* Triangular flap on top */
.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 55%;
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    background: linear-gradient(165deg, #ebe4d8 0%, #f5f0e8 50%, #fdfbf7 100%);
    transform-origin: 50% 0%;
    transition: transform 1.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.15));
}

.envelope.opening .envelope-flap {
    transform: rotateX(-180deg);
}

/* Letter inside (hidden for now) */
.letter-paper {
    display: none;
}

.wax-seal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background:
        radial-gradient(circle at 35% 30%, #b87889, #a06373 30%, var(--color-accent) 50%, #7a4452 80%, #5d3340),
        radial-gradient(circle at 60% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 30%);
    background-blend-mode: normal, overlay;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 12px 35px rgba(139, 75, 94, 0.5),
        0 5px 15px rgba(0, 0, 0, 0.3),
        inset 0 -4px 15px rgba(0, 0, 0, 0.25),
        inset 0 4px 15px rgba(255, 255, 255, 0.15),
        inset 0 0 30px rgba(139, 75, 94, 0.3);
    cursor: pointer;
    z-index: 4;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wax-seal::before {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.15);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.wax-seal::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 20%;
    width: 40%;
    height: 40%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.25) 0%, transparent 60%);
    border-radius: 50%;
    filter: blur(8px);
}

.wax-seal:hover {
    transform: translate(-50%, -50%) scale(1.08) rotateZ(-3deg);
    box-shadow:
        0 15px 50px rgba(139, 75, 94, 0.6),
        0 8px 20px rgba(0, 0, 0, 0.35),
        inset 0 -4px 15px rgba(0, 0, 0, 0.25),
        inset 0 4px 15px rgba(255, 255, 255, 0.2),
        inset 0 0 30px rgba(139, 75, 94, 0.4);
}

.seal-inner {
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-secondary);
    text-shadow:
        0 3px 10px rgba(0, 0, 0, 0.4),
        0 1px 2px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(212, 175, 55, 0.3);
    letter-spacing: 2px;
    z-index: 1;
    position: relative;
    line-height: 1;
}

.envelope.opening .wax-seal {
    animation: sealBreak 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes sealBreak {
    0% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
    30% {
        transform: translate(-50%, -50%) scale(1.15) rotate(5deg);
        opacity: 0.9;
    }
    60% {
        transform: translate(-50%, -50%) scale(0.8) rotate(-8deg);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(0) rotate(20deg);
        opacity: 0;
    }
}

.tap-instruction {
    font-family: var(--font-secondary);
    font-size: 0.95rem;
    color: #8b7355;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 500;
    animation: gentlePulse 2.5s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% {
        opacity: 0.5;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* ==========================================================================
   Main Content
   ========================================================================== */

.main-content {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Navigation */
.nav {
    position: sticky;
    top: 0;
    background: rgba(26, 31, 58, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-list {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.nav-link {
    font-family: var(--font-primary);
    color: var(--color-light-gold);
    text-decoration: none;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 1rem;
    transition: var(--transition-smooth);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-secondary);
    transition: var(--transition-smooth);
    transform: translateX(-50%);
}

.nav-link:hover {
    color: var(--color-secondary);
}

.nav-link:hover::after {
    width: 100%;
}

/* Section Styles */
.section {
    padding: 6rem 0;
    position: relative;
}

.section-title {
    font-size: 3rem;
    text-align: center;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--color-accent);
    margin-bottom: 3rem;
}

/* Divider */
.divider {
    width: 100px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-secondary), transparent);
    margin: 2rem auto;
    position: relative;
}

/* Ornaments */
.ornament-top,
.ornament-bottom {
    width: 100px;
    height: 100px;
    margin: 2rem auto;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50 10 Q60 30 80 40 Q60 50 50 70 Q40 50 20 40 Q40 30 50 10" fill="%23d4af37" opacity="0.3"/></svg>') center/contain no-repeat;
}

.ornament-bottom {
    transform: rotate(180deg);
}

/* ==========================================================================
   Invitation Section
   ========================================================================== */

.invitation-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-neutral) 0%, var(--color-white) 100%);
    position: relative;
}

.invitation-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(201, 169, 97, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 75, 94, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.invitation-content {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.main-title {
    font-size: 4rem;
    color: var(--color-primary);
    margin: 1rem 0;
    letter-spacing: 1px;
    font-weight: 500;
}

.honoree-name {
    font-size: 1.2rem;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 1rem 0;
}

.name-highlight {
    font-size: 3.5rem;
    color: var(--color-accent);
    margin: 1rem 0;
    font-style: italic;
}

.invitation-text {
    font-size: 1.2rem;
    line-height: 2;
    color: var(--color-text);
    margin: 2rem 0;
}

/* ==========================================================================
   Details Section
   ========================================================================== */

.details-section {
    background: var(--color-white);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin: 4rem 0;
}

.detail-card {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--color-white);
    border: 1px solid rgba(201, 169, 97, 0.2);
    border-radius: 16px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.detail-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    border-color: var(--color-secondary);
}

.detail-icon {
    margin-bottom: 1.5rem;
    color: var(--color-secondary);
}

.detail-icon svg {
    stroke-width: 1.5;
}

.detail-title {
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.detail-text {
    font-size: 1.1rem;
    color: var(--color-text);
    line-height: 1.8;
}

/* Countdown Timer */
.countdown-container {
    text-align: center;
    margin: 5rem 0;
    padding: 4rem 3rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, #1a2340 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(10, 14, 39, 0.3);
}

.countdown-title {
    font-size: 2rem;
    color: var(--color-light-gold);
    margin-bottom: 2rem;
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.countdown-number {
    font-family: var(--font-primary);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-secondary);
    line-height: 1;
}

.countdown-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-light-gold);
    margin-top: 0.5rem;
}

/* Additional Info */
.additional-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 4rem;
}

.info-card {
    padding: 2.5rem;
    background: var(--color-white);
    border: 1px solid rgba(201, 169, 97, 0.2);
    border-left: 3px solid var(--color-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: var(--transition-smooth);
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border-left-color: var(--color-accent);
}

.info-title {
    font-size: 1.8rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.info-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-text);
}

.schedule-list {
    list-style: none;
    padding: 0;
}

.schedule-list li {
    font-size: 1.1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--color-text);
}

.schedule-list li:last-child {
    border-bottom: none;
}

/* ==========================================================================
   RSVP Section
   ========================================================================== */

.rsvp-section {
    background: var(--color-muted-blue);
}

.rsvp-form {
    max-width: 700px;
    margin: 0 auto;
    padding: 3.5rem;
    background: var(--color-white);
    border: 1px solid rgba(201, 169, 97, 0.15);
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.08);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 2rem;
}

.form-label {
    display: block;
    font-family: var(--font-primary);
    font-size: 1rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    font-family: var(--font-secondary);
    font-size: 1rem;
    border: 1px solid rgba(201, 169, 97, 0.25);
    border-radius: 10px;
    background: var(--color-neutral);
    color: var(--color-text);
    transition: var(--transition-smooth);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 4px rgba(201, 169, 97, 0.1);
    background: var(--color-white);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Radio Buttons */
.radio-group {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
}

.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
    cursor: pointer;
    accent-color: var(--color-accent);
}

/* Submit Button */
.form-actions {
    text-align: center;
    margin-top: 2rem;
}

.btn-submit {
    font-family: var(--font-primary);
    font-size: 1.1rem;
    padding: 1.15rem 3.5rem;
    background: linear-gradient(135deg, var(--color-accent) 0%, #9d566b 100%);
    color: var(--color-white);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: var(--transition-smooth);
    box-shadow: 0 6px 25px rgba(139, 75, 94, 0.25);
    font-weight: 500;
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 35px rgba(139, 75, 94, 0.35);
    background: linear-gradient(135deg, #9d566b 0%, var(--color-accent) 100%);
}

.btn-submit:active {
    transform: translateY(0);
}

/* Form Messages */
.form-message {
    margin-top: 2rem;
    padding: 1.25rem;
    border-radius: 12px;
    text-align: center;
    font-size: 1rem;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================================================
   Gallery Section
   ========================================================================== */

.gallery-section {
    background: var(--color-white);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    aspect-ratio: 4/3;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transition: var(--transition-smooth);
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-neutral) 0%, var(--color-light-gold) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    font-size: 1.5rem;
    color: var(--color-primary);
}

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

.footer {
    background: var(--color-primary);
    padding: 4rem 0 2rem;
    text-align: center;
}

.footer-ornament {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50 10 Q60 30 80 40 Q60 50 50 70 Q40 50 20 40 Q40 30 50 10" fill="%23d4af37" opacity="0.5"/></svg>') center/contain no-repeat;
}

.footer-text {
    font-size: 1.1rem;
    color: var(--color-light-gold);
    margin-bottom: 1rem;
}

.footer-signature {
    font-family: var(--font-script);
    font-size: 2rem;
    color: var(--color-secondary);
    margin-top: 2rem;
}

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

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    .nav-list {
        gap: 0.8rem;
        flex-wrap: wrap;
    }

    .nav-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }

    .section {
        padding: 3rem 0;
    }

    .invitation-section {
        min-height: auto;
        padding: 2rem 0;
    }

    .invitation-content {
        padding: 2rem 1rem;
    }

    .section-title {
        font-size: 2.2rem;
        line-height: 1.3;
    }

    .main-title {
        font-size: 2rem;
        line-height: 1.2;
        margin: 0.5rem 0;
    }

    .name-highlight {
        font-size: 2rem;
        line-height: 1.3;
        word-wrap: break-word;
    }

    .script-text {
        font-size: 1.3rem;
        line-height: 1.4;
    }

    .invitation-text {
        font-size: 0.95rem;
        line-height: 1.8;
        margin: 1.5rem 0;
    }

    .honoree-name {
        font-size: 0.95rem;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .countdown {
        gap: 1rem;
    }

    .countdown-number {
        font-size: 2.5rem;
    }

    .countdown-title {
        font-size: 1.5rem;
    }

    .additional-info {
        grid-template-columns: 1fr;
    }

    .rsvp-form {
        padding: 2rem 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

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

    .wax-seal {
        width: 90px;
        height: 90px;
    }

    .seal-inner {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .invitation-content {
        padding: 1.5rem 0.5rem;
    }

    .main-title {
        font-size: 1.6rem;
        line-height: 1.3;
    }

    .name-highlight {
        font-size: 1.7rem;
        line-height: 1.3;
        word-break: break-word;
    }

    .section-title {
        font-size: 1.8rem;
        line-height: 1.3;
    }

    .script-text {
        font-size: 1.1rem;
    }

    .invitation-text {
        font-size: 0.9rem;
        line-height: 1.7;
    }

    .honoree-name {
        font-size: 0.85rem;
    }

    .countdown-container {
        padding: 2rem 1rem;
    }

    .countdown-item {
        min-width: 65px;
    }

    .countdown-number {
        font-size: 1.8rem;
    }

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

    .countdown-title {
        font-size: 1.2rem;
        line-height: 1.4;
    }

    .btn-submit {
        padding: 0.9rem 2rem;
        font-size: 0.95rem;
    }

    .nav-list {
        gap: 0.5rem;
    }

    .nav-link {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }

    .wax-seal {
        width: 70px;
        height: 70px;
    }

    .seal-inner {
        font-size: 1.1rem;
    }
}

/* ==========================================================================
   Scroll Animations
   ========================================================================== */

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
