@font-face {
    font-family: "Klee One";
    src: url("assets/fonts/klee-one-latin-400.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

:root {
    color-scheme: light;
    --fg: #1a1b19;
    --bg: #efefeb;
    --muted: rgba(26, 27, 25, 0.58);
    --accent: #7b695c;
    --figure-filter: grayscale(1) contrast(0.84) brightness(0.36);
    --figure-opacity: 0.11;
    --figure-wide-opacity: 0.12;
    --figure-mobile-opacity: 0.09;
    --shift-x: 0px;
    --shift-y: 0px;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --fg: #ecece6;
        --bg: #101211;
        --muted: rgba(236, 236, 230, 0.58);
        --accent: #b29a87;
        --figure-filter: grayscale(1) contrast(0.84);
        --figure-opacity: 0.15;
        --figure-wide-opacity: 0.17;
        --figure-mobile-opacity: 0.12;
    }
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100svh;
    margin: 0;
    display: grid;
    grid-template-rows: 1fr auto;
    gap: clamp(1.5rem, 4vh, 2.5rem);
    padding: clamp(1.25rem, 5vw, 3rem);
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--fg);
    background: var(--bg);
    font-family: "Klee One", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
    line-height: 1.7;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.backdrop::before {
    content: "";
    position: absolute;
    right: clamp(-1rem, 2vw, 2rem);
    bottom: clamp(-7rem, -8vh, -3rem);
    width: clamp(20rem, 31vw, 30rem);
    aspect-ratio: 929 / 1525;
    background: url("assets/figure.webp") center bottom / contain no-repeat;
    filter: var(--figure-filter);
    opacity: var(--figure-opacity);
    transform: translate3d(var(--shift-x), var(--shift-y), 0);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 80%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 80%, transparent 100%);
}

.backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E");
    mix-blend-mode: soft-light;
    opacity: 0.18;
}

main {
    position: relative;
    z-index: 1;
    width: min(100%, 48rem);
    margin: auto;
    padding-block: clamp(2rem, 8vh, 5rem);
    text-align: left;
    transform: translateX(clamp(-3rem, calc((52rem - 100vw) * 0.08), 0rem));
}

h1 {
    max-width: none;
    margin: 0;
    font-size: 1.7rem;
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0;
    white-space: nowrap;
}

.contact-row {
    --stack-gap: clamp(1.5rem, 4vh, 2rem);

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--stack-gap);
    width: max-content;
    margin-top: var(--stack-gap);
}

h1 .word {
    display: inline-block;
}

.motion-enabled h1 .word {
    opacity: 0;
    transform: translateY(0.5rem);
    animation: word-in 500ms ease-out forwards;
}

.divider {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.motion-enabled .divider,
.motion-enabled .contact,
.motion-enabled .site-footer {
    opacity: 0;
    animation: fade-in 500ms ease-out forwards;
}

.divider-line {
    width: 3.75rem;
    height: 1px;
    background: currentColor;
    opacity: 0.72;
}

.divider-line.short {
    width: 1.25rem;
}

.divider-dot {
    width: 0.22rem;
    height: 0.22rem;
    border-radius: 50%;
    background: var(--accent);
}

.contact {
    font-size: 1.2rem;
    font-style: normal;
}

a {
    position: relative;
    display: inline-block;
    color: inherit;
    text-decoration: none;
    transition: opacity 200ms ease;
}

a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -0.12rem;
    left: 0;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover,
a:focus-visible {
    opacity: 0.72;
}

a:hover::after,
a:focus-visible::after {
    transform: scaleX(1);
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 0.45rem;
}

.site-footer {
    position: relative;
    z-index: 1;
    min-height: 1.5rem;
    justify-self: start;
    color: var(--muted);
    font-size: 0.92rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

.cursor {
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    .backdrop::before {
        will-change: transform;
    }

    .custom-cursor body {
        cursor: none;
    }

    .custom-cursor .cursor {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 9999;
        display: block;
        width: 0.6rem;
        height: 0.6rem;
        border: 1px solid var(--fg);
        border-radius: 50%;
        opacity: 0;
        pointer-events: none;
        transform: translate3d(-2rem, -2rem, 0);
        transition: opacity 160ms ease;
        will-change: transform;
    }

    .custom-cursor .cursor.is-visible {
        opacity: 0.62;
    }
}

@keyframes word-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(0.38rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 90rem) {
    h1 {
        font-size: 1.82rem;
    }

    .backdrop::before {
        right: 4vw;
        width: 34rem;
        opacity: var(--figure-wide-opacity);
    }
}

@media (max-width: 48rem) {
    h1 {
        white-space: normal;
        text-wrap: pretty;
    }
}

@media (max-width: 32rem) {
    .backdrop::before {
        right: -0.5rem;
        bottom: -4.5rem;
        width: min(74vw, 18rem);
        opacity: var(--figure-mobile-opacity);
    }

    main {
        margin-inline: auto;
        padding-block: 2rem;
    }

    h1 {
        max-width: 18rem;
        font-size: 1.3rem;
    }

    .contact {
        font-size: 1.12rem;
    }

}

@media (max-height: 22rem) {
    body {
        display: block;
    }

    main {
        margin-inline: auto;
        padding-block: 1rem;
    }

    .site-footer {
        margin-top: 1rem;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .backdrop::before {
        transform: none;
    }
}
