/* Editorial treatment for the technician tooling case study. */

:root {
  --accent: #168846;
  --accent-dark: #0c5f30;
  --accent-ink: #082b18;
  --accent-soft: #e4f0e7;
  --alarm: #ea5a58;
  --alarm-soft: #f6dedd;
  --canvas: #fff;
  --figure: #f2f2f0;
  --ink: #181817;
  --line: #deded9;
  --muted: #6c6c67;
  --reading: 42rem;
  --soft: #fafaf8;
  --wide: 68rem;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  color: var(--ink);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  background: var(--canvas);
  color: var(--ink);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  margin: 0;
}

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

a {
  border-bottom: 0;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: #a3a39d;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: currentcolor;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.skip {
  background: var(--ink);
  color: #fff;
  left: 1rem;
  padding: 0.75rem 1rem;
  position: fixed;
  top: -5rem;
  z-index: 20;
}

.skip:focus {
  top: 1rem;
}

.site-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.82rem;
  gap: 1.25rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 90rem;
  padding: 1.15rem clamp(1.25rem, 4vw, 3rem);
}

.site-header a {
  border-bottom: 0;
  text-decoration: none;
}

.site-header strong {
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: flex-end;
}

.article-head {
  margin: 0 auto;
  max-width: 58rem;
  padding: clamp(5rem, 12vw, 10rem) 1.25rem clamp(4rem, 9vw, 7rem);
  text-align: center;
}

.article-head h1 {
  font-size: var(--type-display);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.92;
  margin: 0;
  text-wrap: balance;
}

.dek {
  color: #4c4c48;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  letter-spacing: -0.02em;
  line-height: 1.45;
  margin: 2.25rem auto 0;
  max-width: 38rem;
  text-wrap: balance;
}

.byline {
  align-items: center;
  display: flex;
  font-size: 0.84rem;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 2rem;
}

.byline-org::before {
  content: "\2022";
  margin-right: 0.65rem;
}

.gate-wall {
  margin: 0 auto;
  max-width: var(--reading);
  padding: 0 1.25rem 7rem;
}

.gate-locked main > *:not(.article-head):not(.gate-wall) {
  display: none;
}

.gate-locked main > .article-head.article-head {
  display: block;
  padding-bottom: 3rem;
}

.gate-locked .gate-wall {
  display: grid;
}

.hero-figure,
.wide-figure {
  margin: 0 auto;
  max-width: var(--wide);
  padding-inline: 1.25rem;
}

.hero-stage {
  align-items: center;
  background: #eeeeeb;
  display: flex;
  justify-content: center;
  min-height: clamp(26rem, 64vw, 43rem);
  overflow: hidden;
  padding: clamp(2rem, 7vw, 6rem);
  position: relative;
}

