/**
 * ══════════════════════════════════════════════════════════════════════════════
 * LE GRIMOIRE DE THIBAULT — v2 IMMERSIVE
 * Manuscrit Ancien · Skeuomorphisme Fantastique
 * ══════════════════════════════════════════════════════════════════════════════
 */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Cinzel:wght@400;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=EB+Garamond:ital,wght@0,400;0,500;1,400;1,500&family=Uncial+Antiqua&family=MedievalSharp&display=swap');

/* ═══════════════════════════════════════════════════════════════════════════
   I. VARIABLES
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
    --paper:         #e8dcc8;
    --paper-light:   #f0e8d8;
    --paper-dark:    #d4c8aa;
    --paper-aged:    #c4b898;
    --paper-burnt:   #b0a080;
    --paper-stain:   #c8bc9c;

    --ink:           #1a1510;
    --ink-dark:      #110e08;
    --ink-brown:     #2e2418;
    --ink-sepia:     #44382a;
    --ink-faded:     #6a5a4a;
    --ink-light:     #8a7a6a;

    --gold:          #c9a832;
    --gold-dark:     #8a7020;
    --gold-light:    #e0c850;
    --gold-glow:     rgba(201, 168, 50, 0.4);
    --crimson:       #7a2230;
    --crimson-dark:  #501520;
    --crimson-light: #a03040;
    --crimson-glow:  rgba(122, 34, 48, 0.35);
    --leather:       #2a1a0e;
    --leather-mid:   #3d2816;
    --leather-light: #56381e;

    --font-ornate:   'Cinzel Decorative', serif;
    --font-title:    'Cinzel', serif;
    --font-body:     'Cormorant Garamond', serif;
    --font-text:     'EB Garamond', serif;
    --font-uncial:   'Uncial Antiqua', cursive;
    --font-medieval: 'MedievalSharp', cursive;

    --header-h:      62px;
    --page-w:        780px;
    --ease:          0.3s ease;

    --shadow-book:   0 2px 0 var(--paper-dark),
                     0 5px 0 var(--paper-aged),
                     0 8px 0 var(--paper-burnt),
                     0 14px 35px rgba(20,15,5,0.25);
    --shadow-card:   0 4px 20px rgba(20,15,5,0.15);
    --shadow-hover:  0 10px 35px rgba(20,15,5,0.25);
    --shadow-deep:   0 16px 50px rgba(10,8,4,0.35);

    --torn-radius:   255px 15px 225px 15px / 15px 225px 15px 255px;
    --torn-sm:       125px 8px 112px 8px / 8px 112px 8px 125px;

    /* Ornement SVG pour les cadres (frise celtique simplifiée) */
    --border-ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 20h40M20 0v40M5 5l30 30M35 5L5 35' stroke='%23c9a832' stroke-width='0.5' opacity='0.15'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
::selection { background: var(--gold-light); color: var(--ink); }

/* ═══════════════════════════════════════════════════════════════════════════
   II. FOND, TEXTURE & VIGNETTAGE
   ═══════════════════════════════════════════════════════════════════════════ */

body {
    font-family: var(--font-body);
    font-size: 1.08rem;
    line-height: 1.85;
    color: var(--ink-dark);
    /* Parchemin plus foncé/chaud + texture tissée */
    background:
        var(--border-ornament),
        linear-gradient(180deg, #d8ccb0 0%, var(--paper) 8%, var(--paper) 92%, #d0c4a8 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Couche de grain monochrome */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='5' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='0.12'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* Vignettage prononcé — ambiance conte au coin du feu */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(
        ellipse at 50% 45%,
        transparent 30%,
        rgba(20,14,5,0.15) 60%,
        rgba(10,6,2,0.45) 100%
    );
    pointer-events: none;
    z-index: 9998;
}

/* ═══════════════════════════════════════════════════════════════════════════
   III. TYPOGRAPHIE
   ═══════════════════════════════════════════════════════════════════════════ */

.prose {
    font-family: var(--font-text);
    font-size: 1.08rem;
    line-height: 1.9;
    color: var(--ink-brown);
}
.prose p {
    margin-bottom: 1.2rem;
    text-align: justify;
    hyphens: auto;
}
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { color: var(--crimson); font-style: italic; }

/* Lettrine avec ornement */
.lettrine::first-letter {
    float: left;
    font-family: var(--font-uncial);
    font-size: 4.2rem;
    line-height: 0.75;
    padding: 0.08rem 0.4rem 0 0;
    color: var(--crimson);
    text-shadow:
        1px 1px 0 rgba(201,168,50,0.3),
        2px 2px 4px rgba(0,0,0,0.15);
    /* Fond doré subtil derrière la lettrine */
    background: linear-gradient(135deg, rgba(201,168,50,0.08), transparent);
    border-bottom: 2px solid var(--gold);
}

.lead-text {
    font-family: var(--font-text);
    font-size: 1.15rem;
    font-style: italic;
    color: var(--ink-sepia);
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Exergue / citation */
.exergue {
    margin: 2rem 0.5rem;
    padding: 1.4rem 1.8rem 1.4rem 2rem;
    background:
        linear-gradient(135deg, rgba(201,168,50,0.06) 0%, transparent 60%),
        var(--paper-light);
    border-left: 4px solid var(--gold);
    border-right: 1px solid var(--paper-aged);
    border-top: 1px solid var(--paper-aged);
    border-bottom: 1px solid var(--paper-aged);
    position: relative;
    box-shadow: inset 3px 0 8px rgba(201,168,50,0.1);
}
.exergue::before {
    content: '\201C';
    position: absolute;
    top: -0.1rem; left: 0.8rem;
    font-family: var(--font-ornate);
    font-size: 3rem;
    color: var(--gold);
    opacity: 0.25;
    line-height: 1;
}
.exergue::after {
    content: '\201D';
    position: absolute;
    bottom: -0.4rem; right: 1rem;
    font-family: var(--font-ornate);
    font-size: 3rem;
    color: var(--gold);
    opacity: 0.15;
    line-height: 1;
}
.exergue p {
    font-family: var(--font-text);
    font-size: 1.08rem;
    font-style: italic;
    color: var(--ink-sepia);
    margin: 0;
    line-height: 1.7;
}
.exergue cite {
    display: block;
    margin-top: 0.7rem;
    font-size: 0.85rem;
    font-style: normal;
    color: var(--ink-faded);
    text-align: right;
    letter-spacing: 0.05em;
}

/* Ornements */
.fleuron {
    text-align: center;
    color: var(--gold);
    font-size: 1rem;
    letter-spacing: 0.5em;
    margin: 2rem 0;
    text-shadow: 0 0 8px var(--gold-glow);
}

.separator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin: 1.8rem 0;
}
.separator::before,
.separator::after {
    content: '';
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.separator span { color: var(--gold); font-size: 1rem; text-shadow: 0 0 6px var(--gold-glow); }

/* Titres de tomes */
.tome-header {
    text-align: center;
    margin-bottom: 2.2rem;
    padding-bottom: 1.8rem;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, transparent 5%, var(--gold) 30%, var(--gold-light) 50%, var(--gold) 70%, transparent 95%) 1;
}
.tome-number {
    display: block;
    font-family: var(--font-title);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.35em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
    text-shadow: 0 0 10px var(--gold-glow);
}
.tome-title {
    font-family: var(--font-ornate);
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.4rem;
    letter-spacing: 0.03em;
    text-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.tome-subtitle {
    font-family: var(--font-text);
    font-size: 1.02rem;
    font-style: italic;
    color: var(--ink-faded);
}
.tome-ornament {
    display: block;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--gold);
    letter-spacing: 0.6em;
    text-shadow: 0 0 8px var(--gold-glow);
}

