@font-face {
  font-family: Roboto;
  src: url("fonts/roboto-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0 24px;
  background: #fff;
  color: #000;
  font-family: Roboto, Arial, sans-serif;
  font-size: clamp(14px, calc(14px + (1vw - 3.2px) * 0.042), 14.4px);
  font-weight: 300;
  line-height: 1.55;
  letter-spacing: 0.3px;
}

p, h2 { margin: 0; }
a { color: inherit; text-underline-offset: 0.1em; }

/* ---------- Intro, contact and menu ---------- */

.sidebar { padding-top: 19.2px; }
.intro, .menu { font-weight: 500; }
.intro p + p { margin-top: 7.5px; }
.contact, .menu { margin-top: 30px; }
.contact a, .menu a { display: block; width: fit-content; }
.contact a { text-decoration: none; }
.contact a:hover { text-decoration: underline; }

/* ---------- Projects ---------- */

main { padding-top: 55px; }
.project + .project { margin-top: 75px; }
.text { padding-top: 19.2px; }
.text h2 { font-size: inherit; font-weight: 500; }
.text p + p { margin-top: 7.5px; }
.text .date { font-size: 12.8px; }
.text .date + p { margin-top: 16px; }

.media {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.project > .media { margin-top: 26px; }
.media img, .media video { display: block; width: 100%; height: auto; }

summary {
  width: fit-content;
  font-weight: 400;
  letter-spacing: normal;
  cursor: pointer;
}
details > .media { margin-top: 12px; }

footer { padding: 43px 0 20px; font-weight: 400; }

/* ---------- Tablet and desktop ---------- */

@media (min-width: 769px) {
  body {
    --side: calc(24.4% + 33px);
    display: grid;
    grid-template-columns: var(--side) minmax(0, 1fr);
    align-items: start;
  }

  /* Intro, contact and menu share one column, so they can't overlap.
     In very short windows the column scrolls by itself. */
  .sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 19.2px 24px 19.2px 0;
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .sidebar > * { flex: none; }
  .sidebar::before { content: ""; order: 1; flex: 0 1 104px; min-height: 16px; }
  .intro { order: 0; max-width: 271px; }
  .contact { order: 2; margin-top: 0; }
  .menu { order: 3; margin-top: auto; padding-top: 16px; }

  .intro p + p, .text p + p { margin-top: 24px; }
  .text .date { margin-top: 0; }
  .text h2 + .date { margin-top: 0; }
  .text .date + p { margin-top: 16px; }

  main { padding-top: 0; }
  .project {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
    gap: 12px;
    align-items: start;
  }
  .project > .media { margin-top: 0; padding-top: 25.6px; }
  .media { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media > * { grid-column: 1 / -1; }
  .media > .half { grid-column: auto; }
}
