/* Système de préchargement */
html.preload * {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
}

html.preload body {
    visibility: hidden !important;
    opacity: 0 !important;
}

html body {
    visibility: visible;
    opacity: 1;
}

/* Loading indicator */
html.preload::after {
    content: 'LOADING SYSTEM...';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00f0ff;
    font-family: monospace;
    font-size: 1.5rem;
    font-weight: bold;
    z-index: 99999;
    animation: blink 1s infinite;
    text-shadow: 0 0 10px #00f0ff;
}

/* --- VARIABLES & BASE --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}
body::before, body::after {
    position: fixed;
    pointer-events: none;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    animation: fadeInOnly 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInOnly {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes pageLoad {
    0% { opacity: 0; transform: translateY(10px); filter: blur(2px); }
    100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* --- LAYOUT --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 10;
    animation: pageLoad 0.5s ease-out forwards;
    animation-delay: 0.1s;
    opacity: 0;
}
.grid-system {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
}

@media (max-width: 850px) {  .grid-system { grid-template-columns: 1fr; }}
main { height: 100%; }

/* --- HEADER --- */
header {
    border-bottom: 2px solid var(--color1);
    margin-bottom: 40px;
    padding-bottom: 20px;
}
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
    border-bottom: 1px dotted var(--border-color);
    padding-bottom: 10px;
}

.theme-btn{
    font-size: 0.75rem;
    padding: 6px 12px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;

    box-sizing: border-box;
    height: 32px;
    line-height: 1;
}
.theme-btn:hover{
    box-shadow: 0 0 10px var(--color1);
}

.wired-status { color: var(--color2); font-size: 0.8em; letter-spacing: 2px; }
.blink { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

h1 {
    font-size: 3.5rem;
    line-height: 1;
    margin: 10px 0;
    position: relative;
}

.subtitle {
    margin: 0 auto;
    min-height: 1.5em;
}
.typing-cursor::after {
    content: '';
    display: inline-block;
    margin-left: 5px;
}

/* --- NAVIGATION MENU --- */
.nav-menu {
    margin-top: 30px;
    border-top: 1px dashed #333;
    padding-top: 20px;
}
.nav-link {
    display: block;
    padding: 12px 15px;
    margin-bottom: 10px;
    text-decoration: none;
    transition: 0.3s;
    position: relative;
}
.nav-link:hover {
    border-left-color: var(--color1);
}
.nav-link.active {
    border-left-color: var(--color2);
}
.nav-link.active::after {
    position: absolute;
}

/* --- PORTRAIT --- */
.portrait-frame {
    width: 100%;
    height: 300px;
    position: relative;
    margin-bottom: 30px;
}
.portrait-frame::after {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    box-shadow: inset 0 0 20px rgba(0, 240, 255, 0.2); pointer-events: none;
}
.portrait-img {
    object-fit: cover;
    transition: 0.5s ease;
}

/* --- CARDS & SECTIONS --- */
.card {
    background: var(--panel-bg);
    padding: 20px;
    margin-bottom: 30px;
    position: relative;
}
.card::before {
    content: '';
    position: absolute;
    z-index: 5;
}
.card h2 {
    border-bottom: 1px dashed var(--color3);
    padding-bottom: 5px; margin-bottom: 20px;
}

.red-glow {color: var(--color2); border-color: var(--color2); }
.red-glow h2 {color: var(--color2);border-color: var(--color2); }

/* --- DETAILS --- */
.contact-info p {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: nowrap;
}
.contact-info span {
    min-width: auto;
    width: 7ch;
    color: var(--color1);
    font-weight: bold;
    flex-shrink: 0;
    margin-right: 5px;
}

.contact-info a, .contact-info {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted transparent;
    text-align: left;
}
.contact-info a:hover {
    color: var(--color3);
    text-decoration: underline;
}

.skill-tag {
    display: inline-block;
}

.highlight-text { font-size: 1.1rem; margin-bottom: 15px; }

.timeline-item {
    margin-bottom: 25px;
    position: relative;
}
.timeline-item h3 {margin: 2px 0; }
.timeline-item::before {
    position: absolute;
}
.timeline-desc {
    margin-top: 10px;
    font-size: 0.9em;
}
.time-date { color: var(--color3); font-size: 0.85rem; display: block; }
.place { font-style: italic; color: #777; font-size: 0.9rem; }

/* --- JOBS --- */
.job-item { margin-bottom: 30px; }
.job-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
}
.job-header h3 { font-size: 1.1rem; }
.company { color: var(--color2); font-weight: bold; }
.job-date {
    font-size: 0.8rem;
    margin-bottom: 10px;
    display: inline-block;
}
.job-details { list-style: square; padding-left: 20px;}
.job-details li { margin-bottom: 5px; }

/* --- PROJECTS --- */
.project-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px;
}
.project-card {
    background: rgba(255,255,255,0.03); border: 1px solid #333;
    padding: 15px; transition: 0.3s;
}
.project-card img{
    width: 100%; height: 150px;
    object-fit: cover;
    border-bottom: 1px solid #333;
}
.project-card>div>span{
    height: 150px;
    width: 100%;
    background: #222;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
}
.project-card:hover { border-color: var(--color1); transform: translateY(-3px); }
.project-card h3 { color: var(--color1); font-size: 1rem; margin-bottom: 5px; }

/* --- FOOTER --- */
footer {
    text-align: center;
    margin-top: 50px;
    font-size: 0.8rem;
    padding-bottom: 20px;
    border-top: 1px solid #222;
    padding-top: 20px;
}


/* --- RESPONSIVE --- */
@media screen and (max-width: 1400px) {
    body::before, body::after { display: none !important; }
}

@media screen and (max-width: 900px) {

    /* 1. GRILLE & STRUCTURE */
    .grid-system {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    header { text-align: center; margin-bottom: 30px; }

    .top-bar {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
    }

    /* 2. PORTRAIT FLUIDE */
    aside {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .portrait-frame {
        width: 40vw;
        height: auto;
        aspect-ratio: 1 / 1;

        min-width: 200px;
        max-width: 350px;
    }

    /* 3. MENU & NAVIGATION */
    .nav-menu {
        width: 100%;
        max-width: 400px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .nav-link {
        text-align: center;
        padding-left: 0 !important;
    }
    .nav-link:hover { padding-left: 0; }

    /* 4. TEXTES & TITRES */
    h1 {
        font-size: clamp(2rem, 5vw, 3.5rem);
        line-height: 1.2;
    }

    /* 5. CONTACT & CONTENU */
    .contact-info {
        width: 100%;
        max-width: 350px;
        margin: 0 auto;
    }
    main { width: 100%; }
    .project-grid { grid-template-columns: 1fr; }
    .timeline-item { margin-left: 10px; padding-right: 0; }
    .job-header { flex-direction: column; align-items: flex-start; gap: 5px; }
}

@media screen and (max-width: 500px) {

    .portrait-frame {
        width: 60vw;
    }
    h1 { font-size: 1.8rem; }
    .contact-info p {
        flex-wrap: wrap;
    }
}













