@font-face { font-family: "Atkinson"; src: url("fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("fonts/atkinson-hyperlegible-next-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("fonts/atkinson-hyperlegible-next-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }

:root {
  /* Colour */
  --paper: #ffffff;
  --ink: #17212b;
  --slate: #4a5866;
  --mist: #edf1f3;
  --rule: #cdd5dc;
  --spruce: #1d6b53;
  --spruce-light: #2b8466;
  --spruce-mid: #4f927a;
  --spruce-dark: #175a46;
  --spruce-deep: #0f3d30;
  --spruce-soft: #d6e8e0;
  /* Interactive: links, focus and hover. Green stays for brand, decoration and data */
  --link: #5b3f9a;
  --link-hover: #47307a;

  /* Type: 1.25 modular scale from an 18px base */
  --step--1: 0.9rem;
  --step-0: 1.125rem;
  --step-1: 1.4rem;
  --step-2: 1.75rem;
  --step-3: clamp(1.9rem, 3.6vw, 2.2rem);
  --step-4: clamp(2.3rem, 5vw, 3.4rem);
  --step-5: clamp(2.6rem, 6.4vw, 4.3rem);

  /* Space: 8px steps */
  --s1: 0.5rem;
  --s2: 1rem;
  --s3: 1.5rem;
  --s4: 2rem;
  --s5: 3rem;
  --s6: 4rem;
  --s7: 6rem;

  --radius: 3px;
  --measure: 40rem;
  --wide: 60rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Atkinson", system-ui, sans-serif;
  font-size: var(--step-0);
  line-height: 1.6;
}

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--gutter); top: 0.75rem; background: var(--paper); padding: var(--s1) 0.75rem; z-index: 10; }

/* Site header */
.site-head {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--s3) var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s4);
  align-items: baseline;
  justify-content: space-between;
}
.site-head .name {
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.site-head .name::before {
  content: "";
  width: 0.8em;
  height: 0.8em;
  background: var(--spruce);
  border-radius: var(--radius);
}
.site-head nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem var(--s3); font-size: 1rem; }
.site-head nav a { color: var(--slate); text-decoration: none; padding-bottom: 0.2rem; border-bottom: 2px solid transparent; }
.site-head nav a:hover { color: var(--link); border-bottom-color: var(--link); }
.site-head nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--spruce); }

main { padding: 0 var(--gutter) var(--s7); }
.col { max-width: var(--wide); margin-left: auto; margin-right: auto; }
.col > * { max-width: var(--measure); }
.facts + .col { margin-top: var(--s5); }
.wide { max-width: var(--wide); margin-left: auto; margin-right: auto; }

h1, h2, h3 { line-height: 1.15; margin: 0; }
h1 { font-weight: 800; letter-spacing: -0.025em; text-wrap: balance; }
h2 { font-size: var(--step-2); font-weight: 700; letter-spacing: -0.015em; margin: var(--s6) 0 var(--s2); }
h3 { font-size: var(--step-1); font-weight: 700; margin: var(--s4) 0 var(--s1); }
p { margin: 0 0 var(--s2); }
ul.points, ol.points { margin: 0 0 var(--s2); padding-left: 1.25rem; }
ul.points li, ol.points li { margin-bottom: var(--s1); }
.lead { font-size: var(--step-1); line-height: 1.45; color: var(--ink); }
.quiet { color: var(--slate); }

/* Featured principle: one idea pulled out of the text */
.principle {
  background: var(--mist);
  border-left: 4px solid var(--spruce);
  padding: var(--s3) var(--s4);
}
.principle p { margin: 0; }
.principle .q { font-size: var(--step-2); font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; }
.principle .q + p { margin-top: var(--s2); color: var(--slate); }

/* Attached to the bottom of a facts panel */
.facts:has(+ .principle) { border-radius: 0; }
.facts + .principle {
  max-width: var(--wide);
  margin: 0 auto;
  border-left: 0;
  border-top: 1px solid var(--rule);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: var(--s3);
}
.facts + .principle > * { max-width: var(--measure); }
.facts + .principle .q { font-size: var(--step-1); }

/* Home hero: headline and lead, then the release timeline */
.hero {
  max-width: var(--wide);
  margin: var(--s5) auto 0;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--s4) var(--s5);
  align-items: end;
}
.hero h1 { font-size: var(--step-5); }
.hero .lead { margin: 0; }
.hero figure { grid-column: 1 / -1; margin: var(--s2) 0 0; }
/* Release timeline: one circle per production release, one lane per release type.
   Lane labels sit in their own column, like a y axis. */
