:root {
    /* Variables par défaut (Hiver) */
    --primary-bg: 
        linear-gradient(217deg, rgba(15, 5, 90, 0.85), rgba(20, 10, 220, 0.15) 60%),
        linear-gradient(127deg, rgba(5, 5, 110, 0.8), rgba(15, 15, 200, 0.12) 65%),
        linear-gradient(336deg, rgba(10, 15, 95, 0.75), rgba(5, 15, 210, 0.18) 55%),
        linear-gradient(37deg, rgba(12, 8, 85, 0.25), rgba(18, 12, 230, 0.1) 20%),
        radial-gradient(circle at 20% 70%, rgba(25, 25, 120, 0.3) 0%, transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(30, 30, 150, 0.25) 0%, transparent 35%);
    
    --header-title-color: #e7eaff;
    --header-text-color: #a1a1b5;
    
    --card-bg: rgba(33,33,54,0.5);
    --card-outline: rgba(62,62,124,0.8);
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    --card-hover-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
    
    --image-container-bg: rgba(16,16,27,0.5);
    
    --content-title-color: #8a9bff;
    --content-text-color: #b0b0c3;
    
    --footer-text-color: #b4bfff;
    --footer-link-color: #a0aeff;
    --footer-link-hover: #e7eaff;
    
    --back-to-top-bg: #212136;
    --back-to-top-hover-bg: linear-gradient(37deg, rgba(25, 25, 50, 0.5), rgba(15, 15, 120, 0.8));
    
    --penguin-opacity: 0.5;
    
    --bush-opacity: 0.1;
    --snow-opacity: 0.25;
    
    --link-display-bg: rgba(0, 0, 0, 0.7);
    
    --scrollbar-track: rgba(25, 25, 50, 0.8);
    --scrollbar-thumb: #8a9bff;
    --scrollbar-thumb-hover: #6a7bff;
    
    --double-section-bg: rgba(25, 25, 50, 0.9);
}

@keyframes dynamicShine {
    0% { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}

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

@keyframes jiggle-p {
    0% { transform: rotate(0); }
    25% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
    75% { transform: rotate(-2deg); }
    100% { transform: rotate(0); }
}

@keyframes shimmer {
  0%, 100% {
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.2),
                0 0 5px rgba(255, 215, 0, 0.1);
  }
  50% {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.35),
                0 0 14px rgba(255, 215, 0, 0.25);
  }
}

@keyframes jiggle {
    0% { transform: translateX(0) rotate(0); }
    25% { transform: translateX(-3px) translateY(-3px) rotate(-3deg); }
    50% { transform: translateX(3px) translateY(-3px) rotate(3deg); }
    75% { transform: translateX(2px) translateY(-2px) rotate(-2deg); }
    100% { transform: translateX(0) rotate(0); }
}

@keyframes colorChange {
    0% { color: var(--header-title-color); }
    14% { color: var(--header-text-color); }
    28% { color: red; }
    42% { color: orange; }
    57% { color: yellow; }
    71% { color: green; }
    85% { color: violet; }
    100% { color: red; }
}

