/* style.css — couleurs et police tout en haut */

/* Police : Manrope (Google Fonts, licence libre OFL) */
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700&display=swap");

:root {
  --bg: #f4740b;
  --bg-alt: #fed1ab;
  --text: #081d06;
  --muted: #6d6b66;
  --line: #d8d5ce;
  --accent: #fadcb5;
  --font: "Manrope", system-ui, sans-serif;
  --mono: var(--font);           /* petits titres, menu, années */
  --pad: clamp(14px, 2vw, 28px);                 /* marge gauche / droite de tout le site */
  --line-menu: rgba(255, 196, 140, .55);        /* ligne sous le menu */

  /* ----- Tailles du texte (1rem = 16px) ----- */
  --size-menu: .8rem;      /* menu du haut : PROJETS · À PROPOS · CONTACT · EN */
  --size-logo: 1rem;       /* ton nom en haut à gauche */
  --size-titres: 1.2rem;    /* titres des sections dans la page : PROJETS, À PROPOS, CONTACT */
  --size-petit: .8rem;     /* années, numéros, pied de page */

  /* ----- Titre « PROJETS » au-dessus de tes projets ----- */
  --projets-titre-taille: 3rem;   /* taille (ex. 1.5rem) */
  --projets-titre-x: 5px;          /* gauche ↔ droite : plus grand = plus à droite (ex. 40px) */
  --projets-titre-y: 0px;          /* haut ↕ bas : plus grand = plus bas, négatif = plus haut (ex. -20px) */
  --projets-titre-espace: 12px;    /* espace entre le titre et les projets */
}
:root.dark {
  --bg: #030b02;
  --bg-alt: #000100;
  --text: #ff811b;
  --muted: #8f8d87;
  --line: #2b2b28;
  --accent: #f4c989;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; background: var(--bg); overflow-anchor: none; }
body {
  font: 400 1rem/1.6 var(--font);
  background: var(--bg);
  color: var(--text);
  transition: background .25s, color .25s;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3 { font-weight: 500; letter-spacing: -0.02em; }

.mono, .label, .nav { font-family: var(--mono); letter-spacing: .02em; }
.nav   { font-size: var(--size-menu); }      /* menu du haut */
.label { font-size: var(--size-titres); }    /* titres PROJETS, À PROPOS, CONTACT */
.mono  { font-size: var(--size-petit); }     /* années des projets, « Projet suivant », etc. */
.muted { color: var(--muted); }

/* En-tête */
.header {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px var(--pad);                      /* menu étalé sur toute la largeur */
  padding-top: calc(18px + env(safe-area-inset-top, 0px));   /* téléphone : couvre la zone de l'heure / batterie */
  background: var(--bg);
  border-bottom: 1px solid var(--line-menu);     /* ligne orange pâle sous le menu */
}
.logo { font-size: var(--size-logo); font-weight: 500; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: clamp(12px, 2.5vw, 28px); text-transform: uppercase; }
.nav a:hover, .nav button:hover { color: var(--accent); }
#theme { font: 1.1rem/1 system-ui, sans-serif; }

/* Sections */
main { padding: 0 var(--pad); }                 /* contenu sur toute la largeur */
/* L'intro (« Portfolio », la ligne, ton nom) : voir la section « Intro » plus bas. */
.hero { height: calc(100vh - var(--header-h, 62px)); padding-top: 22vh; text-align: center; }  /* 22vh = hauteur de départ du groupe */
#projets { padding-top: 24px; }   /* garder petit : sinon les projets n'arrivent plus sous ton nom */
.hero h1 { font-weight: 700; line-height: 1; letter-spacing: -0.04em; }
.section { padding: clamp(48px, 7vw, 96px) 0; }
.label { color: var(--muted); text-transform: uppercase; font-weight: 400; margin-bottom: 32px; }
.split { display: grid; grid-template-columns: 1fr 3fr; gap: 24px; }
.split .label { margin: 0; }

/* Projets */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px 24px; }
.card { display: block; }
.thumb {
  aspect-ratio: 4 / 3; overflow: hidden;
  display: grid; place-items: center;
  background: var(--bg-alt); color: var(--muted);
  font-family: var(--mono); font-size: var(--size-petit);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 43% 50%;   /* 1er % = gauche↔droite (plus grand = plus à droite), 2e % = haut↕bas */ transition: transform .5s ease; }
.card:hover .thumb img { transform: scale(1.03); }
.card .row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; }
.card h3 { font-size: 1.15rem; }
.card:hover h3 { color: var(--accent); }
.card .row .mono { color: var(--muted); }
.card p { font-size: .95rem; }

