/* Variables */
:root {
    --font-size: 14px;
    --line-height: 1.6;
    --background: #fff;
    --grey1: #111;
    --grey2: #111;
    --grey3: #999;
    --wash1: #e5e5e5;
    --wash2: #f2f2f2;
    --transparentBorder: rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: #222;
        --grey1: #eee;
        --grey2: #bbb;
        --grey3: #888;
        --wash1: #4e4e4e;
        --wash2: #383838;
        --transparentBorder: rgb(255 255 255 / 0.1);
    }
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

html,
body {
    max-width: 100vw;
    overflow-x: hidden;
}

@media (prefers-color-scheme: dark) {
    html {
        color-scheme: dark;
    }
}

/* Base */
body {
    background-color: var(--background);
    font-family: "Geist", sans-serif;
    font-size: var(--font-size);
    line-height: var(--line-height);
    color: var(--grey1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Loading Screen */
#loading {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999;
    overflow: hidden;
    transition: transform 0.65s cubic-bezier(0.4, 0, 1, 1);
    will-change: transform;
}

#loading.drop {
    transform: translateY(100%);
}

.loading-pill {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 16px 36px;
    font-size: 42px;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    font-family: "Geist", sans-serif;
    pointer-events: none;
    transform-origin: center center;
}

body.is-loading {
    overflow: hidden;
}

/* Page */
.page {
    padding: 0 24px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.page.page-visible {
    opacity: 1;
}

/* Profile */
.profile {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    padding: clamp(24px, calc((100vw - 540px) / 2), 72px) 0;
}

.profile-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    column-gap: 16px;
}

.profile-header h1 {
    font-size: 20px;
    font-weight: 500;
}

.byline {
    color: var(--grey2);
}

