@font-face {
  font-family: "ITC New Baskerville";
  src: url("fonts/ITCNewBaskerville-Roman.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "ITC New Baskerville";
  src: url("fonts/ITCNewBaskerville-Italic.woff") format("woff");
  font-weight: 400;
  font-style: italic;
  font-display: block;
}

@font-face {
  font-family: "ITC New Baskerville";
  src: url("fonts/ITCNewBaskerville-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

/* Starting points: no default margins, and headings and links that look like the text around them */

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

:root {
  /* Only a light colour scheme is supported, so that browsers do not invert the page in dark mode */
  color-scheme: light;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family:
    "ITC New Baskerville",
    Baskerville,
    "Times New Roman",
    serif;
  /* Set outright, so the text stays visible on devices that adjust colours in dark mode */
  color: #000000;
  -webkit-user-select: none;
  user-select: none;
}

/* Desktop Safari clips macOS font smoothing off the tops of large glyphs. On macOS, turn smoothing off and
   restore the weight it added with a hairline stroke instead (0.09px matches the design's weight for
   ITC New Baskerville) */
.mac body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-stroke-width: 0.09px;
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: inherit;
  font-weight: inherit;
}

a {
  color: inherit;
  text-decoration: inherit;
}

/* Only the text itself can be selected, not the space around it */
p,
h1,
span,
a {
  -webkit-user-select: text;
  user-select: text;
}

::selection {
  background: rgba(0, 0, 0, 0.1);
  color: inherit;
}

/* The home page. One column on a narrow screen; from 860px, the name on the left, which stays put, and
   the text on the right, with both starting halfway down the window. */

main {
  min-height: 100vh;
  padding: 22vh 24px;
  font-size: 22px;
  line-height: 1.2222;
}

.columns {
  display: grid;
  row-gap: 1.2222em;
  max-width: 540px;
  margin: 0 auto;
}

header span {
  font-size: 0.9em;
  font-weight: 700;
}

article > * + * {
  margin-top: 1.2222em;
}

.links {
  display: grid;
}

.links a {
  width: max-content;
  color: #909090;
  transition: color 500ms ease-out;
}

.links a + a {
  margin-top: 8px;
}

.links a:hover {
  color: #000000;
}

@media (min-width: 860px) {
  main {
    padding-top: 50vh;
    font-size: 28px;
  }

  .columns {
    grid-template-columns: 384px 540px;
    column-gap: 37px;
    justify-content: center;
    max-width: none;
  }

  /* The name sits 2.3px higher than the text beside it, as in the design it was drawn from */
  header {
    position: sticky;
    top: calc(50vh - 2.3px);
    align-self: start;
    margin-top: -2.3px;
  }
}

/* The guestbook archive */

.archive {
  display: grid;
  place-items: center;
  height: 100vh;
  margin-top: 256px;
}

.archive > div {
  display: flex;
}

.archive h1 {
  font-size: 24px;
  line-height: 36px;
}

.entries {
  margin-left: 64px;
}

.entry {
  max-width: 576px;
}

.entry + .entry {
  margin-top: 16px;
}

.entry p {
  margin-top: 8px;
  color: #999999;
}

@media (min-width: 640px) {
  .archive h1 {
    font-size: 30px;
  }
}
