:root {
    --primary-color: #ffffff;
    --accent-color: #F79421; /* Logo Orange */
    --accent-secondary: #F15B27; /* Logo Red-Orange */
    --card-bg: #2a2a2a;
    --card-text: #F79421;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #090919 0%, #161644 50%, #1f4068 100%);
    background-size: 200% 200%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    overflow: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
}

.logo-container {
    width: 300px; 
    height: auto;
    margin-bottom: 1rem;
}

.animated-logo {
    width: 100%;
    height: auto;
    overflow: visible;
}

.animated-logo path, 
.animated-logo polygon {
    fill-opacity: 0;
    stroke: #ffffff;
    stroke-width: 1;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: fill-opacity 1s ease;
}

.animated-logo.finished path, 
.animated-logo.finished polygon {
    fill-opacity: 1;
    stroke: none; 
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-shadow: 0 4px 6px rgba(0,0,0,0.3);
    letter-spacing: 2px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease forwards;
    animation-delay: 3.5s; 
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 2rem;
    opacity: 0; 
    transform: translateY(20px);
    animation: fadeInUp 1s ease forwards;
    animation-delay: 4s;
    perspective: 400px; 
}

/* Flip Clock Styles */
.time-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.flip-unit {
    position: relative;
    width: 100px; /* Reduced from potential overflow if too big */
    height: 120px; /* Slightly taller for breathing room */
    font-size: 5rem;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    background-color: var(--card-bg); /* Fallback */
}

/* 
   We using 2 cards. Each card is 50% height.
   Top Card: shows top 50% of text.
   Bottom Card: shows bottom 50% of text.
*/
.upper-card, .lower-card, .first-flip, .second-flip {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%; /* 60px */
    overflow: hidden;
    background-color: var(--card-bg);
    color: var(--card-text);
    text-align: center;
}

/* Upper halves */
.upper-card, .first-flip {
    top: 0;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid rgba(0,0,0,0.3); 
    z-index: 1;
}

/* Lower halves */
.lower-card, .second-flip {
    bottom: 0;
    border-radius: 0 0 8px 8px;
    border-top: 1px solid rgba(0,0,0,0.3); 
    z-index: 1;
}

/* SPAN Positioning */
/* 
   The span contains the full number. 
   Height of flip-unit is 120px.
   Line-height is 120px.
*/
.flip-unit span {
    display: block;
    height: 120px;
    line-height: 120px;
    width: 100%;
    position: absolute;
    left: 0;
}

/* For Upper Card: Text sits at top: 0. We see top 60px. Correct. */
.upper-card span, .first-flip span {
    top: 0;
}

/* For Lower Card: Text needs to shift up by 60px so we see bottom 60px. */
.lower-card span, .second-flip span {
    bottom: 0; /* Or top: -60px */
    transform: translateY(-50%); /* Shifts up by 50% of span height (60px) */
    /* 
       Wait, span height is 120px. 
       translateY(-50%) moves it UP by 60px.
       If parent is bottom aligned (bottom: 0), top of span is at parent top (0 relative).
       If we translate -50%, it moves up 60px.
       So top of span is at -60px relative to lower-card top.
       So we see from 60px to 120px of the span.
       This is CORRECT.
    */
    top: 0; /* Reset explicitly */
}

/* Animation Z-Indexes */
.first-flip {
    z-index: 2;
    transform-origin: bottom;
    backface-visibility: hidden;
}

.second-flip {
    z-index: 2;
    transform-origin: top;
    backface-visibility: hidden;
    transform: rotateX(90deg); 
}

.label {
    font-size: 0.9rem;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1rem;
}

.flip-unit.fling .first-flip {
    animation: flipDownFront 0.6s ease-in-out forwards;
}

.flip-unit.fling .second-flip {
    animation: flipDownBack 0.6s ease-in-out forwards;
}

@keyframes flipDownFront {
    0% { transform: rotateX(0deg); }
    100% { transform: rotateX(-90deg); }
}

@keyframes flipDownBack {
    0% { transform: rotateX(90deg); }
    100% { transform: rotateX(0deg); }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Contact Section */
.contact-section {
    margin-top: 3rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease forwards;
    animation-delay: 4.5s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.contact-section p {
    font-size: 1.2rem;
    color: #cbd5e1;
    letter-spacing: 1px;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #25D366;
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 1.1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

.whatsapp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    .countdown {
        gap: 1rem;
        flex-wrap: wrap;
    }
    .flip-unit {
        width: 70px;
        height: 80px;
        font-size: 3rem;
    }
    .flip-unit span {
        height: 80px;
        line-height: 80px;
    }
    .contact-section {
        margin-top: 2rem;
    }
}
