/*
 * Copyright (c) 2025-2026 Evolution Creek Software. All rights reserved.
 *
 * Unauthorized copying, linking, or other unintended use of this file
 * (in part or in whole) is strictly prohibited.
 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 100vw;
  margin: 0 auto;
  background-color: beige;
  opacity: 0;
  animation: fadeIn 0.2s ease-in forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

main{
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items: center;
  gap: 3rem;
  margin-top: 2rem;
}

img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s ease;
}

header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 2rem;
  background-color: wheat;
  box-shadow: 0 0 10px 3px peru;
  position: relative;
  top: 0;
  width: 100%;
  box-sizing: border-box;
  transition: opactiy 0.2s ease;
}

h1 {
  justify-self: center;
  font-family: 'Caveat', cursive;
  font-size: 3rem;
  margin: 0;
  cursor: default;
  transition: opactiy 0.2s ease;
  line-height: 1;
}

#headerIcon {
  position: absolute;
  left: 0rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 600ms, left 0.3s ease;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  z-index: 1100;
}

.line {
  fill: none;
  transition: stroke-dasharray 600ms, stroke-dashoffset 600ms, stroke 800ms;
  stroke: #000;
  stroke-width: 5.5;
  stroke-linecap: butt;
}

.ham8 .top {
  stroke-dasharray: 40 160;
}

.ham8 .middle {
  stroke-dasharray: 40 142;
  transform-origin: 50%;
  transition: transform 600ms;
}

.ham8 .bottom {
  stroke-dasharray: 40 85;
  transform-origin: 50%;
  transition: transform 600ms, stroke-dashoffset 600ms;
}

.ham8.active .top {
  stroke-dashoffset: -64px;
}

.ham8.active .middle {
  transform: rotate(90deg);
}

.ham8.active .bottom {
  stroke-dashoffset: -64px;
}

#headerIcon.active {
  transform: rotate(45deg);
}

#headerIcon.active .line {
  stroke: saddlebrown;
}

#sideMenu {
  position: fixed;
  top: 0;
  left: -250px;
  width: 250px;
  height: 100%;
  background: white;
  box-shadow: 2px 0 5px rgba(0,0,0,0.2);
  padding: 2rem 1rem;
  transition: left 0.3s ease;
  z-index: 1000;
  background-color: beige;
}

#sideMenu.active {
  left: 0;
}

#sideMenu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-top: 3rem;
}

#sideMenu li {
  margin: 1rem 0;
}

#sideMenu a {
  text-decoration: none;
  font-family: 'Caveat', cursive;
  font-size: 2rem;
  color: black;
  transition: color 0.2s ease;
}

#sideMenu a:hover {
  color: saddlebrown;
}

.popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 2rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  z-index: 2000;
  width: 80%;
  max-width: 400px;
  border-radius: 10px;
  cursor: default;
  border: 2px solid black;
}


.popup h2{
  font-size: 2rem;
  font-family: 'Caveat', cursive;
  color: saddlebrown;
}

.popup p{
  font-size: 1.5rem;
  font-family: "Caveat Brush", cursive;
}

.popup a{
  text-decoration: none;
  font-size: 1.5rem;
  font-family: "Caveat Brush", cursive;
}
.popup a:hover{
  color: blue;
}

.popup.active {
  display: block;
}

#popups.active ~ main,
#popups.active ~ header h1 {
  opacity: 0.5;
}


.grid {
  display: grid;
  gap: clamp(0.5rem, 2vw, 3rem);
  justify-content: center;
}

.row-1 {
  grid-template-columns: repeat(1, 1fr);
  width: min(450px, 90vw);
}

.row-2 {
  grid-template-columns: repeat(2, 1fr);
  width: min(1000px, 90vw);
}

.grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.title {
  margin-bottom: 0.6rem;
  font-family: 'Caveat', cursive;
  font-size: 2rem;
  text-align: center;
  cursor: default;
  transition: color 0.2s ease;
}

.square-link{
  text-decoration: none;
  color: inherit;
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.square {
  width: 100%;
  position: relative;
  box-sizing: border-box;
  aspect-ratio: 5/3;
  overflow: hidden;
  border: 3px solid black;
  border-radius: 5px;
  font-size: clamp(20px, 2rem, 40px);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease, border 0.2s ease;
}

.square-description {
  opacity: 0;
  transition: opacity 0.3s ease;
  position: absolute;
  text-align: center;
  padding: 0.5rem;
  color: black;
  font-family: "Caveat Brush", cursive;
  font-weight: 400;
  font-style: normal;
  font-size: 1.5rem;
  pointer-events: none;
}

.square:hover .square-description {
  opacity: 1;
}

.square:hover img {
  opacity: 0.2;
}

@media (hover: hover) and (pointer: fine){
  .square:hover {
    background-color: rgba(250, 250, 250, 0.8);
    transform: scale(1.05);
  }

  .square-description:hover{
    opacity:1;
  }
}

footer {
  text-align: center;
  padding: 1rem;
  font-size: 1rem;
  color: #666;
  cursor: default;
  margin-top: auto;
}

@media (max-width: 700px) {
  header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
  }

  h1{
    font-size: 2rem;
    line-height: 1;
    max-width: 70vw;
    text-align: center;
    margin-top: 0.5rem;
  }

  #headerIcon{
    left: 0rem;
    padding: 7px;
  }

  #sideMenu.active + #headerIcon,
  #headerIcon.active {
    left: 0rem;
    position: fixed;
  }

  #sideMenu {
    left: -100vw;
    width: 100vw;
    box-sizing: border-box;
  }

  #sideMenu.active {
    left: 0;  /* Add !important here too */
  }

  #sideMenu ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  #sideMenu a {
  	font-size: 1.5rem;
  }

  .title{
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-size: 25px;
    line-height: 1.2;
    min-height: calc(1.2em * 2);
  }

  main {
   display: flex;
   flex-direction: column;
   align-items: center;
   width: 100%;
   margin-top: 0;
   gap: 0rem;
 }

 .grid {
   width: 100%;
   display: flex;
   flex-direction: column;
   align-items: center;
 }

 .grid-item {
   width: 90vw;
   max-width: 500px;
 }

 .square {
   width: 100%;
 }

  footer{
    margin-top: auto;
  }
}
