/**
 * Quantik Web — Portfolio Christopher Geneste
 * Optimisé performance | accessibilité | responsive | SEO speed 90+
 */

/* =============================================
   VARIABLES & RESET
============================================= */
:root {
    --gold: #ffc451;
    --gold-hover: #ffcd6b;
    --gold-dark: #e6b048;
    --dark: #151515;
    --darker: #0a0a0a;
    --text: #444444;
    --text-light: #848484;
    --white: #ffffff;
    --radius: 6px;
    --shadow: 0 4px 20px rgba(0,0,0,.12);
    --transition: .35s cubic-bezier(.4,0,.2,1);
    /* Matrix colors */
    --m-green: #00ff41;
    --m-green-dim: #00cc33;
    --m-green-dark: #006610;
    --m-head: #c8ffd4;
}

*, *::before, *::after { box-sizing: border-box; }

/* =============================================
   BASE
============================================= */
body {
    font-family: "Open Sans", sans-serif;
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}
a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-hover); }
h1,h2,h3,h4,h5,h6 { font-family: "Raleway", sans-serif; }
img { max-width: 100%; height: auto; }

/* =============================================
   ██  PRELOADER MATRIX  ██
============================================= */

/* Fond noir, plein écran */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity .55s ease, visibility .55s ease;
}
#preloader.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Canvas — occupe tout l'écran derrière le centre */
#matrix-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
}

/* Bloc central : logo + barre + texte */
.loader-center {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Logo avec cercle glow vert */
.loader-logo-wrap {
    width: 140px;
    height: 140px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.loader-logo-wrap::before {
    content: "";
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,255,65,.22) 0%, transparent 70%);
    animation: loader-pulse .9s ease-in-out infinite alternate;
}
@keyframes loader-pulse {
    from { transform: scale(1);    opacity: .5; }
    to   { transform: scale(1.15); opacity: 1;  }
}

.loader-logo {
    position: relative;
    z-index: 1;
    width: 118px;
    height: 118px;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(0,255,65,.55));
    animation: loader-logo-in .45s .15s ease both;
}
@keyframes loader-logo-in {
    from { opacity: 0; transform: scale(.75); }
    to   { opacity: 1; transform: scale(1);   }
}

/* Barre de progression neon */
.loader-bar-track {
    width: 240px;
    height: 3px;
    background: #1a1a1a;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}
.loader-bar-track::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid var(--m-green-dark);
    border-radius: 2px;
    pointer-events: none;
    z-index: 1;
}
.loader-bar {
    width: 0%;
    height: 100%;
    background: var(--m-green);
    box-shadow: 0 0 6px var(--m-green), 0 0 16px var(--m-green-dim);
    border-radius: 2px;
    transition: width .07s linear;
}

/* Texte terminal avec blink */
.loader-text {
    font-family: "Courier New", monospace;
    font-size: 13px;
    color: var(--m-green);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    animation: loader-blink 1s step-end infinite;
}
@keyframes loader-blink {
    0%, 100% { opacity: 1;   }
    50%      { opacity: .25; }
}

