/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Tokens ─────────────────────────────────────── */
:root {
  --bg:       #0c0c0c;
  --surface:  #111111;
  --border:   #1c1c1c;
  --text:     #b4bcd0;
  --dim:      #3a4150;
  --green:    #4ade80;
  --blue:     #60a5fa;
  --yellow:   #facc15;
  --font:     'JetBrains Mono', ui-monospace, monospace;
  --max:      780px;
}

/* ── Base ────────────────────────────────────────── */
html { 
  font-size: 100%; /* 1rem = 16px. Naturally scales with 150% browser zoom */
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  /* Mobile-first padding, expanded in media query below */
  padding: 2rem 1rem; 
}

a { 
    color: var(--blue);
    text-decoration: none;
}

a:hover {
    color: #fff;
    text-decoration: underline;
}

/* ── Terminal window (homepage) ──────────────────── */
.term-window {
  max-width: var(--max);
  margin: 0 auto;
  border: 1px solid var(--border); /* 1px is safer than 0.5px for rendering across zoom levels */
  border-radius: 0.5rem;
  overflow: hidden;
}

.term-chrome {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot.r { background: #ff5f57; }
.dot.y { background: #febc2e; }
.dot.g { background: #28c840; }

.term-title {
  flex: 1;
  text-align: center;
  font-size: 0.875rem; /* 14px */
  color: var(--dim);
}

.term-body {
  /* Mobile-first padding */
  padding: 1.5rem 1rem 2rem;
}

.nav-items {
    display: inline-flex;
    margin: 0 1rem 0 1rem;
    list-style: none;
}

.nav-active {
    color: var(--green);
}

/* ── Prompt row ──────────────────────────────────── */
.prompt-row {
  display: block;
  font-size: 0.875rem; /* 14px */
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.p-user  { color: var(--green); }
.p-sep   { color: var(--dim); }
.p-host  { color: var(--blue); }
.p-path  { color: var(--yellow); }
.p-sym   { color: var(--dim); margin-right: 0.5rem; }
.p-out   { color: var(--white); word-break: break-all; white-space: pre-wrap }

/* ── Site identity ───────────────────────────────── */
.site-name {
  font-size: 1.5rem; /* 24px */
  font-weight: 500;
  color: #f0f0f0;
  letter-spacing: -0.4px;
}
.tagline {
  font-size: 0.875rem; /* 14px */
  color: var(--dim);
  margin-top: 0.25rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ── Blocks ──────────────────────────────────────── */
.block {
  margin-bottom: 2rem;
}

.cmd {
  font-size: 0.875rem; /* 14px */
  color: var(--dim);
  margin-bottom: 0.75rem;
}
.cmd::before {
  content: '$ ';
  color: var(--dim);
}

/* ── Bio ─────────────────────────────────────────── */
.bio {
  font-size: 1rem; /* 16px */
  color: #6e7a8a;
  line-height: 1.7;
}

/* ── Post list (homepage + list page) ───────────── */
.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.post-list li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  align-items: baseline;
}

.post-date {
  font-size: 0.875rem; /* 14px */
  color: var(--dim);
  white-space: nowrap;
}

.post-list a {
  font-size: 1rem; /* 16px */
  color: var(--text);
  text-decoration: none;
}
.post-list a:hover { color: #fff; text-decoration: none; }

.see-all {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.875rem; /* 14px */
  color: var(--dim);
  text-decoration: none;
}
.see-all:hover { color: var(--text); }

/* ── Link list ───────────────────────────────────── */
.link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.link-list li {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1rem;
  font-size: 0.875rem; /* 16px */
  align-items: baseline;
}

.link-key { color: var(--dim); font-size: 0.875rem; }

.link-list a {
  color: var(--blue);
  text-decoration: none;
}
.link-list a:hover {
    text-decoration: underline;
    color: #fff;
}

/* ── Cursor ──────────────────────────────────────── */
.cursor {
  display: inline-block;
  width: 0.5rem;
  height: 1rem;
  background: var(--green);
  vertical-align: middle;
  margin-left: 0.25rem;
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Inner pages (single, list) ──────────────────── */
.container {
  max-width: var(--max);
  margin: 0 auto;
}

.breadcrumb {
  font-size: 0.875rem; /* 14px */
  color: var(--dim);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.breadcrumb a { color: var(--dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { color: var(--border); }
.crumb-current { color: var(--text); }

/* ── Post header ─────────────────────────────────── */
.post-header {
  margin-bottom: 2.5rem;
}
.post-header h1 {
  font-size: 2rem; /* 32px */
  font-weight: 500;
  color: #f0f0f0;
  margin-top: 0.5rem;
  letter-spacing: -0.3px;
}
.post-header .post-date {
  display: block;
  font-size: 0.875rem; /* 14px */
  color: var(--dim);
  margin-top: 0.5rem;
}

/* ── Post content (markdown output) ─────────────── */
.post-content {
  font-size: 1rem; /* 1 */
}

/* ── pstree-style Lists ──────────────────────────── */
.post-content ul {
  list-style: none; /* Removes the default dots */
  padding-left: 0;  /* Removes the default HTML indent */
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.post-content li {
  position: relative;
  padding-left: 1.75rem; /* Creates clean space for the ASCII branches */
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

/* Injects the "T" branch for all items */
.post-content li::before {
  content: "├──";
  position: absolute;
  left: 0;
  color: var(--dim); /* Makes the branches slightly faded, classic terminal look */
}

/* Injects the "L" branch ONLY for the very last item in the list */
.post-content li:last-child::before {
  content: "└──";
}

/* ── htop Portfolio Table (Desktop Default) ──────── */
.htop-table {
  font-size: 0.875rem;
  width: 100%;
}

.htop-header, .htop-row {
  display: grid;
  /* Adjust these fractions based on what needs the most room */
  grid-template-columns: 2fr 2fr 1fr 1fr; 
  gap: 1rem;
  padding: 0.25rem 0;
}

.htop-header {
  color: var(--dim);
  font-weight: bold;
}

.htop-row {
  color: var(--text);
}

.htop-row:hover {
  background: rgba(255, 255, 255, 0.05); /* Slight highlight like selecting a process in htop */
}

.htop-row .h-name {
color: var(--green); 
font-weight: bold;
}

.h-link a {
  color: var(--blue);
  text-decoration: none;
}
.h-link a:hover {
  color: #fff;
}

/* ── Media Queries (Responsive Adjustments) ──────── */
@media (min-width: 768px) {
  html {
    font-size: 125%; 
  }
  
  body {
    padding: 3rem 1.5rem;
  }
  .term-body {
    padding: 2rem 2.5rem 2.5rem;
  }
}

@media (max-width: 600px) {
  /* Force long links to wrap nicely inside the terminal */
  .link-list a {
    overflow-wrap: break-word;
    word-break: break-all; 
  }

  .post-list li,
  .link-list li {
    grid-template-columns: 1fr; /* This stacks the label above the link */
    gap: 0.25rem;
    margin-bottom: 0.5rem;
  }
  
  .post-date, 
  .link-key {
    font-size: 0.75rem; 
  }

  .htop-header, .divider {
    display: none; /* Hide the horizontal headers on mobile */
  }

  .htop-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 0;
    border-bottom: 1px dashed var(--dim); /* Separator between projects */
  }

  /* Inject labels before the content on mobile so they know what they are looking at */
  .h-name::before { content: "NAME:  "; color: var(--dim); }
  .h-stack::before { content: "STACK: "; color: var(--dim); }
  .h-date::before { content: "DATE:  "; color: var(--dim); }
  .h-link::before { content: "LINK:  "; color: var(--dim); }
  
}
