:root {
  color-scheme: dark;
  --bg: #090b0c;
  --panel: #0b0f11;
  --ink: #f0eee9;
  --muted: #7d8284;
  --quiet: #505658;
  --line: rgba(240, 238, 233, .14);
  --line-strong: rgba(240, 238, 233, .28);
  --accent: #ef684f;
  --sans: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Roboto Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
}

body {
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { font: inherit; }

.page {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  padding: 28px clamp(24px, 4vw, 76px) 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 9%, rgba(24, 54, 68, .24), transparent 29%),
    linear-gradient(112deg, #090a0b 0%, #0a0d0f 55%, #071116 100%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: .12;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
}

.masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 34px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  color: #929798;
  font: 600 10px/1 var(--mono);
  letter-spacing: .12em;
}

.masthead__state { color: var(--ink); }
.masthead > :last-child { justify-self: end; }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(300px, 3fr);
  align-items: end;
  gap: clamp(28px, 5vw, 80px);
  padding: clamp(24px, 3.5vh, 42px) 0 clamp(24px, 3.5vh, 38px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font: 600 10px/1 var(--mono);
  letter-spacing: .14em;
}

.intro h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(40px, 4vw, 68px);
  font-weight: 650;
  line-height: .98;
  letter-spacing: -.055em;
  text-wrap: balance;
}

.intro__summary {
  display: grid;
  gap: 13px;
  align-self: end;
  max-width: 440px;
  padding-bottom: 3px;
}

.intro__summary p {
  margin: 0;
  color: #a4a8a8;
  font-size: clamp(13px, .9vw, 15px);
  line-height: 1.65;
  text-wrap: pretty;
}

.intro__summary span {
  color: #686e70;
  font: 600 9px/1 var(--mono);
  letter-spacing: .1em;
}

.workflow {
  position: relative;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: rgba(9, 12, 13, .42);
}

.phase-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-height: 72px;
  border-bottom: 1px solid var(--line);
}

.phase {
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 0 18px;
  border-left: 1px solid var(--line);
}

.phase:first-child { border-left: 0; }
.phase--intake { grid-column: 1 / 3; }
.phase--decision { grid-column: 3 / 5; }
.phase--delivery { grid-column: 5 / 7; }
.phase--learning { grid-column: 7 / 8; }

.phase small {
  color: var(--muted);
  font: 600 8px/1 var(--mono);
  letter-spacing: .12em;
}

.phase strong {
  font-size: clamp(15px, 1.05vw, 18px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.02em;
}

.phase--decision small,
.phase--decision strong { color: var(--accent); }

.flow {
  --progress: 0%;
  --progress-opacity: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-height: 245px;
}

.flow__base {
  position: absolute;
  top: 150px;
  left: calc(100% / 14);
  right: calc(100% / 14);
  z-index: 1;
  height: 1px;
  background: rgba(240, 238, 233, .28);
}

.flow__base::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-top: 1px solid #929697;
  border-right: 1px solid #929697;
  transform: rotate(45deg);
}

.flow__base span {
  display: block;
  width: var(--progress);
  height: 2px;
  margin-top: -1px;
  background: var(--accent);
  opacity: var(--progress-opacity);
  transition: width .42s cubic-bezier(.16, 1, .3, 1), opacity .18s ease;
}

.step {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-rows: 18px 42px 24px 42px 38px;
  justify-items: center;
  align-items: start;
  min-width: 0;
  min-height: 245px;
  padding: 28px 13px 18px;
  border: 0;
  border-left: 1px solid rgba(240, 238, 233, .07);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  text-align: center;
  cursor: pointer;
  outline: none;
}

.step:first-of-type { border-left: 0; }

.step__code {
  color: #737879;
  font: 600 8px/1 var(--mono);
  letter-spacing: .08em;
  white-space: nowrap;
}

