/* ============================================================
   BASE — styles partagés par toutes les pages
   (accueil, à propos, posture, contact, portfolio, sites-web)

   1. Variables
   2. Reset & éléments
   3. Header / navigation
   4. Navigation principale (variante --main)
   5. Icônes réseaux sociaux
   6. Footer
   7. Bouton « retour en haut »
   8. Bouton son des vidéos
   ============================================================ */


/* ============================================================
   1. VARIABLES
   ============================================================ */

:root {
  /* Couleurs */
  --color-bg:           #ffffff;
  --color-bg-alt:       #f7f7f7;
  --color-surface:      #ffffff;
  --color-text:         #000000;
  --color-text-muted:   #333333;
  --color-accent:       #15FF00;
  --color-accent-hover: #12e000;
  --color-accent-light: rgba(21, 255, 0, 0.15);
  --color-border:       #000000;

  /* Typographie */
  --font-family:        'Inter', system-ui, -apple-system, sans-serif;
  --font-size-base:     1rem;
  --font-size-sm:       0.875rem;
  --font-size-lg:       1.125rem;
  --font-size-xl:       1.25rem;
  --font-size-2xl:      1.5rem;
  --font-size-3xl:      2rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold:   700;
  --line-height:        1.6;

  /* Espacements */
  --space-xs:   0.5rem;
  --space-sm:   1rem;
  --space-md:   1.5rem;
  --space-lg:   2.5rem;
  --space-xl:   4rem;
  --space-2xl:  6rem;

  /* Mise en page */
  --container-max:  72rem;
  --header-height:  4rem;
  --radius-sm:      0.5rem;
  --radius-md:      0.75rem;
  --radius-lg:      1rem;
  --radius-pill:    999px;
  --transition:     0.2s ease;

  /* Navigation principale */
  --nav-main-size:  clamp(1rem, 1.45vw, 1.5625rem);
}


/* ============================================================
   2. RESET & ÉLÉMENTS
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  overflow-x: clip;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  max-width: 100%;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul { list-style: none; }

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-md);
}


/* ============================================================
   3. HEADER / NAVIGATION
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  height: var(--header-height);
  max-width: 100%;
}

.nav {
  display: flex;
  align-items: center;
  height: 100%;
  gap: var(--space-md);
}

.nav__logo-link {
  flex-shrink: 0;
  line-height: 0;
  transition: opacity var(--transition);
}

.nav__logo-link:hover {
  opacity: 0.7;
}

.nav__logo-img {
  height: 2rem;
  width: auto;
  object-fit: contain;
  display: block;
}

.nav__links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  margin-left: auto;
}

.nav__links a {
  font-size: 0.75rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color var(--transition);
}

.nav__links a:hover {
  color: var(--color-accent);
}

/* Bouton burger (mobile) */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: var(--space-xs);
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  transition: transform var(--transition), opacity var(--transition);
}

/* ---- Mobile : menu déroulant ---- */

@media (max-width: 640px) {
  html.mobile-nav-open,
  body.mobile-nav-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.mobile-nav-open::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 99;
    background: var(--color-accent);
  }

  body.mobile-nav-open .site-header {
    position: relative;
    z-index: 112;
    background: var(--color-accent);
    backdrop-filter: none;
    border-bottom: none;
    pointer-events: auto;
  }

  body.mobile-nav-open .nav__logo-link,
  body.mobile-nav-open .social-icons,
  body.mobile-nav-open .nav__toggle {
    position: relative;
    z-index: 114;
  }

  body.mobile-nav-open .scroll-top {
    visibility: hidden;
    pointer-events: none;
  }

  .site-header {
    overflow: visible;
  }

  .nav {
    position: relative;
    flex-wrap: nowrap;
  }

  .nav__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 110;
    flex-direction: column;
    align-items: flex-end;
    background: var(--color-surface);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-sm);
    margin-left: 0;
  }

  .nav__links.is-open {
    display: flex;
    position: fixed;
    top: var(--mobile-nav-header-h, var(--header-height));
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 110;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    margin: 0;
    padding: clamp(3.25rem, 12vh, 6.5rem) 0.8rem 2rem;
    overflow-y: auto;
    background: transparent;
    border: none;
    box-shadow: none;
    pointer-events: auto;
    gap: 0.15rem;
  }

  .nav__links.is-open li {
    max-width: 100%;
    min-width: 0;
  }

  .nav__links.is-open a {
    pointer-events: auto;
  }

  .nav__links a {
    padding: 0.25rem 0;
    font-size: var(--font-size-sm);
  }

  .nav__links.is-open a,
  .nav__links.is-open a:hover {
    color: var(--color-text);
  }

  .nav__toggle {
    display: flex;
    position: relative;
    z-index: 111;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 2rem;
    height: 2rem;
  }

  body.mobile-nav-open .social-icons {
    display: none;
  }

  body.mobile-nav-open .nav__toggle span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.7rem;
    height: 4px;
    margin: 0;
  }

  body.mobile-nav-open .nav__toggle span:nth-child(1) {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  body.mobile-nav-open .nav__toggle span:nth-child(2) {
    opacity: 0;
  }

  body.mobile-nav-open .nav__toggle span:nth-child(3) {
    transform: translate(-50%, -50%) rotate(-45deg);
  }
}

