/* ============================================================
   Portfolio Philippe Azzaretti — feuille de style principale
   Palette sombre premium : noir brun, doré mat, ivoire
   ============================================================ */

:root {
  --bg: #0e0d0b;
  --bg-soft: #14120e;
  --surface: #1a1712;
  --surface-2: #211d16;
  --line: rgba(201, 168, 92, 0.16);
  --ivory: #f0eadd;
  --ivory-dim: #b9b2a3;
  --gold: #c9a85c;
  --gold-soft: #a8854a;
  --copper: #b07a4f;
  --font-display: "Syne", "Futura", "Helvetica Neue", sans-serif;
  --font-body: "Space Grotesk", "Helvetica Neue", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 76px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  position: relative; /* ancre du fil de lumière (hauteur = document) */
  background: var(--bg);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--gold); text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
  text-wrap: balance; /* équilibrage des lignes de titres */
}

h1 { font-size: clamp(2.5rem, 6vw, 4.8rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.8vw, 2.8rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 600; }

p { margin: 0 0 1.2em; color: var(--ivory-dim); }

.container {
  width: min(1200px, 92vw);
  margin-inline: auto;
}

section { position: relative; padding: clamp(80px, 12vh, 140px) 0; }

/* Étiquette de section */
.kicker {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.2rem;
}
.kicker::before {
  content: "";
  display: inline-block;
  width: 34px;
  height: 1px;
  background: var(--gold);
  vertical-align: middle;
  margin-right: 12px;
  opacity: 0.7;
}

/* ---------- Navigation ---------- */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  z-index: 100;
  transition: background 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), height 0.4s var(--ease-out);
}
.site-nav.is-scrolled {
  background: rgba(14, 13, 11, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
  height: 64px;
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--ivory);
  letter-spacing: 0.04em;
}
.brand { font-weight: 700; }
.brand em { font-style: normal; color: var(--gold); font-weight: 500; }

.nav-links {
  display: flex;
  gap: 2.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  position: relative;
  color: var(--ivory-dim);
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.3s;
  padding: 6px 0;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--ivory); }
.nav-links a:hover::after, .nav-links a.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Burger */
.burger {
  display: none;
  background: none;
  border: 0;
  width: 44px;
  height: 44px;
  cursor: pointer;
  padding: 10px;
  z-index: 110;
}
.burger span {
  display: block;
  height: 2px;
  background: var(--ivory);
  margin: 5px 0;
  transition: transform 0.35s var(--ease-out), opacity 0.3s;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 820px) {
  .burger { display: block; }
  .nav-links {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    background: rgba(14, 13, 11, 0.97);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--ease-out), visibility 0.4s;
  }
  .nav-links.is-open { opacity: 1; visibility: visible; }
  .nav-links a { font-size: 1.2rem; }
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-block;
  padding: 14px 34px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 0.88rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  transition: color 0.4s var(--ease-out);
  background: transparent;
  cursor: pointer;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: translateY(101%);
  transition: transform 0.45s var(--ease-out);
  z-index: -1;
}
.btn:hover { color: var(--bg); }
.btn:hover::before { transform: translateY(0); }

.btn--ghost { border-color: rgba(240, 234, 221, 0.3); color: var(--ivory); }
.btn--ghost::before { background: var(--ivory); }

.btn-row { display: flex; gap: 1.2rem; flex-wrap: wrap; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.88rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.link-arrow svg { transition: transform 0.35s var(--ease-out); }
.link-arrow:hover svg { transform: translateX(6px); }

/* ---------- Hero accueil ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 60px;
  overflow: hidden;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.hero-title { text-transform: uppercase; letter-spacing: 0.01em; }
.hero-title .line { display: block; overflow: hidden; }
.hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  max-width: 34em;
  margin: 1.6rem 0 2.4rem;
}

/* Composition graphique du hero */
.hero-visual { position: relative; aspect-ratio: 4 / 5; }
.hero-visual .frame {
  position: absolute;
  border: 1px solid var(--line);
}
.hero-visual .frame--1 { inset: 0 12% 12% 0; }
.hero-visual .frame--2 { inset: 8% 4% 4% 8%; border-color: rgba(201, 168, 92, 0.35); }
.hero-visual img, .hero-visual .visual-fill {
  position: absolute;
  inset: 4% 8% 8% 4%;
  width: 88%;
  height: 88%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.04);
}
.hero-visual .orb {
  position: absolute;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(201, 168, 92, 0.35), rgba(176, 122, 79, 0.08) 60%, transparent 75%);
  right: -10%;
  bottom: -6%;
  filter: blur(2px);
  pointer-events: none;
}

@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-visual { max-width: 420px; }
}

