/* portfolio jm — tout le style tient ici */

:root {
  --papier:   #FAF7F1;
  --encre:    #1C1A17;
  --encre-2:  #5C574E;
  --trait:    #E4DED2;
  --accent:   #A5431F;
  --marqueur: #F5E4A3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --papier:   #191714;
    --encre:    #EDE8DF;
    --encre-2:  #9B948A;
    --trait:    #322E28;
    --accent:   #E07A4C;
    --marqueur: #4A3F1E;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  max-width: 42rem;
  padding: 1.5rem 1.25rem 4rem;
  margin-inline: auto;
}

::selection { background: var(--marqueur); }

h1, h2, h3 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--accent); }

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

/* lien d'évitement pour la navigation clavier */
.evitement {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 10000;
  background: var(--encre);
  color: var(--papier);
  padding: .5rem .9rem;
  border-radius: 4px;
  text-decoration: none;
  transition: top .2s;
}
.evitement:focus { top: 1rem; color: var(--papier); }


/* header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  padding-bottom: 2.5rem;
}
.nom {
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
}
.site-header nav {
  display: flex;
  gap: .2rem;
  flex-wrap: wrap;
  margin-right: -.65rem;
}
.site-header nav a {
  font-size: .9rem;
  color: var(--encre-2);
  text-decoration: none;
  padding: .35rem .65rem;
  border-radius: 999px;
  transition: transform .18s cubic-bezier(.2,1,.3,1), background .18s, color .18s;
}
.site-header nav a:hover { color: var(--accent); }

/* header empilé sur mobile */
@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
    padding-bottom: 1.75rem;
  }
  .site-header nav {
    width: 100%;
    margin-left: -.65rem;
    margin-right: 0;
  }
  .site-header nav a {
    font-size: .95rem;
    padding: .5rem .7rem;
  }
}

/* retour tactile : onde à l'appui + halo qui suit le doigt (mobile) */
a { -webkit-tap-highlight-color: transparent; }

.halo-doigt {
  position: fixed;
  top: 0; left: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  pointer-events: none;
  z-index: 9999;
  transform: translate3d(-100px, -100px, 0) translate(-50%, -50%);
  opacity: 0;
  transition: opacity .3s;
  will-change: transform;
}
.halo-doigt.is-on { opacity: 1; }

.onde {
  position: fixed;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  animation: ondeOut .55s ease-out forwards;
}
@keyframes ondeOut {
  from { transform: translate(-50%, -50%) scale(1);   opacity: .7; }
  to   { transform: translate(-50%, -50%) scale(4.5); opacity: 0; }
}
@media (hover: none) {
  a:active { color: var(--accent); }
  .site-header nav a:active,
  .liens a:active {
    background: var(--marqueur);
    color: var(--encre);
    transform: scale(.93);
  }
  .projet:active,
  .frise li:active {
    transform: scale(.985);
  }
  .projet, .frise li {
    transition: transform .18s cubic-bezier(.2,1,.3,1);
  }
}


/* intro */
.intro { padding: 2.5rem 0 1rem; }
.intro h1 {
  font-size: clamp(2.1rem, 6.5vw, 3.1rem);
  margin: 0 0 1.25rem;
}
.surligne {
  background: linear-gradient(transparent 55%, var(--marqueur) 55%, var(--marqueur) 92%, transparent 92%);
  padding: 0 .08em;
}
.statut { color: var(--encre-2); }
.statut strong { color: var(--encre); }


/* sections */
section {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--trait);
}
.intro {
  margin-top: 0;
  border-top: 0;
}
h2 {
  font-size: 1.6rem;
  margin: 0 0 1.25rem;
}
h2::after {
  content: ".";
  color: var(--accent);
}


