﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #0f1117;
    color: #ffffff;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* HERO */

header {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at 30% 30%, #1a1d29, #0f1117);
    text-align: center;
    animation: fadeIn 1.5s ease-in-out;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    font-size: 1.2rem;
    color: #9ca3af;
}

/* HOME LAYOUT TUNING */

body > header {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    height: clamp(520px, 74vh, 760px);
    min-height: 0;
    justify-content: flex-start;
    padding-top: clamp(120px, 19vh, 210px);
    padding-bottom: clamp(42px, 7vh, 86px);
}

body > header::before,
body > header::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(60px);
    z-index: -1;
    pointer-events: none;
}

body > header::before {
    width: min(42vw, 560px);
    height: min(42vw, 560px);
    top: -18%;
    left: -8%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.22), rgba(59, 130, 246, 0));
}

body > header::after {
    width: min(36vw, 460px);
    height: min(36vw, 460px);
    right: -10%;
    bottom: -16%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.18), rgba(139, 92, 246, 0));
}

.hero-actions {
    margin-top: 26px;
    display: flex;
    gap: 12px;
}

.hero-btn {
    display: inline-block;
    text-decoration: none;
    padding: 11px 20px;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.hero-btn:hover {
    transform: translateY(-1px);
}

.hero-btn-primary {
    color: #ffffff;
    border: 1px solid rgba(115, 136, 255, 0.65);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.9), rgba(139, 92, 246, 0.9));
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.28);
}

.hero-btn-primary:hover {
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

.hero-btn-secondary {
    color: #dbe2ef;
    border: 1px solid rgba(59, 130, 246, 0.45);
    background: rgba(59, 130, 246, 0.08);
}

#about,
#projects,
#contact {
    position: relative;
    scroll-margin-top: 84px; /* Compense la navbar fixe sur les ancres */
}

#about,
#projects,
.contact {
    padding: clamp(56px, 8vh, 90px) 10%;
    min-height: auto;
    background: linear-gradient(180deg, rgba(11, 17, 34, 0.26), rgba(11, 17, 34, 0));
}

#about {
    padding-top: clamp(34px, 5vh, 56px);
}

#projects::before,
#contact::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0), rgba(59, 130, 246, 0.4), rgba(139, 92, 246, 0.4), rgba(139, 92, 246, 0));
    opacity: 0.6;
}

/* SECTIONS */

section {
    padding: 120px 10%;
    min-height: 60vh;
}

h2 {
    font-size: 2rem;
    margin-bottom: 40px;
}

/* PROJECT GRID */

.projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.card {
    background: #1a1d29;
    padding: 30px;
    border-radius: 12px;
    transition: 0.3s ease;
    cursor: pointer;
    border: 1px solid #222638;
}

.card:hover {
    transform: translateY(-10px);
    border-color: #3b82f6;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
}

/* CONTACT */

.contact a {
    color: #3b82f6;
    text-decoration: none;
}

