
:root {
    --ink: #d0d0d0;
    --paper: #2a134a;
    --accent: #e03fb8;
    --muted: #cacaca;
    --border: #b73497;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--paper);
    color: var(--ink);
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

/* ── NAV ── */
nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 2.5rem;
    background: #361860;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    font-family: 'DM Serif Display', serif;
    font-size: 1.3rem; letter-spacing: -0.02em;
    color: var(--ink);
    text-decoration: none;
    flex-shrink: 0;
}
.nav-logo span { color: var(--accent); font-style: italic; }

.nav-links { display: flex; gap: 1.2rem; list-style: none; align-items: center; }
.nav-links a {
    font-size: 0.82rem; font-weight: 500; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--muted);
    text-decoration: none; transition: color .2s; white-space: nowrap;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.nav-active { color: var(--ink); border-bottom: 1px solid var(--accent); padding-bottom: 2px; }

.nav-cta {
    background: var(--ink); color: var(--paper) !important;
    padding: .4rem 1rem; border-radius: 2px;
    font-size: 0.78rem !important; font-weight: 500 !important;
    letter-spacing: 0.06em !important;
    transition: background .2s !important;
}
.nav-cta:hover { background: var(--accent) !important; color: #fff !important; }

.nav-cta-logout {
    background: rgba(183,28,28,.25) !important;
    color: #ef9a9a !important;
    border: 1px solid rgba(183,28,28,.4);
}
.nav-cta-logout:hover { background: #b71c1c !important; color: #fff !important; }

.nav-pseudo {
    font-size: 0.78rem; color: var(--accent);
    font-weight: 500; letter-spacing: .04em;
    text-decoration: none; display: flex; align-items: center; gap: .4rem;
}
.nav-pseudo:hover { color: #fff; }

.nav-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    object-fit: cover; border: 1px solid var(--accent);
    vertical-align: middle;
}

/* ── HERO ── */
.hero {
    min-height: 100vh;
    display: grid; grid-template-columns: 1fr 1fr;
    padding-top: 62px;
}

.hero-left {
    display: flex; flex-direction: column; justify-content: center;
    padding: 5rem 3rem 5rem 5rem;
    animation: fadeUp .8s ease both;
}

.hero-tag {
    font-size: 0.72rem; font-weight: 500; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--accent); margin-bottom: 1.2rem;
}

.hero-title {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(2.5rem, 4.5vw, 4.5rem);
    line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 1.5rem;
}
.hero-title em { font-style: italic; color: var(--accent); }

.hero-desc {
    font-size: 0.95rem; font-weight: 300; line-height: 1.75;
    color: #b4b4b4; max-width: 400px; margin-bottom: 2rem;
}

.hero-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

.btn-primary-custom {
    background: var(--ink); color: var(--paper);
    padding: .8rem 1.8rem; border: none; border-radius: 2px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem; font-weight: 500; letter-spacing: 0.05em;
    text-transform: uppercase; cursor: pointer;
    transition: background .2s, transform .15s;
    text-decoration: none; display: inline-block;
}
.btn-primary-custom:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }

.btn-ghost {
    font-size: 0.85rem; font-weight: 400; color: var(--muted);
    text-decoration: none; letter-spacing: 0.02em;
    border-bottom: 1px solid var(--border); padding-bottom: 2px;
    transition: color .2s, border-color .2s;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--ink); }

.hero-right {
    position: relative; overflow: hidden; background: #1a1a1a;
    animation: fadeIn .8s ease .2s both;
}
.hero-right::before {
    content: '';
    position: absolute; inset: 0;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,.03) 39px, rgba(255,255,255,.03) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255,255,255,.03) 39px, rgba(255,255,255,.03) 40px);
}

.manga-grid {
    position: absolute; inset: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 6px; padding: 6px;
}

.manga-card { border-radius: 2px; overflow: hidden; position: relative; transition: transform .3s; }
.manga-card:hover { transform: scale(1.03); z-index: 2; }
.manga-card:nth-child(1) { grid-row: span 2; }
.manga-card:nth-child(4) { grid-column: span 2; }

.manga-card-inner {
    width: 100%; height: 100%; min-height: 80px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'DM Serif Display', serif;
    font-size: 0.7rem; letter-spacing: .1em; text-transform: uppercase;
    color: rgba(255,255,255,.5); position: relative;
}

