@import url('https://fonts.googleapis.com/css2?family=VT323&display=block');

/* --- Reset & Layout --- */
* {
  box-sizing: border-box;
}

body {
  background-color: #202020;
  color: white;
  font-family: 'VT323', monospace;
  margin: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* --- Header & Navigation --- */
h1 {
  padding: 0;
  margin: 0;
  font-size: clamp(30pt, 12vw, 50pt); 
  line-height: 0.75;
  cursor:default;
}

.leftarrow {
  position:static;
  text-indent:0px;
}

.rightarrow {
  float:none
}
.rainbow {
  position: relative;
  display: inline-block;
  
  background: linear-gradient(
    135deg, 
    #ff0000 0%, #ff0000 16.6%, 
    #ff8000 16.6%, #ff8000 33.3%, 
    #ffff00 33.3%, #ffff00 50%, 
    #00ff00 50%, #00ff00 66.6%, 
    #00ffff 66.6%, #00ffff 83.3%, 
    #ff00ff 83.3%, #ff00ff 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  
  background-size: 200% 200%;
  animation: shine 1s ease-out forwards; 
}

.rainbow::after {
  content: "";
  position: absolute;
  /* Adjusting position for a smaller star */
  top: 1px;    
  right: 2px;
  /* Making it smaller */
  width: 8px;
  height: 8px;
  background: #ffff00; /* Yellow twinkle */
  
  /* A sharp 4-pointed star shape */
  clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%);
  
  opacity: 0;
  transform: scale(0);
  
  /* Animation plays once and disappears */
  animation: twinkle 0.9s ease-in-out 0.9s forwards;
}

/* 1. The Swipe Shine */
@keyframes shine {
  0% { background-position: 200% 0%; }
  100% { background-position: 100% 0%; }
}

/* 2. The Star Twinkle (Appear then Disappear) */
@keyframes twinkle {
  0% { 
    transform: scale(0) rotate(0deg); 
    opacity: 0; 
  }
  50% { 
    transform: scale(4) rotate(90deg); 
    opacity: 1; 
    box-shadow: 0 0 5px #ffff00;
  }
  100% { 
    transform: scale(0) rotate(180deg); 
    opacity: 0; 
  }
}.nav-bar-link {
  color: inherit; 
  text-decoration: none;
}
.container {
  display: flex;
  margin-top: -8px; 
}

.container div {
  margin-right: 6px; 
  font-size: clamp(14px, 4.5vw, 20px); 
}

hr {
  width: 100%;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 10px 0;
}

/* --- Terminal Container --- */
.code-container {
  background: rgb(48, 48, 48);
  border: 1px solid #ccc;
  padding: 15px;
  flex-grow: 1; 
  display: block;
  flex-direction: column;
  justify-content: flex-start; 
  align-items: flex-start; 
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 5px;
}
/* Custom Scrollbar for the terminal */
.code-container::-webkit-scrollbar {
  width: 8px;
}

.code-container::-webkit-scrollbar-track {
  background:  rgb(48,48,48);}

.code-container::-webkit-scrollbar-thumb {
  background: #202020;
  border-radius: 2px;
}

.terminal-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 4px;
}

.terminal-text {
  --char-count: 0;
  --delay: 0s;
  --duration: 1s;

  margin: 0;
  font-size: clamp(16px, 4.5vw, 20px);
  white-space: nowrap;
  overflow: hidden;
  display: inline-block;
  position: relative;
  width: 0;
  visibility: hidden; 
  white-space: pre;
  animation: typing var(--duration, 1s) steps(var(--char-count, 20), end) forwards;
  animation-delay: var(--delay, 0s);
}

/* --- The Caret Logic --- */
.terminal-text::after {
  content: '█';
  position: absolute;
  right: 0;
  width: 1ch;
  color: white;
  background: white;
  visibility: hidden;
  
  /* Caret only shows DURING the typing duration, then vanishes */
  animation: caret-active var(--duration, 1s) step-start;
  animation-delay: var(--delay, 0s);
}

/* ONLY the last line stays visible and blinks after it finishes */
.terminal-line:last-child .terminal-text::after {
  /* Overrides the vanish: shows while typing AND blinks forever after */
  animation: 
    caret-active var(--duration, 1s) step-start forwards,
    blink 1s step-end infinite;
  animation-delay: var(--delay, 0s), calc(var(--delay) + var(--duration));
}

/* --- Keyframes --- */
@keyframes typing {
  from { 
    width: 0; 
    padding-right: 0;
    visibility: visible;
  }
  to { 
    width: calc((var(--char-count) * 1ch) + 1.2ch); 
    padding-right: 1.2ch;
    visibility: visible;
  }
}

@keyframes caret-active {
  0%, 100% { visibility: visible; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* --- Footer --- */
footer {
  font-size: 14px;
  color: white;
  margin-top: auto;
  padding: 5px 0;
}
