/* ============================================
   DÉCORATIONS ARCHITECTURALES
   Motifs plans, isolation, portes, mobilier
   ============================================ */

/* ============================================
   MOTIF ISOLATION LAINE DE VERRE (ZIGZAG)
   ============================================ */

.isolation-border {
    position: relative;
}

.isolation-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 2px,
            var(--blue-primary) 2px,
            var(--blue-primary) 4px
        ),
        repeating-linear-gradient(
            135deg,
            var(--blue-light) 0px,
            var(--blue-light) 6px,
            transparent 6px,
            transparent 12px
        );
    opacity: 0.6;
}

/* Bordure isolation horizontale réutilisable */
.isolation-line {
    height: 12px;
    width: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='12' viewBox='0 0 24 12'%3E%3Cpath d='M0 6 L6 0 L12 6 L18 0 L24 6 L18 12 L12 6 L6 12 Z' fill='none' stroke='%231e4a8f' stroke-width='1' opacity='0.4'/%3E%3C/svg%3E") repeat-x;
    margin: 20px 0;
}

/* Isolation verticale pour les côtés */
.isolation-vertical {
    width: 12px;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E%3Cpath d='M6 0 L0 6 L6 12 L0 18 L6 24 L12 18 L6 12 L12 6 Z' fill='none' stroke='%231e4a8f' stroke-width='1' opacity='0.4'/%3E%3C/svg%3E") repeat-y;
}

/* ============================================
   PORTE QUI S'OUVRE - CARTES PROJET
   ============================================ */

.projet-card {
    position: relative;
}

/* Porte sur la carte */
.projet-card::before {
    content: '';
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 30px;
    height: 50px;
    border: 2px solid var(--blue-primary);
    background: var(--paper-bg);
    transform-origin: right center;
    transition: transform 0.4s ease;
    z-index: 5;
    opacity: 0.8;
}

/* Poignée de porte */
.projet-card::after {
    content: '';
    position: absolute;
    bottom: 42px;
    right: 24px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--blue-primary);
    transition: all 0.4s ease;
    z-index: 6;
}

/* Porte qui s'ouvre au hover */
.projet-card:hover::before {
    transform: perspective(600px) rotateY(-70deg);
}

.projet-card:hover::after {
    right: 44px;
    opacity: 0.5;
}

/* ============================================
   OBJETS D'INTÉRIEUR FLOTTANTS (FOND)
   ============================================ */

.floating-objects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

/* Objet flottant générique */
.float-object {
    position: absolute;
    opacity: 0.04;
    animation: float-drift 30s ease-in-out infinite;
}

/* Chaise */
.float-chair {
    width: 60px;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect x='20' y='10' width='60' height='5' fill='%231e4a8f'/%3E%3Crect x='20' y='15' width='5' height='50' fill='%231e4a8f'/%3E%3Crect x='75' y='15' width='5' height='50' fill='%231e4a8f'/%3E%3Crect x='20' y='65' width='60' height='5' fill='%231e4a8f'/%3E%3Crect x='20' y='70' width='5' height='25' fill='%231e4a8f'/%3E%3Crect x='75' y='70' width='5' height='25' fill='%231e4a8f'/%3E%3C/svg%3E") no-repeat center;
    top: 15%;
    left: 5%;
    animation-delay: 0s;
}

/* Lampe */
.float-lamp {
    width: 40px;
    height: 80px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 100'%3E%3Cellipse cx='25' cy='20' rx='20' ry='15' fill='none' stroke='%231e4a8f' stroke-width='2'/%3E%3Cline x1='25' y1='35' x2='25' y2='85' stroke='%231e4a8f' stroke-width='2'/%3E%3Cellipse cx='25' cy='90' rx='15' ry='5' fill='none' stroke='%231e4a8f' stroke-width='2'/%3E%3C/svg%3E") no-repeat center;
    top: 60%;
    right: 8%;
    animation-delay: -10s;
}

/* Table */
.float-table {
    width: 80px;
    height: 50px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 60'%3E%3Crect x='5' y='5' width='90' height='5' fill='%231e4a8f'/%3E%3Crect x='10' y='10' width='5' height='45' fill='%231e4a8f'/%3E%3Crect x='85' y='10' width='5' height='45' fill='%231e4a8f'/%3E%3C/svg%3E") no-repeat center;
    bottom: 20%;
    left: 12%;
    animation-delay: -5s;
}

/* Plante */
.float-plant {
    width: 50px;
    height: 70px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 70'%3E%3Crect x='18' y='50' width='14' height='18' fill='none' stroke='%231e4a8f' stroke-width='2'/%3E%3Cpath d='M25 50 Q15 35 25 20 Q35 35 25 50' fill='none' stroke='%231e4a8f' stroke-width='2'/%3E%3Cpath d='M25 45 Q10 30 20 15' fill='none' stroke='%231e4a8f' stroke-width='2'/%3E%3Cpath d='M25 45 Q40 30 30 15' fill='none' stroke='%231e4a8f' stroke-width='2'/%3E%3C/svg%3E") no-repeat center;
    top: 30%;
    right: 15%;
    animation-delay: -15s;
}

