/*
  Blub Builds, type edition.

  Two faces: Chivo (self-hosted, variable 100 to 900, upright only) for the
  mark, titles, navigation and credits; the reader's own serif for reading
  text and film titles.

  One gesture: the home page mark, cut into three strips. See "The mark".
  No images, no icons, no entrance motion. Nothing here needs a script.
*/

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

:root {
  --paper: #faf8f0;
  --trim: #f1efe4;
  --ink: #121826;
  --slate: #4a5263;
  --blue: #223f70;
  --rule: #c3c0b1;
  --white: #ffffff;

  --sans: "Chivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --page: 80rem;
  --measure: 34em;
}

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

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
}

@media (min-width: 48em) {
  body {
    font-size: 1.125rem;
  }
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

main {
  flex: 1 0 auto;
}

[id] {
  scroll-margin-top: 1.5rem;
}

::selection {
  background: var(--blue);
  color: var(--white);
}

a {
  color: var(--ink);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--ink);
}

:focus-visible {
  outline: 0.1875rem solid var(--blue);
  outline-offset: 0.1875rem;
  border-radius: 0.125rem;
}

/* Shared pieces */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: 0;
  z-index: 2;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--white);
  font: 700 0.9375rem/1.2 var(--sans);
  transform: translateY(-120%);
}

.skip:focus {
  color: var(--white);
  transform: none;
}

.stack > * + * {
  margin-top: 1rem;
}

.prose {
  max-width: var(--measure);
}

.note {
  color: var(--slate);
  font: 500 0.875rem/1.5 var(--sans);
}

.label {
  font: 700 0.9375rem/1.3 var(--sans);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.75rem;
  padding: 0;
  list-style: none;
  font: 600 0.9375rem/1.3 var(--sans);
}

.actions a {
  display: inline-block;
  padding-block: 0.4rem;
}

/* The main action is the only filled blue shape on the site. */

.join,
.button {
  display: inline-block;
  padding: 0.62em 1.1em;
  border: 0.125rem solid var(--blue);
  border-radius: 999px;
  font: 700 0.875rem/1.2 var(--sans);
  text-decoration: none;
  white-space: nowrap;
}

.join {
  background: var(--blue);
  color: var(--white);
}

.join:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.join:focus-visible {
  outline-color: var(--ink);
}

.join[aria-current="page"] {
  background: transparent;
  color: var(--blue);
}

.actions .join,
.actions .button {
  padding: 0.75em 1.3em;
  font-size: 0.9375rem;
}

.button {
  border-color: var(--ink);
  background: transparent;
  color: var(--ink);
}

.button:hover {
  background: var(--ink);
  color: var(--paper);
}

/* Header, the same on every page */

.masthead {
  padding-block: 0.75rem 0.25rem;
}

.masthead__in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name join"
    "nav nav";
  align-items: center;
  gap: 0.25rem 1rem;
}

.masthead__name {
  grid-area: name;
  font: 800 1rem/1.2 var(--sans);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.masthead__name a {
  display: inline-block;
  padding-block: 0.6rem;
  color: var(--ink);
  text-decoration: none;
}

.masthead__nav {
  grid-area: nav;
}

.masthead__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  padding: 0;
  list-style: none;
}

.masthead__nav a {
  display: inline-block;
  padding-block: 0.6rem 0.4rem;
  border-bottom: 0.1875rem solid transparent;
  color: var(--ink);
  font: 500 0.9375rem/1.2 var(--sans);
  text-decoration: none;
}

.masthead__nav a:hover {
  border-bottom-color: var(--rule);
}

.masthead__nav a[aria-current="page"] {
  border-bottom-color: var(--blue);
  font-weight: 700;
}

.masthead__join {
  grid-area: join;
  padding-inline: 0.9em;
}

@media (min-width: 48em) {
  .masthead {
    padding-block: 1.5rem 0.75rem;
  }

  .masthead__name {
    font-size: 1.0625rem;
  }

  .masthead__join {
    padding-inline: 1.1em;
  }

  .masthead__in {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "name nav join";
    column-gap: 2.25rem;
  }

  .masthead__nav ul {
    gap: 0 1.75rem;
  }
}

/*
  The mark

  "Blub / Builds" in Chivo 900, cut straight across into three strips.
  The cuts divide its height in the ratio of the running times of the three
  selected films: 5:14, 7:41 and 3:30, so 314 : 461 : 210 seconds.
    --cut-1 = 314 / 985
    --cut-2 = (314 + 461) / 985
  Change the selection and these two numbers, with the three row values on
  .index below, are the whole edit.

  The heading text is in the page once and is the top strip. The other two
  strips are generated copies with empty alternative text. Without
  clip-path the heading is simply the uncut name.
*/

