/* General styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Theme variables */

:root,
html[data-theme="light"] {
    background: var(--background-page);
    --background-card: #ffffff;
    --background-container-frame: #e9dfff;
    --background-page: #f4f0ff;
    --card-border-subtle: #d9c8ff;
    --font-main: 'Baloo 2', sans-serif;
    --loader-ring-background: hsla(266, 100%, 15%, 0.1);
    --loader-worm-gradient-end: #7a33e0;
    --loader-worm-gradient-start: #8f50ff;
    --primary-accent: #8f50ff;
    --text-nav-links: #47266d;
    --text-primary: #2c004f;
    --text-secondary: #593c7a;
}

html[data-theme="dark"] {
    background: var(--background-page);
    --background-card: #3e1f63;
    --background-container-frame: #2c104d;
    --background-page: #1a0a2e;
    --card-border-subtle: #4d297a;
    --font-main: 'Baloo 2', sans-serif;
    --loader-ring-background: hsla(262, 76%, 85%, 0.1);
    --loader-worm-gradient-end: #500eaa;
    --loader-worm-gradient-start: #6118bf;
    --primary-accent: #aa84ff;
    --text-nav-links: #d8c7f0;
    --text-primary: #e9dfff;
    --text-secondary: #c8b3e6;
}

/* Body styles */
body {
    align-items: center;
    background-color: var(--background-page);
    color: var(--text-primary);
    display: flex;
    font-family: var(--font-main);
    justify-content: center;
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    user-select: none;
}

/* Loader styles */
#loader {
    align-items: center;
    background: var(--background-page);
    bottom: 0;
    display: flex;
    font-size: 1.5rem;
    justify-content: center;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    transition: background-color 0.2s ease;
    z-index: 1000;
}

.pl,
.pl__worm {
    animation-duration: 3s;
    animation-iteration-count: infinite;
}

.pl {
    animation-name: bump;
    animation-timing-function: linear;
    height: 8em;
    width: 8em;
}

.pl__ring {
    transition: stroke 0.2s ease;
}

.pl__worm {
    animation-name: worm;
    animation-timing-function: cubic-bezier(0.42, 0.17, 0.75, 0.83);
}

@keyframes bump {

    from,
    42%,
    46%,
    51%,
    55%,
    59%,
    63%,
    67%,
    71%,
    74%,
    78%,
    81%,
    85%,
    88%,
    92%,
    to {
        transform: translate(0, 0);
    }

    44% {
        transform: translate(1.33%, 6.75%);
    }

    53% {
        transform: translate(-16.67%, -0.54%);
    }

    61% {
        transform: translate(3.66%, -2.46%);
    }

    69% {
        transform: translate(-0.59%, 15.27%);
    }

    76% {
        transform: translate(-1.92%, -4.68%);
    }

    83% {
        transform: translate(9.38%, 0.96%);
    }

    90% {
        transform: translate(-4.55%, 1.98%);
    }
}

@keyframes worm {
    from {
        stroke-dashoffset: 10;
    }

    25% {
        stroke-dashoffset: 295;
    }

    to {
        stroke-dashoffset: 1165;
    }
}

/* Hidden until load */
.hidden-until-load {
    display: none;
}

/* Portfolio container */
.portfolio-container {
    background-color: var(--background-container-frame);
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    max-width: 1600px;
    padding: 1.8rem;
    transition: background-color 0.2s ease;
    width: 100%;
}

/* Page header */
.page-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.8rem;
    padding: 0 0.5rem;
}

/* Logo area */
.logo-area {
    align-items: center;
    display: flex;
}

#theme-toggle-icon {
    color: var(--text-nav-links);
    cursor: pointer;
    font-size: 1.2rem;
    margin-right: 0.75rem;
    transition: color 0.2s ease;
}

#theme-toggle-icon:hover {
    color: var(--primary-accent);
}

