/* ============================================
   ALFRED — LE JARDINIER DE DONNÉES
   Styles immersifs & narratifs
   ============================================ */

/* ---- Variables & Reset ---- */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: rgba(255, 255, 255, 0.03);
    --text-primary: #f0ece2;
    --text-secondary: rgba(240, 236, 226, 0.6);
    --text-muted: rgba(240, 236, 226, 0.35);
    --accent-green: #4ade80;
    --accent-gold: #fbbf24;
    --accent-blue: #60a5fa;
    --accent-purple: #c084fc;
    --accent-warm: #fb923c;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Inter', -apple-system, sans-serif;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out-quint: cubic-bezier(0.83, 0, 0.17, 1);
}

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

html {
    scroll-behavior: auto; /* Géré par JS */
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    cursor: none;
    -webkit-font-smoothing: antialiased;
}

/* ---- Canvas de fond ---- */
#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ---- Curseur personnalisé ---- */
.cursor {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transition: transform 0.1s ease;
    mix-blend-mode: screen;
    box-shadow: 0 0 20px var(--accent-green), 0 0 60px rgba(74, 222, 128, 0.3);
}

.cursor-follower {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.3s var(--ease-out-expo), width 0.3s, height 0.3s, border-color 0.3s;
}

.cursor-follower.hover {
    width: 60px;
    height: 60px;
    border-color: var(--accent-gold);
}

/* ---- Navigation ---- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: transparent;
    transition: background 0.5s ease, backdrop-filter 0.5s ease;
}

.nav.scrolled {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--accent-green);
    text-shadow: 0 0 30px rgba(74, 222, 128, 0.3);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-green);
    transition: width 0.4s var(--ease-out-expo);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-green);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-scroll-indicator {
    width: 2px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1px;
    overflow: hidden;
}

.scroll-progress {
    width: 100%;
    height: 0%;
    background: linear-gradient(to bottom, var(--accent-green), var(--accent-gold));
    border-radius: 1px;
    transition: height 0.1s linear;
}

/* ---- Sections communes ---- */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 6rem 2rem;
}

.section-content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 300;
    line-height: 1.15;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

/* ---- Section Hero (Étincelle) ---- */
.section-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 300;
    line-height: 1.1;
    text-align: center;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-green) 50%, var(--accent-gold) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease infinite;
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 300;
    text-align: center;
    color: var(--text-secondary);
    letter-spacing: 0.15em;
}

.hero-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 40px var(--accent-green), 0 0 100px rgba(74, 222, 128, 0.4);
    animation: particlePulse 3s ease-in-out infinite;
}

.hero-hint {
    text-align: center;
    margin-top: 4rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
}

.scroll-arrow {
    margin: 1rem auto 0;
    width: 20px;
    height: 30px;
    position: relative;
}

.scroll-arrow-line {
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-green), transparent);
    margin: 0 auto;
    animation: scrollBounce 2s ease-in-out infinite;
}

/* ---- Section Germination ---- */
.section-germination {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seed-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.seed {
    position: relative;
    width: 120px;
    height: 120px;
    cursor: pointer;
}

.seed-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, var(--accent-green), rgba(74, 222, 128, 0.2));
    border-radius: 50%;
    box-shadow: 0 0 30px var(--accent-green);
    transition: all 0.8s var(--ease-out-expo);
}

.seed-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 50%;
    transition: all 0.8s var(--ease-out-expo);
}

.seed:hover .seed-core {
    transform: translate(-50%, -50%) scale(1.5);
    box-shadow: 0 0 60px var(--accent-green);
}

.seed:hover .seed-ring {
    width: 100px;
    height: 100px;
    border-color: rgba(74, 222, 128, 0.5);
}

.seed-text h2 {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 300;
    text-align: center;
    margin-bottom: 0.5rem;
}

.seed-text p {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
}

.seed-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.seed-prompt input {
    width: 100%;
    max-width: 400px;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.seed-prompt input:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 30px rgba(74, 222, 128, 0.1);
}

.hold-btn {
    position: relative;
    padding: 1rem 2.5rem;
    background: transparent;
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 50px;
    color: var(--accent-green);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.hold-btn:hover {
    border-color: var(--accent-green);
    box-shadow: 0 0 30px rgba(74, 222, 128, 0.2);
}

.hold-btn:active {
    transform: scale(0.98);
}

.hold-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, rgba(74, 222, 128, 0.15), rgba(74, 222, 128, 0.3));
    transition: width 0.1s linear;
}

/* ---- Section Forêt ---- */
.section-foret {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.section-foret .section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.forest-container {
    width: 100%;
    max-width: 800px;
    height: 400px;
    margin: 0 auto 4rem;
    position: relative;
}

.forest-node {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.5s var(--ease-out-expo), box-shadow 0.5s;
    cursor: pointer;
}

.forest-node:hover {
    transform: scale(1.3) !important;
    box-shadow: 0 0 40px rgba(74, 222, 128, 0.4) !important;
}

.forest-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(74, 222, 128, 0.3), transparent);
    transform-origin: left center;
}

