* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: "aktiv-grotesk", sans-serif;
  cursor: none;
}

html, body {
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(to bottom, rgb(54, 63, 199), rgb(98, 202, 255));
} 

canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.control-panel {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  height: 490px;
  width: 300px;
  padding: 45px 20px 0px 20px;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 10;
}

.control-panel .slider {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.control-panel label {
  color: rgb(0, 0, 0);
  font-size: 0.8rem;
  font-weight: 300;
  font-style: italic;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.control-panel input[type="range"] {
  width: 100%;
}

.slider-container{
  width: 100%;
}

.m_container{
  width: 95%;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.button-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  justify-items: center;
  align-items: center;
  width: 100%;
  margin-top: 0.5rem;
}

.circle, .circleinv {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #a0a0a0;
  transition: 0.2s;
  border: none;
}

.circle:hover {
  background-color: #ffe481;
}

.circle.active {
  background-color: #000000;
}

.circleinv {
  background: transparent;
  pointer-events: none;
}

.control-panel input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #a0a0a0; /* Slider track color */
  border-radius: 3px;
  outline: none;
}

/* Webkit (Chrome, Safari) */
.control-panel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #ffe481; /* Thumb color */
}

/* Firefox */
.control-panel input[type="range"]::-moz-range-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #ffe481;
}

#mouseModeButtons {
  width: 100%;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 20px 0px;
}

#mouseModeButtons button {
  height: 80px;
  width: 80px;
  border-radius: 50%;
  padding: 6px 10px;
  background-color: #a0a0a0;
  color: rgb(0, 0, 0);
  transition: background-color 0.2s ease;
  font-weight: 300;
  font-size: 0.8rem;
  font-style: italic;
  text-transform: uppercase;
  outline: none;
  border: none;
  box-shadow: none;
}

#mouseModeButtons button:hover {
  background: #ffe481;
  color: rgb(0, 0, 0);
}

#mouseModeButtons button.active {
  background: #000000;
  color: rgb(255, 255, 255);
}

.s_container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding-top: 2rem;
  padding-right: 2rem;
}

#muteButton, #cloudyToggleBtn {
  padding: 10px 12px;
  font-size: 1.2rem;
  border-radius: 50%;
  border: none;
  background-color: #a0a0a0;
  transition: background-color 0.2s ease;
}

#muteButton:hover, #cloudyToggleBtn:hover {
  background-color: #000000;
}

#timeSlider {
  width: 100%;
}

.home {
  user-select: none;
  font-weight: 300;
  font-style: italic;
  font-size: 6rem;
  text-transform: uppercase;
  color: rgb(255, 255, 255);
  text-decoration: none;
  transition: color 0.3s ease;
  line-height: 5.5rem;
  z-index: 999;
}

.arrow {
  background: none;
  border: none;
  color: rgb(255, 255, 255);
  font-size: 6rem;
  font-weight: 300;
  font-style: italic;
  text-transform: uppercase;
  line-height: 0.1rem;
  pointer-events: auto;
  display: inline-block;
  width: 6rem;
  height: 3rem;
  text-align: center;
  overflow: hidden;
}

.t_text{
  font-weight: 300;
  font-size: 1rem;
  font-style: italic;
  text-transform: uppercase;
  color: rgb(255, 255, 255);
  text-decoration: none;
  pointer-events: none;
}

nav{
  position: fixed;
  top: 2.2rem;
  margin-left: 1.9rem;
  display: flex;
  gap: 2rem;
  align-items:start;
  z-index: 9998;
}

.exp_intro{
  display: block;
}

.button{
  margin-top: 1rem;
}

.wrapper{
  width: 100%;
}

/* Base ring */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 20px; height: 20px;
  border: 2px solid currentColor; 
  border-radius: 50%;
  background: transparent;
  color: #ffffff;                       
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: color 150ms ease;
  z-index: 9999;
}

.cursor::after {
  content: '';
  position: absolute;
  top: -2px; left: -2px;            /* match ring stroke width */
  width: calc(100% + 4px);           /* expand under the ring */
  height: calc(100% + 4px);
  border-radius: 50%;
  background: transparent;
  transition: background 150ms ease, clip-path 150ms ease;
  z-index: 9998;                       /* behind the ring */
}

/* Hover state = half pie */
.cursor.hover::after {
  background: rgb(255, 255, 255) !important;
  clip-path: polygon(50% 0%,100% 0%,100% 100%,50% 100%);
  z-index: 9998;
}

/* Click state = full fill */
.cursor.clicked::after {
  background: currentColor;
  clip-path: none;
}

@media (max-width: 768px) {
  .control-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    max-height: 28vh;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    z-index: 10000;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch; /* smooth iOS scroll */
  }

  .control-panel > * {
    flex: 0 0 auto;
  }

  .wrapper {
    min-width: 160px;
    max-width: 240px;
  }

  .control-panel .slider {
    width: 80%;
  }

  .control-panel label {
    font-size: 0.85rem;
  }

  #mouseModeButtons {
    min-width: 200px;
    display: flex;
    gap: 8px;
    justify-content: space-around;
    margin: 10px 0;
  }

  #mouseModeButtons button {
    width: 60px;
    height: 60px;
    font-size: 0.6rem;
  }

  .m_container {
    min-width: 160px;
    display: flex;
    justify-content: space-evenly;
    margin-bottom: 0.6rem;
  }

  .s_container {
    display: flex;
    gap: 0.75rem;
    padding-right: 1rem;
  }

  #muteButton,
  #cloudyToggleBtn {
    padding: 8px 10px;
    font-size: 0.9rem;
    border-radius: 50%;
    border: none;
    background-color: #a0a0a0;
    transition: background-color 0.2s ease;
  }

  .home {
    font-size: 2.8rem;
    min-width: 44px;
    min-height: 44px;
  }

  .arrow {
    font-size: 2.8rem;
    min-width: 88px;
    min-height: 44px;
  }

  .t_text {
    font-size: 0.7rem;
  }

  nav {
    top: 1rem;
    margin-left: 1rem;
    gap: 1rem;
    width: calc(100vw - 2rem);
  }

  .exp_intro {
    width: calc(100vw - 4rem);
    display: flex;
    justify-content: space-between;
  }

  .button {
    margin-top: 0;
    width: 4.2rem;
  }

  .cursor {
    display: none;
  }
}

/* Extra small devices: specific overrides for very narrow screens (e.g., 320px and below) */
@media (max-width: 320px) {
  .wrapper,
  .m_container,
  #mouseModeButtons {
    min-width: 140px;
    max-width: 180px;
  }

  #mouseModeButtons button {
    width: 50px;
    height: 50px;
    font-size: 0.5rem;
  }

  .control-panel {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }

  .s_container {
    gap: 0.5rem;
    padding-right: 0.5rem;
  }

  .home,
  .arrow {
    font-size: 2.4rem;
  }

   #mouseModeButtons{
    margin-right: 2rem;
   }
}

@media (pointer: coarse) {
  .cursor {
    display: none;
  }
}
