:root {
  --bg: #0a0a0a;
  --terminal-bg: #111111;
  --header-bg: #1e1e1e;
  --green: #4af626;
  --green-dim: #2d8a18;
  --white: #d4d4d4;
  --dim: #606060;
  --bright: #ffffff;
  --red: #ff5f56;
  --orange: #ffbd2e;
  --green-btn: #27c93f;
  --link-hover: #6dff4a;
  --font: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', monospace;
}

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

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  font-family: var(--font);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
}

.terminal {
  width: 100%;
  background: var(--terminal-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* header */
.terminal-header {
  background: var(--header-bg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.terminal-buttons {
  display: flex;
  gap: 8px;
}

.terminal-buttons span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.btn-close { background: var(--red); }
.btn-minimize { background: var(--orange); }
.btn-maximize { background: var(--green-btn); }

.terminal-title {
  flex: 1;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
  font-family: var(--font);
}

.terminal-header-spacer {
  width: 56px;
}

/* body — CSS Grid two-column layout */
.terminal-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  flex: 1;
  overflow-y: auto;
  font-size: clamp(14px, 1.1vw, 18px);
  line-height: 1.7;
}

.content-area {
  padding: 20px 32px;
  min-width: 0;
}

/* command line */
.cmd-line {
  display: flex;
  align-items: center;
}

/* section spacing */
.spacer {
  height: 12px;
}

/* animations */
.output {
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  margin-top: 4px;
  margin-bottom: 4px;
}

.output.visible {
  opacity: 1;
  transform: translateY(0);
}

/* prompt */
.prompt {
  color: var(--green);
  margin-right: 10px;
  font-weight: 700;
}

.cmd {
  color: var(--white);
}

/* ascii art */
.ascii-art {
  color: var(--green);
  font-size: clamp(7px, 0.75vw, 12px);
  line-height: 1.2;
  margin: 2px 0 4px 0;
  display: block;
}

/* output */
.output-dim {
  color: var(--dim);
}

/* whoami info block */
.info-block {
  margin: 4px 0 0 20px;
}

.info-row {
  display: flex;
  gap: 8px;
  line-height: 2;
}

.info-key {
  color: var(--green);
  min-width: 60px;
}

.info-key::after {
  content: ':';
}

.info-val {
  color: var(--white);
}

.inline-link {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px dashed var(--green-dim);
  transition: color 0.15s, border-color 0.15s;
}

.inline-link:hover {
  color: var(--link-hover);
  border-color: var(--link-hover);
}

/* package grid */
.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 2px;
  margin: 4px 0 0 0;
}

.pkg {
  display: flex;
  gap: 12px;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
  align-items: baseline;
}

.pkg:hover {
  background: rgba(74, 246, 38, 0.04);
  border-color: rgba(74, 246, 38, 0.1);
}

.pkg:hover .pkg-name {
  color: var(--link-hover);
}

.pkg-name {
  color: var(--green);
  font-weight: 700;
  min-width: 80px;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.pkg-desc {
  color: var(--dim);
  font-size: clamp(11px, 0.8vw, 12px);
}

/* tree */
.tree-block {
  margin: 4px 0 0 20px;
  line-height: 1.9;
}

.tree-line {
  line-height: 1.9;
}

.tree-branch {
  color: var(--dim);
}

.tree-link {
  color: var(--green);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.15s;
}

.tree-link:hover {
  color: var(--link-hover);
}

.tree-arrow {
  color: var(--dim);
}

.tree-dim {
  color: var(--dim);
}

.tree-comment {
  color: var(--dim);
  font-size: 13px;
}

.tree-summary {
  color: var(--dim);
  font-size: 12px;
  margin-top: 2px;
}

/* cursor */
.cursor-line {
  display: flex;
  align-items: center;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 18px;
  background: var(--green);
  animation: blink 1s step-end infinite;
}

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

/* tech panel — scattered absolute positioning within grid column */
.tech-panel {
  position: relative;
  pointer-events: none;
}

.tech-panel img {
  position: absolute;
  height: auto;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.3s ease;
  pointer-events: none;
}

.tech-panel img.visible {
  opacity: 0.18;
  pointer-events: auto;
}

.tech-panel img:hover {
  opacity: 0.6;
  transform: scale(1.3);
}

/* scattered icon positions (percentage-based for scaling) */
.tech-panel img:nth-child(1)  { top: 2%;  left: 22%; width: 60px; }
.tech-panel img:nth-child(2)  { top: 7%;  left: 73%; width: 54px; }
.tech-panel img:nth-child(3)  { top: 12%; left: 4%;  width: 56px; }
.tech-panel img:nth-child(4)  { top: 17%; left: 54%; width: 52px; }
.tech-panel img:nth-child(5)  { top: 22%; left: 26%; width: 50px; }
.tech-panel img:nth-child(6)  { top: 27%; left: 78%; width: 54px; }
.tech-panel img:nth-child(7)  { top: 33%; left: 11%; width: 50px; }
.tech-panel img:nth-child(8)  { top: 38%; left: 61%; width: 52px; }
.tech-panel img:nth-child(9)  { top: 43%; left: 34%; width: 48px; }
.tech-panel img:nth-child(10) { top: 48%; left: 83%; width: 46px; }
.tech-panel img:nth-child(11) { top: 53%; left: 2%;  width: 52px; }
.tech-panel img:nth-child(12) { top: 58%; left: 49%; width: 50px; }
.tech-panel img:nth-child(13) { top: 63%; left: 18%; width: 48px; }
.tech-panel img:nth-child(14) { top: 68%; left: 71%; width: 46px; }
.tech-panel img:nth-child(15) { top: 73%; left: 29%; width: 44px; }
.tech-panel img:nth-child(16) { top: 78%; left: 83%; width: 50px; }
.tech-panel img:nth-child(17) { top: 83%; left: 10%; width: 46px; }
.tech-panel img:nth-child(18) { top: 88%; left: 61%; width: 44px; }

/* scrollbar */
.terminal-body::-webkit-scrollbar {
  width: 6px;
}

.terminal-body::-webkit-scrollbar-track {
  background: transparent;
}

.terminal-body::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

/* >= 1800px — full bleed, wider sidebar, larger icons */
@media (min-width: 1800px) {
  .terminal-body {
    grid-template-columns: 1fr 340px;
  }

  .tech-panel img:nth-child(1)  { width: 68px; }
  .tech-panel img:nth-child(2)  { width: 62px; }
  .tech-panel img:nth-child(3)  { width: 64px; }
  .tech-panel img:nth-child(4)  { width: 60px; }
  .tech-panel img:nth-child(5)  { width: 58px; }
  .tech-panel img:nth-child(6)  { width: 62px; }
  .tech-panel img:nth-child(7)  { width: 58px; }
  .tech-panel img:nth-child(8)  { width: 60px; }
  .tech-panel img:nth-child(9)  { width: 56px; }
  .tech-panel img:nth-child(10) { width: 54px; }
  .tech-panel img:nth-child(11) { width: 60px; }
  .tech-panel img:nth-child(12) { width: 58px; }
  .tech-panel img:nth-child(13) { width: 56px; }
  .tech-panel img:nth-child(14) { width: 54px; }
  .tech-panel img:nth-child(15) { width: 52px; }
  .tech-panel img:nth-child(16) { width: 58px; }
  .tech-panel img:nth-child(17) { width: 54px; }
  .tech-panel img:nth-child(18) { width: 52px; }
}

/* 720-1199px — windowed, single column, hide tech panel */
@media (max-width: 1199px) {
  body {
    padding: 16px;
  }

  .terminal {
    border-radius: 10px;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.05),
      0 20px 60px rgba(0, 0, 0, 0.6),
      0 0 80px rgba(74, 246, 38, 0.03);
  }

  .terminal-body {
    grid-template-columns: 1fr;
  }

  .tech-panel {
    display: none;
  }

  /* show first 8 repos on medium screens */
  .pkg:nth-child(n+9) {
    display: none;
  }
}

/* < 720px — full bleed mobile */
@media (max-width: 719px) {
  body {
    padding: 0;
  }

  .terminal {
    border-radius: 0;
    box-shadow: none;
  }

  .terminal-body {
    grid-template-columns: 1fr;
    font-size: 12px;
  }

  .content-area {
    padding: 16px;
  }

  .ascii-art {
    font-size: 7px;
  }

  .package-grid {
    grid-template-columns: 1fr;
  }

  /* show first 6 repos on mobile */
  .pkg:nth-child(n+7) {
    display: none;
  }

  .pkg-name {
    min-width: 64px;
  }

  .info-block {
    margin-left: 0;
  }

  .tree-block {
    margin-left: 0;
  }

  .tech-panel {
    display: none;
  }
}
