@font-face {
    font-family: "Apple Garamond";
    src: url("assets/AppleGaramond-Light.ttf") format("truetype");
    font-display: swap;
}

@font-face {
    font-family: "Arial Rounded";
    src: url("assets/Arial Rounded Bold.ttf") format("truetype");
    font-display: swap;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    background: #f7f6f2;
}

body {
    margin: 0;
    color: #171717;
    font-family: "Arial Rounded", sans-serif;
    font-size: 19px;
    line-height: 1.35;
}

button {
    border: 0;
    border-radius: 0;
    background: none;
    color: inherit;
    font: inherit;
}

.site-header {
    display: grid;
    grid-template-columns: clamp(132px, 24vw, 260px) 1fr;
    gap: clamp(24px, 8vw, 92px);
    align-items: center;
    width: min(850px, calc(100% - 32px));
    margin: clamp(28px, 6vw, 72px) auto clamp(22px, 4vw, 44px);
}

.portrait {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 14px 30px rgb(23 23 23 / 0.13);
}

.identity h1 {
    font-family: "Apple Garamond", serif;
}

.identity p,
.identity h1 {
    margin: 0;
    font-weight: 400;
    letter-spacing: 0;
}

.identity p:first-child {
    font-size: clamp(42px, 7vw, 54px);
    line-height: 0.9;
}

.identity h1 {
    font-size: clamp(56px, 10vw, 106px);
    line-height: 0.9;
}

.identity p:last-child {
    margin-top: 8px;
    font-size: clamp(32px, 5vw, 38px);
    line-height: 1;
}

.tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    width: min(850px, calc(100% - 32px));
    margin: 0 auto clamp(34px, 5vw, 60px);
}

.tab {
    position: relative;
    isolation: isolate;
    min-height: 46px;
    padding: 8px 10px 7px;
    border: 1px solid #171717;
    border-radius: 8px;
    cursor: pointer;
    overflow-wrap: anywhere;
    text-align: center;
    text-transform: none;
    transition:
        color 180ms ease,
        border-color 180ms ease,
        box-shadow 220ms ease,
        transform 180ms ease;
    will-change: transform;
}

.tab::before {
    position: absolute;
    inset: 3px;
    z-index: -1;
    border-radius: 5px;
    background: #171717;
    content: "";
    opacity: 0;
    transform: scale(0.78);
    transition:
        opacity 180ms ease,
        transform 180ms ease;
}

.tab[aria-selected="true"] {
    color: #f7f6f2;
    box-shadow: 0 10px 20px rgb(23 23 23 / 0.12);
}

.tab[aria-selected="true"]::before {
    opacity: 1;
    transform: scale(1);
}

.tab:active,
.tab.is-pressing {
    animation: tab-press 180ms ease both;
}

main {
    width: min(850px, calc(100% - 32px));
    margin: 0 auto 64px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(18px, 3vw, 36px);
}

.gallery-column {
    display: flex;
    flex-direction: column;
    gap: clamp(18px, 3vw, 36px);
    min-width: 0;
}

.gallery figure {
    margin: 0;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.gallery a {
    display: block;
    color: inherit;
    outline-offset: 5px;
}

.gallery img {
    display: block;
    width: 100%;
    height: auto;
    border: 6px solid #fffaf0;
    border-radius: 8px;
    background: #ebe9e1;
    box-shadow:
        0 1px 0 rgb(23 23 23 / 0.16),
        0 12px 26px rgb(23 23 23 / 0.12);
    transition:
        filter 220ms ease,
        box-shadow 260ms ease,
        transform 180ms ease;
}

.gallery a:hover img,
.gallery a:focus-visible img {
    filter: saturate(1.04) contrast(1.02);
    box-shadow:
        0 1px 0 rgb(23 23 23 / 0.16),
        0 18px 34px rgb(23 23 23 / 0.17);
    transform: translateY(0px) scale(1);
}

.gallery.is-entering figure {
    animation: gallery-fade 260ms ease both;
}

@keyframes tab-press {
    0% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(0px) scale(1);
    }
}

@keyframes gallery-fade {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tab,
    .tab::before,
    .gallery img {
        transition: none;
    }

    .tab:active,
    .tab.is-pressing,
    .gallery.is-entering figure {
        animation: none;
    }

    .tab,
    .tab:hover,
    .tab[aria-selected="true"],
    .tab[aria-selected="true"]:hover,
    .gallery a:hover img,
    .gallery a:focus-visible img {
        transform: none;
    }
}

@media (max-width: 760px) {
    .site-header {
        grid-template-columns: 104px 1fr;
        gap: 18px;
        width: min(100% - 24px, 850px);
        margin-top: 22px;
    }

    .identity p:first-child {
        font-size: 36px;
    }

    .identity h1 {
        font-size: 48px;
    }

    .identity p:last-child {
        font-size: 28px;
    }

    .tabs,
    main {
        width: min(100% - 24px, 850px);
    }

    .tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .gallery,
    .gallery-column {
        gap: 14px;
    }
}

@media (max-width: 420px) {
    .site-header {
        grid-template-columns: 86px 1fr;
    }

    .identity p:first-child {
        font-size: 31px;
    }

    .identity h1 {
        font-size: 39px;
    }

    .identity p:last-child {
        font-size: 24px;
    }

    .gallery,
    .gallery-column {
        gap: 10px;
    }
}
