/* =========================
   FONT
========================= */

@font-face {
  font-family: "Aesthetic";
  src: url("font/Aesthetic-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

/* =========================
   GLOBAL
========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

body {
  background: black;
  color: white;
  font-family: Helvetica, Arial, sans-serif;
  overflow: hidden;
  height: 100vh;
}

/* =========================
   NAVIGATION
========================= */

.top-nav {
  position: fixed;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 24px;
  z-index: 10;
}

.top-nav a {
  color: white;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 2px;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.top-nav a:hover {
  opacity: 1;
}

/* =========================
   HOME SCREEN
========================= */

.home-screen {
  position: fixed;
  inset: 0;
  background: black;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

/* TITRE POÉTIQUE */

.main-title {
  font-family: "Aesthetic", serif;
  font-size: clamp(48px, 6vw, 120px);
  letter-spacing: 6px;
  margin-bottom: 48px;
  text-align: center;
  opacity: 0.9;
}

/* =========================
   BOUTON
========================= */

.start-btn {
  padding: 16px 44px;
  background: white;
  border: 1px solid rgba(255,255,255,0.6);
  color: black;
  font-size: 12px;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.4s ease;
}

.start-btn:hover {
  background: transparent;
  color: white;
}

/* =========================
   FADE
========================= */

.fade-overlay {
  position: fixed;
  inset: 0;
  background: black;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.5s ease;
  z-index: 20;
}

.fade-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* =========================
   EDGE LOADER
========================= */

.edge-loader {
  position: fixed;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 30;

  background:
    conic-gradient(
      white 0deg,
      rgba(255,255,255,0.15) 0deg
    );

  mask: radial-gradient(
    circle,
    transparent 55%,
    black 56%
  );
}


.edge-loader.loading {
  opacity: 1;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================
   THANK YOU
========================= */

.thanks-screen {
  position: fixed;
  inset: 0;
  padding: 100px;
  background: black;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  text-align: center;
}

.thanks-screen h1 {
  font-family: "Aesthetic", serif;
  font-size: 28px;
  margin-bottom: 32px;
}

.thanks-screen p {
  font-size: 20px;
  letter-spacing: 2px;
  opacity: 0.8;
}

.thanks-screen.active {
  opacity: 1;
  pointer-events: all;
  transition: opacity 2s ease;
}

/* =========================
   CANVAS
========================= */

canvas {
  position: absolute;
  inset: 0;
  display: block;
}



/* =========================
   STORY SCREEN
========================= */

.story-screen {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
  overflow-y: auto;
}

.story-screen.active {
  opacity: 1;
  pointer-events: all;
}

.story-content {
  max-width: 800px;
  margin: 120px auto;
  padding: 0 24px 120px;
}

.story-content h1 {
  font-family: "Aesthetic", serif;
  font-size: 64px;
  margin-bottom: 48px;
}

.story-content h2 {
  margin-top: 64px;
  margin-bottom: 24px;
  letter-spacing: 3px;
}

.story-content h3 {
  margin-top: 40px;
  margin-bottom: 12px;
  letter-spacing: 2px;
}

.story-content p {
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 24px;
  opacity: 0.9;
}

.story-content a {
  color: white;
  text-decoration: underline;
}

.story-credits {
  margin-top: 64px;
  opacity: 0.7;
  text-align: center;
}

.close-btn {
  display: block;
  margin: 80px auto 0;
  padding: 14px 40px;
  background: white;
  border: 1px solid white;
  color: black;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.4s ease;
}

.close-btn:hover {
  background: transparent;
  color: white;
}

.phase-1 canvas {
  width: 100vw;
  height: 100vh;
  display: block;
}


/* =========================
   PHASES
========================= */

.phase {
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
  background: black;
}

.phase.active {
  opacity: 1;
  pointer-events: all;
}

.phase-1 { z-index: 1; }
.phase-2 { z-index: 2; }
.phase-3 { z-index: 3; }
.fade-overlay { z-index: 100; }

/* Phase videos - full screen, properly scaled */
.phase-2 video,
.phase-3 video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: black;
}

/* Play overlay for videos */
.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  cursor: pointer;
}

.play-overlay.hidden {
  display: none;
}

.play-btn {
  padding: 20px 48px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.6);
  color: white;
  font-size: 14px;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.4s ease;
}

.play-btn:hover {
  background: white;
  color: black;
}




#phase3 {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

#phase3 video {
  z-index: 1;
}

#eggLayer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none; /* IMPORTANT */
}

.play-overlay {
  z-index: 3;
}

.egg {
  position: absolute;
  width: 15px;
}

.phase-message {
  position: fixed;
  bottom: 15px;
  width: 100%;
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  pointer-events: none; /* pour ne pas gêner les clics */
  user-select: none;
  z-index: 1000;
  text-shadow: 0 0 5px rgba(0,0,0,0.7);
}





.play-animation-btn {
  position: fixed;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  padding: 16px 40px;
  background: transparent;
  background: white;
  color: black;
  border: 1px solid rgba(255,255,255,0.6);
  font-size: 12px;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.4s ease;
  z-index: 2000;
}

.play-animation-btn:hover {
  background: transparent;
  color: white;
}

.play-animation-btn.hidden {
  display: none;
}
