:root {
    --bg: #110e1f;
    --surface: #1b1731;
    --surface-2: #241e40;
    --ink: #efecf8;
    --muted: #948daf;
    --accent: #ff7a59;
    --accent-soft: rgba(255, 122, 89, 0.14);
    --line: rgba(239, 236, 248, 0.09);
    --radius: 14px;
    --font-display: "Unbounded", sans-serif;
    --font-body: "Space Grotesk", sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* Le main occupe l'espace restant : footer collé en bas si peu de contenu. */
main {
    flex: 1 0 auto;
}

a {
    color: inherit;
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- fond animé d'onde (toutes les pages) ---------- */
#hero-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    opacity: 0.85;
}

/* ---------- topbar ---------- */
.topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px clamp(20px, 5vw, 56px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 18px;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.brand-logo {
    height: 30px;
    width: auto;
}

.brand-dot {
    color: var(--accent);
}

.topbar nav {
    display: flex;
    gap: 26px;
}

.topbar nav a {
    text-decoration: none;
    color: var(--muted);
    font-size: 15px;
    transition: color 0.2s;
}

.topbar nav a:hover {
    color: var(--ink);
}

/* ---------- bascule de langue FR / EN ---------- */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.lang-switch .lang-link {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1;
    color: var(--muted);
    transition:
        color 0.2s,
        background 0.2s;
}

.lang-switch .lang-link:hover {
    color: var(--ink);
}

.lang-switch .lang-link.active {
    color: var(--bg);
    background: var(--accent);
}

/* ---------- burger menu (mobile) ---------- */
.nav-toggle {
    display: none; /* visible uniquement sous le breakpoint mobile */
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0 10px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
}

.nav-toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition:
        transform 0.25s ease,
        opacity 0.2s ease;
}

@media (max-width: 720px) {
    .topbar {
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: flex;
    }

    .topbar nav {
        display: flex;
        flex-basis: 100%;
        flex-direction: column;
        gap: 2px;
        overflow: hidden;
        max-height: 0;
        margin-top: 0;
        opacity: 0;
        transform: translateY(-6px);
        transition:
            max-height 0.34s ease,
            opacity 0.25s ease,
            transform 0.34s ease,
            margin-top 0.34s ease;
    }

    .topbar.nav-open nav {
        max-height: 340px;
        margin-top: 16px;
        opacity: 1;
        transform: translateY(0);
    }

    .topbar nav a {
        padding: 13px 4px;
        font-size: 16px;
        color: var(--ink);
        border-bottom: 1px solid var(--line);
    }

    /* Animation burger → croix. */
    .topbar.nav-open .nav-toggle-bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .topbar.nav-open .nav-toggle-bar:nth-child(2) {
        opacity: 0;
    }

    .topbar.nav-open .nav-toggle-bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}

/* ---------- hero (centré) ---------- */
.hero {
    position: relative;
    z-index: 1;
    padding: clamp(50px, 10vh, 110px) clamp(20px, 5vw, 56px) 70px;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.hero-eyebrow {
    color: var(--accent);
    font-size: 13px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 22px;
}

.hero h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(38px, 7vw, 78px);
    line-height: 1.08;
    letter-spacing: -0.01em;
}

.hero h1 em {
    font-style: normal;
    color: var(--accent);
}

.hero-sub {
    margin: 28px auto 0;
    max-width: 545px;
    color: var(--muted);
    font-size: 18px;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 38px;
    padding: 13px 26px;
    border: 1px solid var(--accent);
    border-radius: 999px;
    color: var(--accent);
    text-decoration: none;
    font-size: 15px;
    letter-spacing: 0.04em;
    transition:
        background 0.25s,
        color 0.25s;
}

.hero-cta:hover {
    background: var(--accent);
    color: var(--bg);
}

/* ---------- marquee ---------- */
.marquee {
    position: relative;
    z-index: 1;
    overflow: hidden;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
    margin-bottom: 70px;
    -webkit-mask-image: linear-gradient(
        90deg,
        transparent,
        #000 8%,
        #000 92%,
        transparent
    );
    mask-image: linear-gradient(
        90deg,
        transparent,
        #000 8%,
        #000 92%,
        transparent
    );
}

.marquee-track {
    display: flex;
    gap: 0;
    width: max-content;
    animation: scroll 36s linear infinite;
}

.marquee-track span {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
    padding: 0 18px;
}

.marquee-track span::after {
    content: "✦";
    color: var(--accent);
    margin-left: 36px;
}

@keyframes scroll {
    to {
        transform: translateX(-50%);
    }
}

/* ---------- sections communes ---------- */
.section-eyebrow {
    color: var(--accent);
    font-size: 13px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.tracks h2,
.about h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 26px;
}

/* ---------- featured ---------- */
.featured {
    position: relative;
    z-index: 1;
    padding: 0 clamp(20px, 5vw, 56px) 80px;
    max-width: 1240px;
    margin: 0 auto;
}

.featured-card {
    display: grid;
    grid-template-columns: minmax(220px, 340px) 1fr;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition:
        border-color 0.3s,
        transform 0.3s;
}

.featured-card:hover {
    border-color: rgba(255, 122, 89, 0.45);
    transform: translateY(-3px);
}

.featured-cover {
    position: relative;
    min-height: 260px;
    background: var(--surface-2);
}

.featured-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-body {
    padding: clamp(24px, 4vw, 44px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 14px;
}

.featured-category {
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}

.featured-body h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(24px, 3.4vw, 38px);
    line-height: 1.15;
}

.featured-desc {
    color: var(--muted);
    max-width: 640px;
}

.featured-wave {
    width: 100%;
    align-self: stretch;
    height: 54px;
    display: block;
}

.featured-play {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    padding: 12px 24px;
    background: var(--accent);
    color: var(--bg);
    border: 0;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s;
}

.featured-play:hover {
    transform: scale(1.04);
}

/* ---------- tracks ---------- */
.tracks {
    position: relative;
    z-index: 1;
    padding: 0 clamp(20px, 5vw, 56px) 70px;
    max-width: 1240px;
    margin: 0 auto;
}

.tracks-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 34px;
}

