body {
    font-family: 'Poppins', sans-serif; /* Modern font */
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    overflow-x: hidden;
}

.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.agency-name {
    font-size: 4rem;
    font-weight: bold;
    opacity: 0;
    animation: reveal 3s ease-in-out forwards;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-top: 1rem;
    opacity: 0;
    animation: reveal 3s ease-in-out 1s forwards; /* Delayed reveal */
}

@keyframes reveal {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

nav.visible {
    transform: translateY(0);
}

nav .logo {
    font-size: 1.5rem;
    font-weight: bold;
}

nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin-left: 2rem;
}

nav ul li a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #ffd700;
}

.content {
    padding: 2rem;
    text-align: center;
}

.cards-container {
    margin-top: 2rem;
}

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

.card {
    width: 250px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px); /* Glassmorphism effect */
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Initial off-screen positions - safe default */
    opacity: 0;
    visibility: hidden; /* Extra safety to hide on fast scrolls */
    transform: translateY(200vh); /* Pushes all cards way off-screen initially */
}

.card:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.fly-left { transform: translateX(-200vw); } /* More extreme off-screen */
.fly-right { transform: translateX(200vw); }
.fly-top { transform: translateY(-200vh); }
.fly-bottom { transform: translateY(200vh); }

@keyframes flyInLeft {
    0% { opacity: 0; visibility: hidden; transform: translateX(-200vw) scale(0.5); }
    100% { opacity: 1; visibility: visible; transform: translateX(0) scale(1); }
}

@keyframes flyInRight {
    0% { opacity: 0; visibility: hidden; transform: translateX(200vw) scale(0.5); }
    100% { opacity: 1; visibility: visible; transform: translateX(0) scale(1); }
}

@keyframes flyInTop {
    0% { opacity: 0; visibility: hidden; transform: translateY(-200vh) scale(0.5); }
    100% { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
}

@keyframes flyInBottom {
    0% { opacity: 0; visibility: hidden; transform: translateY(200vh) scale(0.5); }
    100% { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
}

.card.fly-left.animate { animation: flyInLeft 1.2s ease-out forwards; }
.card.fly-right.animate { animation: flyInRight 1.2s ease-out forwards; }
.card.fly-top.animate { animation: flyInTop 1.2s ease-out forwards; }
.card.fly-bottom.animate { animation: flyInBottom 1.2s ease-out forwards; }

.scratch-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.card-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 0;
    padding: 0.5rem; /* Reduced padding for better fit */
    box-sizing: border-box; /* Ensures padding doesn't overflow */
    word-wrap: break-word; /* Handles long words */
}

.card h3 {
    margin: 0;
    font-size: 1rem; /* Further reduced size */
}

.card p {
    margin: 0.3rem 0;
    font-size: 0.8rem; /* Further reduced size */
}

.cta-button {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: #ffd700;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
    font-size: 0.8rem; /* Smaller button text */
}

.cta-button:hover {
    background: #e6c200;
}

footer {
    background: rgba(0, 0, 0, 0.8);
    padding: 2rem;
    text-align: center;
    margin-top: 2rem;
}

.social-links a {
    color: #ffd700;
    text-decoration: none;
    margin: 0 0.5rem;
}

@media only screen and (max-width: 600px) {
    .agency-name {
        font-size: 2.5rem;
    }
    .nav {
        width: auto;
    }
    .cards {
        flex-direction: column;
        align-items: center;
    }
    .card {
        width: 90%;
        max-width: 250px;
    }
}