/*
  Civitas Cybersecurity, first design pass.

  The site reads as a drawing set for a plant: black sheets drawn in gold line,
  warm drafting-paper pages, and a pipe that runs down the left of every page
  from the plant at the top to the conversation at the bottom. Oxblood, the
  company's colour, is the thread between them.
  docs/design.md explains the choices. Gold never carries text on a light
  background, and the red used for findings stays well away from oxblood.
*/

/* ---------- Fonts: IBM Plex, self-hosted (SIL Open Font License) ---------- */

@font-face {
  font-family: "Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-latin-300-normal.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  /* Three colours with set jobs. Black is the ground of the big sheets: the
     header, the opening section and the footer. Oxblood is the company's colour,
     and runs through every screen: the drawings beside the text, the notes, the
     phone's strip, the headings, the pipe and the closing band. Gold is the
     line. */
  --night: #120708;
  --night-2: #1e0c0f;
  --night-line: rgba(201, 162, 74, 0.22);
  --oxblood: #4a0e15;
  --oxblood-2: #5e1720;
  --oxblood-deep: #2b080b;
  --gold: #c9a24a;
  --gold-pale: #f0dda6;
  --paper: #f2eae0;
  --paper-2: #e9ded0;
  --ink: #161112;
  --ink-2: #59403f;
  --rule: #d6c6b6;
  --on-night: #f3eee4;
  --on-night-2: #c6b2ac;
  --signal: #e5533d;
  --pipe: rgba(74, 14, 21, 0.5);
  --pipe-fill: rgba(74, 14, 21, 0.06);

  --sans: "Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --wrap: 75rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --rail: 6rem;
  --measure: 40rem;
  --chamfer: 10px;

  /* Hover. An effect starts at once and eases into place, and fades back
     more slowly once the pointer leaves, so nothing snaps. Movement, such as
     a fill sweeping across a button or an underline drawing itself, uses the
     sweep times, which Pause Motion and less motion set to nothing. Colour
     changes keep their fade. A press shows at once. */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --hover-in: 0.3s;
  --hover-out: 0.5s;
  --sweep-in: var(--hover-in);
  --sweep-out: var(--hover-out);
}

.still {
  --sweep-in: 0s;
  --sweep-out: 0s;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --sweep-in: 0s;
    --sweep-out: 0s;
  }
}

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

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

/* Behind the page is black, not paper: a phone pulled past either end of the
   page shows black beside the header and footer, and nothing pale shows
   around the header while one sheet changes to the next. The paper is the
   rail's own background. */
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
  background: var(--night);
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--oxblood);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a {
  transition: text-decoration-thickness var(--hover-out) var(--ease-out), color var(--hover-out) var(--ease-out);
}

a:hover {
  text-decoration-thickness: 2px;
  transition-duration: var(--hover-in);
}

/* Links in the text, the breadcrumb and the footer's address draw their
   underline: a fine line at rest, and on hover a heavier one drawn over it
   from the left, like a pen going back over the line. */
.more,
.eyebrow a,
.tb-cell > a {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%, 0 100%;
  background-size: 100% 1px, 0 2px;
  transition: background-size var(--sweep-out) var(--ease-out), color var(--hover-out) var(--ease-out);
}

.more:hover,
.eyebrow a:hover,
.tb-cell > a:hover {
  background-size: 100% 1px, 100% 2px;
  transition-duration: var(--sweep-in), var(--hover-in);
}

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

.dark :focus-visible,
.site-header :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--gold);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

h1 {
  font-size: clamp(2.5rem, 6.4vw, 5.25rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.85rem, 3.4vw, 2.85rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.muted {
  color: var(--ink-2);
}

.dark .muted {
  color: var(--on-night-2);
}

/* On paper, each section's heading carries the company's colour */
.section h2 {
  color: var(--oxblood);
}

::selection {
  background: var(--oxblood);
  color: var(--on-night);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--gold);
  color: var(--night);
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

/* Monospace captions: the drawing set's second voice */
.eyebrow,
.caption,
.tag,
.kicker {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
  color: var(--gold);
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border: 1px solid currentColor;
  line-height: 1.3;
}

.kicker {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--ink-2);
}

.lead {
  font-size: clamp(1.15rem, 1.8vw, 1.375rem);
  line-height: 1.55;
  max-width: 38rem;
}

/* ---------- Buttons: machined plates with cut corners ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* The hero's proof line: three promises under the buttons */
.proof-line {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  max-width: 34rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-pale);
}

.proof-line li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.6rem;
  background: var(--gold);
  vertical-align: middle;
}

.button {
  --cut: var(--chamfer);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.35rem;
  background: var(--gold);
  color: var(--night);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  background-image: linear-gradient(var(--gold-pale), var(--gold-pale));
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 0 100%;
  transition: background-size var(--sweep-out) var(--ease-out);
}

.button::after {
  content: "";
  width: 0.9rem;
  height: 0.6rem;
  background: currentColor;
  clip-path: polygon(0 42%, 70% 42%, 70% 0, 100% 50%, 70% 100%, 70% 58%, 0 58%);
  transition: transform var(--sweep-out) var(--ease-out);
}

/* On hover a paler fill sweeps across from the left, the way product fills
   the pipe, and the arrow glides on. It drains back when the pointer leaves.
   The fill grows from no width at all rather than sliding in from beyond the
   edge, because a fill parked beyond the edge shows a one-pixel sliver there
   in some browsers. */
.button:hover {
  background-size: 100% 100%;
  transition-duration: var(--sweep-in);
}

.button:hover::after {
  transform: translateX(4px);
  transition-duration: var(--sweep-in);
}

.button.secondary {
  background-color: var(--night);
  background-image: linear-gradient(rgba(201, 162, 74, 0.14), rgba(201, 162, 74, 0.14));
  color: var(--gold);
  box-shadow: inset 0 0 0 1.5px var(--gold);
}

.on-paper .button.secondary {
  background-color: var(--paper);
  background-image: linear-gradient(rgba(74, 14, 21, 0.07), rgba(74, 14, 21, 0.07));
  color: var(--oxblood);
  box-shadow: inset 0 0 0 1.5px var(--oxblood);
}

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