.lead {
  --mark-size: clamp(4.25rem, 24vw, 13rem);
  --cut-1: 31.88%;
  --cut-2: 78.68%;
  --kerf: 0px;
  padding-top: clamp(1.75rem, 6vw, 4.5rem);
  overflow-x: clip;
}

.mark {
  position: relative;
  margin-bottom: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--mark-size);
  font-weight: 900;
  line-height: 0.86;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.mark__strip {
  display: block;
}

@supports (clip-path: inset(0 0 50% 0)) {
  .mark__strip {
    clip-path: inset(-0.2em -0.5em calc(100% - var(--cut-1)) -0.5em);
  }

  .mark::before,
  .mark::after {
    content: "Blub\A Builds";
    content: "Blub\A Builds" / "";
    position: absolute;
    inset: 0;
    white-space: pre;
    pointer-events: none;
  }

  .mark::before {
    clip-path: inset(var(--cut-1) -0.5em calc(100% - var(--cut-2)) -0.5em);
    transform: translateX(0.025em);
  }

  .mark::after {
    clip-path: inset(var(--cut-2) -0.5em -0.2em -0.5em);
    transform: translateX(-0.009em);
  }
}

/* The three films the strips measure. Beside the mark on wide screens. */

.index {
  margin-top: 1.75rem;
  padding: 0;
  list-style: none;
}

.index__film {
  position: relative;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
}

.index__link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 1.2rem;
  align-content: start;
  align-items: baseline;
  column-gap: 0.85rem;
  min-height: 2.75rem;
  padding-block: 0.7rem;
  color: var(--ink);
  text-decoration: none;
}

.index__title {
  grid-column: 1;
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.3;
}

.index__time {
  grid-column: 2;
  grid-row: 1;
  color: var(--slate);
  font-size: 0.9375rem;
  font-weight: 450;
  font-variant-numeric: tabular-nums;
}

.index__direction {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  color: var(--slate);
  font-size: 1rem;
}

