* {
    -webkit-tap-highlight-color: transparent;
}

/* Keyframes */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(26px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpBlur {
    from {
        opacity: 0;
        transform: translateY(26px);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0px);
    }
}

@keyframes slideDownBlur {
    from {
        opacity: 1;
        transform: scale(1);
        filter: blur(0px);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
        filter: blur(8px);
    }
}

@keyframes glowFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleInLeft {
    from {
        transform: scaleX(0.7) scaleY(0.7);
        transform-origin: left center;
    }
    to {
        opacity: 1;
        transform: scaleX(1) scaleY(1);
        transform-origin: left center;
    }
}

.main-title {
    animation: weightBounce 1.2s cubic-bezier(.05, .15, 0.5, 1) forwards;
}

@keyframes weightBounce {
    0%   { font-variation-settings: "wght" 500; }
    30%  { font-variation-settings: "wght" 600; }
    50%  { font-variation-settings: "wght" 300; }
    100% { font-variation-settings: "wght" 400; }
}

/* Blur for top bar */
.top-bar.scrolled {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Staggered slide-up for horizontal buttons */
.button-grid-horizontal .feature-button-horizontal {
    opacity: 0;
    transform: translateY(26px);
    animation: slideUp 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.button-grid-horizontal .feature-button-horizontal:nth-child(1) { animation-delay: 0.00s; }
.button-grid-horizontal .feature-button-horizontal:nth-child(2) { animation-delay: 0.10s; }
.button-grid-horizontal .feature-button-horizontal:nth-child(3) { animation-delay: 0.20s; }
.button-grid-horizontal .feature-button-horizontal:nth-child(4) { animation-delay: 0.30s; }
.button-grid-horizontal .feature-button-horizontal:nth-child(5) { animation-delay: 0.40s; }
.button-grid-horizontal .feature-button-horizontal:nth-child(6) { animation-delay: 0.50s; }
.button-grid-horizontal .feature-button-horizontal:nth-child(7) { animation-delay: 0.60s; }
.button-grid-horizontal .feature-button-horizontal:nth-child(8) { animation-delay: 0.70s; }
.button-grid-horizontal .feature-button-horizontal:nth-child(9) { animation-delay: 0.80s; }
.button-grid-horizontal .feature-button-horizontal:nth-child(10) { animation-delay: 0.90s; }

/* Scale-in for main feature buttons */
.feature-button {
    opacity: 0;
    animation: scaleInLeft 0.7s cubic-bezier(0.4,0,0.2,1) forwards;
}

.feature-button:nth-child(2) {
    opacity: 0;
    animation-delay: 0.2s;
}

.feature-button:nth-child(3) {
    opacity: 0;
    animation-delay: 0.3s;
}

.feature-button-horizontal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Hidden container: show/hide animations */
#hiddenContainer.visible .feature-button-horizontal {
    animation: slideUpBlur 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#hiddenContainer.hiding .feature-button-horizontal {
    animation: slideDownBlur 0.3s ease-out forwards;
}

#hiddenContainer.visible .feature-button-horizontal:nth-child(1) { animation-delay: 0.00s; }
#hiddenContainer.visible .feature-button-horizontal:nth-child(2) { animation-delay: 0.10s; }
#hiddenContainer.visible .feature-button-horizontal:nth-child(3) { animation-delay: 0.20s; }
#hiddenContainer.visible .feature-button-horizontal:nth-child(4) { animation-delay: 0.30s; }
#hiddenContainer.visible .feature-button-horizontal:nth-child(5) { animation-delay: 0.40s; }
#hiddenContainer.visible .feature-button-horizontal:nth-child(6) { animation-delay: 0.50s; }
#hiddenContainer.visible .feature-button-horizontal:nth-child(7) { animation-delay: 0.60s; }
#hiddenContainer.visible .feature-button-horizontal:nth-child(8) { animation-delay: 0.70s; }
#hiddenContainer.visible .feature-button-horizontal:nth-child(9) { animation-delay: 0.80s; }
#hiddenContainer.visible .feature-button-horizontal:nth-child(10) { animation-delay: 0.90s; }

#hiddenContainer.hiding .feature-button-horizontal:nth-child(1) { animation-delay: 0.00s; }
#hiddenContainer.hiding .feature-button-horizontal:nth-child(2) { animation-delay: 0.00s; }
#hiddenContainer.hiding .feature-button-horizontal:nth-child(3) { animation-delay: 0.00s; }
#hiddenContainer.hiding .feature-button-horizontal:nth-child(4) { animation-delay: 0.00s; }
#hiddenContainer.hiding .feature-button-horizontal:nth-child(5) { animation-delay: 0.00s; }
#hiddenContainer.hiding .feature-button-horizontal:nth-child(6) { animation-delay: 0.00s; }
#hiddenContainer.hiding .feature-button-horizontal:nth-child(7) { animation-delay: 0.00s; }
#hiddenContainer.hiding .feature-button-horizontal:nth-child(8) { animation-delay: 0.00s; }
#hiddenContainer.hiding .feature-button-horizontal:nth-child(9) { animation-delay: 0.00s; }
#hiddenContainer.hiding .feature-button-horizontal:nth-child(10) { animation-delay: 0.00s; }


/* Base for all the glow */
#tiktokButton .button-image::before,
#youtubeButton .button-image::before,
#instagramButton .button-image::before { /* Glow backgrounds behind specific icons */
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    opacity: 0; /* start hidden for fade-in */
    will-change: opacity;
}

