@import url("https://fonts.googleapis.com/css2?family=Archivo:ital,wdth,wght@0,62..125,100..900;1,62..125,100..900&display=swap");

:root {
  /* Neutral row of the chart, light to dark */
  --n95: #f3f3f2;
  --n80: #c8c8c8;
  --n65: #a0a0a0;
  --n50: #7a7a79;
  --n35: #555555;
  --n20: #343434;

  --page: #ffffff;       /* the infinity cove */
  --ink: var(--n20);     /* body text, 12:1 on white */
  --quiet: var(--n35);   /* secondary text, 7.5:1 on white */
  --rule: var(--n80);

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --measure: 38rem;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  font-stretch: 100%;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

::selection {
  background: var(--n80);
}

/* ---------- Page frame ---------- */

.container {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

.container-inner {
  padding: 0.75rem 0 3rem;
}

.clear {
  clear: both;
}

/* ---------- Feed links (top utility line) ---------- */

#inside-subscribe {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--quiet);
  text-align: right;
}

#inside-subscribe a.feed {
  color: var(--quiet);
}

#inside-subscribe a.feed:hover {
  color: var(--ink);
}

/* ---------- Masthead ---------- */

#masthead {
  padding-top: clamp(2rem, 6vw, 4.5rem);
}

#masthead h4.left {
  float: none;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  column-gap: 2rem;
  row-gap: 0.5rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
}

#masthead h4.left > a {
  grid-column: 1 / -1;
  font-size: clamp(1.25rem, 8.6vw, 2.75rem);
  font-weight: 800;
  font-stretch: 75%;
  line-height: 1;
  letter-spacing: -0.015em;
  white-space: nowrap;
  text-decoration: none;
}

#masthead .description {
  color: var(--quiet);
}

#masthead .contact {
  justify-self: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#masthead .contact br {
  display: none;
}

/* ---------- Main menu: the grey step wedge ---------- */

.sf-menu {
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
}

.sf-menu ul.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--rule);
}

.sf-menu .menu-item {
  margin: 0;
}

.sf-menu .menu-item a {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 4rem;
  height: 100%;
  padding: 0.75rem 0.9rem;
  background: var(--patch);
  color: var(--label);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

/* Patch values in chart order. Labels meet WCAG AA on every patch. */
.sf-menu .menu-item:nth-child(1) a { --patch: var(--n95); --label: #000; }
.sf-menu .menu-item:nth-child(2) a { --patch: var(--n80); --label: #000; }
.sf-menu .menu-item:nth-child(3) a { --patch: var(--n65); --label: #000; }
.sf-menu .menu-item:nth-child(4) a { --patch: var(--n50); --label: #000; }
.sf-menu .menu-item:nth-child(5) a { --patch: var(--n35); --label: #fff; }
.sf-menu .menu-item:nth-child(6) a { --patch: var(--n20); --label: #fff; }

.sf-menu .menu-item a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.sf-menu .menu-item a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -6px;
}

/* Current page: a bar across the top of its patch */
.sf-menu .current-menu-item a::before {
  content: "";
  position: absolute;
  top: 0.75rem;
  left: 0.9rem;
  right: 0.9rem;
  height: 3px;
  background: currentColor;
}

/* ---------- Page content ---------- */

.post {
  margin-top: clamp(2.5rem, 7vw, 5rem);
}

.post p {
  max-width: var(--measure);
  margin: 0 0 1em;
}

/* WordPress leftovers: empty paragraph and empty image link */
.post p:empty,
.post a:empty {
  display: none;
}

.post h2 {
  margin: 0;
  font-weight: 700;
}

/* Section titles: About, Studio (1st, 3rd … h2) */
.post > h2:nth-of-type(odd) {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.125rem;
  font-stretch: 125%;
  line-height: 1.5;
}

.post > h2:first-of-type {
  margin-top: 0;
}

/* Statements: "And they come back for more." etc. (2nd, 4th … h2) */
.post > h2:nth-of-type(even) {
  max-width: var(--measure);
  margin: 2rem 0 1rem;
  font-size: clamp(1.625rem, 4vw, 2.25rem);
  font-weight: 500;
  font-stretch: 75%;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* Opening line of the page reads as a lead */
.post > h2:first-of-type + p {
  font-size: 1.25rem;
  line-height: 1.45;
}

/* ---------- Footer ---------- */

hr {
  height: 1px;
  margin: clamp(3rem, 7vw, 5rem) 0 1.5rem;
  border: 0;
  background: var(--rule);
}

#inside-widgets > div:empty {
  display: none;
}

#footer .quiet {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--quiet);
}

#footer a.feed {
  color: inherit;
}

#footer a.feed:hover {
  color: var(--ink);
}

/* ---------- Wider screens ---------- */

@media (min-width: 40rem) {
  #masthead h4.left > a {
    font-size: clamp(2rem, 5vw, 4.25rem);
    font-stretch: 110%;
  }

  .sf-menu ul.menu {
    grid-template-columns: repeat(6, 1fr);
  }

  .sf-menu .menu-item a {
    min-height: 5.5rem;
  }
}

@media (min-width: 52rem) {
  /* Section titles sit in a left column, text runs in the right one */
  .post {
    display: grid;
    grid-template-columns: minmax(9rem, 14rem) minmax(0, var(--measure));
    column-gap: clamp(2rem, 5vw, 4rem);
    align-items: baseline;
  }

  .post > * {
    grid-column: 2;
  }

  .post > h2:nth-of-type(odd) {
    grid-column: 1;
    margin: 4rem 0 0;
  }

  .post > h2:first-of-type {
    margin-top: 0;
  }

  /* Paragraph beside a section title starts on the same line */
  .post > h2:nth-of-type(odd):not(:first-of-type) + p {
    margin-top: 4rem;
  }
}