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

@font-face {
    font-family: 'Dancing Script';
    src: url('assets/fonts/DancingScript.ttf') format('truetype');
    font-weight: 400 700;
    font-display: swap;
}

body {
    font-family: 'Dancing Script', cursive;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
    min-height: 100vh;
    padding: 20px;
}

/* Desktop: 3-column layout */
@media (min-width: 900px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
        padding: 30px;
    }
}

/* Tablet: 2-column layout */
@media (min-width: 600px) and (max-width: 899px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
        padding: 25px;
    }
}

/* Mobile: 1-column layout */
@media (max-width: 599px) {
    .grid-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
}

.tile {
    aspect-ratio: 1;
    perspective: 1000px;
    position: relative;
    width: 90%;
    margin: 0 auto;
    background: transparent;
}

/* Mobile: full width */
@media (max-width: 599px) {
    .tile {
        width: 100%;
    }
}

.tile-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    background: transparent;
}

/* Floating shadow on desktop only - applied to inner */
@media (min-width: 600px) {
    .tile-inner {
        transition: transform 0.6s, box-shadow 0.3s ease;
    }
    
    .tile:hover .tile-inner {
        transform: rotateY(180deg);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    }
    
    .tile-inner:not(:hover) {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    }
    
    .tile:hover {
        transform: translateY(-5px);
    }
}

/* Desktop hover effect */
@media (min-width: 600px) {
    .tile:hover .tile-inner {
        transform: rotateY(180deg);
    }
}

/* Mobile: Show front only, no flip */
@media (max-width: 599px) {
    .tile-inner {
        transform: none !important;
    }
    
    .tile-back {
        display: none;
    }
}

.tile-front,
.tile-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
}

.tile-front {
    z-index: 2;
    transform: rotateY(0deg);
}

.tile-back {
    transform: rotateY(180deg);
}

/* Text tiles - dark background with light text */
.tile-text {
    background-color: #1a1a1a;
    color: #ffffff;
}

.tile-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.tile-text h3 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tile-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
}

/* Image tiles - no background */
.tile-image {
    background-color: transparent;
    padding: 0;
    overflow: hidden;
}

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

/* Color tiles - bright colors with dark text */
.tile-color {
    color: #1a1a1a;
    font-weight: 600;
}

.tile-color h2 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.tile-color p {
    font-size: 1.2rem;
    line-height: 1.6;
    max-width: 80%;
}

/* Responsive text sizing */
@media (max-width: 599px) {
    .tile-text h2,
    .tile-color h2 {
        font-size: 2rem;
    }
    
    .tile-text h3 {
        font-size: 1.5rem;
    }
    
    .tile-text p,
    .tile-color p {
        font-size: 1rem;
    }
    
    .tile-front,
    .tile-back {
        padding: 1.5rem;
    }
}

/* Smooth transitions */
.tile-inner,
.tile-front,
.tile-back {
    transition: all 0.3s ease;
}

/* Optional: Add subtle shadow on hover */
@media (min-width: 600px) {
    .tile:hover {
        z-index: 10;
    }
}