.index__date {
  grid-column: 1 / -1;
  color: var(--slate);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.index__link:hover .index__title,
.index__link:focus-visible .index__title {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

@media (prefers-reduced-motion: no-preference) {
  .mark::before,
  .mark::after {
    transition: transform 160ms ease-out;
  }

  .lead:has(.index__link:focus-visible) .mark::before,
  .lead:has(.index__link:focus-visible) .mark::after {
    transform: translateX(0);
  }

  @media (hover: hover) {
    .lead:has(.index__link:hover) .mark::before,
    .lead:has(.index__link:hover) .mark::after {
      transform: translateX(0);
    }
  }
}

.lead__key {
  max-width: 32em;
  margin-top: 1rem;
}

@media (min-width: 68.75em) {
  .lead {
    --mark-size: clamp(9.5rem, 14.25vw, 13rem);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    column-gap: 3.5rem;
  }

  .mark {
    grid-column: 1;
    margin-right: 0.11em;
  }

  /* Same height as the mark, split by the same three running times. */
  .index {
    grid-column: 2;
    display: grid;
    grid-template-rows: minmax(0, 314fr) minmax(0, 461fr) minmax(0, 210fr);
    row-gap: var(--kerf);
    block-size: calc(var(--mark-size) * 1.72 + var(--kerf) * 2);
    margin-top: 0;
  }

  .lead__key {
    grid-column: 1 / -1;
    margin-top: 1.5rem;
  }
}

/* Home, under the mark */

.pitch {
  display: grid;
  gap: 2.75rem 3.5rem;
  padding-top: clamp(3rem, 9vw, 6.5rem);
}

.statement {
  max-width: 14em;
  font: 400 clamp(1.75rem, 4.2vw, 3.125rem)/1.1 var(--serif);
  letter-spacing: -0.012em;
}

.pitch__ask > .actions {
  margin-top: 1.75rem;
}

.pitch__now > * + * {
  margin-top: 0.6rem;
}

.pitch__now > .label + .headline {
  margin-top: 0.5rem;
}

.pitch__now > .pitch__also {
  margin-top: 2rem;
}

.headline {
  max-width: 18em;
  font: 400 clamp(1.375rem, 2.6vw, 1.875rem)/1.18 var(--serif);
}

.headline a {
  color: var(--ink);
  text-decoration-color: var(--blue);
}

.headline a:hover {
  color: var(--blue);
}

@media (min-width: 56em) {
  .pitch {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: start;
  }
}

/* Inner page openers */

.opener {
  padding-block: clamp(2rem, 7vw, 5rem) clamp(1.5rem, 4vw, 3rem);
}

.title {
  color: var(--ink);
  font: 900 clamp(3.25rem, 13vw, 8.5rem)/0.88 var(--sans);
  letter-spacing: -0.035em;
}

.standfirst {
  max-width: 30em;
  margin-top: 1.5rem;
  font-size: clamp(1.1875rem, 2.1vw, 1.5rem);
  line-height: 1.42;
}

.opener > .actions {
  margin-top: 1.5rem;
}

/* A heading on the left, its content on the right. No rule: space separates. */

.row {
  display: grid;
  gap: 0.75rem 3.5rem;
  padding-block: clamp(1.5rem, 4vw, 2.75rem);
}

.row__head {
  font: 800 clamp(1.375rem, 2.4vw, 1.75rem)/1.12 var(--sans);
  letter-spacing: -0.015em;
}

.row__body {
  min-width: 0;
  max-width: 40rem;
}

/*
  A list of like things: films, preview steps, accounts. One light Chivo
  figure on the left, the content on the right, a rule between items.
*/

.entries {
  padding: 0;
  list-style: none;
}

.entry {
  display: grid;
  gap: 0.75rem 3.5rem;
  padding-block: clamp(1.75rem, 4.5vw, 3rem);
  border-top: 1px solid var(--rule);
}

.entry__figure {
  color: var(--ink);
  font: 250 clamp(2.75rem, 7vw, 5rem)/0.9 var(--sans);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.entry__figure--word {
  font-size: clamp(2.25rem, 4.6vw, 3.75rem);
}

/* Arriving by a link to this item marks it. Instant, and needs no script. */
.entry:target > .entry__figure {
  color: var(--blue);
  font-weight: 500;
}

.entry__body {
  min-width: 0;
}

@media (min-width: 56em) {
  .row,
  .entry {
    grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  }
}

/* Films */

.film {
  display: block;
  padding-block: clamp(1.1rem, 2.7vw, 2.3rem);
}

.film__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.65rem 2rem;
}

.film__title {
  max-width: 26em;
  font: italic 400 clamp(1.55rem, 3.3vw, 3rem)/1.12 var(--serif);
  text-wrap: balance;
}

.film__byline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1rem;
  margin-top: 0.55rem;
  color: var(--slate);
  font: 500 0.85rem/1.4 var(--sans);
  font-variant-numeric: tabular-nums;
}

.film__watch {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 2.75rem;
  font: 650 0.95rem/1.2 var(--sans);
  text-decoration: none;
}

.film__watch:hover,
.film__watch:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.film .notes {
  margin-top: 0;
}

.film .notes__in {
  padding-bottom: 0.5rem;
}

.film__release-title {
  color: var(--slate);
  font-size: 0.96rem;
}

.films-opener {
  padding-bottom: clamp(1.25rem, 3vw, 2.5rem);
}

@media (max-width: 40em) {
  .film__head > div {
    flex-basis: 100%;
  }

  .film__head {
    row-gap: 0;
  }

  .film__watch {
    min-height: 2.75rem;
  }

  .film .notes__toggle {
    font-size: 0.875rem;
  }
}

.notes {
  margin-top: 0.75rem;
}

.notes__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding-right: 0.5rem;
  color: var(--ink);
  font: 700 0.9375rem/1.2 var(--sans);
  list-style: none;
  cursor: pointer;
}

.notes__toggle::-webkit-details-marker {
  display: none;
}

/* A plus when shut, a bar when open. Drawn, so nothing extra is read out. */
.notes__toggle::before {
  content: "";
  flex: none;
  inline-size: 0.8125rem;
  block-size: 0.8125rem;
  background:
    linear-gradient(var(--blue), var(--blue)) center / 100% 0.1875rem no-repeat,
    linear-gradient(var(--blue), var(--blue)) center / 0.1875rem 100% no-repeat;
}

.notes[open] > .notes__toggle::before {
  background: linear-gradient(var(--blue), var(--blue)) center / 100% 0.1875rem no-repeat;
}

@media (forced-colors: active) {
  .notes__toggle::before {
    forced-color-adjust: none;
  }
}

/* site.js eases this box's height. It only clips while it is moving. */
.notes__body {
  display: flow-root;
}

.notes__body.is-moving {
  overflow: hidden;
}

.notes__in {
  max-width: var(--measure);
  padding-block: 0.5rem 0.25rem;
}

.notes__in h3 {
  margin-top: 1.75rem;
  font: 700 1rem/1.3 var(--sans);
}

