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

/* ─── Variables ─────────────────────────────────────────────────────────── */

:root {
    --font-primary: 'Test Tiempos Text', 'Georgia', serif;
    --font-mono: 'Inconsolata', Courier, monospace;

    --color-bg: #000000;
    --color-bg-overlay: rgba(0, 0, 0, 0.75);
    --color-bg-surface: rgb(32, 32, 32);
    --color-bg-card-hover: rgba(255, 255, 255, 0.067);
    --color-bg-skill: rgba(255, 255, 255, 0.05);
    --color-bg-skill-hover: rgba(255, 255, 255, 0.08);

    --color-text-primary: #ffffff;
    --color-text-muted: rgba(255, 255, 255, 0.698);
    --color-text-faint: rgba(255, 255, 255, 0.526);
    --color-text-dim: rgba(255, 255, 255, 0.4);
    --color-text-nav: rgba(255, 255, 255, 0.65);

    --color-border-primary: rgba(255, 255, 255, 1);
    --color-border-subtle: rgba(255, 255, 255, 0.1);
    --color-border-medium: rgba(255, 255, 255, 0.3);
    --color-border-divider: rgb(116, 116, 116);

    --color-selection-bg: #3d3d3d94;
    --color-gradient-accent: #28102b;

    --radius-sm: 5px;
    --radius-md: 8px;
    --radius-lg: 50px;

    --transition-fast: 0.3s ease;
    --transition-mid: 0.5s ease;

    --margin-page: 20%;
    --margin-page-mobile: 0;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */

* {
    padding: 0;
    margin: 0;
}

/* ─── Scrollbar ──────────────────────────────────────────────────────────── */

::-webkit-scrollbar {
    width: 10px;
    background: var(--color-bg);
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* ─── Selection ──────────────────────────────────────────────────────────── */

::selection {
    background-color: var(--color-selection-bg);
    color: #ebebeb;
}

/* ─── Animations ─────────────────────────────────────────────────────────── */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.05); }
}

@keyframes gradientBG {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ─── Base ───────────────────────────────────────────────────────────────── */

body {
    background: linear-gradient(45deg, var(--color-bg), var(--color-bg), var(--color-gradient-accent));
    background-size: 400% 400%;
    background-repeat: no-repeat;
    background-position: center;
    animation: gradientBG 15s ease infinite, fadeIn 1s ease-out;
    min-height: 100vh;
    font-family: var(--font-primary);
}

.all {
    background-color: var(--color-bg-overlay);
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */

.container {
    width: 100%;
    height: 100%;
    position: relative;
    display: block;
    margin-bottom: 5%;
    animation: fadeIn 1.2s ease-out;
}

.page {
    display: none;
    animation: fadeIn var(--transition-fast);
}

.page.active {
    display: block;
}

/* ─── Navbar ─────────────────────────────────────────────────────────────── */

.navbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: slideIn 1s ease-out;
}

.logo {
    filter: invert(1);
    width: 18rem;
    padding: 1rem 1rem 0 1rem;
    transition: all var(--transition-mid);
}

.logo:hover {
    transform: scale(0.95) rotate(2deg);
    filter: invert(0.8);
}

.links {
    max-width: 30%;
    min-width: 20%;
    background-color: var(--color-bg-surface);
    margin: auto;
    display: flex;
    align-items: center;
    padding: 2%;
    border-radius: var(--radius-lg);
    transition: transform var(--transition-fast);
}

.links:hover {
    transform: translateY(-2px);
}

/* ─── Website path / breadcrumb ──────────────────────────────────────────── */

.websitePath {
    display: flex;
    flex-direction: row;
    max-height: 50px;
    margin-top: 5%;
    margin-left: var(--margin-page);
    margin-right: var(--margin-page);
    border-top: 1px solid var(--color-border-primary);
    animation: slideIn 0.8s ease-out;
}

ul.breadcrumb {
    padding: 10px 16px 0 16px;
    list-style: none;
    margin-right: var(--margin-page);
    animation: fadeIn 1s ease-out;
}

ul.breadcrumb li {
    display: inline;
    font-size: 14px;
    font-family: var(--font-mono);
    font-weight: 600;
}

ul.breadcrumb li + li::before {
    padding: 4px;
    color: var(--color-border-divider);
    content: "/\00a0";
}

ul.breadcrumb li button {
    color: var(--color-text-muted);
    background-color: transparent;
    border: 0;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-mid);
}

