/* ════════════════════════════════════════════════════════════════
   VARIANT POP — Fond blanc, hyperpop kawaï
   Reutilise TOUTE la structure du tech (intro → scene → liste).
   On ne fait que restyler + swap la scene 3D du milieu.
   ════════════════════════════════════════════════════════════════ */

/* ═══ BACKGROUND GLOBAL ═══ */
[data-variant="pop"] body {
    background: #fff !important;
    color: #1a1a1a !important;
}

/* Le SVG d'intro reste noir (on pourra l'inverser plus tard avec un logo kawaï) */
[data-variant="pop"] body:not(.dark) { }

/* ═══ NAV ═══ */
/* Pas de fond blanc — le cadre 3D doit s'afficher derriere la nav */
[data-variant="pop"] .site-nav {
    background: transparent;
    backdrop-filter: none;
}

/* Le bouton dark-toggle devient le switch variant en pop */
[data-variant="pop"] .dark-toggle {
    border: none;
    background: linear-gradient(135deg, #ff7edc 0%, #7edcff 100%);
    box-shadow: 0 4px 14px rgba(255, 120, 220, 0.4);
    cursor: pointer;
}
[data-variant="pop"] .dark-toggle::after {
    content: '✦';
    background: none !important;
    color: #fff;
    font-size: 16px;
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
}
[data-variant="pop"] .dark-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(255, 120, 220, 0.6);
}

/* Liens nav avec bubble kawai */
[data-variant="pop"] .nav-link {
    padding: 6px 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, #ffd6f2 0%, #d6f0ff 100%);
    color: #1a1a1a;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}
[data-variant="pop"] .nav-link:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 120, 220, 0.35);
    opacity: 1;
}

/* ═══ PHASE 2 : CANVAS ═══ */
/* Canvas pop = fond blanc, pas de filtre invert */
[data-variant="pop"] #cloud-canvas {
    background: transparent;
}

/* ═══ VENT ASCII + PNG KAWAII — multi-layer ═══ */
#pop-wind { display: none; }

[data-variant="pop"] #pop-wind {
    display: block;
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Cadre kawaii (sequence webm avec alpha) entre les elements 3D et la webcam */
#pop-overlay-video { display: none; }
[data-variant="pop"] #pop-overlay-video {
    display: block;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    object-fit: fill;        /* etire pour couvrir exactement (le cadre suit les bords)*/
    z-index: 10;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Vent ASCII style "Matrix lateral 3D" avec perspective */
[data-variant="pop"] #pop-wind {
    display: block;
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    will-change: opacity;
    /* Perspective Star Wars : point de fuite en haut (20% from top) pour que les
       lignes inclinées via rotateX convergent vers ce point au loin */
    perspective: 700px;
    perspective-origin: 50% 20%;
}

/* La scene globale : le JS modifie le --scroll-z pour zoomer */
.wind-scene {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transform: translateZ(var(--scroll-z, 0px));
    will-change: transform;
}

/* STAR WARS CRAWL : toutes les lignes inclinées sur un meme plan en arriere
   → la perspective fait converger naturellement vers un point de fuite en haut/loin
   - rotateX = tilt commun (plan incliné back-tilted)
   - translateZ = position dans le plan (perception : far/close)
   - top/left = offset 2D (variete des points de depart) */
.wind-line {
    position: absolute;
    top: var(--y, 50%);
    left: var(--leftX, 0%);
    width: var(--lineW, 60vw);
    white-space: nowrap;
    transform:
        translateZ(var(--depth, -200px))
        rotateX(var(--rotX, 60deg));
    transform-origin: 50% 50%;
    transform-style: preserve-3d;
    font-family: 'Inter', monospace;
    font-weight: 700;
    font-size: var(--size, 32px);
    color: #ff44a0;   /* fallback rose au lieu de noir si JS ne set pas */
    overflow: visible;
    background: transparent;
    pointer-events: none;
}

/* Slide horizontal ambient (se passe en continu, independant du scroll) */
.wind-slide {
    display: inline-block;
    width: max-content;
    animation: windSlide linear infinite;
    will-change: transform;
    backface-visibility: hidden;
}
.wind-slide.reverse { animation-direction: reverse; }

/* Gros ASCII art multilignes */
.wind-big-art {
    font-family: 'Courier New', Courier, monospace;
    font-size: inherit;
    line-height: 1;
    letter-spacing: 0;
    margin: 0;
    padding: 0;
    white-space: pre;
    /* heritera la couleur de .wind-line (couleur unie ou rainbow gradient) */
    color: inherit;
}

