/* ==========================================================
   Elise Braud — portfolio
   Couleurs et typo reprises du site Squarespace d'origine.
   ========================================================== */

:root {
  --bg: hsl(0, 66.67%, 96.47%);        /* rose pâle #fcf0f0 */
  --ink: hsl(229.71, 43.21%, 15.88%);  /* bleu nuit #171d3a */
  --accent: hsl(294.17, 100%, 79.8%);  /* lilas du logo */
  --orange: #ff8a1e;                   /* titres de la page Info */
  --gutter: 4vw;
  --max: 1422px;
  --header-h: clamp(123px, calc(3.35vw + 89px), 160px);
  --font-body: "Nunito Sans", system-ui, sans-serif;
  --font-head: "Rubik", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
a { color: inherit; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
}
h1 { font-size: min(calc(6vw + 1rem), 101px); line-height: 0.8; }
h2 { font-size: min(calc(3.12vw + 1rem), 60px); line-height: 0.9; }
h3 { font-size: min(calc(1.44vw + 1rem), 36px); line-height: 0.95; margin-bottom: 0.5em; }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 var(--gutter);
  background: var(--bg);
  box-shadow: 0 2px 10px rgba(23, 29, 58, 0.12);
}
main { padding-top: var(--header-h); }

.logo { flex: 0 1 auto; margin-right: auto; }
.logo img { height: 88px; width: auto; max-width: 100%; }

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  column-gap: 30px;
  row-gap: 0;
  max-width: 330px;
  text-align: right;
}
.nav-item { position: relative; }
.nav-item > a,
.nav-item > button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0.1em 0;
  cursor: pointer;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.25s ease;
}
.nav-item > a:hover,
.nav-item > button:hover,
.nav-item.active > a,
.nav-item.active > button { background-size: 100% 1px; }

.folder-menu {
  position: absolute;
  right: -16px;
  top: 100%;
  min-width: 100%;
  padding: 8px 16px;
  background: var(--bg);
  text-align: right;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.folder:hover .folder-menu,
.folder:focus-within .folder-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.folder-menu a {
  display: block;
  line-height: 1.3;
  padding: 2px 0;
  text-decoration: none;
}
.folder-menu a:hover,
.folder-menu a[aria-current] { text-decoration: underline; text-underline-offset: 3px; }

.socials { display: flex; gap: 28px; align-items: center; }
.socials a { display: block; width: 21px; height: 21px; color: var(--ink); transition: opacity 0.2s; }
.socials a:hover { opacity: 0.7; }
.socials svg { width: 100%; height: 100%; fill: currentColor; }
.header-socials { margin-left: 19px; }

.burger { display: none; }

@media (min-width: 1200px) {
  .nav { max-width: none; flex-wrap: nowrap; }
}

/* ---------- Menu mobile ---------- */

@media (max-width: 767px) {
  :root { --header-h: 76px; --gutter: 6vw; }
  .logo img { height: 46px; }
  .nav, .header-socials { display: none; }

  .burger {
    display: grid;
    gap: 7px;
    place-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
  }
  .burger span {
    display: block;
    width: 26px;
    height: 1.5px;
    background: var(--ink);
    transition: transform 0.25s;
  }
  .menu-open .burger span:first-child { transform: translateY(4.25px) rotate(45deg); }
  .menu-open .burger span:last-child { transform: translateY(-4.25px) rotate(-45deg); }

  .mobile-menu {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 6vw var(--gutter) 10vw;
    background: var(--bg);
    overflow-y: auto;
  }
  .mobile-menu[hidden] { display: none; }
  .m-nav { display: flex; flex-direction: column; align-items: center; }
  .m-nav a,
  .m-nav button {
    font: inherit;
    font-size: 1.75rem;
    line-height: 1.6;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
  }
  .m-folder::after { content: " ›"; }
  .m-back { opacity: 0.6; }
  .m-back::before { content: "‹ "; }
  .m-sub {
    display: none;
    flex-direction: column;
    align-items: center;
  }
  .m-nav.in-folder > :not(.m-sub.open) { display: none; }
  .m-sub.open { display: flex; }
  .mobile-menu .socials { justify-content: center; }
}

/* ---------- Blocs de contenu ---------- */

main { min-height: 60vh; }

.block {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 41px var(--gutter);
}
.block + .block { padding-top: 0; }

/* Galeries pleine largeur (comme sur Squarespace) */
.block.full { max-width: none; padding-top: var(--gutter); }

/* Lien lightbox */
.lb { display: block; cursor: zoom-in; }

/* Masonry */
.masonry { display: flex; gap: var(--gap); align-items: flex-start; }
.masonry.ready { display: flex; }
.masonry:not(.ready) { display: block; columns: var(--cols); column-gap: var(--gap); }
.masonry:not(.ready) .masonry-item { break-inside: avoid; margin-bottom: var(--gap); }
.masonry-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.masonry img { width: 100%; }

/* Grille */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: var(--gap);
}
.grid img { width: 100%; aspect-ratio: var(--ratio); object-fit: cover; }

