/* mroczne portfolio — kształty nakładające się, półprzezroczyste */

:root {
  --bg-0: #07080a;
  --bg-1: #0d0f12;
  /* wypełnienie pod kształtem: rgba — alpha = 0.5 (półprzezroczyste, widać krawędzie sąsiadów) */
  --fill-shape: rgba(28, 31, 36, 0.5);
  --fill-shape-hover: rgba(40, 44, 50, 0.62);
  --text-hover: #aab0b8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-0);
  color: #c0c4cc;
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  overflow: hidden;
  cursor: default;
}

body {
  background:
    radial-gradient(ellipse at 50% 50%, var(--bg-1) 0%, var(--bg-0) 70%, #000 100%);
}

#stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  perspective: 1000px;
}

.shape {
  position: absolute;
  top: 0;
  left: 0;
  /* obrót aplikowany przez zmienne CSS — paralaksa nadpisuje translate3d */
  --tx: 0px;
  --ty: 0px;
  --rot: 0deg;
  transform: translate3d(var(--tx), var(--ty), 0) rotate(var(--rot));
  will-change: transform;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  /* domyślny z-index ustawiamy z JS (data-z) */
}

.shape svg {
  display: block;
  overflow: visible;
  transition: filter 420ms ease;
  filter: drop-shadow(0 0 0 rgba(0,0,0,0));
  width: 100%;
  height: 100%;
}

.shape:hover svg,
.shape.is-top svg {
  filter: drop-shadow(0 0 18px rgba(180, 190, 210, 0.22));
}

.shape .face {
  fill: var(--fill-shape);
  transition: fill 420ms ease;
}

.shape:hover .face,
.shape.is-top .face {
  fill: var(--fill-shape-hover);
}

.shape .outline {
  fill: none;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  opacity: 0.9;
}

/* etykieta — kompensujemy obrót, żeby tekst zawsze był czytelny */
.shape .label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 14%;
  pointer-events: none;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  line-height: 1.35;
  color: var(--text-hover);
  font-style: italic;
  opacity: 0;
  transform: rotate(calc(-1 * var(--rot))) translateY(4px);
  transform-origin: 50% 50%;
  transition: opacity 480ms ease, transform 480ms ease;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.shape:hover .label,
.shape.is-top .label {
  opacity: 1;
  transform: rotate(calc(-1 * var(--rot))) translateY(0);
}

/* puls krawędzi */
@keyframes drift {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}