:root {
    color-scheme: dark;

    --bg: #111;
    --bg-soft: #17171a;
    --surface: #1a1a1f;

    --text: #eee;
    --secondary: #aaa9ad;
    --muted: #8d8d94;
    --border: #2d2d34;

    --purple: #c778ff;
    --blue: #7aa2f7;
    --pink: #ff67c8;
    --cyan: #89dceb;
    --green: #a6e3a1;

    --link-hover: #fff;

    --ease: 180ms ease;
    --ease-slow: 320ms ease;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 280px;
    scroll-behavior: smooth;
}

html,
body {
    min-height: 100%;
}

body {
    position: relative;
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;

    background:
        radial-gradient(circle at 18% 0%, #c778ff0d, transparent 28rem),
        radial-gradient(circle at 82% 22%, #89dceb08, transparent 30rem),
        var(--bg);

    color: var(--secondary);

    font-family:
        "Segoe UI Variable Text",
        Inter,
        ui-sans-serif,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 0.90625rem;
    font-weight: 600;
    line-height: 1.75;
    letter-spacing: -0.01em;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content:
        "$ whoami                                                  \A"
        "m5rcel                                                    \A"
        "                                                          \A"
        "01001000 01010100 01001101 01001100                       \A"
        "                                                          \A"
        ":: boot ok       :: localhost       :: web                \A"
        "                                                          \A"
        "./start --quiet                                           \A"
        "cargo build --release                                     \A"
        "Finished release [optimized]                              \A"
        "                                                          \A"
        "127.0.0.1      0xDEADBEEF      /dev/null                  \A"
        "                                                          \A"
        "[ linux ] [ code ] [ web ] [ weird ideas ]               \A"
        "                                                          \A"
        "01101100 01101001 01101110 01110101 01111000             \A"
        "                                                          \A"
        "service: active                                           \A"
        "listening on :443                                         \A"
        "ping 0.042ms                                              \A"
        "                                                          \A"
        "$ echo hello internet                                     \A"
        "hello internet                                            \A"
        "                                                          \A"
        "*     +      .      *      +      .      *               \A"
        "                                                          \A"
        "memory::0x7ff        kernel::ready                        \A"
        "                                                          \A"
        "01010101 00101111 01100100 01100101 01110110             \A";

    position: fixed;
    z-index: 0;

    top: -8vh;
    left: -6vw;

    width: 112vw;
    height: 116vh;

    overflow: hidden;
    pointer-events: none;
    user-select: none;
    white-space: pre;

    color: #decde91a;

    font-family:
        "JetBrains Mono",
        "Cascadia Code",
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 11px;
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.05em;

    opacity: 0.4;
    filter: blur(1.3px);

    transform: translate3d(0, 0, 0);
    will-change: transform;

    animation: ascii-float 44s ease-in-out infinite alternate;
}

body::after {
    content: "";

    position: fixed;
    z-index: 0;
    inset: 0;

    pointer-events: none;

    background:
        radial-gradient(
            ellipse at center,
            transparent 35%,
            #1111112e 72%,
            #111111a8 100%
        );
}

@keyframes ascii-float {
    from {
        transform: translate3d(-1%, -0.7%, 0);
    }

    to {
        transform: translate3d(1%, 0.8%, 0);
    }
}

main {
    position: relative;
    z-index: 1;

    width: min(570px, calc(100% - 40px));
    margin-inline: auto;

    padding-top: clamp(90px, 16vh, 180px);
    padding-bottom: 100px;
}

::selection {
    color: #fff;
    background: #5e3f73;
}

a {
    color: var(--text);
    text-decoration: none;

    transition:
        color var(--ease),
        background-color var(--ease),
        border-color var(--ease),
        transform var(--ease);
}

a:hover {
    color: var(--link-hover);
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--purple);
    outline-offset: 4px;
    border-radius: 4px;
}

button {
    font: inherit;
}

[hidden] {
    display: none !important;
}

.icon-definitions {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;

    vertical-align: -2px;

    transition:
        color var(--ease),
        transform var(--ease);
}

p {
    margin: 0 0 16px;
}

strong {
    font-weight: 700;
}

.purple {
    color: var(--purple);
    --holo-top: #f5d9ff;
    --holo-mid: #df8dff;
    --holo-bottom: #b95cff;
    --holo-glow: #c778ff2b;
}

.blue {
    color: var(--blue);
    --holo-top: #dcecff;
    --holo-mid: #96c5ff;
    --holo-bottom: #6f8cff;
    --holo-glow: #7aa2f729;
}

.pink {
    color: var(--pink);
    --holo-top: #ffd6f3;
    --holo-mid: #ff91dc;
    --holo-bottom: #ee56bd;
    --holo-glow: #ff67c82b;
}

.cyan {
    color: var(--cyan);
    --holo-top: #dcfbff;
    --holo-mid: #91e4ef;
    --holo-bottom: #55bdd1;
    --holo-glow: #89dceb24;
}

.green {
    color: var(--green);
    --holo-top: #e2ffe3;
    --holo-mid: #9cf0a8;
    --holo-bottom: #4fc46f;
    --holo-glow: #a6e3a126;
}

.holographic {
    display: inline-block;
    color: var(--holo-mid);

    /* links on or inside a holographic element highlight in its color */
    --link-hover: var(--holo-mid);
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
    .holographic {
        background-image:
            linear-gradient(
                to top,
                var(--holo-bottom) 0%,
                var(--holo-mid) 12.5%,
                var(--holo-top) 25%,
                var(--holo-mid) 37.5%,
                var(--holo-bottom) 50%,
                var(--holo-mid) 62.5%,
                var(--holo-top) 75%,
                var(--holo-mid) 87.5%,
                var(--holo-bottom) 100%
            );

        background-size: 100% 200%;
        background-position: 0 100%;
        background-repeat: repeat-y;

        background-clip: text;
        -webkit-background-clip: text;

        color: transparent;
        -webkit-text-fill-color: transparent;

        text-shadow: 0 0 7px var(--holo-glow);

        animation: holo 2.65s linear infinite;
    }

    .holographic:nth-of-type(2n) {
        animation-delay: -0.55s;
    }

    .holographic:nth-of-type(3n) {
        animation-delay: -1.1s;
    }

    .holographic:nth-of-type(4n) {
        animation-delay: -1.65s;
    }
}

@keyframes holo {
    from {
        background-position: 0 100%;
    }

    to {
        background-position: 0 0;
    }
}

.poland {
    display: inline-block;
    color: #fff;
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
    .poland {
        background:
            linear-gradient(
                to bottom,
                #fff 0%,
                #fff 32%,
                #f8d5d8 49%,
                #ed6c78 65%,
                #dc143c 100%
            );

        background-clip: text;
        -webkit-background-clip: text;

        color: transparent;
        -webkit-text-fill-color: transparent;

        text-shadow: 0 0 6px #dc143c1c;
    }
}

main > section,
main > nav,
main > footer {
    opacity: 0;
    transform: translateY(7px);

    animation: fade-up 460ms ease forwards;
}

.intro {
    animation-delay: 20ms;
}

.social-links {
    animation-delay: 80ms;
}

.projects {
    animation-delay: 140ms;
}

.music {
    animation-delay: 200ms;
}

.elsewhere {
    animation-delay: 260ms;
}

main > footer {
    animation-delay: 320ms;
}

@keyframes fade-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.intro a {
    text-decoration: underline;
    text-decoration-color: #4b4950;
    text-underline-offset: 3px;

    transition:
        color var(--ease),
        text-decoration-color var(--ease);
}

.intro a:hover {
    color: var(--link-hover);
    text-decoration-color: var(--link-hover);
}

.intro a .icon {
    color: #c2c1c6;
}

.intro a:hover .icon {
    color: var(--link-hover);
    transform: translateY(-1px);
}

.social-links {
    display: flex;
    flex-wrap: wrap;

    gap: 6px 10px;

    margin-top: 22px;
    margin-left: -6px;
}

.social-links a {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    padding: 4px 8px;

    border: 1px solid transparent;
    border-radius: 7px;

    color: var(--secondary);
    font-size: 0.8125rem;
}

.social-links a:hover {
    color: var(--link-hover);

    background: #ffffff08;
    border-color: #ffffff0f;

    transform: translateY(-1px);
}

.social-links a.holographic:hover {
    background: color-mix(in srgb, var(--link-hover) 9%, transparent);
    border-color: color-mix(in srgb, var(--link-hover) 24%, transparent);
}

.social-links .icon {
    color: var(--muted);
}

.social-links a:hover .icon {
    color: var(--link-hover);

    transform:
        translateY(-1px)
        scale(1.05);
}

.projects,
.music {
    margin-top: 40px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 12px;

    min-height: 28px;
    margin-bottom: 14px;
}

h2 {
    margin: 0;

    color: var(--text);

    font-size: 0.875rem;
    font-weight: 600;
}

.repo-symbol,
.music-note {
    display: inline-block;

    margin-right: 5px;

    color: var(--muted);
    font-size: 0.75rem;

    transition:
        color var(--ease),
        transform var(--ease);
}

.section-heading:hover .repo-symbol,
.section-heading:hover .music-note {
    color: var(--purple);
    transform: translateY(-1px);
}

.quiet-link {
    color: var(--muted);
    font-size: 0.75rem;
}

.quiet-link:hover {
    color: var(--link-hover);
}

.external {
    display: inline-block;
    font-size: 0.75rem;
    transition: transform var(--ease);
}

a:hover .external {
    transform: translate(1px, -1px);
}

.repo-list {
    display: grid;

    gap: 8px;

    margin: 0 -8px;
    padding: 0;

    list-style: none;
}

.repo-row {
    padding: 6px 8px;

    border: 1px solid transparent;
    border-radius: 7px;

    transition:
        background-color var(--ease),
        border-color var(--ease),
        transform var(--ease);
}

.repo-row:hover,
.repo-row:focus-within {
    background: #ffffff06;
    border-color: var(--border);

    transform: translateX(2px);
}

.repo-summary {
    font-size: 0.8125rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.repo-name {
    margin-right: 9px;

    color: var(--text);

    font-size: 0.875rem;
    font-weight: 600;
}

.repo-description {
    color: var(--secondary);
}

.repo-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 4px 13px;

    margin-top: 3px;

    color: var(--muted);

    font-size: 0.75rem;
    line-height: 1.6;
}

.repo-language {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.language-dot {
    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: var(--language-color, var(--muted));
}

.github-loading,
.github-message,
.github-error,
.cache-note {
    color: var(--muted);
    font-size: 0.8125rem;
}

.github-error a,
.github-message a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.github-message,
.github-error {
    margin-bottom: 0;
}

.cache-note {
    margin: 12px 0 0;
    font-size: 0.75rem;
}

html:not(.js) .github-loading {
    display: none;
}

#music-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    margin: -2px -8px -2px 0;
    padding: 8px;

    border: 1px solid transparent;
    border-radius: 999px;

    background: transparent;
    color: var(--muted);

    cursor: pointer;

    transition:
        color var(--ease),
        background-color var(--ease),
        border-color var(--ease),
        transform var(--ease);
}

#music-toggle:hover {
    color: var(--text);

    background: #ffffff08;
    border-color: #ffffff0f;

    transform: scale(1.04);
}