/* ---- Desktop : liens en ligne ---- */

@media (min-width: 641px) {
  .nav__links {
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
  }

  .nav__links a {
    font-size: 0.7rem;
  }
}


/* ============================================================
   4. NAVIGATION PRINCIPALE (header de toutes les pages)
   ============================================================ */

.site-header--main {
  height: auto;
  min-height: var(--header-height);
  border-bottom: none;
}

.nav--main {
  max-width: 100%;
  padding: 0.5625rem clamp(1rem, 1.16vw, 1.25rem);
  height: auto;
  min-width: 0;
}

.nav__links--main {
  gap: clamp(0.75rem, 2vw, 2rem);
}

.nav__links--main a {
  font-size: var(--nav-main-size);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.nav__tab {
  display: inline-flex;
  align-items: center;
  padding: 0.35em 0.75em;
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-pill);
  color: var(--color-text);
  transition: background var(--transition), color var(--transition);
}

.nav__links a.nav__tab:hover,
.nav__tab--active {
  background: var(--color-accent);
  color: var(--color-text);
}

@media (max-width: 640px) {
  .nav__item--desk {
    display: none;
  }
}

@media (min-width: 641px) {
  .nav__item--phone {
    display: none;
  }
}

/* Page courante (aria-current="page" dans le HTML) */
.nav__links--main a[aria-current="page"] {
  color: var(--color-accent);
}

@media (max-width: 640px) {
  .nav--main {
    padding-inline: 0.75rem;
    gap: 0.5rem;
  }

  .nav__logo-img {
    height: 1.5rem;
  }

  .nav__links--main.is-open a,
  .nav__links--main.is-open a:hover,
  .nav__links--main.is-open a[aria-current="page"] {
    color: #000;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: clamp(3rem, 19.85vw, 4.875rem);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.02em;
    text-align: left;
    text-transform: lowercase;
    display: block;
    max-width: 100%;
    padding: 0;
  }

  .nav__links--main.is-open a.nav__link--fit {
    font-size: clamp(2.4rem, 17.2vw, 4.45rem);
    white-space: nowrap;
  }
}


/* ============================================================
   5. ICÔNES RÉSEAUX SOCIAUX (Behance, LinkedIn, Facebook)
   ============================================================ */

.social-icons {
  display: flex;
  flex-shrink: 0;
  gap: 2px;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: #d0cdcd;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  transition: background 0.3s ease-in-out;
}

.social-icons a:hover {
  background: #00c3f4;
  color: #fff;
}


/* ============================================================
   6. FOOTER
   ============================================================ */

.site-footer {
  padding: var(--space-md) 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}


/* ============================================================
   7. BOUTON « RETOUR EN HAUT » — flèche verte ↑
   Visibilité gérée en JS (classe .is-visible) :
   accueil → js/home.js · autres pages → js/pages.js
   ============================================================ */

.scroll-top {
  position: fixed;
  top: auto;
  bottom: clamp(1rem, 8vw, 5rem);
  right: clamp(0.75rem, 2vw, 1.5rem);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(3rem, 7vw, 7.875rem);
  height: clamp(3rem, 8vw, 8.542rem);
  padding: 0;
  background: none;
  border: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition), visibility var(--transition),
              transform var(--transition);
}

.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.scroll-top.is-visible:hover {
  transform: translateY(-3px);
}

.scroll-top__arrow {
  font-size: clamp(3rem, 7vw, 7.51rem);
  font-weight: 500;
  line-height: 1;
  color: var(--color-accent);
}


/* ============================================================
   8. BOUTON SON DES VIDÉOS (rond en bas à droite de la vidéo)
   Accueil (showreel) + portfolio (vidéo Montreux Jazz).
   Comportement : NOQUADRI.bindVideoSound() dans js/base.js
   ============================================================ */

.video-mute {
  position: absolute;
  right: clamp(0.75rem, 2vw, 1.5rem);
  bottom: clamp(0.75rem, 2vw, 1.5rem);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: var(--color-accent);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.video-mute:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-2px);
}

.video-mute:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