.site-header {
  --header-h: 4.5rem;
  position: relative;
  z-index: 10;
  background: var(--night);
  color: var(--on-night);
  border-bottom: 1px solid var(--night-line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  min-height: var(--header-h);
}

.wordmark {
  --name-size: 1.15rem;
  --word-size: 0.7rem;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  color: var(--on-night);
  text-decoration: none;
}

.wordmark-main {
  font-weight: 600;
  font-size: var(--name-size);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* "Cybersecurity" sits centred on the capitals of "Civitas" rather than on
   its baseline. Plex Sans and Plex Mono both draw capitals 0.698 em tall, so
   lifting the smaller word by half the difference in height centres it. */
.wordmark-sub {
  font-family: var(--mono);
  font-size: var(--word-size);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  transform: translateY(calc((var(--name-size) - var(--word-size)) * -0.349));
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav > ul {
  display: flex;
  align-items: center;
  gap: 0.25rem 1.75rem;
}

.site-nav a:not(.button) {
  display: inline-block;
  padding: 0.5rem 0;
  color: var(--on-night);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color var(--hover-out) var(--ease-out);
}

.site-nav a:not(.button):hover,
.site-nav a[aria-current]:not(.button) {
  color: var(--gold);
  transition-duration: var(--hover-in);
}

/* A top link draws the gold line that marks the current page as you point
   at it */
.site-nav > ul > li > a:not(.button) {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 2px;
  transition: color var(--hover-out) var(--ease-out), background-size var(--sweep-out) var(--ease-out);
}

.site-nav > ul > li > a:not(.button):hover {
  background-size: 100% 2px;
  transition-duration: var(--hover-in), var(--sweep-in);
}

.site-nav .button[aria-current] {
  background: var(--gold-pale);
}

.site-nav a[aria-current]:not(.button) {
  box-shadow: inset 0 -2px 0 var(--gold);
}

.site-nav .button {
  padding: 0.6rem 1rem;
}

.site-nav .button::after {
  display: none;
}

/* Sectors runs the full height of the header, so its menu hangs from the
   header's bottom line, and the pointer stays on Sectors all the way down to
   the menu. */
.has-sub {
  position: relative;
  display: flex;
  align-items: center;
  height: var(--header-h);
}

/* The arrow's button is wider than the arrow, for an easier target. Its
   empty right side reaches into the gap after it, so Sectors sits evenly
   between its neighbours. */
.sub-toggle {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-left: 0.15rem;
  margin-right: -0.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  cursor: pointer;
}

.sub-toggle::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--sweep-in) var(--ease-out);
}

.sub-toggle[aria-expanded="true"]::before {
  transform: translateY(2px) rotate(-135deg);
}

/* The menu's gold top edge lies on the header's bottom line. The menu stays
   hidden but present, so it can fade and close after a short grace period
   instead of vanishing the moment the pointer slips off. */
.sub {
  position: absolute;
  top: 100%;
  left: -1rem;
  min-width: 13rem;
  padding: 0.5rem 0;
  background: var(--oxblood-deep);
  border: 1px solid var(--night-line);
  border-top: 2px solid var(--gold);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s var(--ease-out) 0.25s, transform 0.25s var(--ease-out) 0.25s, visibility 0s linear 0.5s;
}

.sub a:not(.button) {
  display: block;
  padding: 0.6rem 1rem;
}

.has-sub:hover .sub,
.has-sub:focus-within .sub,
.sub.open {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity var(--hover-in) var(--ease-out), transform var(--sweep-in) var(--ease-out), visibility 0s;
}

/* ---------- Dark sheets: hero, bands, footer ---------- */

.dark {
  background-color: var(--night);
  color: var(--on-night);
}

.dark a:not(.button) {
  color: var(--gold);
}

.hero {
  position: relative;
  overflow: hidden;
  background-color: var(--night);
  background-image:
    linear-gradient(rgba(201, 162, 74, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 162, 74, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(201, 162, 74, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 162, 74, 0.035) 1px, transparent 1px);
  background-size: 200px 200px, 200px 200px, 40px 40px, 40px 40px;
  background-position: -1px -1px;
  color: var(--on-night);
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding-top: clamp(3rem, 8vw, 6.5rem);
}

.hero h1 {
  max-width: 13em;
}

.hero .lead {
  margin: 1.75rem 0 0;
  color: var(--on-night-2);
}

.hero-art {
  --art-h: clamp(15rem, 37.5vw, max(37.5rem, 16vw));
  --p: 0.55;
  position: relative;
  z-index: 1;
  margin: clamp(-9rem, -10vw, -2rem) 0 0;
  pointer-events: none;
  /* An oxblood glow along the skyline, like a plant lit at dusk */
  background: radial-gradient(ellipse 62% 80% at 50% 100%, rgba(74, 14, 21, 0.85), rgba(74, 14, 21, 0) 72%);
}

/* The drawing is 4000 by 600, far wider than any screen. Keeping the box no
   wider than that ratio means a wide screen crops only the sides, never the
   tops of the towers. --p is how far across the drawing the crop sits, from 0
   at its left end to 1 at its right, and the redlines use it too. */
.hero-art img {
  width: 100%;
  height: var(--art-h);
  object-fit: cover;
  object-position: calc(var(--p) * 100%) 100%;
}



/* Inner pages: a shorter sheet, with a crop of a drawing */
.hero--page .hero-copy {
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
}

.hero--page h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.5rem);
}

.hero--page .hero-art {
  margin-top: clamp(1rem, 3vw, 2.5rem);
}

.hero--page .hero-art {
  --art-h: max(10rem, 18vw);
}

/* Each page shows its own stretch of the plant. The two sector pages have
   drawings of their own, built around the middle, so they show it centred. */
.art-left {
  --p: 0;
}

.art-wells {
  --p: 0.16;
}

.art-control {
  --p: 0.14;
}

.art-centre {
  --p: 0.5;
}

.art-columns {
  --p: 0.52;
}

.art-mid {
  --p: 0.62;
}

.art-power {
  --p: 0.84;
}

/* Home sits a little left of centre, so a laptop sees the whole pumpjack */
.hero:not(.hero--page) .hero-art {
  --p: 0.49;
}

/* Each redline opens a note. A hotspot sits over its cloud by the same sums
   the browser uses to crop the drawing: scaled to the box's height, then
   shifted by --p. draw_plant.py writes every cloud's --x, --y, --rx and --ry
   at the end of this file. Where the browser can't anchor a note to its cloud,
   the note opens in the middle of the screen instead. */
.redline {
  position: absolute;
  left: calc(var(--x) * var(--art-h) / 600 - var(--p) * (var(--art-h) * 20 / 3 - 100%));
  top: calc(var(--y) * var(--art-h) / 600);
  width: max(2.75rem, calc(var(--rx) * var(--art-h) / 300));
  height: max(2.75rem, calc(var(--ry) * var(--art-h) / 300));
  translate: -50% -50%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  pointer-events: auto;
}

/* While its note is open, a cloud fills in red, so it's clear which cloud the
   note belongs to. Keyboard focus also traces the cloud's outline in gold.
   The outline's box is the ellipse the cloud is drawn around, the same size
   as the hotspot before its minimum for a finger. */
.redline-fill {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--rx) * var(--art-h) / 300);
  height: calc(var(--ry) * var(--art-h) / 300);
  translate: -50% -50%;
  overflow: visible;
  pointer-events: none;
}

.redline-fill path {
  fill: var(--signal);
  fill-opacity: 0;
  stroke: none;
  transition: fill-opacity var(--hover-out) var(--ease-out);
}

.redline:focus-visible {
  outline: none;
}

.redline.on .redline-fill path,
.redline:focus-visible .redline-fill path {
  fill-opacity: 0.55;
  transition-duration: var(--hover-in);
}

.redline:focus-visible .redline-fill path {
  stroke: var(--gold-pale);
  stroke-width: 2.5px;
  vector-effect: non-scaling-stroke;
}

/* Until a note has been open this visit, the clouds blink twice every five
   seconds, like a beacon, so they read as something to press rather than part
   of the drawing without nagging anyone reading beside them. The blinking
   starts as the clouds appear, once the drawing has plotted in, and holds off
   for a cloud with keyboard focus. With Pause Motion or less motion, the
   clouds hold a little more red instead. */
:root:not(.noted) .redline:not(:focus-visible) .redline-fill path {
  fill-opacity: 0.2;
}

@media (prefers-reduced-motion: no-preference) {
  :root:not(.noted):not(.still) .redline:not(:focus-visible) .redline-fill path {
    stroke: var(--signal);
    vector-effect: non-scaling-stroke;
    animation: blink 5s ease-in-out 3.1s infinite backwards;
  }
}

@keyframes blink {
  0%,
  20%,
  40%,
  100% {
    fill-opacity: 0;
    stroke-width: 0;
  }

  10%,
  30% {
    fill-opacity: 0.28;
    stroke-width: 4.5px;
  }
}

.redline-note {
  width: min(22rem, calc(100vw - 2rem));
  padding: 1rem 1.15rem 1.1rem;
  border: 0;
  background: var(--oxblood-deep);
  color: var(--on-night);
  box-shadow: inset 0 0 0 1px var(--night-line);
  clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer));
  pointer-events: auto;
}

@supports (position-area: top) {
  .redline-note {
    inset: auto;
    margin: 0.6rem 0;
    position-area: top;
    position-try-fallbacks: flip-block, top span-right, top span-left, bottom span-right, bottom span-left;
  }
}

