/* ===================================
   RESET & BASE STYLES
   =================================== */
html,
body {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: #000000;
  overflow: hidden;
}

body {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-tap-highlight-color: transparent;
}

::-moz-focus-inner {
  border: 0;
}

:focus {
  outline: none;
}

/* Hide default video controls on webkit browsers */
*::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}

/* Disable transitions during preload */
.preload * {
  -webkit-transition: none !important;
  transition: none !important;
}

/* ===================================
   MAIN CONTAINER
   =================================== */
.container {
  position: absolute;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vw;
  max-height: 100vh;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  overflow: hidden;
  cursor: pointer;
  perspective: 1000px;
  opacity: 1;
}

/* ===================================
   WATERMARK
   =================================== */
#al {
  position: absolute;
  top: 0.7vw;
  left: 0.7vw;
  letter-spacing: 0.3px;
  font-family: Arial, sans-serif;
  font-weight: 700;
  font-size: 2vw;
  color: rgba(255, 255, 255, 0.5);
  z-index: 1001;
}

/* ===================================
   BACKGROUND IMAGE
   =================================== */
#bg {
  position: absolute;
  width: 100%;
  height: 100%;
  background: url("../img/bg.webp") no-repeat center/cover;
  z-index: 3;
}

/* ============================================
   ANIMATIONS - Keyframes
   ============================================ */
/* Zombie appear with zoom effect */
@keyframes zombieAppear {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Zombie shake effect */
@keyframes zombieShake {
  0%, 100% {
    transform: translate(0, 0);
  }
  10% {
    transform: translate(-8px, -4px);
  }
  20% {
    transform: translate(8px, 4px);
  }
  30% {
    transform: translate(-6px, 2px);
  }
  40% {
    transform: translate(6px, -2px);
  }
  50% {
    transform: translate(-4px, 4px);
  }
  60% {
    transform: translate(4px, -4px);
  }
  70% {
    transform: translate(-2px, 2px);
  }
  80% {
    transform: translate(2px, -2px);
  }
  90% {
    transform: translate(-1px, 1px);
  }
}


/* Smooth fade in for tagline and CTA */
@keyframes fadeInSmooth {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Standard fade in animation */
@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* ============================================
   CHARACTER ANIMATIONS
   ============================================ */
/* Apply zoom and shake animations to character */
.char.animate {
  animation: 
    zombieAppear 0.4s ease-out forwards,
    zombieShake 0.15s ease-in-out 0.4s 5;
}

/* ============================================
   TAGLINE & CTA ANIMATIONS
   ============================================ */
/* Smooth fade in for tagline and CTA */
.tagline.fade-in,
.cta.fade-in {
  animation: fadeInSmooth 0.8s ease-out forwards;
}

/* ===================================
   TAGLINE & CTA - Fixed Position
   =================================== */
/* Tagline - Always at top */
.tagline {
  position: fixed;
  width: 100%;
  height: auto;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  object-fit: contain;
  pointer-events: none;
  max-width: 100vh;
  opacity: 0;
}

/* CTA - Always at bottom */
.cta {
  position: fixed;
  width: 100%;
  height: auto;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  object-fit: contain;
  pointer-events: none;
  max-width: 100vh;
  opacity: 0;
}

/* Legal - Fixed above CTA at 107px from bottom on 1200px canvas */
.legal {
  position: fixed;
  width: 100%;
  height: auto;
  bottom: calc(100vh * 107 / 1200);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  object-fit: contain;
  pointer-events: none;
  max-width: 100vh;
}

/* ===================================
   CHARACTER IMAGE
   =================================== */
/* Character - 810×1003px positioned at x:470px, y:46px on 1200×1200 canvas */
.char {
  position: fixed;
  width: calc(100vh * 810 / 1200);
  height: calc(100vh * 1003 / 1200);
  left: calc(50% - (100vh / 2) + (100vh * 470 / 1200));
  top: calc(50vh - (100vh / 2) + (100vh * 46 / 1200));
  z-index: 4;
  object-fit: contain;
  pointer-events: none;
  opacity: 0;
}

/* ===================================
   VIDEO PREVIEW
   =================================== */
/* Video preview - 815x458px positioned at y:721px from top of bg.webp (1200x1200), centered horizontally */
.video-preview {
  position: fixed;
  width: calc(100vh * 815 / 1200);
  height: calc(100vh * 458 / 1200);
  left: 50%;
  top: calc(50vh - (100vh / 2) + (100vh * 721 / 1200));
  transform: translateX(-50%);
  z-index: 5;
  opacity: 0;
  overflow: hidden;
  border-radius: 0;
  animation: fadeIn 0.8s ease-out 0.4s forwards;
}

.video-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

/* ===================================
   PLAY BUTTON
   =================================== */
/* Play button - Same dimensions and position as video preview */
.play-dark {
  position: fixed;
  width: calc(100vh * 815 / 1200);
  height: calc(100vh * 458 / 1200);
  left: 50%;
  top: calc(50vh - (100vh / 2) + (100vh * 721 / 1200));
  transform: translateX(-50%);
  cursor: pointer;
  z-index: 6;
  opacity: 0;
  object-fit: contain;
  animation: fadeIn 0.8s ease-out 0.5s forwards;
}

/* Play button active (tap) effect - Mobile only */
.play-dark:active {
  filter: brightness(0.9);
}

/* ===================================
   MAIN VIDEO (Full Screen Mode)
   =================================== */
/* Main video - Centered on page, hidden by default */
.video {
  position: fixed;
  top: 50%;
  left: 50%;
  width: calc(100vh * 815 / 1200);
  height: auto;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%);
  transition: width 0.5s, opacity 0.5s, visibility 0.5s, transform 0.5s;
  z-index: 1000;
  border-radius: 0;
}

/* Video visible when active */
.active .video {
  width: 93vw;
  height: auto;
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%);
}

