/* ===========================
   RESET & VARIABLES
=========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --black: #0a0a0a;
  --white: #f5f2ed;
  --gray: #9a9a9a;
  --light: #e8e4de;
  --mid: #444444;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Libre Baskerville', serif;
  --font-mono: 'Space Mono', monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--white);
  color: var(--black);
  font-family: var(--font-body);
  cursor: none;
  overflow-x: hidden;
}

/* ===========================
   NOISE OVERLAY
=========================== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9000;
  opacity: 0.45;
}

/* ===========================
   CUSTOM CURSOR — mix-blend-mode: difference
   Le curseur est blanc sur fond blanc → noir visible.
   Le curseur est blanc sur fond noir → blanc visible.
   L'inversion se fait pixel par pixel, en temps réel, automatiquement.
=========================== */
.cursor {
  position: fixed;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  transition: width 0.2s ease, height 0.2s ease;
}

.cursor.hover {
  width: 52px;
  height: 52px;
}

.cursor-ring {
  position: fixed;
  width: 42px;
  height: 42px;
  border: 1.5px solid #ffffff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  transition: width 0.35s ease, height 0.35s ease, opacity 0.25s;
}

.cursor-ring.hover {
  width: 14px;
  height: 14px;
  opacity: 0;
}

/* ===========================
   NAV
=========================== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 48px;
  transition: background 0.3s, backdrop-filter 0.3s, border-bottom 0.3s;
}

nav.scrolled {
  background: rgba(245, 242, 237, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1.5px solid var(--light);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.1em;
  color: var(--black);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo-box {
  width: 32px;
  height: 32px;
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-family: var(--font-mono);
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--black);
  text-decoration: none;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 100%;
  height: 1px;
  background: var(--black);
  transition: right 0.3s ease;
}

.nav-links a:hover::after {
  right: 0;
}

.nav-cta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--black);
  color: var(--white);
  padding: 10px 20px;
  text-decoration: none;
  border: 2px solid var(--black);
  transition: background 0.2s, color 0.2s;
}

.nav-cta:hover {
  background: transparent;
  color: var(--black);
}

/* ===========================
   HERO
=========================== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 48px;
  position: relative;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1.5px solid var(--black);
  padding: 6px 14px;
  margin-bottom: 40px;
  width: fit-content;
  transform: rotate(-1deg);
  background: rgba(245, 242, 237, 0.85);
  animation: fadeSlideDown 0.8s ease 0.2s both;
}

.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--black);
  border-radius: 50%;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(72px, 10vw, 160px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  max-width: 900px;
  animation: fadeSlideUp 0.9s ease 0.3s both;
}

.hero-title .inverted {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  padding: 0 12px;
  transform: skew(-2deg);
}

.hero-sub {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 18px;
  color: var(--mid);
  max-width: 500px;
  margin-top: 32px;
  line-height: 1.6;
  animation: fadeSlideUp 0.9s ease 0.5s both;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 48px;
  animation: fadeSlideUp 0.9s ease 0.7s both;
}

.hero-scroll {
  position: absolute;
  bottom: 40px;
  right: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray);
  z-index: 1;
  animation: fadeIn 1s ease 1.2s both;
}

.hero-scroll-line {
  width: 1px;
  height: 60px;
  background: var(--gray);
  animation: scrollPulse 2s ease-in-out infinite;
}

/* ===========================
   BUTTONS
=========================== */
.btn-primary {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: var(--black);
  color: var(--white);
  padding: 14px 28px;
  text-decoration: none;
  border: 2px solid var(--black);
  transition: background 0.25s, color 0.25s;
}

.btn-primary:hover {
  background: transparent;
  color: var(--black);
}

.btn-secondary {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: transparent;
  color: var(--black);
  padding: 14px 28px;
  text-decoration: none;
  border: 2px solid var(--black);
  transition: background 0.25s, color 0.25s;
}

.btn-secondary:hover {
  background: var(--black);
  color: var(--white);
}

/* ===========================
   MARQUEE
=========================== */
.marquee-section {
  border-top: 1.5px solid var(--black);
  border-bottom: 1.5px solid var(--black);
  overflow: hidden;
  padding: 16px 0;
  background: var(--black);
}

.marquee-track {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  animation: marquee 22s linear infinite;
}

.marquee-item {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.1em;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 48px;
  flex-shrink: 0;
}

.marquee-item span {
  color: #555;
  font-size: 18px;
}

