/* Spiral embed — autonome (pas de Tailwind sur cette page) */
:root { --primary: #0c10f0; }
.hidden { display: none !important; }
/* Reset boutons (pas de preflight Tailwind sur la page Astro : sans ça, fond blanc UA par défaut) */
:where(#spiral-ui, #spiral-enter, #mystery-cta, #contact-panel) button {
    appearance: none; -webkit-appearance: none; background: none; border: 0;
    font: inherit; color: inherit; cursor: pointer; padding: 0; }
/* Le watermark déborde à droite -> pas de scroll horizontal */
#contact-panel { overflow-x: hidden; }
.font-mono { font-family: 'Space Mono', monospace; }
#spiral-layer, #hlist-layer, #spiral-enter, #contact-panel, #spiral-ui, #mystery-cta, #bg-marquees {
    font-family: 'Manrope', system-ui, sans-serif; color: #fff; }
#contact-panel h2, #contact-panel h3, #contact-panel p, #contact-panel label, #contact-panel a, #contact-panel b, #contact-panel span,
#spiral-enter h2, #spiral-enter p, #spiral-enter button, #spiral-layer p, #spiral-layer a, #spiral-layer span,
#hlist-layer a, #hlist-layer span { font-family: inherit; color: inherit; }
.sp-btn { background: var(--primary); color: #fff; font-weight: 700; font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.08em; padding: 16px 34px; border-radius: 16px;
    border: 0; cursor: pointer; font-family: 'Manrope', system-ui, sans-serif;
    box-shadow: 0px 0px 10px 2px rgb(4, 53, 255);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease; }
.sp-btn:hover { background: #1a1ef5; transform: translateY(-2px); box-shadow: 0px 4px 24px 4px rgba(4, 53, 255, 0.6); }
.cp-field { margin-bottom: 1rem; }
.cp-label { display: block; font-family: 'Space Mono', monospace; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255, 255, 255, 0.45); margin-bottom: 0.5rem; }
.cp-label small { text-transform: lowercase; opacity: 0.6; }
.cp-input { width: 100%; box-sizing: border-box; border-radius: 12px; padding: 12px 16px; font-size: 14px;
    background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.1); color: #fff;
    font-family: 'Manrope', system-ui, sans-serif;
    transition: border-color 0.25s ease, background 0.25s ease; }
.cp-input:focus { outline: none; border-color: var(--primary); background: rgba(0, 0, 0, 0.6); }
.cp-input::placeholder { color: rgba(255, 255, 255, 0.3); }
textarea.cp-input { resize: none; }
.cp-submit { width: 100%; margin-top: 0.5rem; }
.cp-note { font-size: 11px; color: rgba(255, 255, 255, 0.35); text-align: center; padding-top: 0.6rem; }
#spiral-enter .enter-title, #contact-panel .cp-title, .hlist-title, .marquee-inner span, #cap-title {
    font-family: 'Manrope', system-ui, sans-serif; }