#music-toggle:active {
    transform: scale(0.97);
}

#music-toggle .icon {
    width: 16px;
    height: 16px;
}

.music-grid {
    display: grid;

    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;

    transition:
        opacity var(--ease),
        transform var(--ease);
}

.music-grid.is-hidden {
    opacity: 0.14;

    transform: scale(0.985);

    pointer-events: none;
    user-select: none;
}

.music-tile {
    display: block;

    min-width: 0;
    overflow: hidden;

    border: 1px solid #ffffff12;
    border-radius: 8px;

    background: var(--bg-soft);

    transition:
        border-color var(--ease),
        background-color var(--ease),
        transform var(--ease-slow);
}

.music-tile:hover,
.music-tile:focus-visible {
    border-color: #ffffff29;
    background: var(--surface);

    transform: translateY(-2px);
}

.music-tile:focus-visible {
    outline-offset: 4px;
}

.artwork {
    position: relative;

    display: block;

    aspect-ratio: 1;
    overflow: hidden;

    background: #141414;
}

.artwork::after {
    content: "";

    position: absolute;
    inset: 0;

    pointer-events: none;

    background:
        linear-gradient(
            to bottom,
            transparent 50%,
            #0000002e
        );
}

.artwork img {
    position: absolute;
    inset: 0;

    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transform: scale(1.001);

    transition: transform var(--ease-slow);
}

