/* ═══════════════════════════════════════════
   SKITSEHANDLEN — Æterisk & Monokrom Version
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300;1,400&display=swap');

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: none;
  font-family: 'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;
  background: #0a0a0a;
}

/* ── Custom cursor ── */
#cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease, border-color 0.5s ease, opacity 0.5s ease;
  mix-blend-mode: difference;
  opacity: 0.6;
}

#cursor.hovering {
  width: 50px;
  height: 50px;
  border-color: rgba(255, 255, 255, 0.4);
  opacity: 0.3;
}

/* ── Particle canvas ── */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* ── Background gradient — monochrome, subtle ── */
#bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(30, 30, 30, 0.4) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(20, 20, 20, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(25, 25, 25, 0.2) 0%, transparent 50%),
    #0a0a0a;
  animation: bgShift 40s ease-in-out infinite alternate;
}

@keyframes bgShift {
  0% {
    background:
      radial-gradient(ellipse at 20% 50%, rgba(30, 30, 30, 0.4) 0%, transparent 60%),
      radial-gradient(ellipse at 80% 20%, rgba(20, 20, 20, 0.3) 0%, transparent 50%),
      radial-gradient(ellipse at 50% 80%, rgba(25, 25, 25, 0.2) 0%, transparent 50%),
      #0a0a0a;
  }
  50% {
    background:
      radial-gradient(ellipse at 70% 30%, rgba(25, 25, 25, 0.4) 0%, transparent 60%),
      radial-gradient(ellipse at 30% 70%, rgba(35, 35, 35, 0.3) 0%, transparent 50%),
      radial-gradient(ellipse at 60% 20%, rgba(20, 20, 20, 0.2) 0%, transparent 50%),
      #0a0a0a;
  }
  100% {
    background:
      radial-gradient(ellipse at 50% 60%, rgba(35, 35, 35, 0.4) 0%, transparent 60%),
      radial-gradient(ellipse at 20% 30%, rgba(20, 20, 20, 0.3) 0%, transparent 50%),
      radial-gradient(ellipse at 80% 70%, rgba(30, 30, 30, 0.2) 0%, transparent 50%),
      #0a0a0a;
  }
}

/* ── Floating artwork containers ── */
.artwork {
  position: absolute;
  z-index: 5;
  cursor: none;
  will-change: transform, opacity;
  transition: filter 0.8s ease, opacity 0.8s ease;
  opacity: 0;
  animation: fadeInArtwork 2s ease forwards;
}

@keyframes fadeInArtwork {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.artwork-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  overflow: hidden;
  box-shadow:
    0 0 40px rgba(0, 0, 0, 0.8),
    0 0 80px rgba(0, 0, 0, 0.4);
  transition: box-shadow 0.8s ease, filter 0.8s ease;
}

.artwork:hover .artwork-inner {
  box-shadow:
    0 0 50px rgba(255, 255, 255, 0.06),
    0 0 100px rgba(255, 255, 255, 0.03),
    0 0 150px rgba(0, 0, 0, 0.5);
  filter: blur(0px);
}

.artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  filter: grayscale(100%) contrast(0.9) brightness(0.85);
  transition: filter 0.8s ease;
}

.artwork:hover img {
  filter: grayscale(100%) contrast(1) brightness(0.95);
}

/* ── RGB Split → Monochrome shadow layers ── */
.artwork .rgb-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  transition: opacity 0.6s ease;
  filter: grayscale(100%) brightness(0.5);
}

.artwork:hover .rgb-layer.red {
  opacity: 0.3;
  transform: translate(-3px, -1px);
  filter: grayscale(100%) brightness(0.6);
}

.artwork:hover .rgb-layer.blue {
  opacity: 0.3;
  transform: translate(3px, 1px);
  filter: grayscale(100%) brightness(0.4);
}

/* ── Glitch effect — monochrome ── */
.artwork.glitching {
  animation: glitchMono 0.9s steps(3) forwards;
}

@keyframes glitchMono {
  0%   { filter: grayscale(100%) brightness(1) contrast(1); clip-path: inset(0 0 0 0); }
  10%  { filter: grayscale(100%) brightness(2) contrast(2); clip-path: inset(20% 0 30% 0); transform: translate(3px, -2px); }
  20%  { filter: grayscale(100%) brightness(0.3) contrast(3); clip-path: inset(50% 0 10% 0); transform: translate(-3px, 2px); }
  30%  { filter: grayscale(100%) invert(1) brightness(0.8); clip-path: inset(10% 0 60% 0); transform: translate(2px, 3px); }
  40%  { filter: grayscale(100%) brightness(1) contrast(1); clip-path: inset(0 0 0 0); transform: translate(0, 0); }
  50%  { filter: grayscale(100%) brightness(3); clip-path: inset(30% 10% 20% 5%); }
  60%  { filter: grayscale(100%) contrast(4); clip-path: inset(0 0 0 0); }
  70%  { filter: grayscale(100%) invert(1) brightness(0.5); clip-path: inset(40% 0 20% 0); transform: translate(-5px, 0); }
  80%  { filter: grayscale(100%) brightness(1.5) contrast(1.5); clip-path: inset(0 0 0 0); transform: translate(0, 0); }
  90%  { filter: grayscale(100%) brightness(0.5); clip-path: inset(15% 5% 25% 10%); }
  100% { filter: grayscale(100%) contrast(0.9) brightness(0.85); clip-path: inset(0 0 0 0); transform: translate(0, 0); }
}

/* ── Kaleidoscope canvas ── */
#kaleidoscope-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease;
}

#kaleidoscope-canvas.active {
  opacity: 1;
}

/* ── HUD / Controls info — nearly invisible ── */
#hud {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  color: rgba(255, 255, 255, 0.15);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: lowercase;
  text-align: center;
  pointer-events: none;
  transition: opacity 1s;
  line-height: 2;
  font-style: italic;
}

#hud span {
  display: inline-block;
  margin: 0 12px;
  opacity: 0.5;
}

#hud .separator {
  opacity: 0.15;
}

/* ── Title — serif, ethereal ── */
#title {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  color: rgba(255, 255, 255, 0.08);
  font-size: 16px;
  letter-spacing: 12px;
  text-transform: lowercase;
  pointer-events: none;
  white-space: nowrap;
  font-weight: 300;
  font-style: italic;
}

/* ── Loading screen ── */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 1.5s ease, visibility 1.5s;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
}

#loader h1 {
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  letter-spacing: 12px;
  text-transform: lowercase;
  font-weight: 300;
  font-style: italic;
  margin-bottom: 40px;
}

#loader .progress-bar {
  width: 160px;
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0;
  overflow: hidden;
}

#loader .progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0.1), rgba(255,255,255,0.3), rgba(255,255,255,0.1));
  transition: width 0.5s ease;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  #hud {
    font-size: 8px;
    bottom: 10px;
    letter-spacing: 1px;
  }

  #title {
    font-size: 11px;
    letter-spacing: 6px;
    top: 15px;
  }

  #cursor {
    display: none;
  }

  html, body {
    cursor: auto;
  }
}

@media (max-width: 480px) {
  #hud {
    display: none;
  }
}
