/* Design Factory posts. Same ground, ink, mark and light as the landing page; see docs/house-style.md.
   One band of light under the headline, one figure that moves, one centred column for text, tables and figure.
   The header stays at the page gutters, as on the landing page. */
:root {
  --paper:  #090B0A;
  --ink:    #E3E8D4;
  --muted:  #ABA6B8;
  --orchid: #F2649D;
  --line:   rgba(227,232,212,.16);

  --display: "Anybody", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --text: "Spectral", Georgia, "Times New Roman", serif;

  --gutter: max(18px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --col: 800px;   /* one column: the text, the table and the figure share both edges */
  --ease: cubic-bezier(.2,.75,.15,1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--paper); overflow-x: clip; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--text);
  font-size: clamp(1.0625rem, .9rem + .5vw, 1.3125rem);
  line-height: 1.62;
  padding: 0 var(--gutter);
  -webkit-font-smoothing: antialiased;
}
/* grain over the page, as on the landing page */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 2; pointer-events: none;
  opacity: .14; image-rendering: pixelated;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

a { color: inherit; text-decoration-color: var(--orchid); text-decoration-thickness: 2px; text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--orchid); outline-offset: 4px; }

/* ---------- header and footer ---------- */
.post, .foot { max-width: var(--col); margin-inline: auto; }
.top { display: flex; align-items: center; padding-block: 20px 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand svg { width: 30px; height: 28px; flex: none; }
.wordmark { font-family: var(--display); font-stretch: 118%; font-weight: 760; font-size: 1.55rem; letter-spacing: -0.03em; line-height: 1; }
/* the menu, as on the landing page: the lit verb is where you are */
.menu { margin-left: auto; display: flex; gap: 1.1em; }
.go {
  display: inline-flex; align-items: center; white-space: nowrap; text-decoration: none;
  font-family: var(--display); font-size: clamp(1.55rem, 1.1rem + 1.4vw, 2.1rem); line-height: 1; letter-spacing: -0.015em;
  font-stretch: 50%; font-weight: 400; color: var(--muted);
  transition: font-stretch .6s var(--ease), font-weight .6s var(--ease), color .3s ease;
}
.go .head { width: 0; margin-right: 0; transition: width .6s var(--ease), margin .6s var(--ease); }
.go:hover, .go:focus-visible, .go[aria-current="page"] { font-stretch: 140%; font-weight: 880; color: var(--ink); }
.go:hover .head, .go:focus-visible .head, .go[aria-current="page"] .head { width: .36em; margin-right: .14em; }
.foot { padding-block: 56px 28px; font-size: .9rem; color: var(--muted); }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.f-ink { fill: var(--ink); }
.f-paper { fill: var(--paper); }

/* ---------- the head: the title stands on the band ---------- */
.post-head { position: relative; padding-block: clamp(36px, 9vh, 110px) 0; }
.post-head h1 {
  position: relative;
  margin: 0;
  padding-right: max(0px, calc(100% - 15ch));   /* the box spans the page so the band can; the text stays narrow */
  font-family: var(--display); font-stretch: 62%; font-weight: 820;
  font-size: clamp(2.7rem, 8.2vw, 6.6rem);
  line-height: .9; letter-spacing: -0.012em;
  text-wrap: balance;
  padding-bottom: .34em;
}
/* the band and its two end lights, full width of the viewport */
.post-head h1::after, .post-head h1::before {
  content: ""; position: absolute; pointer-events: none; z-index: -1;
  left: 50%; width: 100vw; translate: -50% 50%;
  bottom: 0;
}
.post-head h1::before {
  height: 38vh;
  background-image:
    radial-gradient(ellipse 44vw 19vh at 0% 50%,   rgba(255,110,30,.5) 0%, rgba(255,110,30,.16) 50%, rgba(255,110,30,0) 100%),
    radial-gradient(ellipse 44vw 19vh at 100% 50%, rgba(24,80,255,.5)  0%, rgba(24,80,255,.16)  50%, rgba(24,80,255,0)  100%);
  background-repeat: no-repeat;
}
.post-head h1::after {
  height: 26vh;
  background-image:
    radial-gradient(ellipse 30vw 1.4vh at 28% 50%, rgba(255,246,228,1) 0%, rgba(255,246,228,.45) 40%, rgba(255,246,228,0) 100%),
    linear-gradient(90deg, #ff5a14 0%, #ff9a4a 12%, #ffe9c8 24%, #bfeeff 36%, #39ccff 52%, rgba(31,124,255,.8) 74%, rgba(11,47,156,.4) 100%);
  background-repeat: no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.1) 32%, rgba(0,0,0,.38) 44%, #000 49.6%, #000 50.4%, rgba(0,0,0,.38) 56%, rgba(0,0,0,.1) 68%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.1) 32%, rgba(0,0,0,.38) 44%, #000 49.6%, #000 50.4%, rgba(0,0,0,.38) 56%, rgba(0,0,0,.1) 68%, transparent 100%);
}
.deck {
  margin: clamp(30px, 6vh, 64px) 0 0;   /* fills the column; only the headline is held narrow */
  font-size: clamp(1.3rem, 1rem + 1.3vw, 1.8rem); line-height: 1.32; font-weight: 300; text-wrap: pretty;
}
.meta { margin: 18px 0 0; color: var(--muted); font-size: .95rem; }

/* ---------- the reading column ---------- */
.prose { max-width: none; }
.prose > p { margin: 0 0 1.05em; text-wrap: pretty; hanging-punctuation: first; }
.post-head + .prose { margin-top: clamp(40px, 7vh, 72px); }
.prose strong { font-weight: 600; }
.prose h2 {
  margin: 2.3em 0 .5em;
  font-family: var(--display); font-stretch: 132%; font-weight: 860;
  font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3.1rem); line-height: .96; letter-spacing: -0.015em;
}
.prose h2.step { display: flex; align-items: center; }
.head { display: inline-block; flex: none; width: .36em; height: .34em; margin-right: .16em; background: var(--orchid); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.prose h3 {
  margin: 1.7em 0 .3em;
  font-family: var(--display); font-stretch: 84%; font-weight: 700;
  font-size: 1.32em; line-height: 1.1;
}

/* ---------- the figure: seven systems, the verbs drive it ---------- */
.floor { margin: clamp(36px, 6vh, 64px) 0 clamp(8px, 2vh, 20px); }
.verbs {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .1em .42em;
  font-family: var(--display); font-size: clamp(1.5rem, 1rem + 2vw, 2.3rem); line-height: .95; letter-spacing: -0.015em;
}
.verb {
  all: unset; position: relative; display: inline-flex; align-items: center; cursor: pointer; white-space: nowrap;
  font-stretch: 50%; font-weight: 400; color: var(--muted); padding-block: .04em .1em;
  transition: font-stretch .8s var(--ease), font-weight .8s var(--ease), color .4s ease;
}
.verb:hover { color: var(--ink); }
.verb[aria-pressed="true"] { font-stretch: 140%; font-weight: 880; color: var(--ink); }
.verb:focus-visible { outline: 3px solid var(--orchid); outline-offset: 2px; }
.verb .head { width: 0; margin-right: 0; transition: width .6s var(--ease), margin .6s var(--ease); }
.verb[aria-pressed="true"] .head { width: .36em; margin-right: .14em; }
.verb .tick { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--orchid); }
.verb.timing .tick { animation: tick var(--cycle, 9000ms) linear forwards; }
@keyframes tick { to { width: 100%; } }