/* Canapé */
.float-sofa {
    width: 100px;
    height: 50px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 60'%3E%3Crect x='5' y='20' width='110' height='30' rx='5' fill='none' stroke='%231e4a8f' stroke-width='2'/%3E%3Crect x='5' y='10' width='25' height='25' rx='3' fill='none' stroke='%231e4a8f' stroke-width='2'/%3E%3Crect x='90' y='10' width='25' height='25' rx='3' fill='none' stroke='%231e4a8f' stroke-width='2'/%3E%3Crect x='10' y='50' width='8' height='8' fill='%231e4a8f'/%3E%3Crect x='102' y='50' width='8' height='8' fill='%231e4a8f'/%3E%3C/svg%3E") no-repeat center;
    bottom: 35%;
    right: 5%;
    animation-delay: -20s;
}

/* Étagère */
.float-shelf {
    width: 70px;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 70 60'%3E%3Crect x='5' y='5' width='60' height='3' fill='%231e4a8f'/%3E%3Crect x='5' y='25' width='60' height='3' fill='%231e4a8f'/%3E%3Crect x='5' y='45' width='60' height='3' fill='%231e4a8f'/%3E%3Crect x='5' y='5' width='3' height='43' fill='%231e4a8f'/%3E%3Crect x='62' y='5' width='3' height='43' fill='%231e4a8f'/%3E%3Crect x='15' y='10' width='8' height='12' fill='none' stroke='%231e4a8f' stroke-width='1'/%3E%3Crect x='30' y='30' width='10' height='12' fill='none' stroke='%231e4a8f' stroke-width='1'/%3E%3C/svg%3E") no-repeat center;
    top: 45%;
    left: 3%;
    animation-delay: -8s;
}

@keyframes float-drift {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(15px, -20px) rotate(3deg);
    }
    50% {
        transform: translate(-10px, -10px) rotate(-2deg);
    }
    75% {
        transform: translate(20px, 10px) rotate(2deg);
    }
}

/* ============================================
   SYMBOLES ARCHITECTURAUX
   ============================================ */

/* Cote / Dimension */
.dimension-line {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--blue-light);
    opacity: 0.7;
}

.dimension-line::before,
.dimension-line::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--blue-light);
}

.dimension-line::before {
    background: linear-gradient(90deg, transparent, var(--blue-light));
}

.dimension-line::after {
    background: linear-gradient(90deg, var(--blue-light), transparent);
}

/* Flèche Nord */
.north-arrow {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 40px;
    height: 40px;
    opacity: 0.15;
    z-index: 1;
    animation: north-pulse 4s ease-in-out infinite;
}

.north-arrow svg {
    width: 100%;
    height: 100%;
}

@keyframes north-pulse {
    0%, 100% { opacity: 0.15; transform: scale(1); }
    50% { opacity: 0.25; transform: scale(1.05); }
}

/* ============================================
   COIN TECHNIQUE (COUPE)
   ============================================ */

.technical-corner {
    position: absolute;
    width: 40px;
    height: 40px;
    opacity: 0.3;
}

.technical-corner--tl {
    top: 0;
    left: 0;
    border-top: 2px solid var(--blue-primary);
    border-left: 2px solid var(--blue-primary);
}

.technical-corner--tr {
    top: 0;
    right: 0;
    border-top: 2px solid var(--blue-primary);
    border-right: 2px solid var(--blue-primary);
}

.technical-corner--bl {
    bottom: 0;
    left: 0;
    border-bottom: 2px solid var(--blue-primary);
    border-left: 2px solid var(--blue-primary);
}

.technical-corner--br {
    bottom: 0;
    right: 0;
    border-bottom: 2px solid var(--blue-primary);
    border-right: 2px solid var(--blue-primary);
}

/* ============================================
   HACHURES (MATÉRIAUX)
   ============================================ */

.hatch-pattern {
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 5px,
        rgba(30, 74, 143, 0.05) 5px,
        rgba(30, 74, 143, 0.05) 6px
    );
}

.hatch-pattern-cross {
    background: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 8px,
            rgba(30, 74, 143, 0.03) 8px,
            rgba(30, 74, 143, 0.03) 9px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 8px,
            rgba(30, 74, 143, 0.03) 8px,
            rgba(30, 74, 143, 0.03) 9px
        );
}

/* ============================================
   ÉCHELLE GRAPHIQUE
   ============================================ */

.scale-bar {
    display: flex;
    align-items: flex-end;
    gap: 0;
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--blue-light);
    opacity: 0.5;
}

.scale-bar-segment {
    width: 20px;
    height: 6px;
    border: 1px solid var(--blue-light);
}

.scale-bar-segment:nth-child(odd) {
    background: var(--blue-light);
}