.chapter-section { margin-bottom: 2rem; }
.section-heading {
    font-family: var(--font-title);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--crimson);
    text-align: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid transparent;
    border-image: linear-gradient(90deg, transparent 20%, var(--crimson-glow) 50%, transparent 80%) 1;
}

.text-crimson { color: var(--crimson); }
.text-gold { color: var(--gold); }

/* ═══════════════════════════════════════════════════════════════════════════
   IV. HEADER — BANNIÈRE MÉDIÉVALE SUSPENDUE
   ═══════════════════════════════════════════════════════════════════════════ */

.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    /* Dégradé cuir profond avec coutures */
    background:
        /* Grain cuir */
        url("data:image/svg+xml,%3Csvg viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='l'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2.5' numOctaves='4'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23l)' opacity='0.07'/%3E%3C/svg%3E"),
        /* Dégradé 3D — bombé au centre */
        linear-gradient(180deg,
            #4a3420 0%,
            var(--leather-mid) 15%,
            var(--leather-light) 40%,
            var(--leather-mid) 60%,
            var(--leather) 85%,
            #120a04 100%
        );
    z-index: 1000;
    transition: all 0.4s ease;
    box-shadow:
        0 6px 25px rgba(0,0,0,0.5),
        0 2px 6px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.06),
        inset 0 -1px 0 rgba(0,0,0,0.3);
    border: none;
}

/* ── Chaînes décoratives ── */
.header-chains {
    position: absolute;
    top: -8px; left: 0; right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 12%;
    pointer-events: none;
}
.chain {
    font-size: 8px;
    color: var(--gold-dark);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    opacity: 0.6;
    filter: brightness(0.8);
}
@media (max-width: 768px) { .header-chains { display: none; } }

/* ── Bordure supérieure — filet doré gravé ── */
.header-border-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 2%,
        var(--gold-dark) 15%,
        var(--gold) 30%,
        var(--gold-light) 50%,
        var(--gold) 70%,
        var(--gold-dark) 85%,
        transparent 98%
    );
    box-shadow: 0 0 8px rgba(201,168,50,0.3);
}

/* ── Bordure inférieure — pennants dentelés ── */
.header-border-bottom {
    position: absolute;
    bottom: -11px; left: 0; right: 0;
    line-height: 0;
    z-index: 1001;
}
.header-pennant {
    width: 100%;
    height: 12px;
    color: var(--leather);
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
}

.header.scrolled {
    box-shadow:
        0 8px 35px rgba(0,0,0,0.6),
        0 2px 6px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.06);
}
.header.hidden { transform: translateY(calc(-100% - 12px)); }

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1000px;
    height: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Logo avec blason ── */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--paper-light);
}
.logo-blason {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    background: radial-gradient(circle at 40% 35%,
        var(--crimson-light) 0%,
        var(--crimson) 40%,
        var(--crimson-dark) 100%
    );
    border: 2px solid var(--gold);
    border-radius: 50%;
    font-size: 1rem;
    color: var(--gold-light);
    box-shadow:
        0 0 0 3px rgba(0,0,0,0.2),
        inset 0 1px 3px rgba(255,255,255,0.15),
        inset 0 -2px 4px rgba(0,0,0,0.3),
        0 0 12px rgba(201,168,50,0.2);
    transition: all 0.4s ease;
}
.blason-glow {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.nav-logo:hover .blason-glow { opacity: 1; }
.nav-logo:hover .logo-blason {
    box-shadow:
        0 0 0 3px rgba(0,0,0,0.2),
        inset 0 1px 3px rgba(255,255,255,0.15),
        0 0 20px rgba(201,168,50,0.4);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.logo-title {
    font-family: var(--font-title);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--paper-light);
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.logo-title .accent {
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold-glow), 0 1px 4px rgba(0,0,0,0.6);
}
.logo-subtitle {
    font-family: var(--font-text);
    font-size: 0.62rem;
    font-style: italic;
    color: var(--paper-burnt);
    letter-spacing: 0.06em;
    opacity: 0.75;
}
@media (max-width: 768px) { .logo-text { display: none; } }

/* ── Navigation avec séparateurs ── */
.nav-main { display: flex; align-items: center; gap: 0; list-style: none; }
.nav-divider {
    color: var(--gold-dark);
    font-size: 0.7rem;
    opacity: 0.4;
    padding: 0 0.15rem;
    user-select: none;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    color: var(--paper-aged);
    text-decoration: none;
    font-family: var(--font-title);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    transition: all 0.35s ease;
    position: relative;
}
.nav-link:hover {
    color: var(--gold-light);
    text-shadow: 0 0 12px var(--gold-glow);
}
.nav-link.active {
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold-glow);
}
/* Soulignement doré animé */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%; right: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
    box-shadow: 0 0 8px var(--gold-glow);
    transition: all 0.35s ease;
    border-radius: 1px;
}
.nav-link:hover::after,
.nav-link.active::after { left: 0.5rem; right: 0.5rem; }
.nav-link i { font-size: 0.82rem; }
@media (max-width: 992px) { .nav-main { display: none; } }

.nav-right { display: flex; align-items: center; gap: 0.5rem; }