.notes__in h3 + p {
  margin-top: 0.4rem;
}

/* The issue */

.issue__head {
  padding-block: clamp(2rem, 7vw, 5rem) clamp(2rem, 5vw, 3.5rem);
}

.issue__title {
  max-width: 15em;
  font: 400 clamp(2.125rem, 5.6vw, 4.5rem)/1.04 var(--serif);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.issue__head > .note {
  margin-top: 1.25rem;
}

.issue__grid {
  display: grid;
  gap: 2.5rem 4rem;
}

.issue__story > p:first-child {
  font-size: 1.2em;
  line-height: 1.45;
}

.issue__side > .actions {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  margin-top: 0.4rem;
}

.issue__rest > section + section {
  margin-top: clamp(2.25rem, 5vw, 3.25rem);
}

.issue__rest h2 {
  font: 800 1.5rem/1.15 var(--sans);
  letter-spacing: -0.015em;
}

.issue__rest h2 + * {
  margin-top: 0.9rem;
}

.steps {
  max-width: var(--measure);
  padding-left: 1.5em;
}

.steps li {
  padding-left: 0.3em;
}

.steps li + li {
  margin-top: 0.4em;
}

.steps li::marker {
  color: var(--blue);
  font-family: var(--sans);
  font-weight: 700;
}

.steps + .prose {
  margin-top: 1rem;
}

.sources {
  max-width: 44rem;
}

.sources__row {
  display: grid;
  gap: 0.2rem 1.5rem;
  padding-block: 0.9rem;
  border-top: 1px solid var(--rule);
}

.sources__row dt {
  font: 700 0.9375rem/1.5 var(--sans);
}

@media (min-width: 40em) {
  .sources__row {
    grid-template-columns: 10.5rem minmax(0, 1fr);
  }

  .sources__row dt {
    padding-top: 0.15rem;
  }
}

@media (min-width: 62em) {
  .issue__grid {
    grid-template-columns: minmax(0, 36rem) minmax(13rem, 1fr);
  }

  .issue__story {
    grid-column: 1;
    grid-row: 1;
  }

  .issue__side {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    padding-top: 0.35rem;
  }

  .issue__rest {
    grid-column: 1 / -1;
  }
}

/* Signal */

.sheet-list {
  max-width: 26rem;
  padding: 0;
  list-style: none;
  font: 500 0.9375rem/1.4 var(--sans);
}

.sheet-list li {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 0.6rem;
  border-top: 1px solid var(--rule);
}

.sheet-list li > span:first-child {
  color: var(--slate);
}

.sheet-list li > span:last-child {
  font-weight: 700;
}

.row__body > .sheet-list {
  margin-top: 1.75rem;
}

/* Join preview */

.notice {
  max-width: 34rem;
  margin-top: 1.5rem;
  padding-left: 1rem;
  border-left: 0.25rem solid var(--blue);
  font: 700 1.0625rem/1.4 var(--sans);
}

.opener > .notice + .note {
  max-width: 34rem;
  margin-top: 0.9rem;
}

.step__title {
  font: 800 clamp(1.375rem, 2.4vw, 1.75rem)/1.12 var(--sans);
  letter-spacing: -0.015em;
}

.step .entry__body > .note + .step__title {
  margin-top: 0.3rem;
}

.step .entry__body > p {
  max-width: var(--measure);
}

/* The sample email is a different object from the page, so it gets a surface. */
.letter {
  max-width: 34rem;
  padding: 1.25rem 1.5rem 1.4rem;
  border-radius: 0.75rem;
  background: var(--trim);
}

.letter__head {
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
  font: 500 0.875rem/1.5 var(--sans);
}

.letter__head > div {
  display: flex;
  gap: 0.75rem;
}

.letter__head dt {
  flex: none;
  width: 4rem;
  color: var(--slate);
}

.letter__head dd {
  font-weight: 700;
}

/* Footer */

.colophon {
  margin-top: clamp(3.5rem, 9vw, 6.5rem);
  padding-block: 2rem 2.5rem;
  background: var(--trim);
  font: 500 0.875rem/1.5 var(--sans);
}

.colophon__in {
  display: grid;
  gap: 0.4rem 2rem;
}

.colophon__name {
  font-size: 1rem;
  font-weight: 800;
}

.colophon__note {
  color: var(--slate);
}

.colophon__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  padding: 0;
  list-style: none;
}

.colophon__links a {
  display: inline-block;
  padding-block: 0.4rem;
  color: var(--ink);
}

.colophon__links a:hover {
  color: var(--blue);
}

@media (min-width: 62em) {
  .colophon__in {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: baseline;
  }
}
