:root {
    --bg: #050505;
    --card-gray: #0f0f0f;
    --border: #222222;
    --accent: #3b82f6;
    --text: #ffffff;
    --text-dim: #71717a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, sans-serif;
    display: flex;
    justify-content: center;
    padding: 20px;
    min-height: 100vh;
}
h1, h2, h3, h4, h5, h6 {
    margin-top: 10px;
}

.bento-item {
    border-radius: 24px;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 1100px;
    width: 100%;
}

/* --- LOGIQUE FLIP ROBUSTE --- */
.flip-card {
    perspective: 1200px;
    cursor: pointer;
    min-height: 250px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

/* On cache les éléments opposés pendant la rotation pour éviter les "fantômes" */
.flip-card.is-flipped .card-inner { transform: rotateY(180deg); }
.flip-card.is-flipped .card-front { opacity: 0; pointer-events: none; }
.flip-card:not(.is-flipped) .card-back { opacity: 0; pointer-events: none; }

.card-front, .card-back {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 24px;
    padding: 14px;
    transition: opacity 0.3s ease;
    overflow: auto;
}

.card-front {
    background: transparent;
    border: 1px solid var(--border);
}

.card-back {
    background-color: var(--card-gray);
    border: 2px solid var(--accent);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    padding: 14px;
    overflow: hidden;
}

.card-back h3 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.card-back p {
    font-size: 0.9rem;
    margin-top: 5px;
    line-height: 1.4;
    overflow-y: auto;
    margin-bottom: 30px;
}
.card-back p::-webkit-scrollbar { width: 3px; }
.card-back p::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }
/* ---------------------------- */


.skill-container {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 5px;
}

.skill-val {
    color: var(--accent);
}

.skill-bar {
    display: flex;
    gap: 3px;
    height: 8px;
}

.segment {
    flex: 1;
    background: var(--border);
    border-radius: 1px;
    transition: background 0.5s ease;
}

/* On allumera les segments via le JS ou via des sélecteurs CSS complexes */
/* Ici, on définit les classes pour l'animation */
.segment.active {
    background: var(--accent);
    box-shadow: 0 0 5px var(--accent);
}

/* Grid Spans */
.hero { grid-column: span 2; }
.available { grid-column: span 1; }
.tech { grid-column: span 1; }
.principles { grid-column: span 1; }
.projects {
    grid-column: span 3;
    border: 1px solid var(--border);
    padding: 14px;
    overflow: hidden;
    position: relative; /* Référence pour les dots en absolute */
    display: flex;
    flex-direction: column;
}

.contact { grid-column: span 3; border: 1px solid var(--border); padding: 0; overflow: hidden; min-height: 100px;}
/* Ajustement de la grille */
.cv-block.span-1 { grid-column: span 1; }

.cv-block {
    text-decoration: none;
    background: linear-gradient(135deg, #0f0f0f 0%, #050505 100%);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    min-height: 120px;
}

.cv-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.cv-icon {
    font-size: 2rem;
    color: var(--accent);
    position: relative;
    margin-bottom: 5px;
}

/* Effet de scan laser sur l'icône */
.scan-line {
    position: absolute;
    top: 0; left: -10%;
    width: 120%;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    animation: scan 2s linear infinite;
    opacity: 0.5;
}

@keyframes scan {
    0% { top: 0%; }
    100% { top: 100%; }
}

.cv-text {
    font-family: monospace;
    font-weight: bold;
    font-size: 0.8rem;
    color: var(--text);
}

.cv-size {
    font-family: monospace;
    font-size: 0.6rem;
    color: var(--text-dim);
}

/* Barre de progression interactive */
.download-bar {
    width: 60%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.bar-progress {
    width: 0%;
    height: 100%;
    background: var(--accent);
    transition: width 0.4s ease;
}

/* --- EFFETS AU SURVOL --- */
.cv-block:hover {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-5px);
}

.cv-block:hover .bar-progress {
    width: 100%;
}

.cv-block:hover .cv-icon {
    transform: scale(1.1);
    text-shadow: 0 0 15px var(--accent);
}

.tech .tech-list{
    margin-top: -15px;
}
/* Contenu */
.status-code { font-family: monospace; color: #10b981; background: rgba(16, 185, 129, 0.1); padding: 4px 10px; border-radius: 6px; font-size: 0.8rem; width: fit-content; }
h1 { font-size: 2.5rem; line-height: 1.1; }
h1 span { color: var(--accent); }
.pill { background: #18181b; border: 1px solid var(--border); padding: 5px 12px; border-radius: 12px; font-size: 0.75rem; font-family: monospace; margin: 2px; margin-top: 10px;display: inline-block; }
.pill:hover { border: 1px solid var(--accent); }
.cmd { color: var(--accent); font-weight: bold; }
ul { list-style: none; margin-top: 10px; padding: 0; }
li { font-family: monospace; color: var(--text-dim); margin-bottom: 8px; font-size: 0.9rem; }
p { font-size: 0.9rem; color: var(--text-dim); line-height: 1.5; margin-top: 10px; }

/* Carousel */
.carousel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
#prev, #next { cursor: pointer; color: var(--accent); font-family: monospace; padding: 5px; font-size: 1.2rem; }
.carousel-container { overflow: hidden; }
.carousel-track { display: flex; transition: 0.5s ease; }
.project-slide { min-width: 100%; margin-bottom: 3px;}
.project-slide h4 { color: var(--accent); margin-bottom: 5px; }
.tag { font-size: 0.7rem; color: var(--text); font-family: monospace; border: 1px solid var(--text); padding: 2px 6px; border-radius: 4px; }

/* Navigation Dots */
.carousel-dots {
    position: absolute;
    bottom: 20px;
    display: flex;
    align-self: center;
    gap: 15px;
}
.dot-item { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: all 0.3s ease; cursor: pointer; }
.dot-item.active { background: var(--accent); transform: scale(1.3); box-shadow: 0 0 8px var(--accent); }

/* Terminal */
.terminal-header { background: #111; padding: 10px 15px; display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.dot { height: 10px; width: 10px; border-radius: 50%; margin-right: 6px; }
.red { background: #ff5f56; } .orange { background: #ffbd2e; } .green { background: #27c93f; }
.terminal-title { font-family: monospace; font-size: 0.7rem; color: var(--text-dim); margin-left: 10px; }
.terminal-body { padding: 24px; font-family: monospace; }
.prompt { color: #10b981; }
.contact-links { display: flex; gap: 15px; margin-top: 25px; flex-wrap: wrap; }
.contact-links a { color: var(--text); text-decoration: none; border: 1px solid var(--border); padding: 10px 18px; border-radius: 12px; font-size: 0.85rem; }
.contact-links a:hover { border-color: var(--accent); background: rgba(59, 130, 246, 0.05); }

/* Buttons & Hints */
.click-hint { position: absolute; bottom: 20px; right: 20px; font-size: 0.65rem; color: var(--accent); font-family: monospace; text-transform: uppercase; }
.back-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: var(--card-gray); /* Fond opaque pour couper le texte si besoin */
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.65rem;
    font-family: monospace;
    z-index: 10;
}
.blink { animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 768px) {
    .bento-grid { grid-template-columns: 1fr; }
    .contact.span-3, .cv-block.span-1 { grid-column: span 1; }
    .hero, .tech, .availability, .principles, .contact { grid-column: span 1; min-height: 300px;}
    .projects { grid-column: span 1; min-height: 450px;}
}
