/* Skills icons layout */
.skills-icons {
    display: flex;
    flex-direction: row;
    gap: var(--gap);
    width: 100%;
    height: fit-content;
    flex-wrap: wrap;
}

.skill-category {
    display: flex;
    flex-direction: column;
    gap: calc(var(--gap) * 0.5);
    align-items: center;
}

.icons-row {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--gap) * 0.5);
    justify-content: center;
    align-items: center;
}

.skill-icon {
    width: 3.5rem;
    transition: transform 200ms ease;
    flex-shrink: 0;
}

@media (min-width: 800px) {}

/* Styleguide */
.styleguide {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    text-align: center;
    width: 100%;
    max-width: var(--section-max-width);
    box-sizing: border-box;
    overflow: hidden;
}

.styleguide img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-width: 100%;
    display: block;
}

.styleguide h2 {
    margin-bottom: var(--gap);
}

/* Global img/video styles */
img,
video {
    border-radius: var(--border-radius-small);
}

/* Quote section */
.quote {
    max-width: 1000px;
    padding: var(--gap);
    text-align: center;
    margin: 0 auto;
    background: linear-gradient(135deg,
            rgba(99, 32, 238, 0.2) 0%,
            rgba(99, 32, 238, 0.1) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius-small);
}

.quote h3 {
    color: var(--color-primary);
}

/* Project layout */
.project-hero {
    width: 100%;
    display: flex;
    gap: var(--gap);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--section-padding-v) var(--section-padding-h) var(--gap) var(--section-padding-h);
}

.meta-data {
    width: 100%;
    max-width: var(--section-max-width);
    padding: var(--gap) var(--section-padding-h) 1rem var(--section-padding-h);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.meta-data h2 {
    padding-top: var(--gap);
    max-width: 100%;
}

.project-cover {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: var(--section-max-width);
    padding: 0 var(--section-padding-h) var(--gap) var(--section-padding-h);
    overflow: hidden;
}

.project-cover video,
.project-cover img {
    width: 110%;
    height: auto;
    border-radius: var(--border-radius-small);
}

.project-description {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: var(--section-max-width);
    padding: .5rem var(--section-padding-h) var(--section-padding-v) var(--section-padding-h);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.project-description h2 {
    font-size: clamp(2rem, 1.5185rem + 1.9753vw, 3rem);
    text-transform: uppercase;
    font-weight: 600;
    line-height: 1.1;
    padding-bottom: 1rem;
}

.project-info {
    display: flex;
    flex-direction: column-reverse;
    border-top: 1px solid var(--color-dark);
    gap: var(--gap);
}

.project-info p {
    padding-top: 1rem;
}

.text-block {
    width: 100%;
}

.text-block p {
    padding-bottom: 1.5rem;
}

.project-tools {
    width: 100%;
    min-width: 400px;
    padding-bottom: 2rem;
}

.project-tools li {
    border-bottom: 1px solid var(--color-dark);
    list-style: none;
    padding: .7rem 0;
    text-transform: uppercase;
}

.section-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: calc(var(--gap) * 3);
    padding: var(--section-padding-v) var(--section-padding-h);
}

.double-image,
.image-text {
    max-width: var(--section-max-width);
    width: 100%;
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
}

.double-image img {
    width: 100%;
    flex-grow: 0;
    flex-shrink: 0;
}

/* Reverse classes */
.image-text.column-reverse {
    flex-direction: column;
}

/* Next project section */
.next-project-link {
    display: block;
    text-decoration: none;
    color: var(--color-light);
    width: 100%;
}

.next-project {
    width: 100%;
    padding: var(--section-padding-v) var(--section-padding-h) 1rem var(--section-padding-h);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    position: relative;
    
    height: 250px;
    
    overflow: hidden;
    cursor: pointer;
}

.next-project img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 300ms ease-out;
    border-radius: 0;
}

/* Gradient overlay - darker in bottom right corner */
.next-project::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at bottom right,
            rgba(0, 0, 0, 0.8) 0%,
            rgba(0, 0, 0, 0.4) 50%,
            transparent 80%);
    z-index: 1;
    transition: opacity 300ms ease-out;
}

