/* ─── FONTS CUSTOM ─── */
@font-face {
    font-family: 'Cakra';
    src: url('fonts/Cakra-Normal.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'FlorDeRuina Flor';
    src: url('fonts/FlorDeRuina-Flor.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'FlorDeRuina Semilla';
    src: url('fonts/FlorDeRuina-Semilla.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─── CURSEUR CUSTOM ─── */
*,
*::before,
*::after {
    cursor: none !important;
}

#cursor {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--blue);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
    will-change: left, top;
}

.click-dot {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
}

.click-dot.fading {
    animation: dot-fade 5s ease-out forwards;
}

@keyframes dot-fade {
    0% {
        opacity: 1;
    }

    60% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

:root {
    --navy: #0F1F5E;
    --blue: #4561D4;
    --orange: #E7A23C;
    --grid-line: rgba(217, 217, 217, 0.45);
}

body {
    background: #fff;
    font-family: 'Source Code Pro', monospace;
    color: var(--navy);
    animation: pageFadeIn 2.3s ease forwards;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.page {
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
}

#grid-canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 0;
}

.page>*:not(#grid-canvas) {
    position: relative;
    z-index: 1;
}

/* ─── NAV ─── */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 48px;
}

nav a {
    font-size: 20px;
    font-weight: 200;
    color: var(--navy);
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--orange);
}

/* ─── HERO TITLE ─── */
.hero {
    padding: 48px 48px 0;
    text-align: center;
}

.hero h1 {
    font-family: 'Cakra', serif;
    font-size: clamp(44px, 5.5vw, 72px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--navy);
}

.hero .subtitle {
    display: block;
    font-family: 'FlorDeRuina Semilla', serif;
    font-style: normal;
    font-weight: normal;
    font-size: clamp(20px, 2.2vw, 30px);
    color: var(--orange);
    margin-top: 12px;
    text-align: right;
    padding-right: 60px;
}

.hero2 {
    padding: 48px;
    text-align: center;
}

.hero2 h3 {
    font-family: 'Cakra', serif;
    font-size: clamp(32px, 5.5vw, 56px);
    font-weight: normal;
    color: var(--navy);
}

/* ─── MODEL VIEWERS (projets 3D) ─── */
.circles-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-content: center;
    gap: clamp(16px, 3vw, 40px);
    padding: 48px;
}

/* Animation de flottement */
@keyframes float {
    0%   { margin-top: 0px; }
    50%  { margin-top: -8px; }
    100% { margin-top: 0px; }
}

.circle-card {
    width: 167px;
    height: 233px;
    justify-self: center;
    cursor: pointer;
    position: relative;
    animation: float 6s ease-in-out infinite;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.circle-card:hover {
    transform: scale(1.06);
}

.circle-card:nth-child(2n) { animation-delay: 1s; }
.circle-card:nth-child(3n) { animation-delay: 2s; }

/* Overlay HTML qui capture clics par-dessus le shadow DOM de model-viewer */
.card-hit {
    position: absolute;
    inset: 0;
    z-index: 10;
    cursor: pointer;
}

.circle-card .cavalier-3d {
    pointer-events: none;
}

/* Masquer la barre de progression */
.circle-card .cavalier-3d::part(default-progress-bar) {
    display: none;
}

@media (max-width: 600px) {
    .circles-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .circle-card {
        width: 110px;
        height: 147px;
    }
}

/* ─── MODAL ─── */
#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.1s cubic-bezier(0.22, 0.2, 0.36, 1);
}

#modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

#modal-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 80vw;
    height: 100vh;
    background: #fff;
    z-index: 101;
    padding: 0;
    transform: translateX(100%);
    transition: transform 1.1s cubic-bezier(0.22, 0.2, 0.36, 1);
    overflow: hidden;
    display: flex;
    flex-direction: row;
}

#modal-panel.active {
    transform: translateX(0);
}





#modal-close {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 56px;
    height: 56px;
    background: #fff;
    border: 3px solid var(--blue);
    color: var(--blue);
    font-size: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

#modal-close:hover {
    background: var(--blue);
    color: #fff;
}

.modal-sidebar {
    position: relative;
    flex-shrink: 0;
    width: 56px;
    height: 100%;
    margin-top: 56px;
    /* laisse place au bouton ✕ */
    background: var(--blue);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 72px;
    z-index: 1;
}

.modal-sidebar h2 {
    font-family: 'FlorDeRuina Flor', sans-serif;
    font-size: 28px;
    font-weight: normal;
    color: #fff;
    white-space: nowrap;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    letter-spacing: 0.04em;
    margin: 0;
}

.modal-scroll-area {
    flex: 1;
    height: 100%;
    overflow: auto;
    padding: 48px;
    display: flex;
    flex-direction: column;
}

/* ── Layout horizontal par colonnes (inspiré du old CSS) ── */
.modal-content {
    display: flex;
    flex-direction: row;
    gap: 32px;
    flex: 1;
    min-height: 0;
    align-items: stretch;
    position: relative;
}

/* ── Colonne générique ── */
.mc-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-shrink: 0;
}

/* Colonne titre (comme .left-column) */
.mc-col-title {
    width: 420px;
    justify-content: flex-start;
}

/* Colonne image unique pleine hauteur (comme .img-container / .right-column) */
.mc-col-img {
    width: 320px;
}

.mc-col-img .mc-img {
    flex: 1;
    min-height: 0;
}

/* Colonne texte body (comme .left-column2) */
.mc-col-body {
    width: 380px;
    justify-content: flex-start;
}

/* Grande image pleine hauteur (comme .img-container big) */
.mc-col-img-big {
    width: 380px;
}

.mc-col-img-big .mc-img {
    flex: 1;
    min-height: 0;
}

