/* Man-page look: monospace, amber-on-black terminal palette, one accent colour for links only. */

:root {
  --bg: #14130f;
  --fg: #e6dfc8;
  --muted: #a39d86;
  --link: #e0a63a;
  --rule: #e6dfc8;
  --font: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --space: 1.5rem;
  /* Side gutter: 1rem on phones, grows with the viewport on tablets and desktops. */
  --gutter: clamp(1rem, 6vw, 6rem);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 100%;
  line-height: 1.7;
  /* Stop iOS from inflating text in landscape. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: var(--space) var(--gutter) calc(var(--space) * 2);
}

/* The measure lives on the children so the gutter can grow without squeezing the text. */
body > * {
  max-width: 70ch;
}

h1,
h2 {
  font-size: 1rem;
  margin: 0;
  text-transform: uppercase;
}

h1 {
  margin-top: var(--space);
}

h2 {
  margin-top: calc(var(--space) * 1.5);
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--rule);
}

p,
ul {
  margin: 0.75rem 0 0;
}

ul {
  padding: 0;
  list-style: none;
}

li + li {
  margin-top: 0.5rem;
}

li p {
  margin-top: 0;
}

/* Header: name and intro on the left, portrait on the right. Stacks on phones. */
header {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: var(--space);
  align-items: start;
}

header > * {
  grid-column: 1;
}

.portrait {
  grid-column: 2;
  grid-row: 1 / span 3;
  width: 8rem;
  aspect-ratio: 1;
  margin: var(--space) 0 0;
  border: 1px solid var(--rule);
}

.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

a {
  color: var(--link);
  text-underline-offset: 0.2em;
  /* Long URLs wrap instead of pushing the page sideways on phones. */
  overflow-wrap: anywhere;
}

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

/* Phones: portrait on top, text full width below. */
@media (max-width: 40em) {
  header {
    display: block;
  }

  .portrait {
    width: 6rem;
    margin-top: 0;
  }
}

/* Large screens: slightly bigger type, so the 70ch column is not a thin strip. */
@media (min-width: 80em) {
  html {
    font-size: 112.5%;
  }
}