/* ===================================
   DARK OVERLAY (Video Mode)
   =================================== */
/* Dark overlay - Appears behind video in full screen mode */
.darken {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  opacity: 0;
  visibility: hidden;
  background: #000;
  transition: opacity 0.5s, visibility 0.5s;
  z-index: 999;
}

/* Dark overlay visible when video is active */
.active .darken {
  opacity: 0.8;
  visibility: visible;
}

/* ===================================
   CLOSE BUTTON
   =================================== */
/* Close button - 113x113px positioned at x:1051px, y:36px on bg.webp (1200x1200) */
.minimize, 
.close {
  position: fixed;
  width: calc(100vh * 113 / 1200);
  height: calc(100vh * 113 / 1200);
  left: calc(50% - (100vh / 2) + (100vh * 1051 / 1200));
  top: calc(50vh - (100vh / 2) + (100vh * 36 / 1200));
  border-radius: 5px;
  background: url("../img/close-dark.svg") no-repeat center/65%;
  background-color: rgba(255, 255, 255, 0.3);
  z-index: 1002;
  cursor: pointer;
}

/* Close button active (tap) effect - Mobile only */
.minimize:active, 
.close:active {
  background-color: rgba(255, 255, 255, 0.5);
}

/* Minimize button z-index */
.minimize { 
  z-index: 333; 
}

/* Show close button when video is active */
.active .close {
  visibility: visible;
}

/* Hide minimize button */
.minimize.hidden {
  display: none;
}

/* Hide minimize when video is active */
.active .minimize {
  opacity: 0;
}

/* Hide close button in splitter mode */
.splitter .close {
  opacity: 0;
  visibility: hidden;
}

/* ===================================
   PRELOAD STATE
   =================================== */
/* Disable animations during preload phase */
.preload .play-dark,
.preload .video-preview {
  animation: none !important;
  opacity: 0;
}

/* ===================================
   RESPONSIVE - MOBILE
   =================================== */
/* Mobile adjustments for close button */
@media screen and (max-width: 767px) {
  .minimize, 
  .close {
    width: calc(100vw * 113 / 1200);
    height: calc(100vw * 113 / 1200);
    left: calc(50% - (100vw / 2) + (100vw * 1051 / 1200));
    top: calc(100vw * 36 / 1200);
  }
}

/* ===================================
   RESPONSIVE - PORTRAIT MODE
   =================================== */