/* ── Boutons auth dans header ── */
.auth-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    font-family: var(--font-title);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.35s ease;
    border-radius: 2px;
}
.login-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--gold-dark);
    color: var(--paper-aged);
}
.login-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(201,168,50,0.08);
    box-shadow: 0 0 16px var(--gold-glow), inset 0 0 12px rgba(201,168,50,0.06);
}
.register-btn {
    background:
        radial-gradient(ellipse at 40% 30%, #9a3038 0%, var(--crimson) 60%, var(--crimson-dark) 100%);
    border: 1px solid var(--crimson);
    color: var(--paper-light);
    box-shadow:
        inset 0 1px 2px rgba(255,255,255,0.1),
        inset 0 -1px 3px rgba(0,0,0,0.2),
        0 2px 8px rgba(0,0,0,0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.register-btn:hover {
    box-shadow:
        inset 0 1px 2px rgba(255,255,255,0.1),
        0 0 18px var(--crimson-glow),
        0 3px 10px rgba(0,0,0,0.3);
}
@media (max-width: 576px) { .auth-btn span { display: none; } .auth-btn { padding: 0.38rem; } }

/* ── Menu utilisateur ── */
.user-menu { position: relative; }
.user-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.55rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--gold-dark);
    color: var(--paper-light);
    cursor: pointer;
    transition: all var(--ease);
    border-radius: 2px;
}
.user-btn:hover { border-color: var(--gold); box-shadow: 0 0 12px var(--gold-glow); }
.user-avatar {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 40% 35%, var(--crimson-light), var(--crimson-dark));
    color: var(--paper-light);
    border-radius: 50%;
    font-family: var(--font-title);
    font-size: 0.72rem;
    font-weight: 700;
    box-shadow: 0 0 0 2px var(--gold-dark), inset 0 -2px 3px rgba(0,0,0,0.2);
}
.user-name { font-family: var(--font-title); font-size: 0.75rem; color: var(--paper-aged); }
@media (max-width: 576px) { .user-name { display: none; } }

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px); right: 0;
    min-width: 180px;
    background: var(--paper-light);
    border: 2px solid var(--paper-aged);
    box-shadow: var(--shadow-deep);
    opacity: 0; visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--ease);
    z-index: 100;
}
.user-menu.open .user-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.7rem 1rem;
    color: var(--ink-sepia);
    text-decoration: none;
    font-size: 0.85rem;
    border: none; background: none;
    width: 100%; cursor: pointer;
    transition: all var(--ease);
    font-family: var(--font-text);
}
.dropdown-item:hover { background: var(--paper); color: var(--ink); }
.dropdown-item.danger:hover { color: var(--crimson); }

/* ── Toggle mobile ── */
.menu-toggle {
    display: none;
    flex-direction: column; gap: 5px; padding: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--gold-dark);
    cursor: pointer;
    border-radius: 2px;
}
.menu-toggle span { display: block; width: 18px; height: 2px; background: var(--paper-aged); transition: all 0.35s ease; }
.menu-toggle.active span { background: var(--gold); }
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }
@media (max-width: 992px) { .menu-toggle { display: flex; } }

/* ── Menu mobile enrichi ── */
.mobile-menu {
    position: fixed;
    top: var(--header-h); left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 50% 20%, var(--paper-light) 0%, var(--paper) 100%);
    padding: 0;
    opacity: 0; visibility: hidden;
    transition: all 0.4s ease;
    z-index: 999; overflow-y: auto;
}
.mobile-menu.open { opacity: 1; visibility: visible; }

.mobile-menu-header {
    text-align: center;
    padding: 1.2rem 1rem 0.8rem;
}
.mobile-ornament {
    font-family: var(--font-text);
    font-size: 0.9rem;
    color: var(--gold);
    letter-spacing: 0.15em;
    text-shadow: 0 0 6px var(--gold-glow);
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 1.2rem;
}
.mobile-nav .nav-link {
    padding: 1rem 1.2rem;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--paper-aged);
    background: transparent;
    color: var(--ink-sepia);
    gap: 0.6rem;
}
.mobile-nav .nav-link:first-child { border-top: 1px solid var(--paper-aged); }
.mobile-nav .nav-link::after { display: none; }
.mobile-nav .nav-link:hover, .mobile-nav .nav-link.active {
    background: rgba(201,168,50,0.05);
    color: var(--ink);
}
.mobile-nav .nav-link.active { border-left: 3px solid var(--gold); }
.mobile-link-marker {
    font-size: 0.45rem;
    color: var(--gold);
    opacity: 0.5;
}
.mobile-nav .nav-link.active .mobile-link-marker { opacity: 1; }

.mobile-menu-footer {
    text-align: center;
    padding: 1.2rem;
}
.mobile-ornament-bottom {
    color: var(--gold);
    font-size: 0.8rem;
    letter-spacing: 0.4em;
    opacity: 0.5;
}

main {
    min-height: calc(100vh - var(--header-h));
    padding-top: calc(var(--header-h) + 12px); /* +12 pour les pennants */
    position: relative;
    z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   V. HERO — PAGE DE COUVERTURE DU GRIMOIRE
   ═══════════════════════════════════════════════════════════════════════════ */

.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-h));
    padding: 2.5rem 1rem;
    text-align: center;
    /* Fond légèrement assombri pour contraste */
    background: radial-gradient(ellipse at 50% 40%, var(--paper) 0%, var(--paper-dark) 100%);
}
.hero-content { max-width: 640px; }

.hero-frame {
    padding: 2.8rem 2.2rem;
    position: relative;
    background:
        linear-gradient(135deg, rgba(201,168,50,0.04), transparent 40%),
        var(--paper-light);
    box-shadow: var(--shadow-book);
    /* Double cadre ornementé */
    border: 3px solid var(--gold-dark);
    outline: 1px solid var(--paper-aged);
    outline-offset: 6px;
}
/* Coins ornementaux dorés */
.hero-frame::before,
.hero-frame::after {
    content: '❧';
    position: absolute;
    font-size: 1.5rem;
    color: var(--gold);
    text-shadow: 0 0 12px var(--gold-glow);
    line-height: 1;
}
.hero-frame::before { top: 6px; left: 10px; }
.hero-frame::after { bottom: 6px; right: 10px; transform: rotate(180deg); }

.hero-tome {
    font-family: var(--font-title);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
    text-shadow: 0 0 8px var(--gold-glow);
}
.hero-pretitle {
    font-family: var(--font-text);
    font-size: 0.98rem;
    font-style: italic;
    color: var(--ink-faded);
    margin-bottom: 0.4rem;
}
.hero-title {
    font-family: var(--font-ornate);
    font-size: clamp(2.2rem, 7vw, 3.2rem);
    font-weight: 900;
    color: var(--ink);
    line-height: 1.15;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.12), 0 0 30px rgba(201,168,50,0.08);
}
.hero-author {
    font-family: var(--font-text);
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    font-style: italic;
    color: var(--ink-sepia);
}
.hero-ornament {
    display: block;
    font-size: 1rem;
    color: var(--gold);
    letter-spacing: 0.5em;
    margin: 1.2rem 0;
    text-shadow: 0 0 10px var(--gold-glow);
}

/* Badge pulsant */
.hero-badge {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.4rem 1.2rem;
    background: linear-gradient(135deg, rgba(201,168,50,0.08), rgba(201,168,50,0.02));
    border: 2px solid var(--gold);
    font-family: var(--font-title);
    font-size: 0.67rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    animation: badge-pulse 3s ease-in-out infinite;
}
@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 transparent, 0 0 0 transparent; }
    50% { box-shadow: 0 0 20px var(--gold-glow), inset 0 0 10px rgba(201,168,50,0.08); }
}

.hero-typing {
    font-family: var(--font-text);
    font-size: 1.08rem;
    color: var(--ink-sepia);
    margin: 1.2rem 0;
    min-height: 1.4em;
}
.typing-text { color: var(--crimson); font-weight: 500; }
.typing-cursor { color: var(--gold); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
    font-family: var(--font-text);
    font-size: 1.02rem;
    color: var(--ink-brown);
    line-height: 1.8;
    margin: 1.2rem 0 1.8rem;
}
.hero-desc strong { color: var(--ink); }

