@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400&display=swap');

:root {
    color-scheme: light;
    --paper: #fff;
    --ink: #242424;
    --muted: #767676;
    --link: #0000ee;
    --rule: #ededed;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 24px;
    -webkit-font-smoothing: antialiased;
}

.profile {
    width: min(580px, calc(100% - 48px));
    margin: 64px auto 80px;
}

.intro { margin-bottom: 43px; }

.portrait {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 23px;
}

h1, p { margin: 0; }

h1 {
    font-size: inherit;
    font-weight: 400;
    line-height: inherit;
}

.occupation { color: var(--muted); }

.timeline {
    display: grid;
    gap: 11px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.timeline li {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 22px;
    align-items: baseline;
}

.year { font-variant-numeric: tabular-nums; }

a {
    color: var(--link);
    text-decoration: none;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

a:hover { text-decoration: underline; }

a:focus-visible, button:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 4px;
    border-radius: 1px;
}

.contact {
    margin-top: 43px;
    font-size: 12px;
    line-height: 21px;
    color: var(--muted);
}

.short-rule {
    width: 48px;
    height: 1px;
    background: var(--rule);
    margin-bottom: 36px;
}

.small-links {
    display: flex;
    flex-wrap: wrap;
    column-gap: 16px;
    row-gap: 4px;
    margin-top: 11px;
}

.small-links a, .small-links button { color: var(--muted); }

.small-links button {
    appearance: none;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
    text-underline-offset: 3px;
}

.small-links button:hover { text-decoration: underline; }

@media (max-width: 600px) {
    .profile { margin-top: 42px; margin-bottom: 48px; }
    .intro { margin-bottom: 37px; }
    .timeline li { grid-template-columns: 43px minmax(0, 1fr); column-gap: 15px; }
    .timeline { gap: 13px; }
    .contact { margin-top: 37px; }
    .contact p { overflow-wrap: anywhere; }
}

.portrait-stage {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 23px;
}

.portrait-stage .portrait { margin: 0; }

.portrait-sprite {
    display: none;
    position: absolute;
    inset: 0;
    background-image: url('assets/alberto-current-sprites.png');
    background-size: 400% 400%;
    background-position: 33.333333% 33.333333%;
    background-repeat: no-repeat;
    transform-origin: 50% 85%;
    transition: transform 140ms ease-out;
}

.portrait-stage.is-following .portrait { visibility: hidden; }
.portrait-stage.is-following .portrait-sprite { display: block; }

.project-preview {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    width: min(320px, calc(100vw - 32px));
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 48px rgb(0 0 0 / 9%);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: scale(.97);
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms;
}

.project-preview.is-visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.project-preview img {
    width: 144px;
    height: 144px;
    object-fit: contain;
}

.project-preview[data-style="app"] img {
    width: 128px;
    height: 128px;
    border-radius: 29px;
    box-shadow: 0 6px 20px rgb(0 0 0 / 10%);
}

.project-preview[data-style="logo"] img { border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
    .portrait-sprite, .project-preview { transition: none; }
}

button.portrait-stage {
    appearance: none;
    display: block;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

.portrait-expression {
    display: none;
    position: absolute;
    inset: 0;
    background: url('assets/alberto-current-sprites.png') no-repeat;
    background-size: 400% 400%;
}

.portrait-stage.is-reacting .portrait { visibility: hidden; }
.portrait-stage.is-reacting .portrait-expression { display: block; }

.trace-preview { display: none; }

.project-preview[data-style="trace"] { background: #faf9f6; }
.project-preview[data-style="trace"] .preview-logo { display: none; }
.project-preview[data-style="trace"] .trace-preview { display: block; }

.trace-pair {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.trace-photo {
    width: 116px;
    margin: 0;
    padding: 7px 7px 5px;
    background: #fff;
    box-shadow: 0 2px 12px rgb(0 0 0 / 8%);
    transform: rotate(-7deg) translateY(-3px);
}

.trace-photo + .trace-photo { transform: rotate(6deg) translateY(4px); }

.project-preview .trace-photo img {
    display: block;
    width: 102px;
    height: 114px;
    object-fit: cover;
}

.trace-photo figcaption {
    padding-top: 3px;
    color: #a09a90;
    font-size: 9px;
    line-height: 18px;
    text-align: center;
}

.trace-preview p {
    margin-top: 22px;
    color: #847d73;
    font-size: 11px;
    line-height: 16px;
    text-align: center;
}

.project-preview.is-visible[data-style="trace"] .trace-photo img {
    animation: trace-develop 1000ms ease-out both;
}

@keyframes trace-develop {
    0%, 15% { filter: blur(12px) grayscale(1); opacity: .3; }
    100% { filter: blur(0) grayscale(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .project-preview.is-visible[data-style="trace"] .trace-photo img { animation: none; }
}

.project-preview[data-style="photo"] .preview-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* Keep neighboring sprite cells outside the displayed head. */
.portrait-sprite, .portrait-expression { clip-path: inset(0 4px); }

.project-preview[data-style="zerion"] {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.project-preview[data-style="zerion"] .preview-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