/* Bandes : lignes justifiées (hauteur cible ~380px, chaque ligne remplit la largeur) */
.strips { display: flex; flex-wrap: wrap; gap: var(--gap); }
.strips figure { flex: var(--r) 1 calc(var(--r) * 380px); min-width: 0; }
.strips img { width: 100%; height: 100%; object-fit: cover; }

/* Image seule */
.single figure { margin: 0 auto; }
.single img { width: 100%; }

/* Vidéo */
.video-frame { margin: 0 auto; aspect-ratio: 16 / 9; }
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Intro projet */
.intro {
  display: grid;
  grid-template-columns: var(--indent) minmax(0, 1fr) calc(100% - var(--at));
  align-items: start;
  padding-top: 68px;
  padding-bottom: min(7vw, 134px);
}
.intro-title { grid-column: 2; }
.intro-details { grid-column: 3; }
.intro h2 { margin-top: 0.1em; }

/* Info + contact */
.about {
  display: grid;
  grid-template-columns: 25.7% 53.8%;
  column-gap: 7.9%;
  align-items: start;
  padding-top: 70px;
  padding-bottom: 120px;
}
.about-photo { padding-left: 18px; }
.about-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 30px; }
.about-text h3 { color: var(--orange); margin-bottom: 0.4em; }
.about-text h3 + p { margin-top: 0; }
.about-text p + h3 { margin-top: 1.6em; }
.nda-link { text-decoration: none; }
.nda-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.nda-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.6;
  vertical-align: 2px;
  color: var(--bg);
  background: var(--ink);
  border-radius: 999px;
}

/* 404 */
.notfound { text-align: center; padding-top: 120px; padding-bottom: 160px; }

