/* x93 — gruvbox ground, pixel edges, no JavaScript */
:root {
  /* Soft gruvbox, shared with the xms editor. */
  --bg:      #2b2928;
  --bg-hard: #242221;
  --shade:   #1b1a19;
  --bg1:     #4a4440;
  --bg2:     #5c5550;
  --fg:      #e2d3b3;
  --fg2:     #cdbf9f;
  --gray:    #a89a88;
  --dim:     #928575;

  --yellow:  #d4a95a;
  --yellow2: #c4953f;
  --orange:  #dc915a;
  --red:     #e27a70;
  --green:   #a9b665;
  --aqua:    #89b482;
  --blue:    #7daea3;
  --purple:  #d3a0b1;

  /* 4px stepped corners: the 8-bit stand-in for border-radius */
  --px: 4px;
  --steps: polygon(
    0 var(--px), var(--px) var(--px), var(--px) 0,
    calc(100% - var(--px)) 0, calc(100% - var(--px)) var(--px), 100% var(--px),
    100% calc(100% - var(--px)), calc(100% - var(--px)) calc(100% - var(--px)), calc(100% - var(--px)) 100%,
    var(--px) 100%, var(--px) calc(100% - var(--px)), 0 calc(100% - var(--px)));
}

* { box-sizing: border-box; }

html { background: var(--bg); }

/* Header, content, footer stacked; the content grows so the footer sits at
   the bottom of the window on short pages. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding: 0 1rem;
  color: var(--fg2);
  background: var(--bg);
  font: 15px/1.6 ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  -webkit-font-smoothing: antialiased;
}

/* One width for header, content and footer on every page. */
.wrap { width: 100%; max-width: 52rem; margin: 0 auto; }
main.wrap { flex: 1; }

a {
  color: var(--yellow);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
a:visited { color: var(--yellow2); }
a:hover { color: var(--green); text-decoration-style: solid; }

img { max-width: 100%; height: auto; }
.pixelated, .badge img, .hero img, .icon { image-rendering: pixelated; }

hr, .rule {
  border: 0;
  height: 2px;
  margin: 2rem 0;
  background: repeating-linear-gradient(90deg, var(--bg1) 0 8px, transparent 8px 12px);
}

/* Pixel-font headings, drawn as SVG rects. */
.pix { fill: currentColor; max-width: 100%; height: auto; vertical-align: middle; }
.pixfallback { font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
h2 { color: var(--orange); font-size: 1rem; margin: 2rem 0 1rem; line-height: 1; }
h2 .pix { height: 14px; width: auto; }

/* ---------------------------------------------------------------- home */

/* Global header: logo and greeting centred, as on the original x93.dev,
   then the nav bar. Same on every page. */
.top { padding-top: 3rem; text-align: center; }
.hero { display: inline-block; line-height: 0; margin-bottom: 1rem; }
.hero img { width: 183px; height: 66px; }

.greeting { text-align: center; color: var(--yellow2); }
.greeting p { margin: 0; }

/* Pressed into the page: darker than the ground, shadowed along the top,
   lit along the bottom, with stepped pixel corners. */
.mainnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1.75rem;
  margin: 2.5rem 0 0;
  padding: .7rem 1rem;
  background: var(--bg-hard);
  box-shadow: inset 0 3px 0 var(--shade), inset 3px 0 0 var(--shade), inset 0 -1px 0 var(--bg1), inset -1px 0 0 var(--bg1);
  clip-path: var(--steps);
}
.mainnav a { display: inline-flex; align-items: center; gap: .45rem; color: var(--yellow); text-decoration: none; }
.mainnav a:hover { color: var(--blue); }
.mainnav a.on { font-weight: 700; color: var(--fg); }
.mainnav a.on:hover { color: var(--blue); }
.icon { width: 16px; height: 16px; flex: none; }

/* 88x31 is the classic web badge; every slot is exactly that. On the home
   page they sit at the bottom, just above the footer. */
.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 3rem;
}
.badges + .foot { margin-top: 1rem; }
.badge { display: block; flex: none; width: 88px; height: 31px; line-height: 0; }
.badge img { width: 88px; height: 31px; object-fit: fill; }
a.badge:hover img { filter: brightness(1.2); }

/* ------------------------------------------------------------- chrome */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin: .6rem 0 0 1rem;
  color: var(--dim);
  font-size: .85rem;
  text-align: left;
}
/* A tree branch hanging off the nav bar, like `tree` output. */
.crumbs::before { content: "└─"; margin-right: -.1rem; color: var(--dim); }
.crumbs a { color: var(--yellow); text-decoration: none; }
.crumbs a:hover { color: var(--blue); }
.crumbs strong { color: var(--fg); }
/* The section's intro line, pushed to the right of the breadcrumb. */
.crumbs .intro { margin-left: auto; padding-left: 1rem; color: var(--purple); font-style: italic; text-align: right; }
.crumbs .intro:empty { display: none; }
main.wrap { padding-top: 1.5rem; }

.lede { color: var(--gray); margin: 0 0 1rem; }


footer.foot {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  margin-top: 3rem;
  padding: 1rem 0 1.5rem;
  color: var(--dim);
  font-size: .85rem;
}
footer.foot a { display: inline-flex; align-items: center; gap: .4rem; color: var(--gray); }

/* ----------------------------------------------------------- microblog */

.day { color: var(--orange); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }

