/* Inter Variable Font */
@font-face {
    font-family: 'Inter';
    src: url('./assets/fonts/Inter-VariableFont_opsz,wght.ttf') format('truetype-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('./assets/fonts/Inter-Italic-VariableFont_opsz,wght.ttf') format('truetype-variations');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

/* Playfair Display Variable Font */
@font-face {
    font-family: 'Playfair Display';
    src: url('./assets/fonts/PlayfairDisplay-VariableFont_wght.ttf') format('truetype-variations');
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Playfair Display';
    src: url('./assets/fonts/PlayfairDisplay-Italic-VariableFont_wght.ttf') format('truetype-variations');
    font-weight: 400 900;
    font-style: italic;
    font-display: swap;
}

/* Root Variables & Theme Setup */
:root {
    --color-primary: #EFECFD;      /* Lavender */
    --color-secondary: #B2AAFA;    /* Periwinkle */
    --color-accent: #EF6461;       /* Bittersweet */
    --color-white: #FFFFFF;        /* White */
    --color-black: #313638;        /* Onyx */
    --color-true-black: #1A1A1A;   /* Black */

    /* Dark mode colors */
    --dark-white: #FFFFFF;         /* White */
    --dark-lighter-black: #474448; /* Onyx */
    --dark-light-black: #2A3039;   /* Gunmetal */
    --dark-black: #313638;        /* Onyx */
    --dark-true-black: #1A1A1A;   /* Black */
}

/* Dark mode styles */
[data-theme="dark"] {
    --color-primary: var(--dark-light-black);       /* Primary becomes Light Black */
    --color-secondary: var(--dark-lighter-black);   /* Secondary becomes Lighter Black */
    --color-white: var(--dark-true-black);          /* White becomes True Black */
    --color-black: var(--dark-white);               /* Black becomes White */
    --color-true-black: var(--dark-white);          /* True Black becomes White, only used in titles */
}

[data-theme="dark"] img[src="assets/clients/EVD.webp"] {
    content: url("assets/clients/EVD_dark.webp");
}

[data-theme="dark"] img[src="assets/clients/Bensound.webp"] {
    content: url("assets/clients/Bensound_dark.webp");
}

[data-theme="dark"] img[src="assets/tools/MySQL.webp"] {
    content: url("assets/tools/MySQL_dark.webp");
}

[data-theme="dark"] .bg-white {
    background-color: var(--dark-lighter-black) !important;
}

[data-theme="dark"] .bg-primary {
    background-color: var(--dark-light-black) !important;
}

[data-theme="dark"] .contact-panel {
    background-color: var(--dark-light-black) !important;
}

[data-theme="dark"] .contact-panel {
    background-color: var(--dark-light-black) !important;
}

[data-theme="dark"] .service-item {
    background-color: var(--dark-lighter-black) !important;
}

[data-theme="dark"] .text-black {
    color: var(--dark-white) !important;
}

[data-theme="dark"] .text-true_black {
    color: var(--dark-white) !important;
}

[data-theme="dark"] .chevron-icon {
    filter: brightness(0) invert(1) !important;
}

/* Base Styles */
html {
    scroll-behavior: smooth;
}

body.modal-open {
    padding-right: var(--scrollbar-width);
    overflow: hidden;
}

body.modal-open header {
    padding-right: var(--scrollbar-width);
}

/* Text Selection Styles */
::selection {
    background-color: var(--color-accent);
    color: var(--color-white);
}

::-moz-selection {
    background-color: var(--color-accent);
    color: var(--color-white);
}

/* Prevent image selection and dragging */
img {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

/* Prevent link dragging */
a {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

/* Typography - Font Classes */
/* Inter font classes */
.inter-thin { font-family: "Inter", sans-serif; font-optical-sizing: auto; font-weight: 100; font-style: normal; }
.inter-extralight { font-family: "Inter", sans-serif; font-optical-sizing: auto; font-weight: 200; font-style: normal; }
.inter-light { font-family: "Inter", sans-serif; font-optical-sizing: auto; font-weight: 300; font-style: normal; }
.inter-regular { font-family: "Inter", sans-serif; font-optical-sizing: auto; font-weight: 400; font-style: normal; }
.inter-medium { font-family: "Inter", sans-serif; font-optical-sizing: auto; font-weight: 500; font-style: normal; }
.inter-semibold { font-family: "Inter", sans-serif; font-optical-sizing: auto; font-weight: 600; font-style: normal; }
.inter-bold { font-family: "Inter", sans-serif; font-optical-sizing: auto; font-weight: 700; font-style: normal; }
.inter-extrabold { font-family: "Inter", sans-serif; font-optical-sizing: auto; font-weight: 800; font-style: normal; }
.inter-black { font-family: "Inter", sans-serif; font-optical-sizing: auto; font-weight: 900; font-style: normal; }

/* Inter italic variants */
.inter-thin-italic { font-family: "Inter", sans-serif; font-optical-sizing: auto; font-weight: 100; font-style: italic; }
.inter-extralight-italic { font-family: "Inter", sans-serif; font-optical-sizing: auto; font-weight: 200; font-style: italic; }
.inter-light-italic { font-family: "Inter", sans-serif; font-optical-sizing: auto; font-weight: 300; font-style: italic; }
.inter-regular-italic { font-family: "Inter", sans-serif; font-optical-sizing: auto; font-weight: 400; font-style: italic; }
.inter-medium-italic { font-family: "Inter", sans-serif; font-optical-sizing: auto; font-weight: 500; font-style: italic; }
.inter-semibold-italic { font-family: "Inter", sans-serif; font-optical-sizing: auto; font-weight: 600; font-style: italic; }
.inter-bold-italic { font-family: "Inter", sans-serif; font-optical-sizing: auto; font-weight: 700; font-style: italic; }
.inter-extrabold-italic { font-family: "Inter", sans-serif; font-optical-sizing: auto; font-weight: 800; font-style: italic; }
.inter-black-italic { font-family: "Inter", sans-serif; font-optical-sizing: auto; font-weight: 900; font-style: italic; }

/* Playfair Display font classes */
.playfair-regular { font-family: "Playfair Display", serif; font-optical-sizing: auto; font-weight: 400; font-style: normal; }
.playfair-medium { font-family: "Playfair Display", serif; font-optical-sizing: auto; font-weight: 500; font-style: normal; }
.playfair-semibold { font-family: "Playfair Display", serif; font-optical-sizing: auto; font-weight: 600; font-style: normal; }
.playfair-bold { font-family: "Playfair Display", serif; font-optical-sizing: auto; font-weight: 700; font-style: normal; }
.playfair-extrabold { font-family: "Playfair Display", serif; font-optical-sizing: auto; font-weight: 800; font-style: normal; }
.playfair-black { font-family: "Playfair Display", serif; font-optical-sizing: auto; font-weight: 900; font-style: normal; }

/* Playfair Display italic variants */
.playfair-regular-italic { font-family: "Playfair Display", serif; font-optical-sizing: auto; font-weight: 400; font-style: italic; }
.playfair-medium-italic { font-family: "Playfair Display", serif; font-optical-sizing: auto; font-weight: 500; font-style: italic; }
.playfair-semibold-italic { font-family: "Playfair Display", serif; font-optical-sizing: auto; font-weight: 600; font-style: italic; }
.playfair-bold-italic { font-family: "Playfair Display", serif; font-optical-sizing: auto; font-weight: 700; font-style: italic; }
.playfair-extrabold-italic { font-family: "Playfair Display", serif; font-optical-sizing: auto; font-weight: 800; font-style: italic; }
.playfair-black-italic { font-family: "Playfair Display", serif; font-optical-sizing: auto; font-weight: 900; font-style: italic; }

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 50;
}

.header-container {
    position: relative;
    z-index: 60;
    background-color: var(--color-accent);
}

/* Navigation Links */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link.active {
    color: var(--color-white);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-white);
    transform: scaleX(1);
    transition: transform 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-black);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-link:hover::after {
    transform: scaleX(1);
    background-color: var(--color-black);
}

.flag-background {
    background-color: #FFFFFF !important;
}

/* Mobile Menu */
#mobile-menu {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: color-mix(in srgb, var(--color-accent) 85%, white);
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
    padding-top: 76px;
    z-index: 40;
}

#mobile-menu.active {
    transform: translateY(0);
}