/* On a computer a note rises a little into place, which draws the eye to the
   one that opens by itself on a first visit */
@media (min-width: 48.0625rem) and (prefers-reduced-motion: no-preference) {
  .redline-note:popover-open {
    animation: note-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
}

@keyframes note-in {
  from {
    opacity: 0;
    translate: 0 0.6rem;
  }
}

/* On a phone the note is a sheet along the bottom of the screen instead. It
   slides up, and a swipe down puts it away. */
@media (max-width: 48rem) {
  .redline-note {
    inset: auto 0 0;
    width: auto;
    max-width: 32rem;
    margin: 0 auto;
    padding: 1.7rem max(var(--gutter), env(safe-area-inset-left)) calc(0.6rem + env(safe-area-inset-bottom));
    position-area: none;
    position-try-fallbacks: none;
    box-shadow: inset 0 1.5px 0 var(--gold);
    clip-path: polygon(var(--chamfer) 0, calc(100% - var(--chamfer)) 0, 100% var(--chamfer), 100% 100%, 0 100%, 0 var(--chamfer));
    touch-action: none;
    translate: 0 100%;
    transition: translate 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), overlay 0.32s allow-discrete, display 0.32s allow-discrete;
  }

  .redline-note:popover-open {
    translate: 0 0;
  }

  @starting-style {
    .redline-note:popover-open {
      translate: 0 100%;
    }
  }

  .redline-note::before {
    content: "";
    position: absolute;
    top: 0.6rem;
    left: 50%;
    width: 2.5rem;
    height: 3px;
    translate: -50% 0;
    background: var(--night-line);
  }

  .redline-note.dragging {
    transition: none;
  }
}

.redline-note p {
  margin: 0;
  color: var(--on-night-2);
  font-size: 0.95rem;
  line-height: 1.5;
}

.redline-note .note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.note-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.redline-note .meter i {
  width: 0.65rem;
  background: rgba(243, 238, 228, 0.16);
}

.redline-note .meter[data-level="4"] i:nth-child(-n + 4),
.redline-note .meter[data-level="3"] i:nth-child(-n + 3),
.redline-note .meter[data-level="2"] i:nth-child(-n + 2),
.redline-note .meter[data-level="1"] i:nth-child(-n + 1) {
  background: var(--gold-pale);
}

.redline-note .meter[data-level="5"] i {
  background: var(--signal);
}

.redline-note .note-title {
  margin-bottom: 0.35rem;
  color: var(--on-night);
  font-size: 1.1rem;
  font-weight: 600;
}

.redline-note .finding-code {
  margin-right: 0.35rem;
  color: var(--gold);
  font-weight: 400;
}

.redline-note .more {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--gold-pale);
}

.redline-note :focus-visible {
  outline-color: var(--gold);
}