.step__title {
  align-self: center;
  max-width: 150px;
  font-size: clamp(13px, .92vw, 16px);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.step__role {
  color: #666c6d;
  font: 500 8px/1.25 var(--mono);
  letter-spacing: .02em;
  white-space: nowrap;
}

.step--lead .step__code,
.step--lead .step__role { color: var(--accent); }

.step__marker {
  align-self: center;
  width: 13px;
  height: 13px;
  border: 1px solid #818687;
  border-radius: 50%;
  background: var(--panel);
  transition: background-color .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.step--lead .step__marker { border-color: var(--accent); }

.step__output {
  align-self: end;
  color: #808586;
  font-size: 10px;
  line-height: 1.25;
  text-wrap: balance;
}

.step:is(:hover, :focus-visible, .is-active) .step__marker {
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 0 0 6px rgba(240, 238, 233, .07);
}

.step--lead:is(:hover, :focus-visible, .is-active) .step__marker {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 6px rgba(239, 104, 79, .11);
}

.flow.has-active .step:not(.is-active):not(.is-upstream) { opacity: .28; }
.flow.has-active .step.is-upstream { opacity: .62; }
.step { transition: opacity .2s ease; }

.responsibility {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-height: 96px;
  border-top: 1px solid var(--line);
}

.responsibility__label {
  grid-column: 1 / 3;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 15px 18px;
  border-right: 1px solid var(--line);
}

.responsibility__label small {
  color: var(--accent);
  font: 600 8px/1 var(--mono);
  letter-spacing: .1em;
}

.responsibility__label strong {
  font-size: 14px;
  font-weight: 600;
}

.criterion {
  position: relative;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 15px 16px 15px 20px;
  border-top: 2px solid var(--accent);
  border-right: 1px solid rgba(239, 104, 79, .22);
  background: rgba(239, 104, 79, .025);
}

.criterion:nth-of-type(2) { grid-column: 3; }
.criterion:nth-of-type(3) { grid-column: 4; }
.criterion:nth-of-type(4) { grid-column: 5; }
.criterion:nth-of-type(5) { grid-column: 6; }

.criterion small {
  color: var(--accent);
  font: 600 8px/1 var(--mono);
  letter-spacing: .08em;
}

.criterion strong {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  text-wrap: balance;
}

.return-path {
  position: relative;
  min-height: 86px;
  border-top: 1px solid rgba(240, 238, 233, .08);
}

.return-path svg {
  position: absolute;
  inset: 8px 0 4px;
  width: 100%;
  height: 72px;
  overflow: visible;
  pointer-events: none;
}

.return-path path {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.return-path__base {
  stroke: rgba(240, 238, 233, .17);
  stroke-width: 1;
}

.return-path__active {
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 6 8;
  opacity: .4;
}

.return-path__arrow {
  stroke: var(--accent);
  stroke-width: 1.5;
  opacity: .8;
}

.return-path.is-active .return-path__active {
  opacity: 1;
  animation: returnFlow .9s linear infinite;
}

.return-path__copy {
  position: absolute;
  left: calc((100% / 7) * 2 + 18px);
  bottom: 15px;
  display: flex;
  align-items: baseline;
  gap: 18px;
  max-width: calc((100% / 7) * 4 - 36px);
}

.return-path__copy small {
  color: var(--accent);
  font: 600 8px/1 var(--mono);
  letter-spacing: .1em;
  white-space: nowrap;
}

.return-path__copy strong {
  color: #858a8b;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  text-wrap: pretty;
}

.legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 46px;
  padding-top: 15px;
  color: #666c6d;
  font: 500 8px/1.2 var(--mono);
  letter-spacing: .04em;
}

.legend > div {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend i {
  width: 7px;
  height: 7px;
  border: 1px solid #74797a;
  border-radius: 50%;
}

.legend i.legend__lead { border-color: var(--accent); }
.legend p { margin: 0; text-align: right; }

@keyframes returnFlow {
  to { stroke-dashoffset: -14; }
}

@media (max-width: 1100px) {
  .page { min-height: auto; overflow: visible; }
  .intro { grid-template-columns: 1fr; }
  .intro__summary { max-width: 650px; }

  .workflow { border-bottom: 0; }
  .phase-row { display: none; }

  .flow {
    display: block;
    min-height: auto;
  }

  .flow__base {
    top: 48px;
    bottom: 48px;
    left: 20px;
    right: auto;
    width: 1px;
    height: auto;
  }

  .flow__base::after { display: none; }
  .flow__base span { display: none; }

  .step {
    width: 100%;
    grid-template-columns: 42px minmax(130px, 1fr) minmax(120px, .7fr);
    grid-template-rows: 18px 30px 22px;
    justify-items: start;
    min-height: 94px;
    padding: 17px 16px 14px 48px;
    border-left: 0;
    border-bottom: 1px solid rgba(240, 238, 233, .08);
    text-align: left;
  }

  .step__code { grid-column: 2; grid-row: 1; }
  .step__title { grid-column: 2; grid-row: 2; align-self: center; max-width: none; }
  .step__role { grid-column: 2; grid-row: 3; }
  .step__marker {
    position: absolute;
    top: 42px;
    left: 20px;
    transform: translate(-50%, -50%);
  }
  .step__output {
    grid-column: 3;
    grid-row: 1 / 4;
    align-self: center;
    justify-self: end;
    text-align: right;
  }

  .responsibility {
    grid-template-columns: repeat(4, 1fr);
    min-height: auto;
  }

  .responsibility__label {
    grid-column: 1 / -1;
    min-height: 72px;
    border-right: 0;
  }

  .criterion:nth-of-type(n) { grid-column: auto; }
  .return-path { min-height: 78px; }
  .return-path svg { display: none; }
  .return-path__copy {
    position: static;
    display: grid;
    max-width: none;
    padding: 22px 18px;
  }
}

@media (max-width: 680px) {
  .page { padding: 20px 18px; }
  .masthead { grid-template-columns: 1fr auto; }
  .masthead > :last-child { display: none; }
  .intro { padding: 30px 0; }
  .intro h1 { font-size: clamp(38px, 12vw, 54px); }

  .step {
    grid-template-columns: 1fr;
    grid-template-rows: 18px 30px 22px 24px;
    min-height: 112px;
    padding-left: 48px;
  }

  .step__code,
  .step__title,
  .step__role,
  .step__output {
    grid-column: 1;
    justify-self: start;
    text-align: left;
  }

  .step__code { grid-row: 1; }
  .step__title { grid-row: 2; }
  .step__role { grid-row: 3; }
  .step__output { grid-row: 4; align-self: end; }

  .responsibility { grid-template-columns: repeat(2, 1fr); }
  .criterion:nth-of-type(n) { min-height: 82px; }

  .legend {
    display: grid;
    gap: 14px;
  }

  .legend p { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
