:root{
    --bg:#0a0a0a;
    --text:#f2efe8;
    --muted:#9a948a;
    --line:rgba(242,239,232,.16);
    --orange:#ff7a1a;
    --panel-w:clamp(360px,38vw,480px);
    --ease:cubic-bezier(.22,.61,.36,1);
}

*{box-sizing:border-box}
html{background:var(--bg)}
body{
    margin:0;
    font-family:"Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height:1.4;
    color:var(--text);
    -webkit-font-smoothing:antialiased;
}
:focus-visible{outline:2px solid var(--orange);outline-offset:3px}

/* Le canvas déborde de l'écran pour que le flou ne s'éclaircisse pas sur les bords */
#fluid{
    position:fixed;
    inset:-60px;
    width:calc(100% + 120px);
    height:calc(100% + 120px);
    z-index:-1;
    pointer-events:none;
    filter:blur(30px);
}
/* Grain animé, sur le fond seulement ; déborde pour pouvoir être décalé à chaque image */
body::after{
    content:"";
    position:fixed;
    inset:-120px;
    animation:grain .7s steps(1) infinite;
    z-index:-1;  /* derrière l'UI ; vient après le canvas, donc par-dessus lui */
    pointer-events:none;
    opacity:.18;
    background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1.4 0 0 0 -.4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes grain{
    0%{transform:translate(0,0)}
    14%{transform:translate(-70px,40px)}
    28%{transform:translate(50px,-90px)}
    42%{transform:translate(-100px,-30px)}
    57%{transform:translate(90px,80px)}
    71%{transform:translate(-30px,100px)}
    85%{transform:translate(60px,-50px)}
}

/* Animation d'entrée : fondu en cascade dans l'ordre de la page (--i posé par script.js) ;
   les boutons montent en plus. « backwards » : après la fin, l'animation ne gêne plus le survol. */
.profile, .page-title, .subtitle, .section-title, .card{
    animation:fade-in .5s ease-out backwards;
    animation-delay:calc(var(--i, 0) * 110ms);
}
.card{animation-name:rise-in}
/* Même chose pour le contenu du panneau, rejoué à chaque ouverture, une fois le panneau en train d'arriver */
.panel.open > *{
    animation:fade-in .5s ease-out backwards;
    animation-delay:calc(200ms + var(--i, 0) * 60ms);
}
.panel.open > .item{animation-name:rise-in}
@keyframes fade-in{ from{opacity:0} }
@keyframes rise-in{ from{opacity:0; transform:translateY(14px)} }

.page{
    min-height:100dvh;
    padding:56px 20px;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:12px;
    text-align:center;
    transition:margin-right .5s var(--ease), transform .5s var(--ease), opacity .5s;
}
body.panel-open .page{margin-right:var(--panel-w)}

.profile{
    width:120px;
    height:120px;
    object-fit:cover;
    border:1px solid var(--line);
}
.page-title{
    margin:12px 0 0;
    font-size:2rem;
    font-weight:800;
    letter-spacing:-.02em;
}
.subtitle{
    margin:0;
    max-width:340px;
    color:var(--muted);
}

.links{
    width:min(520px,100%);
    display:flex;
    flex-direction:column;
    gap:12px;
}
.section-title{
    margin:32px 0 4px;
    font-size:.75rem;
    font-weight:500;
    letter-spacing:.14em;
    text-transform:uppercase;
    color:var(--muted);
}

.card{
    display:flex;
    align-items:center;
    flex-direction:row-reverse;  /* texte à gauche, icône à droite */
    justify-content:space-between;
    gap:12px;
    width:100%;
    padding:18px 22px;
    border:1px solid var(--line);
    background:#121212;
    color:inherit;
    font:inherit;
    font-size:1.05rem;
    font-weight:500;
    text-decoration:none;
    cursor:pointer;
    transition:border-color .25s, color .25s, background .25s, transform .25s;
}
.card:hover, .card[aria-expanded="true"]{
    border-color:var(--orange);
    color:var(--orange);
    background:#1c130b;
    transform:translateY(-2px);
}
.logo{
    width:22px;
    height:22px;
    flex-shrink:0;
    color:var(--text);
    opacity:.6;
}

/* Colonne de droite */
.panel{
    position:fixed;
    top:0;
    right:0;
    z-index:5;
    width:var(--panel-w);
    height:100dvh;
    overflow-y:auto;
    padding:24px;
    background:#111;
    border-left:1px solid var(--line);
    display:flex;
    flex-direction:column;
    transform:translateX(100%);
    visibility:hidden;
    transition:transform .5s var(--ease), visibility 0s .5s;
}
.panel.open{
    transform:none;
    visibility:visible;
    transition-delay:0s;
}
.panel-close{
    position:absolute;
    top:14px;
    right:14px;
    width:48px;
    height:48px;
    border:none;
    background:transparent;
    color:var(--muted);
    font-size:44px;
    line-height:1;
    cursor:pointer;
    transition:color .2s;
}
.panel-close:hover{color:var(--orange)}
.notice{
    margin:auto 0 16px;   /* collée en bas du panneau quand la liste est courte ; 16px d'air avant la liste */
    padding-top:28px;
    font-size:.75rem;
    line-height:1.5;
    color:var(--muted);
}
.panel-title{
    margin:0 0 16px;
    font-size:1.4rem;
    font-weight:800;
    letter-spacing:-.02em;
}
.panel-photo{
    display:block;
    width:100%;
    aspect-ratio:3/2;
    object-fit:cover;
    margin-bottom:8px;
    background:#1c1c1c;
    color:var(--muted);
    font-size:.8rem;
}
.item{
    position:relative;
    display:flex;
    flex-direction:column;
    gap:2px;
    padding:14px 36px 14px 0;
    border-bottom:1px solid var(--line);
    color:inherit;
    text-decoration:none;
    transition:color .2s, border-color .2s;
}
.item::after{
    content:"↗";
    position:absolute;
    right:8px;
    top:calc(50% - .6em);
    width:1.2em;
    height:1.2em;
    line-height:1.2em;
    text-align:center;
    /* Roll-over : l'ombre est une copie de la flèche en bas à gauche. Au survol tout glisse en haut à
       droite pendant que la fenêtre de découpe glisse en sens inverse, donc reste fixe à l'écran. */
    text-shadow:-1.2em 1.2em;
    clip-path:inset(0);
    transition:transform .14s cubic-bezier(.55,.085,.68,.53), clip-path .14s cubic-bezier(.55,.085,.68,.53); /* quadIn */
}
.item:hover::after, .item:focus-visible::after{
    transform:translate(1.2em,-1.2em);
    clip-path:inset(1.2em 1.2em -1.2em -1.2em);
}
.item:hover{
    color:var(--orange);
    border-color:var(--orange);
}
.item-title{font-weight:500}
.item-desc{font-size:.8rem;color:var(--muted)}

/* Mobile : la colonne prend tout l'écran, la page glisse derrière */
@media (max-width:800px){
    .panel{width:100%; border-left:0}  /* 100% et non 100vw : vw compte la barre de défilement */
    .page{padding:32px 16px}
    body.panel-open{overflow:hidden}
    body.panel-open .page{
        margin-right:0;
        transform:translateX(-30%);
        opacity:.3;
    }
}

@media (prefers-reduced-motion:reduce){
    *, *::before, *::after{transition:none !important; animation:none !important}
}

/* Page simple centrée (ex. portfolio « en cours de construction ») */
.page-center{justify-content:center}
.back-link{
    margin-top:24px;
    color:var(--muted);
    font-size:.9rem;
    text-decoration:none;
    transition:color .2s;
}
.back-link:hover{color:var(--orange)}
/* Bouton sans icône : en row-reverse, flex-end = à gauche, comme les autres textes */
.card.no-icon{justify-content:flex-end}