.hero-stage::before {
  background:
    linear-gradient(#ffffffb8, #ffffffb8),
    repeating-linear-gradient(
      90deg,
      transparent 0 4.8rem,
      #d7d7d1 4.8rem calc(4.8rem + 1px)
    );
  content: "";
  inset: 0;
  opacity: 0.55;
  position: absolute;
}

.hero-stage img {
  filter: drop-shadow(0 2.2rem 2.5rem rgb(25 25 20 / 0.15));
  height: auto;
  max-height: 38rem;
  max-width: 100%;
  mix-blend-mode: multiply;
  object-fit: contain;
  outline: 1px solid oklch(0 0 0 / 0.1);
  outline-offset: -1px;
  position: relative;
  width: auto;
  z-index: 1;
}

figcaption {
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.45;
  margin: 0.8rem auto 0;
  max-width: var(--reading);
}

.article {
  margin: 0 auto;
  max-width: var(--reading);
  padding: clamp(5rem, 10vw, 8rem) 1.25rem 8rem;
}

.article > p {
  font-size: clamp(1.08rem, 1.6vw, 1.2rem);
  letter-spacing: -0.012em;
  line-height: 1.66;
  margin: 0 0 1.15em;
}

.article .lead {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  letter-spacing: -0.025em;
  line-height: 1.45;
}

.article h2 {
  font-size: var(--type-section);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1;
  margin: 3em 0 0.4em;
  text-wrap: balance;
}

.article h3 {
  font-size: 1.35rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 2.75em 0 0.8em;
}

.facts {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 4rem 0 5rem;
}

.fact {
  padding: 1.3rem 0;
}

.fact:nth-child(odd) {
  border-right: 1px solid var(--line);
  padding-right: 1.3rem;
}

.fact:nth-child(even) {
  padding-left: 1.3rem;
}

.fact:nth-child(-n + 2) {
  border-bottom: 1px solid var(--line);
}

.fact strong {
  display: block;
  font-size: 2.2rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -0.06em;
}

.fact span {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

blockquote {
  border-left: 0.28rem solid var(--ink);
  color: var(--ink);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin: 2.25em 0;
  padding-left: 1.25rem;
}

.article blockquote p {
  font-size: inherit;
  line-height: inherit;
  margin: 0;
}

blockquote cite {
  color: var(--muted);
  display: block;
  font-size: 0.75rem;
  font-style: normal;
  letter-spacing: 0;
  margin-top: 1rem;
}

.wide-break {
  margin-block: clamp(3rem, 8vw, 6rem);
  margin-inline: calc((min(var(--wide), 100vw - 2.5rem) - 100%) / -2);
}

.figure-stage {
  background: var(--figure);
  overflow-x: auto;
  padding: clamp(1.5rem, 5vw, 4rem);
}

.figure-title {
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 1.5rem;
}

.diagram-host {
  min-width: 34rem;
}

@media (max-width: 45rem) {
  .figure-stage:has(.diagram-host > svg)::before {
    color: var(--muted);
    content: "Swipe to see the full diagram \2192";
    display: block;
    font-size: 0.75rem;
    line-height: 1.4;
    margin-block-end: 1rem;
    position: sticky;
    inset-inline-start: 0;
    width: max-content;
  }

  .diagram-host:has(.lv-grid) {
    min-width: 0;
  }
}

.diagram-host > svg {
  display: block;
  height: auto;
  margin-inline: auto;
  max-width: var(--dg-figure-width, 640px);
  overflow: visible;
  width: 100%;
}

.diagram-host > .lv-heading,
.diagram-host > .lv-grid {
  margin-inline: auto;
  max-width: 60rem;
}

.diagram-host .lv-icon {
  height: 34px;
  max-width: none;
  min-width: 0;
  width: 34px;
}

.diagram-host--wide {
  --dg-figure-width: 760px;
}

.proof-interlude {
  background: var(--accent);
  color: var(--accent-ink);
  margin: 7rem calc(50% - 50vw);
  padding: clamp(5rem, 16vw, 11rem) 1.25rem;
  text-align: center;
  width: 100vw;
}

.proof-interlude p {
  font-size: var(--type-feature);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.92;
  margin: 0 auto;
  max-width: 74rem;
  text-wrap: balance;
}

.proof-interlude small {
  display: block;
  font-size: 0.78rem;
  margin-top: 2.5rem;
}

.admission {
  background: var(--alarm-soft);
  margin: 5rem calc(50% - 50vw);
  padding: clamp(4rem, 10vw, 8rem)
    max(1.25rem, calc((100vw - var(--reading)) / 2));
  width: 100vw;
}

.admission p {
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  letter-spacing: -0.045em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

.admission small {
  display: block;
  font-size: 0.78rem;
  margin-top: 1.5rem;
}

.chain {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, 1fr);
}

.chain-card {
  background: #fff;
  min-height: 14rem;
  padding: 1.25rem;
}

.chain-card strong {
  display: block;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.chain-card b,
.chain-card span {
  display: block;
}

.chain-card b {
  font-size: 0.84rem;
  margin-top: 2.4rem;
}

.chain-card span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
  margin-top: 0.35rem;
}

.chain-card--end {
  background: var(--alarm-soft);
}

.chain-card--end strong {
  color: #2b1110;
}

.gates {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, 1fr);
}

.gate-card {
  background: #fff;
  min-height: 15rem;
  padding: 1.25rem;
}

.gate-card strong {
  color: var(--accent-dark);
  display: block;
  font-size: clamp(2.3rem, 6vw, 4.2rem);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -0.07em;
}

.gate-card b {
  display: block;
  font-size: 0.9rem;
  margin-top: 1.8rem;
}

.gate-card span {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  line-height: 1.35;
  margin-top: 0.3rem;
}

.paths {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.path {
  background: #fff;
  padding: 1.25rem;
}

.path b {
  display: block;
  font-size: 0.84rem;
}

.path span {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  line-height: 1.4;
  margin-top: 0.35rem;
}

.path ol {
  display: grid;
  gap: 0.45rem;
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
}

.path li {
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: 0.75rem;
  min-height: 2.4rem;
  padding: 0.65rem 0.8rem;
}

.path li:first-child,
.path li:last-child {
  background: var(--accent-soft);
  border-color: #c5dccb;
}

.stage-map {
  --stage-accent: var(--accent);
  color: var(--ink);
}

.stage-map__label {
  align-items: baseline;
  display: flex;
  font-weight: 600;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.stage-map__label span {
  color: var(--muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

.stage-map__stages {
  counter-reset: stage;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.stage-map__stage {
  counter-increment: stage;
  min-width: 0;
  position: relative;
}

.stage-map__stage:not(:last-child)::after {
  color: #777;
  content: "\2192";
  font-size: 1.25rem;
  inset-block-start: 0.5rem;
  inset-inline-end: -1.125rem;
  line-height: 1;
  position: absolute;
}

.stage-map__title {
  align-items: baseline;
  background: #fff;
  border: 1px solid #aaa;
  border-radius: 999px;
  box-shadow:
    0 1px 3px rgb(0 0 0 / 0.1),
    0 1px 2px rgb(0 0 0 / 0.06);
  display: flex;
  font-weight: 600;
  gap: 0.45rem;
  min-height: 2.25rem;
  padding: 0.45rem 0.75rem;
}

.stage-map__title::before {
  color: #777;
  content: counter(stage, decimal-leading-zero);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

.stage-map__steps {
  display: grid;
  gap: 1rem;
  list-style: none;
  margin: 1rem 0 0 0.75rem;
  padding: 0 0 0 1.25rem;
  position: relative;
}

.stage-map__steps::before {
  background: #999;
  content: "";
  inset-block: 0.35rem;
  inset-inline-start: 0;
  position: absolute;
  width: 1px;
}

.stage-map__steps li {
  line-height: 1.35;
  position: relative;
}

.stage-map__steps li::before {
  background: #777;
  border: 2px solid var(--figure);
  border-radius: 50%;
  box-shadow: 0 0 0 1px #777;
  content: "";
  height: 0.45rem;
  inset-block-start: 0.42rem;
  inset-inline-start: -1.45rem;
  position: absolute;
  width: 0.45rem;
}

.stage-map__signal {
  color: var(--stage-accent);
  font-weight: 600;
}

.stage-map__signal::before {
  background: var(--stage-accent);
  box-shadow: 0 0 0 1px var(--stage-accent);
}

.stage-map__tag {
  color: #777;
  display: block;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
  text-transform: uppercase;
}

.results {
  border-top: 1px solid var(--line);
  display: grid;
  margin: 2.5rem 0;
}

.result {
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  padding: 0.9rem 0;
}

.result span {
  color: var(--muted);
  font-size: 0.82rem;
}

.result strong {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  text-align: right;
}

.closing {
  border-top: 1px solid var(--line);
  margin-top: 7rem;
  padding-top: 2rem;
}

.closing p {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.next {
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.8rem;
  gap: 1.25rem 2rem;
  justify-content: space-between;
  margin-top: 4rem;
  padding-top: 2rem;
}

.page-footer {
  align-items: baseline;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.8rem;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 90rem;
  padding: 2rem clamp(1.25rem, 4vw, 3rem);
}

.page-footer a {
  border-bottom: 0;
  text-decoration: none;
}

.page-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

@media (max-width: 56rem) {
  .chain,
  .gates,
  .paths {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 51rem) {
  .stage-map__stages {
    grid-template-columns: 1fr;
  }

  .stage-map__stage:not(:last-child) {
    padding-bottom: 1rem;
  }

  .stage-map__stage:not(:last-child)::after {
    content: "\2193";
    inset-block-end: -0.5rem;
    inset-block-start: auto;
    inset-inline-end: auto;
    inset-inline-start: 1rem;
  }
}

@media (max-width: 45rem) {
  .article-head {
    text-align: left;
  }

  .dek {
    margin-left: 0;
    text-wrap: pretty;
  }

  .byline {
    justify-content: flex-start;
  }

  .result {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }
}

@media (max-width: 30rem) {
  .chain,
  .gates,
  .paths {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