/* =============================================
   BACK TO TOP
============================================= */
.back-to-top {
    position: fixed;
    visibility: hidden;
    opacity: 0;
    right: 20px; bottom: 20px;
    z-index: 996;
    background: var(--gold);
    width: 42px; height: 42px;
    border-radius: var(--radius);
    transition: all var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.back-to-top i { font-size: 28px; color: var(--dark); line-height: 0; }
.back-to-top:hover { background: var(--dark); }
.back-to-top:hover i { color: var(--gold); }
.back-to-top.active { visibility: visible; opacity: 1; }

/* =============================================
   HEADER / NAV
============================================= */
#header { transition: all var(--transition); z-index: 997; padding: 18px 0; }
#header.header-scrolled {
    background: rgba(0,0,0,.88);
    backdrop-filter: blur(6px);
    padding: 10px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
#header .logo { font-size: 28px; margin: 0; line-height: 1; font-weight: 700; letter-spacing: 1px; }
#header .logo a { color: var(--white); }
#header .logo a span { color: var(--gold); }

.get-started-btn {
    color: var(--white); border-radius: var(--radius);
    padding: 8px 26px; white-space: nowrap;
    font-size: 14px; font-weight: 600;
    display: inline-block;
    border: 2px solid var(--gold);
    transition: all var(--transition);
}
.get-started-btn:hover { background: var(--gold); color: var(--dark); }
@media (max-width:992px) { .get-started-btn { padding: 8px 18px; margin-right: 12px; } }

/* Nav desktop */
.navbar { padding: 0; }
.navbar ul { margin: 0; padding: 0; display: flex; list-style: none; align-items: center; }
.navbar li { position: relative; }
.navbar a, .navbar a:focus {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0 10px 28px;
    font-size: 15px; font-weight: 600;
    color: var(--white); white-space: nowrap;
    transition: color var(--transition);
}
.navbar a:hover, .navbar .active, .navbar .active:focus, .navbar li:hover>a { color: var(--gold); }

.mobile-nav-toggle { color: var(--white); font-size: 28px; cursor: pointer; display: none; }
@media (max-width:991px) {
    .mobile-nav-toggle { display: block; }
    .navbar ul { display: none; }
}

/* Nav mobile overlay */
.navbar-mobile { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 999; transition: .3s; }
.navbar-mobile .mobile-nav-toggle { position: absolute; top: 15px; right: 15px; }
.navbar-mobile ul {
    display: block; position: absolute;
    top: 55px; right: 15px; bottom: 15px; left: 15px;
    padding: 10px 0; background: var(--white); overflow-y: auto;
}
.navbar-mobile a, .navbar-mobile a:focus { padding: 12px 20px; font-size: 15px; color: var(--dark); }
.navbar-mobile a:hover, .navbar-mobile .active { color: var(--dark); background: var(--gold); }

/* =============================================
   HERO
============================================= */
#hero {
    width: 100%; min-height: 100vh;
    background: url("hero-bg.jpg") top center / cover no-repeat;
    position: relative;
}
#hero::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.6); }
#hero .container { position: relative; padding-top: 74px; text-align: center; }
#hero h1 {
    margin: 0; font-size: clamp(32px,6vw,58px);
    font-weight: 700; line-height: 1.15;
    color: var(--white); font-family: "Poppins", sans-serif;
}
#hero h1 span { color: var(--gold); }
#hero h2 { color: rgba(255,255,255,.85); margin: 12px 0 0; font-size: clamp(18px,3vw,24px); font-weight: 300; }