footer {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

/* ANIMATION */

.fade-element {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-element.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

section:nth-of-type(1) .fade-element { transition-delay: 0.1s; }
section:nth-of-type(2) .fade-element { transition-delay: 0.2s; }
section:nth-of-type(3) .fade-element { transition-delay: 0.3s; }

/* NAVBAR */

.navbar {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    padding: 20px 10%;
    z-index: 1000;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.navbar.scrolled {
    background: rgba(15, 17, 23, 0.8);
    backdrop-filter: blur(10px);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 600;
    font-size: 1.2rem;
    text-decoration: none;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 400;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #3b82f6;
}


/* PROJECT HERO */

.project-hero {
    position: relative;
    height: 80vh;
    overflow: hidden;
}

.project-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-hero .overlay {
    position: absolute;
    bottom: 20%;
    left: 10%;
    color: white;
}

/* PROJECT SECTIONS */

.project-section,
.project-image,
.project-video,
.project-buttons {
    padding: 120px 10%;
}

.project-image img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.featured-project {
    border: 1px solid #3b82f6;
    background: linear-gradient(145deg, #1a1d29, #151822);
}

.featured-project:hover {
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.25);
}

/* SPLIT LAYOUT */

.project-split {
    display: flex;
    gap: 60px;
    padding: 120px 10%;
    align-items: center;
}

.project-split .text {
    flex: 1;
}

.project-split .image {
    flex: 1;
}

.project-split img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* VIDEO */

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}

.video-wrapper iframe {
    position: absolute;
    width: 100%;
    height: 100%;
}

.project-hero-video {
    position: relative;
    height: 85vh;
    overflow: hidden;
}

.project-hero-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-hero-video .overlay {
    position: absolute;
    bottom: 20%;
    left: 10%;
    color: white;
}

/* BUTTONS */

.btn-primary,
.btn-secondary {
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    margin-right: 20px;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    color: white;
}

.btn-secondary {
    border: 1px solid #3b82f6;
    color: #3b82f6;
}

/* HERO VIDEO */

.project-hero-video {
    position: relative;
    height: 85vh;
    overflow: hidden;
}

.project-hero-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-hero-video .overlay {
    position: absolute;
    bottom: 20%;
    left: 10%;
    color: white;
}

/* CONTAINER */

.project-container {
    max-width: 1100px;
    margin: auto;
}

.project-section {
    padding: 120px 10%;
}

.tech-section {
    background: #131722;
}

.project-block {
    margin-bottom: 60px;
}

.project-block h3 {
    margin-bottom: 15px;
}

/* GALLERY */

.project-gallery {
    padding: 120px 10%;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.gallery-item video {
    width: 100%;
    border-radius: 15px;
}

.gallery-item p {
    margin-top: 10px;
    color: #9ca3af;
}


.mode-toggle {
    position: relative;
    display: flex;
    width: 420px;
    margin: 60px auto;
    background: #1a1d29;
    border-radius: 50px;
    padding: 5px;
}

.toggle-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    z-index: 2;
}

.toggle-slider {
    position: absolute;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 50px;
    transition: transform 0.3s ease;
    z-index: 1;
}

.toggle-btn.active {
    color: white;
}

.project-layout {
    display: flex;
    gap: 60px;
    padding: 0 10%;
}

.project-content {
    flex: 3;
}

.project-sidebar {
    flex: 1;
    position: sticky;
    top: 120px;
    height: fit-content;
}

.hidden {
    display: none;
}

/* Mobile */
@media (max-width: 1000px) {
    .project-layout {
        flex-direction: column;
    }

    .project-sidebar {
        display: none;
    }
}

/* ========================= */
/* TOGGLE PREMIUM ADVANCED */
/* ========================= */

.mode-toggle {
    position: relative;
    display: flex;
    align-items: center;
    width: 460px;
    margin: 80px auto;

    padding: 6px;
    border-radius: 60px;

    background: linear-gradient(
        145deg,
        rgba(255,255,255,0.06),
        rgba(255,255,255,0.02)
    );

    border: 1px solid rgba(139, 92, 246, 0.15);

    box-shadow:
        inset 0 0 20px rgba(139, 92, 246, 0.05),
        0 10px 30px rgba(0,0,0,0.5);

    backdrop-filter: blur(12px);

    overflow: hidden;
}

.toggle-btn {
    flex: 1;
    padding: 14px 0;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: #9ca3af;
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: 
        color 0.3s ease,
        transform 0.15s ease;
}

.toggle-btn:active {
    transform: scale(0.97);
}

.toggle-btn.active {
    color: #ffffff;
}

.toggle-slider {
    position: absolute;
    top: 6px;
    left: 6px;
    width: calc(50% - 6px);
    height: calc(100% - 12px);

    border-radius: 50px;

    background: linear-gradient(
        90deg,
        #3b82f6,
        #8b5cf6
    );

    box-shadow:
        0 0 20px rgba(139, 92, 246, 0.4),
        0 0 40px rgba(59, 130, 246, 0.2),
        0 5px 15px rgba(0,0,0,0.5);

    transition: 
        transform 0.35s cubic-bezier(.4,0,.2,1),
        box-shadow 0.3s ease;
    z-index: 1;
}

/* léger glow supplémentaire quand actif */
.mode-toggle:hover .toggle-slider {
    box-shadow:
        0 0 25px rgba(139, 92, 246, 0.6),
        0 0 50px rgba(59, 130, 246, 0.25),
        0 8px 20px rgba(0,0,0,0.6);
}

.toggle-slider::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0.2),
        rgba(255,255,255,0)
    );
    opacity: 0.4;
}

