/* --- Variables & Reset --- */
:root {
    --bg-main: #0a0a0c;
    --bg-card: #141418;
    --purple-pop: #a855f7;
    --purple-glow: #a855f780;
    --purple-pastel: #c285f0;
    --light-purple: #d8b4fe;
    --text-main: #f3f4f6;
    --text-dim: #b9bfc9;
    --text-body: #ededed;
    --bg-tags: #201727;
}

::selection {
    background-color: rgba(168, 85, 247, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-body);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

nav {
    z-index: 1000;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    height: 80px; /* Resting height */
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.4); /* Slight tint at top */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

nav a:hover {
    color: var(--purple-pop);
}

.text-slim {
    color: var(--text-dim);
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.container-custom {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
    position: relative;
}

#experience {
    background-color: var(--bg-card);
}

/* --- Typography & Accents --- */
.mono { font-family: 'JetBrains Mono', monospace; }
.text-purple { color: var(--purple-pop); }
.purple-glow { box-shadow: 0 0 20px rgba(168, 85, 247, 0.4); }
.purple-gradient-text {
    background: linear-gradient(to right, #a855f7, #d8b4fe);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.logo { 
    font-weight: 700; 
    font-size: 1.25rem;
    line-height: 1.75rem;
    color: var(--purple-pop); 
}
.section-title { 
    font-size: 2.5rem; 
    font-weight: 700; 
    margin-bottom: 2rem; 
}

/* --- Hero Section --- */
.hero {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
    margin: 1.5rem;
    max-width: 70%;
}

.badge {
    background: rgba(168, 85, 247, 0.1);
    border: 0.5px solid var(--purple-glow);
    color: var(--purple-pastel);
    padding: 0.4rem 1rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.hero-subtext {
    max-width: 42rem;
    color: var(--text-dim);
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

/* --- Hamburger Animation --- */
#menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
    background-color: var(--purple-pop);
}

#menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

#menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    background-color: var(--purple-pop);
}

/* --- Mobile Menu Overlay --- */
#mobile-menu {
    position: fixed;
    top: 70px; /* Start below the nav bar */
    left: 0;
    width: 100%;
    height: calc(100% - 70px);
    background: rgba(10, 10, 12, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99; /* Below nav so logo and X button stay visible */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#mobile-menu.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.mobile-link {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 700;
    transition: 0.3s;
}

.mobile-link:hover {
    color: var(--purple-pop);
    transform: scale(1.1);
}

/* Prevent scrolling when menu is open */
body.menu-open {
    overflow: hidden;
}

/* --- Buttons --- */
.btn-primary {
    background-color: rgb(147 51 234 / var(--tw-bg-opacity, 1));
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    transition: 0.3s;
    box-shadow: 0 0 10px var(--purple-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    background-color: rgb(126 34 206 / var(--tw-bg-opacity, 1));
}

.btn-secondary {
    padding: 0.8rem 2rem;
    color: var(--text-main);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    margin-left: 1rem;
    font-weight: 600;
    background-color: rgb(255 255 255 / 0.05);;
}

.btn-secondary:hover {
    background-color: rgb(255 255 255 / 0.1);
    border-color: var(--purple-pop);
}

/* --- Tool Card Updates --- */
#stack {
    background-color: var(--bg-card);
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 1.5rem;
    border-radius: 20px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tool-icon-img {
    width: 45px;
    height: auto;
    margin-bottom: 1rem;
    filter: grayscale(100%) brightness(0.8); /* Keeps it subtle initially */
    transition: 0.3s ease;
}

.tool-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dim);
    transition: 0.3s;
}

/* --- Hover State: The Reveal --- */
.tool-card:hover {
    border: 0.5px solid var(--purple-pop);
    transform: translateY(-8px);
    /* background: rgba(168, 85, 247, 0.05); */
    box-shadow: 0px 5px 10px 0px var(--purple-glow);
}

.tool-card:hover .tool-icon-img {
    filter: grayscale(0%) brightness(1); /* Brings back the brand color on hover */
    transform: scale(1.1);
}

.tool-card:hover h3 {
    color: white;
}

/* --- Timeline --- */
.timeline-item {
    border-left: 2px solid var(--purple-pop);
    padding-left: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.timeline-item h4 { font-size: 1.3rem; margin-bottom: 0.2rem; }
.timeline-item .date { color: var(--purple-pop); font-weight: 600; font-size: 0.9rem; }
.timeline-item p { color: var(--text-dim); margin-top: 0.5rem; }

/* --- CV Section Styling --- */
.cv-section {
    margin-top: 4rem;
    padding-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05); /* Subtle line to separate from timeline */
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers the heading and text */
}

.cv-button-group {
    display: flex;
    gap: 1.5rem;
    justify-content: center; /* Centers the buttons horizontally */
    flex-wrap: wrap; /* Ensures they stack nicely on mobile */
}

/* Optional: Make the text under the title look consistent */
.text-center {
    text-align: center;
}

.mb-8 {
    margin-bottom: 2rem;
}

/* Ensure buttons have enough width to look balanced */
.cv-button-group .btn-primary, 
.cv-button-group .btn-secondary {
    min-width: 200px;
    margin-left: 0; /* Resets your previous margin-left: 1rem on btn-secondary */
}

/* --- Projects Grid Layout --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.project-card {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    height: 400px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.4s ease, border-color 0.4s ease;
}

.project-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s ease;
}

/* --- Hover Reveal Effect --- */
.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 12, 0.95), rgba(168, 85, 247, 0.1));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2.5rem;
    opacity: 0; /* Hidden by default */
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover .project-image {
    transform: scale(1.05);
    filter: brightness(0.3);
}

