/* IntroRelay
   Colors, type and spacing are set once here. Change a value in :root and
   the whole site follows. */

:root {
  --paper: #F3F1EC;
  --ink: #121210;
  --muted: #5E5B55;
  --rule: rgba(18, 18, 16, 0.18);

  --accent: #E8441F;       /* the dot, buttons, highlights */
  --accent-deep: #B3300E;  /* accent for small text on the light background */

  --on-ink: #F3F1EC;
  --on-ink-muted: #B5B1A8;
  --rule-on-ink: rgba(243, 241, 236, 0.24);

  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --pad: clamp(1.25rem, 4.2vw, 3.75rem);
  --max: 86rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.25, 1);
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
svg { display: block; }

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

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

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--pad);
  top: -5rem;
  z-index: 30;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 0.75rem; }

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

/* Small uppercase label with the accent dot */
.label {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.label::before {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
}
.label span { color: var(--ink); }

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.85rem 1.35rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: 600 1rem/1.1 var(--sans);
  text-decoration: none;
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}
.btn svg {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  transition: transform 0.35s var(--ease);
}
.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}
.btn:hover svg { transform: translateX(4px); }

.btn-small {
  min-height: 2.75rem;
  padding: 0.6rem 1.05rem;
  font-size: 0.94rem;
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}
.btn-accent:hover {
  background: var(--on-ink);
  border-color: var(--on-ink);
  color: var(--ink);
}

.text-link {
  display: inline-block;
  padding-block: 0.6rem;
  font-weight: 600;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.3em;
  transition: color 0.2s;
}
.text-link:hover { color: var(--accent-deep); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
}
.brand-mark { width: 2.7rem; height: auto; }
.brand-dot { fill: var(--accent); }
.brand-name {
  font-size: 1.3rem;
  font-weight: 460;
  font-stretch: 90%;
  letter-spacing: -0.02em;
  line-height: 1;
}
.brand-name b { font-weight: 800; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.site-nav ul {
  display: flex;
  gap: 1.75rem;
}
.site-nav a:not(.btn) {
  position: relative;
  display: inline-block;
  padding-block: 0.6rem;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.3rem;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.site-nav a:not(.btn):hover::after,
.site-nav a[aria-current="true"]::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.95rem;
  border: 1px solid var(--ink);
  background: none;
  color: var(--ink);
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(2.75rem, 6.5vw, 5.75rem) clamp(3rem, 6.5vw, 5.5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 1.5rem;
  align-items: end;
  margin-top: clamp(1.25rem, 2.5vw, 2rem);
}

.hero h1 {
  grid-column: 1 / span 8;
  font-size: clamp(2.85rem, 8.6vw, 7.9rem);
  font-weight: 720;
  font-stretch: 84%;
  line-height: 0.93;
  letter-spacing: -0.032em;
  word-spacing: 0.04em;
  text-wrap: balance;
}

.hero-copy {
  grid-column: 9 / -1;
  padding-bottom: 0.5rem;
}

.lede {
  max-width: 34ch;
  font-size: clamp(1.15rem, 1.55vw, 1.4rem);
  line-height: 1.42;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 1.75rem;
}

/* ---------- The relay line: two ends, one dot that travels across ---------- */

.relay-line {
  position: relative;
  display: block;
  min-width: 3rem;
  height: 1.5px;
  background: currentColor;
}
.relay-line::before,
.relay-line::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0.62rem;
  height: 0.62rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: var(--paper);
  transform: translate(-50%, -50%);
}
.relay-line::before { left: 0; }
.relay-line::after { left: 100%; }

.relay-dot {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 100%;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
}

@keyframes relay {
  from { left: 0; }
  to { left: 100%; }
}

.relay-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.5rem;
  row-gap: 1.1rem;
  margin-top: clamp(3rem, 6vw, 5.5rem);
}
.relay-hero .relay-end {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
  text-wrap: balance;
}
.relay-hero .relay-end:first-child { grid-area: 1 / 1; }
.relay-hero .relay-end:last-child { grid-area: 1 / 2; text-align: right; }
.relay-hero .relay-line {
  grid-area: 2 / 1 / 3 / 3;
  height: 2px;
  margin-block: 0.7rem;
}
.relay-hero .relay-line::before,
.relay-hero .relay-line::after {
  width: 0.85rem;
  height: 0.85rem;
  border-width: 2px;
}
.relay-hero .relay-dot {
  width: 1.4rem;
  height: 1.4rem;
  animation: relay 1.9s 0.75s var(--ease-inout) both;
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(4rem, 9vw, 8rem);
  border-top: 1px solid var(--ink);
}