/* Red glow for Instagram */
#instagramButton .button-image::before {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(247, 209, 105, 0.2);
    box-shadow: 0 0 20px 8px rgba(247, 210, 106, 0.1);
    /* shift slightly to the right */
    transform: translate(calc(-50% + 10px), -70%);
    filter: blur(9px);
    animation: glowFadeIn 5s ease-out forwards;
}

/* Red glow for YouTube */
#youtubeButton .button-image::before {
    width: 50px;
    height: 25px;
    border-radius: 18px;
    background: rgba(255, 127, 127, 0.3);
    box-shadow: 0 0 20px 8px rgba(255, 127, 127, 0.1);
    /* offset a bit towards top-left */
    transform: translate(calc(-55% - 15px), calc(-55% - 15px));
    filter: blur(12px);
    animation: glowFadeIn 4s ease-out forwards;
}

/* Blue glow for TikTok */
#tiktokButton .button-image::before {
    width: 10px;
    height: 40px;
    border-radius: 50%;
    background: rgba(52, 208, 255, 0.3);
    box-shadow: 0 0 20px 8px rgba(61, 213, 255, 0.3);
    /* shift slightly to the right */
    transform: translate(calc(-50% + 10px), -60%);
    filter: blur(9px);
    animation: glowFadeIn 5s ease-out forwards;
}

.button-image img {
    width: 100%;
    height: 105px;
    object-fit: contain;
    transition: transform 0.3s ease, height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth animation for hiddenContainer */
#hiddenContainer {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4,0,0.2,1), opacity 0.4s cubic-bezier(0.4,0,0.2,1);
    will-change: max-height, opacity;
}

.more-icon {
    transition: transform 0.3s ease;
}

/* Add smooth transitions for all changes */
#moreButton {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

#moreButton .button-image-small {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#moreButton .button-text h2 {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#moreButton .more-icon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Icon rotation for moreButton */
#moreButton.active .more-icon,
.more-icon.rotated {
    transform: rotate(180deg);
} 

/* Restore height for .feature-button in first container */
.content-container .feature-button {
    height: 180px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}


/* Generic Popup Styles */
.popup {
    display: flex;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

.popup-content {
    filter: blur(5px);
}

.popup.active .popup-content {
    filter: blur(0px);
}

.close-popup-btn {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    background: none;
    color: var(--text-color);
    border: none;
    font-size: 2rem;
    opacity: 0.6;
    cursor: pointer;
    transition: opacity 0.2s, background 0.2s;
  }
  .close-popup-btn:hover {
    opacity: 1;
  }

  .popup-content {
    background: var(--popup-container-background);
    color: var(--text-color);
    border-radius: 18px;
    padding: 2rem;
    max-width: 90vw;
    width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    text-align: left;
    position: relative;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s ease, filter 0.4s ease;
  }