.release-plot {
  --lane-major: 1.1rem;
  --lane-minor: 3.1rem;
  --lane-patch: 5rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
}
/* Width of the lane label column; the caption lines up after it */
.releases { --lane-col: 7rem; }
.release-lanes { position: relative; width: var(--lane-col); font-size: var(--step--1); color: var(--slate); }
.release-lanes span { position: absolute; right: var(--s2); transform: translateY(-50%); line-height: 1.15; text-align: right; white-space: nowrap; }
.release-lanes .lane-major { top: var(--lane-major); }
.release-lanes .lane-minor { top: var(--lane-minor); }
.release-lanes .lane-patch { top: var(--lane-patch); }
.release-plot .release-years { grid-column: 2; }
.release-chart {
  position: relative;
  height: 6.4rem;
  border-bottom: 2px solid var(--ink);
  /* Faint guide line along each lane */
  background-image: linear-gradient(var(--rule), var(--rule)), linear-gradient(var(--rule), var(--rule)), linear-gradient(var(--rule), var(--rule));
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 var(--lane-major), 0 var(--lane-minor), 0 var(--lane-patch);
}
.release-chart .r {
  position: absolute;
  left: var(--x);
  transform: translate(-50%, -50%);
  animation: release-in 360ms ease-out both;
  animation-delay: calc(var(--i) * 22ms + 200ms);
  display: block;
  border-radius: 50%;
  /* A ring in the page colour keeps neighbouring releases apart */
  box-shadow: 0 0 0 2px var(--paper);
}
.release-chart .major { top: var(--lane-major); width: 18px; height: 18px; background: var(--spruce-deep); }
.release-chart .minor { top: var(--lane-minor); width: 12px; height: 12px; background: var(--spruce); }
.release-chart .patch { top: var(--lane-patch); width: 10px; height: 10px; background: var(--spruce-mid); }
.release-years { position: relative; height: 1.75rem; font-size: var(--step--1); color: var(--slate); }
.release-years span {
  position: absolute;
  top: 0.35rem;
  left: var(--x);
  transform: translateX(-50%);
}
.release-years span::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -0.35rem;
  width: 1px;
  height: 0.3rem;
  background: var(--ink);
}
.hero-caption { font-size: var(--step--1); color: var(--slate); margin-top: var(--s1); margin-left: var(--lane-col, 0); }
@keyframes release-in { from { transform: translate(-50%, -50%) scale(0); } to { transform: translate(-50%, -50%) scale(1); } }

/* Home: point of view and work list */
.pov { margin-top: var(--s7); }
.work-band {
  background: var(--mist);
  border-top: 1px solid var(--rule);
  margin: var(--s7) calc(-1 * var(--gutter)) calc(-1 * var(--s7));
  padding: var(--s6) var(--gutter) var(--s7);
}
.work-band h2 { margin-top: 0; font-size: var(--step-3); }
.work { list-style: none; margin: var(--s3) 0 0; padding: 0; }
.col > .work { max-width: none; }
.work li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 17rem);
  grid-template-rows: auto 1fr;
  align-items: start;
  column-gap: var(--s5);
  padding: var(--s4);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.work li + li { margin-top: var(--s2); }
/* The whole card is the link: the title link stretches over the card */
.work h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 6px; }
.work li:hover { border-color: var(--link); box-shadow: 0 0 0 1px var(--link); }
.work li:hover h3 a { color: var(--link); text-decoration: underline; text-decoration-thickness: 2px; }
.work h3 a:focus-visible { outline: none; }
.work li:has(a:focus-visible) { outline: 3px solid var(--link); outline-offset: 3px; }
.work li > * { grid-column: 1; }
.work h3 { margin: 0 0 var(--s1); font-size: var(--step-2); letter-spacing: -0.015em; }
.work h3 a { color: var(--ink); text-decoration: none; }
.work p { margin: 0; max-width: var(--measure); }
.work .proof {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  font-size: 1rem;
  color: var(--slate);
  padding-left: var(--s3);
  border-left: 3px solid var(--spruce);
}

/* Case study header and spec panel */
.case-head { max-width: var(--wide); margin: var(--s5) auto 0; }
.case-head h1 { font-size: var(--step-4); max-width: 20ch; }
.case-head .lead { max-width: var(--measure); margin-top: var(--s3); }
.facts {
  max-width: var(--wide);
  margin: var(--s5) auto 0;
  display: grid;
  /* Four across, or two by two: never three and an orphan */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--mist);
  border-top: 3px solid var(--spruce);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.facts > div {
  padding: var(--s2) var(--s3) var(--s3);
  /* Rules between cells; the panel clips the ones on its outer edges */
  box-shadow: -1px 0 0 var(--rule), 0 -1px 0 var(--rule);
}
.facts dt { font-size: var(--step--1); color: var(--slate); }
.facts dd { margin: 0.25rem 0 0; font-weight: 700; line-height: 1.4; font-variant-numeric: tabular-nums; }

/* Figures */
figure { margin: var(--s5) auto; }
figcaption { font-size: var(--step--1); color: var(--slate); margin-top: 0.75rem; max-width: var(--measure); }
.slot {
  border: 2px dashed var(--rule);
  border-radius: 6px;
  background: var(--mist);
  min-height: 14rem;
  display: grid;
  place-items: center;
  padding: var(--s3);
  text-align: center;
  color: var(--slate);
  font-size: 1rem;
}
.slot strong { display: block; color: var(--ink); margin-bottom: 0.25rem; }

