:root {
  --bg: #d3d3d3;
  --stage: #d3d3d3;
  --box: #ffffff00;
  --accent: #ffffff;
  --accent2: #e2e2e2;
  --ink: #000000;
  --muted: #555555;
  --backdrop: #ffffff4a;
  --linkhover: #000dff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Roboto', -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

#loadingscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Roboto', sans-serif;
  color: var(--ink);
}

#loadingscreen.hidden {
  display: none;
}

body.loading {
  overflow: hidden;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  background: var(--stage);
  overflow: hidden;
  cursor: default;
}

.box {
  position: absolute;
  background: var(--box);
  border: 1px solid var(--ink);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 2px 3px;
  will-change: left, top, width, height, opacity;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.box:hover { border-width: 2px; z-index: 5; }

.box.attracted {
  border-width: 2px;
  z-index: 8;
}

.box.active {
  border: none;
  background: var(--ink);
  z-index: 10;
}

/* brief flash on each rhythmic retrigger: invert to white */
.box.active.tick {
  background: var(--stage);
  outline: 1px solid var(--ink);
}
.box.active.tick .label { color: var(--ink); }

.label {
  font-size: 8px;
  line-height: 1;
  color: var(--ink);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.box.active .label { color: #ffffff; font-weight: 700; pointer-events: auto; }

.label[contenteditable="true"] {
  outline: none;
  pointer-events: auto;
  background: var(--accent2);
}

/* volume fader styles */

#volume-fader {
  position: fixed;
  top: 40px;
  right: 40px;
  z-index: 300;
  width: 40px;
  height: 180px;
  background: var(--accent2);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px;
  padding-bottom: 0px; 
  gap: 0px;
  box-sizing: border-box;
  user-select: none;
  touch-action: none;
}

.fader-track {
  position: relative;
  width: 20px;
  flex: 1;
  border: 1px solid var(--ink);
  background: #d9d9d9;
  cursor: pointer;
  touch-action: none;
}

.fader-thumb {
  position: absolute;
  left: -3px;
  width: calc(100% + 6px);
  height: 4px;
  background: var(--ink);
  transform: translateY(-50%);
  pointer-events: none; 
}

.fader-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fader-icon svg {
  width: 65%;
  height: 65%;
  display: block;
}

#volume-fader.hidden {
  display: none;
}

/*copyright-overlay*/

#copyright-overlay {
  position: fixed;
  bottom: 10px;
  right: 40px;
  z-index: 300;
  background: var(--accent2);
  font-family: 'Roboto', sans-serif;
  font-weight: 327;
  font-stretch: 75%;
  font-size: 12px;
  line-height: 1.0;
}

#copyright-overlay.hidden {
  display: none;
}

/*popup overlay*/

#popup-box h2 {
  font-family: 'Roboto', sans-serif;
  font-weight: 327;
  font-stretch: 75%;
  font-size: 14px;
  line-height: 1.0;
  margin: 0 0 16px 0;
  text-transform: none;
  text-decoration: underline;
}

#popup-box h3 {
  font-family: 'Roboto', sans-serif;
  font-weight: 327;
  font-stretch: 75%;
  font-size: 12px;
  line-height: 1.0;
  margin: 0 0 8px 0;
  text-transform: none;
  text-decoration: underline;
}

#popup-box a {
  color: var(--ink);
  text-decoration: underline;
}

#popup-box a:hover {
  color: var(--linkhover);
}

#popup-box p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink); 
  margin: 0 0 10px 0;
}

#popup-box p2 {
  font-size: 10px;
  line-height: 1.5;
  color: var(--ink); 
  margin: 0;
}

#popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0); /* change to 0.8 for a semi-transparent black overlay */
  z-index: 1000;
  display: flex;
  align-items: center; 
  justify-content: center;
}

#popup-box {
  background: var(--backdrop);
  color: var(--ink);
  width: 400px;
  max-width: 90%;
  padding: 32px;
  position: relative;
  font-family: 'Roboto', sans-serif;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px); 
  border:#000000 0px solid;
  border-radius: 10px;
  box-shadow: 0 4px 30px rgb(0, 0, 0);

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: left;
}

#popup-close {
  position: absolute;
  font-family: 'Roboto', sans-serif;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #000000;
  line-height: 1;
}

#popup-overlay.hidden {
  display: none;
}

/* Responsive adjustments for mobile */

@media (max-width: 768px) {

  #site-nav a,
  #site-nav span {
    width: 100px;
    font-size: 14px;
  }

  #volume-fader {
    top: 16px;
    bottom: auto;
    right: 16px;
    width: 50px;
    height: 170px;
  }

  .fader-track {
    width: 30px;
  }

  #popup-box {
    width: 320px;
    padding: 35px;
    flex-direction: column;
    text-align: left;
  }

  #copyright-overlay {
    left: 10;
    bottom: 10;
  }

}