/* Posts: tweet-sized. A sticky note, the words, nothing else. */
.note {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .4rem 0;
}
.note + .note { border-top: 1px dashed var(--bg1); }
.note .pin { flex: none; line-height: 0; margin-top: .2rem; opacity: .75; }
.note .pin:hover, .note:hover .pin { opacity: 1; }
.note .text { min-width: 0; }
.note p { margin: 0 0 .3rem; color: var(--fg); }
.note p:last-child { margin-bottom: 0; }
.note .out { display: inline-block; font-size: .85rem; }
.note .shot { display: block; margin: .4rem 0 .1rem; }
.note .shot img { display: block; max-height: 16rem; width: auto; border: 2px solid var(--bg1); }
.meta { display: block; margin-top: .35rem; color: var(--dim); font-size: .8rem; }
.meta a { color: var(--dim); }
.meta a:hover { color: var(--green); }

/* Home: one section per part of the site, side by side or stacked. */
.sections { display: grid; gap: 2.5rem; margin-top: 2rem; }
.sections.columns { grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; }
.sections.columns > section { padding: 0 1.5rem; min-width: 0; }
.sections.columns > section:first-child { padding-left: 0; }
.sections.columns > section:last-child { padding-right: 0; }
.sections.columns > section + section { border-left: 2px solid var(--bg1); }
.sections.columns > section:only-child { padding: 0; }
.sections .sections { margin-top: 0; }

h2.section {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0 0 1rem;
  color: var(--gray);
  font-size: .75rem;
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
}
h2.section::after { content: ""; flex: 1; height: 2px; background: var(--bg1); }
h2.section a { color: inherit; text-decoration: none; }
h2.section a:hover { color: var(--blue); }
.more { display: inline-block; margin-top: 1rem; font-size: .85rem; text-decoration: none; }
.more:hover { color: var(--blue); }

.grid.small { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .75rem; }

/* Article and sketch entries in lists: thumbnail, title, a line or two. */
.card {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: .25rem 0;
  padding: .6rem 0 .6rem 1rem;
  border-left: 2px solid var(--bg1);
  color: var(--fg);
  text-decoration: none;
}
.card:hover { border-left-color: var(--yellow2); }
.card:hover strong { color: var(--blue); }
.card img { width: 6rem; aspect-ratio: 4 / 3; object-fit: cover; outline: 2px solid var(--bg1); flex: none; }
.card > span { display: flex; flex-direction: column; min-width: 0; }
.card strong { color: var(--yellow); }
.card .summary { color: var(--fg2); font-size: .9rem; }
.card .meta { margin-top: .15rem; }

/* Featured articles on /blog/: big cover, title, summary. */
.featured { margin: 1.5rem 0 2.5rem; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.25rem; }
.feature { display: flex; flex-direction: column; gap: .3rem; color: var(--fg); text-decoration: none; }
.feature img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 2px solid var(--bg1); margin-bottom: .3rem; }
.feature strong { color: var(--yellow); font-size: 1.05rem; }
.feature .summary { color: var(--fg2); font-size: .9rem; }
.feature:hover img { border-color: var(--yellow2); }
.feature:hover strong { color: var(--blue); }

/* Narrow home columns: image on top, text below. */
.sections.columns .card { flex-direction: column; align-items: stretch; gap: .5rem; }
.sections.columns .card img { width: 100%; }

.article .cover { margin: 0 0 1.5rem; }
.article .cover img { display: block; width: 100%; border: 2px solid var(--bg1); }
.article .prose { max-width: 42rem; }
.article .prose img { border: 2px solid var(--bg1); }

/* ---------------------------------------------------------- sketchbook */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1rem;
}
.tile {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-hard);
  outline: 2px solid var(--bg1);
  text-decoration: none;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile span {
  position: absolute;
  left: 0; bottom: 0;
  padding: .15rem .5rem;
  color: var(--bg-hard);
  background: var(--yellow);
  font-size: .8rem;
  transform: translateY(100%);
  transition: transform .12s steps(3);
}
.tile:hover { outline-color: var(--yellow); box-shadow: 6px 6px 0 var(--bg-hard); }
.tile:hover span, .tile:focus span { transform: none; }

.sketch figure { margin: 0 0 1rem; }
.sketch figure img { display: block; margin: 0 auto; max-height: 80vh; width: auto; border: 2px solid var(--bg1); }
.sketch .body { max-width: 40rem; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; }

/* ---------------------------------------------------------------- prose */

.prose { color: var(--fg2); }
.prose h2 { color: var(--orange); font-size: 1.05rem; }
.prose h3 { color: var(--yellow2); font-size: 1rem; }
.prose blockquote { margin: 1rem 0; padding: .25rem 1rem; border-left: 4px solid var(--bg2); color: var(--gray); }
.prose code { color: var(--aqua); }
.prose pre { padding: .75rem 1rem; background: var(--bg-hard); overflow-x: auto; clip-path: var(--steps); }
.prose figure { margin: 1rem 0; }
.prose figcaption { color: var(--dim); font-size: .85rem; }
.prose ul { padding-left: 1.25rem; }
.prose li::marker { content: "■ "; color: var(--orange); font-size: .7em; }

@media (max-width: 40rem) {
  .sections.columns { grid-auto-flow: row; gap: 2.5rem; }
  .sections.columns > section { padding: 0; }
  .sections.columns > section + section { border-left: 0; }
}

@media (max-width: 34rem) {
  .top { padding-top: 1.5rem; }
}