.hero-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

@media (max-width: 600px) {
    .hero-frame { padding: 1.8rem 1.2rem; border-width: 2px; outline: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   VI. MANUSCRIT — PAGES DE LIVRE
   ═══════════════════════════════════════════════════════════════════════════ */

.book-page {
    max-width: calc(var(--page-w) + 80px);
    margin: 0 auto;
    padding: 2rem 1rem;
}

.manuscript {
    background:
        /* Tache d'eau très subtile */
        radial-gradient(ellipse at 80% 20%, rgba(180,165,130,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 15% 85%, rgba(180,165,130,0.1) 0%, transparent 40%),
        var(--paper-light);
    padding: 3rem 3.5rem;
    border: 2px solid var(--paper-aged);
    box-shadow: var(--shadow-book);
    position: relative;
}

/* Double cadre intérieur */
.manuscript::before {
    content: '';
    position: absolute;
    top: 12px; left: 12px; right: 12px; bottom: 12px;
    border: 1px solid var(--paper-aged);
    pointer-events: none;
}
.manuscript::after {
    content: '';
    position: absolute;
    top: 18px; left: 18px;
    width: 30px; height: 30px;
    border-top: 3px solid var(--gold);
    border-left: 3px solid var(--gold);
    box-shadow: -2px -2px 6px rgba(201,168,50,0.15);
}
.corner-decoration {
    position: absolute;
    bottom: 18px; right: 18px;
    width: 30px; height: 30px;
    border-bottom: 3px solid var(--gold);
    border-right: 3px solid var(--gold);
    box-shadow: 2px 2px 6px rgba(201,168,50,0.15);
}

@media (max-width: 768px) {
    .book-page { padding: 1rem 0.5rem; }
    .manuscript { padding: 1.8rem 1.4rem; }
    .manuscript::before, .manuscript::after, .corner-decoration { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   VII. BOUTONS — SCEAU DE CIRE & FER FORGÉ
   ═══════════════════════════════════════════════════════════════════════════ */

.btn-primary, .btn-outline, .btn-gold {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.7rem 1.3rem;
    font-family: var(--font-title);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--ease);
    position: relative;
}

/* Sceau de cire */
.btn-primary {
    background: radial-gradient(ellipse at 40% 25%, #9a3038 0%, var(--crimson) 50%, var(--crimson-dark) 100%);
    border: 2px solid var(--crimson-dark);
    color: var(--paper-light);
    border-radius: var(--torn-sm);
    box-shadow:
        inset 0 2px 3px rgba(255,255,255,0.15),
        inset 0 -3px 5px rgba(0,0,0,0.25),
        0 4px 12px rgba(0,0,0,0.3);
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        inset 0 2px 3px rgba(255,255,255,0.15),
        inset 0 -3px 5px rgba(0,0,0,0.25),
        0 8px 25px rgba(122,34,48,0.4),
        0 0 30px var(--crimson-glow);
}
.btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow:
        inset 0 2px 6px rgba(0,0,0,0.3),
        0 2px 6px rgba(0,0,0,0.2);
}

/* Fer forgé */
.btn-outline {
    background: linear-gradient(180deg, var(--paper-light) 0%, var(--paper-dark) 100%);
    border: 2px solid var(--ink-light);
    color: var(--ink);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.5),
        inset 0 -2px 3px rgba(0,0,0,0.08),
        0 3px 8px rgba(0,0,0,0.12);
}
.btn-outline:hover {
    background: linear-gradient(180deg, var(--leather-mid) 0%, var(--leather) 100%);
    border-color: var(--gold-dark);
    color: var(--gold);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        0 6px 18px rgba(0,0,0,0.25);
    text-shadow: 0 0 6px var(--gold-glow);
}

/* Doré royal */
.btn-gold {
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
    border: 2px solid var(--gold-dark);
    color: var(--ink-dark);
    border-radius: var(--torn-sm);
    box-shadow:
        inset 0 2px 3px rgba(255,255,255,0.35),
        inset 0 -2px 4px rgba(0,0,0,0.15),
        0 4px 12px rgba(0,0,0,0.2);
    text-shadow: 0 1px 0 rgba(255,255,255,0.25);
}
.btn-gold:hover {
    transform: translateY(-3px);
    box-shadow:
        inset 0 2px 3px rgba(255,255,255,0.35),
        0 8px 25px rgba(201,168,50,0.35),
        0 0 35px var(--gold-glow);
}

/* ═══════════════════════════════════════════════════════════════════════════
   VIII. CARTES & GRILLES
   ═══════════════════════════════════════════════════════════════════════════ */

.section {
    max-width: var(--page-w);
    margin: 0 auto;
    padding: 2.8rem 1.2rem;
    text-align: center;
}
.section-badge {
    display: inline-block;
    padding: 0.25rem 0.9rem;
    background: var(--paper-light);
    border: 1px solid var(--gold);
    font-family: var(--font-title);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.7rem;
}
.section-title {
    font-family: var(--font-ornate);
    font-size: clamp(1.4rem, 4vw, 1.9rem);
    color: var(--ink);
    margin-bottom: 0.6rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.06);
}
.section-subtitle {
    font-family: var(--font-text);
    font-size: 0.98rem;
    font-style: italic;
    color: var(--ink-faded);
    margin-bottom: 1.3rem;
}

/* Encadré quête */
.scroll-box {
    max-width: var(--page-w);
    margin: 2rem auto;
    padding: 2rem;
    background:
        linear-gradient(135deg, rgba(201,168,50,0.04), transparent 50%),
        var(--paper-light);
    border: 2px solid var(--gold-dark);
    position: relative;
    text-align: center;
    box-shadow: var(--shadow-card);
}
.scroll-box::before,
.scroll-box::after {
    content: '✦';
    position: absolute;
    font-size: 0.9rem;
    color: var(--gold);
    text-shadow: 0 0 8px var(--gold-glow);
}
.scroll-box::before { top: 6px; left: 8px; }
.scroll-box::after { bottom: 6px; right: 8px; }

.scroll-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    font-family: var(--font-title);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--ink-dark);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    box-shadow: 0 3px 10px rgba(201,168,50,0.25);
}
.scroll-box h2 {
    font-family: var(--font-ornate);
    font-size: clamp(1.2rem, 3.5vw, 1.6rem);
    color: var(--ink);
    margin-bottom: 0.3rem;
}
.scroll-subtitle {
    font-family: var(--font-text);
    font-size: 0.98rem;
    font-style: italic;
    color: var(--ink-faded);
    margin-bottom: 1.3rem;
}
.scroll-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.7rem;
    margin-bottom: 1.3rem;
    text-align: left;
}
.scroll-item {
    padding: 0.9rem;
    background: var(--paper);
    border: 1px solid var(--paper-aged);
    transition: all var(--ease);
    position: relative;
    overflow: hidden;
}
/* Lueur dorée au hover */
.scroll-item::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(201,168,50,0.08), transparent);
    transition: left 0.5s ease;
}
.scroll-item:hover::before { left: 100%; }
.scroll-item:hover { border-color: var(--gold); box-shadow: 0 0 14px var(--gold-glow); }