#mobile-menu.visible {
    transform: translateY(0);
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
    width: 24px;
    height: 24px;
}

.theme-toggle img {
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity var(--transition-duration) var(--transition-timing);
}

.theme-toggle:hover img {
    filter: brightness(0) saturate(100%) invert(0%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0%) contrast(100%); /* Black */
}

.theme-toggle img[data-theme="light"] {
    opacity: 0;
}

[data-theme="dark"] .theme-toggle img[data-theme="light"] {
    opacity: 1;
}

[data-theme="dark"] .theme-toggle img[data-theme="dark"] {
    opacity: 0;
}

.theme-toggle::after {
    display: none;
}

/* Icons */
.icon-white {
    filter: brightness(0) invert(1);
    transition: filter 0.3s ease;
}

a:hover .icon-white {
    filter: brightness(0) saturate(100%) invert(95%) sepia(31%) saturate(4155%) hue-rotate(180deg) brightness(109%) contrast(98%); /* Primary */
}

.icon-menu {
    filter: brightness(0) invert(1);
}

/* Portfolio Panel specific styles */
#portfolioPanel {
    overflow-y: auto;
    height: 100vh;
}

#portfolioPanel > div {
    height: 100%;
    overflow-y: auto;
    padding-bottom: 2rem;
}

