/* ====================== BODY ====================== */
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: #000000; 
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Courier New", monospace;
  color: #000000;
  perspective: 1000px;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ====================== LOADER CUBES 3D ====================== */
#vignette {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 4;
  background-image: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0) 100%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

#container {
  width: 100%;
  perspective: 2200px;
  padding: 20px 60px;
  position: relative;
  display: table-cell;
  vertical-align: middle;
}

#pos {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.cube {
  width: 30px;
  height: 150px;
  position: relative;
  transform-style: preserve-3d;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  animation: animCube 2s ease-in-out infinite;
}

.cube:nth-child(1) { animation-delay: 0s; }
.cube:nth-child(2) { animation-delay: 1.1s; }
.cube:nth-child(3) { animation-delay: 2.2s; }
.cube:nth-child(4) { animation-delay: 3.3s; }
.cube:nth-child(5) { animation-delay: 4.4s; }
.cube:nth-child(6) { animation-delay: 5.5s; }
.cube:nth-child(7) { animation-delay: 6.6s; }
.cube:nth-child(8) { animation-delay: 7.7s; }

.cube .center,
.cube .left,
.cube .right,
.cube .bottom {
  position: absolute;
  width: 30px;
  height: 150px;
  animation-iteration-count: infinite;
  animation-duration: 1s;
  animation-timing-function: ease-in-out;
  animation-delay: inherit;
}

.cube .center { background-color:  #8f6200; animation-name: animCenter; }
.cube .bottom {
  width: 30px;
  height: 10px;
  bottom: 0;
  transform: rotateX(90deg);
  transform-origin: center bottom;
  animation-name: animBottom;
}
.cube .left {
  left: 0;
  transform: rotateY(90deg);
  transform-origin: left center;
  animation-name: animSide;
}
.cube .right {
  right: 0;
  transform: rotateY(-90deg);
  transform-origin: right center;
  animation-name: animSide;
}

@keyframes animCube {
  30% {
    transform: translateZ(100px) rotateX(3deg);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), 0 12px 20px 1px rgba(0,0,0,0.5);
  }
  100% { 
    transform: translateZ(0) rotate(0deg); 
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5); 
  }
}

@keyframes animSide {
  30% { width: 100px; background-color: #000000; }
  95% { width: 10px; }
}

@keyframes animBottom {
  30% { height: 100px; }
  95% { height: 10px; }
}

@keyframes animCenter {
  20% {
    background-color: #ffae00;
    box-shadow: 0 0 3px rgba(255,255,255,0.15), inset 0 1px rgba(255,255,255,0.5);
  }
  65% {
    box-shadow: 0 0 3px rgba(255,255,255,0), inset 0 1px rgba(255,255,255,0.25);
  }
}

.loader-container h1 {
  font-family: 'Helvetica', sans-serif;
  text-align: center;
  text-transform: uppercase;
  color: #888;
  font-size: 19px;
  padding-top: 10px;
  text-shadow: 1px 1px 0px #111;
}

.loader-container {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  text-align: center;
  width: auto;
}

#container {
  width: 200px;
  perspective: 2200px;
  margin: 0 auto;
}

#pos {
  display: flex;
  justify-content: center;
  gap: 8px;
}

/* ====================== CONTENEUR TERMINAL ====================== */
.terminal-stack {
  position: relative;
  width: 80%;
  max-width: 900px;
  min-height: 600px;
}

/* ====================== PAGES ====================== */
.terminal-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background-color: rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  overflow: hidden;
  transform-origin: center;
  transition: transform 0.5s;
  border-radius: 8px;
  backdrop-filter: blur(5px);
}

.terminal-page:nth-child(1) {
  transform: translate(-20px, -20px) rotateX(2deg) rotateY(-2deg);
  z-index: 1;
  opacity: 0.6;
}

.terminal-page:nth-child(2) {
  transform: translate(-10px, -10px) rotateX(1deg) rotateY(-1deg);
  z-index: 2;
  opacity: 0.8;
}

