/* Portfolio — mêmes composants que l'accueil (home.css), plus ce qui lui est propre.
   Toutes les animations sont coupées si le visiteur a demandé moins de mouvements. */

/* Transitions entre les pages (natives, sans script) */
@view-transition { navigation: auto; }
.masthead { view-transition-name: masthead; }
::view-transition-old(root) { animation: 220ms ease-in both page-out; }
::view-transition-new(root) { animation: 380ms cubic-bezier(.2, .8, .2, 1) both page-in; }
@keyframes page-out { to { opacity: 0; transform: translateY(-12px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(18px); } }

/* Seconde barre : les pages du portfolio */
.subnav { view-transition-name: subnav; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; padding: 1rem 0 1.4rem; border-bottom: 1px solid var(--line); }
.subnav-title { font: 700 .72rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.subnav div { display: flex; flex-wrap: wrap; gap: .35rem; }
.subnav a { padding: .55rem 1rem; border: 1px solid var(--line); border-radius: 999px; font: 600 .85rem/1 var(--sans); text-decoration: none; color: var(--muted); transition: color .2s, border-color .2s, background-color .2s; }
.subnav a:hover { color: var(--ink); border-color: var(--ink); }
.subnav a[aria-current] { color: var(--bg); background: var(--ink); border-color: var(--ink); }

/* Cascade : chaque élément d'un bloc [data-stagger] arrive un peu après le précédent */
.reveal { transition-delay: calc(var(--i, 0) * 70ms); }

/* En-tête des pages intérieures */
.page-head { padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(2.5rem, 5vw, 3.5rem); }
.page-head h1 { margin: 0 0 1.75rem; font: 850 clamp(3rem, 7vw, 6rem)/.94 var(--sans); letter-spacing: -.06em; }
.page-head .lede { margin-bottom: 2rem; }
.status { margin-left: .75rem; padding: .3rem .6rem; border-radius: 999px; background: var(--accent); color: var(--on-accent); letter-spacing: .08em; }
.mail { display: block; margin-top: .75rem; color: var(--ink); font-family: var(--mono); font-size: 1rem; }

/* Journal qui défile en continu, dans la carte en arche */
.feed-window { position: relative; height: 16.5rem; overflow: hidden; }
.feed-window::after { content: ""; position: absolute; inset: auto 0 0; height: 3rem; background: linear-gradient(transparent, #0f0f12); pointer-events: none; }
.feed-track { animation: feed-scroll 30s linear infinite; }
.feed:hover .feed-track { animation-play-state: paused; }
.feed b { color: #ff7b69; }
/* La piste contient la liste deux fois : remonter de moitié donne une boucle sans à-coup */
@keyframes feed-scroll { to { transform: translateY(-50%); } }
.feed ol { min-height: 0; padding: 0; }

/* Cartes de projets */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.project { display: flex; flex-direction: column; gap: .5rem; padding: clamp(1.5rem, 3vw, 2.25rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; transition: border-color .25s, transform .25s var(--ease), box-shadow .25s; }
.project:hover, .project:focus-visible { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 24px 50px -30px var(--accent); }
.project .card-tag { margin-bottom: .5rem; }
.project h3 { margin: 0; font: 800 clamp(1.6rem, 2.6vw, 2.1rem)/1.05 var(--sans); letter-spacing: -.045em; }
.project p { margin: 0; color: var(--muted); font-size: .95rem; }
.project .more { display: inline-flex; align-items: center; gap: .5rem; margin-top: auto; padding-top: 1.25rem; font: 650 .9rem/1 var(--sans); }
.project .more svg { width: 1rem; height: 1rem; color: var(--accent); transition: transform .25s var(--ease); }
.project:hover .more svg { transform: translate(3px, -3px); }
.project.is-hidden { display: none; }
.project.todo-card { border-style: dashed; }
.projects .project.entering { animation: card-in .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.filters { margin-bottom: 1.5rem; }

/* Frise chronologique : le trait se dessine au défilement */
.timeline { list-style: none; margin: 0; padding: 0 0 0 2rem; position: relative; max-width: 48rem; }
.timeline::before, .timeline::after { content: ""; position: absolute; left: .4rem; top: .5rem; width: 2px; background: var(--line); }
.timeline::before { bottom: .5rem; }
.timeline::after { height: 0; background: var(--accent); transition: height 1.4s cubic-bezier(.2, .8, .2, 1); }
.timeline.is-visible::after { height: calc(100% - 1rem); }
.timeline li { position: relative; padding: 0 0 2.25rem; }
.timeline li::before { content: ""; position: absolute; left: -2rem; top: .3rem; width: .9rem; height: .9rem; border-radius: 50%; border: 2px solid var(--accent); background: var(--bg); }
.timeline time { display: block; margin-bottom: .4rem; font: 700 .72rem/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.timeline h3 { margin: 0 0 .4rem; font: 800 1.4rem/1.2 var(--sans); letter-spacing: -.035em; }
.timeline p { margin: 0; color: var(--muted); }

/* Outils */
.tags { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; margin: 0; padding: 0; }
.tags li { padding: .75rem 1.2rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: 650 .95rem/1 var(--sans); }

@media (max-width: 760px) {
    .projects { grid-template-columns: 1fr; }
    .status { display: inline-block; margin: .75rem 0 0; }
}

/* Moins de mouvements demandé : tout s'affiche directement */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
    .reveal { opacity: 1; transform: none; }
    .timeline::after { height: calc(100% - 1rem); }
}

/* Carte de projet sans lien public */
article.project:hover { transform: none; box-shadow: none; border-color: var(--line); }
.project .more.muted { color: var(--muted); font-weight: 500; }
