/* Shared by every page. Deliberately small: Helvetica, black, blue links. */

:root {
  --ink: #000;
  --paper: #fff;
  --link: #00f;
  --here: #551a8b; /* the page or slide you are on */
  --muted: #555;
  --pad-top: 24px;
  --pad-side: 18px;
  --head-height: 132px; /* wordmark + three nav lines; slides clear this */
  --side: 320px; /* the sidebar: wordmark and page list above, photo block below */
}
@media (max-width: 719px), (max-height: 519px) {
  :root {
    --side: 0px; /* no room for a sidebar */
  }
}

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

body {
  margin: 0;
  padding: var(--pad-top) var(--pad-side) 16px;
  font: 16px/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a,
a:visited {
  color: var(--link);
}

/* Wordmark and page list, top-left on every page */
.site-head {
  margin-bottom: 24px;
}

.mark {
  display: block;
  width: 279px;
  max-width: 70vw;
  margin-bottom: 14px;
}
.mark img {
  display: block;
  width: 100%;
  height: auto;
}

.pages {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-left: 10px; /* the page list sits a step in from the wordmark */
}
.pages a[aria-current] {
  color: var(--here);
}

h1 {
  font-size: 30px;
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 14px;
}

.links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.links li {
  margin-top: 6px;
}

p {
  margin: 0 0 12px;
  max-width: 62ch;
}

/* Wide screens: the header and the photo block are a fixed sidebar on the
   left, and each page centres its content in the space to the right of it. */
@media (min-width: 720px) and (min-height: 520px) {
  body {
    padding: 0;
  }
  .site-head {
    position: fixed;
    top: var(--pad-top);
    left: var(--pad-side);
    z-index: 2;
    margin: 0;
  }
  main {
    margin-left: var(--side);
  }
  /* A page that is not a scroll of slides: one thing, centred */
  .page {
    box-sizing: border-box;
    min-height: 100vh;
    min-height: 100svh;
    padding: var(--pad-top) 24px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Photo, one line, and links 04 and 05. Fixed bottom-left on every page.
   Sizes and offsets are taken from PersonalSiteGraphics.psd at half scale. */
.about {
  position: fixed;
  left: 56px;
  bottom: 56px;
  z-index: 2;
  width: 168px;
  font-size: 13px;
  font-weight: 500;
}
.about-photo {
  position: relative;
  width: 168px;
  height: 168px;
  overflow: hidden;
}
.about-photo img {
  /* The frame shows the picture slightly enlarged, trimmed at left and bottom */
  display: block;
  width: 102.68%;
  height: auto;
  margin-left: -2.98%;
}
.about-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--ink);
}
.about p {
  margin: 3.5px 0 5.5px;
  line-height: 16px;
}
.about-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}
.about-links a[aria-current] {
  color: var(--here);
}

/* Narrow or short screens: one compact row in the bottom-left corner */
@media (max-width: 719px), (max-height: 519px) {
  .about {
    left: var(--pad-side);
    bottom: 16px;
    width: auto;
    display: grid;
    grid-template-columns: 44px auto;
    column-gap: 10px;
    align-content: center;
  }
  .about-photo {
    grid-row: 1 / span 2;
    width: 44px;
    height: 44px;
  }
  .about p {
    margin: 0;
    align-self: end;
  }
  .about-links {
    flex-direction: row;
    gap: 12px;
  }
  /* Pages that scroll normally end with the row instead of pinning it */
  body:not(.deck-page) .about {
    position: static;
    margin-top: 24px;
  }
}

/* "Click for Vibes" (vibes.js): 12pt, blue, underlined, with a loudspeaker, fixed top-right. Hidden until a
   page offers it (page 01, after its first slide) or it has been chosen once; from then on it is on every
   page. Purple, the colour for "the one you are on", while the track plays. */
.vibes {
  position: fixed;
  top: var(--pad-top);
  right: var(--pad-side);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12pt;
  line-height: 1.2;
  color: var(--link);
  cursor: pointer;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s;
}
html.vibes-on .vibes,
html[data-slide]:not([data-slide="1"]) body[data-vibes] .vibes {
  visibility: visible;
  opacity: 1;
}
.vibes span {
  text-decoration: underline;
}
.vibes svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.vibes svg .body {
  fill: currentColor;
}
.vibes.is-playing {
  color: var(--here);
}
/* On pages that scroll under it, a little paper behind the words keeps them readable */
body:not(.deck-page) .vibes {
  padding: 2px 6px;
  margin: -2px -6px;
  background: var(--paper);
}
/* Narrow or short screens: the wordmark and page list have the top, so sit beside the last page link */
@media (max-width: 719px), (max-height: 519px) {
  .vibes {
    top: calc(var(--pad-top) + 100px);
  }
}

/* While music plays, other pages of the site open in this frame, laid over the window that holds the
   player (vibes.js). */
.vibes-frame {
  position: fixed;
  inset: 0;
  z-index: 10;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--paper);
}
html.vibes-shell {
  overflow: hidden;
  scroll-snap-type: none;
}
html.vibes-shell body {
  margin: 0;
  padding: 0;
  overflow: hidden;
}