/* Pages sous NDA : reprend l'écran verrouillé d'origine (fond sombre + flamme) */
body.locked { background: #1a191f; color: #fff; }
body.locked main { padding: 0; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; }
.lock-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px var(--gutter);
  font-family: "Jost", "Futura", system-ui, sans-serif;
  font-weight: 300;
  font-size: 18px;
  line-height: 1.5;
}
.lock-flame { width: 120px; height: auto; mix-blend-mode: lighten; margin-bottom: 12px; }
.lock-screen h1 {
  font-family: inherit;
  font-weight: 300;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin: 0 0 28px;
}
.lock-screen p { margin: 0; color: rgba(255, 255, 255, 0.75); }
.lock-form {
  display: flex;
  align-items: center;
  width: min(326px, 100%);
  margin-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  transition: border-color 0.3s;
}
.lock-form:focus-within { border-color: #fff; }
.lock-form input {
  flex: 1;
  min-width: 0;
  padding: 10px 2px;
  font: inherit;
  font-size: 16px;
  color: #fff;
  background: transparent;
  border: 0;
  outline: none;
}
.lock-form input::placeholder { color: rgba(255, 255, 255, 0.5); }
.lock-form button {
  padding: 8px 4px;
  font: inherit;
  font-size: 18px;
  color: #fff;
  background: none;
  border: 0;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.lock-form button:hover { transform: translateX(4px); }
.lock-error { margin: -24px 0 28px !important; color: #ff9b8a !important; font-size: 14px; }
.lock-form.shake { animation: shake 0.4s ease; }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.lock-mail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(326px, 100%);
  margin-top: 14px;
  padding: 10px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  text-decoration: none;
  font-weight: 400;
  font-size: 16px;
  transition: border-color 0.3s;
}
.lock-mail span { transition: transform 0.3s ease; }
.lock-mail:hover { border-color: #fff; }
.lock-mail:hover span { transform: translateX(4px); }
.lock-back {
  margin-top: 48px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.3s;
}
.lock-back:hover { color: #fff; }

@media (max-width: 767px) {
  .masonry[data-cols="2"] { --cols: 1; }
  .masonry[data-cols="3"] { --cols: 2; --gap: 12px; }
  .grid { --cols: 1 !important; grid-template-columns: 1fr; padding-left: var(--gutter); padding-right: var(--gutter); }
  .grid[style*="--ratio:3/4"] { grid-template-columns: 1fr 1fr; gap: 12px; }
  .strips figure { flex-basis: 100%; }
  .single figure, .video-frame { width: 100% !important; }
  .intro { grid-template-columns: 1fr; row-gap: 24px; padding-top: 34px; padding-bottom: 32px; }
  .intro-title, .intro-details { grid-column: 1; }
  .about { grid-template-columns: 1fr; row-gap: 32px; padding-top: 32px; }
  .about-photo { padding-left: 0; }
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 24px var(--gutter) 28px;
  text-align: center;
  font-size: 14.4px;
}
.site-footer .socials { justify-content: center; gap: 12px; margin-bottom: 12px; }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 60px 80px;
  opacity: 0;
  transition: opacity 0.2s;
}
.lightbox.open { opacity: 1; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  width: 48px;
  height: 48px;
  padding: 12px;
}
.lightbox button svg { width: 100%; height: 100%; stroke: currentColor; stroke-width: 1.5; fill: none; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
@media (max-width: 767px) {
  .lightbox { padding: 60px 12px; }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
}

body.no-scroll { overflow: hidden; }

/* ==========================================================
   Animations douces
   Reprises des réglages Squarespace d'origine : apparition
   « scale + fade » (0.65s, ease) et header « scroll-back ».
   ========================================================== */

/* Apparition au défilement */
.js .rv {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.65s ease, transform 0.65s ease;
  transition-delay: var(--d, 0s);
}
.js .rv.in { opacity: 1; transform: none; }

/* Header : se cache en descendant, revient en remontant */
.site-header { transition: transform 0.4s ease, box-shadow 0.4s ease; }
.site-header.hidden { transform: translateY(-100%); box-shadow: none; }

/* Survol des images : léger zoom dans le cadre */
.lb { overflow: hidden; }
.lb img { transition: transform 0.6s ease, opacity 0.6s ease; }
.lb:hover img { transform: scale(1.02); }

/* Lightbox : fondu + léger zoom */
.lightbox img { transform: scale(0.96); transition: transform 0.35s ease, opacity 0.25s ease; }
.lightbox.open img { transform: none; }
.lightbox img.swap { opacity: 0; }

/* Menus */
.folder-menu a { transition: opacity 0.2s; }
.mobile-menu:not([hidden]) { animation: fade-in 0.3s ease; }
.m-sub.open, .m-nav:not(.in-folder) > * { animation: fade-in 0.3s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .js .rv { opacity: 1; transform: none; transition: none; }
  .site-header, .lb img, .lightbox img { transition: none; }
  .lb:hover img { transform: none; }
  .mobile-menu:not([hidden]), .m-sub.open, .m-nav:not(.in-folder) > * { animation: none; }
}

/* ---------- Protection des images ----------
   Empêche glisser-déposer, sélection et menu « Enregistrer l'image » sur mobile.
   (Ne bloque pas les captures d'écran : aucun site ne peut l'empêcher.) */
main img, .lightbox img {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
