:root {
    --panel: rgba(255, 255, 255, 0.04);
    --panel-border: rgba(255, 255, 255, 0.08);
    --line: rgba(204, 11, 13, 0.25);
    --line-hover: rgba(204, 11, 13, 0.65);
    --card-width: 1200px;
}

/* ===========================================================
GENERAL
==============================================================*/


/* Moving sqares */

.achievements-bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(to right, rgba(30, 30, 30, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(30, 30, 30, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: -1;
}

.achievements-floating-square {
    position: absolute;
    border: 0.1vw solid var(--accent);
    pointer-events: none;
    z-index: -1;
}


/* ==========================================================================
   1. HERO SECTION
   ========================================================================== */

.hero-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3.125rem;
    align-items: center;
}

.hero-title {
    margin-top: 3rem; /* Ajustement pour mobile */
    font-size: 2.5rem; /* Taille de base pour mobile */
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3.75rem;
        margin-top: 5rem;
    }
}

.hero-title h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(30px);
}

.hero-title span {
    color: var(--accent);
}

.hero-content h2 {
    margin-bottom: 4rem;
    margin-top: 0 !important;
}

.hero-content h2::after {
    display: none;
}

.hero-description-container {
    display: grid;
    grid-template-columns: 1fr; /* Base mobile */
    gap: 2rem;
}

@media (min-width: 768px) {
    .hero-description-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

.hero-description-container img {
    max-width: 100%;
    height: auto; /* Base mobile */
    object-fit: cover;
    margin: 0 auto 2rem; /* Marge en bas sur mobile */
    display: block;
}

@media (min-width: 768px) {
    .hero-description-container img {
        height: 100%;
        margin: auto 0;
    }
}

.hero-description {
    font-size: 1.1rem; /* Ajustement pour mobile */
    color: #d1d5db;
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
    .hero-description {
        font-size: 1.25rem;
    }
}

.hero-buttons {
    text-align: left;
}


/* Text Roller */

.hero-animated-line {
    color: var(--text);
    font-family: var(--title-font);
    font-weight: 700;
    font-size: 1.8rem; /* Ajustement pour mobile */
    margin: 3rem 0; /* Ajustement pour mobile */
}

@media (min-width: 768px) {
    .hero-animated-line {
        font-size: 36px;
        margin: 5rem 0;
    }
}

.track {
    display: grid;
    display: inline-block;
    position: relative;
    width: 12ch;
    /* ajuste selon le plus long mot */
    height: 1.2em;
    /* hauteur d’une ligne */
    overflow: hidden;
    /* masque le surplus */
    vertical-align: bottom;
}

/* tous les mots se superposent exactement, un seul visible à la fois */
.track .w {
    position: absolute;
    inset: 0;
    display: inline-block;
    white-space: nowrap;

    color: var(--accent);

    opacity: 0;
    transform: translateY(.45em) rotate(-6deg) scale(.98);
    animation: word 12s ease-in-out infinite both;
    /* 6 mots → 12s */
    animation-delay: calc(var(--i) * 2s);
    /* 2s par mot */
}

/* entre 0%→8% : entrée ; 8%→17% : visible ; 17%→20% : sortie ; pas de chevauchement */
@keyframes word {
    0% {
        opacity: 0;
        transform: translateY(.45em) rotate(-6deg) scale(.98);
    }

    8% {
        opacity: 1;
        transform: translateY(0) rotate(0) scale(1);
    }

    17% {
        opacity: 1;
        transform: translateY(0) rotate(0) scale(1);
    }

    20% {
        opacity: 0;
        transform: translateY(-.45em) rotate(6deg) scale(1.02);
    }

    100% {
        opacity: 0;
        transform: translateY(-.45em) rotate(6deg) scale(1.02);
    }
}

@media (prefers-reduced-motion: reduce) {
    .track .w {
        animation: none;
        opacity: 1;
        transform: none;
    }
}


/* ==========================================================================
   2. MON APPROCHE SECTION
   ========================================================================== */

/* Mon Approche avec SVG */
.approach-section {
    position: relative;
}

.approach-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-top: 40px;
}

