/* Global */
body {
  margin: 0;
  font-family: "Courier New", monospace;
  background: #fdf6e3;
  overflow-x: hidden;
  position: relative;
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  z-index: 999;
  padding: 10px;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 20px;
  justify-content: center;
}

nav li {
  cursor: pointer;
}

.layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-auto-rows: auto;
  gap: 20px;
  padding: 40px;
}
/* Based on CSS Grid layout practices :contentReference[oaicite:0]{index=0} */


/* Snow background */
#snow {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('https://tse1.mm.bing.net/th/id/OIP.bxcTWbyIBRmQ8hAVVj4iVgHaEK?pid=Api') repeat;
  mix-blend-mode: overlay;
  opacity: 0.5;
  animation: drift 30s linear infinite;
  z-index: 1;
}

@keyframes drift {
  0% { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

/* Flakes */
.flake {
  position: absolute;
  color: rgba(255, 255, 255, 0.8);
  user-select: none;
  animation: fall 5s linear forwards;
  z-index: 999;
}

@keyframes fall {
  to { top: 100vh; }
}

/* Sections */
section {
  padding: 100px 60px;
  border-bottom: 3px dotted #925;
  position: relative;
  z-index: 2;
}

h1, h2, p {
  margin: 10px;
}

.tiny {
  font-size: 12px;
  color: #a0a;
}

.giant {
  font-size: 6vw;
  color: #f00;
}

.spin {
  transform: rotate(-15deg);
  color: #0f0;
  font-size: 3rem;
}

/* Weird layered text */
.chaos {
  position: absolute;
  opacity: 0.3;
  z-index: 3;
}

/* Image gallery layout */
.image-gallery {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 30px;
}

/* Weird images */
.weird-img {
  width: 250px;
  transition: transform 0.5s ease;
  transform: rotate(5deg);
  border: 3px dashed #925;
  box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.2);
}

.weird-img:hover {
  transform: rotate(-5deg) scale(1.1);
}

.weird-img.flipped {
  transform: rotate(-10deg) scaleX(-1);
}

/* API block */
.api-block {
  background: #222;
  color: #0f0;
  padding: 40px;
  font-family: monospace;
  position: relative;
}

/* Footer */
.footer {
  padding: 80px 20px;
  text-align: center;
  background: black;
  color: white;
  font-size: 1rem;
  position: relative;
}

/* Chaotic Floating Popups */
@keyframes fadePop {
  from {
    transform: scale(0.3) rotate(-30deg);
    opacity: 0;
  }
  to {
    transform: scale(1.2) rotate(10deg);
    opacity: 1;
  }
}

.random-popup {
  position: fixed;
  z-index: 9999;
  padding: 30px 35px 25px 20px;
  border: 4px double hotpink;
  pointer-events: auto;
  animation: fadePop 0.4s ease-in;
  transform-origin: center;
  white-space: pre-wrap;
  mix-blend-mode: difference;
  filter: contrast(200%) brightness(150%);
  word-break: break-word;
  max-width: 300px;
  overflow-wrap: break-word;
  box-shadow: 0 0 30px rgba(255, 0, 255, 0.6);
}

/* Close button inside popup */
.random-popup .close-btn {
  position: absolute;
  top: 5px;
  right: 10px;
  background: #000;
  color: #fff;
  border: 2px dashed red;
  border-radius: 50%;
  font-weight: bold;
  font-size: 1rem;
  width: 24px;
  height: 24px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
}

.random-popup .close-btn:hover {
  background: red;
  color: black;
  transform: scale(1.2) rotate(10deg);
}
