/* =========================================================
   ECHORYS — feuille de style
   Direction : "tableau noir de salle de classe"
   - vert tableau profond en fond de section forte
   - accent craie/menthe (le vert de marque existant)
   - jaune surligneur pour les nouveautés
   - cartes façon post-it épinglés pour le changelog
   - ondes sonores pour les boutons de lecture
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&display=swap');

/* ----- RESET & BASES ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #d1fae5;

    --board: #0e2018;        /* vert tableau noir profond */
    --board-soft: #16301f;   /* variante plus claire du tableau */
    --chalk: #f4f7f1;        /* blanc "craie" légèrement vert */

    --bg-main: #ffffff;
    --bg-alt: #f4f7f2;
    --text-main: #10241a;
    --text-muted: #5f7267;
    --border: #e0e8e0;

    --amber: #d97706;
    --amber-light: #fef3c7;
    --danger: #ef4444;

    --font-display: 'Space Grotesk', 'Outfit', sans-serif;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --ease: cubic-bezier(.22, 1, .36, 1);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: var(--font-display);
}

::selection {
    background: var(--primary);
    color: white;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary-dark);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ----- HEADER ----- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.1rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px) saturate(140%);
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-decoration: none;
    color: var(--text-main);
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background: var(--primary);
    transform: scaleX(0.55);
    transform-origin: left;
    transition: transform 0.35s var(--ease);
}

.logo:hover::after {
    transform: scaleX(1);
}

.badge-v {
    background-color: var(--board);
    color: var(--primary-light);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding-bottom: 2px;
    transition: color 0.2s;
}

nav a::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s var(--ease);
}

nav a:hover {
    color: var(--text-main);
}

nav a:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.nav-back {
    font-size: 0.9rem;
    border-left: 1px solid var(--border);
    padding-left: 2rem;
}

/* ----- MENU MOBILE (HAMBURGER) ----- */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ----- BOUTONS ----- */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.85rem 2rem;
    text-decoration: none;
    font-weight: 600;
    border-radius: 999px;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s var(--ease);
    position: relative;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    overflow: hidden;
    isolation: isolate;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.35) 48%, transparent 66%);
    transform: translateX(-120%);
    transition: transform 0.6s var(--ease);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover::before {
    transform: translateX(120%);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--bg-alt);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* ----- HERO SECTION ----- */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8rem 2rem 4rem 2rem;
    position: relative;
    background:
        radial-gradient(circle at 50% 0%, var(--primary-light) 0%, transparent 55%);
    overflow: hidden;
}

.hero::before {
    /* fine trame façon poussière de craie, très discrète */
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(15, 32, 24, 0.05) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: radial-gradient(circle at 50% 20%, black 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    animation: slideUp 0.8s var(--ease);
    position: relative;
}

.badge-update {
    display: inline-block;
    background-color: var(--amber-light);
    color: var(--amber);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2rem;
    border: 1px solid #fde68a;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    line-height: 1.12;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    letter-spacing: -1.2px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ----- SECTIONS GENERIQUES ----- */
section[id] {
    scroll-margin-top: 100px;
}

.section-container {
    padding: 6rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.bg-gray {
    background-color: var(--bg-alt);
    max-width: 100%;
}

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

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* ----- FONCTIONNALITES (3 colonnes) ----- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 3rem;
}

.feature-box {
    text-align: center;
    padding: 2rem;
    border-radius: var(--radius-lg);
    transition: transform 0.3s var(--ease), background-color 0.3s var(--ease);
}

.feature-box:hover {
    background-color: var(--bg-alt);
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 2.6rem;
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    transition: transform 0.3s var(--ease), border-radius 0.3s var(--ease);
}

.feature-box:hover .feature-icon {
    transform: rotate(-6deg) scale(1.05);
    border-radius: 50% 40% 45% 50%;
}

.feature-box h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.feature-box p {
    color: var(--text-muted);
}

/* ----- LANGUES ----- */
.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.language-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.2rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-weight: 500;
    color: var(--text-main);
    transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.language-item:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 8px 20px -10px rgba(16, 185, 129, 0.35);
}

.language-flag {
    font-size: 1.4rem;
    line-height: 1;
}

@media (max-width: 700px) {
    .languages-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.75rem;
    }
    .language-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* ----- NOUVEAUTES (CHANGELOG — cartes "post-it" épinglées) ----- */
.changelog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
    gap: 1.75rem 1.5rem;
    padding-top: 0.5rem;
}