.hero-buttons { margin-top: 30px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-hero-primary {
    background: var(--gold); color: var(--dark);
    padding: 12px 30px; border-radius: var(--radius);
    font-weight: 700; font-size: 15px;
    transition: all var(--transition);
}
.btn-hero-primary:hover { background: var(--gold-hover); color: var(--dark); transform: translateY(-2px); }
.btn-hero-secondary {
    background: transparent; color: var(--white);
    padding: 12px 30px; border-radius: var(--radius);
    font-weight: 600; font-size: 15px;
    border: 2px solid var(--white);
    transition: all var(--transition);
}
.btn-hero-secondary:hover { background: var(--white); color: var(--dark); }
@media (min-width:1024px) { #hero { background-attachment: fixed; } }

/* =============================================
   SECTIONS
============================================= */
section { padding: 70px 0; overflow: hidden; }

.section-title { padding-bottom: 36px; }
.section-title h2 {
    font-size: 13px; font-weight: 500; padding: 0; line-height: 1;
    margin: 0 0 6px; letter-spacing: 2.5px; text-transform: uppercase;
    color: #aaa; font-family: "Poppins", sans-serif;
}
.section-title h2::after {
    content: ""; width: 100px; height: 2px;
    display: inline-block; background: var(--gold); margin: 0 10px;
}
.section-title p {
    margin: 0; font-size: 34px; font-weight: 700;
    text-transform: uppercase; font-family: "Poppins", sans-serif; color: var(--dark);
}

/* =============================================
   ABOUT
============================================= */
.about .content h3 { font-weight: 700; font-size: 26px; font-family: "Poppins",sans-serif; margin-bottom: 16px; }
.about .content ul { list-style: none; padding: 0; }
.about .content ul li { padding: 6px 0 6px 28px; position: relative; }
.about .content ul i { position: absolute; left: 0; top: 1px; font-size: 20px; color: var(--gold); }
.about .content p:last-of-type { margin-bottom: 0; }

.about-photo-wrapper { position: relative; display: inline-block; max-width: 320px; width: 100%; }
.about-photo {
    border-radius: 50%; width: 100%; max-width: 280px;
    border: 6px solid var(--gold);
    box-shadow: 0 8px 30px rgba(0,0,0,.15);
    transition: transform var(--transition);
}
.about-photo:hover { transform: scale(1.03); }

.about-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-about-link {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 20px; border-radius: var(--radius);
    border: 2px solid var(--gold); color: var(--gold);
    font-weight: 600; font-size: 14px;
    transition: all var(--transition);
}
.btn-about-link:hover { background: var(--gold); color: var(--dark); }
.btn-about-link i { font-size: 18px; }

/* =============================================
   FEATURES
============================================= */
.features { padding-top: 30px; }
.features .icon-box { padding-left: 15px; }
.features .icon-box h4 { font-size: 19px; font-weight: 700; margin: 6px 0 10px 62px; color: var(--dark); }
.features .icon-box i { font-size: 44px; float: left; color: var(--gold); line-height: 1.2; }
.features .icon-box p { font-size: 14px; color: var(--text-light); margin-left: 62px; line-height: 1.7; }
.features .image {
    background-position: center; background-repeat: no-repeat; background-size: cover;
    min-height: 420px; border-radius: var(--radius);
}

/* =============================================
   CTA
============================================= */
.cta {
    background: linear-gradient(rgba(2,2,2,.55),rgba(0,0,0,.55)), url("cta-bg.jpg") fixed center / cover;
    padding: 70px 0;
}
.cta h3 { color: var(--white); font-size: 30px; font-weight: 700; }
.cta p { color: rgba(255,255,255,.85); max-width: 680px; margin: 0 auto 20px; }
.cta .cta-btn {
    font-family: "Raleway",sans-serif; font-weight: 600; font-size: 16px;
    letter-spacing: 1px; display: inline-block;
    padding: 10px 30px; border-radius: var(--radius);
    border: 2px solid var(--white); color: var(--white);
    transition: all var(--transition);
}
.cta .cta-btn:hover { background: var(--gold); border-color: var(--gold); color: var(--dark); }

/* =============================================
   SKILLS
============================================= */
.skills { background: #f8f9fa; }
.skills .section-title p { color: var(--dark); }

.skills-image { padding: 0; min-height: 480px; display: flex; align-items: stretch; }
.skills-img-wrapper { width: 100%; height: 100%; min-height: 420px; overflow: hidden; border-radius: var(--radius); }
.skills-img-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.skills-img-wrapper:hover img { transform: scale(1.04); }

.skills-content { padding: 40px 0 40px 50px; display: flex; flex-direction: column; justify-content: center; }
.skills-grid { display: flex; flex-direction: column; gap: 18px; }
.skill-item { width: 100%; }
.skill-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.skill-name { font-size: 15px; font-weight: 600; color: var(--dark); font-family: "Raleway",sans-serif; display: flex; align-items: center; gap: 9px; }
.skill-name i { color: var(--gold); font-size: 20px; }
.skill-percent { font-size: 13px; font-weight: 700; color: var(--gold); font-family: "Poppins",sans-serif; }

.skill-bar { width: 100%; height: 7px; background: #dce1e6; border-radius: 4px; overflow: hidden; }
.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold));
    border-radius: 4px;
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 1s cubic-bezier(.4,0,.2,1);
}
/* Activé par JS via IntersectionObserver */
.skill-progress.animate { transform: scaleX(1); }

/* =============================================
   CONTACT
============================================= */
.contact .info { width: 100%; }
.contact .info i {
    font-size: 20px; background: var(--gold); color: var(--dark);
    float: left; width: 44px; height: 44px;
    display: flex; justify-content: center; align-items: center;
    border-radius: var(--radius);
}
.contact .info h4 { padding: 0 0 0 60px; font-size: 20px; font-weight: 600; margin-bottom: 4px; color: var(--dark); }
.contact .info p { padding: 0 0 0 60px; margin-bottom: 0; font-size: 14px; color: #484848; }
.contact .info p a { color: var(--gold); }
.contact .info .email, .contact .info .phone { margin-top: 36px; }

.contact .php-email-form { width: 100%; }
.contact .php-email-form .form-group { padding-bottom: 8px; }

.contact .php-email-form .error-message {
    display: none; color: var(--white); background: #ed3c0d;
    text-align: left; padding: 14px; font-weight: 600; border-radius: var(--radius);
}
.contact .php-email-form .sent-message {
    display: none; color: var(--white); background: #18d26e;
    text-align: center; padding: 14px; font-weight: 600; border-radius: var(--radius);
}
.contact .php-email-form .loading {
    display: none; background: var(--white); text-align: center; padding: 14px;
}
.contact .php-email-form .loading::before {
    content: ""; display: inline-block; border-radius: 50%;
    width: 22px; height: 22px; margin: 0 10px -5px 0;
    border: 3px solid #18d26e; border-top-color: #eee;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.contact .php-email-form input,
.contact .php-email-form textarea {
    box-shadow: none; font-size: 14px;
    border-radius: var(--radius); border: 1px solid #dee2e6;
    transition: border-color var(--transition);
}
.contact .php-email-form input:focus,
.contact .php-email-form textarea:focus { border-color: var(--gold); outline: none; }
.contact .php-email-form input { height: 44px; }
.contact .php-email-form textarea { padding: 10px 12px; }

.contact .php-email-form button[type="submit"] {
    background: var(--gold); border: 0;
    padding: 10px 28px; color: var(--dark);
    font-weight: 700; font-size: 15px;
    border-radius: var(--radius); cursor: pointer;
    transition: all var(--transition);
}
.contact .php-email-form button[type="submit"]:hover { background: var(--gold-hover); transform: translateY(-2px); }

/* =============================================
   FOOTER
============================================= */
#footer { background: #000; padding: 0 0 28px; color: var(--white); font-size: 14px; }
#footer .footer-top { background: var(--dark); border-bottom: 1px solid #222; padding: 56px 0 30px; }

#footer .footer-top .footer-info h3 { font-size: 26px; margin: 0 0 18px; font-weight: 700; text-transform: uppercase; }
#footer .footer-top .footer-info h3 span { color: var(--gold); }
#footer .footer-top .footer-info p { font-size: 14px; line-height: 1.8; color: #ccc; font-family: "Raleway",sans-serif; }
#footer .footer-top .footer-info p a { color: var(--gold); }

/* Ligne des icônes sociales + logo Quantik */
#footer .footer-top .social-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Icônes LinkedIn / GitHub */
#footer .footer-top .social-links > a {
    font-size: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #292929; color: var(--white);
    width: 38px; height: 38px;
    border-radius: var(--radius);
    transition: all var(--transition);
}
#footer .footer-top .social-links > a:hover { background: var(--gold); color: var(--dark); }

/* Logo Quantik miniature (même taille que les icônes sociales) */
.footer-logo-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    background: #292929;
    border-radius: var(--radius);
    padding: 5px;
    transition: background var(--transition);
}
.footer-logo-link:hover { background: var(--gold); }

.footer-social-logo {
    width: 26px; height: 26px;
    object-fit: contain;
    border-radius: 4px;
    /* Rendre le logo visible sur fond sombre */
    filter: brightness(0) invert(1);
    transition: filter var(--transition);
}
.footer-logo-link:hover .footer-social-logo { filter: none; }

/* Footer links */
#footer .footer-top .footer-links h4 { font-size: 16px; font-weight: 600; color: var(--white); padding-bottom: 14px; }
#footer .footer-top .footer-links ul { list-style: none; padding: 0; margin: 0; }
#footer .footer-top .footer-links ul li { padding: 8px 0; display: flex; align-items: center; }
#footer .footer-top .footer-links ul i { color: var(--gold); font-size: 18px; padding-right: 4px; }
#footer .footer-top .footer-links ul a { color: #ccc; transition: color var(--transition); }
#footer .footer-top .footer-links ul a:hover { color: var(--gold); }

/* Footer brand (grand logo bas) */
.footer-brand h4 { font-size: 16px; font-weight: 600; color: var(--white); padding-bottom: 14px; }
.footer-logo { max-width: 160px; border-radius: var(--radius); margin-bottom: 14px; }
.footer-tagline { font-size: 14px; color: #999; font-style: italic; }

/* Copyright */
#footer .copyright { text-align: center; padding-top: 28px; color: #888; }
#footer .copyright strong span { color: var(--gold); }

/* =============================================
   RESPONSIVE
============================================= */
@media (max-width:991px) {
    .skills-content { padding: 40px 0 0; }
    .skills-image { min-height: 300px; }
}
@media (max-width:768px) {
    section { padding: 50px 0; }
    .section-title p { font-size: 26px; }
    .about-photo { max-width: 220px; }
    .skills-img-wrapper { min-height: 280px; }
    .features .image { min-height: 280px; }
}
@media screen and (max-width:768px) {
    [data-aos-delay] { transition-delay: 0 !important; }
}