#site-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 2000;
    pointer-events: auto;
}

.projects-section {
    min-height: auto;
    padding-top: 5rem;
    background-color: var(--backgrund-body);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--base-color);
}


.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    gap: 2rem;
    padding: 2rem 0;
}


.project-card {
    display: block;
    position: relative;
    border-radius: 1rem;
    width: 100%;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    margin-bottom: 4rem;

    opacity: 0;
    transform: translateY(30px) translateZ(0);

    transition:
        opacity 1s ease-out,
        transform 1s cubic-bezier(0.2, 1, 0.3, 1),
        background-color 0.3s ease;
    pointer-events: none;

    overflow: hidden;
    isolation: isolate;
    mask-image: -webkit-radial-gradient(white, black);

    /**BOARDER RIM POP**/
    border: 0px solid rgba(255, 255, 255, 0.575);
    background-color: var(--backgrund-body-2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    /**BOARDER RIM POP**/
}

.project-card.appear {
    opacity: 1; 
    transform: translateY(0) translateZ(0);
    pointer-events: auto;
}

.project-card.appear:hover {
    transform: translateY(-10px) translateZ(0);
    transition-delay: 0s;
}

.project-card.appear:not(:hover) {
    transition: transform 0.5s ease-out, opacity 1.2s ease-out;
}

.project-card.appear:hover .project-info {
    background-color: rgba(30, 30, 30, 0.8);
}

.project-image {
    width: 100%;
    height: 400px;
    display: block;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;

    box-sizing: border-box;
    width: 100%;

    backdrop-filter: blur(2px) saturate(150%);
    -webkit-backdrop-filter: blur(2px) saturate(150%);

    background: rgba(15, 15, 15, 0.7);

    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;

    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);

    outline: 1px solid transparent;
    backface-visibility: hidden;

    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
    
    margin-bottom: -1px; 
    width: 101%; 
    left: -0.5%;
}

.project-info p {
    margin: 0;
    width: 100%;
    max-width: 100%;
    text-align: left;
}

.project-info h3 {
    font-size: 1.8rem;
    margin: 0 0 0.5rem 0;
    color: var(--base-color);
    font-family: Inter;
}

.project-info p {
    font-size: 1rem;
    color: var(--base-color);
    margin: 0;
}

.site-footer {
    z-index: 10;
}



/**PROJECTWHEEL**/
/**PROJECTWHEEL**/
/**PROJECTWHEEL**/
/**PROJECTWHEEL**/

#project-wheel {
    position: fixed;
    left: 40px;
    top: 50%;
    transform: translateY(-20px);
    z-index: 1000;
    opacity: 0;
}

#project-wheel.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.wheel-track {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    align-items: flex-start;
}

.wheel-item {
    height: 40px;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0.2;
    transition: opacity 0.4s, transform 0.4s;
    cursor: pointer;
    text-decoration: none;

}

.wheel-item.active {
    opacity: 1;
}

.wheel-label {
    color: var(--base-color);
    font-size: 0.8rem;
    margin-left: 0px;
    font-family: 'Inter', sans-serif;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.wheel-item:hover .wheel-label,
.wheel-item.active .wheel-label {
    opacity: 10;
}

.wheel-dot {
    width: 12px;
    height: 12px;
    background-color: var(--base-color);
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.wheel-item.active .wheel-dot {
    background-color: transparent;
    border-color: var(--base-color);
    box-shadow: 0 0 10px var(--base-color);
}


/** about section**/


#about {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 10rem;
    padding-top: 5rem;
    background-color: var(--backgrund-body);
}

#aboutTitle {
    padding: 0;
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--base-color);
}

#bildtextcontainer {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 1200px;
    background-color: var(--backgrund-body-2);

    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s ease-out, transform 1.2s cubic-bezier(0.2, 1, 0.3, 1);
}

#textBlock {
    flex: 1;
}

#aboutbilden {
    height: auto;
    width: 30%;
    border-radius: 1rem;
}

.about-paragraph {
    font-size: 1.2rem;
    color: var(--base-color);
    font-family: Inter;
    margin-bottom: 0.8rem;
    margin-top: 0;
}

#textblocktitle {
    text-align: left;
    font-size: 2rem;
    font-family: Inter;
    color: var(--base-color);
    margin-bottom: 1rem;
}

#bildtextcontainer.appear {
    opacity: 1;
    transform: translateY(0);
}

.button-container {
    margin-top: 2rem;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.button-container-header {
    margin-top: 1rem;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.cv-button {
    padding: .5rem .5rem;
    background-color: transparent;
    color: var(--base-color);
    border: 2px solid var(--base-color);
    border-radius: 0.5rem;
    text-decoration: none;
    font-family: Inter, sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    box-sizing: border-box;
    white-space: nowrap;
}

.cv-button:hover {
    background-color: var(--base-color);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/** about section**/

/** side projects section**/


#sideProjects {
    max-width: auto;
    margin: 0 auto;
    padding: 5rem 20px;
}

.sideProjectGrid {
    display: block; 
    column-count: 3;
    column-gap: 20px;
    width: 100%;
}

.sideProjectGrid img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: .5rem;
    transition: transform 1s ease;
    cursor: pointer;
    margin-bottom: 20px;

    opacity: 0;
    transform: translateY(30px);
    transition: opacity 2s ease, transform 2s cubic-bezier(0.2, 1, 0.3, 1);

    pointer-events: none;

    overflow: hidden;
    isolation: isolate;
    mask-image: -webkit-radial-gradient(white, black);
}

.sideProjectGrid img.appear {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.sideProjectGrid img.appear:hover {
    transform: translateY(-10px) translateZ(0);
    transition-delay: 0s;
}

#sideProjectsW {
    max-width: 1200px;
    margin: 0 auto;
}

.sideProjectGrid img:nth-child(1) { transition-delay: .5s; }
.sideProjectGrid img:nth-child(2) { transition-delay: .1s; }
.sideProjectGrid img:nth-child(3) { transition-delay: .22s; }
.sideProjectGrid img:nth-child(4) { transition-delay: .3s; }
.sideProjectGrid img:nth-child(5) { transition-delay: .6s; }


#sideProjects {
    background-color: #1a1a1a; 
}