.approach-card {
    background: rgba(153, 153, 153, 0.1);
    padding: 30px;
    border-radius: 0.25rem;
    border-left: 4px solid var(--accent);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 25px;
}

.approach-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(204, 11, 13, 0.1));
    transition: width 0.3s ease;
}

.approach-card:hover::before {
    width: 100%;
}

.approach-card:hover {
    transform: translateX(10px);
    background: rgba(153, 153, 153, 0.15);
}

.approach-icon {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    position: relative;
}

.approach-icon svg {
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
}

.approach-card:hover .approach-icon svg {
    transform: scale(1.1);
}

.approach-content h3 {
    font-family: var(--title-font);
    font-weight: 600;
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--accent);
}

.approach-content {
    flex: 1;
    z-index: 2;
    position: relative;
}

/* Animations pour les icônes d'approche */
.icon-analyze .gear {
    animation: rotateGear 8s linear infinite;
    transform-origin: 40px 40px;
}

.icon-analyze .data-point {
    animation: dataFlow 2s ease-in-out infinite;
}

.icon-analyze .data-point:nth-child(4) {
    animation-delay: 0.5s;
}

.icon-analyze .data-point:nth-child(5) {
    animation-delay: 1s;
}

.icon-analyze .data-point:nth-child(6) {
    animation-delay: 1.5s;
}

.icon-design .brush {
    animation: drawStroke 3s ease-in-out infinite;
}

.icon-design .color-drop {
    animation: colorDrop 4s ease-in-out infinite;
}

.icon-design .color-drop:nth-child(3) {
    animation-delay: 1s;
}

.icon-design .color-drop:nth-child(4) {
    animation-delay: 2s;
}

.icon-dev .code-line {
    animation: typeCode 2s ease-in-out infinite;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}

.icon-dev .code-line:nth-child(2) {
    animation-delay: 0.5s;
}

.icon-dev .code-line:nth-child(3) {
    animation-delay: 1s;
}

.icon-dev .code-line:nth-child(4) {
    animation-delay: 1.5s;
}

.icon-dev .terminal-cursor {
    animation: blink 1s linear infinite;
}

@keyframes rotateGear {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes dataFlow {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes drawStroke {
    0% {
        stroke-dashoffset: 100;
    }

    50% {
        stroke-dashoffset: 0;
    }

    100% {
        stroke-dashoffset: -100;
    }
}

@keyframes colorDrop {

    0%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0.7;
    }

    50% {
        transform: translateY(-10px) scale(1.1);
        opacity: 1;
    }
}

@keyframes typeCode {
    0% {
        stroke-dashoffset: 100;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* ==========================================================================
   3. CARTES REALISATIONS
   ========================================================================== */


.achievements-cards-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.5rem;
}


.achievements-card {
    background-color: var(--card-bg);
    border-radius: 0.25rem;
    overflow: hidden;
    /* transition: transform 0.3s ease, box-shadow 0.3s ease; */
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    height: 100%;
    display: flex;
    flex-direction: column;
    /* opacity: 1; */
    /* transform: translateY(0); */
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.achievements-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.achievements-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent), transparent, var(--accent));
    z-index: -1;
    border-radius: 0.25rem;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.achievements-card:hover::before {
    opacity: 0.4;
    animation: borderRotate 3s linear infinite;
}

@keyframes borderRotate {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 300% 0%;
    }
}

.achievements-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
}

.achievements-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    filter: grayscale(30%) contrast(120%);
}

.achievements-card:hover .achievements-card-image img {
    transform: scale(1.05);
    filter: grayscale(0%) contrast(110%);
}

.achievements-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.7));
    z-index: 1;
}

.achievements-card-tech-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    width: 0%;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}

.achievements-card-tech-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: scanEffect 3s ease-in-out infinite;
}

@keyframes scanEffect {
    0% {
        left: -50%;
    }

    100% {
        left: 150%;
    }
}

.achievements-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.achievements-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0.5rem 0;
    color: var(--text);
    position: relative;
    display: inline-block;
}