.changelog-item {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    background: var(--bg-main);
    padding: 1.6rem 1.5rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    position: relative;
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

/* petite "épingle" en haut de chaque carte */
.changelog-item::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 28px;
    width: 22px;
    height: 14px;
    background: var(--amber-light);
    border: 1px solid #fde68a;
    border-radius: 3px;
    transform: rotate(-4deg);
}

.changelog-grid .changelog-item:nth-child(3n+1) { transform: rotate(-0.6deg); }
.changelog-grid .changelog-item:nth-child(3n+2) { transform: rotate(0.5deg); }
.changelog-grid .changelog-item:nth-child(3n)   { transform: rotate(-0.3deg); }

.changelog-item:hover {
    transform: rotate(0deg) translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 14px 28px -18px rgba(15, 32, 24, 0.35);
}

.changelog-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    background: var(--primary-light);
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.changelog-text h3 {
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.changelog-text p {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.changelog-text a {
    color: var(--primary-dark);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed var(--primary);
}

.changelog-text a:hover {
    border-bottom-style: solid;
}

/* ----- LISTE DES SONNERIES ----- */
.sounds-list {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
}

.sound-item {
    display: flex;
    align-items: center;
    background: var(--bg-main);
    padding: 1rem 1.2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}


.sound-item:hover {
    transform: translateX(6px);
    box-shadow: 0 10px 24px -16px rgba(15, 32, 24, 0.4);
}

.sound-icon {
    font-size: 1.7rem;
    margin-right: 1.8rem;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
    border-radius: 50%;
    text-align: center;
}

.sound-details {
    flex-grow: 1;
}

.sound-details h3 {
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}

/* ----- LECTEUR AUDIO (bouton "haut-parleur" avec ondes) ----- */
.play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    min-width: 46px;
    margin-left: auto;
    border-radius: 50%;
    border: none;
    background-color: var(--primary);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s, transform 0.2s;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

/* anneaux d'onde sonore au survol — clin d'oeil aux sonneries */
.play-btn::before,
.play-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid var(--primary);
    opacity: 0;
}

.play-btn:hover::before,
.play-btn:hover::after {
    animation: soundRing 1.3s var(--ease) infinite;
}

.play-btn:hover::after {
    animation-delay: 0.4s;
}

@keyframes soundRing {
    0% { transform: scale(1); opacity: 0.55; }
    100% { transform: scale(1.9); opacity: 0; }
}

.play-btn:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

.play-btn:active {
    transform: scale(0.95);
}

.play-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.play-label {
    display: none;
}

/* ----- BADGES COMMANDES (v1 / v2) ----- */
.cmd-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cmd-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tag-new,
.tag-update {
    font-family: 'Outfit', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.tag-new {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.tag-update {
    background-color: var(--amber-light);
    color: var(--amber);
}

/* ----- TERMINAL COMMANDES ----- */
.terminal-mockup {
    background-color: var(--board);
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 24px 48px -18px rgba(14, 32, 24, 0.45), 0 0 0 1px rgba(255,255,255,0.04);
}

.terminal-header {
    background-color: var(--board-soft);
    padding: 1rem;
    display: flex;
    align-items: center;
    position: relative;
}

.terminal-dots {
    display: flex;
    gap: 8px;
}

.terminal-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.terminal-dots span:nth-child(1) { background-color: #ef4444; }
.terminal-dots span:nth-child(2) { background-color: #eab308; }
.terminal-dots span:nth-child(3) { background-color: #22c55e; }

.terminal-title {
    position: absolute;
    width: 100%;
    text-align: center;
    color: #9db8a8;
    font-size: 0.9rem;
    font-family: monospace;
    pointer-events: none;
}

.terminal-body {
    padding: 2rem;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    color: var(--chalk);
}

.cmd-line {
    margin-bottom: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.cmd-line:not(.comment):not(.empty):hover {
    background-color: rgba(255, 255, 255, 0.04);
}

.cmd-line.empty {
    height: 1rem;
}

.cmd-line.comment {
    color: #6b8577;
    font-style: italic;
    margin-top: 1rem;
}

.cmd-prompt { color: var(--primary); font-weight: bold; }
.cmd-name { color: #38bdf8; font-weight: bold; }
.cmd-arg { color: #fde047; }
.cmd-desc { color: #6b8577; margin-left: auto; }

/* ----- CTA SECTION ----- */
.cta-section {
    text-align: center;
    padding: 6rem 2rem;
    background: var(--board);
    color: var(--chalk);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 120%, rgba(16, 185, 129, 0.35), transparent 60%);
    pointer-events: none;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    position: relative;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.85;
    position: relative;
}

.cta-section .btn {
    position: relative;
}

.cta-btn {
    background-color: var(--chalk);
    color: var(--board);
}

.cta-btn:hover {
    background-color: white;
    color: var(--primary-dark);
}

/* ----- FOOTER ----- */
footer {
    background-color: var(--text-main);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-logo span {
    font-size: 0.8rem;
    font-weight: normal;
    color: var(--primary-light);
}

footer a {
    color: var(--primary-light);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.copyright {
    color: rgba(255,255,255,0.5);
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* ----- RESPONSIVE ----- */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    header {
        padding: 1rem 1.5rem;
        position: fixed;
    }

    .logo { font-size: 1.5rem; }

    .menu-toggle { display: flex; }

    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: #ffffff;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 12px 24px -12px rgba(0,0,0,0.15);
        padding: 0.5rem 1.5rem 1rem 1.5rem;
    }

    nav.open { display: flex; }

    nav a {
        padding: 0.9rem 0;
        border-bottom: 1px solid var(--border);
        font-size: 1rem;
    }

    nav a:last-child { border-bottom: none; }

    .nav-back {
        border-left: none;
        padding-left: 0;
        margin-top: 0.3rem;
        color: var(--primary);
        font-weight: 600;
    }

    .hero { padding: 7.5rem 1.2rem 3rem 1.2rem; min-height: unset; }
    .badge-update { font-size: 0.8rem; padding: 0.35rem 0.8rem; }
    .hero p { font-size: 1.05rem; }
    .hero-buttons { flex-direction: column; width: 100%; }
    .hero-buttons .btn { width: 100%; justify-content: center; }

    .section-container { padding: 3.5rem 1.2rem; }
    .section-header { margin-bottom: 2.5rem; }
    .section-header h2 { font-size: clamp(1.6rem, 7vw, 2.2rem); }
    .section-header p { font-size: 1rem; }

    .features-grid { gap: 1.5rem; }
    .feature-box { padding: 1rem; }

    .changelog-grid { gap: 1.2rem; }
    .changelog-item { padding: 1.2rem; gap: 1rem; transform: none !important; }
    .changelog-item::before { left: 20px; }
    .changelog-icon { width: 40px; height: 40px; font-size: 1.2rem; }
    .changelog-text h3 { font-size: 1rem; }
    .changelog-text p { font-size: 0.88rem; }

    .sounds-list { gap: 0.9rem; }
    .sound-item {
        flex-direction: column;
        text-align: center;
        padding: 1.2rem;
        border-left-width: 3px;
    }
    .sound-icon { margin: 0 0 0.8rem 0; }
    .sound-details h3 { justify-content: center; font-size: 1.05rem; }

    .play-btn {
        width: 100%;
        height: 46px;
        border-radius: 999px;
        margin: 1rem 0 0 0;
        gap: 0.6rem;
        font-size: 0.95rem;
        font-weight: 600;
    }
    .play-label {
        display: inline;
        font-family: 'Outfit', sans-serif;
    }

    .cmd-legend { flex-direction: column; align-items: center; gap: 0.6rem; }

    .terminal-mockup { border-radius: 14px; }
    .terminal-header { padding: 0.8rem; }
    .terminal-title { font-size: 0.75rem; }
    .terminal-body { padding: 1.2rem; font-size: 0.82rem; }
    .cmd-line { gap: 0.4rem; margin-bottom: 0.7rem; }
    .cmd-desc { margin-left: 0; width: 100%; }
    .tag-new, .tag-update { font-size: 0.6rem; padding: 0.12rem 0.5rem; }

    .cta-section { padding: 4rem 1.2rem; }
    .cta-section h2 { font-size: clamp(1.6rem, 7vw, 2.2rem); }
    .cta-section p { font-size: 1rem; }

    footer { padding: 3rem 1.2rem; }
}

@media (max-width: 420px) {
    .hero h1 { font-size: 2rem; }
    .terminal-body { font-size: 0.75rem; }
    .cmd-name { word-break: break-word; }
}