#knowledge {
  background-color: var(--bg);
  overflow-x: hidden;
}

#knowledge .section-h2 {
  margin-bottom: 0;
  padding-top: 16px;
  padding-bottom: 0;
}

.section-intro {
  max-width: 800px;
  margin: 0 auto 8px;

  color: var(--accent);
  font-size: 24px;
  text-align: center;
}

.knowledge-grid {
  display: flex;
  justify-content: center;
  /* margin: 0 auto; */
  margin-top: 1.5rem;
}

.laptop {
  position: relative;
  width: min(100vw, 1440px);
  min-height: clamp(560px, 66vw, 960px);
  margin-top: -56px;
  margin-bottom: 64px;
  overflow: hidden;

  aspect-ratio: 3 / 2;
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 112% 100%;
}

.techstack {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);

  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
  width: min(72%, 900px);
  margin: 0;
  padding: 8px;
  overflow: visible;

  list-style-type: none;
}

.techstack li {
  width: 100%;
}

.techstack li:nth-child(2) {
  margin-bottom: 16px;
}

.terminal,
.terminal-command,
.terminal-skill {
  font-size: 1rem;
  white-space: nowrap;
}

.terminal {
  color: var(--text);
  line-height: 0.9;
}

.terminal-command {
  margin-bottom: 0;
  color: var(--text);
}

.terminal-path {
  color: var(--text);
}

.terminal-skill {
  margin-bottom: 16px;
  color: var(--accent);
  letter-spacing: 2px;
  font-size: 1.1rem;
}

.terminal-skill:last-child {
  margin-bottom: 0;
}

.cursor {
  color: var(--accent);
  animation: blink 1s infinite;
}

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

  51%,
  100% {
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .knowledge-grid {
    margin-top: -16px;
    margin-bottom: 32px;
    padding: 0 8px;
  }

  .laptop {
    flex: 0 0 min(100%, 1200px);
    width: min(100%, 1200px);
    min-height: clamp(528px, calc(78vw - 32px), 688px);
    margin-top: 0;
    margin-bottom: 0;

    aspect-ratio: 16 / 10.5;
    background-image: url("../images/tablet-tech-bg-glass.png");
    background-size: 100% 100%;
  }

  .techstack {
    top: 14%;
    width: min(80%, 820px);
    padding: 24px 16px 16px;
  }
}

@media (max-width: 816px) {
  .knowledge-grid {
    width: 100%;
    padding: 0;
  }

  .laptop {
    flex: 0 0 min(116vw, 580px);
    width: min(116vw, 580px);
    min-height: auto;

    aspect-ratio: 2 / 3;
    background-image: url("../images/phone-tech-bg.png");
    background-size: 100% 100%;
  }

  .techstack {
    top: calc(12% - 8px);
    left: 50%;
    width: 68%;
    padding: 16px 8px 16px 16px;
  }

  .terminal,
  .terminal-command,
  .terminal-skill {
    font-size: 0.8125rem;
    line-height: 1.2;
    white-space: normal;
  }

  .terminal-path,
  .typewriter-text {
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
  }

  .terminal-skill {
    letter-spacing: 0;
  }
}

@media (min-width: 901px) {
  .laptop {
    background-image: url("../images/laptop.png");
    background-size: 112% 100%;
  }
}
