@import url("https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap");

:root {
  --color-bg: #ffffff; /* Off-black */
  --color-text: #2c1313; /* Off-white */
  --color-dark: #1a1a1a; /* Slightly lighter than background */
  --color-light: #e0e0e0; /* Slightly darker than text */

  --font-primary: "Space Mono", monospace;
  --font-size-massive: clamp(10rem, 10vw, 30rem);
  --grid-size: 50px;
  --transition-speed: 500ms;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-bg);
  color: #524d7d;
  overflow: hidden;
  height: 100vh;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Preloader */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--color-bg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Pixel Grid */
.pixel-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.pixel-row,
.pixel-column {
  position: absolute;
  background-color: var(--color-text);
  opacity: 0.1;
}

.pixel-row {
  height: 1px;
  width: 0%;
  left: 0;
}

.pixel-column {
  width: 1px;
  height: 0%;
  top: 0;
}

#top-row {
  top: 20%;
}

#bottom-row {
  bottom: 20%;
}

#left-column {
  left: 20%;
}

#right-column {
  right: 20%;
}



/* Counter */
.counter-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  width: 100%;
  text-align: center;
}

.counter {
  font-size: var(--font-size-massive);
  font-weight: 700;
  line-height: 0.8;
  color: #524d7d;
  position: relative;
  display: inline-block;
}

.counter-outline {
  font-size: var(--font-size-massive);
  font-weight: 700;
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px rgba(245, 245, 245, 0.1);
  position: absolute;
  top: 5px;
  left: 5px;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Loading Text */
.text-container {
  position: absolute;
  top: 2rem;
  left: 2rem;
  z-index: 10;
}

.loading-text {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.system-messages {
  font-size: 1rem;
  font-weight: normal;
  line-height: 1.5;
  opacity: 0.8;
  height: 1.5em; /* Fixed height to prevent layout shift */
  overflow: hidden;
}

.message {
  display: none;
  opacity: 0;
  transform: translateY(10px); /* Slight movement effect */
  transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.message.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}


/* Loading Bar */
.loading-bar-container {
  position: absolute;
  bottom: 3rem;
  left: 2rem;
  right: 2rem;
  z-index: 10;
}

.loading-bar {
  height: 3px;
  width: 100%;
  background-color: rgba(245, 245, 245, 0.1);
  margin-bottom: 10px;
  position: relative;
}

.progress {
  height: 100%;
  width: 0%;
  background-color: #524d7d;
  transition: width var(--transition-speed) cubic-bezier(0.23, 1, 0.32, 1);
}

.loading-bar-markers {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 0.8rem;
  opacity: 0.6;
  position: relative;
}

.marker {
  position: relative;
  padding-top: 10px;
  transition: opacity 0.3s ease;
}

.marker::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 5px;
  background-color: #524d7d;
}

/* Connector lines between markers */
.connector-lines {
  position: absolute;
  top: 0;
  width: 100%;
}

.connector-line {
  position: absolute;
  top: -12px;
  height: 1px;
  background-color: #524d7d ;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform var(--transition-speed) cubic-bezier(0.23, 1, 0.32, 1);
}

#line-0-25 {
  left: 0%;
  width: 25%;
}

#line-25-50 {
  left: 25%;
  width: 25%;
}

#line-50-75 {
  left: 50%;
  width: 25%;
}

#line-75-100 {
  left: 75%;
  width: 25%;
}



/* Media queries for responsive design */
@media (max-width: 768px) {
  .text-container {
    top: 1rem;
    left: 1rem;
  }

  .loading-bar-container {
    bottom: 2rem;
    left: 1rem;
    right: 1rem;
  }

  .loading-text {
    font-size: 1.5rem;
  }

  .system-messages {
    font-size: 0.8rem;
  }

  #block-1,
  #block-2,
  #block-3,
  #block-4 {
    width: 25vw;
    height: 25vw;
  }
}