* {
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;

    scroll-snap-type: y proximity;
}


body {
    margin: 0;

    color: rgb(20, 20, 20);

    background: rgb(255, 255, 255);

    font-family:
        system-ui,
        sans-serif;
}


html,
body,
* {
    scrollbar-width: none;
}


html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
    display: none;
}


.landing {
    min-height: 100vh;

    scroll-snap-align: start;

    display: flex;
    flex-direction: column;

    padding: 40px;
}


.site-header {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;
}


.site-name {
    color: inherit;

    font-size: 16px;
    font-weight: 600;

    text-decoration: none;
}


.site-nav {
    display: flex;
    align-items: center;

    gap: 28px;
}


.site-nav a {
    color: rgb(80, 80, 80);

    font-size: 14px;

    text-decoration: none;

    transition:
        color 100ms ease;
}


.site-nav a:hover {
    color: rgb(20, 20, 20);
}


.hero {
    flex: 1;

    width: 100%;
    max-width: 900px;

    margin: 0 auto;

    display: flex;
    align-items: center;
}


.hero-content {
    width: 100%;
}


.scroll-control {
    width: fit-content;

    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 5px;

    color: rgb(100, 100, 100);

    font-size: 13px;

    text-decoration: none;

    transition:
        color 100ms ease,
        transform 100ms ease;
}


.scroll-control:hover {
    color: rgb(20, 20, 20);
}


.scroll-down {
    align-self: center;

    animation: attention-bounce 4s ease-in-out infinite;
}


.scroll-down:hover {
    transform: translateY(2px);
}


.scroll-up {
    position: fixed;
    top: 24px;
    right: 40px;

    align-self: flex-end;

    margin: 0;

    opacity: 0;
    pointer-events: none;

    animation: attention-bounce 4s ease-in-out 1.5s infinite;
}


.life-section.is-active .scroll-up {
    opacity: 1;
    pointer-events: auto;
}


.scroll-up:hover {
    transform: translateY(-2px);
}


.scroll-arrow {
    font-size: 20px;
    line-height: 1;
}


.life-section {
    min-height: 100vh;

    scroll-snap-align: start;

    display: flex;
    justify-content: center;

    padding:
        80px
        40px;
}


.life-section .page-content {
    align-items: center;

    transform: scale(0.8);
    transform-origin: top center;
}


.life-section .section-header {
    width: 100%;
}


@keyframes attention-bounce {
    0%,
    82%,
    100% {
        transform: translateY(0);
    }

    86% {
        transform: translateY(-6px);
    }

    90% {
        transform: translateY(2px);
    }

    94% {
        transform: translateY(-3px);
    }
}


@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .scroll-control {
        animation: none;
    }
}


.page-content {
    width: 100%;
    max-width: 900px;

    display: flex;
    flex-direction: column;
}


.section-header {
    margin-bottom: 30px;
}


.section-header h1 {
    margin:
        0
        0
        5px
        0;

    font-size: 28px;
    font-weight: 600;
}


.section-header p {
    margin: 0;

    color: rgb(100, 100, 100);

    font-size: 14px;
}


#year-card {
    width: fit-content;

    max-width: 100%;

    margin-inline: auto;

    scroll-margin-block-start: 48px;

    padding: 28px;

    border: 1px solid rgb(200, 200, 200);
    border-radius: 12px;
}


#year-card > h1 {
    margin:
        0
        0
        30px
        0;

    font-size: 28px;
    font-weight: 600;
}


.category {
    margin-bottom: 28px;
}


.category:last-child {
    margin-bottom: 0;
}


.category-title {
    margin:
        0
        0
        10px
        0;

    color: rgb(35, 35, 35);

    font-size: 14px;
    font-weight: 600;
}


.heat-map {
    display: grid;

    grid-template-rows:
        repeat(7, 12px);

    grid-auto-flow: column;

    grid-auto-columns: 12px;

    gap: 3px;

    width: max-content;
}


.mobile-months {
    display: none;
}


.day,
.day-placeholder {
    width: 12px;
    height: 12px;
}


.day {
    border-radius: 2px;

    cursor: pointer;

    transition:
        transform 80ms ease,
        filter 80ms ease;
}


.day:hover {
    transform: scale(1.4);

    filter: brightness(1.25);

    z-index: 1;
}


.level-0 {
    background: rgb(125, 125, 125);
}


.level-1 {
    background: #24452f;
}


.level-2 {
    background: #2f6b41;
}


.level-3 {
    background: #3c9655;
}


.level-4 {
    background: #52c96d;
}


.negative-level-0 {
    background: #24452f;
}


.negative-level-1 {
    background: #4d2929;
}


.negative-level-2 {
    background: #743333;
}


.negative-level-3 {
    background: #a33d3d;
}


.negative-level-4 {
    background: #d95353;
}


#tooltip {
    position: fixed;

    display: flex;
    flex-direction: column;

    gap: 4px;

    padding:
        8px
        10px;

    background: #202020;
    color: #ddd;

    border: 1px solid #333;
    border-radius: 6px;

    font-size: 12px;

    pointer-events: none;

    opacity: 0;

    transform: translateY(3px);

    transition:
        opacity 80ms ease,
        transform 80ms ease;

    z-index: 1000;

    box-shadow:
        0
        4px
        16px
        rgba(0, 0, 0, 0.35);
}


#tooltip.visible {
    opacity: 1;

    transform: translateY(0);
}


#tooltip strong {
    margin-bottom: 2px;

    color: #fff;

    font-size: 12px;
    font-weight: 600;
}


#tooltip span {
    white-space: nowrap;
}


@media (max-width: 650px) {

    .landing {
        min-height: 100svh;
        min-height: 100dvh;

        padding: 24px;

        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }


    .site-header {
        align-items: flex-start;
    }


    .site-nav {
        gap: 16px;
    }


    .site-nav a {
        font-size: 13px;
    }


    .life-section {
        padding:
            60px
            24px;
    }


    .scroll-up {
        right: 24px;
    }


    .scroll-down {
        margin-bottom: env(safe-area-inset-bottom);
    }


    #year-card {
        width: 100%;

        padding: 12px;

        scroll-margin-block-start: 32px;
    }


    #year-card > h1 {
        display: none;
    }


    .category {
        margin-bottom: 12px;
    }


    .category-title {
        margin-bottom: 6px;

        font-size: 12px;
    }


    .life-section {
        scroll-snap-align: none;
    }


    .heat-map {
        gap: 2px;

        grid-auto-columns: 11px;

        zoom: 0.72;
    }


    .desktop-heat-map {
        display: none;
    }


    .mobile-months {
        display: flex;

        gap: 12px;

        width: 100%;

        padding: 0 2px 2px;

        overflow-x: auto;

        scroll-snap-type: x proximity;
    }


    .month-group {
        flex: 0 0 64px;

        scroll-snap-align: center;
    }


    .month-title {
        margin:
            0
            0
            6px;

        color: rgb(100, 100, 100);

        font-size: 11px;
        font-weight: 600;
        text-align: center;
    }


    .month-map {
        display: grid;

        grid-template-rows: repeat(7, 8px);

        grid-auto-flow: column;
        grid-auto-columns: 8px;

        gap: 2px;

        width: max-content;

        margin-inline: auto;
    }


    .month-map .day,
    .month-map .day-placeholder {
        width: 8px;
        height: 8px;
    }


    .day,
    .day-placeholder {
        width: 11px;
        height: 11px;
    }

}
