/* --- GENERAL --- */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #ffffff;
  font-family: 'Work Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* --- HEADER + NAV --- */
header {
  position: fixed;
  top: 2rem;
  left: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  z-index: 10;
}

.site-title {
  color: #000;
  font-weight: 400;
  font-size: 1.5rem;
  margin-bottom: 10rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  
}

.site-title-wrapper {
  position: relative;
  display: inline-block;
}

.blinking-square {
  position: absolute;
  top: 1.5rem;
  left: 10rem;
  width: 10px;
  height: 12px;
  background-color: black;
  animation: blink 2s steps(1) infinite;
}

@keyframes blink {
  0%, 50% { visibility: visible; }
  51%, 100% { visibility: hidden; }
}

nav {
  display: flex;
  flex-direction: column;
  gap: 10rem;
}

nav a {
  position: relative;
  font-family: 'Roboto Mono', monospace;
  display: inline-block;
  transform: rotate(-90deg);
  transform-origin: left top;
  color: #000;
  text-decoration: none;
  font-size: 0.6rem;
  letter-spacing: 2px;
  opacity: 0.5;
  transition: opacity 0.25s ease;
  will-change: opacity;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

nav a:hover {
  opacity: 1;
}

nav a::before {
  content: ">";
  display: inline-block;
  margin-right: 0.3rem;
  font-weight: bold;
  color: transparent;
}

nav a:hover::before {
  color: black;
}

nav a::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 100%;
  color: rgba(0, 0, 0, 0.2);
  transform: rotate(-180deg);
  font-size: 0.6rem;
  letter-spacing: 2px;
  opacity: 0;
  transition: opacity 0.3s, top 0.3s;
  pointer-events: none;
}

nav a:hover::after {
  opacity: 1;
  top: 105%;
}

/* ABOUT LINK (GLOBAL) */
.about-link {
  position: fixed;
  top: 20rem;
  right: 2rem;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 2px;
  color: #000;
  text-decoration: none;
  user-select: none;
}

.about-link::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0%;
  height: 1px;
  background-color: black;
  transition: width 0.15s ease-in-out;
}

.about-link:hover::after {
  width: 95%;
}

.about-link.active {
  opacity: 0.5;
}

.about-link.active::after {
  width: 95%;
  background-color: black;
}

/* PROGRESS BAR */
#progress-bar {
  position: absolute;
  top: 3rem;
  left: 0rem;
  height: 3px;
  width: 0%;
  background-color: black;
}

/* --- ASCII BACKGROUND --- */
#horizonCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
}

.ascii-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  text-align: center;
}

#ascii-container {
  font-family: 'Share Tech Mono', monospace;
  white-space: pre;
  color: rgb(0, 0, 0);
  line-height: 1;
  font-size: 0.45vw;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* --- FOOTER --- */
footer {
  position: fixed;
  bottom: 1rem;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 0.5rem;
  background: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

:root {
  --left-gutter: 30vw;   /* adjust until it looks right */
}

nav a.active {
  opacity: 1;
}

nav a.active::before {
  color: black;
}

nav a.active::after {
  opacity: 1;
  top: 105%;
}

@media (max-width: 768px) {

  /* Header and Site Title */
  header {
    position: relative; /* scroll with content */
    top: auto;
    left: auto;
    margin-top: 2rem;  
    margin-left: 1rem; 
  }

  .site-title {
    font-size: 1.2rem;    
    margin-bottom: 1.5rem;  /* spacing below title */
  }

  /* Nav links */
  nav {
    position: relative;
    flex-direction: row;    
    gap: 1rem;              
    margin-bottom: 1rem;  /* spacing below nav */
  }

  nav a {
    transform: none;       
    display: inline-block;
    font-size: 0.6rem;
    letter-spacing: 1px;
    opacity: 0.7;
  }

  nav a:hover {
    opacity: 1;
  }

  /* About link */
  .about-link {
    position: relative;   /* scrolls with content */
    top: auto;
    bottom: auto;
    right: auto;
    margin: 0 0 1rem 0;   /* 1rem spacing below nav links */
    font-size: 0.55rem;
  }

  /* Footer */
  footer {
    position: relative;
    margin-top: 1rem;    
    font-size: 0.45rem;
  }

  body.music-page .about-link,
  body.design-page .about-link {
    display: none;
  }

  #ascii-container {
    font-size: 1.5vw; /* bigger ASCII on mobile */
    line-height: 1;   /* keep lines tight */
    position: relative; /* or absolute if needed */
    top: -10rem; /* moves it up */
  }

  #progress-bar {
    top: -0.00005rem;
  }

  .blinking-square {
    top: 1.2rem;   /* adjust vertical position */
    left: 8rem;    /* adjust horizontal position */
    width: 8px;    /* optional size adjustment */
    height: 10px;  /* optional size adjustment */
  }
}
