* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #0a0a0a;
  color: #00ff77;
  font-family: 'Fira Code', monospace;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  flex-direction: column;
  text-align: left;
}

#stars {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
}

.terminal-container {
  width: 90%;
  max-width: 1000px;
  margin: 40px auto;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.85);
  padding: 1.5rem;
  box-shadow: 0 0 30px rgba(0, 255, 100, 0.1);
  position: relative;
  z-index: 1;
}

.terminal {
  font-size: 1.1rem;
  line-height: 1.4;
  width: 100%;
  min-height: 400px;
}

.line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
  align-items: center;
}

.prompt {
  color: #00ff77;
  white-space: nowrap;
  position: relative;
  top: 1px;
}

.dynamic-cursor {
  display: inline-block;
  width: 8px;
  border-right: 2px solid #00ff77;
  animation: blink 1s step-end infinite;
  position: relative;
  top: -1px;
}

.input-line {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
  width: 100%;
}

.input-wrapper {
  width: 100%;
  max-width: 60ch;
  position: relative;
}

.terminal-textarea {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  color: transparent;
  background: transparent;
  border: none;
  resize: none;
  overflow: hidden;
  caret-color: transparent;
  font-family: 'Fira Code', monospace;
  font-size: 1.1rem;
  line-height: 1.4;
  padding: 0;
  margin: 0;
  outline: none !important;
  box-shadow: none !important;
}

.terminal-mirror {
  white-space: pre-wrap;
  word-wrap: break-word;
  background: transparent;
  color: #00ff77;
  font-family: 'Fira Code', monospace;
  font-size: 1.1rem;
  line-height: 1.4;
  min-height: 1.4rem;
  pointer-events: none;
}

.fake-cursor {
  display: inline-block;
  width: 8px;
  height: 1.2em;
  background: #00ff77;
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
  vertical-align: bottom;
}

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

.nav-bar {
  position: sticky;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  padding: 10px;
  border-top: 1px solid #1a1a1a;
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-link {
  color: #00ff77;
  margin: 0 5px;
  text-decoration: none;
}

.nav-link:hover {
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(0, 255, 119, 0.4);
}

a {
  color: #00ffff;
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
}

a.visible-link {
  pointer-events: auto;
  cursor: pointer;
}

a.hidden-link {
  color: inherit !important;
  pointer-events: none;
  text-decoration: inherit !important;
  opacity: 1 !important;
}

a:not(.hidden-link):hover {
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
}

.terminal-footer {
  margin-top: 2rem;
  color: #00ff77;
  text-align: left;
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  padding-top: 1.5rem;
  border-top: 1px solid #00ff77;
}

.terminal-footer a {
  color: #00ff77;
  text-decoration: none;
  margin-right: 10px;
}

.terminal-footer a:hover {
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(0, 255, 119, 0.4);
}

.page-intro {
  color: #b9ffd8;
  font-family: 'Fira Code', monospace;
  line-height: 1.7;
  margin-bottom: 1rem;
  max-width: 78ch;
}

.terminal-note {
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 255, 119, 0.25);
  color: #8fd6b2;
  font-family: 'Fira Code', monospace;
  line-height: 1.7;
  font-size: 0.92rem;
}

.code-credit {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 255, 0, 0.15);
  border: 1px solid #0f0;
  padding: 8px 14px;
  font-family: 'Fira Code', monospace;
  color: #0f0;
  font-size: 14px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
  z-index: 1000;
}

.code-credit.show {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 700px) {
  body {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .terminal-container {
    width: calc(100% - 24px);
    margin: 12px auto;
    padding: 1rem;
  }

  .terminal,
  .terminal-textarea,
  .terminal-mirror {
    font-size: 0.95rem;
  }

  .line {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .prompt {
    white-space: normal;
  }

  .input-line {
    flex-direction: column;
    gap: 0.2rem;
  }

  .input-wrapper {
    max-width: 100%;
  }

  .terminal-footer {
    line-height: 1.9;
  }
}