.terminal-page:nth-child(3) {
  z-index: 3;
  opacity: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 10px;
  overflow-y: auto;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

.terminal-page::-webkit-scrollbar { width: 6px; }
.terminal-page::-webkit-scrollbar-thumb {
  background-color: rgba(255,255,255,0.3);
  border-radius: 3px;
}

/* ====================== BARRE TERMINAL ====================== */
.terminal-bar {
  width: 100%;
  height: 50px;
  border-bottom: 2px solid rgba(255,255,255,0.8);
  background-color: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 10px;
  box-sizing: border-box;
  z-index: 10;
}

.terminal-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-left: 6px;
}
.red { background-color: #ff605c; }
.yellow { background-color: #ffbd44; }
.purple { background-color: #2bff00; }

/* ====================== TEXTE ====================== */
.terminal-page p {
  font-family: "Courier New", monospace;
  font-size: 1.4rem;
  margin: 0;
  color: #ffffff;
  line-height: 1.5;
  white-space: pre;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ====================== CURSEUR ====================== */
#cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.2em;
  background-color: #ffd000;
  vertical-align: bottom;
  animation: blink 0.7s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ====================== FOOTER ====================== */
footer {
  width: 100%;
  text-align: center;
  position: fixed;
  bottom: 0;
  left: 0;
  padding: 10px 0;
  background-color: rgba(0,0,0,0.8);
  color: #ffffff;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.3);
  z-index: 100;
}
footer a { color: #ffd000; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ====================== RESPONSIVE TABLETTE ====================== */
@media (max-width: 1024px) {
  .terminal-stack { width: 90%; min-height: 500px; }
  .terminal-page { border-radius: 6px; }
  .terminal-bar { height: 45px; padding: 0 8px; }
  .terminal-circle { width: 20px; height: 20px; margin-left: 5px; }
  .terminal-page p { font-size: 1.2rem; line-height: 1.4; }
  #cursor { width: 0.55em; height: 1.1em; }
  .terminal-page:nth-child(1) { transform: translate(-10px,-10px) rotateX(1.5deg) rotateY(-1.5deg); }
  .terminal-page:nth-child(2) { transform: translate(-5px,-5px) rotateX(0.8deg) rotateY(-0.8deg); }
}

/* ====================== TABLETTES MOYENNES ====================== */
@media (max-width: 768px) {
  .terminal-stack { width: 95%; min-height: 400px; }
  .terminal-page { border-radius: 5px; }
  .terminal-bar { height: 40px; padding: 0 6px; }
  .terminal-circle { width: 18px; height: 18px; margin-left: 4px; }
  .terminal-page p { font-size: 1rem; line-height: 1.3; white-space: pre-wrap; }
  #cursor { width: 0.5em; height: 1em; }
  .terminal-page:nth-child(1) { transform: translate(-8px,-8px) rotateX(1deg) rotateY(-1deg); }
  .terminal-page:nth-child(2) { transform: translate(-4px,-4px) rotateX(0.5deg) rotateY(-0.5deg); }
}

/* ====================== PETITS TELEPHONES ====================== */
@media (max-width: 480px) {
  .terminal-stack { width: 98%; min-height: 300px; }
  .terminal-page { border-radius: 4px; }
  .terminal-bar { height: 35px; padding: 0 4px; }
  .terminal-circle { width: 14px; height: 14px; margin-left: 3px; }
  .terminal-page p { font-size: 0.8rem; line-height: 1.2; }
  #cursor { width: 0.4em; height: 0.8em; }
  .terminal-page:nth-child(1) { transform: translate(-4px,-4px) rotateX(0.5deg) rotateY(-0.5deg); }
  .terminal-page:nth-child(2) { transform: translate(-2px,-2px) rotateX(0.25deg) rotateY(-0.25deg); }
}

/* ====================== PETITS TELEPHONES + ORIENTATION PAYSAGE ====================== */
@media (max-width: 480px) and (orientation: landscape) {
  .terminal-stack { width: 95%; min-height: 250px; }
  .terminal-page p { font-size: 0.7rem; line-height: 1.1; }
  #cursor { width: 0.35em; height: 0.7em; }
}