.music-tile:hover .artwork img {
    transform: scale(1.04);
}

.artwork-number {
    position: absolute;
    z-index: 2;

    bottom: 8px;
    left: 10px;

    color: #ffffff99;

    font: 0.625rem ui-monospace, monospace;
    letter-spacing: 0.15em;
}

.artwork-sepia {
    background:
        radial-gradient(
            ellipse at 65% 35%,
            #d8b388 0,
            #88664b 25%,
            transparent 55%
        ),
        repeating-linear-gradient(
            0deg,
            #0000 0 3px,
            #0002 4px
        ),
        #362d25;
}

.artwork-mono {
    background:
        linear-gradient(
            130deg,
            transparent 35%,
            #bcbab5 35% 36%,
            transparent 36% 58%,
            #bcbab5 58% 60%,
            transparent 60%
        ),
        radial-gradient(
            ellipse at 80% 90%,
            #62605c,
            #161616 60%
        );
}

.artwork-blue {
    background:
        radial-gradient(
            ellipse at 20% 80%,
            #5a958e 0,
            transparent 60%
        ),
        radial-gradient(
            ellipse at 80% 25%,
            #477386 0,
            transparent 60%
        ),
        #142b36;
}

.artwork-gray {
    background:
        repeating-radial-gradient(
            ellipse at 65% 120%,
            #191919 0 5px,
            #7a7a78 6px,
            #343433 9px,
            #171717 12px
        );
}

