/* Theme tokens, reset, cursor, navigation, and shared shell */

:root {
  --black: #0A0A0A;
  --white: #eeebdc;
  --shadow: rgba(0, 0, 0, 0.78);

  --navBackground: var(--white);
  --navText: var(--black);

  --scrollbarTrack: var(--black);
  --scrollbar: var(--black);
  --scrollbarThumb: var(--white);

  --cursor-size: 28px;
  --bg: var(--white);

  --navBarText: var(--white);

  --overlayOpacity: 1;

  --pulseColor: color-mix(in srgb, var(--navBarText) 40%, transparent);

  transition:
    background-color 0.5s ease,
    color 0.5s ease,
    var(--navBackground) 0.5s ease,
    var(--navText) 0.5s ease,
    var(--scrollbarTrack) 0.5s ease,
    var(--scrollbarThumb) 0.5s ease;
}

* {
  margin: 0;
  padding: 0;
  font-family: "Geist", sans-serif; 
  cursor: none;

  transition:
    background-color 0.5s ease,
    color 0.5s ease,
    border-color 0.5s ease;
}

body {
  background: var(--black);
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x:hidden;
}

*::-webkit-scrollbar-track {
  background-color: var(--scrollbarTrack);
}

*::-webkit-scrollbar {
  width: 10px;
  background-color: var(--scrollbar);
}

*::-webkit-scrollbar-thumb {
  background-color: var(--scrollbarThumb);
}

.navbar {
  background-color: var(--navBackground);
  color: var(--navText);
  transition: background-color 0.3s, color 0.3s;
}

#particles-js {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: auto;
}

#container3D {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 2;
}

h1 {
  font-size: 2.5rem;
  text-align: center;
}

.container {
  position: fixed;
  top: 2.5vh;
  right: 5%;
  width: 50px;
  height: 50px;
  padding-top: 20px;
  opacity: 0;
}

.container.no-transition {
  transition: none !important;
}

.goo {
  display: none;
}

#cursor {
  position: fixed;
  top: 0px;  /* Half of 28px cursor size */
  left: 0px; /* Half of 28px cursor size */
  pointer-events: none;
  mix-blend-mode: difference;  
  filter: url(#goo);
  z-index: 99999;
}

.cursor-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;  /* Default cursor size */
  height: 28px; /* Default cursor size */
  border-radius: 50%;
  background: var(--bg);
  transform-origin: center;
  transform: translate(-50%, -50%); /* Center the cursor at its middle */
  transition: width 0.3s ease, height 0.3s ease;
}

.menu {
  position: relative;
  width: 50px;
  height: 50px;
}

.menu span {
  width: 100%;
  height: 3.5px;
  background: var(--navBarText);
  position: absolute;
  transition: all 0.18s ease;
  border-radius: 5px;
}

.menu span:first-child {
  top: -15px;
}

.menu span:last-child {
  top: 15px;
}

.container:hover #button8 span:first-child {
  width: 10px;
  height: 15px;
  top: -17px;
  animation: wink 3s 2s infinite;
}

.container:hover #button8 span:last-child {
  width: 35px;
  height: 20px;
  border-radius: 20px 20px 50px 50px;
  top: 5px;
  margin-left: 7px;
  animation: smile 3s 2s infinite;
}

.container:hover #button8 span:nth-child(2) {
  width: 10px;
  height: 15px;
  top: -17px;
  margin-left: 40px;
  animation: wink 3s 2s infinite;
}

@keyframes wink {
  0% {
    height: 15px;
  }
  5% {
    height: 1px;
    top: -7px;
  }
  10% {
    height: 15px;
    top: -17px;
  }
  100% {
    height: 15px;
  }
}

@keyframes smile {
  0% {
    border-radius: 20px 20px 50px 50px;
  }
  5% {
    border-radius: 10px 10px 110px 110px;
    top: 4px;
  }
  10% {
    border-radius: 20px 20px 50px 50px;
    top: 5px;
  }
  100% {
    border-radius: 20px 20px 50px 50px;
  }
}

