@font-face {
    font-family: "SF Pro Text";
    src: url("../fonts/SF Pro/SF-Pro-Text-Regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "SF Pro Text";
    src: url("../fonts/SF Pro/SF-Pro-Text-Medium.otf") format("opentype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "SF Pro Text";
    src: url("../fonts/SF Pro/SF-Pro-Text-Semibold.otf") format("opentype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "SF Pro Text";
    src: url("../fonts/SF Pro/SF-Pro-Text-Bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "SF Pro Display";
    src: url("../fonts/SF Pro/SF-Pro-Display-Bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "SF Pro Display";
    src: url("../fonts/SF Pro/SF-Pro-Display-Heavy.otf") format("opentype");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: dark;
    --bg: #111111;
    --ink: #e8e8e8;
    --muted: #8f8f8f;
    --line: #2a2a2a;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font-family:
        "SF Pro Text",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: var(--bg);
}

body::before {
    position: fixed;
    inset: -3vmax;
    z-index: -2;
    content: "";
    background-image: url("../images/background.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 0.35;
    filter: brightness(0.45) contrast(0.9);
    transform: scale(1.03) translate3d(-6px, -4px, 0);
    animation: bg-drift 32s ease-in-out infinite alternate;
    will-change: transform;
}

body::after {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    background: rgba(17, 17, 17, 0.72);
}

@media (min-aspect-ratio: 16 / 9) {
    body::before {
        background-size: 100vw auto;
    }
}

@media (max-aspect-ratio: 16 / 9) {
    body::before {
        background-size: auto 100vh;
    }
}

@keyframes bg-drift {
    to {
        transform: scale(1.06) translate3d(6px, 4px, 0);
    }
}

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

.page {
    display: flex;
    width: min(720px, calc(100% - 32px));
    min-height: 100vh;
    flex-direction: column;
    margin: 0 auto;
    padding: 56px 0;
    transform: none;
    filter: blur(0);
    opacity: 1;
    clip-path: inset(0 -24px 0 -24px);
    transition:
        clip-path 850ms cubic-bezier(0.22, 1, 0.36, 1),
        filter 850ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 650ms ease,
        transform 850ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.is-loading .page {
    transform: translateY(8px);
    filter: blur(10px);
    opacity: 0;
    clip-path: inset(0 -24px 100% -24px);
}

.intro {
    margin-top: auto;
    margin-bottom: 56px;
}

.kicker {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.95rem;
}

.kicker span {
    color: #6759c9;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    max-width: 100%;
    margin-bottom: 18px;
    font-family:
        "SF Pro Display",
        "SF Pro Text",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    font-size: clamp(2.8rem, 8vw, 5rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.035em;
}

.summary {
    max-width: 54ch;
    margin-bottom: 24px;
    color: var(--muted);
    font-size: 1.03rem;
    line-height: 1.65;
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.project,
.note,
.footer {
    border-top: 1px solid var(--line);
}

.links a {
    color: var(--muted);
    transition:
        color 150ms ease,
        transform 150ms ease;
}

.links a:hover {
    color: var(--ink);
    transform: translateY(-1px);
}

.projects {
    margin-bottom: 44px;
}

h2 {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: lowercase;
}

.project {
    display: grid;
    grid-template-columns: 150px 1fr auto;
    gap: 18px;
    padding: 18px 0;
}

.project[hidden] {
    display: none;
}

.project:hover .project-name {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.project-name {
    font-weight: 700;
    letter-spacing: -0.01em;
}

.project-desc {
    color: var(--muted);
    line-height: 1.55;
}

.project::after {
    content: "↗";
    align-self: start;
    color: var(--muted);
    opacity: 0;
    transition: opacity 150ms ease;
}

.project:hover::after {
    opacity: 1;
}

.note {
    display: grid;
    gap: 6px;
    padding: 18px 0;
    color: var(--muted);
}

.note p {
    margin: 0;
    line-height: 1.7;
}

.time {
    color: var(--ink);
}

.time-place {
    color: var(--muted);
}

.message {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(17, 17, 17, 0.68);
    animation: message-fade-in 160ms ease-out;
}

.message[hidden],
.message-step[hidden],
.identity-step[hidden] {
    display: none;
}

.message-window {
    width: min(520px, 100%);
    border: 1px solid var(--line);
    padding: 22px;
    background: rgba(17, 17, 17, 0.9);
    animation: message-window-in 180ms ease-out;
}

.message.is-closing {
    animation: message-fade-out 160ms ease-in forwards;
}

.message.is-closing .message-window {
    animation: message-window-out 160ms ease-in forwards;
}

.message-close {
    margin-bottom: 22px;
}

.message-form,
.message-step {
    display: grid;
    gap: 14px;
}

.identity-step {
    display: grid;
    gap: 10px;
    padding-top: 2px;
}

.message-form label,
.identity-step p {
    display: grid;
    gap: 6px;
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.message-form input,
.message-form textarea {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 10px 0;
    color: var(--ink);
    font: inherit;
    background: transparent;
    outline: none;
    resize: none;
}

.message-form input:focus,
.message-form textarea:focus {
    border-color: var(--muted);
}

.message-form button,
.message-toggle,
.message-close {
    width: max-content;
    border: 0;
    padding: 0;
    color: var(--muted);
    font: inherit;
    background: transparent;
    cursor: pointer;
    transition:
        color 150ms ease,
        transform 150ms ease;
}

.message-form button:hover,
.message-toggle:hover,
.message-close:hover {
    color: var(--ink);
    transform: translateY(-1px);
}

.message-toggle.is-sent {
    color: #6759c9;
    animation: message-sent 420ms ease-out;
}

.identity-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 2px;
}

.message-form button:disabled {
    cursor: wait;
    opacity: 0.6;
}

.form-status {
    min-height: 1.4em;
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: auto;
    padding-top: 18px;
    color: var(--muted);
    font-size: 0.9rem;
}

@keyframes message-sent {
    45% {
        transform: translateY(-2px);
    }
}

@keyframes message-fade-in {
    from {
        opacity: 0;
    }
}

@keyframes message-fade-out {
    to {
        opacity: 0;
    }
}

@keyframes message-window-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.99);
    }
}

@keyframes message-window-out {
    to {
        opacity: 0;
        transform: translateY(8px) scale(0.99);
    }
}

@media (prefers-reduced-motion: reduce) {
    body::before,
    .message,
    .message-window {
        animation: none;
        transform: none;
    }

    .page,
    .links a,
    .project::after,
    .message-form button,
    .message-toggle,
    .message-close {
        transition: none;
    }

    .message-toggle.is-sent {
        animation: none;
    }

    body.is-loading .page {
        transform: none;
        filter: none;
        opacity: 1;
        clip-path: none;
    }
}

@media (max-width: 580px) {
    .page {
        padding-top: 54px;
    }

    h1 {
        font-size: clamp(2.6rem, 14vw, 4rem);
    }

    .project {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .project::after {
        display: none;
    }

    .footer {
        flex-direction: column;
    }
}