.map { display: block; width: 100%; aspect-ratio: 16 / 9; margin-top: 14px; }

.readout { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; margin-top: 10px; min-height: 3.2rem; }
.readout p { margin: 0; }
.count { font-family: var(--display); font-stretch: 84%; font-weight: 600; font-size: 1.05rem; }
.count .num { display: inline-block; min-width: 2ch; font-stretch: 130%; font-weight: 860; font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; vertical-align: -.08em; }
.ledger { color: var(--muted); font-size: .98rem; font-variant-numeric: tabular-nums; }
.stop {
  margin-left: auto;
  padding: .72em 1.25em .78em;
  background: var(--ink); color: var(--paper);
  font-family: var(--display); font-stretch: 96%; font-weight: 640; font-size: 1.02rem; line-height: 1;
  border: 0; border-radius: 3px; cursor: pointer; white-space: nowrap;
  transition: font-stretch .35s ease;
}
.stop:hover:not(:disabled) { font-stretch: 112%; }
.stop:disabled { opacity: .32; cursor: default; }   /* See it: there is no agent to stop yet */
.stop[aria-pressed="true"] { background: none; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.state { margin: 6px 0 0; min-height: 1.62em; font-style: italic; }
.floor figcaption { margin-top: 10px; color: var(--muted); font-size: .92rem; line-height: 1.5; }
[hidden] { display: none !important; }

/* ---------- the table of gaps ---------- */
.wide { margin: 1.6em 0 2em; }
.gaps { width: 100%; border-collapse: collapse; font-size: .95rem; line-height: 1.42; }
.gaps caption { text-align: left; padding-bottom: .6em; font-family: var(--display); font-stretch: 84%; font-weight: 700; font-size: 1.25rem; }
.gaps th, .gaps td { text-align: left; vertical-align: top; padding: .7em 1.4em .75em 0; border-top: 1px solid var(--line); }
.gaps thead th { border-top: 0; color: var(--muted); font-weight: 400; font-style: italic; padding-block: 0 .5em; }
.gaps tbody th { font-family: var(--display); font-stretch: 100%; font-weight: 720; font-size: 1.08rem; white-space: nowrap; }
.gaps td:nth-child(3) { color: var(--ink); }
.gaps td:nth-child(2), .gaps td:nth-child(4) { color: var(--muted); }

/* ---------- the Monday list: a real sequence, so it is numbered ---------- */
.monday { list-style: none; margin: 1.1em 0 1.8em; padding: 0; counter-reset: m; }
.monday li { counter-increment: m; position: relative; padding: .55em 0 .6em 3.6em; border-top: 1px solid var(--line); }
.monday li::before {
  content: counter(m); position: absolute; left: 0; top: .32em;
  font-family: var(--display); font-stretch: 130%; font-weight: 860; font-size: 1.5em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.reach { font-family: var(--display); font-stretch: 110%; font-weight: 700; font-size: 1.4em; }

/* ---------- narrow screens ---------- */
@media (max-width: 560px) {
  .map { aspect-ratio: 3 / 5; }
}
@media (max-width: 720px) {
  .stop { margin-left: 0; }
  .readout { min-height: 0; }
  .gaps thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .gaps, .gaps caption, .gaps tbody, .gaps tr, .gaps th, .gaps td { display: block; }
  .gaps tr { border-top: 1px solid var(--line); padding: .8em 0 .9em; }
  .gaps th, .gaps td { border: 0; padding: 0; }
  .gaps td { margin-top: .35em; }
  .gaps td::before { content: attr(data-l) ". "; font-style: italic; color: var(--muted); }
  .gaps td:nth-child(2), .gaps td:nth-child(4) { color: var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
