/* ==========================================================================
   My Sense of Beauty – page d'accueil
   ========================================================================== */

@font-face {
  font-family: "Avenir LT Light";
  src: url("../fonts/avenir-light.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Futura LT Light";
  src: url("../fonts/futura-light.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --noir: #000;
  --blanc: #fff;
  --or: #f1bd12;
  --cuivre: #a36538;
  --cuivre-clair: #cd966f;
  --encre: #191919;
  --police-menu: "Avenir LT Light", sans-serif;
  --police-titre: "Futura LT Light", sans-serif;
  /* Courbes de mouvement : départ vif, arrivée douce */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

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

html {
  background: var(--noir);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--noir);
  color: var(--blanc);
  font-family: var(--police-menu);
}

img {
  display: block;
  max-width: 100%;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Texte réservé aux lecteurs d'écran */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.lien-evitement {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  padding: 12px 16px;
  background: var(--blanc);
  color: var(--noir);
  font: 18px/1.2 var(--police-menu);
  transform: translateY(-120%);
}

.lien-evitement:focus {
  transform: none;
}

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

/* ==========================================================================
   En-tête et menu (bureau)
   ========================================================================== */

.entete {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
}

.burger {
  display: none;
}

.menu {
  position: absolute;
  top: 33px;
  /* centré sur 980px + 492px, sans jamais dépasser du bord droit */
  left: min(calc(50% + 2px), calc(100% - 667px));
}

.menu__liste {
  display: flex;
  height: 50px;
  padding: 0 9px;
  background: var(--noir);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* Lien : filet fin sous l'élément actif, cadre de visée au survol et au focus.
   Seuls transform et opacity sont animés ; la sortie est plus rapide que l'entrée. */
.menu a {
  position: relative;
  display: block;
  height: 100%;
  padding: 0 16px;
  color: var(--or);
  font: 25px/50px var(--police-menu);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, transform 0.16s var(--ease-out);
}

.menu a::before {
  --c: var(--cuivre-clair);
  content: "";
  position: absolute;
  inset: 6px 10px;
  opacity: 0;
  transform: scale(1.12);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%'%3E%3Csvg x='0' y='0' width='1' height='1' overflow='visible'%3E%3Cpath d='M0 0.5H12M0.5 0V12' stroke='%23cd966f' stroke-width='1' fill='none'/%3E%3C/svg%3E%3Csvg x='100%' y='0' width='1' height='1' overflow='visible'%3E%3Cpath d='M0 0.5H-12M-0.5 0V12' stroke='%23cd966f' stroke-width='1' fill='none'/%3E%3C/svg%3E%3Csvg x='0' y='100%' width='1' height='1' overflow='visible'%3E%3Cpath d='M0 -0.5H12M0.5 0V-12' stroke='%23cd966f' stroke-width='1' fill='none'/%3E%3C/svg%3E%3Csvg x='100%' y='100%' width='1' height='1' overflow='visible'%3E%3Cpath d='M0 -0.5H-12M-0.5 0V-12' stroke='%23cd966f' stroke-width='1' fill='none'/%3E%3C/svg%3E%3C/svg%3E") center / 100% 100% no-repeat;
  transition: transform 0.15s var(--ease-out), opacity 0.12s ease-out;
}

.menu a::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 8px;
  left: 16px;
  height: 1px;
  background: var(--cuivre-clair);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.15s var(--ease-out);
}

.menu a:focus-visible {
  color: var(--blanc);
}

.menu a:focus-visible::before {
  opacity: 1;
  transform: scale(1);
  transition-duration: 0.22s, 0.16s;
}

/* Le survol n'existe qu'avec une souris : sur écran tactile il resterait « collé » après un appui */
@media (hover: hover) and (pointer: fine) {
  .menu a:hover {
    color: var(--blanc);
  }

  .menu a:hover::before {
    opacity: 1;
    transform: scale(1);
    transition-duration: 0.22s, 0.16s;
  }
}

.menu a[aria-current="page"] {
  color: var(--blanc);
}

.menu a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* Appui : l'interface « entend » le doigt ou le clic */
.menu a:active {
  transform: scale(0.97);
}

/* Clic : le cadre se verrouille (très bref), un flash discret l'accompagne */
.menu a.declenche::before {
  opacity: 1;
  transform: scale(0.9);
  transition-duration: 0.08s;
}

.flash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--blanc);
  opacity: 0;
  pointer-events: none;
  animation: flash 0.18s var(--ease-out);
}