.scroll-item i { color: var(--gold); margin-right: 0.3rem; }
.scroll-item strong {
    display: block;
    font-family: var(--font-title);
    font-size: 0.82rem;
    color: var(--ink);
    margin-bottom: 0.1rem;
}
.scroll-item small { color: var(--ink-faded); font-size: 0.8rem; }
.scroll-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1.3rem;
}
.skill-card {
    padding: 1.2rem;
    background: var(--paper-light);
    border: 1px solid var(--paper-aged);
    transition: all 0.4s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}
/* Shine effect au hover */
.skill-card::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(201,168,50,0.06) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.skill-card:hover::after { opacity: 1; }
.skill-card:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(20,15,5,0.15), 0 0 20px var(--gold-glow);
}

.skill-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.7rem; }
.skill-header i { font-size: 1.1rem; color: var(--gold); text-shadow: 0 0 6px var(--gold-glow); }
.skill-header h3 {
    font-family: var(--font-title);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
}

.skill-bar { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.7rem; }
.skill-bar > div:first-child {
    flex: 1; height: 5px;
    background: var(--paper-dark);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}
.skill-fill {
    height: 100%; width: 0;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
    border-radius: 3px;
    transition: width 1.2s ease;
    position: relative;
    box-shadow: 0 0 6px var(--gold-glow);
}
.skill-card.revealed .skill-fill { width: var(--level); }

.skill-bar span {
    font-family: var(--font-title);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold);
    min-width: 32px;
    text-align: right;
}

.skill-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tag {
    padding: 0.15rem 0.45rem;
    background: var(--paper);
    border: 1px solid var(--paper-aged);
    font-family: var(--font-title);
    font-size: 0.6rem;
    color: var(--ink-faded);
    transition: all var(--ease);
}
.tag:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(201,168,50,0.06);
    box-shadow: 0 0 8px var(--gold-glow);
}

/* Projects — Pages arrachées */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.2rem;
    margin-top: 1.3rem;
}
.project-card {
    background: var(--paper-light);
    border: 2px solid var(--paper-aged);
    overflow: hidden;
    transition: all 0.4s ease;
    text-align: left;
    position: relative;
    border-radius: var(--torn-radius);
    box-shadow: var(--shadow-card);
}
.project-card:hover {
    border-color: var(--gold);
    transform: translateY(-5px) rotate(-0.3deg);
    box-shadow: var(--shadow-hover);
}
/* Lueur dorée en haut au hover */
.project-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 60%;
    background: linear-gradient(180deg, rgba(201,168,50,0.08) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    border-radius: var(--torn-radius);
}
.project-card:hover::after { opacity: 1; }

.project-image {
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, var(--paper-dark), var(--paper-burnt));
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.project-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
    filter: sepia(0.15) saturate(0.85);
}
.project-card:hover .project-image img {
    transform: scale(1.06);
    filter: sepia(0) saturate(1);
}
.project-image .placeholder { color: var(--ink-light); font-size: 2rem; }

.project-content { padding: 1.2rem; }
.project-content h3 {
    font-family: var(--font-title);
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.4rem;
    transition: color var(--ease);
}
.project-card:hover .project-content h3 { color: var(--crimson); }
.project-content p {
    font-family: var(--font-text);
    font-size: 0.92rem;
    color: var(--ink-faded);
    line-height: 1.6;
    margin-bottom: 0.7rem;
}
.project-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   IX. TIMELINE
   ═══════════════════════════════════════════════════════════════════════════ */

.timeline {
    position: relative;
    max-width: 650px;
    margin: 1.5rem auto;
    padding-left: 28px;
}
.timeline::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: 6px;
    width: 3px;
    background: linear-gradient(180deg, var(--gold), var(--gold-dark), var(--paper-aged));
    border-radius: 2px;
    box-shadow: 0 0 8px var(--gold-glow);
}
.timeline-item {
    position: relative;
    padding: 1.2rem 1.3rem;
    margin-bottom: 1.2rem;
    background: var(--paper-light);
    border: 1px solid var(--paper-aged);
    margin-left: 1rem;
    transition: all var(--ease);
}
.timeline-item:hover {
    border-color: var(--gold);
    box-shadow: 0 0 18px var(--gold-glow);
    transform: translateX(4px);
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -32px; top: 1.3rem;
    width: 12px; height: 12px;
    background: radial-gradient(circle, var(--gold-light), var(--gold-dark));
    border: 3px solid var(--paper-light);
    box-shadow: 0 0 0 2px var(--gold), 0 0 10px var(--gold-glow);
    border-radius: 50%;
    transition: all var(--ease);
}
.timeline-item:hover::before {
    box-shadow: 0 0 0 3px var(--gold), 0 0 18px var(--gold-glow);
    transform: scale(1.2);
}

.timeline-date {
    display: inline-block;
    font-family: var(--font-title);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 0.3rem;
    padding: 0.1rem 0.5rem;
    background: rgba(201,168,50,0.08);
    border: 1px solid rgba(201,168,50,0.2);
}
.timeline-item h3 {
    font-family: var(--font-title);
    font-size: 0.95rem;
    color: var(--ink);
    margin-bottom: 0.15rem;
}
.timeline-item h4 {
    font-family: var(--font-text);
    font-size: 0.92rem;
    font-style: italic;
    font-weight: 400;
    color: var(--ink-sepia);
    margin-bottom: 0.5rem;
}
.timeline-item p {
    font-family: var(--font-text);
    font-size: 0.92rem;
    color: var(--ink-faded);
    line-height: 1.65;
}

/* ═══════════════════════════════════════════════════════════════════════════
   X. FORMULAIRE
   ═══════════════════════════════════════════════════════════════════════════ */

.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group label {
    font-family: var(--font-title);
    font-size: 0.73rem;
    font-weight: 500;
    color: var(--ink-sepia);
    letter-spacing: 0.03em;
}
.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.7rem 0.9rem;
    background: var(--paper);
    border: 2px solid var(--paper-aged);
    color: var(--ink);
    font-family: var(--font-text);
    font-size: 0.95rem;
    transition: all var(--ease);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--ink-light);
    font-style: italic;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    background: var(--paper-light);
    box-shadow: 0 0 16px var(--gold-glow), inset 0 0 8px rgba(201,168,50,0.05);
}
.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%234a4035' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2rem;
}
.form-group textarea { resize: vertical; min-height: 110px; }

.success-message {
    text-align: center;
    padding: 1.5rem;
    background: rgba(201,168,50,0.05);
    border: 2px solid var(--gold);
    border-radius: var(--torn-sm);
}
.success-message h3 {
    font-family: var(--font-title);
    color: var(--gold);
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
}

