/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    overflow-x: hidden;
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
}

/* Cover Page - Two Layer System */
.cover-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;

    /* IMPORTANT: Transition for sliding */
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateY(0); /* Ensure starting position */

    /* Gradient background for text cutout effect */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientShift 4s ease-in-out infinite;

    /* Ensure proper centering */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.cover-page.slide-up {
    transform: translateY(-100vh) !important; /* Force the transform */
}

/* White overlay layer for cutout effect */
.cover-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 1;
    pointer-events: none; /* Allow interaction with content below */
}

.cover-content {
    position: relative;
    z-index: 3;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    padding: 2rem;
    overflow: visible;
}

.cover-title {
    font-size: clamp(3rem, 8vw, 8rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.1;
    text-transform: lowercase;

    /* Ensure enough space for descenders and letter edges */
    padding: 0.2em 0.1em 0.3em 0.1em;
    margin: 0;
    width: auto;
    min-width: fit-content;
    overflow: visible;

    /* This creates the cutout effect */
    color: transparent;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    background-clip: text;
    -webkit-background-clip: text;
    animation: gradientShift 4s ease-in-out infinite;

    /* Mask the white layer behind the text */
    position: relative;

    /* Better text rendering */
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Alternative approach using backdrop-filter for better browser support */
.cover-page-alt {
    background:
        linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientShift 4s ease-in-out infinite;
}

.cover-page-alt::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    /* Use CSS mask to cut out text area */
    mask:
        radial-gradient(circle at center, transparent 20%, black 21%),
        linear-gradient(black, black);
    mask-composite: subtract;
    -webkit-mask:
        radial-gradient(circle at center, transparent 20%, black 21%),
        linear-gradient(black, black);
    -webkit-mask-composite: subtract;
    z-index: 2;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.6;
    animation: bounce 2s infinite;
}

.scroll-indicator span {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    letter-spacing: 0.05em;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) rotate(45deg);
    }
    40% {
        transform: translateY(-10px) rotate(45deg);
    }
    60% {
        transform: translateY(-5px) rotate(45deg);
    }
}

/* Main Page */
.main-page {
    position: relative;
    min-height: 100vh;
    max-height: 100vh; /* Lock to viewport height */
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding-top: 80px;
    overflow-y: auto; /* Allow internal scrolling */
    box-sizing: border-box;
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 100;
}

.logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    text-transform: lowercase;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Hamburger Menu */
.hamburger-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s ease;
}

.hamburger-menu span {
    width: 24px;
    height: 2px;
    background: #1e293b;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Tools Container */
.tools-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    justify-items: center;
}

/* Tool Cards */
.tool-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(20px);
    max-width: 320px;
    width: 100%;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
}

.tool-icon {
    margin-bottom: 1.5rem;
}

.tool-icon .icon {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

.tool-card:hover .icon {
    transform: scale(1.1);
}

.tool-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.tool-card p {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    background: #ffffff;
    padding: 2rem;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mobile-menu.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-menu-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #1e293b;
}

.mobile-menu-content ul {
    list-style: none;
}

.mobile-menu-content li {
    margin-bottom: 1rem;
}

.mobile-menu-content a {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    padding: 0.75rem 0;
    display: block;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mobile-menu-content a:hover {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    padding-left: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-header {
        padding: 0 1rem;
    }

    .tools-container {
        padding: 2rem 1rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .mobile-menu-content {
        width: 280px;
    }
}

@media (max-width: 480px) {
    .cover-title {
        font-size: 2.5rem;
    }

    .logo h2 {
        font-size: 1.25rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .cover-page {
        transition: none;
    }

    .scroll-indicator {
        animation: none;
    }
}