.logo {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

/* Main navigation */
.main-nav a {
    color: var(--text-nav-links);
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: 1px;
    margin-left: 1.8rem;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

.main-nav a:hover {
    color: var(--primary-accent);
}

.main-nav a.active-nav {
    color: var(--primary-accent);
    font-weight: 700;
}

/* Content grid */
.content-grid {
    display: flex;
    gap: 1.5rem;
}

/* Portfolio column */
.portfolio-column {
    display: flex;
    flex-direction: column;
    flex-shrink: 1;
    gap: 1.5rem;
}

/* Column sizing */
.column-1 {
    flex-basis: 0;
    flex-grow: 1.618;
    min-width: 0;
}

.column-2 {
    flex-basis: 0;
    flex-grow: 0.618;
    min-width: 0;
}

.column-3 {
    flex-basis: 0;
    flex-grow: 0.9;
    min-width: 0;
}

/* Card styles */
.card {
    background-color: var(--background-card);
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(100, 80, 80, 0.05);
    display: flex;
    flex-direction: column;
    padding: 1.8rem;
    position: relative;
    transition: background-color 0.2s ease, opacity 0.3s ease, transform 0.3s ease;
}

.content-grid:hover > .portfolio-column > .card:not(:hover),
.portfolio-column:hover > .card:not(:hover) {
    opacity: 0.5;
    transform: scale(0.98);
}

.content-grid > .portfolio-column > .card:hover,
.portfolio-column > .card:hover {
    opacity: 1;
    transform: scale(1.02);
}

/* Hero card */
.hero-card {
    flex-shrink: 0;
    justify-content: center;
}

.hero-card h1 {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.2;
    transition: color 0.2s ease;
}

/* Profile image card */
.profile-image-card {
    aspect-ratio: 3 / 4;
    flex-grow: 1;
    flex-shrink: 0;
    overflow: hidden;
    padding: 0;
    width: 100%;
    align-self: center;
}

.profile-image-card img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

/* Projects list card */
.projects-list-card {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Projects navigation */
.projects-nav {
    flex-grow: 1;
    list-style: none;
    overflow-y: auto;
}

.projects-nav li a {
    border-bottom: 1px solid var(--card-border-subtle);
    color: var(--text-primary);
    display: block;
    font-size: 1.15rem;
    font-weight: 500;
    padding: 0.7rem 0;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.projects-nav li:last-child a {
    border-bottom: none;
}

.projects-nav li a:hover {
    color: var(--primary-accent);
}

/* Arrow icon */
.arrow-icon {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-left: 0.3em;
    transition: color 0.2s ease;
}

.projects-nav li a:hover .arrow-icon {
    color: var(--primary-accent);
}

/* Decorative elements */
.decorative-element {
    color: var(--primary-accent);
    font-size: 2.5rem;
    opacity: 0.3;
    position: absolute;
    transition: color 0.2s ease;
    user-select: none;
}

.top-right-deco {
    right: 1.5rem;
    top: 1rem;
}

.bottom-right-deco {
    bottom: 1rem;
    right: 1.5rem;
}

/* Social card */
.social-card {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: fit-content;
    flex-shrink: 0;
}

/* Footer social links */
.footer-social-links {
    display: flex;
    justify-content: space-between;
    max-width: 400px;
    width: 100%;
}

.footer-social-links a {
    color: var(--text-secondary);
    font-weight: 500;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

.footer-social-links a i {
    font-size: 2rem;
}

.footer-social-links a:hover {
    color: var(--primary-accent);
}

/* About me card */
.about-me-card {
    flex-grow: 1;
    justify-content: center;
}

/* Style the about-me list and items */
.about-me-card ul {
    color: var(--text-secondary);
    font-size: 1.618rem;
    line-height: 1.7;
    transition: color 0.2s ease;
    list-style: disc inside;
    margin: 0;
    padding: 0 0 0 1.2em;
}

.about-me-card li {
    margin-bottom: 0.5em;
    /* Optional: add spacing between items */
}

/* Spotify card */
.spotify-card {
    background-color: var(--primary-accent);
    color: var(--background-card);
    display: flex;
    flex-direction: column;
    height: auto;
    justify-content: space-between;
    min-height: 250px;
    overflow: hidden;
    padding: 1.5rem;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.3s ease, transform 0.3s ease, height 0.3s ease, min-height 0.3s ease, padding-top 0.3s ease, padding-bottom 0.3s ease;
    width: 100%;
    align-self: center;
}

.spotify-card.hidden {
    height: 0;
    margin: 0;
    min-height: 0;
    opacity: 0;
    padding: 0;
}

/* Song details */
.song-prompt {
    font-size: 1.45rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    opacity: 0.9;
    max-width: 100%; /* Added max-width */
}

.song-title {
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%; /* Added max-width */
}

.song-artist {
    font-size: 1.45rem;
    font-weight: 500;
    overflow: hidden;
    opacity: 0.8;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%; /* Added max-width */
}

.song-artist a {
    transition: opacity 0.3s ease;
}

.song-artist a {
    transition: opacity 0.3s ease;
}

.song-artist a:hover {
    opacity: 0.7;
}

/* Spotify link */
.spotify-link {
    align-items: center;
    border-radius: 1.618rem;
    color: var(--background-card);
    display: flex;
    font-size: 1.35rem;
    font-weight: 600;
    padding: 0.618rem 1rem;
    text-decoration: none;
    transition: opacity 0.3s ease, color 0.2s ease, transform 0.2s ease;
}

.spotify-link:hover {
    color: var(--text-nav-links);
    opacity: 0.8;
    transform: scale(1.05);
}

.spotify-link i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

/* Media queries */
@media (min-width: 1920px) {
    .portfolio-container {
        max-width: calc(100vh * 1.777);
        aspect-ratio: 21 / 9;
        height: auto;
        display: flex;
        flex-direction: column;
    }

    .content-grid,
    .projects-layout {
        flex: 1 1 0;
        min-height: 0;
        min-width: 0;
        height: 100%;
        width: 100%;
    }

    /* enlarge about me text */
    .about-me-card ul {
        font-size: 1.618rem;
    }

    /* enlarge projects card text to match golden ratio */
    .projects-list-card .projects-nav,
    .projects-list-card .projects-nav li a {
        font-size: 1.618rem;
    }
}

@media (min-width: 1400px) {
    body {
        padding: 1.5rem;
    }
}


@media (max-width: 1275px) {
    .content-grid {
        flex-wrap: wrap;
    }

    .column-1 {
        flex-basis: calc(72.36% - 0.75rem);
        flex-grow: 1;
    }

    .column-2 {
        flex-basis: calc(27.64% - 0.75rem);
        flex-grow: 1;
    }

    .column-3 {
        flex-grow: 1;
        flex-basis: 0;
    }

    .projects-nav li a {
        font-size: 0.9rem;
        padding: 0.6rem 0;
    }

    .decorative-element {
        display: none;
    }
}

@media (min-width: 900px) and (max-width: 1275px) {
    .content-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    .column-1 {
        flex-basis: calc(70% - 0.75rem);
        flex-grow: 1;
    }

    .column-2 {
        flex-basis: calc(30% - 0.75rem);
        flex-grow: 1;
        min-width: 250px;
    }

    .column-3 {
        min-width: 380px;
    }

    .profile-image-card,
    .contact-cta-card {
        flex-grow: 1;
    }
}

@media (max-width: 900px) {
    body {
        padding: 1rem;
    }

    .portfolio-container {
        padding: 1rem;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .main-nav a {
        margin-left: 0;
        margin-right: 1rem;
    }

    .content-grid {
        flex-direction: column;
        gap: 1rem;
    }

    .portfolio-column {
        flex-basis: auto !important;
        width: 100%;
    }

    .column-3 {
        margin-top: 0;
    }

    .card {
        padding: 1.2rem;
    }

    .hero-card h1 {
        font-size: 1.6rem;
    }

    .contact-action-button {
        font-size: 1.3rem;
    }

    .projects-nav li a {
        font-size: 0.9rem;
        padding: 0.7rem 0;
    }
}

@media (max-width: 412px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
        padding: 0 0.2rem;
    }
    .logo-area {
        width: 100%;
        justify-content: space-between;
    }
    .main-nav {
        width: 100%;
        margin-top: 0.5rem;
        display: none;
        flex-direction: column;
        gap: 0.2rem;
        background: var(--background-card);
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(100, 80, 80, 0.05);
        padding: 0.5rem 0.3rem;
        position: static;
    }
    .main-nav.show {
        display: flex;
    }
    .main-nav a {
        font-size: 1rem;
        margin: 0.2rem 0;
        padding: 0.3rem 0.5rem;
        width: 100%;
        text-align: left;
    }
    .header-hamburger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.7rem;
        color: var(--text-nav-links);
        background: none;
        border: none;
        cursor: pointer;
        margin-left: 0.5rem;
        transition: color 0.2s;
    }
    .header-hamburger:active,
    .header-hamburger:focus {
        color: var(--primary-accent);
        outline: none;
    }
    /* Prevent nav overlap with content */
    .portfolio-container {
        position: relative;
    }
}

/* Hide hamburger by default, show only on <=412px */
.header-hamburger {
    display: none;
}

@media (max-width: 412px) {
    .header-hamburger {
        display: inline-flex;
    }
}