/* Paire d'images empilées (comme .three-column-section .column) */
.mc-col-img-pair {
    width: 220px;
}

/* Variante large (ProjetMade, Aeristal etc.) */
.mc-col-img.mc-wide {
    width: 420px;
}

.mc-col-img-pair.mc-wide {
    width: 300px;
}

/* Body column large (ProjetMade: sq2, sqA, sqB plus larges) */
.mc-col-body.mc-wide {
    width: 480px;
}

/* Image solo 3x plus large (Bulac rectA) */
.mc-col-img-wide-single {
    width: 660px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.mc-col-img-wide-single .mc-img {
    flex: 1;
    min-height: 0;
}

.mc-col-img-pair .mc-img {
    flex: 1;
    min-height: 0;
}

/* ── Titre ── */
.mc-main-title {
    font-family: 'Cakra', serif;
    font-size: 52px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.05;
    margin: 0;
}

.mc-sub {
    font-family: 'FlorDeRuina Semilla', serif;
    font-style: italic;
    color: var(--orange);
    font-size: 20px;
    margin: 4px 0 0;
}

/* ── BLOCS TEXTE ── */
.mc-text {
    border: 1px solid var(--blue);
    background: #fff;
    padding: 20px 24px;
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--navy);
    text-align: left;
}

.mc-text p {
    margin: 0;
}

.mc-col-title .mc-text {
    margin-top: 24px;
}

/* Image sous les blocs body text (remplit l'espace restant) */
.mc-img-under-text {
    flex: 1;
    min-height: 120px;
}

/* ── BLOCS IMAGE ── */
.mc-img {
    background-color: #ccccd4;
    overflow: hidden;
    position: relative;
}

.mc-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── LAYOUT VIDÉO ── */
.mc-video-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-height: 100%;
    max-width: 720px;
}

.mc-video-header {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mc-video-layout .mc-text {
    width: 100%;
}

.mc-video-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111;
    border: 1px solid var(--blue);
    position: relative;
    overflow: hidden;
}

.mc-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mc-video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    font-weight: 200;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* CTA */
.mc-cta {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 48px;
}

.mc-cta-title {
    font-family: 'Source Code Pro', monospace;
    font-size: 15px;
    font-weight: 200;
    font-style: italic;
    color: var(--navy);
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s;
}

.mc-cta-title:hover {
    color: var(--orange);
}

.hero h2 {
    font-family: 'Cakra', serif;
    font-size: clamp(32px, 5.5vw, 72px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--navy);
}

/* ─── TWO COLUMNS ─── */
.columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    padding: 48px;
    align-items: start;
    position: relative;
}


/* Left — Compétences */
.skills-tag {
    display: inline-block;
    background: var(--blue);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 5px 12px;
    margin-bottom: 0;
}

.skills-col {
    display: flex;
    flex-direction: column;
    width: 100%;
    transform-style: preserve-3d;
}

.skills-box {
    border: 1px solid var(--blue);
    background-color: #fff;
    padding: 24px 28px;
    font-family: 'Source Code Pro', monospace;
    font-size: 15px;
    font-weight: 400;
    line-height: 2;
    flex: 1;
}

.skills-box ul {
    list-style: none;
}

.skills-box li::before {
    content: "- ";
}

/* Right — Intro text */
.intro-box {
    border: 1px solid var(--blue);
    background-color: #fff;
    padding: 28px 32px;
    font-family: 'Source Code Pro', monospace;
    font-size: 15px;
    line-height: 1.75;
}

.highlight {
    color: var(--orange);
    font-family: 'FlorDeRuina Semilla', serif;
    font-style: italic;
}

/* ─── FOOTER ─── */
footer {
    border-top: 1px solid var(--grid-line);
    padding: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer p {
    font-size: 12px;
    font-weight: 200;
    opacity: 0.55;
}

footer a {
    font-size: 16px;
    font-weight: 200;
    color: var(--navy);
    text-decoration: none;
    padding-bottom: 2px;
    transition: color 0.2s, border-color 0.2s;
}

footer a:hover {
    color: var(--orange);
    border-color: var(--blue);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {

    nav,
    .hero,
    .columns,
    .projects,
    footer {
        padding-left: 32px;
        padding-right: 32px;
    }

    .columns {
        grid-template-columns: 1fr;
    }

    .hero .subtitle {
        padding-right: 0;
        text-align: center;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* ── Modal responsive tablette ── */
    #modal-panel {
        width: 100vw;
    }

    .modal-scroll-area {
        overflow-x: hidden;
        overflow-y: auto;
        padding: 32px 24px;
    }

    .modal-content {
        flex-direction: column;
        gap: 24px;
    }

    .mc-col {
        width: 100% !important;
        flex-shrink: 1;
    }

    .mc-col-img,
    .mc-col-img-big {
        max-height: 400px;
    }

    .mc-col-img-pair {
        flex-direction: row;
    }

    .mc-col-img-pair .mc-img {
        flex: 1;
    }

    .mc-cta {
        padding: 32px 0;
    }

    .mc-main-title {
        font-size: 36px;
    }
}

@media (max-width: 600px) {
    nav {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    footer {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    /* ── Modal responsive mobile ── */
    .modal-sidebar {
        display: none;
    }

    #modal-close {
        position: fixed;
        top: 8px;
        right: 8px;
        left: auto;
        z-index: 102;
    }

    .modal-scroll-area {
        padding: 56px 16px 32px;
    }

    .modal-content {
        gap: 16px;
    }

    .mc-col-img-pair {
        flex-direction: column;
    }

    .mc-main-title {
        font-size: 28px;
    }

    .mc-sub {
        font-size: 16px;
    }
}