/* ========================= */
/* SIDEBAR PREMIUM */
/* ========================= */

/* ========================= */
/* PROJECT LAYOUT CLEAN */
/* ========================= */

.project-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: clamp(44px, 5vw, 84px);
    padding: 0 5% 0 9%;
}

.project-layout.mode-switching .project-sidebar {
    opacity: 0.55;
    transform: translateX(6px);
}

.project-content {
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.project-content.mode-transition {
    opacity: 0;
    transform: translateY(12px);
}

.project-sidebar {
    --sidebar-progress-offset: -18px;
    --sidebar-progress-width: 3px;
    position: sticky;
    top: 200px;
    align-self: start;
    opacity: 0.85;
    transition: opacity 0.3s ease, transform 0.25s ease;
    justify-self: end;
}

.project-sidebar:hover {
    opacity: 1;
}

.project-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.sidebar-demo-link {
    display: inline-block;
    margin-top: 18px;
    margin-left: calc(var(--sidebar-progress-offset) + var(--sidebar-progress-width) + 10px);
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.5);
    color: #dbe2ef;
    font-size: 0.82rem;
    text-decoration: none;
    background: rgba(59, 130, 246, 0.08);
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.sidebar-demo-link:hover {
    color: #ffffff;
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.7);
}

.scroll-top-btn {
    position: fixed;
    top: 84px;
    right: 24px;
    z-index: 1100;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.5);
    color: #dbe2ef;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    background: rgba(59, 130, 246, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.scroll-top-btn:hover {
    color: #ffffff;
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.7);
}

.scroll-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.project-sidebar li {
    margin-bottom: 18px;
    position: relative;
    padding: 2px 0;
}

.project-sidebar a {
    text-decoration: none;
    font-size: 0.9rem;
    color: #9ca3af;
    transition: color 0.25s ease, transform 0.25s ease;
    display: inline-block;
}

.project-sidebar a:hover {
    color: white;
}

.project-sidebar a.active {
    color: #ffffff;
    font-weight: 500;
    transform: translateX(5px);
    text-shadow: 0 0 12px rgba(139, 92, 246, 0.35);
}

/* Barre verticale */

.project-sidebar ul::before {
    content: "";
    position: absolute;
    left: var(--sidebar-progress-offset);
    top: 0;
    width: var(--sidebar-progress-width);
    height: 100%;
    background: rgba(255,255,255,0.08);
}

.progress-indicator {
    position: absolute;
    left: var(--sidebar-progress-offset);
    width: var(--sidebar-progress-width);
    height: 40px;
    background: linear-gradient(#3b82f6, #8b5cf6);
    border-radius: 999px;
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.45);
    transition: top 0.28s ease, height 0.28s ease;
}

