:root{
  --accent-blue: #1d44b8;
  --nav-h: 48px;
  --footer-h: 54px;

  --scroll-top-gap: 10px;
  --scroll-bottom-gap: 10px;

  --fade-top: 90px;
  --fade-bottom: 90px;
}

/* --------------------------------------------------
   Base transparency and background
-------------------------------------------------- */

html {
  background: #fff !important;
}

body,
main,
.contentDecree,
.decree {
  background: transparent !important;
}

/* Scroll image */ 
body::before {
  content: "";
  position: fixed;
  top: calc(var(--nav-h) + var(--scroll-top-gap));
  bottom: calc(var(--footer-h) + var(--scroll-bottom-gap));
  left: 0;
  right: 0;
  background: url("/img/scroll-nobg.webp") no-repeat center top;
  background-size: 100% 100%;
  z-index: 0;
  pointer-events: none;
}

/* --------------------------------------------------
   NAVBAR
-------------------------------------------------- */

nav.w3-top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10000;
}

nav.w3-top .w3-bar {
  height: var(--nav-h);
  padding: 0 16px;
  background: #000;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
}

nav.w3-top .w3-bar a,
nav.w3-top .w3-bar .w3-bar-item {
  height: var(--nav-h);
  line-height: var(--nav-h);
  padding: 0 12px;
}

nav.w3-top .w3-dropdown-hover .w3-button {
  background: none !important;
  color: #fff !important;
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
}

nav.w3-top .w3-dropdown-hover .w3-button:hover {
  background: #fff !important;
  color: #000 !important;
}

.w3-dropdown-content {
  background: #fff !important;
  border: 1px solid #ccc;
  z-index: 10001;
}

#mobileMenu {
  display: none;
}
/* --------------------------------------------------
   Main layout
-------------------------------------------------- */

main {
  max-width: 1140px;
  margin: 0 auto;
  z-index: 1;
}

/* --------------------------------------------------
   Decree viewport
-------------------------------------------------- */

.contentDecree {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 150px;
  bottom: 140px;
  width: clamp(320px, 64vw, 880px);
  z-index: 2;
  overflow: hidden;
}

.contentDecree,
.contentDecree * {
  color: #000 !important;
}

/* --------------------------------------------------
   Scrolling text
-------------------------------------------------- */

.decree {
  height: 100%;
  overflow-y: auto;
  padding: var(--fade-top) 3px var(--fade-bottom) 50px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    black var(--fade-top),
    black calc(100% - var(--fade-bottom)),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    black var(--fade-top),
    black calc(100% - var(--fade-bottom)),
    transparent 100%
  );
}

.decree::-webkit-scrollbar {
  display: none;
}

.decree p {
  margin-bottom: 24px;
}

/* --------------------------------------------------
   Footer scroll controls
-------------------------------------------------- */

#scrollBar {
  position: fixed;
  inset: auto 0 0 0;
  height: var(--footer-h);
  background: #000;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  z-index: 1001;
}

/* --------------------------------------------------
   Controls
-------------------------------------------------- */

.slider-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.font-resizer label,
#speedValue {
  white-space: nowrap;
}

/* --------------------------------------------------
   SLIDERS
-------------------------------------------------- */

#scrollBar input[type="range"] {
  appearance: none;
  width: 120px;
  height: 8px;
  cursor: pointer;
  --fill: 0%;
  background: linear-gradient(
    to right,
    #fff 0%,
    #fff var(--fill),
    #666 var(--fill),
    #666 100%
  );
  border-radius: 5px;
}

#scrollBar input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  background: transparent;
}

#scrollBar input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  background: #fff;
  border: 2px solid var(--accent-blue);
  border-radius: 50%;
  margin-top: -5px;
}

#scrollBar input[type="range"]::-moz-range-track {
  height: 8px;
  background: #666;
  border-radius: 5px;
}

#scrollBar input[type="range"]::-moz-range-progress {
  height: 8px;
  background: #fff;
  border-radius: 5px;
}

#scrollBar input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #fff;
  border: 2px solid var(--accent-blue);
  border-radius: 50%;
}

/* --------------------------------------------------
   BUTTONS
-------------------------------------------------- */

#scrollBar #incrementSpeed,
#scrollBar #decrementSpeed {
  width: 34px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #666;
  border-radius: 3px;
  color: var(--accent-blue);
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

#scrollBar #incrementSpeed:hover,
#scrollBar #decrementSpeed:hover {
  background: var(--accent-blue);
  color: #fff;
}

#scrollToggle {
  height: 30px;
  padding: 0 12px;
  background: #3f3f3f;
  border: 1px solid #666;
  border-radius: 3px;
  color: #fff;
  cursor: pointer;
}

#scrollToggle:hover {
  background: var(--accent-blue);
}

/* --------------------------------------------------
   RESPONSIVE
-------------------------------------------------- */

@media (max-width: 800px) {
  #scrollBar {
    flex-direction: column;
    height: auto;
    padding: 10px;
    gap: 10px;
  }

  #scrollBar input[type="range"] {
    width: 140px;
  }
}

@media (max-width: 600px) {
  #scrollBar input[type="range"] {
    width: 100px;
  }
}

/* --------------------------------------------------
   Misc
-------------------------------------------------- */

.extraSpace {
  padding-top: 200px;
}

.colorChange a {
  text-decoration: none;
}

.colorChange a:hover {
  color: var(--accent-blue);
}
