/* ==========================================================================
   Portfolio Coralie LEFORT – socle commun (toutes les pages)
   ========================================================================== */

:root {
  --text-primary: #303030;
  --text-on-inverse: #d1d6e0;
  --border: #d1d6e0;
  --bg: #f7f7f7;
  --surface: #fff;
  --surface-inverse: #303030;
  --accent: #ce12b2;

  --font-serif: "Playfair Display", Georgia, serif;
  --font-sans: "Work Sans", system-ui, sans-serif;

  --container: 1440px;
  --gutter-min: 80px;
  /* marge latérale : 80px, qui grandit au-delà de 1440px pour centrer le contenu */
  --gutter: max(var(--gutter-min), calc((100vw - var(--container)) / 2 + var(--gutter-min)));
  --navbar-h: 91px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--navbar-h); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, ol { margin: 0; padding: 0; }
ol { list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

em { font-style: italic; }

/* Titres avec mots en italique noir */
.h-section {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 44px;
  line-height: normal;
}
.h-section em { font-weight: 900; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--navbar-h);
  padding: 24px var(--gutter);
  background: var(--bg);
}

/* Desktop : la barre est en verre liquide et devient une « pill » au scroll (≥ 768px, pas de mobile) */
@media (min-width: 768px) {
  .navbar {
    width: 100%;
    margin-inline: auto;
    border: 1px solid transparent;
    border-radius: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, .22) 100%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    backdrop-filter: blur(18px) saturate(180%);
    box-shadow:
      0 0 0 rgba(48, 48, 48, 0),
      inset 0 1px 0 rgba(255, 255, 255, .9),
      inset 0 -1px 0 rgba(255, 255, 255, .25),
      inset 0 0 18px rgba(255, 255, 255, .25);
    transition: border-radius .5s, width .5s cubic-bezier(.22, 1, .36, 1), transform .5s cubic-bezier(.22, 1, .36, 1),
      padding .5s cubic-bezier(.22, 1, .36, 1), background-color .4s, border-color .4s,
      box-shadow .4s, backdrop-filter .4s, -webkit-backdrop-filter .4s;
  }
  .navbar .brand__name { transition: font-size .5s cubic-bezier(.22, 1, .36, 1); }

  .navbar.is-scrolled {
    width: min(max(50vw, 820px), calc(100% - 32px));
    transform: translateY(12px);
    padding-inline: 32px;
    border-color: rgba(255, 255, 255, .55);
    border-radius: 50px;
    box-shadow:
      0 8px 32px rgba(48, 48, 48, .12),
      inset 0 1px 0 rgba(255, 255, 255, .9),
      inset 0 -1px 0 rgba(255, 255, 255, .25),
      inset 0 0 18px rgba(255, 255, 255, .25);
  }
  .navbar.is-scrolled .brand__name { font-size: 24px; }
  .navbar.is-scrolled .menu { gap: 28px; }
  .navbar.is-scrolled .actions { gap: 16px; }
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand__name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 32px;
  line-height: normal;
  white-space: nowrap;
}

.menu { display: flex; align-items: center; gap: 40px; white-space: nowrap; }
.menu__link { line-height: 1.6; transition: opacity .2s; }
.menu__link:hover { opacity: .65; }
.menu__link.is-active {
  font-weight: 600;
  text-decoration: underline;
  text-underline-position: from-font;
}

.actions { display: flex; align-items: center; gap: 24px; }

.lang { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: normal; }
.lang__btn { font-size: 14px; font-weight: 400; }
.lang__btn.is-active { font-weight: 700; }
.lang__sep { color: var(--border); }

.btn-cta {
  padding: 12px 24px;
  border: .75px solid var(--text-primary);
  border-radius: 25px;
  background: linear-gradient(180deg, rgba(228, 248, 254, .6) 0%, rgba(180, 184, 242, .6) 96.6%);
  font-weight: 600;
  font-size: 14px;
  line-height: normal;
  white-space: nowrap;
  transition: transform .2s, box-shadow .2s;
}
.btn-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(180, 184, 242, .5); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  padding: 18px 36px;
  border-radius: 40px;
  font-weight: 600;
  font-size: 18px;
  line-height: normal;
  white-space: nowrap;
  transition: transform .2s, box-shadow .2s, background-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: var(--surface); }
.btn--primary:hover { box-shadow: 0 10px 24px rgba(206, 18, 178, .35); }
.btn--secondary { background: var(--surface); color: var(--text-primary); border: 1px solid var(--text-primary); }
.btn--secondary:hover { box-shadow: 0 10px 24px rgba(48, 48, 48, .15); }

/* ---------- Décors (blobs + texture) ---------- */
.deco { position: absolute; left: 0; width: 100%; overflow: hidden; pointer-events: none; z-index: 0; }
.deco img { position: absolute; max-width: none; }
.deco img.u-mobile { display: none; }

.deco__ellipse,
.deco__polygon { position: absolute; display: flex; align-items: center; justify-content: center; }
.deco__ellipse > div,
.deco__polygon > div { position: relative; flex: none; }

main { position: relative; }

.deco__texture {
  position: absolute;
  inset: 0;
  background: url("../assets/texture.png") top left / 134px 134px;
  opacity: .05;
  mix-blend-mode: overlay;
}

