* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}

/* HOMEPAGE */
#homepage {
  padding: 40px;
}

/* CLOSE BUTTON (hidden by default) */
#closeOverlay {
  position: fixed;
  top: 20px;
  right: 20px;
  font-size: 24px;
  z-index: 1000;
  display: none;
  cursor: pointer;
}

/* OVERLAY */
#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  z-index: 999;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#overlay.hidden {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

/* PANELS */
.panel {
  flex: 1;
  position: relative;
  overflow: hidden;
  transition: transform 0.6s ease;
}

.panel.left {
  background: url('../images/emu_muhedinovic_3D_ograde.png') center/cover no-repeat;
}

.panel.right {
  background: url('../images/emu_muhedinovic_2D_ograde.png') center/cover no-repeat;
}

/* OVERLAY DARKENING (balanced) */
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.18),
    rgba(0,0,0,0.38)
  );
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    transparent 55%,
    rgba(0,0,0,0.22)
  );
}

/* CONTENT */
.content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
}

.icon {
  width: 330px;
  max-width: 100%;
}

/* FLOAT */
@keyframes float {
  0% { transform: translate(0,0); }
  50% { transform: translate(5px,-10px); }
  100% { transform: translate(0,0); }
}

.icon1 { animation: float 6s ease-in-out infinite; }
.icon2 { animation: float 6.5s ease-in-out infinite; }

/* TEXT */
.content h2 {
  margin-top: 15px;
  font-weight: 600;
}

.content a {
  margin-top: 15px;
  padding: 12px 24px;
  border: 1px solid rgba(255,255,255,0.6);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.content a:hover {
  background: #c37d2a;
  color: white;
  border-color: #c37d2a;
}

.content a:active {
  background: #c37d2a;
  color: white;
  border-color: #c37d2a;
}

/* MAIN ICON */
#mainIcon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: 130px;
  height: 130px;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  z-index: 10;
}

#mainIcon img {
  width: 100%;
  height: auto;
}

img {
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}
/* MOBILE */
@media (max-width: 768px) {
  #overlay {
    flex-direction: column;
  }

  .panel {
    height: 50vh;
  }

  .icon {
    width: 130px;
  }
  
  .icon1 {
    margin-top: -25px;
  }
  
  .icon2 {
    margin-top: 15px;
  }

  #mainIcon {
    width: 110px;
    height: 110px;
  }

  #mainIcon img {
    width: 100%;
    height: auto;
  }
  
  .content a {
  margin-top: -15px;
  
}
  
}


/* =========================
   OVERLAY BASE
========================= */
#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  z-index: 999;
  overflow: hidden;
}

/* =========================
   PANEL BASE
========================= */
.panel {
  flex: 1;
  position: relative;
  overflow: hidden;
  transition: transform 0.7s cubic-bezier(0.77, 0, 0.175, 1);
}

/* =========================
   SPLIT ANIMATION (PRO EFFECT)
========================= */
#overlay.hidden .left {
  transform: translateX(-100%);
}

#overlay.hidden .right {
  transform: translateX(100%);
}

/* =========================
   VERY LIGHT DARKNESS
========================= */
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.08),
    rgba(0,0,0,0.22)
  );
}

/* =========================
   PANEL HOVER (DESKTOP ONLY)
========================= */
@media (min-width: 769px) {
  .panel:hover {
    transform: scale(1.02);
  }
}

/* =========================
   MAIN ICON IMAGE
========================= */
#mainIcon img {
  width: 100%;
  height: auto;
  transition: transform 0.25s ease, filter 0.25s ease;
  filter: drop-shadow(0 15px 35px rgba(0,0,0,0.25));
}

#mainIcon:hover img {
  transform: scale(1.06);
  filter: drop-shadow(0 25px 55px rgba(0,0,0,0.35));
}

/* =========================
   MAIN ICON "HELLO" ANIMATION
========================= */
@keyframes helloWiggle {
  0%   { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  20%  { transform: translate(-50%, -50%) scale(1.06) rotate(-6deg); }
  40%  { transform: translate(-50%, -50%) scale(1.06) rotate(6deg); }
  60%  { transform: translate(-50%, -50%) scale(1.06) rotate(-4deg); }
  80%  { transform: translate(-50%, -50%) scale(1.03) rotate(3deg); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}

#mainIcon.animate {
  animation: helloWiggle 0.9s ease;
}

/* =========================
   HOMEPAGE FADE IN
========================= */
#homepage {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

#overlay.hidden ~ #homepage {
  opacity: 1;
  transform: translateY(0);
}

/* =========================
   BUTTONS (PREMIUM FEEL)
========================= */
.content a {
  transition: all 0.25s ease;
}

.content a:hover,
.content a:active {
  background: #c37d2a;
  color: white;
  border-color: #c37d2a;
  transform: translateY(-2px);
}

/* =========================
   ICON DEPTH
========================= */
.icon {
  filter: drop-shadow(0 10px 25px rgba(0,0,0,0.25));
}

/* =========================
   MOBILE (SAFE)
========================= */
@media (max-width: 768px) {

  #overlay {
    flex-direction: column;
  }

  .panel {
    height: 50vh;
  }

  /* disable split on mobile (important) */
  #overlay.hidden .left,
  #overlay.hidden .right {
    transform: none;
  }

  #mainIcon {
    width: 110px;
    height: 110px;
  }

  .icon {
    width: 130px;
  }
}


#homepage {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

body.overlay-hidden #homepage {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (orientation: landscape) and (max-height: 500px) {

  #overlay {
    flex-direction: row !important;
  }

  .panel {
    height: 100vh !important;
  }
  
  .icon1 {
    margin-top: 0px;
  }
  
  .icon2 {
    margin-top: 0px;
  } 

}


/* =========================
   PRELOADER (FULLSCREEN)
========================= */
#preloader {
  position: fixed;
  inset: 0;
  background: #000; /* black background */
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 1;
  transition: opacity 0.5s ease;
}

/* HIDDEN STATE */
#preloader.hidden {
  opacity: 0;
  pointer-events: none;
}

/* =========================
   SPINNER
========================= */
.loader {
  width: 42px;
  height: 42px;

  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.15);
  border-top: 3px solid #c37d2a;

  animation: spin 0.9s linear infinite;
}

/* SPIN ANIMATION */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}