/* Volkin Reborn — Base: Scrollbar + Global Background */

/* ========================================
   2. CUSTOM SCROLLBAR
   Szeroki, unoszący się nad layoutem
   ======================================== */
::-webkit-scrollbar {
  width: 28px;
}

::-webkit-scrollbar-track {
  background: transparent;
  margin: 100px 0 80px 0;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #CACFFF 0%, #4488EF 20%, #6B8BFF 80%, #2656DC 100%);
  border-radius: 20px;
  /* Odsunięcie od krawędzi - przezroczysta ramka */
  border: 6px solid transparent;
  background-clip: padding-box;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.3),
    0 0 20px rgba(68, 136, 239, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.15);
}

::-webkit-scrollbar-thumb:hover {
  border-width: 5px;
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.4),
    0 0 30px rgba(68, 136, 239, 0.5),
    0 6px 16px rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb:active {
  border-width: 4px;
}

html {
  scrollbar-width: auto;
  scrollbar-color: #4488EF transparent;
}


/* ========================================
   3. GLOBALNE TŁO
   ======================================== */
.bg-global {
  background:
    /* Blueprint grid — duża siatka (czarna w light) */
    linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    /* Blueprint grid — mała siatka */
    linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px),
    /* Bazowy kolor */
    var(--bg-global);
  background-size:
    80px 80px,
    80px 80px,
    16px 16px,
    16px 16px,
    100% 100%;
  background-attachment: fixed;
  min-height: 100vh;
  position: relative;
}

/* Winieta — siatka zanika przy krawędziach */
.bg-global::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, transparent 30%, var(--bg-global) 100%);
}

/* Cursor glow na tle głównym */
.bg-global-glow {
  position: fixed;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(68, 136, 239, 0.07) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  transform: translate(-50%, -50%);
  z-index: 0;
  filter: blur(30px);
}

.dark .bg-global-glow {
  background: radial-gradient(circle, rgba(68, 136, 239, 0.1) 0%, transparent 70%);
}

.dark .bg-global {
  background:
    /* Blueprint grid — biała w dark */
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    var(--bg-global);
  background-size:
    80px 80px,
    80px 80px,
    16px 16px,
    16px 16px,
    100% 100%;
  background-attachment: fixed;
}

/* iOS Safari: fixed background-attachment causes jank */
@media (max-width: 768px) {
  .bg-global,
  .dark .bg-global {
    background-attachment: scroll;
  }
}

/* Efekt fade na górze strony */
.page-fade-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: linear-gradient(
    to bottom,
    rgba(240, 242, 245, 0.7) 0%,
    rgba(240, 242, 245, 0.4) 20%,
    rgba(240, 242, 245, 0.15) 50%,
    rgba(240, 242, 245, 0) 100%
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  mask-image: linear-gradient(to bottom, black 0%, black 30%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 30%, transparent 100%);
  pointer-events: none;
  z-index: var(--z-sticky);
}

/* Efekt fade na dole strony - dynamiczny (JS kontroluje opacity) */
.page-fade-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 150px;
  background: linear-gradient(
    to top,
    rgba(240, 242, 245, 0.7) 0%,
    rgba(240, 242, 245, 0.4) 20%,
    rgba(240, 242, 245, 0.15) 50%,
    rgba(240, 242, 245, 0) 100%
  );
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  mask-image: linear-gradient(to top, black 0%, black 30%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, black 0%, black 30%, transparent 100%);
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: var(--z-sticky);
}