/* ============================================
   ANIMATIONS ENTRÉE ÉLÉMENTS
   ============================================ */

.draw-in {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw-line 2s ease forwards;
}

@keyframes draw-line {
    to {
        stroke-dashoffset: 0;
    }
}

/* Animation d'apparition des sections */
.section-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.section-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   TRAÎNÉE DE CRAYON D'ARCHITECTE
   ============================================ */

.pencil-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    overflow: visible;
}

.pencil-path {
    filter: drop-shadow(0 0 3px rgba(91, 159, 255, 0.5));
}

/* ============================================
   PARTICULES MAGIQUES
   ============================================ */

.magic-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9997;
    overflow: hidden;
}

.magic-particle {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(circle, #5b9fff 0%, #1e4a8f 50%, transparent 70%);
    pointer-events: none;
    animation: particle-float 2s ease-out forwards;
    box-shadow: 0 0 10px rgba(91, 159, 255, 0.8), 0 0 20px rgba(91, 159, 255, 0.4);
}

@keyframes particle-float {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx, 0), var(--ty, -50px)) scale(0);
    }
}

/* ============================================
   DIMENSION FLOTTANTE
   ============================================ */

.floating-dimension {
    position: fixed;
    background: rgba(30, 74, 143, 0.95);
    color: #fff;
    padding: 6px 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(30, 74, 143, 0.3);
    border: 1px solid rgba(91, 159, 255, 0.5);
}

.floating-dimension::before {
    content: '⟨ ';
    opacity: 0.6;
}

.floating-dimension::after {
    content: ' ⟩';
    opacity: 0.6;
}

.dim-unit {
    opacity: 0.7;
    margin-left: 3px;
}

/* ============================================
   LIGNE QUI SE DESSINE
   ============================================ */

.draw-line {
    position: relative;
    overflow: hidden;
}

.draw-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--paper-bg, #f5f3ef);
    transform: translateX(0);
    transition: transform 1s ease;
}

.draw-line.line-drawn::after {
    transform: translateX(100%);
}

/* ============================================
   EFFET BLUEPRINT REVEAL
   ============================================ */

.blueprint-reveal {
    position: relative;
    overflow: hidden;
}

.blueprint-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(91, 159, 255, 0.1) 45%,
        rgba(91, 159, 255, 0.3) 50%,
        rgba(91, 159, 255, 0.1) 55%,
        transparent 100%
    );
    animation: blueprint-scan 3s ease-in-out infinite;
}

@keyframes blueprint-scan {
    0%, 100% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
}

/* ============================================
   EFFETS HOVER AVANCÉS
   ============================================ */

/* Effet ondulation au clic */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(91, 159, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease, opacity 0.6s ease;
    opacity: 0;
}

.ripple-effect:active::after {
    width: 300px;
    height: 300px;
    opacity: 1;
    transition: 0s;
}

/* Effet glow pulsant */
.glow-pulse {
    animation: glow-pulse-anim 2s ease-in-out infinite;
}

@keyframes glow-pulse-anim {
    0%, 100% {
        box-shadow: 0 0 5px rgba(91, 159, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(91, 159, 255, 0.6), 0 0 40px rgba(91, 159, 255, 0.3);
    }
}

/* ============================================
   EFFET TEXTE TYPEWRITER
   ============================================ */

.typewriter-text {
    opacity: 0;
    font-family: var(--font-mono);
}

.typewriter-text::after {
    content: '|';
    animation: blink-cursor 0.7s step-end infinite;
    margin-left: 2px;
    color: var(--blue-primary);
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ============================================
   EFFET 3D SUR LES CARTES
   ============================================ */

.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.card-3d:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg) translateZ(20px);
}

.card-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.1) 100%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-3d:hover::before {
    opacity: 1;
}

/* ============================================
   GRILLE ANIMÉE DE FOND
   ============================================ */

.animated-grid {
    background-image: 
        linear-gradient(rgba(30, 74, 143, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 74, 143, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% {
        background-position: 0 0, 0 0;
    }
    100% {
        background-position: 50px 50px, 50px 50px;
    }
}

/* ============================================
   COMPTEUR ANIMÉ
   ============================================ */

.counter-animate {
    display: inline-block;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* ============================================
   RESPONSIVE - DÉSACTIVER SUR MOBILE
   ============================================ */

@media (max-width: 900px) {
    .floating-objects,
    .north-arrow,
    .pencil-trail,
    .magic-particles,
    .floating-dimension {
        display: none !important;
    }
    
    .projet-card::before,
    .projet-card::after {
        display: none;
    }
    
    body::before {
        display: none;
    }
    
    .blueprint-reveal::before {
        display: none;
    }
    
    /* Désactiver l'effet page flip sur mobile */
    .page-flip-overlay {
        display: none !important;
    }
    
    /* Animation simplifiée sur mobile */
    body.page-loaded {
        animation: none;
    }
}