/* ===========================
   ABOUT
=========================== */
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  padding: 120px 48px;
  align-items: center;
}

.about-visual {
  position: relative;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#about-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.about-content {}

.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-label::before {
  content: '';
  width: 30px;
  height: 1px;
  background: var(--gray);
}

.about-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1;
  margin-bottom: 24px;
}

.about-text {
  font-size: 15px;
  line-height: 1.8;
  color: #444;
  margin-bottom: 32px;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1.5px solid var(--black);
  padding: 5px 12px;
  transition: background 0.2s, color 0.2s;
}

.skill-tag:hover {
  background: var(--black);
  color: var(--white);
}

/* ===========================
   PROJECTS
=========================== */
.projects {
  padding: 80px 48px;
  background: var(--black);
}

.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 60px;
}

.projects-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 6vw, 96px);
  line-height: 1;
  color: var(--white);
}

.projects-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #8a8a8a;
  letter-spacing: 0.15em;
}

/* Côté droit de l'en-tête projets : compteur + interrupteur compétences */
.projects-header-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

/* Interrupteur discret on/off */
.competences-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #777;
  transition: color 0.2s ease;
}

.competences-toggle:hover {
  color: #ccc;
}

.competences-toggle-switch {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  transition: background 0.25s ease, border-color 0.25s ease;
  flex-shrink: 0;
}

.competences-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #888;
  transition: transform 0.25s ease, background 0.25s ease;
}

.competences-toggle.is-on {
  color: var(--white);
}

.competences-toggle.is-on .competences-toggle-switch {
  background: var(--white);
  border-color: var(--white);
}

.competences-toggle.is-on .competences-toggle-knob {
  transform: translateX(16px);
  background: var(--black);
}

/* Badges de compétences sur les cartes — masqués par défaut */
.project-competences {
  display: none;
  margin-bottom: 28px;
  padding: 14px 16px;
  border: 1px dashed #3d3d3d;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.02);
}

#projets.show-competences .project-competences {
  display: block;
  animation: competencesIn 0.3s ease;
}

@keyframes competencesIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.project-competences-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 10px;
}

.project-competences-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-competence {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--black);
  background: var(--white);
  padding: 4px 10px;
  border-radius: 2px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5px;
}

.project-card {
  background: #111;
  padding: 40px 32px;
  position: relative;
  overflow: hidden;
  transition: background 0.3s, transform 0.3s;
  border: 1.5px solid #1c1c1c;
  cursor: pointer;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(255,255,255,0.02) 100%);
  pointer-events: none;
}

.project-card:hover {
  background: #1a1a1a;
  transform: translateY(-4px);
}

/* Toutes les cartes occupent une moitié (grille 50/50). */
.project-card.featured {
  grid-column: span 1;
}

/* Si le nombre de projets est impair, la dernière carte occupe toute la ligne. */
.project-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.project-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #777;
  margin-bottom: 40px;
}

.project-category {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8a8a8a;
  margin-bottom: 12px;
}

.project-name {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: 0.05em;
  color: var(--white);
  margin-bottom: 12px;
  line-height: 1.1;
}

.project-desc {
  font-size: 13px;
  color: #9a9a9a;
  line-height: 1.6;
  margin-bottom: 32px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 32px;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid #555;
  color: #b8b8b8;
  padding: 4px 10px;
}

.project-link {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: gap 0.25s;
}

.project-link:hover {
  gap: 16px;
}

.project-link::after {
  content: '→';
}

/* ===========================
   STATS
=========================== */
.stats {
  padding: 100px 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1.5px solid var(--black);
}

.stat-item {
  padding: 40px 0;
  border-right: 1.5px solid var(--light);
  text-align: center;
}

.stat-item:last-child {
  border-right: none;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 72px;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray);
}

/* ===========================
   SERVICES
=========================== */
.services {
  padding: 100px 48px;
}

.services-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  margin-bottom: 80px;
  align-items: end;
}

.services-title {
  font-family: var(--font-display);
  font-size: clamp(56px, 7vw, 100px);
  line-height: 0.95;
}

.services-text {
  font-size: 15px;
  color: #666;
  line-height: 1.8;
  padding-bottom: 8px;
}

.service-list {
  border-top: 1.5px solid var(--light);
}

.service-item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 32px 0;
  border-bottom: 1.5px solid var(--light);
  transition: padding-left 0.3s;
  cursor: default;
}