.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    color: var(--ink);
    border-color: var(--muted);
}

.filter-btn.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.grid {
    position: relative; /* repère pour l'épinglage absolu des cards qui sortent (FLIP) */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

/* ---------- card ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-body);
    color: var(--ink);
    padding: 0;
    transition:
        transform 0.3s cubic-bezier(0.2, 0.7, 0.3, 1),
        border-color 0.3s,
        opacity 0.5s,
        translate 0.6s;
    opacity: 0;
    translate: 0 24px;
}

.card.visible {
    opacity: 1;
    translate: 0 0;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 122, 89, 0.45);
}

/* Filtrage fluide (FLIP, piloté en JS via la Web Animations API). */
.card.is-filtered {
    display: none;
}
.card.is-leaving {
    pointer-events: none;
}

/* Lien "Tout explorer" dans l'en-tête de la sélection (accueil). */
.tracks-more {
    font-size: 14px;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.tracks-more:hover {
    opacity: 0.75;
}

/* CTA "Explorer tout le catalogue" sous la grille (accueil). */
.explore-cta {
    display: flex;
    justify-content: center;
    margin-top: 44px;
}

.card-cover {
    position: relative;
    height: 180px;
    background: var(--surface-2);
    overflow: hidden;
}

.card-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform 0.5s ease,
        filter 0.4s;
}

.card:hover .card-cover img {
    transform: scale(1.05);
    filter: brightness(0.65);
}

.card-wave {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 64px;
    background: linear-gradient(transparent, rgba(17, 14, 31, 0.85));
}

.card-cover.no-img .card-wave {
    height: 100%;
    background: none;
}

.card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 18px;
}

.card-title {
    font-size: 16px;
    font-weight: 500;
}

.card-meta {
    margin-top: 3px;
    font-size: 13px;
    color: var(--muted);
}

.card-play {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 14px;
    transition:
        background 0.2s,
        border-color 0.2s;
}

.card:hover .card-play {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

/* ---------- stats ---------- */
.stats {
    display: flex;
    justify-content: center;
    gap: clamp(30px, 7vw, 90px);
    flex-wrap: wrap;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--line);
}

.stat {
    text-align: center;
    min-width: 130px;
}

.stat-value {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(26px, 4vw, 40px);
    color: var(--accent);
}

.stat-label {
    margin-top: 4px;
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- about ---------- */
.about {
    padding: 40px clamp(20px, 5vw, 56px) 90px;
    max-width: 1100px;
    margin: 0 auto;
}

.about > p {
    margin-top: 18px;
    color: var(--muted);
    /* max-width: 700px; */
}

.about a {
    color: var(--accent);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
    margin-top: 44px;
}

.step {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 24px;
}

.step-num {
    font-family: var(--font-display);
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 0.1em;
}

.step h3 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 18px;
    margin: 12px 0 10px;
}

.step p {
    font-size: 15px;
    color: var(--muted);
}

/* ---------- footer ---------- */
.footer {
    padding: 44px clamp(20px, 5vw, 56px) 26px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px 64px;
    flex-wrap: wrap;
    padding-bottom: 32px;
}

.footer-brand {
    max-width: 320px;
}

.footer-tagline {
    margin-top: 12px;
    line-height: 1.6;
}

.footer-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
}

.footer-title {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 5px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.footer a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--accent);
}

/* la marque du footer garde l'encre du wordmark, pas le gris des liens */
.footer-brand .brand {
    color: var(--ink);
}

