/* cavemanwithcomputer.com — one stylesheet, no build step, no dependencies. */

:root {
  --bg:     #fcfcf9;
  --fg:     #1b1b18;
  --muted:  #6f6f66;
  --accent: #14803b;
  --rule:   #e4e4dc;
  --mono:   ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --serif:  Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #12140f;
    --fg:     #e7e7df;
    --muted:  #8d8d83;
    --accent: #5fd07d;
    --rule:   #292c22;
  }
}

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  margin: 0;
  padding: 2rem 2rem 6rem;
}

/* Header and footer span the page; prose is capped for line length. */
main { max-width: 40rem; }

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

/* ---- links ---- */

a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover { background: var(--accent); color: var(--bg); text-decoration: none; }

/* ---- header / tabs ---- */

header {
  font-family: var(--mono);
  font-size: 0.85rem;
  margin-bottom: 3rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  border-bottom: 1px solid var(--rule);
}

header .home {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  padding-bottom: 0.45rem;
}
header .home:hover { background: none; color: var(--accent); text-decoration: underline; }

nav.tabs {
  display: flex;
  gap: 1.5rem;
}

nav.tabs a {
  padding: 0.4rem 0;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
}
nav.tabs a:hover { color: var(--fg); background: none; }
nav.tabs a[aria-current="page"] {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

/* ---- headings ---- */

h1, h2, h3 {
  font-family: var(--mono);
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 1.3rem; margin: 0 0 0.25rem; }
h2 { font-size: 0.85rem; margin: 3rem 0 0.75rem; color: var(--muted); text-transform: lowercase; letter-spacing: 0.04em; }
h3 { font-size: 1rem; margin: 2rem 0 0.5rem; }

.tagline { color: var(--muted); margin: 0 0 2rem; }

/* the little blinking block after the name */
.cursor {
  color: var(--accent);
  animation: blink 1.2s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

/* ---- entry lists (projects, posts, links) ---- */

ul.entries { list-style: none; padding: 0; margin: 0; }

ul.entries li {
  margin: 0 0 0.65rem;
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
}

ul.entries time,
ul.entries .key {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  flex: 0 0 5.25rem;
  white-space: nowrap;
}

ul.entries .note { color: var(--muted); font-size: 0.95rem; }

@media (max-width: 30rem) {
  ul.entries li { display: block; }
  ul.entries time, ul.entries .key { display: block; flex: none; }
}

/* ---- prose (blog posts) ---- */

article p, article li { line-height: 1.7; }
article > p:first-of-type { margin-top: 0; }

article blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}

article code, article pre {
  font-family: var(--mono);
  font-size: 0.85rem;
}

article pre {
  background: var(--rule);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  border-radius: 3px;
}

article img { max-width: 100%; height: auto; }

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

.postmeta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 2rem;
}

/* ---- prose list (projects, videos) — one paragraph per item ---- */

.list p {
  margin: 0 0 0.85rem;
  line-height: 1.55;
}

/* ---- footer ---- */

footer {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
footer a { color: var(--muted); }

footer .updated { display: block; margin-top: 0.6rem; }
