/* =======================
   RESET & BASE
======================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: black;
  overflow-x: hidden;
  background-color: #d0d0d0;
}

/* =======================
   SECTION À PROPOS
======================= */
.section-3d-apropos.full-height-left {
  flex-direction: column;
  display: flex;
  align-items: center;
  justify-content: flex-start;

  padding-bottom: 100px;
}

.apropos-viewer {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}
/* Ajoute un padding spécifique UNIQUEMENT au <p> du #section-apropos */
#section-apropos p {
  padding: 0 4rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.about{
  padding: 0 10rem;
  padding-top: 2rem;
  padding-bottom: 10rem;
}
.about h2, .works h2, .contact h2 { font-size:2.8rem; margin-bottom:20px; }
.about p, .contact p { font-size:1.1rem; line-height:1.6; color:#000000; }
/* =======================
   INTRO 3D
======================= */
#intro-3d {
  width: 100%;
  height: 100vh;
  background-color: #0000c2;
  overflow: hidden;
  position: relative;
}

#three-container {
  width: 100%;
  height: 100%;
}
#three-container-2 {
  width: 100%;
  height: 100%;
}

/* =======================
   GLASS EFFECT
======================= */
.glass {
  background: rgba(237, 237, 237, 0.08);
  border-radius: 20px;
  transition: all 0.3s ease;
}

.glass:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
}

/* =======================
   FADE ANIMATIONS
======================= */
.hidden {
  display: none;
  opacity: 0;
}

.fade-in {
  animation: fadeIn 1s forwards;
}

.fade-out {
  animation: fadeOut 1s forwards;
}

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

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

/* =======================
   FILTRES DE TRI
======================= */
.filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 2rem auto;
  padding: 1rem 2rem;
  border-radius: 20px;
  max-width: 1000px;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.filters button {
  padding: 0.5rem 1.5rem;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #e5e5e7;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.filters button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.filters button.active,
.filters button.selected {
  background: rgba(255, 255, 255, 0.3);
  font-weight: bold;
}

/* =======================
   BENTO CARDS
======================= */
.bento {
  position: relative;
  width: 100%;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s;
  display: inline-block;
  break-inside: avoid;
}

.bento:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.bento video,
.bento img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* =======================
   OVERLAY TEXTE
======================= */
.bento .overlay {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  background: linear-gradient(to top, black, transparent);
  color: #fff;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  text-align: left;
}

.bento:hover .overlay {
  opacity: 1;
}

.overlay p {
  font-size: 1.5rem;
  line-height: 1.4;
  font-weight: bolder;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.click-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background: rgba(255, 0, 0, 0); /* totalement transparent */
  cursor: pointer;
}

.click-zone.left {
  left: 0;
}

.click-zone.right {
  right: 0;
}

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

/* =======================
   RATIOS FIXES
======================= */
.ratio-1x1::before,
.ratio-16x9::before,
.ratio-9x16::before {
  content: '';
  display: block;
}

.ratio-1x1::before {
  padding-bottom: 100%;
}

.ratio-16x9::before {
  padding-bottom: 56.25%;
}

.ratio-9x16::before {
  padding-bottom: 177.78%;
}

.bento > *:not(.overlay) {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* =======================
   MASONRY LAYOUT
======================= */
.masonry {
  column-count: 4;
  column-gap: 1.5rem;
  padding: 2rem;
}

.masonry .bento {
  margin-bottom: 1.5rem;
}

/* =======================
   RESPONSIVE
======================= */
@media screen and (max-width: 1024px) {
  .about{
    padding: 0 rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
  .section-3d-apropos {
    flex-direction: column;
  }
  .masonry {
    column-count: 2;
  }
  h2 {
    font-size: 4rem;
  }
  #three-container-2 {
    display: none;
  }
}
#apropos-viewer{
max-width: 100%;
 max-height: 100%;

}
@media screen and (max-width: 600px) {
  .apropos-viewer {
    flex-direction: column;
  }
  #apropos-viewer{
    max-width: 250%;
     max-height: 80%;
     padding-left: 350px;
    }
  #apropos-viewer img {
    width: 200%;
  }

  .masonry {
    column-count: 1;
  }
  .ratio-9x16::before {
    padding-bottom: 130%;
  }
  .bento .overlay {
    opacity: 1;
  }
  .intro-3d,
  #intro-3d {
    display: none;
  }
}

/* =======================
   FULLSCREEN VIEW
======================= */
#fullscreen-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: black;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.fullscreen-video {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-video video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#fullscreen-view.hidden {
  display: none;
}

#close-fs {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 10000;
}

/* =======================
   FOOTER
======================= */
.contact {
  margin: 0 auto;
  padding-left: 25px;
  text-align: center;
}

footer {
  color: black;
  text-align: center;
  font-size: 0.9rem;
  padding: 50px;
}

.contact-viewer {
  cursor: pointer;
}

/* =======================
   LOADING SCREEN
======================= */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #dedede;
  color: #000000;
  font-size: 1.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 99999;
  opacity: 1;
  transition: opacity 0.1s ease;
  font-weight: 500;
}

#loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #000000;
  border-top: 4px solid transparent;
  border-radius: 50%;
  margin-bottom: 1em;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
img {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
