/* Homepage — scrollable landing page */
html, body {
    overflow: hidden;
    height: 100%;
}

#app-container {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    grid-template-rows: auto 1fr;
}

#app-header {
    z-index: 100;
}

.home-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 0;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 28px var(--gap-lg) 80px;
    background-color: #fff;
}

.home-intro,
.home-database {
    width: 100%;
    max-width: 1040px;
}

.home-intro {
    margin-bottom: 40px;
}

.home-intro h2 {
    margin: 0 0 20px;
    max-width: 52rem;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #111;
    line-height: 1.2;
}

.home-intro p {
    margin: 0 0 28px;
    max-width: 46rem;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.45;
    color: #4a5568;
}

.home-intro p a {
    color: var(--accent-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.home-intro p a:hover,
.home-intro p a:focus-visible {
    color: var(--primary-blue);
}

.home-intro-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.home-btn-primary {
    background-color: var(--accent-blue);
    border: 1.5px solid var(--accent-blue);
    color: #fff;
}

.home-btn-primary:hover,
.home-btn-primary:focus-visible {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: #fff;
}

.home-btn-secondary {
    background-color: #fff;
    border: 1.5px solid var(--accent-blue);
    color: var(--accent-blue);
}

.home-btn-secondary:hover,
.home-btn-secondary:focus-visible {
    background-color: rgba(0, 102, 204, 0.06);
    color: var(--accent-blue);
}

.home-database-header {
    margin: 0 0 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid #d4d4d4;
}

.home-database-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: #111;
    line-height: 1.15;
}

.home-database-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.home-database-list li + li {
    border-top: 1px solid #e5e5e5;
}

.home-database-list a {
    display: grid;
    grid-template-columns: 150px 9fr 1fr 260px;
    gap: 12px 32px;
    align-items: start;
    padding: 12px 64px 12px 8px;
    margin: 0 -8px;
    border-radius: 6px;
    color: inherit;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.home-database-list a:hover,
.home-database-list a:focus-visible {
    background-color: rgba(0, 102, 204, 0.1);
    box-shadow: inset 3px 0 0 var(--accent-blue);
}

.home-database-list a:hover h3,
.home-database-list a:focus-visible h3 {
    color: var(--accent-blue);
}

.home-database-list a:hover .home-database-thumb,
.home-database-list a:focus-visible .home-database-thumb {
    border-color: var(--accent-blue);
}

.home-database-thumb {
    display: block;
    width: 260px;
    height: 144px;
    min-width: 260px;
    min-height: 144px;
    max-width: 260px;
    max-height: 144px;
    grid-column: 4;
    object-fit: cover;
    object-position: top left;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #f7fafc;
    transition: border-color 0.15s ease;
}

.home-database-list h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.2px;
    color: #111;
    line-height: 1.25;
    grid-column: 1;
    transition: color 0.15s ease;
}

.home-database-list p {
    margin: 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: #4a5568;
    grid-column: 2;
}

@media (max-width: 768px) {
    html, body {
        overflow: hidden;
        height: 100%;
    }

    #app-container {
        display: flex;
        flex-direction: column;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }

    .home-main {
        padding: 16px 16px 48px;
        flex: 1;
        min-height: 0;
    }

    .home-intro {
        margin-bottom: 28px;
    }

    .home-intro h2 {
        font-size: 24px;
        margin-bottom: 14px;
    }

    .home-intro p {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .home-btn {
        font-size: 15px;
        padding: 9px 14px;
    }

    .home-database-header h2 {
        font-size: 18px;
    }

    .home-database-list a {
        grid-template-columns: 1fr 128px;
        gap: 8px 12px;
        padding: 10px 4px;
        margin: 0 -4px;
    }

    .home-database-thumb {
        width: 128px;
        height: 72px;
        min-width: 128px;
        min-height: 72px;
        max-width: 128px;
        max-height: 72px;
        grid-column: 2;
        grid-row: 1 / 3;
    }

    .home-database-list h3 {
        font-size: 15px;
        grid-column: 1;
    }

    .home-database-list p {
        grid-column: 1;
        font-size: 14px;
    }
}