/* Portrait tablets and phones - Use VW (width-based) calculations */
@media screen and (orientation: portrait) {
  /* Container aligned to top */
  .container {
    width: 100vw;
    height: 100vw;
    max-height: 100vh;
    top: 0;
    transform: translateX(-50%);
  }

  /* Character - Portrait sizing */
  .char {
    width: calc(100vw * 810 / 1200);
    height: calc(100vw * 1003 / 1200);
    left: calc(50% - (100vw / 2) + (100vw * 470 / 1200));
    top: calc(100vw * 46 / 1200);
  }

  /* Legal - Portrait sizing */
  .legal {
    bottom: calc(100vw * 107 / 1200);
  }

  /* Video preview - Portrait sizing */
  .video-preview {
    width: calc(100vw * 815 / 1200);
    height: calc(100vw * 458 / 1200);
    top: calc(100vw * 721 / 1200);
  }

  /* Play button - Portrait sizing */
  .play-dark {
    width: calc(100vw * 815 / 1200);
    height: calc(100vw * 458 / 1200);
    top: calc(100vw * 721 / 1200);
  }

  /* Main video - Portrait sizing */
  .video {
    width: calc(100vw * 815 / 1200);
  }

  /* Close button - Portrait sizing */
  .minimize, 
  .close {
    width: calc(100vw * 113 / 1200);
    height: calc(100vw * 113 / 1200);
    left: calc(50% - (100vw / 2) + (100vw * 1051 / 1200));
    top: calc(100vw * 36 / 1200);
  }
}

/* ===================================
   RESPONSIVE - LANDSCAPE MODE
   =================================== */
/* Landscape orientation - Use VH (height-based) only if width > height */
@media screen and (orientation: landscape) and (min-aspect-ratio: 1/1) {
  .container {
    width: 100vh;
    height: 100vh;
    max-height: none;
  }

  .char {
    width: calc(100vh * 810 / 1200);
    height: calc(100vh * 1003 / 1200);
    left: calc(50% - (100vh / 2) + (100vh * 470 / 1200));
    top: calc(50vh - (100vh / 2) + (100vh * 46 / 1200));
  }

  .legal {
    bottom: calc(100vh * 107 / 1200);
  }

  .video-preview {
    width: calc(100vh * 815 / 1200);
    height: calc(100vh * 458 / 1200);
    top: calc(50vh - (100vh / 2) + (100vh * 721 / 1200));
  }

  .play-dark {
    width: calc(100vh * 815 / 1200);
    height: calc(100vh * 458 / 1200);
    top: calc(50vh - (100vh / 2) + (100vh * 721 / 1200));
  }

  .video {
    width: calc(100vh * 815 / 1200);
  }

  .minimize, 
  .close {
    width: calc(100vh * 113 / 1200);
    height: calc(100vh * 113 / 1200);
    left: calc(50% - (100vh / 2) + (100vh * 1051 / 1200));
    top: calc(50vh - (100vh / 2) + (100vh * 36 / 1200));
  }
}

/* ===================================
   RESPONSIVE - DESKTOP LANDSCAPE
   =================================== */
/* Desktop landscape screens - Minimum 1024px width */
@media screen and (min-width: 1024px) and (orientation: landscape) {
  /* Container fixed to viewport height */
  .container {
    width: 100vh;
    height: 100vh;
  }

  /* Character - Desktop sizing */
  .char {
    width: calc(100vh * 810 / 1200);
    height: calc(100vh * 1003 / 1200);
    left: calc(50% - (100vh / 2) + (100vh * 470 / 1200));
    top: calc(50vh - (100vh / 2) + (100vh * 46 / 1200));
  }

  /* Legal - Desktop sizing */
  .legal {
    bottom: calc(100vh * 107 / 1200);
  }

  /* Video preview - Desktop sizing */
  .video-preview {
    width: calc(100vh * 815 / 1200);
    height: calc(100vh * 458 / 1200);
    top: calc(50vh - (100vh / 2) + (100vh * 721 / 1200));
  }

  /* Play button - Desktop sizing */
  .play-dark {
    width: calc(100vh * 815 / 1200);
    height: calc(100vh * 458 / 1200);
    top: calc(50vh - (100vh / 2) + (100vh * 721 / 1200));
  }

  /* Main video - Desktop sizing */
  .video {
    width: calc(100vh * 815 / 1200);
  }

  /* Close button - Desktop sizing */
  .minimize, 
  .close {
    width: calc(100vh * 113 / 1200);
    height: calc(100vh * 113 / 1200);
    left: calc(50% - (100vh / 2) + (100vh * 1051 / 1200));
    top: calc(50vh - (100vh / 2) + (100vh * 36 / 1200));
  }
}

/* ===================================
   RESPONSIVE - LARGE SCREENS
   =================================== */
/* Large screens - Height limitation at 1440px */
@media screen and (min-width: 1440px) {
  .container {
    max-height: 1440px;
    max-width: 1440px;
  }
}

/* ===================================
   RESPONSIVE - ULTRA-WIDE SCREENS
   =================================== */
/* Ultra-wide screens - Height limitation at 1920px */
@media screen and (min-width: 1920px) {
  .container {
    max-height: 1920px;
    max-width: 1920px;
  }
}