body { background: #000; }

/* ============ EXPÉRIENCE PROJETS (spirale + liste horizontale) ============ */
        body.spiral-mode #list-view, body.hlist-mode #list-view { display: none; }
        body.spiral-mode, body.hlist-mode { overflow: hidden; height: 100vh; }

        /* Fond : marquees multiples */
        #bg-marquees { position: fixed; inset: 0; z-index: 5; display: none; pointer-events: none; overflow: hidden; }
        body.spiral-mode #bg-marquees, body.hlist-mode #bg-marquees { display: block; }
        body.hlist-mode #bg-marquees { opacity: 0.5; }
        .marquee-row { position: absolute; left: 0; right: 0; white-space: nowrap; }
        .marquee-inner { display: inline-flex; will-change: transform; animation: mq linear infinite; }
        .marquee-inner span { display: inline-block; font-weight: 800; line-height: 1; letter-spacing: -0.02em;
            color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.09); padding-right: 5vw; }
        @keyframes mq { to { transform: translateX(-50%); } }
        .marquee-row:nth-child(1) { top: 4%; font-size: 7.5vw; }
        .marquee-row:nth-child(1) .marquee-inner { animation-duration: 60s; }
        .marquee-row:nth-child(2) { top: 26%; font-size: 12vw; }
        .marquee-row:nth-child(2) .marquee-inner { animation-duration: 90s; animation-direction: reverse; }
        .marquee-row:nth-child(2) .marquee-inner span { -webkit-text-stroke-color: rgba(255, 255, 255, 0.06); }
        .marquee-row:nth-child(3) { top: 52%; font-size: 9vw; }
        .marquee-row:nth-child(3) .marquee-inner { animation-duration: 48s; }
        .marquee-row:nth-child(3) .marquee-inner span { -webkit-text-stroke-color: rgba(122, 126, 255, 0.12); }
        .marquee-row:nth-child(4) { top: 76%; font-size: 13vw; }
        .marquee-row:nth-child(4) .marquee-inner { animation-duration: 110s; animation-direction: reverse; }
        .marquee-row:nth-child(4) .marquee-inner span { -webkit-text-stroke-color: rgba(255, 255, 255, 0.05); }

        /* Grain global */
        #fx-grain { position: fixed; inset: -50%; z-index: 30; display: none; pointer-events: none; opacity: 0.14;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
            animation: grain-shift 0.9s steps(4) infinite; }
        body.spiral-mode #fx-grain, body.hlist-mode #fx-grain { display: block; }
        @keyframes grain-shift {
            0% { transform: translate(0, 0); } 25% { transform: translate(-2%, 1.5%); }
            50% { transform: translate(1.5%, -2%); } 75% { transform: translate(-1%, -1%); } 100% { transform: translate(0, 0); }
        }

        /* Spirale */
        #spiral-layer { position: fixed; inset: 0; z-index: 10; display: none; touch-action: none; overflow: hidden; }
        body.spiral-mode #spiral-layer { display: block; }
        #spiral-layer.is-hover { cursor: pointer; }
        #spiral-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }

        /* Liste horizontale */
        #hlist-layer { position: fixed; inset: 0; z-index: 10; display: none; touch-action: none; overflow: hidden; cursor: grab; }
        body.hlist-mode #hlist-layer { display: block; }
        #hlist-layer.dragging { cursor: grabbing; }
        #hlist-track { position: absolute; top: 50%; left: 0; display: flex; align-items: center; gap: 4vw; padding: 0 10vw; will-change: transform; }
        .hlist-item { flex: none; width: min(33vw, 460px); text-decoration: none; color: #fff; display: block;
            opacity: 0; transform: translateY(36px); transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
        .hlist-item.in { opacity: 1; transform: translateY(0); }
        .hlist-idx { font-family: 'Space Mono', monospace; font-size: 9px; letter-spacing: 0.3em; color: rgba(255, 255, 255, 0.4); display: block; margin-bottom: 0.7rem; }
        .hlist-item .im { display: block; overflow: hidden; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.08); }
        .hlist-item img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: center top;
            filter: grayscale(0.75) brightness(0.8); transform: scale(1.01);
            transition: filter 0.45s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); pointer-events: none; }
        .hlist-item:hover img { filter: none; transform: scale(1.06); }
        .hlist-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: 0.9rem; }
        .hlist-title { font-weight: 800; font-size: clamp(1.1rem, 1.7vw, 1.55rem); letter-spacing: -0.02em; transition: color 0.25s ease; }
        .hlist-item:hover .hlist-title { color: #7a7eff; }
        .hlist-tag { font-family: 'Space Mono', monospace; font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255, 255, 255, 0.45); white-space: nowrap; }
        @media (max-width: 768px) { .hlist-item { width: 72vw; } #hlist-track { gap: 6vw; padding: 0 14vw; } }

        /* Écran d'entrée (déclenche le son — requis par l'autoplay navigateur) */
        #spiral-enter { position: fixed; inset: 0; z-index: 60; display: none; flex-direction: column; align-items: center; justify-content: center;
            gap: 1.1rem; background: rgba(0, 0, 0, 0.74); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
            text-align: center; padding: 2rem; transition: opacity 0.7s ease; }
        body.spiral-mode #spiral-enter, body.hlist-mode #spiral-enter { display: flex; }
        #spiral-enter.gone { opacity: 0; pointer-events: none; }
        .enter-kicker { font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: 0.4em; text-transform: uppercase; color: rgba(255, 255, 255, 0.45); }
        .enter-title { font-weight: 800; font-size: clamp(2.4rem, 7vw, 4.5rem); letter-spacing: -0.03em; line-height: 1; }
        .enter-sub { font-size: 0.9rem; color: rgba(255, 255, 255, 0.5); font-weight: 300; max-width: 26rem; }
        #enter-btn { margin-top: 1.2rem; }
        #enter-nosound { font-size: 12px; color: rgba(255, 255, 255, 0.4); text-decoration: underline dotted; transition: color 0.2s ease; }
        #enter-nosound:hover { color: #fff; }

        /* UI cachée tant qu'on n'est pas entré */
        #spiral-ui { opacity: 0; visibility: hidden; transition: opacity 0.5s ease; }
        body.entered #spiral-ui { opacity: 1; visibility: visible; }

        /* Bouton mystère */
        #mystery-cta { position: fixed; bottom: clamp(2.2rem, 5.5vh, 3.8rem); left: 50%; transform: translateX(-50%);
            z-index: 40; opacity: 0; visibility: hidden; transition: opacity 0.5s ease 0.3s; }
        body.entered.spiral-mode #mystery-cta, body.entered.hlist-mode #mystery-cta { opacity: 1; visibility: visible; }
        #mystery-cta-btn { position: relative; display: inline-grid; cursor: pointer;
            font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase;
            color: #fff; padding: 16px 30px; border-radius: 999px;
            background: var(--primary); border: 1px solid rgba(255, 255, 255, 0.25);
            animation: cta-pulse 2.4s ease-in-out infinite;
            transition: transform 0.25s ease, background 0.25s ease; }
        #mystery-cta-btn:hover { transform: translateY(-3px) scale(1.03); background: #1a1ef5; }
        #mystery-cta-btn .cta-a, #mystery-cta-btn .cta-b { grid-area: 1 / 1; white-space: nowrap;
            transition: opacity 0.3s ease, transform 0.3s ease; }
        #mystery-cta-btn .cta-b { opacity: 0; transform: translateY(8px); }
        #mystery-cta-btn:hover .cta-a { opacity: 0; transform: translateY(-8px); }
        #mystery-cta-btn:hover .cta-b { opacity: 1; transform: translateY(0); }
        @keyframes cta-pulse {
            0%, 100% { box-shadow: 0 0 12px 1px rgba(4, 53, 255, 0.55); }
            50% { box-shadow: 0 0 34px 6px rgba(4, 53, 255, 0.8); }
        }

        /* Panneau contact (projet n°12) */
        #contact-panel { position: fixed; inset: 0; z-index: 45; overflow-y: auto; overscroll-behavior: contain;
            transform: translateY(103%); visibility: hidden;
            transition: transform 0.85s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.85s;
            background: radial-gradient(90% 70% at 75% 115%, rgba(12, 16, 240, 0.25) 0%, transparent 62%),
                        radial-gradient(60% 50% at 0% 0%, rgba(127, 22, 224, 0.12) 0%, transparent 55%), #050507; }
        body.contact-open #contact-panel { transform: translateY(0); visibility: visible; transition-delay: 0s, 0s; }
        body.contact-open #spiral-layer, body.contact-open #hlist-layer, body.contact-open #bg-marquees {
            transform: scale(0.96) translateY(-2vh); opacity: 0.3; }
        #spiral-layer, #hlist-layer, #bg-marquees { transition: transform 0.85s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.85s ease; }
        body.contact-open #mystery-cta, body.contact-open #spiral-ui { opacity: 0; visibility: hidden; transition: opacity 0.3s ease; }
        /* sibling du panel, fixed viewport : reste visible quel que soit le scroll interne du panel */
        #contact-close { position: fixed; top: 6.5rem; right: clamp(1rem, 4vw, 3rem); z-index: 46;
            display: inline-flex; align-items: center; gap: 10px;
            font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: 0.25em; text-transform: uppercase;
            background: #fff; color: #0a0a14; padding: 12px 20px; border-radius: 999px; font-weight: 700;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
            opacity: 0; visibility: hidden; pointer-events: none;
            transition: opacity 0.4s ease, visibility 0s linear 0.8s, transform 0.2s ease, background 0.2s ease; }
        body.contact-open #contact-close { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0.4s, 0s, 0s, 0s; }
        #contact-close:hover { transform: scale(1.05); background: #e8e8ff; }
        #contact-close svg { width: 12px; height: 12px; }
        .cp-watermark { position: absolute; right: -4vw; top: 50%; transform: translateY(-50%); font-weight: 800;
            font-size: 36vw; line-height: 1; color: transparent; -webkit-text-stroke: 1.5px rgba(122, 126, 255, 0.09);
            pointer-events: none; user-select: none; }
        .cp-inner { position: relative; z-index: 2; max-width: 74rem; margin: 0 auto; min-height: 100%;
            display: grid; gap: 3.5rem; padding: 9rem 1.5rem 5rem; align-content: center; }
        @media (min-width: 900px) { .cp-inner { grid-template-columns: 1.05fr 1fr; gap: 5rem; padding: 9rem 2.5rem 5rem; align-items: center; } }
        .cp-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: 0.35em; color: rgba(255, 255, 255, 0.4); margin-bottom: 1.4rem; }
        .cp-title { font-weight: 800; font-size: clamp(2.5rem, 5vw, 4.3rem); letter-spacing: -0.03em; line-height: 1.02; margin-bottom: 1.4rem; }
        .cp-title em { font-style: italic; font-weight: 300; color: #7a7eff; }
        .cp-sub { color: rgba(255, 255, 255, 0.55); font-weight: 300; line-height: 1.7; max-width: 30rem; margin-bottom: 2.6rem; }
        .cp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding: 1.8rem 0; border-top: 1px solid rgba(255, 255, 255, 0.1); border-bottom: 1px solid rgba(255, 255, 255, 0.1); margin-bottom: 2.2rem; }
        .cp-stats b { display: block; font-size: clamp(1.6rem, 2.6vw, 2.4rem); font-weight: 700; letter-spacing: -0.02em;
            background: linear-gradient(135deg, #fff 0%, #8a8eff 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
        .cp-stats span { font-family: 'Space Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.15em; color: rgba(255, 255, 255, 0.45); margin-top: 0.5rem; display: block; }
        .cp-direct { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; }
        .cp-direct a { font-size: 0.9rem; color: rgba(255, 255, 255, 0.7); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(122, 126, 255, 0.5); transition: color 0.2s ease; }
        .cp-direct a:hover { color: #7a7eff; }
        .cp-form { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 24px;
            padding: clamp(1.6rem, 3vw, 2.6rem); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
        .cp-form-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
        .cp-form-head h3 { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; }
        .cp-form-head span { font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: 0.25em; color: rgba(122, 126, 255, 0.8); white-space: nowrap; }

        /* Responsive mobile */
        @media (max-width: 768px) {
            #spiral-caption { bottom: clamp(9.5rem, 22vh, 12rem); width: 94vw; }
            #cap-title { font-size: clamp(1.5rem, 7.5vw, 2rem); }
            #mystery-cta { bottom: 5.8rem; width: max-content; }
            #mystery-cta-btn { font-size: 10px; padding: 14px 22px; letter-spacing: 0.22em; }
            #contact-close { top: 5.6rem; right: 1rem; padding: 10px 16px; font-size: 10px; }
            .cp-inner { padding: 8.5rem 1.25rem 4rem; gap: 2.5rem; }
            .cp-watermark { font-size: 110vw; top: auto; bottom: -10vw; right: -14vw; transform: none; }
            .cp-stats { gap: 0.5rem; }
            .cp-sub { margin-bottom: 1.8rem; }
            #spiral-ui { padding: 1rem 1rem; }
        }
        #spiral-eyebrow { position: absolute; top: 7.5rem; left: 50%; transform: translateX(-50%);
            z-index: 4; font-size: 11px; text-transform: uppercase; letter-spacing: 0.35em;
            color: rgba(255, 255, 255, 0.4); pointer-events: none; white-space: nowrap; }
        #spiral-hint { position: absolute; right: 2rem; top: 50%; transform: translateY(-50%); z-index: 4;
            font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(255, 255, 255, 0.45);
            writing-mode: vertical-rl; display: flex; align-items: center; gap: 12px;
            transition: opacity 0.6s ease; pointer-events: none; }
        #spiral-hint.seen { opacity: 0; }
        #spiral-hint .hint-line { width: 1px; height: 56px; background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
            animation: hint-drop 1.8s ease-in-out infinite; }
        @keyframes hint-drop { 0% { transform: translateY(-8px); opacity: 0; } 35% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }
        #spiral-caption { position: absolute; left: 50%; bottom: clamp(7rem, 16vh, 10.5rem); transform: translateX(-50%);
            z-index: 4; text-align: center; pointer-events: none; width: min(92vw, 640px); }
        #spiral-caption a { pointer-events: auto; }
        #cap-index { font-size: 10px; letter-spacing: 0.35em; color: rgba(255, 255, 255, 0.4); display: block; margin-bottom: 0.6rem; }
        #cap-title { display: inline-block; font-weight: 800; letter-spacing: -0.03em; line-height: 1;
            font-size: clamp(1.8rem, 4.5vw, 3.2rem); color: #fff; text-decoration: none; transition: color 0.25s ease; }
        #cap-title:hover { color: #7a7eff; }
        #cap-meta { margin-top: 0.7rem; font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase; color: rgba(255, 255, 255, 0.55); }
        #cap-cat { color: #7a7eff; }
        #cap-cat.is-concept { color: rgba(255, 255, 255, 0.75); }
        .cap-dot { margin: 0 0.6em; color: rgba(255, 255, 255, 0.3); }
        #spiral-caption.cap-anim #cap-title { animation: cap-in 0.55s cubic-bezier(0.16, 1, 0.3, 1); }
        @keyframes cap-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
        #spiral-caption.cap-out { opacity: 0; transition: opacity 0.4s ease; }
        /* UI fixe (toggle vue + son) */
        #spiral-ui { position: fixed; z-index: 40; inset: auto 0 0 0; pointer-events: none; padding: 1.25rem 1.5rem; display: flex; justify-content: space-between; align-items: flex-end; }
        #spiral-ui > * { pointer-events: auto; }
        #view-toggle { display: flex; gap: 2px; padding: 3px; border-radius: 999px;
            background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); }
        #view-toggle button { font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
            color: rgba(255, 255, 255, 0.45); padding: 8px 16px; border-radius: 999px; transition: color 0.25s ease, background 0.25s ease; }
        #view-toggle button.active { color: #fff; background: rgba(255, 255, 255, 0.1); }
        #view-toggle button:hover { color: #fff; }
        #sound-toggle { width: 42px; height: 42px; border-radius: 999px; display: none;
            align-items: center; justify-content: center; gap: 3px;
            background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); }
        body.spiral-mode #sound-toggle, body.hlist-mode #sound-toggle { display: flex; }
        #sound-toggle .bar { width: 2px; height: 12px; border-radius: 2px; background: rgba(255, 255, 255, 0.8); transform-origin: center; }
        #sound-toggle .bar:nth-child(1) { animation: eq 0.9s ease-in-out infinite; }
        #sound-toggle .bar:nth-child(2) { animation: eq 0.7s ease-in-out 0.15s infinite; }
        #sound-toggle .bar:nth-child(3) { animation: eq 1.1s ease-in-out 0.3s infinite; }
        @keyframes eq { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }
        #sound-toggle.muted .bar { animation: none; transform: scaleY(0.25); background: rgba(255, 255, 255, 0.35); }
        @media (max-width: 768px) {
            #spiral-hint { right: 1rem; }
            #spiral-eyebrow { top: 6.5rem; font-size: 10px; letter-spacing: 0.25em; }
        }