.manga-card:nth-child(1) .manga-card-inner { background: linear-gradient(160deg, #2c1810 0%, #8b1a1a 100%); }
.manga-card:nth-child(2) .manga-card-inner { background: linear-gradient(160deg, #0d1f2d 0%, #1a3a5c 100%); }
.manga-card:nth-child(3) .manga-card-inner { background: linear-gradient(160deg, #1a1a2e 0%, #4a1942 100%); }
.manga-card:nth-child(4) .manga-card-inner { background: linear-gradient(160deg, #0f2318 0%, #1e4d2b 100%); }
.manga-card:nth-child(5) .manga-card-inner { background: linear-gradient(160deg, #2d1b00 0%, #7a4700 100%); }
.manga-card:nth-child(6) .manga-card-inner { background: linear-gradient(160deg, #1c0a1c 0%, #5c1a5c 100%); }
.manga-card:nth-child(7) .manga-card-inner { background: linear-gradient(160deg, #0a1a2e 0%, #1a3d6b 100%); }
.manga-card:nth-child(8) .manga-card-inner { background: linear-gradient(160deg, #1a0505 0%, #5c0000 100%); }

.manga-label {
    position: absolute; bottom: 8px; left: 10px; right: 10px;
    font-family: 'DM Serif Display', serif;
    font-size: 0.65rem; color: rgba(255,255,255,.6);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── STATS ── */
.stats {
    background: #401d71; color: #cacaca;
    padding: 2.5rem 4rem;
    display: grid; grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    animation: fadeUp .8s ease .3s both;
}

.stat-item {
    text-align: center; padding: .8rem 0;
    border-right: 1px solid rgba(255,255,255,.1);
}
.stat-item:last-child { border-right: none; }

.stat-number {
    font-family: 'DM Serif Display', serif;
    font-size: 2.5rem; line-height: 1; color: #fff;
}
.stat-number span { color: var(--accent); font-style: italic; }

.stat-label {
    font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
    color: rgba(255,255,255,.45); margin-top: .4rem;
}

/* ── FEATURES ── */
.features {
    padding: 5rem 4rem;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem;
}

.feature-item {
    padding: 2rem; border: 1px solid var(--border); border-radius: 2px;
    transition: border-color .2s, transform .2s;
    animation: fadeUp .6s ease both;
}
.feature-item:nth-child(2) { animation-delay: .1s; }
.feature-item:nth-child(3) { animation-delay: .2s; }
.feature-item:hover { border-color: var(--ink); transform: translateY(-4px); }

.feature-icon { font-size: 1.5rem; margin-bottom: 1.2rem; }
.feature-title { font-family: 'DM Serif Display', serif; font-size: 1.25rem; margin-bottom: .6rem; }
.feature-desc { font-size: 0.88rem; line-height: 1.7; color: #666; font-weight: 300; }

/* ── CTA BANNER ── */
.cta-banner {
    margin: 0 4rem 5rem;
    background: var(--ink); border-radius: 2px;
    padding: 3.5rem 4rem;
    display: flex; align-items: center; justify-content: space-between; gap: 2rem;
}

.cta-text { max-width: 500px; }
.cta-text h2 { font-family: 'DM Serif Display', serif; font-size: 2rem; color: #fff; line-height: 1.15; margin-bottom: .6rem; }
.cta-text h2 em { color: var(--accent); font-style: italic; }
.cta-text p { color: rgba(255,255,255,.5); font-size: .88rem; font-weight: 300; line-height: 1.6; }

.btn-accent {
    background: var(--accent); color: #fff;
    padding: .9rem 2rem; border: none; border-radius: 2px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem; font-weight: 500; letter-spacing: 0.05em;
    text-transform: uppercase; cursor: pointer; white-space: nowrap;
    transition: background .2s, transform .15s;
    text-decoration: none; display: inline-block;
}
.btn-accent:hover { background: #a93226; transform: translateY(-1px); color: #fff; }

/* ── FOOTER ── */
footer {
    border-top: 1px solid var(--border);
    padding: 1.8rem 4rem;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.78rem; color: var(--muted);
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--ink); }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── RESPONSIVE TABLETTE ── */
@media (max-width: 1024px) {
    nav { padding: .9rem 1.8rem; }
    .nav-links { gap: .9rem; }
    .stats { grid-template-columns: repeat(3, 1fr); padding: 2rem; }
    .features { grid-template-columns: 1fr 1fr; padding: 3rem 2rem; }
    .cta-banner { margin: 0 2rem 3rem; padding: 2.5rem 2.5rem; }
    footer { padding: 1.5rem 2rem; }
}

/* ── RESPONSIVE MOBILE ── */
@media (max-width: 768px) {
    /* Nav mobile */
    nav { padding: .85rem 1.2rem; }
    .nav-links { gap: .6rem; }
    .nav-links li.nav-user-info { display: none; } /* cache le pseudo, avatar visible via cta */
    .nav-links a { font-size: 0.72rem; letter-spacing: .02em; }
    .nav-cta { padding: .35rem .75rem; font-size: 0.72rem !important; }

    /* Hero mobile : colonne unique */
    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
        padding-top: 58px;
    }
    .hero-left {
        padding: 3rem 1.5rem 2rem;
        order: 1;
    }
    .hero-right {
        height: 42vw; min-height: 200px; max-height: 280px;
        order: 0;
    }

    /* Stats mobile : 2 colonnes */
    .stats { grid-template-columns: 1fr 1fr; padding: 1.5rem 1.2rem; gap: 1rem; }
    .stat-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,.1); padding: .6rem 0; }
    .stat-item:nth-child(odd) { border-right: 1px solid rgba(255,255,255,.1); }
    .stat-item:last-child { border-bottom: none; }
    .stat-number { font-size: 2rem; }

    /* Features mobile */
    .features { grid-template-columns: 1fr; padding: 2.5rem 1.2rem; gap: 1.2rem; }

    /* CTA mobile */
    .cta-banner { flex-direction: column; margin: 0 1.2rem 2.5rem; padding: 2rem 1.5rem; }
    .cta-text h2 { font-size: 1.6rem; }

    /* Footer mobile */
    footer { flex-direction: column; gap: .4rem; padding: 1.2rem 1.5rem; text-align: center; }
}

/* ── TRÈS PETIT ÉCRAN ── */
@media (max-width: 480px) {
    nav { padding: .75rem 1rem; }
    .nav-logo { font-size: 1.1rem; }
    .nav-links { gap: .4rem; }
    /* Sur très petit écran on cache "Communauté" si connecté pour sauver de la place */
    .nav-links li:not(:last-child):not(:first-child) { display: none; }
    .nav-links li:first-child { display: block; } /* Ma collection */
    .nav-links li:last-child { display: block; }  /* Déconnexion */

    .hero-title { font-size: 2rem; }
    .hero-desc { font-size: 0.88rem; }
    .stats { grid-template-columns: 1fr 1fr; }
}
