:root {
    --gradient_color1: rgb(86, 10, 121);
    --gradient_color2: rgb(177, 190, 57);
    --clock_color: rgb(23,59,59);
    --srv-color-primary: 33 150 243;
}

/* Page background: a 3-viewport-wide gradient strip slid with transform.
   Equivalent to the old background-position pan (same colours, same 5s loop),
   but it is composited on the GPU instead of repainting the whole screen every frame. */
@keyframes background-pan {
    from { transform: translateX(0); }
    to   { transform: translateX(-66.6667%); }
}

body {
    height: 100vh;
    margin: 0px;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 300vw;
    z-index: -1000;
    background: linear-gradient(to right,
        var(--gradient_color1),
        var(--gradient_color2) 33.3333%,
        var(--gradient_color1) 66.6667%,
        var(--gradient_color2));
    animation: background-pan 5s linear infinite;
    will-change: transform;
    pointer-events: none;
}

.menu{
    height: 5vh;
    width: 100vw;
    background: black;
    margin:0;
    padding: 0%;
	display:flex;
	 align-items: center; /* Add this line to vertically center items */
}
#logobg{
	background: linear-gradient(to right, rgb(27, 27, 27), black);
	width:8vh;
	height:100%;
}

#logo {
    position: relative;
    padding-left: 0.25vw;
	padding-bottom:0.25vw;
    height: 4vh;
    aspect-ratio: 1 / 1;
    user-select: none;
    margin:0;
  }
  
  #logo > img {
    width: 100%;
    position: absolute;
  }
  
  #clock {
    position:relative;
    margin:0;
    float:right;
    /*vertical center*/
    top: 50%;
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);  
    /*/vertical center*/
    width: 15vw;
  }

  #hackable{
  font-family: 'Space Mono', monospace;
  font-size: clamp(1.5rem, 5vw, 5rem);
  color: white;
  padding: 0rem clamp(1rem, 2vw, 3rem);
  border-radius: clamp(0.4rem, 0.75vw, 1rem);
  }
  #hackable:hover {
    background-color: white;
    color: black;
  }

#maindiv{
    display: grid;
    place-items: left;
    width:fit-content;
    height:fit-content;
    margin: 0;
    overflow: hidden;
    color: white;
  }

  #tiles {
    height: calc(95vh - 1px);
    width: calc(100vw - 0.5px);
    position: absolute;
    top:calc(5vh + 0.5px);
    z-index: -999;
    display: grid;
    grid-template-columns: repeat(var(--columns), 1fr);
    grid-template-rows: repeat(var(--rows), 1fr);
  }
  
  .tile {
    position: relative;
  }
  
  .tile:before {
    background-color: rgb(0, 0, 0);
    content: "";
    inset: 0.5px;
    position: absolute;
    z-index: -998
  }

  .srv-container {
    width: 25vh;
    display: flex;
    background-color: rgb(0, 0, 0);
    /*
    border: 3px solid rgb(var(--srv-color-primary) / 80%);*/
    /*background-color: rgb(var(--srv-color-primary) / 15%);*/
    overflow: hidden;
    position: relative;
    z-index: 1;
    width: calc(var(--columns) / 3 * 100%); /* Takes 3 grids of width */
    height: var(--tile-height); /* Takes 1 grid height */
    position: absolute;
    right: 1px; /* Touches the right side of the screen */
    container-type: size; /* lets .srv-bg img use cqw/cqh units in its animation */
  }
  
  .srv-container:after,
  .srv-container:before {
    content: "";
    height: 5px;
    position: absolute;
    z-index: -750;
    left: 50%;
    translate: -50% 0%;
    background-color: white;
  }
  
  .srv-container:before {
    width: 15%;
    top: 0;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
  }
  
  .srv-container:after {
    width: 25%;
    bottom: 0;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
  }
  
  /* Scanlines: the pattern repeats every 9px, so sliding the (taller) layer by
     exactly 10 periods (90px) loops seamlessly. Transform only, no repaint. */
  @keyframes pan-overlay {
    from { transform: translateY(0); }
    to   { transform: translateY(-90px); }
  }
  
  .srv-overlay {    
    background: linear-gradient(
      rgb(var(--srv-color-primary) / 0.15),
      rgb(var(--srv-color-primary) / 0.15) 3px,
      transparent 3px,
      transparent 9px
    );
    background-size: 100% 9px;
    height: calc(100% + 90px);
    width: 100%;
    animation: pan-overlay 22s infinite linear;
    will-change: transform;
    position: absolute;
    z-index: -600;
    left: 0px;
    top: 0px;
  }
  
  /* Background image pan/zoom, rewritten from background-position/background-size
     to transforms. The <img> is laid out at 500% of the container width (the largest
     zoom), and each step is scale(S/5) plus a translate that reproduces the old
     background-position:
       x = -(S-1) * posX * 100cqw
       y = posY * 100cqh - scale * posY * 100%   (100% = the image's own height)
     Stops: (S=3 -> scale 0.6) and (S=5 -> scale 1). */
  @keyframes pan-image {  
    0% {
      transform: translate(-72cqw, calc(42cqh - 25.2%)) scale(0.6);
    }
    
    20% {
      transform: translate(-60cqw, calc(35cqh - 21%)) scale(0.6);
    }
    
    20.0001% { /* -- View 2 -- */
      transform: translate(-240cqw, calc(85cqh - 85%)) scale(1);
    }
    
    40% {
      transform: translate(-196cqw, calc(81cqh - 81%)) scale(1);
    }
    
    40.0001% { /* -- View 3 -- */
      transform: translate(-160cqw, calc(42cqh - 25.2%)) scale(0.6);
    }
    
    60% {
      transform: translate(-168cqw, calc(33cqh - 19.8%)) scale(0.6);
    }
    
    60.0001% { /* -- View 4 -- */
      transform: translate(0cqw, calc(0cqh - 0%)) scale(0.6);
    }
    
    80% {
      transform: translate(-30cqw, calc(4cqh - 2.4%)) scale(0.6);
    }
    
    80.0001% { /* -- View 5 -- */
      transform: translate(-160cqw, calc(10cqh - 6%)) scale(0.6);
    }
    
    100% {
      transform: translate(-144cqw, calc(14cqh - 8.4%)) scale(0.6);
    }
  }
  
  .srv-container > .srv-bg {
    height: 100%;
    width: 100%;
    position: absolute;
    z-index: -550;
    left: 0px;
    top: 0px;
    overflow: hidden;
    filter: sepia(100%) hue-rotate(160deg);
    opacity: 0.6;
  }

  .srv-bg > img {
    position: absolute;
    left: 0;
    top: 0;
    width: 500cqw;
    max-width: none;
    height: auto;
    transform-origin: 0 0;
    animation: pan-image 15s linear infinite;
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
  }