nav {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 0;
  background: var(--navBackground);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9991;
  pointer-events: none;
  touch-action: none;
  overflow: hidden;
  will-change: height;

}

nav.open {
  pointer-events: auto !important;
  touch-action: auto !important;
}

nav {
  padding-top: env(safe-area-inset-top) !important;
}

nav ul {
  list-style: none;
}

nav ul li {
  margin: 50px 0;
}

nav ul li a {
  color: var(--navText);
  font-size: 2em;
  text-decoration: none;
  font-weight: 500;
  position: relative;
  opacity: 0;
  pointer-events: none;
}

nav ul li a:after {
  content: '';
  width: 100%;
  position: absolute;
  height: 3px;
  border-radius: 5px;
  background: var(--navText);
  bottom: -10px;
  left: 0;
  transform-origin: left;
  transition: transform .5s ease;
  transform: scaleX(0);
}

nav ul li a:hover:after {
  transform: scaleX(1);
}

nav .close {
  width: 50px;
  height: 25px;
  padding-top: 20px;
  position: absolute;
  top: 4.9%;
  right: 5%;
  opacity: 0;
  pointer-events: none;
}

nav h2 {
  position: absolute;
  top: 5vh !important;
  left: 5%;
  opacity: 0;
  pointer-events: none;
  color: var(--navText);
  font-size: 2em;
}

.main-h2 {
  position: absolute;
  margin-top: -2vh !important;
  left: 5%;
  color: var(--navBarText);
  font-size: 2em;
  opacity: 1;
  pointer-events: none;
  z-index: 999;
  opacity: 0;
  transition: color 0.18s ease;
}

nav .close div::before,
nav .close div::after {
  content: '';
  position: absolute;
  width: 50px;
  height: 3.5px;
  background: var(--navText);
  transition: background .5s ease;
}

nav .close div::before {
  transform: rotate(-45deg);
  transition: transform 0.3s ease;
}

nav .close div::after {
  transform: rotate(45deg);
  transition: transform 0.3s ease;
}

nav .close:hover div::before {
  transform: rotate(45deg);
  transition: transform 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1.5);
}

nav .close:hover div::after {
  transform: rotate(-45deg);
  transition: transform 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1.5);
}

.MainTitle div {
  transform: translateY(20px); /* Initial offset for animation */
  opacity: 0; /* Hidden before animation */
}

#theme-toggle {
  position: fixed;
  top: 3.2vh;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent !important;
  border: 2px solid var(--navBarText) !important;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.2s ease;
  z-index: 9999;
  box-shadow: 0 0 0 0 var(--black);
  animation: pulseColorChange 7.8s infinite cubic-bezier(0.16, 1, 0.3, 1);
}

/* Default scale for tooltip (bubble + arrow) */
#theme-toggle {
  --tooltip-scale: 0;
}

/* Tooltip bubble */
#theme-toggle::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -40px; /* bubble under the button */
  left: 50%;
  transform: translateX(-50%) scale(var(--tooltip-scale));
  transform-origin: top center;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
  background: var(--navBarText);
  color: var(--navText);
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
}

/* Tooltip arrow */
#theme-toggle::before {
  content: "";
  position: absolute;
  bottom: -16px; /* arrow sits above bubble */
  left: 50%;
  transform: translateX(-50%) scale(var(--tooltip-scale));
  transform-origin: top center;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--navBarText);
  opacity: 0;
}

/* Control visibility with a class */
#theme-toggle.show-tooltip::after,
#theme-toggle.show-tooltip::before {
  opacity: 1;
}

@keyframes pulseColorChange {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--navBarText) 40%, transparent); }
  36% { box-shadow: 0 0 12px 12px color-mix(in srgb, var(--navBarText) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