.profile-photo {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    flex-shrink: 0;
    background-color: var(--wash2);
    overflow: hidden;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-section:first-of-type {
    margin: 36px 0;
}

.profile-section {
    margin: 60px 0;
}

.profile-section h3 {
    font-size: var(--font-size);
    font-weight: 500;
    margin-bottom: calc((var(--font-size) * var(--line-height)) / 2);
}

.title {
    font-weight: 500;
}

.experiences {
    display: flex;
    flex-direction: column;
    row-gap: 36px;
    margin-top: 24px;
}

.contacts {
    display: flex;
    flex-direction: column;
    row-gap: 16px;
    margin-top: 24px;
}

.experience {
    display: flex;
    flex-direction: row;
    column-gap: 36px;
}

.description {
    color: var(--grey2);
    display: flex;
    row-gap: calc((var(--font-size) * var(--line-height)) / 2);
    flex-direction: column;
}

.description p a {
    border-bottom: 1px solid var(--wash1);
}

.year {
    color: var(--grey3);
    font-family: "Geist Mono", monospace;
    font-variant-numeric: tabular-nums;
    position: relative;
    flex-shrink: 0;
}

.year::before {
    content: "0000 — 0000";
    visibility: hidden;
}

.year span {
    position: absolute;
    left: 0;
    white-space: nowrap;
}

.experience-content {
    display: flex;
    flex-direction: column;
}

.title a:hover,
.website:hover {
    text-decoration: underline;
}

.location {
    color: var(--grey3);
}

.location ~ .description {
    margin-top: calc((var(--font-size) * var(--line-height)) / 2);
}

.awards .description {
    color: var(--grey3);
}

/* Brands */
.brands {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
    overflow: hidden;
}

.brand {
    border: 1px solid var(--wash1);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: var(--font-size);
    color: var(--grey1);
    white-space: nowrap;
    pointer-events: none;
}

/* Media tiles (games, albums, movies) */
.media-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.media-img-container {
    display: flex;
    align-items: center;
    position: relative;
}

.media-cover {
    width: 50%;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    display: block;
}

.media-disc {
    width: 49%;
    flex-shrink: 0;
    margin-left: -34%;
    position: relative;
    z-index: 0;
    transform: rotate(0deg);
    transition: margin-left 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block;
}

.media-img-container:hover .media-disc {
    margin-left: 8%;
    transform: rotate(360deg);
}

.media-tile-title {
    font-weight: 500;
    margin-top: 12px;
}

.media-tile-desc {
    color: var(--grey2);
    margin-top: 4px;
}

@media (max-width: 480px) {
    .media-grid {
        grid-template-columns: 1fr;
    }
}

/* Sub-roles */
.sub-roles {
    display: flex;
    flex-direction: column;
    margin-top: 4px;
    row-gap: 2px;
}

.sub-role {
    color: var(--grey3);
    text-decoration: line-through;
    text-decoration-color: var(--grey3);
    font-weight: 500;
}

/* Attachments */
.attachments {
    margin-top: 12px;
    width: 100%;
    position: relative;
}

.attachments-scroll {
    position: absolute;
    inset: 0;
    overflow-x: scroll;
    overflow-y: hidden;
    scrollbar-width: none;
    cursor: grab;
}

.attachments-scroll::-webkit-scrollbar {
    display: none;
}

.attachments-scroll:active {
    cursor: grabbing;
}

.attachments-images {
    display: flex;
    column-gap: 8px;
    position: relative;
    width: fit-content;
    min-width: 100%;
}

.attachment-media {
    background-color: var(--wash2);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.attachment-media img,
.attachment-media video {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-media::after {
    position: absolute;
    inset: 0;
    content: "";
    border: 1px solid var(--transparentBorder);
    border-radius: inherit;
    z-index: 10;
    pointer-events: none;
}

/* Scrollbar */
.scrollbar-track {
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background-color: var(--wash2);
    overflow: hidden;
    position: relative;
}

.scrollbar-bar {
    min-width: 50px;
    height: 100%;
    position: absolute;
    left: 0;
    border-radius: 2px;
    background-color: #ccc;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 999;
}

.lightbox-carousel-scroll {
    position: absolute;
    inset: 0;
}

.lightbox-carousel {
    display: grid;
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

.lightbox-image {
    grid-column: 1;
    grid-row: 1;
    padding: 48px 24px;
    width: 100dvw;
    height: 100dvh;
}

.lightbox-inner {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-img-wrap {
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    pointer-events: all;
}

.lightbox-img-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid var(--transparentBorder);
    backface-visibility: hidden;
}

.lightbox-img-wrap img,
.lightbox-img-wrap video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.lightbox-dots {
    display: flex;
    align-items: center;
    height: 48px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    column-gap: 6px;
    z-index: 10;
    pointer-events: none;
}

.pager-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--grey1);
    opacity: 0.1;
    transition: opacity 0.15s;
}

.pager-dot[data-active="true"] {
    opacity: 0.5;
}

.lightbox-navigation {
    position: absolute;
    inset: 0;
    display: flex;
    z-index: 1;
}

.lightbox-navigation button {
    width: 50%;
    border: none;
    outline: none;
    background-color: transparent;
}

.lightbox-prev {
    cursor: w-resize;
}
.lightbox-next {
    cursor: e-resize;
}

.lightbox-backdrop {
    position: absolute;
    z-index: 0;
    inset: 0;
    background-color: var(--background);
    cursor: pointer;
}

.lightbox-close {
    position: absolute;
    z-index: 11;
    width: 24px;
    height: 24px;
    border-radius: 16px;
    border: none;
    background-color: var(--wash2);
    top: 12px;
    right: 12px;
    cursor: pointer;
}

.lightbox-close::after,
.lightbox-close::before {
    content: "";
    position: absolute;
    width: 2px;
    height: 11px;
    background-color: var(--grey3);
    left: 50%;
    top: 50%;
    border-radius: 1px;
}

.lightbox-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}
.lightbox-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

/* Mobile lightbox: swipeable carousel */
.lightbox[data-mobile="true"] .lightbox-carousel-scroll {
    overflow-x: scroll;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.lightbox[data-mobile="true"] .lightbox-carousel-scroll::-webkit-scrollbar {
    display: none;
}

.lightbox[data-mobile="true"] .lightbox-carousel {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    position: relative;
}

.lightbox[data-mobile="true"] .lightbox-image {
    flex-shrink: 0;
    scroll-snap-align: center;
    scroll-snap-stop: normal;
    visibility: visible !important;
}

/* Responsive */
@media (max-width: 480px) {
    .about .description,
    .experiences,
    .contacts {
        margin-left: 16px;
    }

    .experience {
        flex-direction: column;
    }

    .attachments-scroll {
        position: absolute;
        left: -40px;
        right: -24px;
    }

    .attachments-scroll .attachments-images > .attachment-media:first-child {
        margin-left: 40px;
    }

    .attachments-scroll .attachments-images > .attachment-media:last-child {
        margin-right: 24px;
    }
}