ul.breadcrumb li button:hover {
    color: var(--color-text-primary);
    transform: translateY(-1px);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* ─── Nav pages ──────────────────────────────────────────────────────────── */

.pages {
    display: flex;
    flex-direction: row;
    text-decoration: none;
}

.pages > li {
    list-style-type: none;
    margin: 10px;
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

.pages > li:nth-child(1) { animation-delay: 0.2s; }
.pages > li:nth-child(2) { animation-delay: 0.4s; }
.pages > li:nth-child(3) { animation-delay: 0.6s; }
.pages > li:nth-child(4) { animation-delay: 0.8s; }
.pages > li:nth-child(5) { animation-delay: 1.0s; }

.pages > li > button {
    padding: 0;
    background-color: transparent;
    color: var(--color-text-primary);
    border: 0;
    cursor: pointer;
    font-size: 16px;
    font-family: var(--font-mono);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.pages > li > button:hover {
    color: rgba(255, 255, 255, 0.526);
    transform: translateY(-2px);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* ─── Home section ───────────────────────────────────────────────────────── */

.homeIndex {
    margin-left: var(--margin-page);
    margin-right: var(--margin-page);
    padding: 10px 16px;
    font-family: var(--font-primary);
    font-weight: 500;
    animation: fadeIn 1.5s ease-out;
}

.homeName {
    color: var(--color-text-primary);
    font-size: 1.7rem;
    font-weight: 500;
    animation: fadeIn 1s ease-out;
}

#homeDesc {
    margin-top: 3%;
    animation: fadeIn 1.2s ease-out;
}

.description {
    margin-bottom: 20px;
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
}

.description:hover {
    color: var(--color-text-primary);
    transform: translateX(5px);
}

.description a {
    color: rgba(255, 255, 255, 0.827);
    position: relative;
    transition: all var(--transition-fast);
}

.description a:hover {
    color: var(--color-text-primary);
}

.description a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--color-text-primary);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform var(--transition-fast);
}

.description a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* ─── Mute button ────────────────────────────────────────────────────────── */

.mute-btn {
    background: none;
    border: none;
    color: var(--color-text-nav);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all var(--transition-fast);
}

.mute-btn:hover {
    color: rgba(255, 255, 255, 0.85);
    transform: scale(1.1);
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */

.cards {
    display: flex;
    min-height: 50vh;
    width: 100%;
    flex-direction: column;
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    display: flex;
    color: #000;
    position: relative;
    width: 90%;
    flex-direction: row;
    border: 1px solid var(--color-border-primary);
    padding: 1.5rem;
    margin: 0 auto;
    transition: all var(--transition-mid);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    background: var(--color-bg-card-hover);
}

.card:is(:hover, :focus-visible) {
    --hover: 1;
}

.card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(calc(1 + (var(--hover, 0) * 0.25))) rotate(calc(var(--hover, 0) * -5deg));
    transition: transform var(--transition-fast);
    display: none;
}

.card__footer {
    padding: 0.5rem;
    position: relative;
    text-align: left;
    width: 100%;
    display: grid;
    gap: 0.5ch;
    backdrop-filter: blur(var(--blur));
    min-height: 30%;
    align-content: center;
    color: var(--color-text-faint);
    transition: all var(--transition-fast);
}

.card:hover .card__footer {
    height: 35%;
}

.card__footer > span:first-child {
    color: var(--color-text-primary);
}

.card__footer span:nth-of-type(1) {
    font-size: calc(var(--size) * 0.065);
    font-weight: 600;
    display: flex;
    justify-content: left;
    align-items: center;
    transition: transform var(--transition-fast);
}

.card__footer span:nth-of-type(1):hover {
    transform: translateX(5px);
}

.card__footer span:nth-of-type(1) svg {
    margin-left: 5px;
    transition: transform var(--transition-fast);
}

.card__footer span:nth-of-type(1):hover svg {
    transform: translateX(3px);
}

.card__footer span:nth-of-type(2) {
    font-size: calc(var(--size) * 0.045);
    transition: opacity var(--transition-fast);
}

.card:hover .card__footer span:nth-of-type(2) {
    opacity: 0.8;
}

.card__action {
    position: absolute;
    aspect-ratio: 1;
    width: calc(var(--size) * 0.15);
    bottom: 30%;
    right: 1.5rem;
    transform: translateY(50%) translateY(calc(var(--size) * 0.4)) translateY(calc(var(--hover, 0) * (var(--size) * -0.4)));
    display: none;
    place-items: center;
    border-radius: var(--radius-md);
    background: hsla(0, 0%, 30%, 0.5);
    transition: all var(--transition-fast);
}

.card__action svg {
    aspect-ratio: 1;
    width: 50%;
    transition: transform var(--transition-fast);
}

.card__action:hover svg {
    transform: scale(1.2);
}

/* ─── Skills ─────────────────────────────────────────────────────────────── */

#skillsDesc {
    color: var(--color-text-muted);
    margin-top: 3%;
    animation: fadeIn 1s ease-out;
}

.skillsContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.skills-item {
    background: var(--color-bg-skill);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border: 1px solid var(--color-border-subtle);
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
    transition: all var(--transition-fast);
}