/* À propos / contact */
.prose { max-width: 60ch; }
.prose p { font-size: clamp(1.1rem, 1.6vw, 1.35rem); line-height: 1.5; margin-bottom: 1em; }
.photo { width: 160px; aspect-ratio: 1; object-fit: cover; margin-bottom: 28px; }
.arrow { border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.arrow:hover, .big:hover, .links a:hover { color: var(--accent); }
.big { font-size: clamp(1.6rem, 4.5vw, 3.2rem); font-weight: 500; letter-spacing: -0.02em; word-break: break-word; }
.links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 24px; }

/* Page projet */
.project { padding-top: 40px; padding-bottom: 40px; }
.back { display: inline-block; color: var(--muted); margin-bottom: clamp(48px, 8vw, 96px); text-transform: uppercase; }
.back:hover { color: var(--accent); }
.project h1 { font-size: clamp(2.2rem, 6vw, 4.6rem); line-height: 1.05; }
.lead { font-size: clamp(1.1rem, 2vw, 1.5rem); color: var(--muted); max-width: 40ch; margin-top: 16px; }
.meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin: 48px 0; padding: 18px 0;
}
.meta dt { color: var(--muted); text-transform: uppercase; }
.gallery { display: grid; gap: 24px; margin-bottom: 56px; }
.gallery .thumb { aspect-ratio: 16 / 9; }
.actions { display: flex; gap: 24px; margin-top: 8px; }
.next {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: clamp(64px, 10vw, 120px); padding-top: 28px;
}
.next .mono { color: var(--muted); text-transform: uppercase; }
.next strong { font-size: clamp(1.5rem, 4vw, 2.6rem); font-weight: 500; letter-spacing: -0.02em; }
.next:hover strong { color: var(--accent); }

.footer { padding: 28px var(--pad);               /* pied de page sur toute la largeur */
  color: var(--muted); font-family: var(--mono); font-size: var(--size-petit); }

/* Petits écrans */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .grid, .split { grid-template-columns: 1fr; }
  .split .label { margin-bottom: 8px; }
  .meta { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .nav a[href$="apropos"] { display: none; }
  .header { padding-top: 14px; padding-bottom: 14px; }
  .nav { gap: 14px; }
}

/* ===== Néon sur ton nom ===== */
/* Lueur légère, de la même couleur que le texte.
   Plus le nombre en px est gros, plus le halo est large. */
.hero h1 { text-shadow: 0 0 4px currentColor; }

/* ===== Intro : « Portfolio », la ligne, puis ton nom =====
   Tout bouge avec des déplacements et des zooms (transform) : la page n'est
   jamais recalculée pendant l'animation, c'est ce qui la rend fluide.
   --s va de 0 (haut de la page) à 1 (après un écran de défilement), réglé par js/site.js. */