.project-content {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.project-content.mode-transition {
    opacity: 0;
    transform: translateY(10px);
}

.project-section {
    position: relative;
    border-left: 2px solid transparent;
    padding-left: 22px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.project-section.section-active {
    transform: translateX(6px);
    border-left-color: rgba(59, 130, 246, 0.75);
    background: linear-gradient(
        90deg,
        rgba(59, 130, 246, 0.08) 0%,
        rgba(59, 130, 246, 0) 45%
    );
}

/* ========================= */
/* NIRYO CONTENT TYPOGRAPHY */
/* ========================= */

.project-content .project-section {
    padding: 44px 0 44px 22px;
    max-width: 1200px;
    min-height: auto;
}

.project-content .project-section h2 {
    margin-bottom: 20px;
    font-size: clamp(1.7rem, 2.8vw, 2.25rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.project-content .project-section p {
    margin: 0 0 16px;
    color: #dbe2ef;
    font-size: clamp(1rem, 1.2vw, 1.08rem);
    line-height: 1.78;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
}

.project-content .project-section p strong {
    color: #f3f6ff;
}

.project-content .project-section ul {
    margin: 6px 0 20px 1.35rem;
    padding: 0;
}

.project-content .project-section li {
    margin-bottom: 10px;
    color: #dbe2ef;
    line-height: 1.72;
    text-align: justify;
    text-justify: inter-word;
}

.project-content .project-section p + ul {
    margin-top: 8px;
}

.project-content .project-section ul + p {
    margin-top: 18px;
}

/* Mobile */
@media (max-width: 1300px) {
    .project-layout {
        grid-template-columns: minmax(0, 1fr) 250px;
        gap: clamp(28px, 3.4vw, 52px);
        padding: 0 4.5% 0 8%;
    }

    .project-content .project-section p,
    .project-content .project-section li {
        text-align: left;
        text-justify: auto;
        hyphens: none;
    }
}

@media (max-width: 1000px) {
    .project-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding: 0 7%;
    }

    .project-sidebar {
        display: none;
    }

    .project-content .project-section {
        max-width: none;
        padding: 28px 0 28px 18px;
    }

    .project-content .project-section p,
    .project-content .project-section li {
        text-align: left;
    }

    .scroll-top-btn {
        top: 78px;
        right: 12px;
    }
}

/* ========================= */
/* NIRYO HERO TUNING */
/* ========================= */

.project-hero-video {
    padding: 0;
    min-height: auto;
    width: min(1140px, 90vw);
    margin: 110px auto 26px;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #080b13;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5);
}

.project-hero-video video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
}

.project-hero-video::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(
        to top,
        rgba(5, 8, 16, 0.78) 0%,
        rgba(5, 8, 16, 0.26) 34%,
        rgba(5, 8, 16, 0) 68%
    );
}

.project-hero-video .overlay {
    left: clamp(16px, 3.2vw, 42px);
    bottom: clamp(5px, 3vw, 34px);
    right: auto;
    top: auto;
    z-index: 2;
    max-width: min(46vw, 660px);
    padding: 10px 14px;
    border-radius: 10px;
    background: linear-gradient(
        145deg,
        rgba(12, 16, 29, 0.55),
        rgba(12, 16, 29, 0.2)
    );
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(4px);
}

.project-hero-video .overlay h1 {
    margin: 0 0 4px;
    font-size: clamp(1.7rem, 3.2vw, 2.9rem);
    line-height: 1.08;
    letter-spacing: -0.01em;
    text-wrap: balance;
    text-shadow: 0 5px 24px rgba(0, 0, 0, 0.5);
}

.project-hero-video .overlay p {
    margin: 0;
    font-size: clamp(0.9rem, 1.35vw, 1.02rem);
    color: #d5d9e4;
    line-height: 1.35;
}

.mode-toggle {
    margin: 22px auto 54px;
}

@media (max-width: 900px) {
    body > header {
        height: auto;
        min-height: 58vh;
        padding-top: 112px;
        padding-bottom: 34px;
    }

    #about,
    #projects,
    .contact {
        padding: 44px 8%;
    }

    #about {
        padding-top: 26px;
    }

    .hero-actions {
        margin-top: 20px;
        flex-direction: column;
        width: min(320px, 86vw);
        gap: 10px;
    }

    .hero-btn {
        width: 100%;
        text-align: center;
    }

    .project-hero-video {
        width: min(96vw, 1140px);
        margin: 88px auto 18px;
    }

    .project-hero-video .overlay {
        left: 10px;
        bottom: 10px;
        right: auto;
        top: auto;
        max-width: calc(100% - 20px);
        padding: 12px 14px;
    }

    .mode-toggle {
        width: min(94vw, 460px);
        margin: 16px auto 30px;
    }
}

