:root {
    --pg-transition: background-color .45s ease;
}

html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pg-header {
    flex: 0 0 auto;
    z-index: 10;
}

.mainLogo {
    height: 2rem;
    width: auto;
}

/* shared circular icon button — both icons are styled & centered identically.
   The .pg-icon span wrapper is required: <button> elements ignore
   display:grid/flex for their contents in Firefox. */
#infoBtn,
.about-close {
    position: relative;
    flex: 0 0 auto;
    width: 2.375rem; /* match Bootstrap .btn height */
    height: 2.375rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    line-height: 0;
}

.pg-icon {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
}

.pg-icon svg {
    display: block;
    width: 1.125rem;
    height: 1.125rem;
}

.about-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(241, 244, 248, .82);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility .35s;
}

.about-overlay.open {
    opacity: 1;
    visibility: visible;
}

.about-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1rem;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .45s ease .25s, transform .45s ease .25s;
}

.about-overlay.open .about-content {
    opacity: 1;
    transform: none;
}

.letter-spacing {
    letter-spacing: .15em;
}

.about-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
}

.about-links a, .about-legal {
    pointer-events: auto;
}

.about-links a {
    display: inline-block;
    padding: .45rem 1.1rem;
    border: 1px solid #212529;
    border-radius: 999px;
    background: rgba(255, 255, 255, .55);
    color: #212529;
    text-decoration: none;
    transition: background .2s ease, color .2s ease, transform .15s ease;
}

.about-links a:hover,
.about-links a:focus-visible {
    background: #212529;
    color: #fff;
    transform: translateY(-2px);
}

.about-legal {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 2rem);
    padding: .5rem 1rem;
    margin: 0;
    border-radius: .75rem;
    background: rgba(255, 255, 255, .65);
    color: #6c757d;
}

.about-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    background: #212529;
    color: #fff;
    transition: background .2s ease;

    @media (min-width: 768px) {
        right: 1.5rem;
    }
}

.about-close:hover,
.about-close:focus-visible {
    background: #343a40;
}

#palette {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
}

.color-block {
    flex: 1 1 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    cursor: pointer;
    border: 0;
    padding: 0 0 3rem;
    transition: var(--pg-transition), flex-grow .3s ease;
    outline-offset: -4px;
}

.color-block:hover,
.color-block:focus-visible {
    flex-grow: 1.25;
}

.hex-label {
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .35rem .75rem;
    border-radius: .5rem;
    user-select: text; /* allow manual selection as copy fallback */
    transition: transform .15s ease;
}

.color-block:hover .hex-label {
    transform: translateY(-4px);
}

@media (max-width: 767.98px) {
    #palette {
        flex-direction: column;
    }
    .color-block {
        align-items: center;
        justify-content: flex-start;
        padding: 0 0 0 1.5rem;
    }
    .color-block:hover,
    .color-block:focus-visible {
        flex-grow: 1.15;
    }
}

@media (prefers-reduced-motion: reduce) {
    .color-block, .hex-label,
    .about-overlay, .about-content {
        transition: none;
    }
}
