@font-face {
    font-family: 'Citadel Script';
    src: url('assets/citadel-script.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

:root {
    /* Colors */
    --burgundy: #3b0909; /* Restored original darker burgundy */
    --burgundy-dark: #240505;
    --cream: #e8e3d8; /* Envelope cream */
    --cream-light: #f4f1ea; /* Card cream */
    --gold: #c5a059; /* Elegant muted gold */
    --gold-dim: #9b7e45;
    
    /* Typography */
    --font-serif: 'Cormorant Garamond', serif;
    --font-script: 'Great Vibes', cursive;
    --font-cursive: 'Citadel Script', 'Great Vibes', cursive;
    --font-sans: 'Inter', sans-serif;
}

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

body {
    background-color: var(--burgundy);
    color: var(--cream);
    font-family: var(--font-serif);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Loader */
.loader {
    position: fixed;
    inset: 0;
    background: var(--burgundy);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease;
}
.loader.hidden {
    opacity: 0;
    pointer-events: none;
}
.loader-text {
    font-family: var(--font-script);
    font-size: 2.5rem;
    color: var(--gold);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Typography */
h1, h2, h3 {
    font-weight: normal;
}
.names-script {
    font-family: var(--font-script);
    font-size: clamp(3rem, 8vw, 5rem);
    color: var(--cream);
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: 2px;
}

/* === SECTION 1: HERO & ENVELOPE === */
.section-hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    /* We'll pin this section with ScrollTrigger */
}

.hero-content {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.top-text {
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 0.75rem;
    color: var(--gold);
    margin-bottom: 1rem;
}

/* Envelope Container */
.envelope-container {
    position: relative;
    width: 320px;
    height: 220px;
    margin: 0 auto;
    perspective: 1200px; /* For 3D flap opening */
}

.envelope {
    position: absolute;
    width: 100%;
    height: 100%;
    /* transform-style: preserve-3d removed to fix iOS Safari stacking bug where cards poked through front */
}

/* Envelope Back */
.env-back {
    position: absolute;
    inset: 0;
    background-color: #d8d3c5;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    z-index: 1;
}

/* Envelope Content Container */
.env-content {
    position: absolute;
    left: 5%;
    right: 5%;
    bottom: 5%;
    top: 5%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2; /* Between back and front */
    /* translateY animated by GSAP */
}

/* Arched Card */
.env-card-arched {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 190px; /* Fits perfectly inside the pocket to avoid overflow */
    background-color: var(--cream-light);
    border-radius: 150px 150px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 15px; /* Reduced to fit longer text */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 10; /* Guaranteed to be in front of polaroids */
}

.card-inner {
    text-align: center;
}

.card-names {
    font-family: var(--font-cursive);
    font-size: 3rem;
    color: var(--burgundy);
    line-height: 1.1;
}

/* Polaroids */
.polaroid {
    position: absolute;
    width: 100px;
    height: 120px;
    background: #fff;
    padding: 6px 6px 24px 6px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.15);
    z-index: 2;
}

.polaroid-img {
    width: 100%;
    height: 100%;
    background: #ddd; /* Placeholder color */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* FOTOĞRAFLARI BURAYA EKLEYEBİLİRSİNİZ */
/* İki polaroid için kendi fotoğraflarınızı assets klasörüne koyup alttaki yorumları (/* ... */) silmeniz yeterli */

.polaroid-1 .polaroid-img {
    background-image: url('assets/foto1.jpeg');
    background-size: cover;
    background-position: center;
}

.polaroid-2 .polaroid-img {
    /* background-image: url('assets/fotograf2.jpg'); */
    background-size: cover;
    background-position: center;
}

.polaroid-1 {
    top: 40px; /* Start hidden inside */
    left: 10px;
    transform: rotate(-10deg);
}

.polaroid-2 {
    top: 60px; /* Start hidden inside */
    left: 20px;
    transform: rotate(0deg);
    z-index: 4;
}
/* Wedding Rings Removed */

/* Floral Details using Transparent PNGs */
.floral-decor {
    position: absolute;
    z-index: 1;
    object-fit: contain;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.2)); 
}
.floral-left {
    top: 0px; 
    left: 20px;
    width: 150px;
    height: 150px;
    transform: rotate(-10deg);
}
.floral-right {
    top: 10px; 
    right: 20px;
    width: 140px;
    height: 140px;
    transform: rotate(20deg);
}

/* Hanging Leaves on Envelope Edges */
.leaves-left {
    position: absolute;
    z-index: 6; /* In front of flap and back */
    top: 0;
    left: -30px;
    width: 120px;
    height: 200px;
    opacity: 0; /* Hidden initially, shown after flap opens or just fade in */
}
.leaves-right {
    position: absolute;
    z-index: 6;
    top: 0;
    right: -30px;
    width: 120px;
    height: 200px;
    opacity: 0;
    transform: scaleX(-1); /* flip horizontally */
}

/* Envelope Front (The overlapping flaps) */
.env-front {
    position: absolute;
    inset: 0;
    /* CSS trick to create front flaps using borders */
    border-left: 160px solid #e2ddd1;
    border-right: 160px solid #e2ddd1;
    border-bottom: 120px solid #e8e3d8;
    border-top: 100px solid transparent;
    border-radius: 4px;
    z-index: 3; /* In front of card */
    pointer-events: none;
}

/* Envelope Top Flap */
/* Envelope Flap container */
.env-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: top;
    z-index: 4; /* Higher than env-front to sit on top when closed */
}