.project-card:hover {
    border-color: var(--purple-pop);
    box-shadow: 0 15px 40px -10px var(--purple-glow);
}

/* --- Content Inside Cards --- */
.project-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    cursor: default;
}

/* .project-tags span {
    background: var(--bg-tags);
    color: var(--light-purple);
    border: 1px solid var(--light-purple);
    white-space: nowrap;     
    display: inline-flex;  
    border-radius: 99px;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.3rem 0.8rem;  
} */

.project-tags span {
    background: var(--bg-tags);
    color: var(--light-purple);
    border: 1px solid var(--light-purple);
    padding: 0.2rem 0.8rem;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-overlay h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.project-overlay p {
    color: var(--text-dim);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.view-link {
    font-weight: 700;
    color: var(--purple-pop);
    text-decoration: none;
}

/* --- About Style --- */
/* --- About Section Styling --- */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.about-card {
    background: var(--bg-card);
    padding: 3rem 2rem;
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
    transition: all 0.5s ease;
    overflow: hidden;
}

/* Creating a unique glow for each card */
.about-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.about-card:hover {
    transform: translateY(-10px);
    border-color: rgba(168, 85, 247, 0.3);
}

.about-card:hover::before {
    opacity: 1;
}

.about-icon {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--purple-pop);
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.about-card h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
}

.about-card p {
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* Skill Tags inside About cards */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tags span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.3rem 0.8rem;
    border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.about-card:hover .skill-tags span {
    border-color: var(--light-purple);
}

/* --- Animated Background Container --- */
.bg-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: #0a0a0c;
    overflow: hidden;
}

/* Ett mycket subtilt rutnät som ger struktur */
.grid-overlay {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(168, 85, 247, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 85, 247, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Själva glas-objekten */
.glass-shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    transition: transform 0.2s ease-out; /* För parallax-effekten senare */
    color: rgba(168, 85, 247, 0.502)
}


.shape-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    right: -5%;
    transform: rotate(15deg);
}

.shape-2 {
    width: 200px;
    height: 200px;
    bottom: 15%;
    left: 5%;
    transform: rotate(-10deg);
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 40%;
    left: 20%;
    transform: rotate(45deg);
}


/* .bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background-color: #0a0a0c; /* Matches your bg-main *
}

/* The Orbs *
.orb {
    position: absolute;
    width: 40vw;
    height: 40vw;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.2; /* Keep it subtle so text stays readable *
    pointer-events: none;
}

.orb-1 {
    top: -10%;
    left: -10%;
    background: var(--purple-glow);
    animation: move 20s infinite alternate;
}

.orb-2 {
    bottom: -10%;
    right: -10%;
    background: var(--purple-pastel); /* A deep blue/indigo for contrast *
    animation: move 25s infinite alternate-reverse;
}

.orb-3 {
    top: 50%;
    left: 50%;
    width: 30vw;
    height: 30vw;
    background: var(--light-purple);
    animation: move 15s infinite linear;
} */

/* Movement Animation */
/* @keyframes move {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(10vw, 20vh) scale(1.2); }
    66% { transform: translate(-5vw, 10vh) scale(0.8); }
    100% { transform: translate(0, 0) scale(1); }
} */

/* --- Footer Styles --- */
.footer {
    background-color: #050505;
    padding: 130px 0 40px 0;
    /* margin-top: 100px; */
    border-top: 1px solid rgba(168, 85, 247, 0.1);
}

.footer-cta {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px auto;
}

.footer-cta h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.footer-cta p {
    color: var(--text-dim);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

.social-icon-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
}

.social-icon-link img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}