/* ═══ RAINBOW PER-CHARACTER (style react-rainbow-ascii) ═══
   Approche universelle (sans @property qui n'est pas supporte partout) :
   - Chaque caractere = <span class="rb-char"> avec --i = son index
   - Animation @keyframes avec hsl() hardcodes (universelle)
   - animation-delay calc(var(--i) * --rb-step) → decalage de phase par char
     → chaque char est a un point different du cycle = rainbow visible ET defilement
   - Variete par ligne : filter saturate / hue-rotate FIXES (pas animes) */
.rb-char {
    animation: rbColor var(--rb-speed, 4s) linear infinite;
    animation-delay: calc(var(--i, 0) * var(--rb-step, -0.05s));
}
@keyframes rbColor {
    0%   { color: hsl(0,   100%, 55%); }
    14%  { color: hsl(50,  100%, 55%); }
    28%  { color: hsl(100, 100%, 50%); }
    42%  { color: hsl(160, 100%, 50%); }
    57%  { color: hsl(210, 100%, 55%); }
    71%  { color: hsl(260, 100%, 55%); }
    85%  { color: hsl(310, 100%, 55%); }
    100% { color: hsl(360, 100%, 55%); }
}
/* Variete par ligne via filter (valeurs fixes, pas animees → pas de filtre gris) */
.wind-rainbow-fx {
    filter: saturate(var(--rb-saturate, 1)) hue-rotate(var(--rb-hueoffset, 0deg));
}
.rb-char .wind-png-inline {
    color: initial;
}
/* Big ASCII : couleur animee sur le pre ENTIER (1 element anime) au lieu de N spans
   → leger en perf, gardons l'effet rainbow dynamique */
.wind-big-art.big-rainbow {
    animation: rbBigColor var(--rb-speed, 5s) linear infinite;
}
@keyframes rbBigColor {
    0%   { color: hsl(0,   100%, 55%); }
    16%  { color: hsl(60,  100%, 55%); }
    33%  { color: hsl(120, 100%, 50%); }
    50%  { color: hsl(180, 100%, 50%); }
    66%  { color: hsl(240, 100%, 55%); }
    83%  { color: hsl(300, 100%, 55%); }
    100% { color: hsl(360, 100%, 55%); }
}

/* Traversee complete : entre depuis la droite, sort a gauche */
.wind-big-traverse {
    display: inline-block;
    position: absolute;
    left: 0;
    top: 0;
    animation: bigTraverse linear infinite;
    will-change: transform;
    backface-visibility: hidden;
}
.wind-big-traverse.reverse { animation-direction: reverse; }

@keyframes bigTraverse {
    0%   { transform: translateX(110vw); opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { transform: translateX(-110vw); opacity: 0; }
}

@keyframes windSlide {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* PNGs kawaii inline dans les lignes — defilent avec le texte, pleine opacite */
.wind-png-inline {
    height: 1.1em;
    width: auto;
    vertical-align: middle;
    display: inline-block;
    margin: 0 0.15em;
    opacity: 1;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* ═══ THUMBNAIL RONDE AU CLIC ═══ */
.pop-thumb {
    position: fixed;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0);
    z-index: 50;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s;
    opacity: 0;
    box-shadow:
        0 0 0 4px #fff,
        0 0 0 8px rgba(255, 120, 220, 0.3),
        0 16px 40px rgba(0, 0, 0, 0.2);
    display: none;
}
[data-variant="pop"] .pop-thumb {
    display: block;
}
.pop-thumb.visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
}
.pop-thumb img, .pop-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pop-thumb-label {
    position: absolute;
    bottom: -34px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #fff;
    padding: 6px 14px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

/* ═══ PHASE 3 : LISTE PROJETS (style pop) ═══ */
[data-variant="pop"] .project-item {
    /* Un peu plus rond, plus fun */
}
[data-variant="pop"] .project-item:hover {
    background: linear-gradient(90deg, rgba(255, 214, 242, 0.3) 0%, rgba(214, 240, 255, 0.3) 100%);
}

[data-variant="pop"] .classic-footer {
    border-top-color: rgba(255, 120, 220, 0.2);
}

/* ═══ SCROLL INDICATOR ═══ */
[data-variant="pop"] .scroll-indicator {
    color: rgba(255, 120, 220, 0.7);
}

/* ═══ MOBILE ═══ */
@media (max-width: 768px) {
    .pop-thumb { width: 140px; height: 140px; }
}
