@font-face {
	font-family: "Lexend";
	font-display: swap;
	src: url("/fonts/Lexend.woff2") format("woff2");
}

@font-face {
    font-family: "Outfit";
    font-display: swap;
    src: url("/fonts/Outfit.woff") format("woff");
}

:root {
    --font-family-body: "Outfit";
    --font-family-title: "Lexend";

    --font-size-h1: 4rem;
    --font-size-h2: 3.5rem;
    --font-size-h3: 3rem;
    --font-size-h4: 2.75rem;
    --font-size-body: 1.5rem;

    /* Catppuccin Mocha */
    --rosewater: #f5e0dc;
    --flamingo: #f2cdcd;
    --pink: #f5c2e7;
    --mauve: #cba6f7;
    --red: #f38ba8;
    --maroon: #eba0ac;
    --peach: #fab387;
    --yellow: #f9e2af;
    --green: #a6e3a1;
    --teal: #94e2d5;
    --sky: #89dceb;
    --sapphire: #74c7ec;
    --blue: #89b4fa;
    --lavender: #b4befe;
    --text: #cdd6f4;
    --subtext1: #bac2de;
    --subtext0: #a6adc8;
    --overlay2: #9399b2;
    --overlay1: #7f849c;
    --overlay0: #6c7086;
    --surface2: #585b70;
    --surface1: #45475a;
    --surface0: #313244;
    --base: #1e1e2e;
    --mantle: #181825;
    --crust: #11111b;
}

html {
    background-color: var(--base);
}

body {
    font-family: var(--font-family-body);
    font-size: var(--font-size-body);
    color: var(--text);

    display: flex;
    flex-direction: column;

    max-width: 50%;
    margin-left: auto;
    margin-right: auto;

    margin-top: 4rem;
}

main {
    flex: 1;
}

footer {
    margin-top: auto;
    padding: 1.5rem;

    text-align: center;
    font-size: 0.75rem;
    color: var(--surface2)
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-family-title);
}

h1 {
    font-size: var(--font-size-h1);
}

h2 {
    font-size: var(--font-size-h2);
}

h3 {
    font-size: var(--font-size-h3);
}

/* unique elements */

.title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title-bar h1 {
    margin: 0;
}

.title-bar nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.title-bar a {
    text-decoration: none;
}

.icon {
    display: block;
    width: 32px;
    height: 32px;

    background-color: currentColor;

    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

.icon.interests {
    mask-image: url("/icons/icons8-idea.svg");
}

.icon.posts {
    mask-image: url("/icons/icons8-scroll.svg");
}

.icon.bookmarks {
    mask-image: url("/icons/icons8-bookmark.svg");
}

.icon.connect {
    mask-image: url("/icons/icons8-connect.svg");
}

.icon.pubkey {
    mask-image: url("/icons/icons8-key.svg");
}

.icon.music {
    mask-image: url("/icons/icons8-music.svg");
}

.title-bar nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: var(--mauve);
}

.title-bar nav .icon {
    transform: translateY(0) rotate(0deg);
    transition: transform 250ms ease-out;
}

/* Give each icon a different rotation */
.title-bar nav a:nth-child(5n+1) { --tilt: -12deg; }
.title-bar nav a:nth-child(5n+2) { --tilt:   8deg; }
.title-bar nav a:nth-child(5n+3) { --tilt: -15deg; }
.title-bar nav a:nth-child(5n+4) { --tilt:  13deg; }
.title-bar nav a:nth-child(5n)   { --tilt:  -5deg; }

/* Elastic hover animation */
.title-bar nav a:hover .icon,
.title-bar nav a:focus-visible .icon {
    transform: translateY(-8px) rotate(var(--tilt, 0deg));

    transition-duration: 400ms;
    transition-timing-function: linear(
        0,
        0.5 15%,
        1.75 35%,
        0.85 65%,
        1.08 75%,
        1
    );
}

@media (prefers-reduced-motion: reduce) {
    .title-bar nav .icon {
        transition: none;
    }
}

/* modifiers */

.rosewater {
    color: var(--rosewater);
}

.flamingo {
    color: var(--flamingo);
}

.pink {
    color: var(--pink);
}

.mauve {
    color: var(--mauve);
}

.red {
    color: var(--red);
}

.maroon {
    color: var(--maroon);
}

.peach {
    color: var(--peach);
}

.yellow {
    color: var(--yellow);
}

.green {
    color: var(--green);
}

.teal {
    color: var(--teal);
}

.sky {
    color: var(--sky);
}

.sapphire {
    color: var(--sapphire);
}

.blue {
    color: var(--blue);
}

.lavender {
    color: var(--lavender);
}

.text {
    color: var(--text);
}

.subtext1 {
    color: var(--subtext1);
}

.subtext0 {
    color: var(--subtext0);
}

.overlay2 {
    color: var(--overlay2);
}

.overlay1 {
    color: var(--overlay1);
}

.overlay0 {
    color: var(--overlay0);
}

.surface2 {
    color: var(--surface2);
}

.surface1 {
    color: var(--surface1);
}

.surface0 {
    color: var(--surface0);
}

.base {
    color: var(--base);
}

.mantle {
    color: var(--mantle);
}

.crust {
    color: var(--crust);
}

.eb {
    font-weight: 600;
}

/* assembly animation */
@keyframes assemble-in {
    from {
        opacity: 0;
        translate: 0 60px;
    }

    to {
        opacity: 1;
        translate: 0 0;
    }
}

.assemble > * {
    --index: 0;

    animation: assemble-in 650ms cubic-bezier(.16, 1, .3, 1) both;
    animation-delay: calc(
        var(--start, 0ms) + var(--index) * 180ms
    );
}

/* Stagger immediate children */
.assemble > :nth-child(2) { --index: 1; }
.assemble > :nth-child(3) { --index: 2; }
.assemble > :nth-child(4) { --index: 3; }
.assemble > :nth-child(5) { --index: 4; }
.assemble > :nth-child(6) { --index: 5; }
.assemble > :nth-child(7) { --index: 6; }
.assemble > :nth-child(8) { --index: 7; }

@media (prefers-reduced-motion: reduce) {
    .assemble > * {
        animation: none;
    }
}