.track-info {
    display: block;
    padding: 8px 9px;
}

.track-title,
.track-artist {
    display: block;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-title {
    color: #dedee0;

    font-size: 0.75rem;
    line-height: 1.5;
}

.track-artist {
    color: var(--muted);

    font-size: 0.75rem;
    line-height: 1.7;
}

.platform {
    display: flex;
    align-items: center;

    gap: 5px;

    margin-top: 7px;

    color: var(--secondary);

    font-size: 0.6875rem;
    line-height: 1.5;
}

.platform .icon {
    width: 11px;
    height: 11px;
    flex-basis: 11px;

    color: #b0b0b3;
}

.elsewhere {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 4px 8px;

    margin-top: 36px;
    margin-left: -6px;

    font-size: 0.75rem;
}

.elsewhere > span {
    margin-right: 3px;
    margin-left: 6px;

    color: var(--muted);
}

.elsewhere a {
    display: inline-flex;
    align-items: center;

    gap: 2px;

    padding: 2px 6px;

    border-radius: 5px;

    color: var(--secondary);
}

.elsewhere a:hover {
    color: var(--link-hover);
    background: #ffffff06;

    transform: translateY(-1px);
}

.elsewhere a.holographic:hover {
    background: color-mix(in srgb, var(--link-hover) 9%, transparent);
}

footer {
    margin-top: 32px;

    color: var(--muted);

    font-size: 0.75rem;
}

footer a {
    color: inherit;
}

.heart {
    display: inline-block;
    color: #c28d9f;
    transform-origin: center;

    animation: heartbeat 2.1s ease-in-out infinite;
}

@keyframes heartbeat {
    0%,
    100% {
        transform: scale(1);
        color: #c28d9f;
    }

    8% {
        transform: scale(1.13);
        color: #e08ca9;
    }

    16% {
        transform: scale(1);
    }

    24% {
        transform: scale(1.07);
        color: #d797ab;
    }

    32% {
        transform: scale(1);
        color: #c28d9f;
    }

    40%,
    100% {
        transform: scale(1);
    }
}

.sr-only {
    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;

    clip-path: inset(50%);

    white-space: nowrap;

    border: 0;
}

@media (max-width: 600px) {
    main {
        width: min(570px, calc(100% - 32px));

        padding-top: 72px;
        padding-bottom: 64px;
    }

    body::before {
        font-size: 9px;
        opacity: 0.32;

        animation-duration: 54s;
    }

    .projects,
    .music {
        margin-top: 32px;
    }
}

@media (max-width: 440px) {
    main {
        width: calc(100% - 28px);
        padding-top: 52px;
    }

    body::before {
        opacity: 0.24;
    }

    .music-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .repo-description {
        display: block;
        margin-top: 2px;
    }

    .elsewhere > span {
        flex-basis: 100%;
        margin-bottom: 3px;
    }
}

@media (hover: none) {
    .social-links a:hover,
    .repo-row:hover,
    .music-tile:hover,
    .elsewhere a:hover {
        transform: none;
    }

    .music-tile:hover .artwork img {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    body::before {
        animation: none;
        transform: none;
    }

    main > section,
    main > nav,
    main > footer {
        opacity: 1;
        transform: none;
    }

    .holographic {
        background-position: 0 50%;
    }
}

@media (forced-colors: active) {
    body::before,
    body::after {
        display: none;
    }

    .holographic,
    .poland {
        background: none !important;
        color: CanvasText !important;
        -webkit-text-fill-color: CanvasText !important;
        text-shadow: none !important;
    }

    .social-links a,
    .repo-row,
    .music-tile {
        border-color: CanvasText;
    }
}