.skills-item:hover {
    transform: translateY(-5px);
    background: var(--color-bg-skill-hover);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.skills-item:nth-child(1) { animation-delay: 0.1s; }
.skills-item:nth-child(2) { animation-delay: 0.2s; }
.skills-item:nth-child(3) { animation-delay: 0.3s; }
.skills-item:nth-child(4) { animation-delay: 0.4s; }
.skills-item:nth-child(5) { animation-delay: 0.5s; }

.skills-item h3 {
    color: var(--color-text-primary);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border-subtle);
    transition: all var(--transition-fast);
}

.skills-item:hover h3 {
    border-bottom-color: var(--color-border-medium);
}

.skills-item ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.skills-item ul li {
    color: var(--color-text-muted);
    padding: 0.5rem 0 0.5rem 1.5rem;
    position: relative;
    transition: all var(--transition-fast);
}

.skills-item ul li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--color-text-dim);
    transition: all var(--transition-fast);
}

.skills-item ul li:hover {
    color: var(--color-text-primary);
    transform: translateX(5px);
}

.skills-item ul li:hover::before {
    color: var(--color-text-primary);
}

.skills-item ul li a {
    color: inherit;
    text-decoration: none;
    position: relative;
}

.skills-item ul li a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--color-text-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-fast);
}

.skills-item ul li a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ─── Homies ─────────────────────────────────────────────────────────────── */

#homiesDesc {
    color: var(--color-text-muted);
    margin-top: 3%;
    animation: fadeIn 1s ease-out;
}

/* ─── Last.fm widget ─────────────────────────────────────────────────────── */

.lastfm_container {
    display: flex;
    flex-direction: row;
    height: 50px;
    padding: 8px;
    border-radius: var(--radius-md);
    align-content: end;
    margin-left: auto;
    margin-top: 0.8%;
    direction: rtl;
    transition: 300ms;
}

.lastfm_container .lastfm_details {
    font-family: var(--font-mono);
    padding-right: 8px;
    margin-top: 5px;
}

.lastfm_container .lastfm_details h3 {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.847);
}

.lastfm_container .lastfm_details p {
    color: var(--color-text-faint);
    font-size: 0.8rem;
}

.lastfm_container .song_cover {
    margin-right: 5px;
}

.lastfm_container .song_cover img {
    aspect-ratio: 1 / 1;
    max-width: 50px;
    display: block;
    border-radius: var(--radius-md);
}

.lastfm_container:hover {
    opacity: 0.75;
    transform: translateX(5px);
    transition: 300ms;
}

/* ─── Profile picture ────────────────────────────────────────────────────── */

.pfp {
    max-width: 25%;
    position: relative;
    float: left;
    top: 0;
    padding-right: 10px;
    padding-bottom: 5px;
    border-radius: 10px;
    display: none;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */

footer {
    position: relative;
    bottom: 3rem;
    padding-top: 10%;
    margin: 0;
    animation: fadeIn 1.5s ease-out;
}

.footer_container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.socials {
    margin-top: 1%;
    padding: 10px 16px;
}

.socials a {
    text-decoration: none;
    margin-right: 5px;
    display: inline-block;
    transition: all var(--transition-fast);
}

.socials a:hover {
    opacity: 0.75;
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    color: var(--color-text-faint);
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.copyright:hover {
    color: var(--color-text-primary);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media only screen and (max-width: 768px) {
    .cards {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        place-items: center;
        width: 90%;
    }

    .card {
        margin: 2% auto;
    }

    .skillsContainer {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.5rem;
    }

    .skills-item {
        padding: 1rem;
    }

    .lastfm_container {
        margin-top: 20px;
    }

    .lastfm_container .song_cover img {
        max-width: 40px;
    }

    .lastfm_container .lastfm_details h3 {
        font-size: 14px;
    }

    .websitePath {
        margin-left: 0;
        margin-right: 0;
    }
}

@media only screen and (max-width: 600px) {
    .navbar {
        display: block;
        width: 100%;
    }

    .logoButton {
        width: 100%;
        height: 40%;
    }

    .logo {
        display: block;
        margin: 0 auto;
        width: 10rem;
    }

    .pages {
        justify-content: center;
        font-size: 0.8rem;
    }

    .pages > li {
        margin: 5px;
    }

    .homeIndex {
        margin: 0;
    }

    ul.breadcrumb {
        margin-left: 0;
        margin-top: 5%;
        margin-right: 0;
    }

    #mutebtn_ {
        display: none;
    }

    .homeName {
        margin-top: 3rem;
    }

    .footer_container {
        display: block;
    }

    footer {
        padding: 5% 0;
    }

    .socials {
        display: flex;
        justify-content: center;
    }

    .copyright {
        font-size: 10px;
        margin: 0 auto;
        text-align: center;
    }
}