.section-head h2 {
  max-width: 17ch;
  margin-top: 1.25rem;
  font-size: clamp(1.95rem, 4.3vw, 3.6rem);
  font-weight: 690;
  font-stretch: 88%;
  line-height: 1;
  letter-spacing: -0.026em;
  text-wrap: balance;
}

.section-head-wide {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 3rem;
}

.section-note {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 1.5rem;
  row-gap: 2.5rem;
}
.split > .section-head { grid-column: 1 / span 5; }
.split-body { grid-column: 7 / -1; }

.aside {
  max-width: 46ch;
  margin-top: 2rem;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}
.aside a {
  color: var(--ink);
  font-weight: 600;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.25em;
}
.aside a:hover { color: var(--accent-deep); }
.aside-wide { margin-top: 2.5rem; }

/* How it works */

.steps { border-top: 1px solid var(--ink); }
.steps li {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  column-gap: 1rem;
  padding-block: 1.6rem;
  border-bottom: 1px solid var(--rule);
}
.step-no {
  padding-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.steps h3 {
  font-size: 1.4rem;
  font-weight: 660;
  font-stretch: 92%;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.steps p {
  max-width: 44ch;
  margin-top: 0.45rem;
  color: var(--muted);
}

/* Selected work */

.ledger {
  margin-top: clamp(2rem, 4.5vw, 3.75rem);
  border-top: 1px solid var(--ink);
}

.row {
  position: relative;
  display: grid;
  grid-template-columns: 3rem 15rem minmax(0, 1fr) 9rem;
  column-gap: 1.5rem;
  align-items: baseline;
  padding-block: clamp(1.4rem, 2.6vw, 2.1rem);
  border-bottom: 1px solid var(--rule);
}
.row::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}
.row:hover::before { transform: scaleX(1); }

.row-no,
.row-tag,
.row-type {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--muted);
}
.row-tag { color: var(--ink); }
.row-type { text-align: right; }