/* Previous and Next step from one redline's note to the next along the drawing */
.redline-note .note-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.85rem;
  border-top: 1px solid var(--night-line);
  color: var(--on-night-2);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.note-step {
  min-height: 2.75rem;
  padding: 0 0.15rem;
  border: 0;
  background: none;
  color: var(--gold);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.note-step {
  transition: color var(--hover-out) var(--ease-out);
}

.note-step:hover {
  color: var(--gold-pale);
  transition-duration: var(--hover-in);
}

.note-step[data-step="-1"]::before {
  content: "\2190\00a0";
}

.note-step[data-step="1"]::after {
  content: "\00a0\2192";
}

/* ---------- The pipe rail ---------- */

.rail {
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .29 0 0 0 0 .05 0 0 0 0 .08 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.section {
  position: relative;
}

.section + .section .section-body {
  border-top: 1px solid var(--rule);
}

.section-grid {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  column-gap: clamp(1rem, 3vw, 2.5rem);
}

.section-body {
  padding-block: clamp(3rem, 7vw, 6rem);
  min-width: 0;
}

.section-body > p,
.section-body > ul,
.section-body > ol {
  max-width: var(--measure);
}

.section-body > .values,
.section-body > .nameplates,
.section-body > .process {
  max-width: 60rem;
}

.section-body > .findings {
  max-width: 54rem;
}

/* The guide's numbered steps and its sources */
.steps {
  margin: 1.75rem 0;
  padding: 0;
  border-top: 2px solid var(--ink);
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 0.85rem 0 0.85rem 3rem;
  border-bottom: 1px solid var(--rule);
  counter-increment: step;
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 0.95rem;
  left: 0;
  color: var(--oxblood);
  font: 500 0.8rem var(--mono);
  letter-spacing: 0.06em;
}

.sources {
  margin: 1.25rem 0 0;
  padding-left: 1.1rem;
  color: var(--ink-2);
  font-size: 0.92rem;
}

.sources li + li {
  margin-top: 0.45rem;
}

/* A figure beside the text: two columns on a wide screen, and the figure under
   the text on a narrow one. The line figures are drawn by draw_figures.py in
   the same line as the plant. */
.has-figure {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 62rem) {
  .has-figure {
    grid-template-columns: minmax(0, 34rem) minmax(0, 1fr);
    column-gap: clamp(2.5rem, 5vw, 5rem);
  }
}

.section-text > p,
.section-text > ul {
  max-width: var(--measure);
}

.section-figure {
  width: 100%;
  max-width: 28rem;
  margin: 0;
}

.plate {
  --cut: 14px;
  padding: 1.25rem 1.25rem 1rem;
  background-color: var(--oxblood-deep);
  background-image:
    linear-gradient(rgba(201, 162, 74, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 162, 74, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--on-night);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}

.fig-art {
  display: block;
  width: 100%;
  height: auto;
}

.fig-art .s {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.fig-art .t {
  fill: none;
  stroke: var(--gold);
  stroke-width: 0.9;
  stroke-opacity: 0.72;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.fig-art .f {
  fill: var(--oxblood-deep);
}

.fig-art .rev-cloud {
  fill: rgba(229, 83, 61, 0.16);
  stroke: var(--signal);
  stroke-width: 2.2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.fig-art .rev-delta {
  fill: var(--signal);
}

.fig-art .rev-letter {
  fill: var(--oxblood-deep);
  font: 700 13px var(--mono);
  text-anchor: middle;
  dominant-baseline: central;
}

.fig-art .tag-card {
  fill: var(--paper);
  stroke: var(--gold);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.fig-art .tag-band,
.fig-art .tag-hole {
  fill: var(--oxblood-deep);
}

.fig-art .tag-stripes {
  fill: url(#fig-hazard);
}

.fig-art .tag-stripe {
  fill: var(--gold);
}

.fig-art .tag-big {
  fill: var(--ink);
  font: 600 16px var(--mono);
  letter-spacing: 0.1em;
  text-anchor: middle;
}

.fig-art .tag-small {
  fill: var(--ink-2);
  font: 500 9px var(--mono);
  letter-spacing: 0.1em;
  text-anchor: middle;
}

/* Drift: a revision block under the drawing, like the one on a real sheet */
.rev-block {
  width: 100%;
  margin-top: 0.9rem;
  border-collapse: collapse;
  color: var(--on-night-2);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.rev-block th,
.rev-block td {
  padding: 0.38rem 0.5rem;
  border-bottom: 1px solid var(--night-line);
  text-align: left;
  vertical-align: top;
}

.rev-block th {
  border-top: 1px solid var(--night-line);
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rev-block th:first-child,
.rev-block td:first-child {
  width: 2.75rem;
}

.rev-block th:nth-child(2),
.rev-block td:nth-child(2) {
  width: 3.75rem;
}

.rev-block .rev td:first-child {
  color: var(--signal);
  font-weight: 600;
}

/* The example report sheet: one finding, as a report lays it out */
.report-sheet .sheet {
  position: relative;
  overflow: hidden;
  padding: 0.45rem;
  background: #f9f3ed;
  border: 1px solid var(--ink);
  box-shadow: 0 22px 44px -28px rgba(22, 17, 18, 0.5);
  color: var(--ink);
}

.sheet-frame {
  border: 1px solid var(--ink);
}

.sheet-head,
.sheet-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0.6rem 0.75rem;
}

.sheet-head {
  justify-content: space-between;
  border-bottom: 1.5px solid var(--ink);
  color: var(--ink-2);
  font: 500 0.64rem/1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sheet-title {
  border-bottom: 1px solid var(--rule);
}

.sheet-title strong {
  flex: 1;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.3;
}

.sheet-title .finding-code {
  padding-top: 0;
}

.sheet-rating {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  color: var(--ink-2);
  font: 500 0.6rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sheet-fields {
  margin: 0;
}

.sheet-fields div {
  display: grid;
  grid-template-columns: 5.6rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.sheet-fields div:last-child {
  border-bottom: 0;
}

.sheet-fields dt {
  color: var(--ink-2);
  font: 500 0.62rem/1.9 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sheet-fields dd {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.hash {
  font-family: var(--mono);
  font-size: 0.78rem;
}

/* "Example" across the whole sheet, faint enough to read through */
.sheet-stamp {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: rgba(74, 14, 21, 0.1);
  font: 600 clamp(2.4rem, 4vw, 3.2rem) var(--mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  transform: rotate(-24deg);
  pointer-events: none;
}

/* The pipe, drawn in the same line style as the plant: solid walls, a bolted
   flange at every joint, a gate valve where each section's instrument taps in,
   a support clamping it to the margin and a line number along the run. As you
   read, gold product fills it down to the reading line, 60% of the way down
   the screen. The timeline's insets put its edge on that line. Percentages
   here, and in the bubble's sticky top, are shares of the screen you can see,
   so the two meet even while a phone's toolbar comes and goes, and the page's
   scroll padding doesn't shift the fill. */
.section-marker {
  --pipe-w: 20px;
  --wall: var(--oxblood);
  --bore: rgba(74, 14, 21, 0.06);
  position: relative;
  z-index: 0;
  view-timeline: --pipe block;
  view-timeline-inset: 60% 40%;
}

.section-marker::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 calc(50% - var(--pipe-w) / 2);
  width: var(--pipe-w);
  border-inline: 2px solid var(--wall);
  background: var(--bore);
}

/* The product, with flow arrows. Without scroll-driven animation it shows at
   half strength along the whole run. */
.section-marker::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 calc(50% - var(--pipe-w) / 2 + 4px);
  width: calc(var(--pipe-w) - 8px);
  background-color: var(--gold);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 36' preserveAspectRatio='none'%3E%3Cpath d='M1.5 9L6 14L10.5 9V12.5L6 17.5L1.5 12.5Z' fill='%23120708' fill-opacity='.42'/%3E%3C/svg%3E");
  background-size: 100% 36px;
  opacity: 0.5;
}

.fittings {
  --flange: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 16'%3E%3Crect x='4' y='3' width='40' height='4.5' fill='%234a0e15'/%3E%3Crect x='4' y='8.5' width='40' height='4.5' fill='%234a0e15'/%3E%3Crect x='0.5' y='1' width='4.5' height='14' rx='1' fill='%234a0e15'/%3E%3Crect x='43' y='1' width='4.5' height='14' rx='1' fill='%234a0e15'/%3E%3C/svg%3E");
  --valve: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 30'%3E%3Cpath d='M14 1H34L24 15L34 29H14L24 15Z' fill='%23f3eee4' stroke='%234a0e15' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='M24 15H7' stroke='%234a0e15' stroke-width='1.8'/%3E%3Cpath d='M5 7V23' stroke='%234a0e15' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
  --support: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 24'%3E%3Crect x='0' y='3' width='3.5' height='18' fill='%234a0e15'/%3E%3Crect x='3' y='10.75' width='32' height='2.5' fill='%234a0e15'/%3E%3Crect x='34' y='7' width='24' height='10' fill='none' stroke='%234a0e15' stroke-width='2'/%3E%3C/svg%3E");
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: var(--flange), var(--valve), var(--support);
  background-repeat: no-repeat;
  background-position: 50% 0, calc(50% - 4px) 1.25rem, calc(50% - 16px) 58%;
  background-size: 48px 16px, 40px 30px, 60px 24px;
}

/* The run's line number, written along the pipe as on a P&ID */
.line-no {
  position: absolute;
  z-index: 1;
  top: 8rem;
  right: calc(50% + var(--pipe-w) / 2 + 6px);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  white-space: nowrap;
}

/* The section's instrument bubble floats on the product level, and reads live
   while you read its section */
.bubble {
  position: sticky;
  top: calc(60% - 1.5rem);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin: calc(clamp(3rem, 7vw, 6rem) - 0.35rem) auto 0;
  border: 2px solid var(--oxblood);
  border-radius: 50%;
  background: var(--paper);
  color: var(--oxblood);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.bubble::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1.5px solid var(--oxblood);
}

.bubble span {
  position: relative;
  top: -0.55rem;
  line-height: 1;
}

/* Signal line from the bubble to the text beside it, dashed as on a P&ID */
.bubble::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  width: calc((var(--rail) - 3rem) / 2 + clamp(1rem, 3vw, 2.5rem) - 0.5rem);
  border-top: 1.5px dashed var(--oxblood);
  opacity: 0.5;
}

/* Bands: full-width photographs the pipe runs in front of */
.band {
  position: relative;
  margin: 0;
  background: var(--night);
  color: var(--on-night);
}

.band img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.band .section-grid {
  position: relative;
  min-height: clamp(16rem, 34vw, 30rem);
}

.band .section-marker,
.next-step .section-marker {
  --wall: rgba(201, 162, 74, 0.85);
  --bore: rgba(18, 7, 8, 0.45);
}

.band .fittings,
.next-step .fittings {
  --flange: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 16'%3E%3Crect x='4' y='3' width='40' height='4.5' fill='%23c9a24a'/%3E%3Crect x='4' y='8.5' width='40' height='4.5' fill='%23c9a24a'/%3E%3Crect x='0.5' y='1' width='4.5' height='14' rx='1' fill='%23c9a24a'/%3E%3Crect x='43' y='1' width='4.5' height='14' rx='1' fill='%23c9a24a'/%3E%3C/svg%3E");
  --valve: none;
  --support: none;
}



/* ---------- Content components ---------- */

.two-tone .muted {
  display: inline;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  gap: 0.6rem;
}

.checklist li {
  position: relative;
  padding-left: 2rem;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 1.1rem;
  height: 0.55rem;
  border-left: 2px solid var(--oxblood);
  border-bottom: 2px solid var(--oxblood);
  transform: rotate(-45deg);
}

.spec-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  border-top: 1px solid var(--rule);
}

.spec-list li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
}

.spec-list li::before {
  content: counter(spec, decimal-leading-zero);
  counter-increment: spec;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-2);
  padding-top: 0.2rem;
}

.spec-list {
  counter-reset: spec;
}

/* Spec-sheet cards with a cut corner */
.cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  margin: 2rem 0;
  max-width: none;
}

.card {
  --cut: 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--rule);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  transition: border-color var(--hover-out) var(--ease-out), transform var(--sweep-out) var(--ease-out);
}

/* The line along the cut corner, centred just inside the cut so the card's
   clip-path doesn't shave it away */
.card::after {
  content: "";
  position: absolute;
  top: calc(var(--cut) / 2 - 1px);
  right: calc(var(--cut) * -0.207 - 0.5px);
  width: calc(var(--cut) * 1.414);
  border-top: 1px solid var(--rule);
  transform: rotate(45deg);
  transition: border-color var(--hover-out) var(--ease-out);
}

.card:hover {
  border-color: var(--oxblood);
  transform: translateY(-3px);
  transition-duration: var(--hover-in), var(--sweep-in);
}

.card:hover::after {
  border-top-color: var(--oxblood);
  transition-duration: var(--hover-in);
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 2.5rem 0.7rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.card-photo img {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem 1.25rem 1.4rem;
}

.card-body h2,
.card-body h3 {
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}

.card-body p {
  margin: 0 0 1rem;
}

.card-body p:last-child {
  margin: auto 0 0;
}

.more {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.more::after {
  content: " \2192";
}

.card .more::before {
  content: "";
  position: absolute;
  inset: 0;
}

/* The seven findings: a legend, most serious first */
.findings {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  border-top: 2px solid var(--ink);
  max-width: 52rem;
}

.finding {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) 9.5rem;
  gap: 0.25rem 1.25rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}

.finding-code {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-2);
  padding-top: 0.25rem;
}

.finding p {
  margin: 0;
}

.finding strong {
  display: block;
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.rating {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  padding-top: 0.25rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-align: right;
}

.meter {
  display: flex;
  gap: 3px;
}

.meter i {
  width: 0.9rem;
  height: 0.4rem;
  background: var(--rule);
}

.meter[data-level="5"] i,
.meter[data-level="4"] i:nth-child(-n + 4),
.meter[data-level="3"] i:nth-child(-n + 3),
.meter[data-level="2"] i:nth-child(-n + 2),
.meter[data-level="1"] i:nth-child(-n + 1) {
  background: var(--ink);
}

.meter[data-level="5"] i {
  background: var(--signal);
}

/* Process: four stations along a run of pipe */
.process {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  counter-reset: step;
  max-width: none;
}

.process li {
  position: relative;
  padding-top: 3.75rem;
}

.process li::before {
  content: counter(step, decimal-leading-zero);
  counter-increment: step;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 2px solid var(--oxblood);
  border-radius: 50%;
  background: var(--paper);
  color: var(--oxblood);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
}

.process li::after {
  content: "";
  position: absolute;
  top: calc(1.375rem - 7px);
  left: 2.75rem;
  right: -1.5rem;
  height: 14px;
  border-block: 2px solid var(--pipe);
  background: var(--pipe-fill);
}

.process li:last-child::after {
  display: none;
}

.process strong {
  display: block;
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

/* Values and nameplates on the About page */
.values {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1.5rem 2rem;
  max-width: none;
}

.values li {
  padding-top: 1rem;
  border-top: 2px solid var(--oxblood);
}

.values strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.nameplates {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: 1rem;
  max-width: none;
}

.nameplates li {
  --cut: 8px;
  position: relative;
  padding: 1.1rem 1.25rem 1rem;
  background:
    radial-gradient(circle at 10px 10px, var(--ink-2) 2px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 10px) 10px, var(--ink-2) 2px, transparent 2.5px),
    radial-gradient(circle at 10px calc(100% - 10px), var(--ink-2) 2px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 10px) calc(100% - 10px), var(--ink-2) 2px, transparent 2.5px),
    var(--paper-2);
  border: 1px solid var(--rule);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.nameplates li span {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.nameplates li small {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink-2);
}

/* Contact */
.email-plate {
  display: inline-block;
  margin: 1.5rem 0 0.5rem;
  padding: 1.1rem 1.4rem;
  border: 1.5px solid var(--oxblood);
  font-size: clamp(1.2rem, 3vw, 1.9rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.email-plate {
  background-image: linear-gradient(rgba(74, 14, 21, 0.06), rgba(74, 14, 21, 0.06));
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 0 100%;
  transition: background-size var(--sweep-out) var(--ease-out);
}

.email-plate:hover {
  background-size: 100% 100%;
  transition-duration: var(--sweep-in);
}

.caution {
  position: relative;
  max-width: var(--measure);
  margin: 1.5rem 0;
  padding: 1.6rem 1.5rem 1.4rem;
  background: var(--paper-2);
}

.caution::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 10px;
  background: repeating-linear-gradient(-45deg, var(--night) 0 10px, var(--gold) 10px 20px);
}

.caution p {
  margin: 0;
}

/* The next step every page ends with: the pipe delivers here */
.next-step {
  position: relative;
  background: var(--oxblood);
  color: var(--on-night);
}

.next-step .section-marker::before,
.next-step .section-marker::after {
  bottom: auto;
  height: 3.25rem;
}

/* A gate valve where the pipe ends */
.valve {
  position: relative;
  display: block;
  width: 1.75rem;
  height: 2.25rem;
  margin: 3.25rem auto 0;
  background: var(--gold);
  clip-path: polygon(0 0, 100% 0, 50% 50%, 100% 100%, 0 100%, 50% 50%);
}

.next-step .section-body {
  padding-block: clamp(3rem, 6vw, 5rem);
}

.next-step h2 {
  color: var(--on-night);
}

.next-step p {
  max-width: var(--measure);
  color: var(--on-night-2);
}

/* ---------- Footer: a drawing's title block ---------- */

.site-footer {
  padding-block: 2.5rem;
  background: var(--night);
  color: var(--on-night-2);
  font-size: 0.92rem;
}

.title-block {
  display: grid;
  grid-template-columns: 2fr 1fr 1.4fr 0.8fr;
  border: 1px solid var(--night-line);
}

.tb-cell {
  padding: 0.85rem 1rem 1rem;
  border: 1px solid var(--night-line);
  margin: -0.5px;
  min-width: 0;
}

.tb-label {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.tb-value {
  color: var(--on-night);
}

.tb-company .tb-value {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-footer a {
  color: var(--on-night);
}

.site-footer a:hover {
  color: var(--gold);
  transition-duration: var(--hover-in);
}

.tb-nav {
  grid-column: 1 / 3;
}

/* The index lists every sheet by number, as a drawing set's index does */
.tb-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.2rem 1.25rem;
}

.sheet-no {
  margin-right: 0.2rem;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.tb-nav a {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: color var(--hover-out) var(--ease-out), background-size var(--sweep-out) var(--ease-out);
}

.tb-nav a:hover,
.tb-nav a:focus-visible {
  background-size: 100% 1px;
  transition-duration: var(--hover-in), var(--sweep-in);
}

.tb-nav a[aria-current] {
  color: var(--gold);
}

.tb-notes {
  grid-column: 3 / 5;
}

.tb-cell p {
  margin: 0;
}

/* ---------- Motion: purposeful and optional ---------- */

/* The pipe fills down to the reading line, and the reading section's bubble
   lights up. Both follow the visitor's own scrolling, so they stay on for
   everyone. Only the flow arrows move by themselves. */
@supports (animation-timeline: view()) {
  .section-marker::after {
    opacity: 1;
    animation: fill linear both;
    animation-timeline: --pipe;
  }

  .bubble,
  .bubble::before,
  .bubble::after {
    animation: live linear;
    animation-timeline: --pipe;
  }

  .bubble::before {
    animation-name: live-line;
  }

  .bubble::after {
    animation-name: live-signal;
  }

  @keyframes fill {
    from {
      clip-path: inset(0 0 100% 0);
    }

    to {
      clip-path: inset(0 0 0 0);
    }
  }

  @keyframes live {
    0%,
    100% {
      background: var(--oxblood);
      color: var(--paper);
    }
  }

  @keyframes live-line {
    0%,
    100% {
      border-top-color: var(--paper);
    }
  }

  @keyframes live-signal {
    0%,
    100% {
      opacity: 1;
    }
  }
}

@media (prefers-reduced-motion: no-preference) {
  .section-marker::after {
    animation: flow 1.4s linear infinite;
  }

  @supports (animation-timeline: view()) {
    .section-marker::after {
      animation: fill linear both, flow 1.4s linear infinite;
      animation-timeline: --pipe, auto;
    }
  }

  @keyframes flow {
    to {
      background-position: 0 36px;
    }
  }

  @supports (animation-timeline: view()) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 5% entry 45%;
    }

    @keyframes rise {
      from {
        opacity: 0;
        transform: translateY(1.75rem);
      }
    }

    /* Drift: each revision's cloud and its row in the block arrive together as
       you scroll the figure through the screen. It moves only when you do. */
    .fig-drift {
      view-timeline: --drift block;
    }

    .fig-drift .rev {
      animation: rev-in linear both;
      animation-timeline: --drift;
    }

    .fig-drift .rev-b {
      animation-range: cover 28% cover 36%;
    }

    .fig-drift .rev-c {
      animation-range: cover 38% cover 46%;
    }

    .fig-drift .rev-d {
      animation-range: cover 48% cover 56%;
    }

    @keyframes rev-in {
      from {
        opacity: 0;
      }
    }
  }
}

/* ---------- Moving between sheets ---------- */

/* The page fades and lifts into place while the header stays put, and the
   drawing slides along to the new sheet's stretch. Browsers without
   cross-page transitions just load the page. Reduced motion and Pause Motion
   both switch it off. */
@view-transition {
  navigation: auto;
}

.site-header {
  view-transition-name: site-header;
}

.title-strip {
  view-transition-name: title-strip;
}

.hero-art {
  view-transition-name: hero-art;
}

/* Between the old sheet fading out and the new one rising in, the screen
   shows black, never paper, so nothing flashes pale between two dark
   headers. */
::view-transition {
  background: var(--night);
}

::view-transition-old(root) {
  animation: 0.18s ease-in both sheet-out;
}

::view-transition-new(root) {
  animation: 0.32s ease-out 0.06s both sheet-in;
}

::view-transition-old(hero-art),
::view-transition-new(hero-art) {
  height: 100%;
  object-fit: cover;
  object-position: 50% 100%;
}

::view-transition-old(hero-art) {
  animation: 0.22s ease-in both art-out;
}

::view-transition-new(hero-art) {
  animation: 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both art-in;
}

html.still::view-transition-group(*),
html.still::view-transition-old(*),
html.still::view-transition-new(*) {
  animation: none;
}

@keyframes sheet-out {
  to {
    opacity: 0;
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
}

@keyframes art-out {
  to {
    opacity: 0;
    transform: translateX(-2.5%);
  }
}

@keyframes art-in {
  from {
    opacity: 0;
    transform: translateX(2.5%);
  }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

/* ---------- Smaller screens ---------- */

@media (max-width: 62rem) {
  .title-block {
    grid-template-columns: 1fr 1fr;
  }

  .tb-company,
  .tb-nav,
  .tb-notes {
    grid-column: 1 / -1;
  }

  .process {
    grid-template-columns: 1fr 1fr;
    row-gap: 2.5rem;
  }

  .process li:nth-child(2)::after {
    display: none;
  }
}

@media (max-width: 48rem) {
  :root {
    --rail: 2rem;
  }

  /* Without the script, the links stack under the name. With it, the header
     keeps only Contact, and the menu moves to the title strip at the bottom. */
  .header-inner {
    flex-wrap: wrap;
  }

  .site-nav {
    flex-basis: 100%;
  }

  .js .header-inner {
    flex-wrap: nowrap;
    column-gap: 1rem;
    min-height: 3.75rem;
  }

  .js .site-nav {
    flex-basis: auto;
  }

  .js .site-nav > ul > li:not(:last-child) {
    display: none;
  }

  .js .site-nav > ul > li {
    border-top: 0;
  }

  .js .site-nav .button {
    margin-top: 0;
  }

  .site-nav > ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav > ul > li {
    border-top: 1px solid var(--night-line);
  }

  .site-nav a:not(.button) {
    padding: 0.85rem 0;
  }

  .site-nav a[aria-current]:not(.button) {
    box-shadow: none;
  }

  .site-nav > ul > li > a:not(.button) {
    background-image: none;
  }

  .site-nav .button {
    margin-top: 1rem;
  }

  .has-sub {
    flex-wrap: wrap;
    height: auto;
  }

  .sub-toggle {
    margin-left: auto;
    margin-right: 0;
  }

  .sub {
    position: static;
    flex-basis: 100%;
    min-width: 0;
    border: 0;
    border-left: 2px solid var(--gold);
    background: none;
    margin: 0 0 0.75rem;
    display: none;
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: none;
  }

  .has-sub:hover .sub,
  .has-sub:focus-within .sub {
    display: none;
  }

  .sub.open {
    display: block;
  }

  .bubble {
    top: calc(60% - 0.9375rem);
    width: 1.875rem;
    height: 1.875rem;
    font-size: 0.62rem;
  }

  .bubble span {
    top: -0.35rem;
  }

  .bubble::after {
    display: none;
  }

  .section-marker {
    --pipe-w: 12px;
  }

  .section-marker::after {
    left: calc(50% - var(--pipe-w) / 2 + 3px);
    width: calc(var(--pipe-w) - 6px);
  }

  .fittings {
    background-size: 30px 10px, 0 0, 0 0;
  }

  .line-no {
    display: none;
  }

  .section-grid {
    column-gap: 0.875rem;
  }
}

/* ---------- Small additions used by single pages ---------- */

.hero-note {
  max-width: 38rem;
  margin: 1rem 0 0;
  color: var(--on-night-2);
}

.h2-follow {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.dark .email-plate {
  color: var(--gold);
  border-color: var(--gold);
}

.dark .email-plate {
  background-image: linear-gradient(rgba(201, 162, 74, 0.1), rgba(201, 162, 74, 0.1));
}

.section-body .lead {
  color: var(--ink);
}

/* ---------- From the usability review (docs/usability-review.md) ---------- */

/* 3.1 Pause Motion: stops the drawing's flare, turbines and pulses and the
   pipe's flow arrows. The fill and live bubble keep following the scroll. */
.motion-toggle {
  display: none;
}

.js .motion-toggle {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--gold);
  background: var(--night);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.js .motion-toggle {
  transition: background-color var(--hover-out) var(--ease-out);
}

.js .motion-toggle:hover {
  background: var(--night-2);
  transition-duration: var(--hover-in);
}

.js .motion-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--night);
}

.motion-icon {
  width: 0.65rem;
  height: 0.75rem;
  border-inline: 3px solid currentColor;
}

.motion-toggle[aria-pressed="true"] .motion-icon {
  border: 0;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.js .site-footer {
  padding-bottom: 5rem;
}

.still .section-marker::after {
  animation: none;
}

@supports (animation-timeline: view()) {
  .still .section-marker::after {
    animation: fill linear both;
    animation-timeline: --pipe;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .motion-toggle {
    display: none;
  }
}

/* 4.2 The sector breadcrumbs link back to Sectors */
.eyebrow a {
  text-underline-offset: 0.25em;
}

.eyebrow a:hover {
  color: var(--gold-pale);
}

/* 5.2 Copy Address, beside the email link */
.email-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0 0.5rem;
}

.email-row .email-plate {
  margin: 0;
}

.copy-email {
  display: none;
}

.js .copy-email {
  display: inline-flex;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gold);
  background: var(--night);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.js .copy-email {
  background-image: linear-gradient(rgba(201, 162, 74, 0.14), rgba(201, 162, 74, 0.14));
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 0 100%;
  transition: background-size var(--sweep-out) var(--ease-out);
}

.js .copy-email:hover {
  background-size: 100% 100%;
  transition-duration: var(--sweep-in);
}

@media (max-width: 48rem) {
  /* 4.3 A thumb-sized Sectors arrow */
  .sub-toggle {
    width: 2.75rem;
    height: 2.75rem;
  }

  /* On phones Pause Motion moves into the title strip, and shows only its icon */
  .js body > .motion-toggle {
    display: none;
  }

  /* Keep the wordmark and the Contact button on one row */
  .wordmark-main {
    letter-spacing: 0.16em;
  }

  .wordmark-sub {
    letter-spacing: 0.1em;
  }

  .motion-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* ---------- On a phone ---------- */

/* A phone is held in one hand, not read across a desk. The plant comes first
   and can be walked along, the menu sits under the thumb in a title strip
   along the bottom, and notes and the index slide up as sheets. All of it
   needs the script except the hero's order, so a phone without the script
   gets the plain stacked page. */

html {
  -webkit-tap-highlight-color: rgba(201, 162, 74, 0.2);
}

/* Buttons press in like plates under a thumb */
.button:active {
  translate: 0 1px;
}

.wrap {
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.key-plan,
.title-strip {
  display: none;
}

@media (max-width: 48rem) {
  .js {
    scroll-padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
  }

  /* The plant first: the drawing heads the sheet, above its title */
  .hero {
    display: flex;
    flex-direction: column;
  }

  .hero-art,
  .key-plan {
    order: -1;
  }

  .hero-art {
    margin: 0;
  }

  .hero:not(.hero--page) .hero-art {
    --art-h: 15rem;
  }

  .hero--page .hero-art {
    --art-h: 11.5rem;
  }

  .hero-copy,
  .hero--page .hero-copy {
    padding-top: 1.75rem;
    padding-bottom: 2.75rem;
  }

  /* Walk the plant: the whole drawing is there to swipe along, starting at
     the page's own stretch, and the redlines ride along with it */
  .js .hero-art {
    overflow: auto hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    pointer-events: auto;
  }

  .js .hero-art::-webkit-scrollbar {
    display: none;
  }

  .js .hero-art img {
    width: calc(var(--art-h) * 20 / 3);
    max-width: none;
  }

  .js .hero-art .redline {
    left: calc(var(--x) * var(--art-h) / 600);
  }

  /* The key plan: the whole drawing in one line, the stretch on screen framed
     in gold and a red dot for each redline. Tap a dot to go to it. */
  .js .key-plan {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
    color: var(--gold);
    font-family: var(--mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .kp-track {
    position: relative;
    flex: 1;
    height: 1.5rem;
    border-block: 1px solid var(--night-line);
    background: repeating-linear-gradient(90deg, var(--night-line) 0 1px, transparent 1px 10%);
    touch-action: none;
    cursor: pointer;
  }

  .kp-window {
    position: absolute;
    top: -1px;
    bottom: -1px;
    left: calc(var(--kp-x, 0.4) * 100%);
    width: calc(var(--kp-w, 0.2) * 100%);
    border: 1.5px solid var(--gold);
    background: rgba(201, 162, 74, 0.16);
  }

  .kp-dot {
    position: absolute;
    top: 50%;
    left: calc(var(--d) * 100%);
    width: 0.55rem;
    height: 0.55rem;
    translate: -50% -50%;
    border-radius: 50%;
    background: var(--signal);
  }

  .kp-dot::before {
    content: "";
    position: absolute;
    inset: -0.75rem -0.6rem;
  }

  .kp-hint {
    position: absolute;
    right: max(var(--gutter), env(safe-area-inset-right));
    bottom: calc(100% + 0.6rem);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    background: var(--night);
    box-shadow: inset 0 0 0 1px var(--gold);
    pointer-events: none;
    transition: opacity 0.4s ease, translate 0.4s ease;
  }

  .kp-hint::before {
    content: "";
    width: 1.1rem;
    height: 0.55rem;
    background: currentColor;
    clip-path: polygon(0 50%, 30% 0, 30% 38%, 70% 38%, 70% 0, 100% 50%, 70% 100%, 70% 62%, 30% 62%, 30% 100%);
  }

  .key-plan.used .kp-hint {
    opacity: 0;
    translate: 0 0.4rem;
  }

  /* The title strip: a drawing's title block along the bottom of the screen,
     where a thumb can reach it. It names the sheet and the section you're
     reading, holds Pause Motion and opens the index. It slides away when the
     real title block, the footer, comes into view. */
  .js .title-strip {
    position: fixed;
    inset: auto 0 0;
    z-index: 40;
    display: flex;
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: var(--oxblood-deep);
    box-shadow: inset 0 1px 0 var(--night-line), 0 -8px 24px rgba(18, 7, 8, 0.16);
    color: var(--on-night);
    transition: translate 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .js .title-strip.docked {
    translate: 0 110%;
  }

  /* How far down the sheet you've read, along the strip's top edge */
  .title-strip::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: var(--gold);
    transform-origin: 0 50%;
    scale: 0 1;
  }

  @supports (animation-timeline: scroll()) {
    .title-strip::before {
      animation: read linear both;
      animation-timeline: scroll(root);
    }

    @keyframes read {
      to {
        scale: 1 1;
      }
    }
  }

  .js .title-strip .motion-toggle {
    position: static;
    flex: none;
    width: 3.25rem;
    height: auto;
    padding: 0;
    border: 0;
    border-right: 1px solid var(--night-line);
    background: none;
    justify-content: center;
  }

  .strip-menu {
    flex: 1;
    display: flex;
    align-items: stretch;
    min-width: 0;
    min-height: 3.5rem;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }

  .strip-readout {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.1rem;
    padding: 0.45rem 0.85rem;
    overflow: hidden;
  }

  .strip-sheet {
    display: flex;
    gap: 0.6rem;
    color: var(--gold);
    font-family: var(--mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .strip-line {
    color: var(--on-night-2);
    letter-spacing: 0.06em;
  }

  .strip-line:empty {
    display: none;
  }

  .strip-title {
    overflow: hidden;
    color: var(--on-night);
    font-size: 0.92rem;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .strip-label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0 1rem;
    border-left: 1px solid var(--night-line);
    color: var(--gold);
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .strip-label::before {
    content: "";
    width: 1rem;
    height: 0.6rem;
    border-block: 1.5px solid currentColor;
    background: linear-gradient(currentColor, currentColor) 50% 50% / 100% 1.5px no-repeat;
  }

  .strip-menu:active .strip-label,
  .js .title-strip .motion-toggle:active {
    background: var(--oxblood);
  }

  /* Buttons span the screen, label at the left and arrow at the right */
  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions .button {
    justify-content: space-between;
    padding-block: 1rem;
  }

  /* Cards swipe sideways, with the next one showing at the edge */
  .cards {
    display: flex;
    gap: 0.875rem;
    margin-right: calc(-1 * max(var(--gutter), env(safe-area-inset-right)));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .cards::-webkit-scrollbar {
    display: none;
  }

  .card {
    flex: 0 0 86%;
    scroll-snap-align: start;
  }

  .card:active {
    border-color: var(--oxblood);
  }

  /* The seven findings stack like tags on a hook as you read down them */
  .findings {
    display: grid;
    gap: 0.75rem;
    border-top: 0;
  }

  .finding {
    --cut: 14px;
    position: sticky;
    top: calc(1rem + var(--i, 0) * 0.5rem);
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.6rem 1rem;
    padding: 1rem 1.1rem 1.15rem;
    border: 1px solid var(--rule);
    background: var(--paper);
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  }

  .finding:nth-child(2) {
    --i: 1;
  }

  .finding:nth-child(3) {
    --i: 2;
  }

  .finding:nth-child(4) {
    --i: 3;
  }

  .finding:nth-child(5) {
    --i: 4;
  }

  .finding:nth-child(6) {
    --i: 5;
  }

  .finding:nth-child(7) {
    --i: 6;
  }

  .finding > .finding-code {
    grid-column: 1;
    grid-row: 1;
    padding-top: 0;
  }

  .finding > .rating {
    grid-column: 2;
    grid-row: 1;
    flex-direction: row-reverse;
    justify-content: flex-start;
    align-items: center;
    gap: 0.6rem;
    padding-top: 0;
    text-align: right;
  }

  .finding > p {
    grid-column: 1 / -1;
  }

  /* The process runs down a pipe from one station to the next */
  .process {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .process li {
    min-height: 5rem;
    padding: 0.55rem 0 2rem 3.75rem;
  }

  .process li::after,
  .process li:nth-child(2)::after {
    display: block;
    top: 2.75rem;
    bottom: 0;
    left: calc(1.375rem - 7px);
    right: auto;
    width: 14px;
    height: auto;
    border-block: 0;
    border-inline: 2px solid var(--pipe);
  }

  .process li:last-child::after {
    display: none;
  }

  /* The founders' nameplates sit two to a row, like a panel of them */
  .nameplates {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .nameplates li {
    padding: 1rem 1rem 0.9rem;
    font-size: 1rem;
  }

  /* The address and Copy Address span the screen, and the address shrinks to
     stay on one line on the narrowest phones */
  .email-row {
    flex-direction: column;
    align-items: stretch;
  }

  .email-plate {
    padding: 1rem;
    font-size: min(1.2rem, calc((100vw - 4.5rem) / 16.5));
  }

  .js .copy-email {
    justify-content: center;
    align-items: center;
    min-height: 3rem;
  }

  /* The strip slides away at the footer, so it needs no room kept under it */
  .js .site-footer {
    padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
  }

  /* The footer's title block keeps its grid, with thumb-sized index rows */
  .title-block {
    grid-template-columns: 1fr 1fr;
  }

  .tb-cell:nth-child(3) {
    grid-column: 1 / -1;
    order: 1;
  }

  .tb-nav,
  .tb-notes {
    order: 2;
  }

  .tb-nav ul {
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
  }

  .tb-nav a {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.75rem;
    text-decoration: none;
  }
}

/* On narrow phones the name stacks, "Civitas" over "Cybersecurity" as on the
   business card, so the whole name still fits beside Contact. Wider spacing
   in "Civitas" makes the two lines the same width. */
@media (max-width: 22.5rem) {
  .wordmark {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    line-height: 1;
  }

  .wordmark-main {
    letter-spacing: 0.26em;
  }

  .wordmark-sub {
    letter-spacing: 0.1em;
    transform: none;
  }
}

/* The index: this sheet's sections, then every sheet in the set. It slides up
   from the title strip, and a swipe down, Close or a tap outside puts it away. */
.index-sheet {
  inset: auto 0 0;
  width: 100%;
  max-width: 32rem;
  max-height: min(85dvh, 46rem);
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: var(--oxblood-deep);
  color: var(--on-night);
  box-shadow: inset 0 1.5px 0 var(--gold);
  clip-path: polygon(var(--chamfer) 0, calc(100% - var(--chamfer)) 0, 100% var(--chamfer), 100% 100%, 0 100%, 0 var(--chamfer));
  overflow: hidden;
  translate: 0 100%;
  transition: translate 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), overlay 0.35s allow-discrete, display 0.35s allow-discrete;
}

.index-sheet[open] {
  display: flex;
  flex-direction: column;
  translate: 0 0;
}

@starting-style {
  .index-sheet[open] {
    translate: 0 100%;
  }
}

.index-sheet::backdrop {
  background: rgba(18, 7, 8, 0.6);
  opacity: 0;
  transition: opacity 0.35s ease, overlay 0.35s allow-discrete, display 0.35s allow-discrete;
}

.index-sheet[open]::backdrop {
  opacity: 1;
}

@starting-style {
  .index-sheet[open]::backdrop {
    opacity: 0;
  }
}

.index-sheet.dragging {
  transition: none;
}

.sheet-open {
  overflow: hidden;
}

.index-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem max(var(--gutter), env(safe-area-inset-right)) 0.8rem max(var(--gutter), env(safe-area-inset-left));
  border-bottom: 1px solid var(--night-line);
  touch-action: none;
  cursor: grab;
}

.index-grip {
  position: absolute;
  top: 0.6rem;
  left: 50%;
  width: 2.5rem;
  height: 3px;
  translate: -50% 0;
  background: var(--night-line);
}

.index-title {
  margin: 0;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.index-close {
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border: 1px solid var(--night-line);
  background: none;
  color: var(--on-night);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.index-close:active {
  background: var(--oxblood);
}

.index-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.25rem max(var(--gutter), env(safe-area-inset-right)) calc(1.25rem + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
}

.index-label {
  margin: 1.1rem 0 0.3rem;
  color: var(--on-night-2);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.index-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.index-list a {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--night-line);
  color: var(--on-night);
  font-size: 1.05rem;
  line-height: 1.3;
  text-decoration: none;
}

.index-list a:active {
  background: var(--oxblood);
}

.index-no {
  flex: none;
  width: 4.75rem;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.index-name {
  flex: 1;
  min-width: 0;
}

.index-here {
  flex: none;
  align-self: center;
  padding: 0.2rem 0.45rem;
  background: var(--gold);
  color: var(--night);
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.index-list a[aria-current] {
  color: var(--gold-pale);
}

.index-list a[aria-current="location"] {
  box-shadow: inset 2px 0 0 var(--gold);
  padding-left: 0.75rem;
}

.index-sheet .button {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  .strip-title.flip {
    animation: flip-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  @keyframes flip-in {
    from {
      opacity: 0;
      translate: 0 0.55em;
    }
  }

  .kp-hint::before {
    animation: sway 1.4s ease-in-out infinite;
  }

  .still .kp-hint::before {
    animation: none;
  }

  @keyframes sway {
    50% {
      translate: 3px 0;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .redline-note,
  .index-sheet,
  .index-sheet::backdrop,
  .title-strip,
  .kp-hint {
    transition: none;
  }
}

/* Redline hotspots: written by scripts/draw_plant.py, which knows where each cloud sits */
[data-redline="plant-3"] {
  --x: 770;
  --y: 366;
  --rx: 42;
  --ry: 34;
  anchor-name: --plant-3;
}

#note-plant-3 {
  position-anchor: --plant-3;
}

[data-redline="plant-1"] {
  --x: 1870;
  --y: 470;
  --rx: 92;
  --ry: 30;
  anchor-name: --plant-1;
}

#note-plant-1 {
  position-anchor: --plant-1;
}

[data-redline="plant-2"] {
  --x: 2500;
  --y: 500;
  --rx: 66;
  --ry: 40;
  anchor-name: --plant-2;
}

#note-plant-2 {
  position-anchor: --plant-2;
}

[data-redline="oil-and-gas-1"] {
  --x: 1722;
  --y: 398;
  --rx: 36;
  --ry: 28;
  anchor-name: --oil-and-gas-1;
}

#note-oil-and-gas-1 {
  position-anchor: --oil-and-gas-1;
}

[data-redline="oil-and-gas-2"] {
  --x: 3260;
  --y: 398;
  --rx: 36;
  --ry: 28;
  anchor-name: --oil-and-gas-2;
}

#note-oil-and-gas-2 {
  position-anchor: --oil-and-gas-2;
}

[data-redline="oil-and-gas-3"] {
  --x: 3500;
  --y: 366;
  --rx: 42;
  --ry: 34;
  anchor-name: --oil-and-gas-3;
}

#note-oil-and-gas-3 {
  position-anchor: --oil-and-gas-3;
}

[data-redline="power-1"] {
  --x: 2116;
  --y: 366;
  --rx: 42;
  --ry: 34;
  anchor-name: --power-1;
}

#note-power-1 {
  position-anchor: --power-1;
}

[data-redline="power-2"] {
  --x: 1759;
  --y: 506;
  --rx: 32;
  --ry: 46;
  anchor-name: --power-2;
}

#note-power-2 {
  position-anchor: --power-2;
}

[data-redline="power-3"] {
  --x: 2313;
  --y: 538;
  --rx: 30;
  --ry: 22;
  anchor-name: --power-3;
}

#note-power-3 {
  position-anchor: --power-3;
}
/* End of redline hotspots */