/**POPOUP DIALOG **/

#imageDialog {
    position: fixed; 
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 90%;
    max-width: 600px;

    margin: 0; 
    border: none;
    background: transparent;
    padding: 0;
    overflow: visible; 
    border: none;
    outline: none;
}

#imageDialog::backdrop {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
}

.dialog-content {
    display: flex;
    flex-direction: column;
    align-items: justify;
    justify-content: justify;
    min-height: auto;
    padding: 0rem;
    border-radius: 10px;
}


#imageDialog img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 1rem;
}


#dialogTitle {
    white-space: pre-line;
    text-align: start;
}

.dialog-content {
    display: flex;
    flex-direction: column;
    align-items: start;
    max-width: 100vw;
    height: 100%;
}

#dialogTitle {
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 1px;
    animation: fadeIn 0.5s ease; 
}

#fullImage {
    display: block;
    margin: 0;      /* Ensure image has no ghost margins */
    height: 100%;
    width: auto;
    object-fit: contain;
    border-radius: 1rem;
    margin-bottom: 1rem;
}

#fullImage {
    pointer-events: none;
}

#dialogVideo {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 0;
    object-fit: contain;
    outline: none;
    min-height: min-content;
}

.media-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    align-items: center;
    max-height: 70vh;
    width: 100%;
}

#dialogVideo{
    pointer-events: auto;
    outline: none;
}

/**Dialog content**/




@media screen and (max-width: 1300px) {
    .media-container {
        flex-direction: column;
        align-items: center;
        min-height: min-content;
    }

    #fullImage, #dialogVideo {
        width: 100%;
        max-height: auto;
        margin-bottom: 0rem;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
/**Dialog content**/

/**POPOUP DIALOG **/


/**START ICON CONTAINER ICON CONTAINER ICON CONTAINER START**/

.icon-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-evenly;

    gap: 1rem;
    padding: 1rem;
    border-radius: .3rem;
    width: 90%;
    max-width: 1200px;
    margin-top: 2rem;


    opacity: 0;
    transform: translateY(0px) translateZ(0);

    transition:
        opacity 1s ease-out,
        transform 1s cubic-bezier(0.2, 1, 0.3, 1),
        background-color 0.3s ease;
    pointer-events: none;
}

.icon-container.appear {
    opacity: 1; 
    transform: translateY(0) translateZ(0);
    pointer-events: auto;
}

.icon-container.appear:hover {
    transform: translateY(0px) translateZ(0);
    transition-delay: 0s;
}

.icon-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.icon-wrapper svg {
    width: 30px; 
    height: 30px;
}

.icon-badge {
    background-color: var(--base-color);
    padding: 0px;
    border-radius: .2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 33px;
    transition: background-color 0.3s ease;
}

.icon-wrapper {
    transition: transform 0.6s cubic-bezier(0.2, 1, 0.3, 1);
    will-change: transform;
}

.icon-wrapper svg {
    width: 30px;
    height: 30px;
}

.icon-wrapper:hover {
    transform: scale(3);
}

.icon-wrapper:hover .icon-badge {
    background-color: var(--base-color);
}

.icon-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease;
}

.icon-spacer {
    background-color: var(--text-color);
    border-radius: .2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 4px;
    height: 30px;
    flex-shrink: 0;
}


.mobile-icon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 1rem;
    width: 100%;
    max-width: 600px;
    width: 90%;
    border-radius: .5rem;
    margin-top: 2rem;

    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s ease-out, transform 1.2s cubic-bezier(0.2, 1, 0.3, 1);
}

.mobile-icon-container.appear {
    opacity: 1;
    transform: translateY(0);
}

.cad-icon-row, 
.surface-icon-row, 
.adobe-icon-row, 
.oters-icon-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;

}

/**END ICON CONTAINER ICON CONTAINER ICON CONTAINER END**/

    .mobile-icon-container {
        display: none;
    }

@media (max-width: 1100px) {
    .icon-container {
        display: none;
    }
    .mobile-icon-container {
        display: flex;
        flex-direction: column;
    }
}

    .hero-lead,
    .hero-value,
    .hero-status {
        font-size: 1rem;
        line-height: 1.2;
    }

    .hero-text {
        font-size: 1rem;
        line-height: 1.5;
        max-width: 65ch;
    }


.hero-text p {
    font-size: 1rem;
    line-height: 1.6;
}

.hi-hero {
    font-size: .5rem;
}

.lead-hero {
    font-size: .5rem;
}

/**Stacked video in side projects**/

html:has(dialog[open]) {
    overflow: hidden;
    height: 100vh;
}

dialog[open] {
    display: flex;
    flex-direction: column;
    max-width: 90vw;
    max-height: 85vh; /* Never taller than 85% of screen */
    border-radius: 12px;
    border: none;
    margin: auto;     /* Centered on screen */
    padding: 0;       /* IMPORTANT: No padding on the dialog itself */
    overflow: hidden; /* Clips the container so the scrollbar works inside */
}
@media screen and (max-width: 1300px) {
.dialog-content {
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
    gap: 1rem;
}
}