.contact-list { display: flex; flex-direction: column; gap: 0.6rem; }
.contact-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    background: var(--paper);
    border: 1px solid var(--paper-aged);
    color: var(--ink);
    text-decoration: none;
    transition: all var(--ease);
}
a.contact-item:hover {
    border-color: var(--gold);
    padding-left: 1.2rem;
    box-shadow: 0 0 14px var(--gold-glow), inset 3px 0 0 var(--gold);
}
.contact-item i { font-size: 1.1rem; color: var(--gold); width: 24px; text-align: center; }
.contact-item small {
    display: block;
    font-size: 0.65rem;
    color: var(--ink-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.social-links { display: flex; justify-content: center; gap: 0.8rem; }
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    background: var(--paper);
    border: 2px solid var(--paper-aged);
    color: var(--ink-faded);
    font-size: 1.05rem;
    transition: all 0.4s ease;
    position: relative;
}
.social-link:hover {
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 20px var(--gold-glow), 0 0 25px var(--gold-glow);
}

.nav-buttons { display: flex; justify-content: center; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   XI. CTA
   ═══════════════════════════════════════════════════════════════════════════ */

.cta-section {
    text-align: center;
    padding: 3rem 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}
.cta-badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: var(--paper-light);
    border: 2px solid var(--gold);
    font-family: var(--font-title);
    font-size: 0.68rem;
    color: var(--gold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
}
.cta-section h2 {
    font-family: var(--font-ornate);
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    color: var(--ink);
    margin-bottom: 0.8rem;
    line-height: 1.3;
}
.cta-section p {
    font-family: var(--font-text);
    font-size: 1rem;
    color: var(--ink-faded);
    margin-bottom: 1.3rem;
    line-height: 1.7;
}
.cta-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════════════════
   XII. FOOTER — COUVERTURE ARRIÈRE DU GRIMOIRE
   ═══════════════════════════════════════════════════════════════════════════ */

.footer {
    background:
        /* Grain cuir */
        url("data:image/svg+xml,%3Csvg viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2.5' numOctaves='4'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)' opacity='0.06'/%3E%3C/svg%3E"),
        linear-gradient(180deg,
            #3d2816 0%,
            var(--leather-mid) 8%,
            var(--leather) 40%,
            #120a04 100%
        );
    padding: 0;
    text-align: center;
    position: relative;
}

/* ── Bordure supérieure — pennants inversés ── */
.footer-border-top {
    line-height: 0;
    margin-top: -1px;
}
.footer-pennant {
    width: 100%;
    height: 12px;
    color: var(--leather-mid);
    filter: drop-shadow(0 -2px 3px rgba(0,0,0,0.3));
}

/* ── Contenu principal ── */
.footer-content {
    max-width: 680px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 2rem;
    position: relative;
}

/* ── Cadre doré intérieur ── */
.footer-content::before {
    content: '';
    position: absolute;
    top: 1.5rem; left: 1rem; right: 1rem; bottom: 1rem;
    border: 1px solid rgba(201,168,50,0.15);
    pointer-events: none;
}

/* ── Ornement d'ouverture ── */
.footer-top-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 2rem;
}
.footer-fleuron {
    font-size: 1.2rem;
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold-glow);
    line-height: 1;
}
.footer-rule {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    box-shadow: 0 0 6px rgba(201,168,50,0.2);
}
.footer-ornament-text {
    font-family: var(--font-title);
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    text-shadow: 0 0 8px var(--gold-glow);
    white-space: nowrap;
}

/* ── Navigation rapide ── */
.footer-nav {
    margin-bottom: 1.8rem;
}
.footer-nav-title {
    font-family: var(--font-title);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--paper-burnt);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 0.9rem;
    opacity: 0.7;
}
.footer-nav-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem 1.2rem;
}
.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-text);
    font-size: 0.88rem;
    color: var(--paper-aged);
    text-decoration: none;
    transition: all 0.35s ease;
    padding: 0.25rem 0;
    position: relative;
}
.footer-link::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 100%;
    height: 1px;
    background: var(--gold);
    box-shadow: 0 0 4px var(--gold-glow);
    transition: right 0.35s ease;
}
.footer-link:hover::after { right: 0; }
.footer-link:hover {
    color: var(--gold);
    text-shadow: 0 0 8px var(--gold-glow);
}
.footer-link-dot {
    font-size: 0.5rem;
    color: var(--gold-dark);
    opacity: 0.5;
    transition: all 0.35s ease;
}
.footer-link:hover .footer-link-dot {
    color: var(--gold);
    opacity: 1;
    text-shadow: 0 0 6px var(--gold-glow);
}

/* ── Séparateur ── */
.footer-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem 0;
}
.footer-separator::before,
.footer-separator::after {
    content: '';
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201,168,50,0.3));
}
.footer-separator::after {
    background: linear-gradient(90deg, rgba(201,168,50,0.3), transparent);
}
.footer-separator span {
    padding: 0 0.8rem;
    color: var(--gold);
    font-size: 0.7rem;
    text-shadow: 0 0 8px var(--gold-glow);
}

/* ── Guildes / Réseaux sociaux ── */
.footer-guilds { margin-bottom: 2rem; }
.footer-social {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}
.footer-social-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    transition: all 0.4s ease;
    group: social;
}
.social-icon-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px; height: 46px;
    background:
        radial-gradient(circle at 40% 35%, rgba(255,255,255,0.04), transparent),
        rgba(255,255,255,0.02);
    border: 2px solid var(--gold-dark);
    border-radius: 50%;
    color: var(--paper-aged);
    font-size: 1.1rem;
    transition: all 0.4s ease;
    position: relative;
}
/* Anneau doré externe */
.social-icon-frame::before {
    content: '';
    position: absolute;
    inset: -5px;
    border: 1px solid rgba(201,168,50,0.15);
    border-radius: 50%;
    transition: all 0.4s ease;
}
.footer-social-link:hover .social-icon-frame {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(201,168,50,0.08);
    box-shadow: 0 0 20px var(--gold-glow), 0 0 40px rgba(201,168,50,0.1);
    transform: translateY(-4px) scale(1.08);
}
.footer-social-link:hover .social-icon-frame::before {
    border-color: rgba(201,168,50,0.4);
    box-shadow: 0 0 12px var(--gold-glow);
}
.social-label {
    font-family: var(--font-title);
    font-size: 0.58rem;
    font-weight: 600;
    color: var(--paper-burnt);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.5;
    transition: all 0.4s ease;
}
.footer-social-link:hover .social-label {
    color: var(--gold);
    opacity: 1;
    text-shadow: 0 0 6px var(--gold-glow);
}

/* ── Colophon (signature) ── */
.footer-colophon {
    margin-bottom: 1.2rem;
}
.colophon-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(201,168,50,0.12);
    border-bottom: 1px solid rgba(201,168,50,0.12);
}
.colophon-year {
    font-family: var(--font-title);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.3em;
    text-shadow: 0 0 6px var(--gold-glow);
}
.colophon-divider {
    color: rgba(201,168,50,0.25);
    font-size: 0.7rem;
}
.colophon-title {
    font-family: var(--font-ornate);
    font-size: 0.85rem;
    color: var(--paper-aged);
    letter-spacing: 0.08em;
}
.colophon-author {
    font-family: var(--font-text);
    font-size: 0.82rem;
    color: var(--paper-burnt);
    font-style: italic;
}
.colophon-heart {
    color: var(--crimson-light);
    font-style: normal;
}

