@font-face {
  font-family: 'Open Sans Light';
  src: url('/fonts/OpenSans-Light-webfont.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Open Sans ExtraBold';
  src: url('/fonts/OpenSans-ExtraBold-webfont.woff') format('woff');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Source Code Pro';
  src: url('/fonts/sourcecodepro-light-webfont.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #e9ebef;
  --sheet: #ffffff;
  --ink: #15181e;
  --ink-2: #545d6b;
  --ink-3: #6b7484;
  --rule: #c9cfd8;
  --rule-soft: #e3e6ec;
  --ink-blue: #1b3a8f;
  --signal: #bd4819;

  --gap: 1.75rem;
  --row-gap: 1.5rem;
  --measure: 34rem;
  --sheet-pad: 3.5rem;
  --rail: 8.5rem;
  --rail-mobile: 1.75rem;
}

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

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

body {
  margin: 0;
  padding: 2rem 1rem 4rem;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Open Sans Light', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.65;
}

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

a {
  color: var(--ink-blue);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.15s ease, color 0.15s ease;
}

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

:focus-visible {
  outline: 2px solid var(--ink-blue);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: 'Open Sans ExtraBold', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

code {
  font-family: 'Source Code Pro', 'Courier New', monospace;
  font-size: 0.9375em;
}

.sheet {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 var(--sheet-pad);
  background: var(--sheet);
  border: 1px solid var(--rule);
}

/* ---------- masthead ---------- */

.masthead {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 1.25rem;
}

/* the rule is drawn on the content column, not the full sheet, so it lines up
   with every other rule on the page */
.masthead::after {
  content: '';
  position: absolute;
  right: var(--sheet-pad);
  bottom: 0;
  left: var(--sheet-pad);
  border-top: 1px solid var(--ink);
}

.wordmark {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.75rem;
}

.wordmark__name {
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

.wordmark__role {
  font-family: 'Source Code Pro', 'Courier New', monospace;
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

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

.masthead__nav a {
  display: inline-block;
  padding: 0.4rem 0;
  font-family: 'Source Code Pro', 'Courier New', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  border-bottom: 0;
}

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

/* ---------- hero: title block + request path ---------- */

.hero {
  padding-top: 3rem;
}

.hero__title {
  font-size: clamp(2.75rem, 8vw, 4.75rem);
  line-height: 0.98;
}

.hero__lede {
  max-width: 30rem;
  margin: 1.5rem 0 0;
  font-size: 1.1875rem;
  line-height: 1.55;
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  font-family: 'Source Code Pro', 'Courier New', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

.hero__facts .signal {
  color: var(--signal);
}

/* the drawing */

.drawing {
  margin: 3.5rem 0 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--ink);
}

.drawing__caption {
  margin: 0 0 1.75rem;
  font-family: 'Source Code Pro', 'Courier New', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

.path {
  display: grid;
  gap: var(--row-gap) var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.path__node {
  position: relative;
  min-width: 0;
  padding-left: var(--rail-mobile);
}

.path__n {
  position: absolute;
  top: 0.15rem;
  left: 0;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid var(--ink);
  background: var(--sheet);
  font-family: 'Source Code Pro', 'Courier New', monospace;
  font-size: 0.625rem;
  line-height: 1.1rem;
  text-align: center;
  color: var(--ink-blue);
}

.path__node + .path__node::after {
  content: '';
  position: absolute;
  top: calc(-1 * var(--row-gap));
  left: 0.625rem;
  height: var(--row-gap);
  border-left: 1px solid var(--rule);
}

.path__name {
  font-size: 1rem;
  line-height: 1.15rem;
}

.path__question {
  max-width: 22ch;
  margin: 0.6rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-2);
}

@media (min-width: 56rem) {
  .path {
    grid-template-columns: repeat(5, 1fr);
  }

  .path__node {
    padding-left: 0;
    padding-top: 2.25rem;
    border-top: 1px solid var(--rule);
  }

  .path__n {
    top: -0.65rem;
  }

  /* the connector spans the column gap and lands on the node's mid-line */
  .path__node + .path__node::before {
    content: '';
    position: absolute;
    top: 0.55rem;
    left: calc(-1 * var(--gap));
    width: calc(var(--gap) - 1px);
    height: 1px;
    border-top: 1px solid var(--rule);
  }

  .path__node + .path__node::after {
    top: calc(0.55rem - 3px);
    left: -9px;
    width: 7px;
    height: 7px;
    border-left: 0;
    border-top: 1px solid var(--ink-blue);
    border-right: 1px solid var(--ink-blue);
    transform: rotate(45deg);
  }

  .path__question {
    max-width: none;
  }
}

/* the title block: a drawing's nameplate, carrying real metadata */

.title-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 3.5rem;
  border: 1px solid var(--ink);
  font-family: 'Source Code Pro', 'Courier New', monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.title-block__cell {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.title-block__cell:nth-child(-n + 2) {
  border-top: 0;
}

.title-block__cell:nth-child(odd) {
  border-left: 0;
}

.title-block dt {
  margin: 0 0 0.15rem;
  color: var(--ink-3);
}

.title-block dd {
  margin: 0;
}

/* ---------- sections ---------- */

.section {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  gap: 0 2rem;
  padding: 3.5rem 0;
  border-top: 1px solid var(--ink);
}

.section__label {
  font-family: 'Source Code Pro', 'Courier New', monospace;
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

.section__body > h2 {
  max-width: 20ch;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  line-height: 1.1;
}

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

.lede {
  margin: 1.25rem 0 0;
  font-size: 1.0625rem;
  color: var(--ink-2);
}

dl {
  margin: 2rem 0 0;
}

.principle {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule-soft);
}

.principle:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.principle dt {
  font-family: 'Open Sans ExtraBold', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.principle dd {
  max-width: var(--measure);
  margin: 0;
  color: var(--ink-2);
}

/* capability spec sheet */

.spec {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0 2.5rem;
  margin-top: 2rem;
}

.spec__group {
  padding: 1.25rem 0;
  border-top: 2px solid var(--ink);
}

.spec__group dt {
  font-family: 'Open Sans ExtraBold', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.spec__group dd {
  margin: 0.5rem 0 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.spec__group dd span {
  display: block;
}

@media (min-width: 56rem) {
  .spec {
    grid-template-columns: 1fr 1fr;
  }
}

/* work entries */

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

.entries > li {
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule-soft);
}

.entries__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.75rem;
}

.entries__head h3 {
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.entries__tag {
  font-family: 'Source Code Pro', 'Courier New', monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.entries p {
  max-width: var(--measure);
  margin: 0.5rem 0 0;
  color: var(--ink-2);
}

.links {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  font-family: 'Source Code Pro', 'Courier New', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.links li {
  display: inline-block;
  margin: 0 1.25rem 0.35rem 0;
}

/* contact */

.contact {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  gap: 0 2rem;
  padding: 3.5rem 0;
  border-top: 1px solid var(--ink);
}

/* the title block already closes the hero with a rule, so the first section
   must not stack a second one on the same pixel */
.hero + .section {
  border-top: 0;
}

.contact__list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.contact__list li {
  padding: 1rem 0;
  border-top: 1px solid var(--rule-soft);
}

.contact__list li:first-child {
  border-top: 0;
}

.contact__list a {
  font-family: 'Open Sans ExtraBold', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.contact__list span {
  display: block;
  font-family: 'Source Code Pro', 'Courier New', monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--rule);
  font-family: 'Source Code Pro', 'Courier New', monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.footer a {
  color: var(--ink-2);
  border-bottom-color: var(--rule);
}

@media (max-width: 47.9375rem) {
  :root {
    --sheet-pad: 1.75rem;
    --rail: 1fr;
  }

  body {
    padding: 1rem 0.75rem 3rem;
  }

  .section,
  .contact {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .section__label {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--rule-soft);
  }

  .principle {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .title-block {
    grid-template-columns: 1fr;
  }

  .title-block__cell,
  .title-block__cell:nth-child(-n + 2) {
    border-top: 1px solid var(--rule);
    border-left: 0;
  }

  .title-block__cell:first-child {
    border-top: 0;
  }
}

/* one orchestrated moment: the path draws itself on load, once */

@keyframes draw {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: no-preference) {
  @media (min-width: 56rem) {
    .path__node + .path__node::before {
      transform-origin: left center;
      animation: draw 0.5s ease-out backwards;
    }
    .path__node:nth-child(2)::before {
      animation-delay: 0.1s;
    }
    .path__node:nth-child(3)::before {
      animation-delay: 0.2s;
    }
    .path__node:nth-child(4)::before {
      animation-delay: 0.3s;
    }
    .path__node:nth-child(5)::before {
      animation-delay: 0.4s;
    }
  }
}
