/* Custom font faces */
@font-face {
  font-family: "Cooper Black";
  src: url("../fonts/CooperBlackStd.woff2") format("woff2"),
       url("../fonts/CooperBlackStd.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Comic Sans MS";
  src: url("../fonts/ComicSansMS.woff2") format("woff2"),
       url("../fonts/ComicSansMS.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

/* Full-screen background and centered logo for landing page */
html, body {
  height: 100%;
  margin: 0;
}
:root{ 
  --bg-fade-duration: 1.5s;
}
body {
  position: relative;
  font-family: sans-serif;
  /* background will be applied in a fading pseudo-element */
}

/* Center the logo exactly in the viewport (aligned with background center) */
.landing-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1);
  z-index: 2; /* keep logo above vignette */
  opacity: 0;
  transition: opacity 0.6s ease;
}
.landing-logo.visible {
  opacity: 1;
}
.landing-logo > a {
  pointer-events: auto;
  cursor: pointer;
}
.landing-logo > img {
  display: block;
  width: auto; /* preserve natural width */
  height: auto; /* preserve natural height */
  max-width: 90vw; /* avoid overflow on small screens */
  max-height: 90vh;
}

.landing-bird-wrap {
  display: none;
}

.landing-bird-layer {
  display: block;
}

/* Small accessibility: ensure background color if image fails to load */
body { background-color: #000; }

/* Vignette overlay: subtle darkening at edges, centered on viewport */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1; /* sits above background, below logo (logo z-index:2) */
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 30%, rgba(0,0,0,0.54) 60%, rgba(0,0,0,0.9) 100%);
}

/* Background layer with fade-in */
body::after{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0; /* underneath vignette and logo */
  background-image: url("../img/landing-background.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 1;
}

@keyframes bg-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes logo-fade {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.98); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes birdGlitchOne {
  0% { transform: translateX(2px); opacity: 0.22; }
  18% { transform: translateX(-3px); opacity: 0.28; }
  35% { transform: translateX(5px); opacity: 0.2; }
  54% { transform: translateX(-2px); opacity: 0.25; }
  70% { transform: translateX(24px); opacity: 0.38; }
  86% { transform: translateX(4px); opacity: 0.22; }
  100% { transform: translateX(-6px); opacity: 0.3; }
}

@keyframes birdGlitchTwo {
  0% { transform: translateX(-2px); opacity: 0.16; }
  18% { transform: translateX(4px); opacity: 0.2; }
  35% { transform: translateX(-5px); opacity: 0.18; }
  54% { transform: translateX(2px); opacity: 0.22; }
  70% { transform: translateX(-22px); opacity: 0.34; }
  86% { transform: translateX(-3px); opacity: 0.18; }
  100% { transform: translateX(6px); opacity: 0.24; }
}

/* Background fade keyframes */
/* No background fade; logo appears immediately. */

/* ===== TABLET AND MOBILE STYLES ===== */

/* Tablet and Mobile: 1024px and below */
@media (max-width: 1024px) {
  body::after {
    background-image: url("../img/bg-black-blue-wireframe-warp.gif");
    background-size: cover;
  }
  
  .landing-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding-top: 40px;
  }
  
  .landing-logo > img {
    display: none;
  }

  .landing-logo > a {
    display: none;
  }

  .landing-bird-wrap {
    display: grid;
    order: 2;
    line-height: 0;
  }

  .landing-bird-wrap .landing-bird-layer {
    grid-area: 1 / 1;
    width: auto;
    height: auto;
    max-width: 320px;
    max-height: 320px;
  }

  .landing-bird-base {
    position: relative;
    z-index: 3;
  }

  .landing-bird-glitch1,
  .landing-bird-glitch2 {
    pointer-events: none;
    animation-duration: 95ms;
    animation-timing-function: steps(1, end);
    animation-iteration-count: infinite;
    animation-direction: alternate;
    will-change: transform, opacity;
  }

  .landing-bird-glitch1 {
    z-index: 1;
    animation-name: birdGlitchOne;
  }

  .landing-bird-glitch2 {
    z-index: 2;
    animation-name: birdGlitchTwo;
  }
  
  .landing-text-top {
    display: block !important;
    font-family: "Cooper Black", Georgia, serif;
    font-size: 4.5rem;
    color: #00ff00;
    margin: 0;
    text-align: center;
    font-weight: bold;
    line-height: 1.2;
    text-shadow: 3px 3px 0 #000;
    order: 1;
  }
  
  .landing-text-bottom {
    display: block !important;
    font-family: "Comic Sans MS", "Comic Sans", cursive;
    font-size: 1.6rem;
    color: #ffff00;
    margin: 0;
    text-align: center;
    line-height: 1.4;
    max-width: 80vw;
    text-shadow: 2px 2px 0 #000;
    order: 3;
  }
  
  .landing-badge {
    display: block !important;
    margin-top: 20px;
    order: 4;
  }
  
  .landing-badge img {
    display: block;
    width: auto;
    height: auto;
  }
}

/* Hide badge on desktop */
.landing-badge {
  display: none;
}

/* Hide text on desktop */
.landing-text-top,
.landing-text-bottom {
  display: none;
}