/* ── Ornement de fermeture ── */
.footer-bottom-ornament {
    font-family: var(--font-text);
    font-size: 0.78rem;
    font-style: italic;
    color: var(--gold-dark);
    letter-spacing: 0.3em;
    opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   XIII. ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

.reveal { opacity: 0; transform: translateY(30px); transition: all 0.7s ease; }
.reveal.revealed { opacity: 1; transform: translateY(0); }

/* Encre qui s'étale sur les liens */
.prose a {
    color: var(--crimson);
    text-decoration: none;
    background-image: linear-gradient(var(--crimson), var(--crimson));
    background-repeat: no-repeat;
    background-position: left bottom;
    background-size: 0% 2px;
    transition: background-size 0.4s ease;
    padding-bottom: 1px;
}
.prose a:hover { background-size: 100% 2px; }

/* ═══════════════════════════════════════════════════════════════════════════
   XIV. MODALS & NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

.notification-container {
    position: fixed;
    top: calc(var(--header-h) + 12px); right: 12px;
    z-index: 10001;
    display: flex; flex-direction: column;
    gap: 8px; max-width: 320px;
}
.notification {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.8rem 1rem;
    background: var(--paper-light);
    border: 2px solid var(--paper-aged);
    border-left: 4px solid var(--gold);
    box-shadow: var(--shadow-card);
    animation: slideIn 0.3s ease;
    font-family: var(--font-text);
}
.notification.success { border-left-color: #2a6a3a; }
.notification.error { border-left-color: var(--crimson); }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
.notification-close {
    background: none; border: none;
    color: var(--ink-light);
    font-size: 1rem; cursor: pointer;
    margin-left: auto; padding: 0;
}

.auth-modal {
    display: none;
    position: fixed; inset: 0;
    background: rgba(16,12,6,0.65);
    backdrop-filter: blur(3px);
    z-index: 10002;
    align-items: center; justify-content: center;
    padding: 1rem;
}
.auth-modal.open { display: flex; }

.auth-modal-content {
    position: relative;
    background: var(--paper-light);
    border: 3px solid var(--gold-dark);
    padding: 2.2rem;
    max-width: 380px; width: 100%;
    box-shadow: var(--shadow-deep);
    animation: modalIn 0.3s ease;
}
.auth-modal-content::before {
    content: '';
    position: absolute;
    top: 8px; left: 8px; right: 8px; bottom: 8px;
    border: 1px solid var(--paper-aged);
    pointer-events: none;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.93) translateY(-10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.auth-modal-close {
    position: absolute; top: 0.8rem; right: 0.8rem;
    background: none; border: none;
    color: var(--ink-light); font-size: 1.3rem;
    cursor: pointer; transition: color var(--ease);
}
.auth-modal-close:hover { color: var(--crimson); }

.auth-modal h2 {
    text-align: center;
    font-family: var(--font-ornate);
    font-size: 1.3rem;
    color: var(--ink);
    margin-bottom: 1.2rem;
}

.auth-form { display: flex; flex-direction: column; gap: 0.8rem; }
.auth-form label {
    font-family: var(--font-title);
    font-size: 0.72rem;
    color: var(--ink-sepia);
    margin-bottom: 0.15rem;
    display: block;
}
.auth-form input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--paper);
    border: 2px solid var(--paper-aged);
    color: var(--ink);
    font-family: var(--font-text);
    font-size: 0.95rem;
    transition: all var(--ease);
}
.auth-form input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 12px var(--gold-glow);
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
    color: var(--ink-light);
    font-size: 0.85rem;
}
.auth-switch a { color: var(--crimson); cursor: pointer; font-weight: 500; text-decoration: none; }

.auth-error {
    background: rgba(122,34,48,0.05);
    border: 2px solid var(--crimson);
    color: var(--crimson);
    padding: 0.5rem 0.7rem;
    font-size: 0.82rem;
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   XV. BACK TO TOP
   ═══════════════════════════════════════════════════════════════════════════ */

#back-to-top {
    position: fixed;
    bottom: 20px; right: 20px;
    width: 40px; height: 40px;
    background: var(--leather);
    border: 2px solid var(--gold-dark);
    color: var(--gold);
    font-size: 1rem;
    cursor: pointer;
    opacity: 0; visibility: hidden;
    transition: all var(--ease);
    z-index: 100;
    border-radius: 50%;
}
#back-to-top.visible { opacity: 1; visibility: visible; }
#back-to-top:hover {
    border-color: var(--gold);
    box-shadow: 0 0 18px var(--gold-glow);
    transform: translateY(-3px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   XVI. RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    :root { --header-h: 54px; }
    .hero { padding: 1.5rem 0.8rem; }
    .section { padding: 2rem 0.8rem; }
    .scroll-box { margin: 1rem 0.5rem; padding: 1.4rem; }
    .project-card { border-radius: var(--torn-sm); }
    body::after {
        background: radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(20,14,5,0.1) 70%, rgba(10,6,2,0.3) 100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}

@media print {
    .header, .footer, #back-to-top, .auth-modal, .notification-container { display: none !important; }
    body { background: white; }
    body::before, body::after { display: none; }
    main { padding-top: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   XVII. INDEX — ÉLÉMENTS ENRICHIS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Particules flottantes CSS (hero) ── */
.hero-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.hero-content { position: relative; z-index: 1; }
.particle {
    position: absolute;
    width: 4px; height: 4px;
    background: radial-gradient(circle, var(--gold-light), transparent);
    border-radius: 50%;
    opacity: 0;
    animation: float-particle 8s ease-in-out infinite;
}
.p1 { left: 15%; top: 20%; animation-delay: 0s; animation-duration: 7s; }
.p2 { left: 75%; top: 30%; animation-delay: 1.5s; animation-duration: 9s; }
.p3 { left: 40%; top: 70%; animation-delay: 3s; animation-duration: 6s; }
.p4 { left: 85%; top: 60%; animation-delay: 4.5s; animation-duration: 8s; }
.p5 { left: 25%; top: 80%; animation-delay: 2s; animation-duration: 10s; }
@keyframes float-particle {
    0%   { opacity: 0; transform: translateY(0) scale(0.5); }
    20%  { opacity: 0.6; }
    50%  { opacity: 0.3; transform: translateY(-40px) scale(1); }
    80%  { opacity: 0.5; }
    100% { opacity: 0; transform: translateY(-80px) scale(0.3); }
}

/* ── Coins ornementaux du hero ── */
.hero-corner {
    position: absolute;
    font-size: 1.8rem;
    color: var(--gold);
    text-shadow: 0 0 15px var(--gold-glow);
    line-height: 1;
    opacity: 0.6;
}
.hero-corner-tl { top: 8px; left: 10px; }
.hero-corner-tr { top: 8px; right: 10px; transform: scaleX(-1); }
.hero-corner-bl { bottom: 8px; left: 10px; transform: scaleY(-1); }
.hero-corner-br { bottom: 8px; right: 10px; transform: scale(-1); }

/* ── Ornement hero redessiné ── */
.hero-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin: 1.2rem 0;
}
.ornament-line {
    width: 50px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    box-shadow: 0 0 4px rgba(201,168,50,0.2);
}
.ornament-diamond {
    color: var(--gold);
    font-size: 0.55rem;
    text-shadow: 0 0 8px var(--gold-glow);
    animation: diamond-pulse 4s ease-in-out infinite;
}
@keyframes diamond-pulse {
    0%, 100% { text-shadow: 0 0 6px var(--gold-glow); }
    50% { text-shadow: 0 0 18px var(--gold-glow), 0 0 30px rgba(201,168,50,0.15); }
}

/* ── Scroll hint en bas du hero ── */
.hero-scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    margin-top: 2.5rem;
    animation: hint-fade 3s ease-in-out infinite;
}
.scroll-text {
    font-family: var(--font-text);
    font-size: 0.82rem;
    font-style: italic;
    color: var(--ink-faded);
    letter-spacing: 0.06em;
}
.scroll-arrow {
    color: var(--gold);
    font-size: 0.9rem;
    animation: bounce-arrow 2s ease-in-out infinite;
}
@keyframes hint-fade {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.9; }
}
@keyframes bounce-arrow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* ── Section ornament top ── */
.section-ornament-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    margin-bottom: 1.5rem;
}
.orn-line {
    width: 60px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.orn-star {
    color: var(--gold);
    font-size: 0.8rem;
    text-shadow: 0 0 10px var(--gold-glow);
}

/* ── Strengths row (préambule) ── */
.strengths-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    max-width: 650px;
    margin: 2rem auto 0;
    text-align: center;
}
.strength-item {
    padding: 1.2rem 0.8rem;
    background: var(--paper-light);
    border: 1px solid var(--paper-aged);
    transition: all 0.4s ease;
    position: relative;
}
.strength-item:hover {
    border-color: var(--gold);
    box-shadow: 0 0 18px var(--gold-glow);
    transform: translateY(-3px);
}
.strength-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    margin: 0 auto 0.6rem;
    background: rgba(201,168,50,0.06);
    border: 2px solid var(--gold-dark);
    border-radius: 50%;
    color: var(--gold);
    font-size: 1rem;
    transition: all 0.4s ease;
}
.strength-item:hover .strength-icon {
    background: rgba(201,168,50,0.12);
    border-color: var(--gold);
    box-shadow: 0 0 14px var(--gold-glow);
    transform: scale(1.1);
}
.strength-item strong {
    display: block;
    font-family: var(--font-title);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.2rem;
}
.strength-item small {
    font-family: var(--font-text);
    font-size: 0.8rem;
    font-style: italic;
    color: var(--ink-faded);
}