@keyframes flash {
  0% { opacity: 0; }
  20% { opacity: 0.3; }
  100% { opacity: 0; }
}

/* ==========================================================================
   Bandeau d'accueil
   ========================================================================== */

.hero {
  height: 726px;
  margin-top: 10px;
}

.hero picture,
.hero img {
  width: 100%;
  height: 100%;
}

.hero img {
  object-fit: cover;
  object-position: 50% 50%;
}

/* ==========================================================================
   Portfolio : trois vignettes
   ========================================================================== */

.portfolio__liste {
  display: grid;
  grid-template-columns: 334fr 323fr 323fr;
  margin-top: 10px;
}

.tuile {
  position: relative;
  height: 467px;
  border: 3px solid var(--blanc);
  background: var(--noir);
}

.tuile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

.bouton {
  position: absolute;
  bottom: 12px;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 142px;
  height: 40px;
  background: var(--noir);
  color: #f7f7f7;
  font: 18px/1 var(--police-titre);
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.bouton__texte {
  margin-right: 4px;
}

.bouton__icone {
  flex: none;
  width: 10px;
  height: 10px;
  margin-left: 4px;
  fill: currentColor;
}

/* Toute la vignette est cliquable : un seul lien par photo */
.tuile {
  overflow: hidden;
}

.tuile__lien {
  position: absolute;
  inset: 0;
  display: block;
}

.tuile__lien:focus-visible {
  outline: 2px solid var(--blanc);
  outline-offset: -8px;
}

.tuile .bouton {
  pointer-events: none;
}

/* Sortie rapide (état de repos), entrée plus ample (états actifs) */
.tuile img {
  transition: transform 0.35s var(--ease-out), filter 0.2s ease-out;
}

/* Le collimateur d'autofocus se verrouille sur le sujet de la photo */
.af {
  --c: var(--blanc);
  position: absolute;
  top: var(--afy, 50%);
  left: var(--afx, 50%);
  width: 92px;
  height: 92px;
  margin: -46px 0 0 -46px;
  opacity: 0;
  transform: scale(1.5);
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%'%3E%3Csvg x='0' y='0' width='1' height='1' overflow='visible'%3E%3Cpath d='M0 1H16M1 0V16' stroke='rgba(0,0,0,.6)' stroke-width='4' fill='none'/%3E%3Cpath d='M0 1H16M1 0V16' stroke='%23fff' stroke-width='2' fill='none'/%3E%3C/svg%3E%3Csvg x='100%' y='0' width='1' height='1' overflow='visible'%3E%3Cpath d='M0 1H-16M-1 0V16' stroke='rgba(0,0,0,.6)' stroke-width='4' fill='none'/%3E%3Cpath d='M0 1H-16M-1 0V16' stroke='%23fff' stroke-width='2' fill='none'/%3E%3C/svg%3E%3Csvg x='0' y='100%' width='1' height='1' overflow='visible'%3E%3Cpath d='M0 -1H16M1 0V-16' stroke='rgba(0,0,0,.6)' stroke-width='4' fill='none'/%3E%3Cpath d='M0 -1H16M1 0V-16' stroke='%23fff' stroke-width='2' fill='none'/%3E%3C/svg%3E%3Csvg x='100%' y='100%' width='1' height='1' overflow='visible'%3E%3Cpath d='M0 -1H-16M-1 0V-16' stroke='rgba(0,0,0,.6)' stroke-width='4' fill='none'/%3E%3Cpath d='M0 -1H-16M-1 0V-16' stroke='%23fff' stroke-width='2' fill='none'/%3E%3C/svg%3E%3C/svg%3E") center / 100% 100% no-repeat;
  transition: transform 0.12s ease-out, opacity 0.1s ease-out;
}

.tuile:is(:focus-within, :active) .af {
  opacity: 1;
  transform: scale(1);
  transition: transform 0.26s var(--ease-out), opacity 0.16s ease-out;
}

.tuile:is(:focus-within, :active) img {
  transform: scale(1.03);
  transition: transform 0.6s var(--ease-out), filter 0.25s ease-out;
}

/* Profondeur de champ : les autres photos décrochent */
.portfolio__liste:has(.tuile:focus-within) .tuile:not(:focus-within) img {
  filter: blur(2px) brightness(0.62);
  transform: scale(1.03);
  transition: transform 0.6s var(--ease-out), filter 0.25s ease-out;
}

/* Souris uniquement : pas de survol « collé » sur écran tactile */
@media (hover: hover) and (pointer: fine) {
  .tuile:hover .af {
    opacity: 1;
    transform: scale(1);
    transition: transform 0.26s var(--ease-out), opacity 0.16s ease-out;
  }

  .tuile:hover img {
    transform: scale(1.03);
    transition: transform 0.6s var(--ease-out), filter 0.25s ease-out;
  }

  .portfolio__liste:has(.tuile:hover) .tuile:not(:hover) img {
    filter: blur(2px) brightness(0.62);
    transform: scale(1.03);
    transition: transform 0.6s var(--ease-out), filter 0.25s ease-out;
  }
}

.tuile:is(:hover, :focus-within) .bouton {
  color: var(--blanc);
}

/* Clic : diaphragme très rapide. La photo est découpée par un cercle qui se ferme
   sur le sujet puis se rouvre (clip-path : aucun calque ajouté, pas de propriété personnalisée animée). */
.tuile.declenche img {
  animation: iris 0.16s var(--ease-in-out);
}

.tuile.declenche .af {
  opacity: 1;
  transform: scale(0.82);
  transition-duration: 0.06s;
}

@keyframes iris {
  0%   { clip-path: circle(150% at var(--afx, 50%) var(--afy, 50%)); }
  45%  { clip-path: circle(0% at var(--afx, 50%) var(--afy, 50%)); }
  55%  { clip-path: circle(0% at var(--afx, 50%) var(--afy, 50%)); }
  100% { clip-path: circle(150% at var(--afx, 50%) var(--afy, 50%)); }
}

.tuile--mode .bouton {
  margin-left: 24px;
}

.tuile--mariage .bouton {
  width: 155px;
  margin-left: -77.5px;
}

.tuile--portrait .bouton {
  margin-left: -88.5px;
}

/* Pied de page et barre d'actions rapides : mobile uniquement */
.pied,
.actions-rapides {
  display: none;
}

/* ==========================================================================
   Mobile : maquette de 320px mise à l'échelle de la largeur d'écran
   ========================================================================== */

@media (max-width: 767px) {
  :root {
    --u: calc(100vw / 320);
  }

  /* En-tête : logo + bouton burger */
  .entete {
    height: calc(228 * var(--u));
    pointer-events: none;
  }

  .hero {
    position: relative;
    height: calc(228 * var(--u));
    margin-top: 0;
  }

  .hero picture {
    position: absolute;
    top: calc(20 * var(--u));
    left: calc(20 * var(--u));
    width: calc(280 * var(--u));
    height: calc(158 * var(--u));
  }

  .burger {
    position: absolute;
    top: calc(152 * var(--u));
    left: calc(261 * var(--u));
    z-index: 2;
    display: block;
    width: calc(50 * var(--u));
    height: calc(50 * var(--u));
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    pointer-events: auto;
  }

  .burger__barre {
    position: absolute;
    left: calc(14 * var(--u));
    width: calc(22 * var(--u));
    height: calc(2 * var(--u));
    background: var(--blanc);
    transition: transform 0.25s var(--ease-in-out), opacity 0.2s ease-out;
  }

  .burger__barre:nth-child(1) { top: calc(15 * var(--u)); }
  .burger__barre:nth-child(2) { top: calc(24 * var(--u)); }
  .burger__barre:nth-child(3) { top: calc(33 * var(--u)); }

  .menu-ouvert .burger__barre:nth-child(1) { transform: translateY(calc(9 * var(--u))) rotate(45deg); }
  .menu-ouvert .burger__barre:nth-child(2) { opacity: 0; }
  .menu-ouvert .burger__barre:nth-child(3) { transform: translateY(calc(-9 * var(--u))) rotate(-45deg); }

  /* Menu plein écran */
  .menu {
    position: fixed;
    inset: 0;
    z-index: 1;
    padding-top: calc(58 * var(--u));
    background: var(--noir);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease-out, visibility 0s linear 0.2s;
    pointer-events: auto;
  }

  .menu-ouvert .menu {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.2s ease-out, visibility 0s;
  }

  .menu__liste {
    flex-direction: column;
    width: calc(188 * var(--u));
    height: auto;
    margin: 0 auto;
    padding-left: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
  }

  .menu a {
    height: calc(56 * var(--u));
    padding: 0;
    color: var(--blanc);
    font: calc(20 * var(--u)) / calc(56 * var(--u)) var(--police-titre);
    text-align: center;
  }

  .menu a::before,
  .menu a::after {
    display: none;
  }

  .menu a:is(:hover, :focus-visible) {
    color: var(--cuivre-clair);
  }

  .menu a[aria-current="page"] {
    color: var(--cuivre);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: calc(6 * var(--u));
  }

  .menu-ouvert {
    overflow: hidden;
  }

  /* Vignettes empilées */
  .portfolio__liste {
    display: block;
    margin-top: 0;
  }

  .tuile {
    border-width: calc(3 * var(--u));
  }

  .tuile--mode { height: calc(126 * var(--u)); }
  .tuile--mariage { height: calc(148 * var(--u)); }
  .tuile--portrait { height: calc(164 * var(--u)); }

  .bouton {
    left: calc(7 * var(--u));
    height: calc(31 * var(--u));
    font-size: calc(18 * var(--u));
  }

  .bouton__icone {
    width: calc(10 * var(--u));
    height: calc(10 * var(--u));
    margin-left: calc(4 * var(--u));
  }

  .bouton__texte {
    margin-right: calc(4 * var(--u));
  }

  .af {
    width: calc(64 * var(--u));
    height: calc(64 * var(--u));
    margin: calc(-32 * var(--u)) 0 0 calc(-32 * var(--u));
  }

  .tuile--mode .bouton { bottom: calc(4 * var(--u)); width: calc(100 * var(--u)); margin-left: 0; }
  .tuile--mariage .bouton { bottom: calc(10 * var(--u)); width: calc(112 * var(--u)); margin-left: 0; }
  .tuile--portrait .bouton { bottom: calc(2 * var(--u)); width: calc(112 * var(--u)); margin-left: 0; }

  /* Pied de page */
  .pied {
    display: block;
    height: calc(103 * var(--u));
    padding-top: calc(11 * var(--u));
    text-align: center;
  }

  .pied p {
    margin: 0;
    font: calc(14 * var(--u)) / calc(25.06 * var(--u)) var(--police-menu);
  }

  /* Barre d'actions rapides */
  .actions-rapides {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: flex;
    height: calc(47 * var(--u));
    background: var(--blanc);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  }

  .actions-rapides a {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    color: var(--noir);
  }

  .actions-rapides a:focus-visible {
    outline-color: var(--noir);
    outline-offset: -4px;
  }

  .actions-rapides svg {
    width: calc(28 * var(--u));
    height: calc(17 * var(--u));
    fill: currentColor;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* On garde les fondus de couleur et d'opacité, on retire tout déplacement */
  .menu a,
  .menu a::before,
  .menu a::after,
  .tuile img,
  .af,
  .burger__barre {
    transition-property: color, opacity, filter !important;
    transition-duration: 0.15s !important;
    transform: none !important;
  }

  .menu a::after {
    opacity: 0;
  }

  .menu a[aria-current="page"]::after {
    opacity: 1;
  }

  .menu a.declenche::before {
    transform: none !important;
  }

  .tuile.declenche img,
  .flash {
    animation: none;
  }
}

/* ==========================================================================
   Pages intérieures (portfolio, etc.)
   ========================================================================== */

.logo-mobile {
  display: none;
}

.portfolio__liste--centre {
  grid-template-columns: repeat(3, 1fr);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.portfolio__liste--centre .tuile {
  height: auto;
  aspect-ratio: 2 / 3;
}

.page-interne .pied p {
  margin: 0;
  font: 14px/25px var(--police-menu);
}

.page-interne .pied a {
  color: var(--blanc);
}

@media (min-width: 768px) {
  .page-interne main {
    padding-top: 120px;
  }

  .page-interne .menu {
    left: 50%;
    transform: translateX(-50%);
  }

  .page-interne .pied {
    display: block;
    padding: 64px 20px 40px;
    text-align: center;
  }

  .portfolio__liste--centre .tuile .bouton {
    left: 50%;
    margin-left: 0;
    transform: translateX(-50%);
  }
}

@media (max-width: 767px) {
  .logo-mobile {
    position: relative;
    display: block;
    height: calc(228 * var(--u));
  }

  .logo-mobile img {
    position: absolute;
    top: calc(20 * var(--u));
    left: calc(20 * var(--u));
    width: calc(280 * var(--u));
    height: calc(158 * var(--u));
  }

  .portfolio__liste--centre {
    display: block;
    padding: 0;
  }

  .portfolio__liste--centre .tuile .bouton {
    bottom: calc(6 * var(--u));
  }

  .page-interne .pied {
    height: auto;
    padding: calc(16 * var(--u)) 0 calc(70 * var(--u));
  }

  .page-interne .pied p {
    font-size: calc(14 * var(--u));
    line-height: calc(25 * var(--u));
  }
}