/* ---------- Bandeau expertises (marquee) ---------- */
.marquee {
  border-block: 1px solid var(--line);
  padding: 22px 0;
  overflow: hidden;
  white-space: nowrap;
  background: var(--bg-soft);
}
.marquee-track { display: inline-flex; will-change: transform; }
.marquee-track span {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.8rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ivory-dim);
  padding: 0 1.6rem;
}
.marquee-track span::after {
  content: "✦";
  color: var(--gold);
  margin-left: 3.2rem;
  font-size: 0.8em;
}

/* ---------- Grille domaines / cartes portfolio ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: clamp(1.4rem, 3vw, 2.4rem);
  margin-top: 3rem;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 0.5s var(--ease-out), border-color 0.5s, box-shadow 0.5s;
}
.card:hover {
  transform: translateY(-8px);
  border-color: rgba(201, 168, 92, 0.45);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(201, 168, 92, 0.12);
}
.card-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out), filter 0.8s;
  filter: saturate(0.85);
}
.card:hover .card-media img { transform: scale(1.06); filter: saturate(1.05); }
.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(14, 13, 11, 0.55));
  pointer-events: none;
}
.card-body { padding: 1.6rem 1.7rem 1.9rem; }
.card-body h3 { margin-bottom: 0.4em; }
.card-body p { font-size: 0.95rem; margin-bottom: 1.2em; }

/* Cartes domaines (accueil, sans image) */
.domain {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 2rem 1.8rem;
  transition: transform 0.45s var(--ease-out), border-color 0.45s, background 0.45s;
}
.domain:hover {
  transform: translateY(-6px);
  border-color: rgba(201, 168, 92, 0.4);
  background: var(--surface-2);
}
.domain .num {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  display: block;
  margin-bottom: 0.8rem;
}
.domain p { font-size: 0.93rem; margin: 0; }

/* ---------- Storytelling (scroll-linked) ---------- */
.story { background: var(--bg-soft); border-block: 1px solid var(--line); }
.story-text {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.2vw, 2.5rem);
  line-height: 1.5;
  max-width: 26em;
  margin-inline: auto;
  color: var(--ivory);
}
.story-text .word { opacity: 0.18; display: inline-block; }

/* ---------- Section double compétence ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.skill-list { list-style: none; margin: 2rem 0 0; padding: 0; }
.skill-list li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ivory-dim);
}
.skill-list li strong { color: var(--ivory); font-weight: 400; min-width: 11em; }
.skill-list li::before { content: "—"; color: var(--gold); }

/* ---------- Chiffres clés ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  text-align: center;
  margin-top: 3rem;
}
.stat .value {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 4.6rem);
  color: var(--gold);
  line-height: 1;
}
.stat .value sup { font-size: 0.45em; }
.stat .label {
  margin-top: 0.8rem;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ivory-dim);
}

/* ---------- CTA final ---------- */
.cta-final { text-align: center; }
.cta-final h2 { max-width: 18em; margin-inline: auto; }
.cta-final .btn { margin-top: 2rem; }

/* ---------- Hero de page interne ---------- */
.page-hero {
  padding: calc(var(--nav-h) + clamp(60px, 12vh, 120px)) 0 clamp(50px, 8vh, 90px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 70% 60% at 80% -10%, rgba(201, 168, 92, 0.07), transparent),
    var(--bg);
}
.page-hero p { max-width: 44em; font-size: 1.08rem; }

/* ---------- Galerie catégorie ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.6rem;
  margin-top: 3rem;
}
.gallery figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: zoom-in;
}
.gallery img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out), filter 0.7s;
  filter: saturate(0.88);
}
.gallery figure:hover img { transform: scale(1.05); filter: saturate(1.05); }
.gallery figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 2.2rem 1.2rem 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--ivory);
  background: linear-gradient(180deg, transparent, rgba(14, 13, 11, 0.85));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
}
.gallery figure:hover figcaption { opacity: 1; transform: translateY(0); }

/* Note "remplacer les visuels" */
.swap-note {
  margin-top: 2.5rem;
  padding: 1.2rem 1.5rem;
  border: 1px dashed rgba(201, 168, 92, 0.35);
  font-size: 0.9rem;
  color: var(--ivory-dim);
}
.swap-note code {
  color: var(--gold);
  font-size: 0.85em;
  background: var(--surface);
  padding: 2px 7px;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 9, 7, 0.94);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease-out), visibility 0.35s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: 88vw;
  max-height: 84vh;
  object-fit: contain;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.8);
}
.lightbox .lb-caption {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--ivory-dim);
}
.lightbox button {
  position: absolute;
  background: none;
  border: 1px solid rgba(240, 234, 221, 0.25);
  color: var(--ivory);
  width: 52px;
  height: 52px;
  cursor: pointer;
  font-size: 1.15rem;
  transition: border-color 0.3s, background 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox button:hover { border-color: var(--gold); background: rgba(201, 168, 92, 0.12); }
.lb-close { top: 24px; right: 24px; }
.lb-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 24px; top: 50%; transform: translateY(-50%); }
@media (max-width: 700px) {
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
}