:root {
  --s: var(--scroll, 0);
  --kick: clamp(2.6rem, 11vw, 8rem);   /* taille de « Portfolio » au début */
  --kick-end: .2;                      /* « Portfolio » finit à 20 % de sa taille */
  --name: clamp(3rem, 11vw, 9rem);     /* taille de ton nom à la fin */
  --name-start: .35;                   /* ton nom commence à 35 % de sa taille */
  --line-gap: clamp(20px, 3vw, 36px);  /* espace au-dessus et au-dessous de la ligne */
  --shrink-max: calc(var(--kick) * (1 - var(--kick-end)));        /* place libérée par « Portfolio » */
  --shrink: calc(var(--shrink-max) * var(--s));
  --rest-move: calc(var(--header-h, 62px) + 24px + var(--kick) * var(--kick-end) + 2 * var(--line-gap) + 8px + var(--name) + 24px);
}
.hero-in {
  /* le groupe monte jusqu'en haut de l'écran (24px sous le menu) */
  transform: translateY(calc((78vh + 24px) * var(--s)));
  will-change: transform;
}
.kicker {
  font-size: var(--kick);
  line-height: 1;
  letter-spacing: .12em;
  text-transform: uppercase;
  transform: scale(calc(1 - (1 - var(--kick-end)) * var(--s)));
  transform-origin: 50% 0;
  will-change: transform;
}
/* La ligne garde la même longueur ; elle s'amincit (8px → 2px) et pâlit (→ 30 %) */
.hero-line {
  border: 0;
  width: min(480px, 50%);              /* longueur de la ligne */
  height: 8px;
  margin: var(--line-gap) auto;
  background: var(--text);
  opacity: calc(1 - 0.7 * var(--s));
  transform: translateY(calc(-1 * var(--shrink))) scaleY(calc(1 - 0.75 * var(--s)));
  will-change: transform, opacity;
}
.hero h1 {
  font-size: var(--name);
  transform: translateY(calc(-1 * var(--shrink))) scale(calc(var(--name-start) + (1 - var(--name-start)) * var(--s)));
  transform-origin: 50% 0;
  will-change: transform;
}
/* Le reste de la page remonte vers ton nom pendant l'animation,
   puis arrive 24px sous lui. */
.home #projets, .home #apropos, .home #contact, .home .footer {
  transform: translateY(calc(var(--s) * var(--rest-move)));
  will-change: transform;
}

/* Deux façons d'animer l'intro, chacune parfaitement synchronisée :
   - molette : js/site.js déplace la page et les titres en même temps (classe .js-scroll) ;
   - barre de défilement, clavier, tactile : le navigateur lie l'animation
     directement au défilement (animation-timeline), sans décalage. */
@supports (animation-timeline: scroll()) {
  :root:not(.js-scroll) :is(.hero-in, .kicker, .hero-line, .hero h1),
  :root.home:not(.js-scroll) :is(#projets, #apropos, #contact, .footer) {
    animation-timing-function: linear;
    animation-fill-mode: both;
    animation-duration: auto;
    animation-timeline: scroll(root);
    animation-range: 0 100vh;
  }
  :root:not(.js-scroll) .hero-in   { animation-name: intro-group; }
  :root:not(.js-scroll) .kicker    { animation-name: intro-kick; }
  :root:not(.js-scroll) .hero-line { animation-name: intro-line; }
  :root:not(.js-scroll) .hero h1   { animation-name: intro-name; }
  :root.home:not(.js-scroll) :is(#projets, #apropos, #contact, .footer) { animation-name: intro-rest; }
}
@keyframes intro-group { from { transform: translateY(0); } to { transform: translateY(calc(78vh + 24px)); } }
@keyframes intro-kick  { from { transform: scale(1); } to { transform: scale(var(--kick-end)); } }
@keyframes intro-line  {
  from { transform: translateY(0) scaleY(1); opacity: 1; }
  to   { transform: translateY(calc(-1 * var(--shrink-max))) scaleY(.25); opacity: .3; }
}
@keyframes intro-name  {
  from { transform: translateY(0) scale(var(--name-start)); }
  to   { transform: translateY(calc(-1 * var(--shrink-max))) scale(1); }
}
@keyframes intro-rest  { from { transform: translateY(0); } to { transform: translateY(var(--rest-move)); } }

/* ===== Icône du thème retournée en mode clair ===== */
:root:not(.dark) #theme { transform: scaleX(-1); }

/* ===== Contour flou noir autour de l'écran =====
   Reste fixe pendant qu'on défile et ne bloque pas les clics.
   Premier nombre en px = largeur du flou, deuxième = épaisseur, puis la couleur. */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  box-shadow: inset 0 0 40px 6px rgba(0, 0, 0, .55);
}
/* Sur téléphone et tablette, le navigateur place mal ce contour quand la barre
   d'adresse apparaît ou disparaît (écran sombre au milieu) : on le retire. */
@media (hover: none) and (pointer: coarse) {
  body::after { display: none; }
}

/* ===== Titre « PROJETS » (réglages en haut du fichier : --projets-titre-...) ===== */
#projets .label {
  font-size: var(--projets-titre-taille);
  translate: var(--projets-titre-x) var(--projets-titre-y);
  margin-bottom: var(--projets-titre-espace);
}
