@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&display=swap");

:root {
  --bg-color: #0c0c0c;
  --text-primary: #d0d0d0;
  --text-secondary: #888888;
  --text-muted: #444444;
  --active-color: #39ff14;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family:
    "JetBrains Mono", "Fira Code", "Menlo", "Monaco", "Consolas", monospace;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 6rem 2rem 2rem;
}

/* Desktop: terminals live in the top-left, not centered */
@media (min-width: 768px) {
  body {
    justify-content: flex-start;
    padding: 3rem 3rem 3rem 4rem;
  }
}

.terminal {
  width: 100%;
  max-width: 560px;
}

.output {
  display: flex;
  flex-direction: column;
}

/* echoed command lines */
.line {
  white-space: pre-wrap;
  word-break: break-word;
}

/* command output blocks (cat, whoami, errors, easter eggs) */
.block {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-secondary);
  margin: 0.15rem 0 0.6rem;
}

.prompt {
  color: var(--text-muted);
}

/* directory listing */
.listing {
  display: flex;
  flex-direction: column;
  margin: 0.15rem 0 0.9rem;
  user-select: none;
}

.row {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr;
  padding: 0.35rem 0;
  text-decoration: none;
  color: inherit;
  align-items: center;
}

.header-row {
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--text-muted);
  padding-bottom: 0.4rem;
  margin-bottom: 0.3rem;
}

.item {
  color: var(--text-primary);
}

.item.inert {
  color: var(--text-muted);
}

/* Only real links (kosik + future subpages) react to hover/tap */
.link {
  cursor: pointer;
}

.link:hover,
.link:focus {
  color: #ffffff;
  outline: none;
}

.col {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-col {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  background-color: var(--active-color);
  border-radius: 50%;
  display: inline-block;
}

/* live input line */
.input-line {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.mirror {
  color: #ffffff;
  white-space: pre-wrap;
  word-break: break-word;
  margin-left: 0.5ch;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background-color: var(--text-secondary);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
}

/* Real input: invisible but focusable — drives the mobile keyboard + paste */
.cmd-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font: inherit;
  font-size: 16px; /* >=16px stops iOS from zooming on focus */
  padding: 0;
  outline: none;
}

@keyframes blink {
  from,
  to {
    background-color: transparent;
  }
  50% {
    background-color: var(--text-secondary);
  }
}

@media (max-width: 480px) {
  body {
    padding: 3rem 1.25rem 2rem;
  }
  .row {
    grid-template-columns: 1.8fr 1fr 1fr;
    font-size: 13px;
  }
}
