:root {
    --heading-font: 'Cormorant Garamond', serif;
    --body-font: 'Montserrat', sans-serif;
    --black: #000000;
    --white: #ffffff;
}

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

html,
body,
* {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="%23ffffff" stroke="%23000000" stroke-width="1"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>') 12 12, auto !important;
}

body {
    background-color: var(--black);
    color: var(--white);
    font-family: var(--body-font);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Split Layout */
.main-wrapper {
    width: 100%;
}

.split-section {
    display: flex;
    min-height: 100vh;
    width: 100%;
    flex-wrap: wrap;
    /* Stacks on mobile */
}

.split-pane {
    flex: 1;
    min-width: 350px;
    /* Stack threshold */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Content Styling */
.content-pane {
    padding: 3rem;
    text-align: center;
}

.bg-black {
    background-color: var(--black);
    color: var(--white);
}

.bg-white {
    background-color: var(--white);
    color: var(--black);
}

.content-inner {
    max-width: 600px;
}

/* Typography */
h1,
h2,
h3,
.day,
.month,
.year,
blockquote {
    font-family: var(--heading-font);
}

.subtitle {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.title {
    font-size: 3rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.name {
    font-size: 3.5rem;
    line-height: 1.1;
    margin: 1rem 0;
}

.ampersand {
    font-family: var(--heading-font);
    font-size: 2.5rem;
    font-style: italic;
    opacity: 0.7;
}

/* Image Styling */
.image-pane {
    height: 100vh;
    /* Full height on desktop */
}

.cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Date Display */
.date-display {
    font-size: 2rem;
    border-top: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    padding: 1rem 0;
    margin-bottom: 3rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

/* Countdown */
.countdown {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.time-box span:first-child {
    font-family: var(--heading-font);
    font-size: 2.5rem;
}

.time-box .label {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    opacity: 0.6;
}

/* Family Section */
.family-section {
    display: grid;
    gap: 3rem;
}

.family-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* Quote & Details */
.quote-section {
    margin-bottom: 4rem;
}

.ataturk-quote {
    font-size: 1.4rem;
    font-style: italic;
    margin-bottom: 2rem;
}

.quote-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.signature {
    width: 120px;
    align-self: center;
}

/* Details */
.details {
    display: grid;
    gap: 3rem;
    margin-bottom: 4rem;
}

.detail-item i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.detail-item h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.address {
    font-size: 0.9rem;
    opacity: 0.8;
    max-width: 300px;
    margin: 0 auto;
}

/* Footer */
.footer {
    opacity: 0.5;
    font-size: 0.8rem;
    margin-top: 2rem;
    letter-spacing: 1px;
}

/* Fireworks Canvas */
#fireworks-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    /* Above envelope (10000) so visible on load */
    pointer-events: none;
    background: transparent;
}

/* Body Overflow for Intro */
body.intro-active {
    overflow: hidden;
}

/* Ensure no extra scroll space */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Envelope Animation Container */
#envelope-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--black);
    /* Background behind envelope */
    perspective: 1500px;
    overflow: hidden;
    transition: opacity 1s ease-out, transform 1s ease-out;
    /* Fade out transition */
}

/* White Envelope Styles */
/* White Envelope Styles - 3D & Realistic */
.envelope-back {
    position: absolute;
    width: 90vw;
    max-width: 600px;
    height: 350px;
    background-color: #c0c0c0;
    /* Darker gray for contrast */
    z-index: 10;
    /* Deep 3D Shadow */
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 5px 15px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.envelope-front {
    position: absolute;
    width: 90vw;
    max-width: 600px;
    height: 350px;
    z-index: 30;
    /* Gradient lines:
       1. Line from Top-Center to Bottom-Right
       2. Line from Top-Center to Bottom-Left
    */
    background:
        linear-gradient(to bottom right, transparent 49.5%, #d0d0d0 50%, #d0d0d0 50.5%, transparent 51%),
        linear-gradient(to bottom left, transparent 49.5%, #d0d0d0 50%, #d0d0d0 50.5%, transparent 51%),
        linear-gradient(to bottom, #f0f0f0 0%, #e0e0e0 100%);
    /* Base color */
    background-size: 100% 100%;
    background-color: #e0e0e0;
    /* Fallback */
    clip-path: polygon(0 0, 50% 50%, 100% 0, 100% 100%, 0 100%);
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    border-radius: 4px;
    /* Shadows */
    filter: drop-shadow(0 -2px 3px rgba(0, 0, 0, 0.1)) drop-shadow(0 -1px 0 #d0d0d0);
    overflow: hidden;
    /* For lines */
}

.envelope-flap {
    position: absolute;
    width: 90vw;
    max-width: 600px;
    height: 350px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 35;
    /* Use preserve-3d for double-sided effect */
    transform-style: preserve-3d;
    clip-path: polygon(0 0, 50% 50%, 100% 0);
    transform-origin: top;
    transition: transform 0.1s linear;
    border-radius: 4px;
    /* Remove background from parent, move to faces */
    background: transparent;
    pointer-events: none;

    /* Shadows mainly on the container */
    filter:
        drop-shadow(0 1px 0 #bbb) drop-shadow(0 5px 10px rgba(0, 0, 0, 0.2));
}

/* Outer/Closed Side (matches envelope body) */
.envelope-flap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Match the gray gradient of .envelope-front */
    background: linear-gradient(to bottom, #f0f0f0 0%, #e0e0e0 100%);
    backface-visibility: hidden;
    z-index: 2;
}

/* Inner/Open Side (matches previous lighter flap color) */
.envelope-flap::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* The lighter white gradient */
    background: linear-gradient(to bottom, #ffffff 0%, #f0f0f0 100%);
    transform: rotateX(180deg);
    backface-visibility: hidden;
    z-index: 1;
}

/* Wax Seal Style */
.envelope-seal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: radial-gradient(circle at 30% 30%, #e6e6e6, #b0b0b0);
    border-radius: 50%;
    z-index: 40;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    color: #555;
    font-family: 'Cormorant Garamond', serif;
    border: 2px solid #fff;
    pointer-events: none;
}

.envelope-seal span {
    margin-top: 2px;
}

.envelope-seal.broken {
    opacity: 0;
    transition: opacity 0.2s;
}

/* Preview Card inside Envelope */
.envelope-card-preview {
    position: absolute;
    width: 85%;
    max-width: 550px;
    height: 320px;
    /* Fits inside envelope */
    background-color: #fff;
    z-index: 20;
    /* Inside pocket */
    top: 50%;
    /* Fix Bottom Protrusion: Card was translating -40% of its height? 
       If it sticks out, maybe scale it down or move it up.
    */
    transform: translateY(-45%);
    /* Move up slightly more to hide bottom edge */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-family: 'Cormorant Garamond', serif;
    color: #000;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
}

.envelope-card-preview h2 {
    font-size: 2rem;
    margin: 0;
    font-weight: 300;
}

.envelope-card-preview p {
    font-size: 1.2rem;
    margin-top: 10px;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 2px;
}

/* When intro is done, hide overlay */
body.intro-complete #envelope-overlay {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.1);
    /* Zoom out slightly on fade */
}

/* Fake scroll removed, we rely on wheel/touch */
#fake-scroll-height {
    display: none;
}


/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {

    /* Reset everything to single column with no horizontal overflow */
    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
        font-size: 14px;
        /* Default slightly smaller */
    }

    .main-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
    }

    .split-section {
        display: flex;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
    }

    .split-pane {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 0 0 auto !important;
    }

    /* Images */
    .image-pane {
        width: 100% !important;
        max-width: 100% !important;
        height: 60vh !important;
        order: -1;
    }

    .cover-img {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block;
    }

    /* Content */
    .content-pane {
        width: 100% !important;
        padding: 1.5rem !important;
    }

    /* Section Specifics */
    .split-section:nth-child(even),
    .split-section:nth-of-type(3) {
        flex-direction: column-reverse !important;
    }

    /* Typography */
    .title {
        font-size: 1.8rem;
        letter-spacing: 1px;
    }

    .subtitle {
        font-size: 0.6rem;
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    /* White as requested */
    font-size: 2rem;
    z-index: 50;
    /* Above envelope parts */
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
    /* Shadow for contrast */
    animation: scroll-prompt 2s infinite ease-in-out;
    pointer-events: none;
    /* Let clicks pass through */
}

@keyframes scroll-prompt {
    0% {
        transform: translate(-50%, 0);
        opacity: 0;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, 20px);
        opacity: 0;
    }
}