.env-flap svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Realistic Lace Overlays */
.lace-wrapper-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
}

.lace-wrapper-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
}

.lace-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 240px; /* Slightly longer to ensure it reaches the center slice */
    height: 30px;
    background: url('assets/lace_transparent.png') repeat-x center/contain;
    transform-origin: 0 0;
    transform: rotate(44.7deg) translateY(-14px); /* Geometrically calculated angle */
    opacity: 0.9;
}

.lace-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 240px;
    height: 30px;
    background: url('assets/lace_transparent.png') repeat-x center/contain;
    transform-origin: 100% 0;
    transform: rotate(-44.7deg) translateY(-14px);
    opacity: 0.9;
}

/* Initials on the Front */
.wax-seal {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    height: auto;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    pointer-events: none;
}

.seal-initials {
    font-family: var(--font-cursive);
    color: var(--burgundy);
    font-size: 1.6rem; /* Reduced size based on feedback */
    font-weight: 400;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5); /* Subtle pop */
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    text-align: center;
    font-family: var(--font-sans);
    font-size: 0.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
}

.scroll-arrow {
    margin-top: 8px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* === SECTION 2: DETAILS */
/* Countdown Timer */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(197, 160, 89, 0.2);
    min-width: 80px;
}

.countdown-number {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    color: var(--gold);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.countdown-label {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--cream);
}

/* Sections */
.section-details {
    background-color: var(--cream);
    color: var(--burgundy);
    padding: 6rem 2rem;
    text-align: center;
    position: relative;
    /* Optional: add a subtle paper texture background */
}

.details-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

.intro-text {
    font-size: 1.5rem;
    font-style: italic;
    margin-bottom: 2rem;
    color: #4a4a4a;
}

.details-names {
    font-family: var(--font-script);
    font-size: 4rem;
    color: var(--burgundy);
    margin-bottom: 1rem;
}

.ampersand {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    color: var(--gold);
}

.divider {
    margin: 2rem 0;
}

.event-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (min-width: 600px) {
    .event-info {
        flex-direction: row;
        justify-content: space-around;
    }
}

.info-block h3 {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    letter-spacing: 3px;
    color: var(--gold);
    margin-bottom: 1rem;
}

.info-block p {
    font-size: 1.2rem;
    line-height: 1.6;
}

.btn-map {
    display: inline-block;
    padding: 12px 30px;
    border: 1px solid var(--burgundy);
    color: var(--burgundy);
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s;
}

.btn-map:hover {
    background-color: var(--burgundy);
    color: var(--cream);
}

/* === SECTION 3: RSVP === */
.section-rsvp {
    background-color: var(--burgundy); /* Matches hero section */
    padding: 6rem 2rem;
    display: flex;
    justify-content: center;
}

.rsvp-container {
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.rsvp-title {
    font-family: var(--font-serif);
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.rsvp-subtitle {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 3rem;
    text-transform: uppercase;
}

.rsvp-form {
    text-align: left;
}

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

.form-group label {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: var(--gold);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

input[type="text"],
input[type="number"],
textarea {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--cream);
    font-family: var(--font-serif);
    font-size: 1.2rem;
    outline: none;
    transition: border-color 0.3s;
}

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

textarea {
    resize: vertical;
}

/* Custom Radio Buttons */
.radio-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: var(--cream);
}

.radio-label input {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    margin-right: 10px;
    display: inline-block;
    position: relative;
}

.radio-label input:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--gold);
    border-radius: 50%;
}

/* Number Input Stepper */
.number-input {
    display: flex;
    align-items: center;
}

.number-input button {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--gold);
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: border-color 0.3s;
}

.number-input button:hover {
    border-color: var(--gold);
}

.number-input input {
    width: 60px;
    text-align: center;
    border-left: none;
    border-right: none;
    height: 40px;
    padding: 0;
}

.btn-submit {
    width: 100%;
    padding: 15px;
    background: var(--gold);
    color: var(--burgundy);
    border: none;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.3s;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-submit:hover {
    background: #e6b972;
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0,0,0,0.1);
    border-top: 2px solid var(--burgundy);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.form-message {
    margin-top: 1rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    text-align: center;
}
.form-message.success { color: #7ece9e; }
.form-message.error { color: #e07070; }

/* === FOOTER === */
.footer {
    text-align: center;
    padding: 3rem;
    background-color: var(--burgundy); /* Matches hero section */
    color: var(--gold);
    font-family: var(--font-script);
    font-size: 2rem;
}

.date-small {
    font-family: var(--font-sans);
    font-size: 0.6rem;
    letter-spacing: 3px;
    margin-top: 0.5rem;
    opacity: 0.5;
}