/* ---------- Navigation entre catégories ---------- */
.cat-nav { border-top: 1px solid var(--line); }
.cat-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}
.cat-nav-list a {
  display: inline-block;
  padding: 9px 20px;
  border: 1px solid var(--line);
  color: var(--ivory-dim);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.3s, border-color 0.3s, transform 0.3s var(--ease-out);
}
.cat-nav-list a:hover {
  color: var(--gold);
  border-color: rgba(201, 168, 92, 0.5);
  transform: translateY(-3px);
}
.cat-nav-list a.is-current { color: var(--bg); background: var(--gold); border-color: var(--gold); }

/* ---------- Page présentation ---------- */
.portrait-hero .container {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
@media (max-width: 860px) { .portrait-hero .container { grid-template-columns: 1fr; } }
.portrait-frame {
  position: relative;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  padding: 14px;
  max-width: 400px;
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; }
.manifesto {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--ivory);
  border-left: 2px solid var(--gold);
  padding-left: 1.4rem;
  margin: 2rem 0 0;
}

.prose { max-width: 46em; }
.prose .lead { font-size: 1.18rem; color: var(--ivory); }

/* ---------- Page contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2.5rem, 6vw, 5rem);
}
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li {
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.contact-list .label {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ivory-dim);
}
.contact-list a { font-size: 1.1rem; color: var(--ivory); transition: color 0.3s; }
.contact-list a:hover { color: var(--gold); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 3rem 0;
  background: var(--bg-soft);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--ivory-dim);
}
.footer-links { display: flex; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--ivory-dim); transition: color 0.3s; }
.footer-links a:hover { color: var(--gold); }

/* ---------- Utilitaires animation ----------
   Les états initiaux sont posés par JS (gsap.set) :
   sans JS ou avec reduced-motion, tout reste visible. */
.parallax-wrap { overflow: hidden; }
.parallax-wrap img { will-change: transform; }

/* ---------- Fil de lumière (scroll-linked) ----------
   Un faisceau vertical doré se dessine au rythme du scroll
   et « allume » les éléments importants à son passage. */
.light-thread {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: screen;
}
.light-thread .beam {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg,
    transparent,
    rgba(201, 168, 92, 0.55) 6%,
    rgba(201, 168, 92, 0.35) 50%,
    rgba(201, 168, 92, 0.55) 94%,
    transparent);
  transform-origin: top center;
  transform: scaleY(0);
  box-shadow: 0 0 18px 2px rgba(201, 168, 92, 0.25);
  will-change: transform;
}
/* Halo diffus autour du fil */
.light-thread::before {
  content: "";
  position: absolute;
  inset: 0 -40px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 92, 0.05), transparent);
}
/* Lueur fixe qui voyage avec le lecteur */
.light-orb {
  position: fixed;
  left: 50%;
  top: 38vh;
  width: 320px;
  height: 320px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(201, 168, 92, 0.32),
    rgba(201, 168, 92, 0.10) 45%,
    transparent 70%);
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: screen;
  filter: blur(6px);
  opacity: 0;
  will-change: opacity, transform;
}
@media (max-width: 700px) {
  .light-thread, .light-orb { display: none; }
}

/* Éléments « allumés » au passage de la lumière */
.kicker, h2 { transition: text-shadow 0.8s var(--ease-out), color 0.8s; }
.is-lit.kicker, .kicker.is-lit {
  color: #e8c878;
  text-shadow: 0 0 24px rgba(201, 168, 92, 0.65);
}
h2.is-lit {
  text-shadow: 0 0 38px rgba(201, 168, 92, 0.35), 0 0 90px rgba(201, 168, 92, 0.18);
}
.stat .value { transition: text-shadow 0.8s var(--ease-out); }
.stat .value.is-lit { text-shadow: 0 0 40px rgba(201, 168, 92, 0.55); }

/* ---------- Curseur personnalisé ---------- */
.has-cursor, .has-cursor a, .has-cursor button, .has-cursor .gallery figure { cursor: none; }
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 300;
  transform: translate(-50%, -50%);
}
.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--gold);
}
.cursor-ring {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(201, 168, 92, 0.55);
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out),
              background 0.3s, border-color 0.3s;
}
.cursor-ring.is-hover {
  width: 64px;
  height: 64px;
  background: rgba(201, 168, 92, 0.10);
  border-color: rgba(201, 168, 92, 0.9);
}

/* Tilt 3D */
.cards-grid { perspective: 900px; }
.card, .domain { transform-style: preserve-3d; }

::selection { background: var(--gold); color: var(--bg); }

/* Scrollbar discrète */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2c2820; border-radius: 5px; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
