/* humbleops.tech
   Linux terminal theme: phosphor green prompt, ANSI blue and yellow,
   light gray text on near-black. Layout adapted from the ctmiller.net theme. */

:root {
  --bg: #0c0c0c;          /* terminal black */
  --bg-soft: #161616;     /* code blocks */
  --fg: #d0d0d0;          /* default terminal foreground */
  --fg-dim: #a0a0a0;      /* secondary text (7.5:1, AAA) */
  --accent: #5fd75f;      /* bold green: prompt user@host, hovers */
  --accent-dim: #48bb48;  /* green for markers and bars (7.9:1) */
  --blue: #6cb6ff;        /* ANSI blue: paths, directory-ish things */
  --yellow: #e5c07b;      /* ANSI yellow: tags, inline code */
  --rule: #2e2e2e;        /* dividers (decorative only) */
  --glyph: #6a6a6a;       /* decorative prefixes like // and > (3.6:1) */
  --max-width: 680px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* faint CRT scanlines over everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.018) 0,
    rgba(255, 255, 255, 0.018) 1px,
    transparent 1px,
    transparent 3px
  );
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  position: relative;
  z-index: 2;
}

::selection { background: var(--accent); color: var(--bg); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- skip link ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 0.4rem 0.8rem;
  z-index: 10;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---- header ---- */
.site-header { margin-bottom: 2.5rem; }

/* bash-style prompt: user@host:~$ command */
.prompt {
  display: inline-block;
  color: var(--fg);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  text-decoration: none;
}

.prompt .p-user { color: var(--accent); font-weight: 700; }
.prompt .p-path { color: var(--blue); font-weight: 700; }
.prompt .p-sym { color: var(--fg); margin-right: 0.5ch; }
.prompt:hover .p-cmd,
.prompt:focus-visible .p-cmd { text-decoration: underline; text-underline-offset: 3px; }

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 0.4rem 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h1 a { color: var(--fg); text-decoration: none; }
h1 a:hover { color: var(--accent); }
h1 .tld { color: var(--accent-dim); }

.tagline {
  color: var(--fg-dim);
  font-size: 0.95rem;
  margin: 0 0 1rem 0;
}

.sep {
  color: var(--accent);
  margin: 0 0.4rem;
}

.site-nav {
  margin-top: 1rem;
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.2rem;
}

.site-nav a {
  color: var(--fg-dim);
  text-decoration: none;
  transition: color 140ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible { color: var(--accent); outline: 2px dashed var(--accent); outline-offset: 3px; }
.site-nav a::before { content: "> " / ""; color: var(--glyph); }

/* ---- section labels ---- */
.section-label {
  color: var(--fg-dim);
  font-size: 0.8rem;
  margin: 2.5rem 0 1rem 0;
  letter-spacing: 0.08em;
  font-weight: 400;
}

.section-label::before {
  content: "// " / "";
  color: var(--glyph);
}

/* ---- intro ---- */
.intro {
  color: var(--fg-dim);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0 0 2rem 0;
}

.intro p { margin: 0 0 1rem; }

.intro a,
.prose a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--accent-dim);
  text-underline-offset: 3px;
  transition: color 140ms ease, text-decoration-color 140ms ease;
}

.intro a:hover, .intro a:focus-visible,
.prose a:hover, .prose a:focus-visible {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ---- link lists ---- */
ul.links {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.links li { border-top: 1px solid var(--rule); }
ul.links li:last-child { border-bottom: 1px solid var(--rule); }

ul.links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  color: var(--fg);
  text-decoration: none;
  transition: color 140ms ease, padding-left 200ms ease;
  position: relative;
}

ul.links a::before {
  content: ">";
  position: absolute;
  left: -1.1rem;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

ul.links a:hover,
ul.links a:focus-visible {
  color: var(--accent);
  padding-left: 0.5rem;
}

ul.links a:focus-visible {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}

ul.links a:hover::before,
ul.links a:focus-visible::before { opacity: 1; transform: translateX(0); }

ul.links .label { font-weight: 500; }

ul.links .entry {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  min-width: 0;
}

ul.links .cat {
  color: var(--yellow);
  font-size: 0.8rem;
  flex-shrink: 0;
}

ul.links .cat::before { content: "["; }
ul.links .cat::after { content: "]"; }

ul.links a:hover .cat,
ul.links a:focus-visible .cat { color: var(--accent); }

ul.links .desc {
  color: var(--fg-dim);
  font-size: 0.85rem;
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
}

ul.links a:hover .desc,
ul.links a:focus-visible .desc { color: var(--accent-dim); }

/* ---- prose block (long-form content) ---- */
.prose { font-size: 0.97rem; }

.prose h2, .prose h3, .prose h4 {
  color: var(--fg);
  letter-spacing: -0.01em;
  margin: 2.2rem 0 0.8rem;
}
.prose h2 { font-size: 1.4rem; }
.prose h3 { font-size: 1.15rem; }
.prose h4 { font-size: 1rem; }

.prose h2::before, .prose h3::before {
  content: "# " / "";
  color: var(--accent-dim);
}

.prose p { margin: 0 0 1.2rem; }

.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.2rem; }
.prose li { margin: 0.3rem 0; }
.prose li::marker { color: var(--accent-dim); }

.prose blockquote {
  margin: 1.4rem 0;
  padding: 0.2rem 0 0.2rem 1.2rem;
  border-left: 2px solid var(--accent-dim);
  color: var(--fg-dim);
}

.prose hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

.prose code {
  background: var(--bg-soft);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.85em;
  color: var(--yellow);
}

.prose pre {
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.5;
}

.prose pre code {
  background: none;
  padding: 0;
  color: var(--fg);
  font-size: inherit;
}

/* ---- terminal-style status block ---- */
.cmd-label {
  color: var(--fg-dim);
  font-weight: 400;
  font-size: 0.8rem;
  margin: 2.5rem 0 1rem 0;
  letter-spacing: 0.02em;
}

.cmd-label::before { content: "$ " / ""; color: var(--accent); }

ul.bars {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}

ul.bars li {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--rule);
}
ul.bars li:last-child { border-bottom: 1px solid var(--rule); }

.bar-name { min-width: 12ch; flex-shrink: 0; }
.bar-fill { color: var(--accent-dim); letter-spacing: -1px; flex-shrink: 0; }
.bar-value { color: var(--fg-dim); font-size: 0.8em; margin-left: auto; }

/* ---- footer ---- */
footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--fg-dim);
  font-size: 0.75rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

footer a {
  color: var(--fg-dim);
  text-decoration: underline;
  text-decoration-color: var(--accent-dim);
  text-underline-offset: 3px;
}
footer a:hover, footer a:focus-visible { color: var(--accent); }

footer .cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.1s steps(2) 4;  /* stops after ~4.4s (WCAG 2.2.2) */
  margin-left: 0.15rem;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  footer .cursor { animation: none; opacity: 1; }
}

@media (max-width: 480px) {
  main { padding: 2.5rem 1.25rem 2rem; }
  h1 { font-size: 2rem; }
  ul.links a { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  ul.links .desc { text-align: left; }
  ul.links a::before { display: none; }
}

/* ---- utilities ---- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#content:focus { outline: none; }
