/* --- VARIABLES --- */
:root {
    --p: #00f2ff; /* Primary */
    --s: #7000ff; /* Secondary */
    --a: #ff00c1; /* Accent */
    --bg: #020205;
    --card-bg: #0a0a10;
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

/* --- RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    background: var(--bg); 
    color: #fff; 
    font-family: var(--font-main); 
    overflow-x: hidden; 
}

/* --- SCROLL ANIMATION --- */
.scroll-progress {
    position: fixed; top: 0; width: 100%; height: 5px;
    background: linear-gradient(90deg, var(--p), var(--a));
    transform-origin: 0 50%;
    animation: grow auto linear;
    animation-timeline: scroll();
    z-index: 100;
}
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* --- HERO --- */
.hero {
    height: 80vh; display: flex; flex-direction: column;
    justify-content: center; align-items: center; position: relative;
}
.glitch-text {
    font-size: clamp(3rem, 12vw, 8rem); font-weight: 900;
    background: linear-gradient(to bottom, #fff, #555);
    background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(0, 242, 255, 0.3));
}
.bg-grid {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(0,242,255,0.05) 1px, transparent 1px), 
                      linear-gradient(90deg, rgba(0,242,255,0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(circle, black, transparent 80%);
    z-index: -1;
}

/* --- SECTIONS LAYOUT --- */
.feature-card {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 4rem; min-height: 70vh; align-items: center; padding: 4rem 10%;
    view-timeline: --section;
    animation: reveal linear both; animation-timeline: --section;
    animation-range: entry 10% cover 30%;
}
.feature-card.reverse { direction: rtl; }
.feature-card.reverse .content, .feature-card.reverse .visual-demo { direction: ltr; }

@keyframes reveal {
    from { opacity: 0; transform: scale(0.9) translateY(50px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.tag { color: var(--p); font-family: var(--font-mono); font-weight: bold; }
h2 { font-size: 3rem; margin: 1rem 0; }
p { color: #888; margin-bottom: 2rem; }

/* --- CODE WINDOW --- */
.code-window {
    background: #000; border: 1px solid #222; padding: 1.5rem; border-radius: 12px;
    font-family: var(--font-mono); font-size: 0.8rem;
}
.token-selector { color: #50fa7b; }
.token-property { color: #8be9fd; }
.token-function { color: #f1fa8c; }
.token-variable { color: #bd93f9; }
.token-keyword { color: #ff79c6; }

/* --- VISUAL DEMOS --- */
.visual-demo {
    background: var(--card-bg); height: 350px; border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; border: 1px solid #222;
}

/* S2: Container Query Demo */
.resizable-box {
    width: 200px; height: 150px; resize: horizontal; overflow: auto;
    border: 2px dashed #444; padding: 10px; container-type: inline-size;
}
.inner-card {
    height: 100%; background: #1a1a1a; display: flex; 
    flex-direction: column; align-items: center; justify-content: center;
    transition: 0.4s; border-radius: 10px;
}
@container (min-width: 280px) {
    .inner-card { background: var(--s); flex-direction: row; gap: 15px; }
}

/* S3: Relative Color Lab */
.color-lab { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 20px; }
.color-swatch { 
    height: 100%; width: 100%; border-radius: 8px; display: flex; 
    align-items: center; justify-content: center; font-size: 0.7rem; font-weight: bold;
}
.main { background: var(--p); color: #000; }
.light { background: oklch(from var(--p) calc(l + .2) c h); color: #000; }
.dark { background: oklch(from var(--p) calc(l - .2) c h); }
.alpha { background: color-mix(in srgb, var(--p), transparent 60%); }

/* S4: Subgrid Demo */
.grid-parent { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: 90%; }
.grid-child { 
    display: grid; grid-template-rows: subgrid; grid-row: span 3; 
    background: #151515; padding: 15px; border-radius: 10px; gap: 10px;
}
.grid-child h3 { background: #222; padding: 5px; font-size: 1rem; }
.grid-child button { background: var(--p); border: none; padding: 5px; border-radius: 4px; }

/* S5: Anchor Demo */
.anchor-target { 
    background: var(--a); padding: 1rem; border-radius: 8px; 
    animation: float 3s infinite ease-in-out;
}
.anchor-popup {
    position: absolute; top: 65%; background: #fff; color: #000;
    padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: bold;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }

/* S6: Glass Demo */
.glass-demo { background: url('https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=800') center/cover; }
.glass-card {
    width: 60%; height: 40%; background: rgba(255,255,255,0.1);
    backdrop-filter: blur(0px); border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px; display: flex; align-items: center; justify-content: center;
    transition: 0.5s;
}
.glass-card:hover { backdrop-filter: blur(15px); background: rgba(255,255,255,0.2); }

/* --- CYBER FOOTER --- */
.cyber-footer {
    margin-top: 10rem; padding: 6rem 2rem; position: relative;
    background: #000; border-top: 1px solid #222; overflow: hidden;
    display: flex; justify-content: center; align-items: center; text-align: center;
}
.footer-content { position: relative; z-index: 2; max-width: 800px; }
.footer-logo {
    font-size: 3rem; font-weight: 900; letter-spacing: -2px;
    background: linear-gradient(90deg, var(--p), var(--s), var(--a));
    background-clip: text; -webkit-text-fill-color: transparent;
    animation: hueRotate 5s infinite linear;
}
@keyframes hueRotate { from { filter: hue-rotate(0); } to { filter: hue-rotate(360deg); } }

.logo-footer {
    height: 40px;
}

.footer-box {
    display: flex;
    align-items: center;
}

.footer-nav { display: flex; gap: 2rem; justify-content: center; margin-bottom: 3rem; }
.footer-nav a { 
    color: #888; text-decoration: none; font-family: var(--font-mono); font-size: 0.9rem;
    transition: 0.3s; display: flex; align-items: center; gap: 8px;
}
.footer-nav a:hover { color: var(--p); transform: translateY(-3px); }

.footer-status {
    font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase;
    color: #444; border: 1px solid #222; padding: 8px 20px; border-radius: 50px;
    display: inline-flex; align-items: center; gap: 10px; margin-bottom: 2rem;
}
.status-dot { width: 8px; height: 8px; background: #00ff00; border-radius: 50%; box-shadow: 0 0 10px #00ff00; }

.footer-credit { font-size: 0.8rem; color: #444; }

/* Animation d'arrière-plan du footer */
.footer-bg-animation {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, var(--s) 0%, transparent 70%);
    opacity: 0.1; filter: blur(100px); animation: pulse 10s infinite alternate;
}
@keyframes pulse { from { transform: scale(1); opacity: 0.1; } to { transform: scale(1.5); opacity: 0.2; } }

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .feature-card, .feature-card.reverse { grid-template-columns: 1fr; padding: 2rem; text-align: center; }
    .glitch-text { font-size: 4rem; }
    .visual-demo { order: -1; }
}