/* Three colours, one weight, one column. That is the whole design.

   Two bands: a full-bleed header and footer stamped at the page edges, and a
   narrow justified column of content centred between them. */

:root {
  --bg: #fff;
  --ink: #2f2f2f;
  --black: #000;
  --orange: #ff7700;
  --edge: clamp(1.25rem, 4vw, 3rem);
  --stamp: 0.6875rem;
  color-scheme: only light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1.45;
  overflow-wrap: break-word;
}

/* Bands ------------------------------------------------------------------ */

header {
  padding-top: 1.5rem;
}

footer {
  padding-top: 4rem;
  padding-bottom: 3rem;
}

/* Corner stamps are the only things that sit at the page edges. Scoped to
   direct children so an article's date stamp stays in the column. */

header > .stamp,
footer > .stamp {
  padding: 0 var(--edge);
}

footer > .stamp {
  margin-top: 3rem;
}

/* Everything else shares one column, all the way down the page. */

main,
.links {
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--edge);
  padding-right: var(--edge);
}

main {
  padding-top: clamp(3rem, 12vh, 9rem);
  padding-bottom: 3rem;
  hyphens: none;
}

/* Justified with no hyphenation, so lines open up at the word gaps rather than
   breaking words. That wide-gap texture is the look — but only once the measure
   is wide enough to absorb it. On a phone the same rule tears holes in the line,
   so below this width everything sets flush left. */

@media (min-width: 40rem) {
  main {
    text-align: justify;
  }
}

/* Stamps — the tiny edge-to-edge lines. A timestamp and a signature, not
   content. No text-align: space-between parks the right item at the right edge
   when it fits, and lets it fall in line left when it wraps. */

.stamp {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  margin: 0;
  font-size: var(--stamp);
  line-height: 1.4;
  text-align: left;
}

/* Type ------------------------------------------------------------------- */

h1 {
  color: var(--black);
  font-size: clamp(1.75rem, 4.4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 2.5rem;
}

h2,
h3,
h4 {
  color: var(--black);
  font-size: 1rem;
  line-height: 1.2;
  margin: 2rem 0 0.75rem;
  text-align: left;
}

p {
  margin: 0 0 1rem;
}

ul,
ol {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  text-align: left;
}

li {
  margin-bottom: 0.375rem;
}

.hl {
  color: var(--orange);
}

.footnote {
  font-size: 0.625rem;
  margin-top: 2.5rem;
  text-align: left;
}

.contact {
  margin-top: 2rem;
  text-align: left;
}

/* Links ------------------------------------------------------------------ */

a {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover,
a:focus {
  background: var(--orange);
  color: var(--bg);
  text-decoration: none;
}

.ext {
  color: var(--orange);
}

/* The log — a plain bullet list at the foot of the page. ------------------ */

#log {
  margin-top: 4.5rem;
  text-align: left;
}

#log h2 {
  margin-top: 0;
}

.log {
  list-style: disc;
  margin: 0;
  padding-left: 1.1rem;
}

.log time {
  margin-right: 0.5rem;
}

/* ** marks an entry I was directly involved with. */

.mine {
  color: var(--orange);
}

/* Hints — CSS-only tooltips, no JavaScript. Dotted underline so the word reads
   as askable; the panel appears instantly on hover or keyboard focus. */

.hint {
  position: relative;
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 0.2em;
}

.hint::after {
  content: attr(data-hint);
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 2;
  width: max-content;
  max-width: min(24rem, 68vw);
  padding: 0.5rem 0.625rem;
  background: var(--black);
  color: var(--bg);
  font-size: var(--stamp);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: left;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
}

.hint:hover::after,
.hint:focus::after {
  opacity: 1;
  visibility: visible;
}

/* Available to screen readers, never painted. */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Footer ----------------------------------------------------------------- */

.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  /* Block-only: the auto side margins from the column rule must survive. */
  margin-block: 0;
  font-size: var(--stamp);
}

/* Article ---------------------------------------------------------------- */

article h1 {
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  margin-bottom: 0.75rem;
  text-align: left;
}

article .stamp {
  margin-bottom: 2.5rem;
}

code,
pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8125rem;
}

pre {
  border: 2px solid var(--black);
  padding: 1rem;
  overflow-x: auto;
  text-align: left;
}

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

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