/* @link https://utopia.fyi/type/calculator?c=320,16,1.2,1440,20,1.25,8,2,1024-768-393&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12 */
:root {
  --step--2: clamp(0.6944rem, 0.6643rem + 0.1508vw, 0.8rem);
  --step--1: clamp(0.8333rem, 0.7857rem + 0.2381vw, 1rem);
  --step-0: clamp(1rem, 0.9286rem + 0.3571vw, 1.25rem);
  --step-1: clamp(1.2rem, 1.0964rem + 0.5179vw, 1.5625rem);
  --step-2: clamp(1.44rem, 1.2934rem + 0.733vw, 1.9531rem);
  --step-3: clamp(1.728rem, 1.5242rem + 1.0192vw, 2.4414rem);
  --step-4: clamp(2.0736rem, 1.7941rem + 1.3974vw, 3.0518rem);
  --step-5: clamp(2.4883rem, 2.1094rem + 1.8948vw, 3.8147rem);
  --step-6: clamp(2.986rem, 2.4767rem + 2.5463vw, 4.7684rem);
  --step-7: clamp(3.5832rem, 2.904rem + 3.3961vw, 5.9605rem);
  --step-8: clamp(4.2998rem, 3.3996rem + 4.5011vw, 7.4506rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
  cursor: url('../img/cursor32.png') 16 16, crosshair;
  touch-action: none;
}

#loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  transition: opacity 0.5s ease;
}

#loader.hidden {
  opacity: 0;
  pointer-events: none;
}

#loader-spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: #fff;
  animation: loader-spin 0.8s linear infinite;
}

@keyframes loader-spin {
  to { transform: rotate(360deg); }
}

#site-title {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  margin: 0;
  font-family: 'Stefan', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: var(--step-3);
  letter-spacing: 0.03em;
  color: #fff;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#site-title.hidden {
  opacity: 0;
}

#bg {
  position: fixed;
  inset: 0;
  background-image: url('../img/bgImage.png');
  background-size: cover;
  background-position: center;
  z-index: 0;
}

#stage {
  position: fixed;
  inset: 0;
  z-index: 1;
}

#dudes-canvas {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 99vh;
  display: block;
  pointer-events: none;
  z-index: 2;
}

#face-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(80vh, 110vw);
  height: min(80vh, 110vw);
  display: block;
  mix-blend-mode: hard-light;
  filter: url(#face-turb);
  pointer-events: none;
  z-index: 3;
}

#vignette {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
  z-index: 8;
  display:none;
}

#grain {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: 0.15;
  mix-blend-mode: overlay;
  z-index: 9;
}

#controls {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 16px 20px;
  color: #fff;
  font-family: monospace;
  font-size: 11px;
  flex-direction: column;
  gap: 10px;
  min-width: 220px;
}

#controls label { display: flex; flex-direction: column; gap: 3px; }

#controls .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#controls input[type=range] { width: 100%; accent-color: #f60; cursor: pointer; }

#controls input[type=number] {
  width: 60px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  color: #fff;
  font-family: monospace;
  font-size: 11px;
  padding: 2px 5px;
  text-align: right;
}

#controls input[type=number]::-webkit-inner-spin-button { opacity: 0.4; }

#controls .section-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