.achievements-card-type {
    font-size: 0.9rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.achievements-card-type::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 1px;
    background-color: var(--accent);
    margin-right: 8px;
    transition: width 0.3s ease;
}

.achievements-card:hover .achievements-card-type::before {
    width: 30px;
}

.achievements-card-objective {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex-grow: 1;
}

.achievements-card-button {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background-color: transparent;
    color: var(--text);
    border: 1px solid var(--accent);
    border-radius: 0.25rem;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    /* transition: all 0.3s ease; */
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.achievements-card-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: var(--accent);
    transition: all 0.3s ease;
    z-index: -1;
}

.achievements-card-button:hover::before {
    left: 0;
}

.achievements-card-button:hover {
    color: var(--text);
}

@media (min-width: 768px) {
    .achievements-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* ==========================================================================
  4. IMPORTANCE SECTION
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.25rem;
    /* transition: all 0.3s ease; */
}

.stat-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
}

.stat-number {
    font-family: var(--title-font);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}



/* ==========================================================================
   5. CTA SECTION
   ========================================================================== */

.cta-section {
    text-align: center;
    font-size: 2.5rem; /* Taille de base pour mobile */
}

@media (min-width: 768px) {
    .cta-section {
        font-size: 4rem;
    }
}

.cta-title::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Taille ↑ et gris plus sombre */
.cta-accent {
    --cta-accent-size: clamp(2.5rem, 8vw, 3.4rem); /* Ajustement pour mobile */
    --muted-col: #444444;
    /* gris de base + sombre */
    --flash-col: var(--text);
    /* flash blanc */
    --accent-col: var(--accent);
    /* rouge final */

    display: inline-block;
    font-family: var(--title-font);
    font-weight: 800;
    font-size: var(--cta-accent-size);
    line-height: 1.12;
    letter-spacing: .2px;
    white-space: pre-wrap;
    margin: 4rem 0; /* Ajustement pour mobile */
}

@media (min-width: 768px) {
    .cta-accent {
        margin: 8rem 0;
    }
}

/* 3 calques (haut → bas) :
   1) bande de flash blanche, largeur = --flashW (0 hors flash)
   2) overlay rouge qui remplit (largeur = --fill)
   3) base grise pleine (100%)
*/
.cta-wipe .chunk {
    display: inline-block;
    position: relative;
    color: transparent;

    background-image:
        linear-gradient(var(--flash-col), var(--flash-col)),
        /* 1 */
        linear-gradient(var(--accent-col), var(--accent-col)),
        /* 2 */
        linear-gradient(var(--muted-col), var(--muted-col));
    /* 3 */

    background-repeat: no-repeat, no-repeat, no-repeat;

    /* largeur des calques */
    background-size:
        var(--flashW, 0) 100%,
        /* bande flash (0 → 0.28em env.) */
        var(--fill, 0%) 100%,
        /* overlay rouge (0% → 100%) */
        100% 100%;
    /* gris plein */

    /* position : la bande suit le front d’avancement */
    background-position:
        var(--fill, 0%) 0,
        /* bande centrée sur le bord d'avance (ok si bord gauche) */
        0 0,
        0 0;

    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    will-change: background-size, background-position;
}

@media (prefers-reduced-motion: reduce) {
    .cta-wipe .chunk {
        background-image: linear-gradient(var(--accent-col), var(--accent-col));
        background-size: 100% 100%;
        background-position: 0 0;
    }
}



@media (prefers-reduced-motion: reduce) {
    .cta-wipe .chunk {
        background-image: linear-gradient(var(--accent-col), var(--accent-col));
        background-size: 100% 100%;
        background-position: 0 0;
    }
}



/* PRM */
@media (prefers-reduced-motion: reduce) {
    .cta-wipe .chunk {
        background-size: 100% 100% !important;
        transform: none !important;
        opacity: 1 !important;
        animation: none !important;
    }
}



.cta-section p {
    font-size: 1.1rem; /* Ajustement pour mobile */
    max-width: 800px;
}

@media (min-width: 768px) {
    .cta-section p {
        font-size: 1.3rem;
    }
}