.service-item:hover {
  padding-left: 16px;
}

.service-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gray);
  letter-spacing: 0.1em;
}

.service-name {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.05em;
}

.service-arrow {
  font-size: 20px;
  transition: transform 0.3s;
}

.service-item:hover .service-arrow {
  transform: translateX(10px);
}

/* ===========================
   CONTACT
=========================== */
.contact {
  background: var(--black);
  color: var(--white);
  padding: 120px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

#contact-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}

.contact-inner {
  position: relative;
  z-index: 1;
}

.contact-label {
  color: #555;
  justify-content: center;
}

.contact-label::before {
  background: #555;
}

.contact-title {
  font-family: var(--font-display);
  font-size: clamp(60px, 9vw, 140px);
  line-height: 0.95;
  margin: 32px 0;
}

.underline-white {
  display: inline-block;
  border-bottom: 4px solid var(--white);
  padding-bottom: 4px;
}

.contact-sub {
  font-style: italic;
  color: #777;
  font-size: 16px;
  margin-bottom: 48px;
}

.contact-email {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--white);
  text-decoration: none;
  border-bottom: 1px solid #444;
  padding-bottom: 4px;
  transition: border-color 0.2s;
}

.contact-email:hover {
  border-color: var(--white);
}

.contact-socials {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 64px;
}

.contact-social {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #666;
  text-decoration: none;
  transition: color 0.2s;
}

.contact-social:hover {
  color: var(--white);
}
.contact-tel-mail {
    display: flex;
  justify-content: center;
  gap: 16px;;
}

/* ===========================
   PROJECT MODAL
=========================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: rgba(5, 5, 5, 0.86);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: #111;
  border: 1.5px solid #2a2a2a;
  width: min(880px, 100%);
  max-height: min(88vh, 920px);
  position: relative;
  transform: translateY(24px) scale(0.98);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
}

.modal-overlay.open .modal-box {
  transform: translateY(0) scale(1);
}

.modal-scroll {
  width: 100%;
  max-height: min(88vh, 920px);
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 5;
  width: 40px;
  height: 40px;
  border: 1px solid #333;
  background: rgba(10, 10, 10, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close span {
  position: absolute;
  width: 16px;
  height: 1.5px;
  background: var(--white);
}

.modal-close span:first-child { transform: rotate(45deg); }
.modal-close span:last-child  { transform: rotate(-45deg); }

.modal-close:hover {
  background: var(--white);
}
.modal-close:hover span {
  background: var(--black);
}

.modal-gallery {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0a0a;
  overflow: hidden;
}

.modal-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Galerie multi-captures : grille de vignettes cliquables */
.modal-gallery.has-images {
  aspect-ratio: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  padding: 14px;
  background: #0a0a0a;
}