table { width: 100%; border-collapse: collapse; font-size: 1rem; margin: var(--s2) 0 var(--s3); }
th, td { text-align: left; vertical-align: top; padding: 0.75rem 0.75rem 0.75rem 0; border-bottom: 1px solid var(--rule); }
th { font-weight: 700; border-bottom: 2px solid var(--ink); }
.table-wrap { overflow-x: auto; }

.result-list { list-style: none; padding: 0; margin: var(--s3) 0; display: grid; gap: var(--s3); }
.result-list li { padding-left: var(--s3); border-left: 3px solid var(--spruce); }
.result-list b { display: block; font-size: var(--step-2); line-height: 1.2; letter-spacing: -0.015em; margin-bottom: 0.25rem; }

/* Impact band: a full-width tinted band with the results side by side */
.impact-band {
  background: var(--mist);
  margin: var(--s6) calc(-1 * var(--gutter)) 0;
  padding: var(--s5) var(--gutter) var(--s6);
}
.impact-band h2 { margin-top: 0; font-size: var(--step-3); }
.impact-band .result-list { max-width: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); margin-bottom: 0; }
.impact-band .result-list li {
  background: var(--paper);
  border-left: 0;
  border-top: 4px solid var(--spruce);
  border-radius: 0 0 6px 6px;
  padding: var(--s3);
  color: var(--slate);
  font-size: 1rem;
}
.impact-band .result-list b { font-size: var(--step-3); color: var(--spruce-dark); margin-bottom: var(--s1); }

.funnel { width: 100%; height: auto; display: block; }

/* Backlog scoring figure */
.score { border: 1px solid var(--rule); border-radius: 6px; padding: var(--s3); }
.score-terms { display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--s1); }
.term { flex: 1 1 7.5rem; display: flex; flex-direction: column; gap: 0.15rem; padding: 0.75rem; background: var(--mist); border-radius: var(--radius); }
.term b { font-size: 1rem; }
.term span { font-weight: 800; font-size: 1.15rem; color: var(--spruce); }
.term small { font-size: 0.85rem; color: var(--slate); line-height: 1.35; }
.op { align-self: center; font-weight: 800; color: var(--slate); }
.bands { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s1); }
.bands li { padding: 0.6rem 0.75rem; border-radius: var(--radius); display: flex; justify-content: space-between; gap: var(--s1); flex-wrap: wrap; font-size: 1rem; }
.b-urgent { background: var(--spruce); color: #fff; }
.b-high { background: #4f927a; color: #fff; }
.b-medium { background: var(--spruce-soft); }
.b-low { background: var(--mist); }

/* Next page link */
.next-case {
  max-width: var(--wide);
  margin: var(--s7) auto 0;
  padding-top: var(--s3);
  border-top: 3px solid var(--ink);
}
.next-case p { margin: 0; }
.next-case a {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: var(--step-3);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
  text-decoration-color: var(--link);
  text-decoration-thickness: 2px;
}
.next-case a:hover { color: var(--link); text-decoration-thickness: 3px; }

/* Footer band */
.site-foot {
  background: var(--spruce-deep);
  color: var(--spruce-soft);
  padding: var(--s5) max(var(--gutter), calc((100% - var(--wide)) / 2)) var(--s6);
  font-size: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s4);
}
.site-foot a { color: #fff; }
.site-foot a:focus-visible { outline-color: #fff; }

@media (max-width: 860px) {
  .impact-band .result-list { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body { font-size: 1.0625rem; }
  .hero { grid-template-columns: 1fr; gap: var(--s3); margin-top: var(--s4); }
  .release-plot { --lane-major: 1rem; --lane-minor: 2.75rem; --lane-patch: 4.4rem; }
  .release-chart { height: 5.75rem; }
  .releases { --lane-col: 5.6rem; }
  .release-lanes { font-size: 0.8rem; }
  .release-lanes span { right: 0.6rem; }
  .release-chart .major { width: 12px; height: 12px; }
  .release-chart .minor { width: 8px; height: 8px; }
  .release-chart .patch { width: 7px; height: 7px; }
  .work li { grid-template-columns: 1fr; padding: var(--s3); }
  .principle { padding: var(--s3); }
  .work-band { padding-top: var(--s5); }
  .work .proof { grid-column: 1; grid-row: auto; margin-top: var(--s2); }
  .op { display: none; }
  .bands { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .release-chart .r { animation: none; }
  .work li { transition: none; }
}

/* Diagrams, code excerpts and screenshots in case studies */
.diagram-wrap { overflow-x: auto; }
.diagram { display: block; width: 100%; min-width: 600px; height: auto; }
pre.code {
  margin: 0;
  padding: var(--s3);
  background: var(--mist);
  border-left: 3px solid var(--spruce);
  border-radius: 0 var(--radius) var(--radius) 0;
  overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink);
  tab-size: 2;
}
.shot { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 6px; }