.capabilities {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.cap-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    transition: transform 0.5s var(--ease-out-expo), border-color 0.5s, box-shadow 0.5s;
    opacity: 0;
    transform: translateY(40px);
}

.cap-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.cap-card:hover {
    transform: translateY(-5px);
    border-color: rgba(74, 222, 128, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.cap-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.cap-card h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
    color: var(--accent-green);
}

.cap-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ---- Section Fruit ---- */
.section-fruit {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fruit-visual {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    pointer-events: none;
}

.fruit-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid rgba(251, 191, 36, 0.1);
    position: relative;
    animation: fruitRotate 20s linear infinite, fruitPulse 6s ease-in-out infinite;
}

.fruit-circle::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    width: 4px;
    height: 4px;
    background: var(--accent-gold);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--accent-gold);
}

.fruit-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.fruit-content .section-title {
    margin-bottom: 1rem;
}

.fruit-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.fruit-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid rgba(251, 191, 36, 0.1);
    border-radius: 16px;
    max-width: 400px;
    margin: 0 auto;
}

.stat-number {
    font-family: var(--font-serif);
    font-size: 4rem;
    font-weight: 300;
    color: var(--accent-gold);
    text-shadow: 0 0 40px rgba(251, 191, 36, 0.3);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

/* ---- Section Écosystème ---- */
.section-ecosysteme {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
}

.section-ecosysteme .section-title {
    text-align: center;
    margin-bottom: 2rem;
    max-width: 700px;
}

.eco-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin-bottom: 4rem;
    line-height: 1.7;
}

.eco-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 900px;
}

.eco-feature {
    text-align: center;
    padding: 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s var(--ease-out-expo);
}

.eco-feature.visible {
    opacity: 1;
    transform: translateY(0);
}

.eco-feature-num {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 300;
    color: var(--accent-green);
    opacity: 0.3;
    margin-bottom: 1rem;
}

.eco-feature h4 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.eco-feature p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ---- Section Semis (CTA) ---- */
.section-semis {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.pot-container {
    position: relative;
    width: 120px;
    height: 80px;
    margin-bottom: 3rem;
}

.pot {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #8B4513, #A0522D);
    clip-path: polygon(10% 0%, 90% 0%, 100% 100%, 0% 100%);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.pot-soil {
    position: absolute;
    top: -5px;
    left: 10%;
    width: 80%;
    height: 10px;
    background: #3d2b1f;
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.section-semis .section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 3rem;
}

.cta-btn {
    position: relative;
    display: inline-block;
    padding: 1.2rem 3.5rem;
    background: linear-gradient(135deg, var(--accent-green), #22c55e);
    color: var(--bg-primary);
    text-decoration: none;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    border-radius: 50px;
    overflow: hidden;
    transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s;
}

.cta-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 60px rgba(74, 222, 128, 0.3);
}

.cta-btn-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 60%);
    animation: ctaGlow 3s ease-in-out infinite;
}

.footer-text {
    margin-top: 4rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 0.15em;
}

/* ---- Animations ---- */
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes particlePulse {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.5); }
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(8px); opacity: 0.3; }
}

@keyframes fruitRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes ctaGlow {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(10%, 10%); }
    66% { transform: translate(-10%, -10%); }
}

@keyframes ctaPulse {
    0%, 100% { box-shadow: 0 0 0 rgba(74, 222, 128, 0); }
    50% { box-shadow: 0 0 40px rgba(74, 222, 128, 0.4); }
}

@keyframes seedBloom {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(4); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

@keyframes fruitPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

/* ---- Fade-in animations ---- */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

/* ---- Grain overlay ---- */
.grain {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    animation: grainMove 0.5s steps(1) infinite;
}

@keyframes grainMove {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-2%, -2%); }
    50% { transform: translate(2%, 2%); }
    75% { transform: translate(-1%, 1%); }
    100% { transform: translate(1%, -1%); }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .nav {
        padding: 1rem 1.5rem;
    }

    .nav-links {
        display: none;
    }

    .section {
        padding: 4rem 1.5rem;
    }

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

    .eco-features {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .fruit-visual {
        width: 300px;
        height: 300px;
        opacity: 0.3;
    }

    .hero-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .stat-number {
        font-size: 3rem;
    }

    .cap-card {
        padding: 1.5rem;
    }
}

/* ---- Section Jardin Nocturne ---- */
.section-nocturne {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 50%, #0a0a1a 0%, #050510 100%);
    position: relative;
    overflow: hidden;
}

.nocturne-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.nocturne-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.nocturne-text {
    font-family: var(--font-serif);
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 3rem;
    line-height: 1.8;
    font-style: italic;
}

.nocturne-flowers {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 3rem;
}

.flower {
    font-size: 2.5rem;
    opacity: 0;
    transform: translateY(20px) scale(0.5);
    transition: all 1s var(--ease-out-expo);
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.3));
}

.flower.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.flower:hover {
    filter: drop-shadow(0 0 25px rgba(251, 191, 36, 0.6));
    transform: scale(1.3) !important;
}

.nocturne-end {
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    font-style: italic;
}
