/* Deliberately close to unstyled HTML: one monospace face, one narrow column. */

body {
  max-width: 72ch;
  margin: 0 auto;
  padding: 5rem 1.25rem 6rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 15px;
  line-height: 1.6;
}

/* The name is a term you can look up: hover or focus it for the definition. */
.term {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.3em;
  margin: 0 0 0.75rem -0.6rem;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  font-size: 1.55em;
  cursor: help;
  transition: background-color 120ms;
}

.term:hover,
.term:focus-within {
  background: #efefef;
}

/* The chair sits in front of the name like a logo and spins while the name is hovered.
   It is as tall as the heading's letters and stands on their baseline. */
#chair {
  flex: none;
  width: 0.52em;
  height: 0.82em;
}

h1 {
  margin: 0;
  font-size: 1em;
  text-decoration: underline dotted 1px #999;
  text-underline-offset: 0.25em;
}

h1:focus {
  outline: none;
}

h1:focus-visible {
  outline: 2px solid #000;
  outline-offset: 4px;
  border-radius: 4px;
}

.definition {
  position: absolute;
  top: calc(100% + 6px);
  left: 0.6rem;
  z-index: 1;
  box-sizing: border-box;
  width: min(26rem, calc(100vw - 2.5rem));
  padding: 0.75rem 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.12);
  font-size: 14px;
  cursor: auto;
  visibility: hidden;
  opacity: 0;
  transition: opacity 120ms, visibility 120ms;
}

/* Bridges the gap so the pointer can travel from the name onto the tooltip. */
.definition::before {
  content: '';
  position: absolute;
  inset: -7px 0 auto;
  height: 7px;
}

.term:hover .definition,
.term:focus-within .definition {
  visibility: visible;
  opacity: 1;
}

.definition p {
  margin: 0;
}

.definition p + p {
  margin-top: 0.4rem;
}

.hello {
  margin: 0 0 1.5rem;
}

/* Oldest at the top, a rule running down to what's happening now. */
.timeline {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  padding: 0 0 1.4rem 1.75rem;
}

.timeline li::before {
  content: '';
  position: absolute;
  top: 0.5em;
  left: 0;
  box-sizing: border-box;
  width: 9px;
  height: 9px;
  border: 1.5px solid #000;
  border-radius: 50%;
  background: #fff;
}

.timeline li::after {
  content: '';
  position: absolute;
  top: calc(0.5em + 9px);
  bottom: -0.5em;
  left: 4px;
  width: 1px;
  background: #000;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li:last-child::before {
  background: #000;
}

.timeline li:last-child::after {
  display: none;
}

/* Projects sit flush left under their heading. */
h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1em;
}

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

.projects li {
  padding: 0 0 1rem;
}

.projects li:last-child {
  padding-bottom: 0;
}

.projects .about {
  display: block;
}

/* The page signs off with a game's corner readout, showing the visitor's own numbers. */
.hud {
  margin-top: 2.5rem;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.hud .dim {
  color: #767676;
}

.hud .status {
  color: #1a7f37;
}

.hud .status.down {
  color: #cf1f2e;
}

@media (max-width: 40rem) {
  body {
    padding-top: 2.5rem;
  }
}