/* ---------- Métriques (accueil + pages projets) ---------- */
.metrics { display: flex; flex-wrap: wrap; gap: 16px; }
.metric {
  flex: 1 1 0;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 32px 28px;
  background: var(--surface);
  border-radius: 24px;
}
.metric__value {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 40px;
  line-height: normal;
  white-space: nowrap;
}
.metric__value--tight { letter-spacing: -1.7px; }
.metric__unit { font-weight: 700; font-size: 24px; }
.metric__unit--plus { font-size: 32px; }
.metric__big32 { font-weight: 700; font-size: 32px; }
.metric__big36 { font-size: 36px; }
.metric__sub { font-size: 32px; }
.metric__label { font-size: 14px; line-height: 1.4; }


/* ---------- CTA ---------- */
.cta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 120px var(--gutter);
  background: conic-gradient(from 90deg at 50% 50%, #fff -25.73%, rgba(247, 247, 247, .29) 52.97%, #fff 74.27%, rgba(247, 247, 247, .29) 152.97%);
  backdrop-filter: blur(2px);
}
.cta__title {
  width: 100%;
  max-width: 800px;
  text-align: center;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 44px;
  line-height: normal;
}
.cta__title em { font-weight: 900; }

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 60px;
  min-height: 393px;
  padding: 80px var(--gutter) 40px;
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
}
.footer__top { display: flex; justify-content: space-between; gap: 40px; }
.footer__left { display: flex; flex-direction: column; gap: 16px; width: 400px; max-width: 100%; }
.footer__name { font-family: var(--font-serif); font-weight: 700; font-size: 32px; line-height: normal; color: #fff; }
.footer__role { font-size: 16px; line-height: 1.6; }
.footer__links { display: flex; gap: 80px; font-size: 14px; line-height: normal; }
.footer__col { display: flex; flex-direction: column; gap: 12px; }
.footer__col a { transition: color .2s; }
.footer__col a:hover { color: #fff; }
.footer__heading { font-weight: 700; text-transform: uppercase; color: #fff; }
.footer__line { width: 100%; height: 1px; }
.footer__legal { font-size: 14px; line-height: normal; }

/* ---------- Animations ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Accessibilité ---------- */
/* Lien d'évitement : visible uniquement au focus clavier */
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 1000;
  padding: 12px 20px; border-radius: 8px;
  background: var(--surface-inverse); color: var(--surface); font-weight: 600;
}
.skip-link:focus { top: 16px; }

/* Focus clavier visible (double anneau : lisible sur fonds clairs et sombres) */
:focus-visible { outline: 3px solid var(--surface-inverse); outline-offset: 3px; box-shadow: 0 0 0 6px var(--surface); }
main:focus { outline: none; }

/* Bouton pause / lecture des vidéos automatiques (positionné en JS) */
.video-toggle {
  position: absolute; z-index: 2; transform: translate(-50%, -100%);
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(48, 48, 48, .75); color: #fff;
}
.video-toggle:hover { background: var(--surface-inverse); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0s !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  :root { --gutter: 48px; }
  .menu { gap: 24px; }
}

@media (max-width: 960px) {
  .navbar { height: auto; min-height: var(--navbar-h); flex-wrap: wrap; gap: 12px 24px; padding-block: 16px; }
  .menu { order: 3; width: 100%; justify-content: center; }
  .brand__name { font-size: 26px; }

  .footer__top { flex-direction: column; }
}

/* Mobile (frame Figma 393 px) – n'affecte pas le rendu ≥ 768px */
@media (max-width: 767px) {
  :root { --gutter: 20px; --navbar-h: 102px; }

  /* Navbar : 2 rangées (marque + langue / liens) */
  .navbar {
    height: auto;
    min-height: var(--navbar-h);
    padding: 16px;
    gap: 12px;
    background: #faf9f6;
  }
  .brand__name { font-size: 28px; }
  .btn-cta { display: none; }
  .menu { order: 3; width: 100%; justify-content: flex-start; gap: 20px; font-size: 14px; }
  .menu__link { line-height: normal; }
  .menu__link.is-active { font-weight: 700; }
  .lang { gap: 6px; }
  .lang__btn { font-size: 12px; }

  /* Métriques */
  .metrics { flex-direction: column; flex-wrap: nowrap; gap: 16px; }
  .metric { flex: none; width: 100%; min-width: 0; padding: 28px 32px; }

  /* CTA */
  .cta { padding: 64px var(--gutter); }
  .cta__title { font-size: 32px; }

  /* Footer */
  .footer { gap: 40px; min-height: 0; padding: 48px var(--gutter) 40px; }
  .footer__top { flex-direction: column; gap: 40px; }
  .footer__left { width: 100%; }
  .footer__links { flex-direction: column; flex-wrap: nowrap; gap: 32px; }
  .footer__col { gap: 8px; }
  .footer__name,
  .footer__heading {
    background: linear-gradient(180deg, #e4f8fe 0%, #b4b8f2 96.635%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    align-self: flex-start;
  }
  .footer__heading { font-size: 12px; }

  /* Variantes d'images de décor (desktop / mobile) */
  .deco img.u-desktop { display: none; }
  .deco img.u-mobile { display: block; }
}
