/* Start page, run log, team and the pictures of people. */

@layer core {
    .system__actions {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        margin-top: 24px;
    }

    .system__hint {
        max-width: 70ch;
        margin-top: 16px;
        color: var(--text-secondary);
    }

    ul.system__hint {
        display: grid;
        gap: 6px;
    }

    /* Messages about jobs that wait, run or have just ended. They lie over the
       page in a corner, so that they neither move its content nor stay in the way. */
    .toasts {
        position: fixed;
        right: 24px;
        bottom: 24px;
        z-index: 10;
        display: grid;
        gap: 10px;
        width: min(440px, calc(100vw - 48px));
    }

    .toast {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        column-gap: 12px;
        row-gap: 4px;
        padding: 16px 20px;
        background: var(--surface);
        border: 1px solid var(--line);
        box-shadow: 0 10px 30px rgb(0 0 0 / 0.25);
        animation: toast-in 0.25s ease-out;
    }

    .toast__title {
        font-weight: 600;
    }

    .toast__text {
        flex-basis: 100%;
        color: var(--text-secondary);
    }

    .toast--leaving {
        opacity: 0;
        transform: translateY(8px);
        transition:
            opacity 0.3s ease-in,
            transform 0.3s ease-in;
    }

    @keyframes toast-in {
        from {
            opacity: 0;
            transform: translateY(8px);
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .toast {
            animation: none;
        }

        .toast--leaving {
            transition: none;
        }
    }

    /* Something is in progress. Always next to a word that says so. */
    .spinner {
        flex: none;
        width: 14px;
        height: 14px;
        border: 2px solid var(--line);
        border-top-color: var(--text-primary);
        border-radius: 50%;
        animation: spinner-turn 0.9s linear infinite;
    }

    @keyframes spinner-turn {
        to {
            transform: rotate(360deg);
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .spinner {
            animation: none;
        }
    }

    /* Start page. Set large on purpose, like the other internal tools: one big
       title, big section headings, big tiles and nothing else. */
    .hero {
        padding: clamp(24px, 6vw, 72px) 0 clamp(8px, 2vw, 24px);
        text-align: center;
    }

    .hero__title {
        font-weight: 600;
        font-size: clamp(40px, 6vw, 68px);
        line-height: 1.05;
        letter-spacing: -0.01em;
    }

    .hero__lead {
        max-width: 56ch;
        margin: 18px auto 0;
        font-weight: 300;
        font-size: clamp(17px, 1.6vw, 20px);
    }

    .showcase {
        margin-top: clamp(40px, 6vw, 80px);
    }

    .showcase__title {
        margin-bottom: 28px;
        font-weight: 600;
        font-size: clamp(26px, 3.2vw, 38px);
        line-height: 1.15;
        text-align: center;
    }

    /* Lines of a run. The level is named in words; the bar only helps the eye
       find changes and problems in a long list. */
    .run-entry td:first-child {
        border-left: 3px solid transparent;
    }

    .run-entry--change td:first-child {
        border-left-color: var(--gold);
    }

    .run-entry--warning td:first-child {
        border-left-color: var(--warning);
    }

    .run-entry--error td:first-child {
        border-left-color: var(--critical);
    }

    .run-entry__context {
        margin-top: 4px;
        color: var(--text-secondary);
        font-size: 13px;
    }

    .run-entry__context pre {
        margin: 6px 0 0;
        white-space: pre-wrap;
        word-break: break-word;
    }

    .filter {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
    }

    /* The picture of a person, or the initials in its place. Square like every
       other surface, and always next to the name, so it never has to carry the
       name alone. */
    .portrait {
        display: block;
        flex: none;
        width: var(--portrait-size);
        height: var(--portrait-size);
        object-fit: cover;
        background: var(--page);
    }

    .portrait--small {
        --portrait-size: 40px;
        font-size: 15px;
    }

    .portrait--medium {
        --portrait-size: 72px;
        font-size: 26px;
    }

    .portrait--large {
        --portrait-size: 144px;
        font-size: 52px;
    }

    /* Initials stand on the paper of the page, grain included. A photo never
       gets grain. */
    .portrait--initials {
        display: grid;
        place-items: center;
        background-image: var(--grain-paper);
        background-size: var(--grain-size);
        background-blend-mode: soft-light;
        border: 1px solid var(--line);
        color: var(--text-secondary);
        font-weight: 300;
        line-height: 1;
        letter-spacing: 0.04em;
        user-select: none;
    }

    /* Team */
    .showcase--team {
        margin-top: clamp(24px, 4vw, 48px);
    }

    .team-member {
        gap: 18px;
    }

    .team-member .portrait {
        margin-bottom: 6px;
    }

    .team-member__error {
        display: flex;
        align-items: flex-start;
        gap: 6px;
    }

    .team-member__error .icon {
        margin-top: 3px;
    }

    .team-member__actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .team-member__upload {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    /* The file input is hidden; its label is the button people see, so it shows
       the focus of the input. */
    .team-member__file:focus-visible + .team-member__choose {
        outline: 2px solid var(--gold-dark);
        outline-offset: 2px;
    }

    .team-member__choose[aria-disabled="true"] {
        cursor: progress;
        opacity: 0.7;
    }

    .team-member__remove {
        border-color: transparent;
        color: var(--text-secondary);
    }

    .team-member__remove:hover {
        border-color: var(--line);
        color: var(--text-primary);
    }

    .team-member__limits {
        color: var(--text-secondary);
        font-size: 14px;
    }

    .team__empty {
        color: var(--text-secondary);
        font-size: 17px;
        text-align: center;
    }
}