/* stack — liste compacte */
.stack {
  margin: 2rem 0 0;
  display: grid;
  gap: .6rem;
}
.stack div {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 1rem;
}
.stack dt {
  color: var(--encre-2);
  font-size: .9rem;
  padding-top: .1rem;
}
.stack dd { margin: 0; }
@media (max-width: 480px) {
  .stack div { grid-template-columns: 1fr; gap: 0; }
}


/* projets */
.projet { margin-bottom: 2.25rem; }
.projet h3 {
  font-size: 1.25rem;
  margin: 0 0 .4rem;
}
.projet p { margin: .4rem 0; }
.meta {
  font-size: .875rem;
  color: var(--encre-2);
  font-family: system-ui, sans-serif;
  font-weight: 400;
}
.debuts {
  margin: 2.5rem 0 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--trait);
}


/* parcours */
.frise {
  list-style: none;
  margin: 0;
  padding: 0;
}
.frise li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1rem;
  padding: .9rem 0;
}
.frise li + li { border-top: 1px dashed var(--trait); }
.frise .date {
  color: var(--encre-2);
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
  padding-top: .15rem;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .frise li { grid-template-columns: 1fr; gap: .15rem; }
}


/* contact */
.liens {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.75rem;
}
.liens a {
  display: inline-block;
  padding: .4rem .65rem;
  margin: -.4rem -.65rem;
  border-radius: 999px;
  transition: transform .18s cubic-bezier(.2,1,.3,1), background .18s, color .18s;
}


/* footer */
footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--trait);
  font-size: .85rem;
  color: var(--encre-2);
}

/* curseur custom (repris de l'ancienne version, aux couleurs papier) */
.curseur,
.curseur-pt {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  transform: translate3d(-50%, -50%, 0);
  will-change: transform, width, height;
}
.curseur {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  transition: width .35s cubic-bezier(.2,1,.3,1),
              height .35s cubic-bezier(.2,1,.3,1),
              border-color .3s, background .3s, border-radius .3s;
}
.curseur-pt {
  width: 5px;
  height: 5px;
  background: var(--accent);
}
.curseur.is-hover {
  width: 58px;
  height: 58px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.curseur.is-text {
  width: 5px;
  height: 26px;
  border-radius: 2px;
  background: var(--accent);
  border-width: 0;
}
.curseur.is-down { width: 22px; height: 22px; }

@media (hover: none), (pointer: coarse) {
  .curseur, .curseur-pt { display: none; }
}
@media (hover: hover) and (pointer: fine) {
  body, a, button { cursor: none; }
}


/* barre de progression en haut */
.top-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 999;
}


/* titre du hero : les mots montent un par un */
.titre-hero .line {
  display: block;
  overflow: hidden;
  padding-bottom: .06em;
}
.titre-hero .word {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  margin-right: .22em;
  animation: wordUp 1s cubic-bezier(.2,.9,.2,1) forwards;
}
.titre-hero .line:nth-child(1) .word:nth-child(1) { animation-delay: .10s; }
.titre-hero .line:nth-child(1) .word:nth-child(2) { animation-delay: .17s; }
.titre-hero .line:nth-child(1) .word:nth-child(3) { animation-delay: .24s; }
.titre-hero .line:nth-child(2) .word:nth-child(1) { animation-delay: .35s; }
.titre-hero .line:nth-child(2) .word:nth-child(2) { animation-delay: .42s; }
@keyframes wordUp { to { transform: translateY(0); opacity: 1; } }

/* le surlignage marqueur se dessine après le titre */
.surligne {
  background-repeat: no-repeat;
  background-size: 0% 100%;
  animation: marqueurIn .8s cubic-bezier(.7,0,.2,1) 1.1s forwards;
}
@keyframes marqueurIn { to { background-size: 100% 100%; } }


/* apparition au scroll */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}


@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .titre-hero .word { opacity: 1; transform: none; }
  .surligne { background-size: 100% 100%; }
  .curseur, .curseur-pt { display: none; }
  body, a, button { cursor: auto; }
}
