/* ───────────────────────────────────────────────────────────
   jensheise.com — modern typewriter / retro terminal
   mono everywhere, readability first, quietly mechanical
   ─────────────────────────────────────────────────────────── */

:root {
  --bg:     #f3efe6;   /* warm paper */
  --fg:     #1f1e1a;
  --muted:  #6e695d;
  --line:   #d6cfbf;
  --accent: #b4480c;   /* burnt amber */
  --card:   #ece6d9;
  --sel:    #f0d9a8;
  --maxw:   46rem;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", "Cascadia Code",
          "Roboto Mono", Menlo, Consolas, monospace;
}

/* Dark palette. Shared by an explicit toggle ([data-theme="dark"]) and by
   the system preference when the user hasn't forced light. */
:root[data-theme="dark"] {
  --bg:     #100f0d;   /* terminal black */
  --fg:     #d8d2c4;   /* phosphor warm */
  --muted:  #857f70;
  --line:   #2a2722;
  --accent: #e2a458;   /* amber phosphor */
  --card:   #19170f;
  --sel:    #3a2f15;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:     #100f0d;
    --fg:     #d8d2c4;
    --muted:  #857f70;
    --line:   #2a2722;
    --accent: #e2a458;
    --card:   #19170f;
    --sel:    #3a2f15;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  font-variant-ligatures: none;
}

::selection { background: var(--sel); }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size .2s ease;
}
a:hover { background-size: 100% 1px; }

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

/* ── Blinking cursor ──────────────────────────────────────── */
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2.25rem;
  padding-bottom: 1.1rem;
  margin-bottom: 3rem;
  border-bottom: 4px solid var(--fg);
}
.brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--bg);
  background: var(--fg);
  padding: 0.2rem 0.55rem;
  letter-spacing: -0.01em;
  transform: rotate(-1.5deg);
  box-shadow: 3px 3px 0 var(--accent);
}
.brand::before { content: "~ $ "; color: var(--accent); }
.brand::after  { content: "_"; color: var(--accent); animation: blink 1.1s step-end infinite; }
.brand:hover { background: var(--accent); color: var(--bg); box-shadow: 3px 3px 0 var(--fg); }

.site-nav { display: flex; align-items: center; gap: 1.1rem; font-size: 0.9rem; }
.site-nav a { color: var(--muted); background: none; }
.site-nav a::before { content: "["; color: var(--line); }
.site-nav a::after  { content: "]"; color: var(--line); }
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--fg); }
.site-nav a[aria-current="page"]::before,
.site-nav a[aria-current="page"]::after { color: var(--accent); }

.theme-toggle {
  font: inherit;
  font-size: 0.9rem;
  color: var(--bg);
  background: var(--accent);
  border: 2px solid var(--fg);
  padding: 0.05rem 0.45rem;
  cursor: pointer;
  text-transform: lowercase;
  box-shadow: 2px 2px 0 var(--fg);
}
.theme-toggle::before { content: "* "; }
.theme-toggle:hover { background: var(--fg); color: var(--bg); }
.theme-toggle:active { transform: translate(2px, 2px); box-shadow: none; }

/* ── Page enter animation ─────────────────────────────────── */
main.wrap { animation: rise .4s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Intro (home) ─────────────────────────────────────────── */
.intro { margin-bottom: 3.5rem; }
.lede {
  display: inline-block;
  font-size: 1.45rem;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  padding-bottom: 0.2rem;
  border-bottom: 5px solid var(--accent);
  text-wrap: balance;
}
.lede::before { content: "> "; color: var(--accent); }
.intro p:last-child { color: var(--muted); margin: 0; font-size: 0.95rem; }

/* ── Home streams ─────────────────────────────────────────── */
.stream { margin-bottom: 3.5rem; }
.stream-title {
  display: inline-block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--bg);
  background: var(--fg);
  margin: 0 0 1.6rem;
  padding: 0.25rem 0.7rem;
  transform: rotate(-1deg);
  box-shadow: 4px 4px 0 var(--accent);
}
.stream-title::before { content: "// "; color: var(--accent); }
.stream-title a { color: inherit; background: none; }
.stream-title a:hover { color: var(--accent); }