@media (prefers-reduced-motion: reduce) {
  body::before,
  .srv-overlay,
  .srv-bg > img {
    animation: none;
  }
}

/* Add styles for the text */
.srcontent-container {
  width: 96%;
  position: absolute;
  left: 2%;
  right: 2%;
  top: 5px;
  bottom: 5px;
}

.srlefttext{
  position: relative;
  float:left;
  transform: translateY(-50%);
  top:50%;
}
.srtitle {
  padding:0;
  margin:0;
  line-height: 75%;
  font-size: 200%; /* Use a responsive font size based on viewport width (adjust as needed) */
  color: white;
  /* Add a 1-pixel black text outline */
  text-shadow: -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black, 1px 1px 0 black;
}
.srversion {
  margin:0;
  font-size: 100%; /* Use a responsive font size based on viewport width (adjust as needed) */
  color: white;
  /* Add a 1-pixel black text outline */
  text-shadow: -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black, 1px 1px 0 black;
}
.srmotd{
  margin:0;
  font-size: 100%; /* Use a responsive font size based on viewport width (adjust as needed) */
  color: white;
  /* Add a 1-pixel black text outline */
  text-shadow: -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black, 1px 1px 0 black;
}

.srv-icon {
  position: relative;
  float:left;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
}

.srrighttext{
  position:absolute;
  float:right;
  text-align: right;
  font-size: 100%; /* Use a responsive font size based on viewport width (adjust as needed) */
  color: white;
  /* Add a 1-pixel black text outline */
  text-shadow: -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black, 1px 1px 0 black;
}

.srpng{
  position:relative;
  vertical-align:middle;
  bottom: 1px;
  width: 6%;
  aspect-ratio: 10 / 7;
}

@media (pointer: coarse), (hover: none) {
  [title] {
    position: relative;
    display: inline-flex;
    justify-content: center;
  }
  [title]:focus::after {
    content: attr(title);
    position: absolute;
    top: 90%;
    color: #000;
    background-color: #fff;
    border: 1px solid;
    width: fit-content;
    padding: 3px;
    font-size: 10px;
  }

}
#Toplink1 {
    color: white;
    margin: 0;
	height:100%;
    display: flex;
    align-items: center;
    background: linear-gradient(to right, black, rgb(27, 27, 27), black); /* Initial gradient with transparency */
    transition: background 0.3s ease; /* Add transition for a smooth effect */
    text-decoration: none; /* Remove default link underline */
	font-size:20px;
}

#Toplink1:hover {
    background: linear-gradient(to right, black, rgb(50, 50, 50),black); /* Hover gradient with transparency */
	font-size:22px;
}
#Toplink1 a:link,
#Toplink1 a:visited {
    color: white; /* Set the color for unvisited and visited links */
    text-decoration: none; /* Remove underline for both states */
}

#Toplink1 a:hover {
    color: white; /* Set the color for the link when hovered (if needed) */
}