/* Portfolio Panel Images */
@media (max-width: 450px) { /* Not Tailwind Specific Breakpoint */
    #portfolioPanel .service-item .logo {
        max-width: 200px !important;
        height: 50px !important;
    }
}

/* Portfolio Item Collapsible Content */
.chevron-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.service-item.active .chevron-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    padding: 0;
}

.service-item.active .collapsible-content {
    display: flex;
    max-height: 1200px;
    opacity: 1;
    transform: translateY(0);
}

/* Contact Panel */
.contact-panel-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 100;
}

.contact-panel-overlay.active {
    display: block;
}

.contact-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    background: var(--color-white);
    z-index: 101;
    box-shadow: -2px 0 16px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.contact-panel.active {
    transform: translateX(0);
}

.contact-panel-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--color-white);
    border: none;
    font-size: 2rem;
    cursor: pointer;
    z-index: 102;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.contact-panel-close:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.contact-panel-close img {
    filter: brightness(0) saturate(100%) invert(60%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
}

.contact-panel textarea {
    min-height: 3rem;
}

.contact-panel input,
.contact-panel textarea {
    border: 2px solid transparent;
}

.contact-panel input:focus,
.contact-panel textarea:focus {
    outline: none;
    border: 2px solid var(--color-accent);
    box-shadow: 0 0 0 3px rgba(239, 100, 97, 0.1);
    background-color: var(--color-white);
}

/* Dark mode form input styling */
[data-theme="dark"] .contact-panel input,
[data-theme="dark"] .contact-panel textarea {
    background-color: var(--dark-lighter-black) !important;
    color: var(--dark-white) !important;
}

[data-theme="dark"] .contact-panel input:focus,
[data-theme="dark"] .contact-panel textarea:focus {
    background-color: var(--dark-lighter-black) !important;
    color: var(--dark-white) !important;
}

/* Dark mode close button styling */
[data-theme="dark"] .contact-panel-close {
    background: var(--dark-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .contact-panel-close:hover {
    background: #f0f0f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Contact CTA Button */
.contact-cta-btn {
    position: relative;
    overflow: hidden;
}

.contact-cta-bg-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    z-index: 1;
    pointer-events: none;
}

.contact-cta-arrow {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin-right: 0.5rem;
}

.contact-cta-img {
    position: relative;
    z-index: 1;
}

.contact-cta-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background-color: var(--color-accent);
    transition: all 0.5s cubic-bezier(0.4,0,0.2,1);
    z-index: 0;
}

.contact-cta-btn:hover .contact-cta-bg {
    width: 600px;
    height: 600px;
    border-radius: 9999px;
}

.contact-cta-text {
    position: relative;
    z-index: 3;
    width: 100%;
    text-align: center;
    transition: color 0.3s ease;
}

.contact-cta-btn:hover .contact-cta-text {
    color: var(--color-white);
}

.service-item {
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.service-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.service-item.active {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-color: var(--color-accent);
    background-color: var(--color-white);
}

.service-item .logo {
    filter: grayscale(100%);
    transition: filter 0.3s ease;
    object-fit: contain;
}

.service-item img[src="assets/clients/Evoline.webp"], /* Specific filter for Evoline logo in light mode */
.carousel-item img[src="assets/clients/Evoline.webp"] {
    filter: grayscale(100%) brightness(0.4);
}

.service-item:hover .logo,
.service-item.active .logo {
    filter: grayscale(0%);
    transition: filter 0.3s ease;
}

[data-theme="dark"] .service-item img[src="assets/clients/Evoline.webp"], /* Override the Evoline logo filter in dark mode */
[data-theme="dark"] .carousel-item img[src="assets/clients/Evoline.webp"] { 
    filter: grayscale(100%);
}

[data-theme="dark"] .service-item:hover img[src="assets/clients/Evoline.webp"], /* Override the Evoline logo filter in dark mode */
[data-theme="dark"] .service-item.active img[src="assets/clients/Evoline.webp"],
[data-theme="dark"] .carousel-item:hover img[src="assets/clients/Evoline.webp"] {
    filter: grayscale(0%) !important;
    transition: filter 0.3s ease !important;
}

/* Loading Spinner */
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--color-white);
    border-top: 3px solid var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.form-loading .loading-spinner {
    display: inline-block;
}

.form-loading button[type="submit"] {
    opacity: 0.7;
    pointer-events: none;
}

.form-loading input,
.form-loading textarea {
    opacity: 0.7;
    pointer-events: none;
}

/* Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

@-webkit-keyframes pulse {
    from {
      -webkit-transform: scale3d(1, 1, 1);
      transform: scale3d(1, 1, 1);
    }
  
    50% {
      -webkit-transform: scale3d(1.05, 1.05, 1.05);
      transform: scale3d(1.05, 1.05, 1.05);
    }
  
    to {
      -webkit-transform: scale3d(1, 1, 1);
      transform: scale3d(1, 1, 1);
    }
  }
  @keyframes pulse {
    from {
      -webkit-transform: scale3d(1, 1, 1);
      transform: scale3d(1, 1, 1);
    }
  
    50% {
      -webkit-transform: scale3d(1.05, 1.05, 1.05);
      transform: scale3d(1.05, 1.05, 1.05);
    }
  
    to {
      -webkit-transform: scale3d(1, 1, 1);
      transform: scale3d(1, 1, 1);
    }
  }

.hover-pulse:hover {
    animation: pulse ease-in-out 1s infinite;
}

/* Rotating Subtitle Animation */
.rotating-subtitle-container {
    vertical-align: top;
    min-height: 84px; /* text-xl - 3 lines */
}
    /* Fixed height for different screen sizes to prevent layout shift */
    @media (min-width: 460px) { /* text-xl - 2 lines */
        .rotating-subtitle-container {
            min-height: 56px;
        }
    }
    @media (min-width: 600px) { /* text-xl - 1 line */
        .rotating-subtitle-container {
            min-height: 28px;
        }
    }
    @media (min-width: 768px) { /* text-3xl - 2 lines - Tailwind md Breakpoint */
        .rotating-subtitle-container {
            min-height: 72px; 
        }
    }
    @media (min-width: 820px) { /* text-3xl - 1 line */
        .rotating-subtitle-container {
            min-height: 36px;
        }
    }

.rotating-subtitle {
    display: inline-block;
}

.rotating-subtitle .cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: var(--color-accent);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Delay classes for staggered animations */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }

/* Scroll margin for sections */
section[id] {
    scroll-margin-top: 5rem;
}

/* Carousel Styles */
.carousel-container {
    overflow: hidden;
    width: 100%;
    position: relative;
    mask: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    -webkit-mask: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

.carousel-track {
    display: flex;
    gap: 2.5rem;
}
    @media (min-width: 768px) { /* Tailwind md Breakpoint */
        .carousel-track {
            gap: 3.5rem;
        }
    }

.carousel-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 176px; /* 80% du format md */
    height: 104px; /* 80% du format md */
}
    @media (min-width: 768px) { /* Tailwind md Breakpoint */
        .carousel-item {
            width: 220px;
            height: 130px;
        }
    }

.carousel-logo {
    object-fit: contain;
    filter: grayscale(100%) opacity(0.7);
    transition: filter 0.3s ease;
    width: 100%;
    max-width: 240px; /* 80% du format md */
    height: 56px; /* 80% du format md */
}
    @media (min-width: 768px) { /* Tailwind md Breakpoint */
        .carousel-logo {
            max-width: 300px;
            height: 70px;
        }
    }

.carousel-item:hover .carousel-logo {
    filter: grayscale(0%) opacity(1);
}

/* Dark mode carousel styles */
[data-theme="dark"] .carousel-logo {
    filter: grayscale(100%) opacity(0.6);
}

[data-theme="dark"] .carousel-item:hover .carousel-logo {
    filter: grayscale(0%) opacity(1);
}

/* Pause animation on hover */
.carousel-container:hover .carousel-track {
    animation-play-state: paused;
}