/* ── Post list ────────────────────────────────────────────── */
.post-list, .note-list { list-style: none; margin: 0; padding: 0; }
.post-list > li { margin-bottom: 1.9rem; }
.post-link { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; background: none; }
.post-title { color: var(--fg); font-weight: 700; }
.post-title::before { content: "› "; color: var(--accent); }
.post-link:hover .post-title { color: var(--accent); }
.post-link time { color: var(--muted); font-size: 0.8rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.post-summary { color: var(--muted); font-size: 0.92rem; margin: 0.35rem 0 0; padding-left: 1.1rem; }

/* ── Notes ────────────────────────────────────────────────── */
.note {
  position: relative;
  padding: 1.5rem 0 1.5rem 1.4rem;
  border-bottom: 1px dashed var(--line);
}
.note::before {
  content: ">";
  position: absolute;
  left: 0; top: 1.5rem;
  color: var(--accent);
  font-weight: 700;
}
.note-list .note:first-child { padding-top: 0; }
.note-list .note:first-child::before { top: 0; }
.note-body { font-size: 0.98rem; }
.note-body p:first-child { margin-top: 0; }
.note-body p:last-child { margin-bottom: 0; }
.note-meta {
  display: inline-block;
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.78rem;
  background: none;
  font-variant-numeric: tabular-nums;
}
.note-meta::before { content: "// "; color: var(--line); }
.note-single { border: none; padding: 0; }
.note-single::before { content: none; }

/* ── List heads ───────────────────────────────────────────── */
.list-head { margin-bottom: 2.5rem; }
.list-head h1 { font-size: 1.5rem; margin: 0 0 0.4rem; }
.list-head h1::before { content: "// "; color: var(--accent); }
.list-head .prose { color: var(--muted); font-size: 0.95rem; }

/* ── Post (single) ────────────────────────────────────────── */
.post-header {
  margin-bottom: 2.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px dashed var(--line);
}
.post-header h1 {
  font-size: 1.7rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
  text-wrap: balance;
}
.post-byline { color: var(--muted); font-size: 0.82rem; margin: 0; font-variant-numeric: tabular-nums; }

/* ── Prose ────────────────────────────────────────────────── */
.prose { font-size: 1rem; }
.prose p { margin: 0 0 1.4rem; }
.prose h2 { font-size: 1.2rem; margin: 2.75rem 0 1rem; }
.prose h2::before { content: "## "; color: var(--accent); }
.prose h3 { font-size: 1.05rem; margin: 2rem 0 0.75rem; }
.prose h3::before { content: "### "; color: var(--accent); }
.prose em { font-style: italic; color: var(--muted); }
.prose strong { font-weight: 700; }
.prose a {
  background: none;
  border-bottom: 2px solid var(--accent);
}
.prose a:hover { background: var(--accent); color: var(--bg); border-bottom-color: var(--fg); }
.prose blockquote {
  margin: 1.6rem 0;
  padding: 0.5rem 0 0.5rem 1.1rem;
  border-left: 6px solid var(--accent);
  color: var(--muted);
}
.prose code {
  font-size: 0.9em;
  background: var(--card);
  border: 1px solid var(--fg);
  padding: 0.08em 0.35em;
}
.prose pre {
  background: var(--card);
  border: 2px solid var(--fg);
  box-shadow: 5px 5px 0 var(--fg);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  line-height: 1.6;
}
.prose pre code { background: none; border: none; padding: 0; font-size: 0.88em; }
.prose img {
  max-width: 100%;
  height: auto;
  border: 2px solid var(--fg);
  box-shadow: 6px 6px 0 var(--fg);
}
.prose hr { border: none; color: var(--line); text-align: center; margin: 2.75rem 0; }
.prose hr::before { content: "* * *"; letter-spacing: 0.5em; color: var(--muted); }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.4rem; }
.prose li { margin-bottom: 0.4rem; }

/* ── Tags ─────────────────────────────────────────────────── */
.post-tags { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px dashed var(--line); font-size: 0.85rem; }
.post-tags a { color: var(--muted); }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 5rem;
  padding-block: 1.75rem;
  border-top: 4px solid var(--fg);
  color: var(--muted);
  font-size: 0.8rem;
}
.site-footer a { color: var(--muted); }
.site-footer .privacy { flex-basis: 100%; font-size: 0.72rem; opacity: 0.75; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 34rem) {
  .lede { font-size: 1.1rem; }
  .post-link { flex-direction: column; gap: 0.15rem; }
  .post-header h1 { font-size: 1.4rem; }
}

/* ── Motion off ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