@keyframes warmColorChange {
    0% { color: var(--header-title-color); }
    14% { color: var(--header-text-color); }
    28% { color: #ff8a8a; }
    42% { color: #ffa347; }
    57% { color: #ffd700; }
    71% { color: #ff6b6b; }
    85% { color: #ffa07a; }
    100% { color: #ff8a8a; }
}

body.theme-summer {
    --primary-bg: 
        linear-gradient(217deg, rgba(95, 15, 5, 0.85), rgba(220, 70, 20, 0.15) 60%),
        linear-gradient(127deg, rgba(110, 25, 10, 0.8), rgba(200, 65, 15, 0.12) 65%),
        linear-gradient(336deg, rgba(100, 20, 8, 0.75), rgba(210, 55, 18, 0.18) 55%),
        linear-gradient(37deg, rgba(85, 18, 12, 0.25), rgba(230, 60, 12, 0.1) 20%),
        radial-gradient(circle at 20% 70%, rgba(120, 40, 25, 0.3) 0%, transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(150, 45, 30, 0.25) 0%, transparent 35%);
		
    --header-title-color: #ffd8c9;
    --header-text-color: #ffc5b5;
    
    --card-bg: rgba(54,33,33,0.5);
    --card-outline: rgba(124, 62, 62, 0.8);
    
    --image-container-bg: rgba(27,16,16,0.5);
    
    --content-title-color: #ff8a8a;
    --content-text-color: #c3b0b0;
    
    --footer-text-color: #ffb4b4;
    --footer-link-color: #ffa0a0;
    --footer-link-hover: #ffd8c9;
    
    --back-to-top-bg: #362121;
    --back-to-top-hover-bg: linear-gradient(37deg, rgba(50, 25, 25, 0.5), rgba(120, 15, 15, 0.8));
    
    --scrollbar-track: rgba(50, 25, 25, 0.8);
    --scrollbar-thumb: #ff8a8a;
    --scrollbar-thumb-hover: #ff6a6a;
    
    --double-section-bg: rgba(50, 25, 25, 0.9);
}

body.theme-spring {
    --primary-bg: 
        linear-gradient(217deg, rgba(15, 85, 25, 0.8), rgba(50, 210, 70, 0.15) 60%),
        linear-gradient(127deg, rgba(10, 95, 35, 0.75), rgba(65, 190, 85, 0.12) 65%),
        linear-gradient(336deg, rgba(5, 90, 40, 0.7), rgba(75, 170, 95, 0.18) 55%),
        linear-gradient(37deg, rgba(8, 75, 15, 0.25), rgba(55, 225, 75, 0.1) 20%),
        radial-gradient(circle at 20% 70%, rgba(40, 120, 50, 0.3) 0%, transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(45, 150, 60, 0.25) 0%, transparent 35%);
    
    --header-title-color: #e8ffe0;
    --header-text-color: #c0e0b0;
    
    --card-bg: rgba(33,54,33,0.5);
    --card-outline: rgba(80, 150, 80, 0.8);
    
    --image-container-bg: rgba(16,27,16,0.5);
    
    --content-title-color: #8aff8a;
    --content-text-color: #c0e0c0;
    
    --footer-text-color: #b0ffb0;
    --footer-link-color: #80e080;
    --footer-link-hover: #e0ffe0;
    
    --back-to-top-bg: #2a4a2a;
    --back-to-top-hover-bg: linear-gradient(37deg, rgba(30, 80, 30, 0.5), rgba(50, 120, 50, 0.8));
    
    --scrollbar-track: rgba(25, 50, 25, 0.8);
    --scrollbar-thumb: #80e080;
    --scrollbar-thumb-hover: #60c060;
    
    --double-section-bg: rgba(25, 50, 25, 0.9);
    
    --bush-opacity: 0.3;
    --snow-opacity: 0;
}

body.theme-autumn {
    --primary-bg: 
        linear-gradient(217deg, rgba(85, 50, 5, 0.85), rgba(200, 110, 20, 0.15) 60%),
        linear-gradient(127deg, rgba(100, 60, 10, 0.8), rgba(180, 95, 15, 0.12) 65%),
        linear-gradient(336deg, rgba(95, 55, 8, 0.75), rgba(160, 85, 18, 0.18) 55%),
        linear-gradient(37deg, rgba(75, 45, 12, 0.25), rgba(220, 120, 12, 0.1) 20%),
        radial-gradient(circle at 20% 70%, rgba(120, 70, 25, 0.3) 0%, transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(150, 85, 30, 0.25) 0%, transparent 35%);
    
    --header-title-color: #ffedd0;
    --header-text-color: #e0c0a0;
    
    --card-bg: rgba(33,45,33,0.5);
    --card-outline: rgba(150, 100, 50, 0.8);
    
    --image-container-bg: rgba(16,22,16,0.5);
    
    --content-title-color: #ffaa60;
    --content-text-color: #e0c0b0;
    
    --footer-text-color: #ffd0a0;
    --footer-link-color: #ffb070;
    --footer-link-hover: #ffe0c0;
    
    --back-to-top-bg: #4a3a2a;
    --back-to-top-hover-bg: linear-gradient(37deg, rgba(80, 50, 20, 0.5), rgba(120, 70, 30, 0.8));
    
    --scrollbar-track: rgba(50, 35, 25, 0.8);
    --scrollbar-thumb: #ffaa60;
    --scrollbar-thumb-hover: #ff8a40;
    
    --double-section-bg: rgba(50, 35, 20, 0.9);
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--primary-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

header {
    text-align: center;
    margin: 20px 0;
    z-index: 5;
}

header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--header-title-color);
    display: inline-block;
}

header h1 span {
    display: inline-block;
    transition: transform 0.1s ease-in-out, opacity 0.1s ease-in-out;
}

header h1:hover span {
    animation: jiggle 0.5s ease-in-out infinite, colorChange 2s linear infinite;
}

.theme-warm header h1:hover span {
    animation: jiggle 0.5s ease-in-out infinite, warmColorChange 2s linear infinite;
}

header p {
    color: var(--header-text-color);
    font-size: 1.2rem;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
    padding: 20px 0;
}

.project-card {
    position: relative;
    width: 50%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border-radius: 10px;
    cursor: pointer;
    box-shadow: var(--card-shadow);
    outline-offset: 0px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, outline 0.3s ease;
    overflow: hidden;
    outline: 0px solid var(--card-outline);
    z-index: 1;
    backdrop-filter: blur(8px);
    isolation: isolate;
	transition: all 0.2s ease-out;
}

.project-card:hover {
    transform: scale(1.02) translateY(-1px);
    box-shadow: var(--card-hover-shadow);
    outline: 2px solid var(--card-outline);
    z-index: 2;
}

.project-card:hover .image-container {
  transform: scale(1.05);
}

.reverse {
    flex-direction: row-reverse;
}

.image-container {
    height: 100%;
    width: auto;
    max-width: 45%;
    object-fit: cover;
    justify-content: center;
    align-items: center;
    background: var(--image-container-bg);
    mix-blend-mode: overlay;
	transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.content-container {
    width: 60%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.content-container h2 {
    font-size: 2rem;
    color: var(--content-title-color);
    margin-bottom: 1px;
}

.content-container p {
    font-size: 1.2rem;
    color: var(--content-text-color);
    line-height: 1.5;
}

footer {
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    color: var(--footer-text-color);
    font-size: 0.9rem;
	z-index: 1;
}

footer a {
    color: var(--footer-link-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--footer-link-hover);
    text-decoration: underline;
}

.project-card.no-image {
    outline: 0px solid var(--card-outline);
    justify-content: center;
    padding-top: 5px;
    padding-bottom: 5px;
    height: 100px;
}

.project-card.no-image .content-container {
    width: 100%;
    text-align: center;
    font-size: 90%;
}

.project-card.no-image h2 {
    font-size: 1.6rem;
}

.project-card.no-image p {
    font-size: 1.2rem;
}

.double-section {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.double-section::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 49.9%;
    transform: translateX(-50%);
    background-color: --card-bg;
    border-radius: 30px;
    z-index: -1;
    box-shadow: var(--card-shadow);
    opacity: 0.8;
}

.double-section .project-card {
    margin-bottom: 20px;
}

.double-section .project-card:last-child {
    margin-bottom: 0;
}

.new-label,
.updated-label {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 10px;
    z-index: 10;
    pointer-events: none;

    color: var(--content-title-color);
    background: --primary-bg;
    border: 1px solid var(--content-title-color);

    box-shadow: 0 0 3px rgba(255, 255, 255, 0.3),
                0 0 5px rgba(255, 215, 0, 0.15);
    
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card.reverse .updated-label,
.project-card.reverse .new-label {
    left: 12px;
    right: auto;
}

.project-card:hover .new-label,
.project-card:hover .updated-label {
    transform: scale(1.1) rotate(-1deg);
	
    animation: shimmer 3s infinite ease-in-out;
}

.project-card.reverse:hover .new-label,
.project-card.reverse:hover .updated-label {
    transform: scale(1.1) rotate(1deg);
	
    animation: shimmer 3s infinite ease-in-out;
}

#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 45%;
    background: var(--back-to-top-bg);
    border: 0px solid var(--card-outline);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    z-index: 1000;
}

#back-to-top:hover {
    transform: scale(1.1);
    box-shadow: var(--card-hover-shadow);
    background: var(--back-to-top-hover-bg);
}

#back-to-top:active {
    transform: scale(1.05);
}

#back-to-top.hidden {
    display: none;
}

/* Pingouin */
.penguin-moving {
    animation: jiggle-p 0.2s infinite;
}

#penguin {
    position: absolute;
    opacity: var(--penguin-opacity);
    z-index: 0;
    width: 30px;
    transition: transform 0.5s ease-in-out, left 2s ease-in-out, top 2s ease-in-out;
    z-index: 1;
}

#link-display {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: var(--link-display-bg);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#link-display.visible {
    opacity: 1;
}

#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@media (max-width: 1450px) {
    .content-container {
        padding: 9px;
    }
}

@media (max-width: 1300px) {
    .project-card {
        width: 90%;
        flex-direction: column;
    }
    
    .project-card.no-image .content-container {
        width: 90%;
        padding: 20px;
    }
    
    .image-container {
        width: 100%;
        max-width: none;
    }
    
    .content-container {
        width: 90%;
    }
    
    .double-section::before {
        width: 89.9%;
    }
    
    #back-to-top {
        display: none;
    }

	header {
		margin-top: 100px;
	}
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

::-webkit-scrollbar-horizontal {
    height: 10px;
}

::-webkit-scrollbar-track-horizontal {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb-horizontal {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
}

html {
    scrollbar-width: thin;
}

@supports (--css: variables) {
    ::-webkit-scrollbar {
        display: none;
    }
}

#theme-selector {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 100;
    perspective: 500px;
}

.theme-btn {
    width: 25px;
    height: 25px;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid var(--card-outline);
    box-shadow: 0 0 2px var(--card-outline);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
	opacity: 0.9;
    backdrop-filter: blur(5px);
    transform-style: preserve-3d;
    transition: 
        transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s ease;
    position: relative;
}

.theme-btn:hover::after {
    content: attr(title);
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.theme-btn:hover {
    transform: rotateY(15deg) scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.theme-btn::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 8px;
    background: linear-gradient(
        45deg,
        rgba(255,255,255,0.8),
        rgba(255,255,255,0)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-btn:hover::before {
    opacity: 0.3;
}

.theme-btn:active {
    transform: scale(0.95);
}

.winter { background: linear-gradient(to bottom right, #8a9bff, #212136); }
.spring { background: linear-gradient(to bottom right, #8aff8a, #213622); }
.summer { background: linear-gradient(to bottom right, #ff8a8a, #362121); }
.autumn { background: linear-gradient(to bottom right, #ffaa60, #362a21); }

#background-bushes, 
#background-snowflakes,
#background-flowers, 
#background-leaves {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
}

.search-active #background-bushes,
.search-active #background-snowflakes,
.search-active #background-flowers,
.search-active #background-leaves {
    overflow: hidden;
}

.bush, .flower, .leaf, .snowflake {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    transform-origin: center;
    opacity: 0.3;
    pointer-events: auto;
    width: 50px;
}

.hidden {
    display: none;
}

#search-container {
    position: fixed;
    top: 18.8px;
    right: 20px;
    z-index: 3;
    display: flex;
    flex-direction: column;
}

#search-input {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.2);
    color: white;
    backdrop-filter: blur(5px);
    width: 150px;
    transition: all 0.3s ease;
}

#search-input:focus {
    outline: none;
    background: none;
    width: 200px;
}

#category-filter,
#sort-select {
    margin-top: 5px;
    padding: 8px 12px;
    border: 1px solid var(--card-outline);
    border-radius: 20px;
    background: var(--card-outline);
    color: var(--content-text-color);
    backdrop-filter: blur(5px);
    width: auto;
    cursor: pointer;
    appearance: none;
    transition: all 0.3s ease;
}

#category-filter option,
#sort-select option {
    background: var(--card-outline);
    color: var(--content-text-color);
}

#category-filter:focus,
#sort-select:focus {
    outline: none;
    border-color: var(--content-title-color);
    box-shadow: 0 0 0 2px rgba(138, 155, 255, 0.3);
}

.project-card {
    --shine-angle: 100deg;
    --shine-opacity: 0;
}

.project-card:hover {
    --shine-opacity: 0.3;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        var(--shine-angle),
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,var(--shine-opacity)) 25%,
        rgba(255,255,255,0) 50%
    );
    pointer-events: none;
    transition: opacity 0.6s ease;
    mix-blend-mode: overlay;
}

.reverse {
    --shine-angle: -100deg;
}

.project-card:hover .image-container img {
    animation: dynamicShine 3s infinite linear;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.1) 25%,
        rgba(255,255,255,0) 50%
    );
    background-size: 200% 100%;
}

footer {
    position: relative;
    padding: 2rem 0;
    margin-top: 5rem;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(to right, 
        transparent 0%, 
        var(--footer-text-color) 20%, 
        var(--footer-text-color) 80%, 
        transparent 100%);
}

footer p::before {
    content: '❖';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--footer-link-color);
    font-size: 1.2rem;
    text-shadow: 0 0 10px currentColor;
}

footer a {
    position: relative;
}

.project-card {
    animation: fadeIn 0.6s both;
}

footer {
    animation: fadeIn 2s;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.3s; }

#xp-portfolio-link {
    z-index: 1000;
    width: 30px;
    height: 30px;
	opacity: 0.7;
    transition: 
        transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s ease;
}

#xp-portfolio-link img {
    width: 100%;
    height: auto;
}

#xp-portfolio-link:hover {
	opacity: 0.95;
    transform: rotateY(15deg) scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}