.modal-gallery.has-images img {
  width: 100%;
  height: 84px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid #1c1c1c;
  cursor: zoom-in;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.modal-gallery.has-images img:hover {
  transform: scale(1.04);
  border-color: #666;
}

/* ===========================
   LIGHTBOX — agrandissement d'une capture
=========================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: rgba(3, 3, 3, 0.94);
  backdrop-filter: blur(4px);
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #777;
  border-radius: 50%;
  color: var(--white);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.lightbox-close:hover {
  background: var(--white);
  color: var(--black);
}

.modal-gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #3a3a3a;
}

.modal-body {
  padding: 40px 44px 48px;
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #888;
}

.modal-category {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #b8b8b8;
  border: 1px solid #555;
  padding: 4px 10px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 42px;
  letter-spacing: 0.03em;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 18px;
}

.modal-desc {
  font-size: 15px;
  color: #b0b0b0;
  line-height: 1.7;
  margin-bottom: 32px;
}

.modal-section {
  margin-bottom: 28px;
}

.modal-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a8a8a;
  margin-bottom: 14px;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-longtext {
  font-size: 14px;
  color: #a8a8a8;
  line-height: 1.75;
}

.modal-longtext p {
  margin-bottom: 14px;
}

.modal-longtext p:last-child {
  margin-bottom: 0;
}

.modal-iut {
  margin-bottom: 28px;
  border-left: 2px solid var(--white);
  padding-left: 18px;
}

.modal-iut-text {
  font-size: 13px;
  color: #aaa;
  line-height: 1.7;
}

.modal-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.modal-actions [hidden] {
  display: none;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.modal-actions .btn-primary:hover,
.modal-actions .btn-secondary:hover {
  background: transparent;
  color: var(--white);
}

.modal-actions .btn-primary[aria-disabled="true"] {
  opacity: 0.35;
  pointer-events: none;
}

@media (max-width: 720px) {
  .modal-overlay { padding: 0; }
  .modal-box { width: 100%; max-height: 100vh; height: 100%; }
  .modal-scroll { max-height: 100vh; }
  .modal-title { font-size: 30px; }
  .modal-body { padding: 32px 24px 40px; }
}

/* ===========================
   FOOTER
=========================== */
footer {
  background: var(--black);
  border-top: 1px solid #1c1c1c;
  padding: 24px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #444;
}

/* ===========================
   SCROLL REVEAL
=========================== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.contact-mail-tel {
    justify-content: center;
    display: flex;
    gap: 16px;
}

/* ===========================
   KEYFRAME ANIMATIONS
=========================== */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-20px) rotate(-1deg); }
  to   { opacity: 1; transform: translateY(0) rotate(-1deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes scrollPulse {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  50%       { transform: scaleY(0.3); opacity: 0.3; }
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  nav { padding: 20px 24px; }
  .nav-links { display: none; }

  .hero { padding: 0 24px; }

  .about {
    grid-template-columns: 1fr;
    padding: 80px 24px;
  }
  .about-visual { height: 280px; }

  .projects { padding: 60px 24px; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-card.featured { grid-column: span 1; }

  .stats {
    grid-template-columns: 1fr 1fr;
    padding: 60px 24px;
  }
  .stat-item:nth-child(2) { border-right: none; }

  .services { padding: 60px 24px; }
  .services-header {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .contact { padding: 80px 24px; }

  footer {
    padding: 20px 24px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* ===========================
   ABOUT — SEAU DE LOGOS TECH (physique Matter.js)
=========================== */
.about-visual { overflow: hidden; }   /* déjà position:relative + height:420px */

.bucket-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
}

/* Un logo = un bouton positionné/orienté par Matter via transform inline */
.tech-chip {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  cursor: none;            /* le curseur custom prend le relais */
  will-change: transform;
}
.tech-chip img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;    /* le clic est capté par le bouton parent */
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 6px 14px rgba(10, 10, 10, 0.14));
  transition: transform 0.18s ease;
}
.tech-chip:hover img { transform: scale(1.12); }

/* Le seau dessiné : corps trapézoïdal plein, ouverture en ellipse + anse */
.bucket-gfx {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  /* corps plein, plus large en haut qu'en bas */
  background:
    repeating-linear-gradient(90deg,
      rgba(255, 255, 255, 0.04) 0 10px,
      rgba(0, 0, 0, 0.05) 10px 20px),
    linear-gradient(180deg, #242424 0%, #0a0a0a 100%);
  clip-path: polygon(2% 0, 98% 0, 86% 100%, 14% 100%);
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.45);
}
/* cerclages du seau */
.bucket-gfx::after {
  content: '';
  position: absolute;
  inset: 22% 6% auto 6%;
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 32px 0 rgba(255, 255, 255, 0.10);
}
/* ombre portée au sol */
.bucket-shadow {
  position: absolute;
  z-index: 0;
  background: radial-gradient(ellipse at center,
    rgba(10, 10, 10, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

.bucket-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gray);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.about-visual.poured .bucket-hint { opacity: 1; }

/* Modal inline d'une techno (remplace l'avatar dans la zone) */
.tech-modal {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  padding: 36px;
  background: var(--white);
  border: 1.5px solid var(--black);
}
.tech-modal.open { display: flex; }

.tech-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--black);
  background: transparent;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tech-modal-close::before,
.tech-modal-close::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 1.5px;
  background: var(--black);
}
.tech-modal-close::before { transform: rotate(45deg); }
.tech-modal-close::after  { transform: rotate(-45deg); }
.tech-modal-close:hover { background: var(--black); }
.tech-modal-close:hover::before,
.tech-modal-close:hover::after { background: var(--white); }

.tech-modal-logo {
  width: 56px;
  height: 56px;
  margin-bottom: 4px;
}
.tech-modal-logo img { width: 100%; height: 100%; object-fit: contain; }

.tech-modal-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gray);
}
.tech-modal-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1;
}
.tech-modal-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--mid);
  max-width: 36ch;
}