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

/* Hide scrollbar globally - including iOS Safari */
html, body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

/* Additional iOS scrollbar hiding */
html, body {
    scrollbar-color: transparent transparent;
}

*::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #0f0f0f;
    --text-primary: #ececec;
    --text-secondary: #a0a0a0;
    --accent-color: #829696;
    --accent-dark: #6b7a7a;
    --gray-color: #a0a0a0;
    --white-color: #ececec;
}

body {
    font-family: 'Shippori Mincho', serif;
    background: #1a1a1a;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.landing-container {
    width: 100%;
    max-width: 1400px;
    padding: clamp(20px, 3vh, 40px) 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Scale gap based on viewport height */
    gap: clamp(40px, 6vh, 80px);
    /* Ensure content fits in viewport */
    max-height: 100vh;
    overflow: hidden;
}

/* Header with logo and text */
.landing-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
}

.landing-logo {
    /* Scale logo based on viewport height - between 200px and 400px */
    width: clamp(200px, 30vh, 400px);
    height: clamp(200px, 30vh, 400px);
    max-width: 80vw;
    object-fit: contain;
    opacity: 0;
    animation: fadeIn 0.8s ease-in forwards;
    /* Prevent any layout shifts */
    transform: translateZ(0);
    will-change: opacity;
}

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

.landing-text {
    font-size: 26px;
    font-weight: 400;
    color: var(--text-primary);
    opacity: 0;
    white-space: nowrap;
    min-height: 40px;
    /* Reserve space to prevent jumping */
    display: block;
}

/* Tiles */
.landing-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    width: 100%;
    max-width: 1200px;
    opacity: 0;
    transform: translateY(30px);
    animation: tilesSlideUp 0.5s ease-out 2s forwards;
}

@keyframes tilesSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-tile {
    background: var(--bg-primary);
    border: 2px solid transparent;
    border-radius: 16px;
    /* Scale padding based on viewport height */
    padding: clamp(30px, 5vh, 60px) clamp(20px, 3vw, 40px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: clamp(16px, 2vh, 24px);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.landing-tile:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Tile colors */
.tile-chat {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, rgba(125, 155, 126, 0.1) 0%, var(--bg-primary) 100%);
}

.tile-chat:hover {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, rgba(125, 155, 126, 0.15) 0%, var(--bg-primary) 100%);
}

.tile-chat .tile-icon {
    color: var(--accent-color);
}


/* Chat Pro tile - deeper green */
.tile-chat-pro {
    border-color: var(--accent-dark);
    background: linear-gradient(135deg, rgba(90, 122, 91, 0.15) 0%, var(--bg-primary) 100%);
}

.tile-chat-pro:hover {
    border-color: var(--accent-dark);
    background: linear-gradient(135deg, rgba(90, 122, 91, 0.2) 0%, var(--bg-primary) 100%);
}

.tile-chat-pro .tile-icon {
    color: var(--accent-dark);
}

.tile-analyze {
    border-color: var(--gray-color);
    background: linear-gradient(135deg, rgba(160, 160, 160, 0.1) 0%, var(--bg-primary) 100%);
}

.tile-analyze:hover {
    border-color: var(--gray-color);
    background: linear-gradient(135deg, rgba(160, 160, 160, 0.15) 0%, var(--bg-primary) 100%);
}

.tile-analyze .tile-icon {
    color: var(--gray-color);
}

.tile-assess {
    border-color: var(--white-color);
    background: linear-gradient(135deg, rgba(236, 236, 236, 0.1) 0%, var(--bg-primary) 100%);
}

.tile-assess:hover {
    border-color: var(--white-color);
    background: linear-gradient(135deg, rgba(236, 236, 236, 0.15) 0%, var(--bg-primary) 100%);
}

.tile-assess .tile-icon {
    color: var(--white-color);
}

/* Tile content */
.tile-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile-icon svg {
    width: 100%;
    height: 100%;
}

.tile-title {
    font-size: 28px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.tile-description {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

/* Mobile responsive */
@media (max-width: 1200px) {
    .landing-tiles {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .landing-tiles {
        grid-template-columns: 1fr;
        gap: 30px;
        max-width: 500px;
    }
    
    .landing-tile {
        padding: 50px 30px;
    }
}

/* Logout button */
.logout-btn {
    position: fixed;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1000;
    color: var(--text-secondary, #a0a0a0);
    opacity: 0;
    animation: fadeIn 0.5s ease-in 2s forwards;
}

.logout-btn svg {
    width: 28px;
    height: 28px;
}

.logout-btn:hover {
    color: var(--text-primary, #ececec);
    transform: scale(1.1);
}

.logout-btn:active {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    body {
        align-items: flex-start;
        padding-top: 20px;
    }

    .landing-container {
        gap: 40px;
        max-height: none;
        overflow: visible;
        padding-bottom: 40px;
    }

    .landing-logo {
        width: 300px;
        height: 300px;
        max-width: 60vw;
    }

    .landing-text {
        font-size: 20px;
        min-height: 30px;
    }

    .tile-title {
        font-size: 24px;
    }

    .tile-description {
        font-size: 14px;
    }

    .tile-icon {
        width: 60px;
        height: 60px;
    }

    .logout-btn {
        top: 16px;
        right: 16px;
    }

    .logout-btn svg {
        width: 24px;
        height: 24px;
    }
}