/* ── Scroll box — sceau décoratif ── */
.scroll-seal {
    position: absolute;
    top: -20px; right: 20px;
    z-index: 2;
}
.seal-circle {
    width: 42px; height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 40% 35%, var(--crimson-light), var(--crimson), var(--crimson-dark));
    border: 3px solid var(--gold);
    border-radius: 50%;
    color: var(--paper-light);
    font-size: 0.95rem;
    box-shadow:
        inset 0 2px 4px rgba(255,255,255,0.15),
        inset 0 -3px 5px rgba(0,0,0,0.3),
        0 4px 12px rgba(0,0,0,0.3),
        0 0 12px var(--gold-glow);
    animation: seal-glow 4s ease-in-out infinite;
}
@keyframes seal-glow {
    0%, 100% { box-shadow: inset 0 2px 4px rgba(255,255,255,0.15), inset 0 -3px 5px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.3), 0 0 8px var(--gold-glow); }
    50% { box-shadow: inset 0 2px 4px rgba(255,255,255,0.15), inset 0 -3px 5px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.3), 0 0 22px var(--gold-glow); }
}

/* ── Scroll item icon ── */
.scroll-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    background: rgba(201,168,50,0.06);
    border: 1px solid var(--gold-dark);
    border-radius: 50%;
    color: var(--gold);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}
.scroll-item:hover .scroll-item-icon {
    border-color: var(--gold);
    box-shadow: 0 0 10px var(--gold-glow);
}

/* ── Skill rank badges ── */
.skill-rank {
    font-family: var(--font-title);
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.08rem 0.35rem;
    border: 1px solid;
}
.rank-master { color: var(--gold); border-color: var(--gold); background: rgba(201,168,50,0.08); }
.rank-expert { color: var(--crimson); border-color: var(--crimson); background: rgba(122,34,48,0.06); }
.rank-adept  { color: var(--ink-sepia); border-color: var(--paper-aged); background: rgba(0,0,0,0.02); }
.rank-apprentice { color: var(--ink-light); border-color: var(--paper-aged); }

.skill-icon-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    background: rgba(201,168,50,0.06);
    border: 1px solid var(--gold-dark);
    border-radius: 50%;
    color: var(--gold);
    font-size: 0.8rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.skill-card:hover .skill-icon-frame {
    border-color: var(--gold);
    box-shadow: 0 0 10px var(--gold-glow);
}

/* ── Project numbering ── */
.project-number {
    font-family: var(--font-ornate);
    font-size: 0.72rem;
    color: var(--gold);
    opacity: 0.4;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.2rem;
}

/* ── Project placeholder enrichi ── */
.project-image .placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    color: var(--ink-light);
}
.project-image .placeholder i { font-size: 1.8rem; }
.project-image .placeholder small {
    font-family: var(--font-title);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.5;
}

/* ── CTA frame ── */
.cta-frame {
    position: relative;
    padding: 2.5rem 2rem;
    background:
        radial-gradient(ellipse at 50% 40%, rgba(201,168,50,0.04), transparent 60%),
        var(--paper-light);
    border: 2px solid var(--paper-aged);
    box-shadow: var(--shadow-card);
}
.cta-corner {
    position: absolute;
    width: 30px; height: 30px;
}
.cta-corner-tl {
    top: 8px; left: 8px;
    border-top: 3px solid var(--gold);
    border-left: 3px solid var(--gold);
}
.cta-corner-br {
    bottom: 8px; right: 8px;
    border-bottom: 3px solid var(--gold);
    border-right: 3px solid var(--gold);
}
.cta-badge i { margin-right: 0.3rem; }

/* ── Hero badge enrichi ── */
.hero-badge i { margin-right: 0.3rem; font-size: 0.6rem; }

/* ── Responsive adjustments ── */
@media (max-width: 600px) {
    .hero-corner { font-size: 1.2rem; opacity: 0.4; }
    .hero-scroll-hint { margin-top: 1.5rem; }
    .strengths-row { grid-template-columns: 1fr; max-width: 280px; }
    .scroll-seal { display: none; }
    .cta-frame { padding: 1.8rem 1.2rem; }
}