/* Homepage (home.py). Everything is scoped under .home */

.home {
    --home-ink: #1b2333;
    --home-muted: #5a6478;
    --home-rule: #dde3ee;
    --home-brand: #307cff;
    --home-link: #1f5fd6;  /* brand blue darkened for 4.5:1 text contrast */

    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(2rem, 6vw, 4.5rem) 24px 0;
    color: var(--home-ink);
    font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
    font-size: 1.125rem;
    line-height: 1.55;
}

.home-meta a {
    color: var(--home-link);
}

.home a:focus-visible {
    outline: 3px solid var(--home-brand);
    outline-offset: 3px;
}

/* Intro */

.home-intro {
    max-width: 34rem;
    margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.home-title {
    margin: 0 0 1rem;
    font-size: clamp(2.1rem, 4.6vw, 3.4rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.015em;
    color: var(--home-ink);
}

/* Tools */

.home-tools {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 40px 28px;
}

@media (max-width: 1040px) {
    .home-tools {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .home-tools {
        grid-template-columns: minmax(0, 1fr);
    }
}

.home a.home-tool {
    display: flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.home-tool-image {
    aspect-ratio: 6 / 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12%;
    margin-bottom: 1rem;
    border: 1px solid var(--home-rule);
    border-radius: 6px;
    background: #fff;
    transition: border-color 120ms ease;
}

.home-tool-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.home-tool-name {
    margin: 0 0 0.35rem;
    font-family: inherit;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--home-ink);
}

.home-tool-blurb {
    margin: 0 0 0.6rem;
    font-size: 1rem;
    color: var(--home-muted);
}

.home-tool-formula {
    margin: auto 0 0;  /* sits at the bottom so formulas line up across a row */
    font-family: 'STIX Two Text', 'Cambria Math', 'Times New Roman', serif;
    font-style: italic;
    font-size: 1.2rem;
    color: var(--home-ink);
}

.home-tool-formula sub,
.home-tool-formula sup {
    font-size: 0.68em;
}

.home a.home-tool:hover .home-tool-image,
.home a.home-tool:focus-visible .home-tool-image {
    border-color: var(--home-brand);
}

.home a.home-tool:hover .home-tool-name,
.home a.home-tool:focus-visible .home-tool-name {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

/* Citation and links */

.home-meta {
    max-width: 44rem;
    margin: clamp(3rem, 7vw, 4.5rem) 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--home-rule);
    font-size: 1rem;
    color: var(--home-muted);
}

@media (prefers-reduced-motion: reduce) {
    .home-tool-image {
        transition: none;
    }
}