/* ---------- lecteur en barre (style Suno, persistant) ---------- */
.player-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: linear-gradient(
        180deg,
        rgba(36, 30, 64, 0.94),
        rgba(17, 14, 31, 0.98)
    );
    border-top: 1px solid var(--line);
    backdrop-filter: blur(10px);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}

.player-bar[hidden] {
    display: none;
}

.player-bar.is-open {
    transform: none;
}

/* Évite que le bas de page soit masqué par la barre fixe. */
body.player-open {
    padding-bottom: clamp(110px, 16vh, 110px);
}

.player-bar-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: 1500px;
    margin: 0 auto;
    padding: 10px clamp(14px, 4vw, 40px);
}

.player-bar-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 1 280px;
    min-width: 0;
}

.player-bar-cover {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--surface-2);
    flex-shrink: 0;
}

.player-bar-text {
    min-width: 0;
}

.player-bar-title {
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-bar-category {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* zone centrale : transport + progression */
.player-bar-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 14px;
}

.player-ctrl {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition:
        color 0.2s,
        transform 0.15s;
}

.player-ctrl svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.player-ctrl:hover {
    color: var(--ink);
}

.player-play {
    width: 44px;
    height: 44px;
    background: var(--accent);
    color: var(--bg);
}

.player-play:hover {
    color: var(--bg);
    transform: scale(1.05);
}

.player-play svg {
    width: 24px;
    height: 24px;
}

/* shuffle / repeat : boutons de mode, accentués quand actifs */
.player-mode {
    position: relative;
}

.player-mode svg {
    width: 18px;
    height: 18px;
}

.player-mode.is-active,
.player-mode.is-active:hover {
    color: var(--accent);
}

/* badge « 1 » du mode répétition d'un seul morceau */
.player-mode.is-one::after {
    content: '1';
    position: absolute;
    top: 1px;
    right: 3px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

.player-play .icon-pause {
    display: none;
}

.player-play.is-playing .icon-play {
    display: none;
}

.player-play.is-playing .icon-pause {
    display: block;
}

.player-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 640px;
}

.player-time {
    width: 38px;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.player-time:last-child {
    text-align: right;
}

/* curseurs (seek + volume) */
.player-seek,
.player-vol {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 999px;
    background: var(--line);
    cursor: pointer;
}

.player-seek {
    flex: 1;
}

.player-seek::-webkit-slider-thumb,
.player-vol::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 13px;
    height: 13px;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.player-seek::-moz-range-thumb,
.player-vol::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.player-bar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 0 1 240px;
    flex-shrink: 0;
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-vol-icon {
    width: 20px;
    height: 20px;
    fill: var(--muted);
    flex-shrink: 0;
}

.player-vol {
    width: 90px;
}

.player-bar-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 17px;
    text-decoration: none;
    cursor: pointer;
    transition:
        color 0.2s,
        border-color 0.2s;
}

.player-bar-btn:hover {
    color: var(--ink);
    border-color: var(--muted);
}

/* carte en cours de lecture */
.card.is-playing {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

@media (max-width: 860px) {
    .player-volume {
        display: none; /* sur mobile : volume géré par l'appareil */
    }
}

@media (max-width: 680px) {
    .player-bar-inner {
        flex-wrap: wrap;
        gap: 10px 16px;
    }
    .player-bar-meta {
        flex: 1 1 auto;
        order: 1;
    }
    .player-bar-actions {
        flex-basis: auto;
        order: 2;
    }
    .player-bar-main {
        order: 3;
        flex-basis: 100%;
    }
}

/* ---------- votes : bouton + pill ---------- */
.vote-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(17, 14, 31, 0.72);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition:
        transform 0.18s,
        border-color 0.2s,
        color 0.2s;
}

.vote-btn:hover {
    transform: scale(1.06);
    border-color: var(--accent);
}

.vote-btn .vote-heart {
    color: var(--muted);
    transition:
        color 0.2s,
        transform 0.2s;
}

.vote-btn.liked {
    border-color: var(--accent);
    color: var(--accent);
}

.vote-btn.liked .vote-heart {
    color: var(--accent);
    transform: scale(1.15);
}

.vote-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.vote-count {
    font-variant-numeric: tabular-nums;
}

.card-pill {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--bg);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 14px rgba(255, 122, 89, 0.4);
}

/* ---------- responsive & accessibilité ---------- */
@media (max-width: 720px) {
    .featured-card {
        grid-template-columns: 1fr;
    }
    .featured-cover {
        min-height: 200px;
    }
}

@media (max-width: 560px) {
    .hero-sub {
        font-size: 16px;
    }
    .modal-card {
        margin: 20px 14px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    #hero-canvas {
        display: none;
    }
    .marquee-track {
        animation: none;
    }
    .card,
    .modal-card {
        animation: none;
        transition: none;
        opacity: 1;
        translate: none;
    }
}
