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

html, body {
    width: 100%;
    height: 100%;
}

body {
    background-color: #F5EDE4;
    font-family: 'Libre Baskerville', serif;
    color: #4A3A28;
    line-height: 1.7;
}

/* ===== FLOATING ELEMENTS ===== */
.floating-elements-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.floating-element {
    position: absolute;
    width: 48px;
    height: 48px;
    opacity: 0.5;
    animation: drift var(--duration, 8s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

.floating-element:nth-child(1) { top: 10%; left: 10%; }
.floating-element:nth-child(2) { top: 15%; left: 75%; animation-direction: reverse; }
.floating-element:nth-child(3) { top: 35%; left: 20%; }
.floating-element:nth-child(4) { top: 50%; left: 85%; animation-direction: reverse; }
.floating-element:nth-child(5) { top: 70%; left: 15%; }

@keyframes drift {
    0%, 100% {
        transform: translateX(0) translateY(0);
    }
    25% {
        transform: translateX(12px) translateY(-8px);
    }
    50% {
        transform: translateX(0) translateY(8px);
    }
    75% {
        transform: translateX(-12px) translateY(-8px);
    }
}

/* ===== MAIN CONTAINER ===== */
.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 40px;
}

/* ===== HEADER ===== */
.page-header {
    text-align: center;
    margin-bottom: 80px;
}

.page-header h1 {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 44px;
    color: #2A2018;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.tagline {
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    font-size: 18px;
    color: #8A7A68;
}

/* ===== CARD GRID ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    perspective: 1000px;
}

.card {
    position: relative;
    height: 280px;
    background-color: #FFFAF5;
    border: 1px solid #D4C4B0;
    border-radius: 3px;
    padding: 28px;
    cursor: pointer;
    transition: border-color 200ms, box-shadow 200ms;
    transform-style: preserve-3d;
    transform: rotateY(0deg);
    transition: transform 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card:hover {
    border-color: #B8906A;
    box-shadow: 0 2px 8px rgba(42, 32, 24, 0.08);
}

.card.flipped {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backface-visibility: hidden;
}

.card-front {
    z-index: 2;
}

.card-back {
    transform: rotateY(180deg);
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
}

.card-front h2 {
    font-weight: 700;
    font-size: 24px;
    color: #2A2018;
    margin-bottom: 16px;
}

.card-front p {
    font-size: 16px;
    color: #4A3A28;
    line-height: 1.6;
}

.card-back h3 {
    font-weight: 700;
    font-size: 18px;
    color: #2A2018;
    margin-bottom: 12px;
}

.card-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 2px;
    margin-bottom: 12px;
    box-shadow: inset 0 0 20px rgba(42, 32, 24, 0.08);
}

.card-back p {
    font-size: 14px;
    color: #4A3A28;
    line-height: 1.6;
    margin-bottom: 12px;
    flex-grow: 1;
}

.card-back::after {
    content: "← Click to return";
    font-family: 'Lato', sans-serif;
    font-size: 12px;
    color: #B8906A;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 400;
}

/* ===== FOOTER ===== */
.page-footer {
    background-color: #E8DCD0;
    margin-top: 80px;
    padding: 40px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.footer-icon {
    width: 64px;
    height: 48px;
}

.page-footer p {
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    color: #8A7A68;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 32px;
    }

    .tagline {
        font-size: 16px;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .container {
        padding: 40px 20px;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 24px;
    }

    .tagline {
        font-size: 14px;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .floating-element {
        display: none;
    }

    .container {
        padding: 30px 16px;
    }

    .card {
        height: 240px;
        padding: 20px;
    }

    .card-front h2 {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .card-front p {
        font-size: 14px;
    }
}
