@import "colors.css";
@import "typography.css";
@import url("https://fonts.googleapis.com/css2?family=Open+Sans&family=Roboto:wght@300;400&family=Source+Code+Pro:wght@400;600&display=swap");
/* Ensure the body and html take up the full height of the viewport */

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--primary-background);
  color: var(--content);
  font-family: "Open Sans", monospace;
  margin: 0;

  & h1 {
    color: var(--highlight);
    text-shadow: 2px 2px 2px var(--cyan);
    -webkit-text-stroke-width: 1px;
    -webkit-text-stroke-color: var(--darker);
  }

  & h1 a {
    color: var(--highlight);
    text-shadow: 2px 2px 2px var(--cyan);
    -webkit-text-stroke-width: 1px;
    -webkit-text-stroke-color: var(--darker);
  }

  & h2 {
    color: var(--light-accent);
  }

  & p {
    color: var(--darker);
  }
}

header {
  position: relative;
  padding: 20px;
  text-align: center;
  display: block;
}

header:before {
  content: "";
  /* Required for pseudo-elements */
  position: absolute;
  /* Positions the pseudo-element relative to the parent */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle farthest-side at 0% 50%, var(--background-color-primary) 23.5%, var(--color-transparent) 0) 21px 30px,
    radial-gradient(circle farthest-side at 0% 50%, var(--background-color-secondary) 24%, var(--color-transparent) 0) 19px 30px,
    linear-gradient(var(--background-color-primary) 14%, var(--color-transparent) 0, var(--color-transparent) 85%, var(--background-color-primary) 0) 0 0,
    linear-gradient(150deg, var(--background-color-primary) 24%, var(--background-color-secondary) 0, var(--background-color-secondary) 26%, var(--color-transparent) 0, var(--color-transparent) 74%, var(--background-color-secondary) 0, var(--background-color-secondary) 76%, var(--background-color-primary) 0) 0 0,
    linear-gradient(30deg, var(--background-color-primary) 24%, var(--background-color-secondary) 0, var(--background-color-secondary) 26%, var(--color-transparent) 0, var(--color-transparent) 74%, var(--background-color-secondary) 0, var(--background-color-secondary) 76%, var(--background-color-primary) 0) 0 0,
    linear-gradient(90deg, var(--background-color-secondary) 2%, var(--background-color-primary) 0, var(--background-color-primary) 98%, var(--background-color-secondary) 0%) 0 0 var(--background-color-primary);
  background-size: 40px 60px;
  z-index: -2;
  /* Places the pseudo-element behind the content */
}

header:after {
  content: "";
  /* Required for pseudo-elements */
  position: absolute;
  /* Positions the pseudo-element relative to the parent */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(279deg, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0) 100%);
  z-index: -1;
  /* Places the pseudo-element behind the content */
}

h1 {
  margin: 0;
  font-size: x-large;
}

.rainbow-effect {
  background: linear-gradient(
    to right,
    violet 0%,
    indigo 14.28%,
    blue 28.56%,
    green 42.84%,
    yellow 57.12%,
    orange 71.4%,
    red 85.68%,
    violet 100%
  );
}

/* C64 style for menu nav */
nav:before {
  content: "";
  /* Required for pseudo-elements */
  position: absolute;
  /* Positions the pseudo-element relative to the parent */
  bottom: 0;
  left: 0;
  width: 100%;
  height: 5px;
  z-index: 1;
  background: linear-gradient(
    to right,
    var(--cyan) 0%,
    var(--teal) 100%
  );
}
/* Basic styling for 
the nav */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #333;
  padding: 10px;
  position: relative;
  box-shadow: 0px -40px 93px 25px rgba(255,255,255,0.8);
}

/* Style for the menu links */
#menu {
  display: flex;
  gap: 20px;
  /* Adds spacing between links */
}

#menu a {
  color: var(--light);
  text-decoration: none;
  padding: 10px;
  font-size: 1.2rem;
  /* Scalable font size */
  transition: color 0.3s ease;
}

#menu a:hover {
  color: var(--orange);
  /* Hover effect */
}

#menu a.active {
  color: var(--bright);
}

/* Hide the hamburger button by default */
#menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

/* Close button for the hamburger menu */
#close-menu {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  position: absolute;
  top: 10px;
  right: 10px;
}

main {
  padding: 20px;
  flex: 1;

  & a {
    color: var(--link);
  }
  & a:link{color:inherit}
  & a:active{color:inherit}
  & a:visited{color:inherit}
  & a:hover{color:inherit}

}

/* part madness */
section:part(page-content) {
  color: red;
}

div::part(my-part) {
  color: red;
}

a {
  color: var(--link);
}

::part(link) {
  color: teal;
  text-decoration: none;
}

::part(link):hover {
  text-decoration: underline;
}

footer {
  background-color: var(--secondary-background);
  padding: 10px;
  text-align: center;
  color: var(--cyan);

  & p {
    color: var(--light);
    font-size: smaller;
  }
}

.loading-spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top: 4px solid var(--highlight);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Responsive styles */
@media (max-width: 768px) {
  /* Show the hamburger button */
  #menu-toggle {
    display: block;
  }

  /* Hide the menu by default */
  #menu {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    /* Remove gap for vertical layout */
    position: fixed;
    top: 0;
    left: 0;
    background-color: #333;
    padding: 60px 20px 20px;
    /* Space for the close button */
    z-index: 1000;
  }

  /* Show the menu when the button is clicked */
  #menu.active {
    display: flex;
  }

  /* Show the close button when the menu is active */
  #close-menu.active {
    display: block;
    width: 100px;
  }
}