.next-project-text {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    transition: all 300ms ease-out;
}

.next-project-text h3 {
    /* font-size: 3rem; */
    margin: 0;
    padding: 0;
    color: #ebebeb;
    transition: color 300ms ease-out;
}

.next-project-text h4 {
    font-size: 1rem;
    text-transform: lowercase;
    padding-bottom: 1rem;
    color: var(--color-primary);
    font-weight: 300;
}

/* Hover effects */
.next-project-link:hover img {
    transform: scale(1.05);
}

.next-project-link:hover::before {
    opacity: 0.9;
}

.next-project-link:hover .next-project-text {
    transform: translateX(0.5rem);
}

.next-project-link:hover .next-project-text h3 {
    color: var(--color-primary);
}

/* Page load animations for projects page */
.projects {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.projects h2 {
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInLeft 0.8s ease-out 0.2s forwards;
}

.project-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.project-card-link:nth-child(1) .project-card {
    animation-delay: 0.1s;
}

.project-card-link:nth-child(2) .project-card {
    animation-delay: 0.2s;
}

.project-card-link:nth-child(3) .project-card {
    animation-delay: 0.3s;
}

.project-card-link:nth-child(4) .project-card {
    animation-delay: 0.4s;
}

.project-card-link:nth-child(5) .project-card {
    animation-delay: 0.5s;
}

.project-card-link:nth-child(6) .project-card {
    animation-delay: 0.6s;
}


.timeline {
    display: flex;
    flex-direction: column;
    gap: calc(var(--gap) * 2);
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    text-align: left;
    padding: var(--gap);
    border-left: 3px solid var(--color-primary);
    padding-left: calc(var(--gap) * 1.5);
    position: relative;
}



.timeline-item h4 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.timeline-item h3 {
    margin-bottom: 0.5rem;
    padding-bottom: 0;
}


.code.project-description {
    padding-bottom: 0;
}

/* Media queries */
@media (min-width: 800px) {
    .project-tools {
        width: 40%;
    }

    .meta-data {
        display: flex;
        justify-content: space-between;
    }

    .meta-data h2 {
        padding-top: 5rem;
        max-width: 40%;
    }

    .double-image,
    .image-text,
    .styleguide,
    .project-info {
        flex-direction: row;
    }

    .image-text.column-reverse {
        flex-direction: row-reverse;
    }

    .image-text>*,
    .double-image>img {
        width: calc(50% - var(--gap) / 2);
    }
}

/* Animations */
html {
    scroll-behavior: smooth;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scrollFadeIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scrollSlideLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scrollSlideRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* CSS Scroll animations */
@supports (animation-timeline: view()) {
    .quote {
        animation: scrollFadeIn linear both;
        animation-timeline: view();
        animation-range: entry 0% cover 15%;
    }

    .styleguide {
        animation: scrollSlideRight linear both;
        animation-timeline: view();
        animation-range: entry 0% cover 15%;
    }

    .image-text:nth-of-type(odd) {
        animation: scrollSlideLeft linear both;
        animation-timeline: view();
        animation-range: entry 0% cover 15%;
    }

    .image-text:nth-of-type(even) {
        animation: scrollSlideRight linear both;
        animation-timeline: view();
        animation-range: entry 0% cover 15%;
    }

    .double-image {
        animation: scrollFadeIn linear both;
        animation-timeline: view();
        animation-range: entry 0% cover 15%;
    }

    .timeline {
        flex-direction: column;
    }
}

/* Fallback for browsers without scroll-timeline */
@supports not (animation-timeline: view()) {

    .quote,
    .styleguide,
    .image-text,
    .double-image {
        opacity: 0;
        animation: fadeInUp 0.8s ease-out forwards;
    }

    .quote {
        animation-delay: 0.3s;
    }

    .image-text:nth-of-type(1) {
        animation-delay: 0.4s;
    }

    .image-text:nth-of-type(2) {
        animation-delay: 0.5s;
    }

    .double-image {
        animation-delay: 0.6s;
    }

    .styleguide {
        animation-delay: 0.7s;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}