/* mind the process
   colors: the grassnose favicon (#005500 square, #00ff00 "g")
   structure: hairlines, pixel type, labeled tiles (after foznt.com) */

/* fonts: self-hosted latin subsets, SIL OFL (see assets/fonts/OFL-*.txt) */
@font-face {
  font-family: "DotGothic16";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/dotgothic16-normal-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/lora-normal-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Lora";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/lora-italic-latin.woff2") format("woff2");
}

:root {
  --moss: #005500;
  --signal: #00ff00;

  --bg: #f5f8f2;
  --ink: #0b160b;
  --muted: #566653;
  --line: #0b160b;
  --soft: #e6ede1;
  --link: var(--moss);
  --focus: var(--moss);

  --pixel: "DotGothic16", ui-monospace, monospace;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --wide: 920px;
  --read: 660px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a120a;
    --ink: #dbe7d6;
    --muted: #8da589;
    --line: #3a5636;
    --soft: #142214;
    --link: #3dff3d;
    --focus: var(--signal);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
}

.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1rem;
}

::selection { background: var(--signal); color: #002200; }

a {
  color: var(--link);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3, h4 {
  font-family: var(--pixel);
  font-weight: 400;
  line-height: 1.2;
  margin: 2.5rem 0 0.75rem;
}
h1 { font-size: 2.4rem; }
h2 { font-size: 1.5rem; }
h3, h4 { font-size: 1.15rem; }

p, ul, ol, blockquote { margin: 0 0 1.25rem; }
li ul, li ol, ul ul, ol ol, ul ol, ol ul { margin-bottom: 0; }

/* legacy posts wrap links in <u>; avoid a double underline */
u:has(a), a u { text-decoration: none; }

small, .small { font-size: 0.875em; }
.text-muted { color: var(--muted); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8em;
  background: var(--soft);
  padding: 0.05em 0.35em;
}
pre {
  overflow-x: auto;
  padding: 0.75rem 1rem;
  background: var(--soft);
  border: 1px solid var(--line);
}
pre code { background: none; padding: 0; }

blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
  font-style: italic;
  color: var(--muted);
}

img, video, audio, iframe { max-width: 100%; }
iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 1.5rem auto;
  border: 1px solid var(--line);
}
img, video {
  display: block;
  height: auto;
  margin: 1.5rem auto 0.5rem;
  border: 1px solid var(--line);
}
.caption {
  display: block;
  text-align: center;
  font-family: var(--pixel);
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 2; background: var(--bg); padding: 0.25rem 0.5rem; }

/* header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.75rem 1.5rem;
  padding: 2.5rem 0 1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--pixel);
}
.site-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}
.mark {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  background: var(--moss);
  color: var(--signal);
  font-size: 1.2rem;
  padding-bottom: 0.15rem;
}
.site-title:hover span:not(.mark) { background: var(--ink); color: var(--bg); }

.site-nav {
  display: flex;
  font-size: 0.95rem;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 0 0.2rem;
}
.site-nav a + a::before {
  content: "·";
  color: var(--muted);
  margin-right: 0.4rem;
}
.site-nav a:hover { background: var(--ink); color: var(--bg); }
.site-nav a + a:hover::before { color: var(--bg); }

/* home */
.tagline {
  font-family: var(--pixel);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  line-height: 1.25;
  margin: 1.5rem 0 2rem;
  overflow-wrap: anywhere;
}

.post-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem 1.25rem;
}
.post-grid a {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  text-decoration: none;
}
.tile {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: var(--soft);
  overflow: hidden;
}
.tile img {
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  object-fit: cover;
}
.tag {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  padding: 0.1rem 0.4rem;
  background: var(--bg);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--pixel);
  font-size: 0.75rem;
  line-height: 1.4;
}
.post-grid a:hover .tag,
.post-grid a:focus-visible .tag { background: var(--ink); color: var(--bg); }
.post-grid a:hover .tile { outline: 1px solid var(--line); outline-offset: 3px; }
.post-grid a:focus-visible { outline: none; }
.post-grid a:focus-visible .tile { outline: 2px solid var(--focus); outline-offset: 3px; }
.card-title {
  margin-top: 0.6rem;
  font-family: var(--pixel);
  font-size: 1.2rem;
  line-height: 1.3;
}
.post-grid a:hover .card-title,
.post-grid a:focus-visible .card-title { text-decoration: underline; text-underline-offset: 4px; }
.card-subtitle {
  color: var(--muted);
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.post-grid time {
  margin-top: 0.3rem;
  font-family: var(--pixel);
  font-size: 0.75rem;
  color: var(--muted);
}

/* post */
.post { max-width: var(--read); margin: 0 auto; }
.post-header { margin: 2.5rem 0 1.5rem; }
.post-header time {
  font-family: var(--pixel);
  font-size: 0.85rem;
  color: var(--muted);
}
.post-header h1 { margin: 0.2rem 0; }
.subtitle {
  margin: 0;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--muted);
}
.cover {
  aspect-ratio: 16 / 9;
  margin-bottom: 2.5rem;
}

.post-nav {
  max-width: var(--read);
  margin: 3rem auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  font-family: var(--pixel);
}
.post-nav a {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.post-nav a:hover { background: var(--ink); color: var(--bg); }
.post-nav small { font-size: 0.75rem; color: var(--muted); }
.post-nav a:hover small { color: var(--bg); }
.post-nav-next { grid-column: 2; text-align: right; }

/* footer */
.site-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 4rem;
  padding: 1rem 0 3rem;
  border-top: 1px solid var(--line);
  font-family: var(--pixel);
  font-size: 0.85rem;
  color: var(--muted);
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { background: var(--ink); color: var(--bg); }

@media (max-width: 720px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1rem; }
}

@media (max-width: 520px) {
  body { font-size: 17px; }
  h1 { font-size: 1.9rem; }
  .card-title { font-size: 1rem; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-next { grid-column: 1; }
}