.footer-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(168, 85, 247, 0.3), transparent);
    margin-bottom: 40px;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.footer-info p {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-top: 10px;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.3s;
}

.footer-links a:hover {
    color: var(--purple-pop);
    text-shadow: 0 0 10px var(--purple-glow);
}

/* --- Global Responsive Overrides --- */

/* Hero Typography (uses clamp, works across all sizes) */
.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem); 
    margin: 1rem 0;
}

.hero-subtext {
    font-size: clamp(1rem, 3vw, 1.25rem);
    padding: 0 1rem;
}

/* Section Titles (uses clamp, works across all sizes) */
.section-title {
    font-size: clamp(2rem, 5vw, 2.5rem);
}

/* Desktop overrides */
@media (min-width: 768px) {
    nav {
        height: 80px;
    }
}

@media (min-width: 1024px) {
    .project-card.large {
        grid-column: span 2;
    }
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    /* Nav */
    nav {
        height: 70px;
    }

    /* Buttons */
    .cta-group {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 1rem;
        padding: 0 2rem;
    }

    .btn-secondary {
        margin-left: 0;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        text-align: center;
    }

    .tool-card .tool-icon-img {
        filter: none !important;
        transform: none !important;
    }

    .project-card {
        height: auto !important;
        display: flex;
        flex-direction: column;
    }

    .project-image {
        height: 250px; /* Adjust this height to your liking */
        width: 100%;
        position: relative;
    }

    .project-overlay {
        position: static !important;
        opacity: 1 !important;
        transform: none !important;
        background: var(--bg-card) !important; /* Matches your card background */
        padding: 1.5rem !important;
        display: block !important;
    }

    .project-card:hover .project-image {
        transform: none !important;
        filter: none !important;
    }

    .project-overlay h3 {
        font-size: 1.4rem;
        margin-top: 0.5rem;
    }

    .project-overlay p {
        margin-bottom: 1rem;
        font-size: 0.9rem;
    }

    /* .project-tags {
        margin-bottom: 0.5rem;
    }

    .project-tags span {
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 1px;
        text-align: center; 
    } */

    .project-tags, .skill-tags {
        gap: 0.4rem;           
        flex-wrap: wrap;       
    }

    .project-tags span, .skill-tags span {
        font-size: 0.65rem;   
        padding: 0.25rem 0.6rem; 
    }

    #about, #about-hero {
        background-color: var(--bg-main);
    }

    /* Footer */
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
}