.row-text {
  max-width: 32ch;
  font-size: clamp(1.3rem, 2.35vw, 2.05rem);
  font-weight: 470;
  font-stretch: 94%;
  line-height: 1.16;
  letter-spacing: -0.015em;
}
.row-text strong {
  font-weight: 760;
  background: linear-gradient(
    transparent 62%,
    rgba(232, 68, 31, 0.3) 62%,
    rgba(232, 68, 31, 0.3) 94%,
    transparent 94%
  );
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Industries */

.pairs {
  margin-top: clamp(2rem, 4.5vw, 3.75rem);
  border-top: 1px solid var(--ink);
}

.pair {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 1.5rem;
  align-items: center;
  padding-block: clamp(1.5rem, 2.8vw, 2.3rem);
  border-bottom: 1px solid var(--rule);
}

.pair-name {
  grid-column: 1 / span 4;
  font-size: clamp(1.3rem, 2.2vw, 1.9rem);
  font-weight: 680;
  font-stretch: 90%;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.pair .relay {
  grid-column: 5 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(4rem, 0.9fr) minmax(0, 1fr);
  column-gap: 1.75rem;
  align-items: center;
}
.pair .relay-end {
  font-size: 1.05rem;
  line-height: 1.3;
  text-wrap: balance;
}

/* ---------- Contact ---------- */

.contact {
  padding-block: clamp(4.5rem, 10vw, 9rem) clamp(3rem, 6vw, 5rem);
  background: var(--ink);
  color: var(--on-ink);
}
.contact :focus-visible,
.site-footer :focus-visible { outline-color: var(--accent); }

.contact .label { color: var(--on-ink-muted); }
.contact .label span { color: var(--on-ink); }

.contact h2 {
  max-width: 13ch;
  margin-top: 1.5rem;
  font-size: clamp(2.6rem, 7.6vw, 6.9rem);
  font-weight: 720;
  font-stretch: 84%;
  line-height: 0.94;
  letter-spacing: -0.032em;
  text-wrap: balance;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: clamp(2.5rem, 6vw, 5rem);
  border-top: 1px solid var(--rule-on-ink);
  border-bottom: 1px solid var(--rule-on-ink);
}
.contact-card { padding: 2rem 2rem 2.4rem 0; }
.contact-card + .contact-card {
  padding-left: 2rem;
  border-left: 1px solid var(--rule-on-ink);
}
.contact-card h3 {
  font-size: 1.55rem;
  font-weight: 660;
  font-stretch: 92%;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.contact-card p {
  max-width: 36ch;
  margin-top: 0.6rem;
  color: var(--on-ink-muted);
}
.contact-card .btn { margin-top: 1.6rem; }

.contact-next {
  max-width: 62ch;
  margin-top: 1.75rem;
  color: var(--on-ink-muted);
}
.contact-next a {
  color: var(--on-ink);
  font-weight: 600;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.25em;
}
.contact-next a:hover { color: var(--accent); }

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 1.75rem 2.25rem;
  background: var(--ink);
  color: var(--on-ink-muted);
  border-top: 1px solid var(--rule-on-ink);
  font-size: 0.92rem;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2.5rem;
}
.site-footer .brand { color: var(--on-ink); }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.6rem;
}
.footer-links a {
  display: inline-block;
  padding-block: 0.7rem;
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--on-ink);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* ---------- Motion ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

.hero-label { animation: rise 0.7s var(--ease) both; }
.hero h1 { animation: rise 0.9s 0.08s var(--ease) both; }
.hero-copy { animation: rise 0.9s 0.22s var(--ease) both; }
.relay-hero { animation: rise 0.9s 0.36s var(--ease) both; }

/* Sections fade up as they scroll into view. Only when scripts are running. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.75s ease, transform 0.75s var(--ease);
}
.js [data-reveal].is-in,
.show-all [data-reveal] {
  opacity: 1;
  transform: none;
}
.steps li:nth-child(2),
.row:nth-child(2),
.pair:nth-child(2),
.contact-card:nth-child(2) { transition-delay: 0.07s; }
.steps li:nth-child(3),
.row:nth-child(3),
.pair:nth-child(3) { transition-delay: 0.14s; }

.js .relay[data-relay] .relay-dot { left: 0; }
.js .relay[data-relay].is-in .relay-dot {
  animation: relay 1.5s 0.3s var(--ease-inout) both;
}
.show-all .relay[data-relay] .relay-dot { left: 100%; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .js .relay[data-relay] .relay-dot { left: 100%; }
}

/* ---------- Tablet ---------- */

@media (max-width: 62rem) {
  .hero-grid { display: block; }
  .hero-copy { margin-top: 2rem; padding-bottom: 0; }
  .lede { max-width: 40ch; }

  .split { display: block; }
  .split-body { margin-top: 2.5rem; }

  .row { grid-template-columns: 2.5rem 11.5rem minmax(0, 1fr); }
  .row-type {
    grid-column: 3;
    margin-top: 0.7rem;
    text-align: left;
  }

  .pair { display: block; }
  .pair .relay { margin-top: 1rem; }
}

/* ---------- Phone ---------- */

@media (max-width: 47.5rem) {
  /* Without scripts the links sit in a row under the logo. */
  .header-row { flex-wrap: wrap; row-gap: 0; }
  .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.9rem;
  }
  .site-nav ul { gap: 1.1rem; }

  /* With scripts they fold into a menu. */
  .js .header-row { flex-wrap: nowrap; }
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    width: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.1rem var(--pad) 1.75rem;
    background: var(--paper);
    border-bottom: 1px solid var(--ink);
  }
  .js .site-nav.is-open { display: flex; }
  .js .site-nav ul {
    flex-direction: column;
    gap: 0.1rem;
    width: 100%;
  }
  .js .site-nav a:not(.btn) {
    display: block;
    padding-block: 0.7rem;
    font-size: 1.4rem;
    font-weight: 620;
    font-stretch: 90%;
    letter-spacing: -0.015em;
  }
  .js .site-nav a:not(.btn)::after { display: none; }

  .relay-hero .relay-end { font-size: 0.72rem; }

  .steps li { grid-template-columns: 1fr; row-gap: 0.5rem; }
  .step-no { padding-top: 0; }

  .row {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 0.9rem;
    row-gap: 0.75rem;
  }
  .row-text,
  .row-type { grid-column: 1 / -1; }
  .row-type { margin-top: 0; }

  .pair .relay {
    grid-template-columns: 1fr;
    row-gap: 0.2rem;
  }
  .pair .relay-line { margin-block: 0.85rem; }

  .contact-grid { grid-template-columns: 1fr; }
  .contact-card { padding-right: 0; }
  .contact-card + .contact-card {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--rule-on-ink);
  }

  .footer-row { align-items: flex-start; flex-direction: column; }
}
