/*
 * The articles (ADR-0112, ADR-0113 decision 10): long reading in the site's Dusk, over site.css. A reading measure
 * under the sky, the App Store screenshots' type for titles (a heavy Rounded line, an orange italic phrase), and the
 * series' pictures: the magpie at dusk with each article's one shiny thing. Each topic wears a star colour of the home
 * page's sky. What moves is small, answers the reader (a card lifting, a picture leaning in, the bar that fills as you
 * read) and stops for anyone who asked for less motion (site.css). Every byte is the site's own
 * (no-third-party.test.ts).
 */

/* New York Italic in Apple's browsers (ui-serif); Newsreader, self-hosted, everywhere else. */
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/newsreader-latin-wght-italic.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC,
    U+2122, U+2212;
}

.guide {
  --page: 72rem;
  --measure: 40rem;
  --serif: ui-serif, "New York", "Newsreader", Georgia, serif;
}

@media (min-width: 720px) {
  .guide {
    --gutter: 32px;
  }
}

.guide .bar nav {
  align-items: center;
}

.guide .bar nav a.nav-cta {
  margin-left: 6px;
  padding: 8px 16px;
  color: var(--on-accent);
  font-weight: 750;
  background: var(--accent);
  box-shadow: 0 8px 20px -10px rgb(255 138 51 / 0.8);
}

.guide .bar nav a.nav-cta:hover {
  color: var(--on-accent);
  background: #ff9a4d;
}

@media (max-width: 520px) {
  .guide .bar nav a:not(.nav-cta) {
    display: none;
  }
}

.accent {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  color: var(--accent-text);
}

.kicker {
  margin: 0 0 14px;
  color: var(--accent-text);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* The index */

.guides-head {
  max-width: 46rem;
  padding: clamp(56px, 10vw, 112px) 0 clamp(32px, 5vw, 56px);
}

.guides-head h1 {
  margin: 0;
  font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.guides-head h1 .accent {
  display: block;
}

.dek {
  margin: 22px 0 0;
  color: var(--ink-2);
  font-size: clamp(1.125rem, 1.02rem + 0.45vw, 1.3125rem);
  line-height: 1.55;
}

/* Topics: each wears one of the sky's star colours. */

.tone-1 {
  --tone: var(--star-1);
  --tone-glow: rgb(255 154 77 / 0.5);
}

.tone-2 {
  --tone: var(--star-2);
  --tone-glow: rgb(95 208 194 / 0.45);
}

.tone-3 {
  --tone: var(--star-3);
  --tone-glow: rgb(196 162 240 / 0.45);
}

.tone-4 {
  --tone: var(--star-4);
  --tone-glow: rgb(240 194 90 / 0.45);
}

.tone-5 {
  --tone: var(--star-5);
  --tone-glow: rgb(242 138 162 / 0.45);
}

.kicker[class*="tone-"] {
  display: flex;
  align-items: center;
  color: var(--tone);
}

/* New: the newest article, in the gold of the fifth star. */

.new {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 3px 9px 2px;
  color: #2b1e1a;
  font-size: 0.6875rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  background: linear-gradient(100deg, #f0c25a 0%, #ffe3a1 45%, #f0c25a 60%) 0 0 / 220% 100%;
  border-radius: 999px;
  box-shadow:
    0 0 0 1px rgb(255 227 161 / 0.5),
    0 0 18px rgb(240 194 90 / 0.55);
}

/* The index's topics */

.topics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 28px;
}

/* Until articles.js shows them; without it they would do nothing, so every card shows instead. */
.topics[hidden] {
  display: none;
}

/* On a phone the topics are one row you swipe, fading at the edges, rather than a wall of chips. */
@media (max-width: 759px) {
  .topics {
    flex-wrap: nowrap;
    margin-inline: calc(-1 * var(--gutter));
    padding: 2px var(--gutter) 6px;
    overflow-x: auto;
    scrollbar-width: none;
    mask-image: linear-gradient(
      90deg,
      transparent,
      #000 var(--gutter),
      #000 calc(100% - var(--gutter)),
      transparent
    );
  }

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

  .topic {
    flex: none;
  }
}

.topic {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 750;
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 220ms cubic-bezier(0.2, 0.9, 0.25, 1.15);
}

.topic:hover {
  color: var(--ink);
  border-color: var(--tone, var(--edge));
  transform: translateY(-1px);
}

.topic[aria-pressed="true"] {
  color: var(--on-accent);
  background: var(--tone, var(--accent));
  border-color: transparent;
  box-shadow: 0 10px 24px -12px var(--tone-glow, rgb(255 138 51 / 0.8));
}

.topic-count {
  min-width: 22px;
  padding: 1px 7px;
  font-size: 0.75rem;
  font-weight: 850;
  text-align: center;
  background: rgb(255 236 220 / 0.1);
  border-radius: 999px;
}

.topic[aria-pressed="true"] .topic-count {
  background: rgb(43 30 26 / 0.18);
}

/* The cards: a picture, then the words, then how long it takes. */

.cards {
  display: grid;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 760px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card[hidden] {
  display: none;
}

.card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  color: var(--ink-2);
  text-decoration: none;
  background: linear-gradient(180deg, rgb(70 50 42 / 0.6), rgb(44 30 26 / 0.7));
  border: 1px solid rgb(255 226 200 / 0.14);
  border-radius: 24px;
  box-shadow: 0 30px 60px -36px rgb(0 0 0 / 0.75);
  transition:
    transform 260ms cubic-bezier(0.2, 0.9, 0.25, 1.15),
    border-color 200ms ease,
    box-shadow 260ms ease;
}

.card a:hover {
  border-color: var(--tone, rgb(255 176 113 / 0.45));
  box-shadow:
    0 0 0 1px var(--tone-glow, transparent),
    0 26px 60px -30px var(--tone-glow, rgb(0 0 0 / 0.75));
  transform: translateY(-6px);
}

.card-picture {
  display: block;
  aspect-ratio: 768 / 429;
  overflow: hidden;
  background: linear-gradient(180deg, #2a1a1a, #4a2a20);
  border-bottom: 1px solid rgb(255 226 200 / 0.1);
}

.card-picture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card a:hover .card-picture img {
  transform: scale(1.06);
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 18px 22px 20px;
}

.card-kicker {
  display: flex;
  align-items: center;
  color: var(--tone, var(--accent-text));
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-title {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 750;
  line-height: 1.25;
}

.card-dek {
  font-size: 0.9375rem;
  line-height: 1.5;
}

.card-meta {
  margin-top: auto;
  padding-top: 8px;
  color: var(--ink-4);
  font-size: 0.8125rem;
  font-weight: 700;
}

/* The newest card glows, and on the index it opens the page at full width. */

.card-new a {
  border-color: rgb(240 194 90 / 0.65);
  box-shadow:
    0 0 0 1px rgb(240 194 90 / 0.3),
    0 0 40px -6px rgb(240 194 90 / 0.4),
    0 30px 60px -36px rgb(0 0 0 / 0.75);
}

.card-new a:hover {
  border-color: #f0c25a;
}

@media (min-width: 760px) {
  .index-cards .card-new {
    grid-column: 1 / -1;
  }

  .index-cards .card-new a {
    flex-direction: row;
  }

  .index-cards .card-new .card-picture {
    flex: 0 0 58%;
    aspect-ratio: auto;
    min-height: 100%;
    border-right: 1px solid rgb(255 226 200 / 0.1);
    border-bottom: 0;
  }

  .index-cards .card-new .card-body {
    justify-content: center;
    gap: 12px;
    padding: 32px 36px;
  }

  .index-cards .card-new .card-title {
    font-size: clamp(1.5rem, 1rem + 1.2vw, 2.125rem);
    line-height: 1.15;
    letter-spacing: -0.015em;
  }

  .index-cards .card-new .card-dek {
    font-size: 1.0625rem;
  }

  .index-cards .card-new .card-meta {
    margin-top: 6px;
  }
}

/* Cards rise into view as the page scrolls to them, where the browser can tie motion to scrolling. */

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .card {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }

  .new {
    animation: shimmer 3.2s ease-in-out infinite;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.98);
  }
}

@keyframes shimmer {
  50% {
    background-position: 100% 0;
  }
}

/* An article */

.article {
  max-width: var(--measure);
  margin-inline: auto;
}

.crumbs {
  display: flex;
  gap: 10px;
  padding-top: clamp(32px, 6vw, 64px);
  color: var(--ink-3);
  font-size: 0.9375rem;
}

.crumbs a {
  color: var(--ink-2);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--ink);
}

.article-head {
  padding: 28px 0 8px;
}

.article-head h1 {
  margin: 0;
  font-size: clamp(2.125rem, 1.5rem + 2.6vw, 3.25rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.byline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 0;
  color: var(--ink-3);
  font-size: 0.9375rem;
}

.byline a {
  color: var(--ink-2);
  text-decoration: none;
}

.byline-photo,
.author img {
  flex: none;
  border-radius: 50%;
  object-fit: cover;
}

.author {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-top: 48px;
  padding: 22px;
  background: rgb(255 236 220 / 0.045);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.author h2 {
  margin: 0 0 6px;
  font-size: 1.125rem;
  font-weight: 800;
}

.author p {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.55;
}

.contents {
  margin: 32px 0 8px;
  padding: 20px 22px 14px;
  background: rgb(255 236 220 / 0.045);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.contents-title {
  margin: 0 0 8px;
  color: var(--ink);
  font-weight: 750;
}

.contents ol {
  margin: 0;
  padding-left: 1.3em;
}

.contents li {
  margin: 6px 0;
}

.contents a {
  color: var(--ink-2);
  text-decoration: none;
}

.contents a:hover {
  color: var(--accent-text);
}

.prose {
  padding-top: 16px;
  color: var(--ink-2);
  font-size: 1.125rem;
  line-height: 1.72;
}

.prose h2 {
  margin: 2.2em 0 0.6em;
  font-size: clamp(1.5rem, 1.3rem + 0.9vw, 1.875rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
  scroll-margin-top: 24px;
}

.prose h3 {
  margin: 1.8em 0 0.5em;
  font-size: 1.25rem;
  font-weight: 750;
  line-height: 1.3;
  scroll-margin-top: 24px;
}

/* The words' own rhythm, kept out of the diagrams, which set their own. */
.prose p:not(.diagram *),
.prose ul:not(.diagram *),
.prose ol:not(.diagram *) {
  margin: 0 0 1.1em;
}

.prose ul:not(.diagram *),
.prose ol:not(.diagram *) {
  padding-left: 1.4em;
}

.prose li:not(.diagram *) {
  margin: 0.4em 0;
}

.prose li::marker {
  color: var(--accent);
}

.prose strong {
  color: var(--ink);
  font-weight: 750;
}

.prose blockquote {
  margin: 1.6em 0;
  padding: 18px 22px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 16px;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose code {
  padding: 1px 6px;
  font-size: 0.9em;
  background: rgb(255 236 220 / 0.08);
  border-radius: 6px;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 20px;
}

.prose hr {
  margin: 2.4em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.table {
  margin: 1.4em 0;
  overflow-x: auto;
}

.prose table {
  width: 100%;
  font-size: 1rem;
  border-collapse: collapse;
}

.prose th,
.prose td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.prose th {
  color: var(--ink);
  font-weight: 750;
}

/* The picture: wider than the words, the way a magazine opens a piece. */

.article-hero {
  --hero: min(100vw - 2 * var(--gutter), 56rem);
  margin: 28px calc((var(--hero) - 100%) / -2) 8px;
  overflow: hidden;
  background: linear-gradient(180deg, #2a1a1a, #4a2a20);
  border: 1px solid rgb(255 226 200 / 0.14);
  border-radius: 28px;
  box-shadow:
    0 40px 90px -40px rgb(0 0 0 / 0.85),
    0 0 80px -30px rgb(192 96 46 / 0.55);
}

.article-hero img {
  display: block;
  width: 100%;
  height: auto;
}

@media (prefers-reduced-motion: no-preference) {
  .article-hero img {
    animation: settle 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
}

/* Never from transparent: the picture is the page's largest paint, and a fade would only delay it. */
@keyframes settle {
  from {
    transform: scale(1.045);
  }
}

/* The short version, up top, as the takeaway it is. */

.prose .short {
  margin: 0.4em 0 1.8em;
  padding: 20px 22px;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, rgb(255 138 51 / 0.14), transparent 60%),
    linear-gradient(180deg, var(--card-top), var(--card-bottom));
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 18px;
}

.prose .short p {
  margin: 0;
}

.prose .short strong {
  color: var(--accent-text);
}

/* How far you've read: a line of sunset across the top, filled by scrolling alone. */

.progress {
  display: none;
}

@supports (animation-timeline: scroll()) {
  .progress {
    position: fixed;
    inset: 0 0 auto;
    z-index: 30;
    display: block;
    height: 3px;
    background: linear-gradient(90deg, #f0c25a, var(--accent), #f28aa2);
    transform: scaleX(0);
    transform-origin: 0 50%;
    animation: read linear both;
    animation-timeline: scroll(root);
    box-shadow: 0 0 12px rgb(255 138 51 / 0.6);
  }
}

@keyframes read {
  to {
    transform: scaleX(1);
  }
}

/* Diagrams (ADR-0113 decision 12): what the reader should see, in the article's topic colour, a little wider than the
   words. The step the reader is heading for glows, like the thing the magpie holds. */

.diagram {
  /* The glow of the thing the magpie holds in every picture: what the reader is heading for. */
  --lit: #ffb071;
  --lit-fill: linear-gradient(180deg, #ffd08a, #ff9a4d);
  --lit-glow: rgb(255 154 77 / 0.55);
  --wide: min(100vw - 2 * var(--gutter), 56rem);
  margin: 2em calc((var(--wide) - 100%) / -2);
  padding: 22px clamp(16px, 3vw, 28px) 20px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.45;
  background:
    radial-gradient(circle at 0% 0%, rgb(192 96 46 / 0.24), transparent 50%),
    radial-gradient(circle at 100% 100%, rgb(255 154 77 / 0.07), transparent 45%),
    linear-gradient(180deg, var(--card-top), var(--card-bottom));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 30px 70px -40px rgb(0 0 0 / 0.8);
}

.diagram-title {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 800;
}

.diagram-title::before {
  flex: none;
  width: 9px;
  height: 9px;
  background: var(--tone, var(--accent));
  border-radius: 50%;
  box-shadow: 0 0 12px 2px var(--tone-glow, rgb(255 138 51 / 0.5));
  content: "";
}

.diagram-caption {
  margin: 16px 0 0;
  color: var(--ink-4);
  font-size: 0.8125rem;
  text-align: center;
}

.diagram strong {
  display: block;
  color: var(--ink);
  font-weight: 800;
}

:where(.diagram) :where(ol, ul) {
  margin: 0;
  padding: 0;
  list-style: none;
}

.diagram .is-lit {
  border-color: var(--lit);
  box-shadow:
    0 0 0 1px var(--lit),
    0 0 34px -6px var(--lit-glow);
}

.diagram .is-lit > strong {
  color: var(--lit);
}

/* A flow: numbered steps on a rail, side by side where there is room. */

.flow {
  position: relative;
  display: grid;
  gap: 14px;
  counter-reset: step;
}

.flow-step {
  position: relative;
  min-height: 34px;
  padding: 4px 0 0 48px;
  counter-increment: step;
}

.flow-step::before {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--tone, var(--accent-text));
  font-size: 0.875rem;
  font-weight: 900;
  background: rgb(255 236 220 / 0.06);
  border: 1.5px solid var(--tone, var(--accent));
  border-radius: 50%;
  content: counter(step);
}

.flow-step:not(:last-child)::after {
  position: absolute;
  top: 38px;
  bottom: -12px;
  left: 16px;
  width: 2px;
  background: linear-gradient(180deg, var(--tone, var(--accent)), transparent);
  opacity: 0.6;
  content: "";
}

.flow-step span {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 0.875rem;
}

.flow-step.is-lit {
  border: 0;
  box-shadow: none;
}

.flow-step.is-lit::before {
  color: var(--on-accent);
  background: var(--lit-fill);
  border-color: transparent;
  box-shadow:
    0 0 0 5px rgb(255 154 77 / 0.22),
    0 0 26px 3px var(--lit-glow);
}

@media (min-width: 720px) {
  .flow.n2,
  .flow.n3,
  .flow.n4 {
    gap: 30px;
  }

  .flow.n2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .flow.n3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .flow.n4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .flow:is(.n2, .n3, .n4) .flow-step {
    padding: 16px 16px 18px;
    background: rgb(255 236 220 / 0.045);
    border: 1px solid var(--line);
    border-radius: 18px;
  }

  .flow:is(.n2, .n3, .n4) .flow-step::before {
    position: static;
    margin-bottom: 12px;
  }

  .flow:is(.n2, .n3, .n4) .flow-step.is-lit {
    border: 1px solid var(--lit);
    box-shadow:
      0 0 0 1px var(--lit),
      0 0 34px -6px var(--lit-glow);
  }

  /* The arrow to the next step. */
  .flow:is(.n2, .n3, .n4) .flow-step:not(:last-child)::after {
    top: 50%;
    right: -21px;
    bottom: auto;
    left: auto;
    width: 11px;
    height: 11px;
    background: none;
    border-top: 2px solid var(--tone, var(--accent));
    border-right: 2px solid var(--tone, var(--accent));
    transform: translateY(-50%) rotate(45deg);
    opacity: 0.8;
  }
}

/* A tree: the app's own drawing of an Intention broken down (tree.css), on the app's dark, a window onto it. Its
   edges stay crisp: the window's own frame says where it ends, and the hint under it says there is more. */

.diagram-tree .tree-canvas {
  padding: 22px 0 20px;
  background: linear-gradient(180deg, rgb(33 23 21 / 0.94), rgb(43 30 26 / 0.94));
  border: 1px solid rgb(255 226 200 / 0.08);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgb(255 240 228 / 0.05);
}

.diagram-tree .tree-canvas.is-wide {
  -webkit-mask-image: none;
  mask-image: none;
}

/* A split: one thing, sorted into a few places. */

.split-from {
  max-width: 22rem;
  margin: 0 auto;
  padding: 12px 18px;
  text-align: center;
  background: rgb(255 236 220 / 0.07);
  border: 1px solid var(--tone, var(--accent));
  border-radius: 16px;
}

.split-from span,
.split-place span {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 0.875rem;
}

.split-to {
  position: relative;
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-left: 22px;
}

.split-to::before {
  position: absolute;
  top: -14px;
  bottom: 22px;
  left: 0;
  width: 2px;
  background: var(--tone, var(--accent));
  opacity: 0.55;
  content: "";
}

.split-place {
  position: relative;
  padding: 12px 14px;
  background: rgb(255 236 220 / 0.045);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.split-place::before {
  position: absolute;
  top: 50%;
  left: -22px;
  width: 21px;
  height: 2px;
  background: var(--tone, var(--accent));
  opacity: 0.55;
  content: "";
}

@media (min-width: 720px) {
  .split-to {
    padding: 34px 0 0;
  }

  .split-to.n2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .split-to.n3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .split-to.n4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .split-to.n5 {
    grid-template-columns: repeat(5, 1fr);
  }

  /* From the thing down to a bar across the places, and a stub down into each. */
  .split-to::before {
    top: -14px;
    bottom: auto;
    left: 50%;
    height: 32px;
  }

  .split-to::after {
    position: absolute;
    top: 18px;
    height: 2px;
    background: var(--tone, var(--accent));
    opacity: 0.55;
    content: "";
  }

  .split-to.n2::after {
    inset-inline: calc((100% - 12px) / 4);
  }

  .split-to.n3::after {
    inset-inline: calc((100% - 24px) / 6);
  }

  .split-to.n4::after {
    inset-inline: calc((100% - 36px) / 8);
  }

  .split-to.n5::after {
    inset-inline: calc((100% - 48px) / 10);
  }

  .split-place {
    text-align: center;
  }

  .split-place::before {
    top: -16px;
    left: 50%;
    width: 2px;
    height: 15px;
  }
}

/* A comparison: the same rows down each option. */

.compare {
  display: grid;
  gap: 12px;
}

@media (min-width: 720px) {
  .compare.n2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .compare.n3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.compare-column {
  padding: 16px 16px 6px;
  background: rgb(255 236 220 / 0.045);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.compare-name {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 850;
}

.compare-column.is-lit .compare-name {
  color: var(--lit);
}

.compare dl {
  margin: 0;
}

.compare dt {
  color: var(--tone, var(--accent-text));
  font-size: 0.6875rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compare dd {
  margin: 2px 0 12px;
}

/* Bars: the numbers a source gives, the ones that matter lit. */

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

.meter-label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-2);
  font-size: 0.875rem;
  font-weight: 750;
}

.meter.is-lit {
  border: 0;
  box-shadow: none;
}

.meter.is-lit .meter-label {
  color: var(--ink);
}

.meter-track {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meter-fill {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 34px;
  padding: 0 12px;
  background: rgb(255 236 220 / 0.16);
  border-radius: 10px;
  transform-origin: 0 50%;
}

.meter.is-lit .meter-fill {
  background: linear-gradient(90deg, #ff9a4d, #ffd08a);
  box-shadow: 0 0 28px -6px var(--lit-glow);
}

.meter-value {
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 850;
  white-space: nowrap;
}

.meter.is-lit .meter-fill .meter-value {
  color: var(--on-accent);
}

.meter-fill.w-5 {
  width: 5%;
}

.meter-fill.w-10 {
  width: 10%;
}

.meter-fill.w-15 {
  width: 15%;
}

.meter-fill.w-20 {
  width: 20%;
}

.meter-fill.w-25 {
  width: 25%;
}

.meter-fill.w-30 {
  width: 30%;
}

.meter-fill.w-35 {
  width: 35%;
}

.meter-fill.w-40 {
  width: 40%;
}

.meter-fill.w-45 {
  width: 45%;
}

.meter-fill.w-50 {
  width: 50%;
}

.meter-fill.w-55 {
  width: 55%;
}

.meter-fill.w-60 {
  width: 60%;
}

.meter-fill.w-65 {
  width: 65%;
}

.meter-fill.w-70 {
  width: 70%;
}

.meter-fill.w-75 {
  width: 75%;
}

.meter-fill.w-80 {
  width: 80%;
}

.meter-fill.w-85 {
  width: 85%;
}

.meter-fill.w-90 {
  width: 90%;
}

.meter-fill.w-95 {
  width: 95%;
}

.meter-fill.w-100 {
  width: 100%;
}

/* A cycle: steps that come round again, the way back drawn beside them. */

.cycle {
  position: relative;
  display: grid;
  gap: 22px;
  padding-right: 34px;
}

.cycle-step {
  position: relative;
  padding: 12px 14px;
  background: rgb(255 236 220 / 0.045);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.cycle-step span,
.timeline-moment span,
.decision-answer span,
.matrix-cell span {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 0.875rem;
}

/* The arrow down to the next step. */
.cycle-step:not(:last-child)::after {
  position: absolute;
  bottom: -16px;
  left: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--tone, var(--accent));
  border-bottom: 2px solid var(--tone, var(--accent));
  transform: translateX(-50%) rotate(45deg);
  opacity: 0.8;
  content: "";
}

/* The way back: from the last step, up the side, into the first. */
.cycle::after {
  position: absolute;
  top: 22px;
  right: 6px;
  bottom: 22px;
  width: 22px;
  border: 2px solid var(--tone, var(--accent));
  border-left: 0;
  border-radius: 0 16px 16px 0;
  opacity: 0.6;
  content: "";
}

.cycle::before {
  position: absolute;
  top: 17px;
  right: 24px;
  width: 9px;
  height: 9px;
  border-bottom: 2px solid var(--tone, var(--accent));
  border-left: 2px solid var(--tone, var(--accent));
  transform: rotate(45deg);
  opacity: 0.8;
  content: "";
}

.cycle-back {
  margin: 12px 0 0;
  color: var(--tone, var(--accent-text));
  font-size: 0.8125rem;
  font-weight: 800;
  text-align: center;
}

.cycle-back span::before {
  margin-right: 6px;
  content: "\21BA";
}

@media (min-width: 720px) {
  .cycle.n3,
  .cycle.n4 {
    gap: 30px;
    padding: 0 0 30px;
  }

  .cycle.n3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .cycle.n4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .cycle:is(.n3, .n4) .cycle-step:not(:last-child)::after {
    top: 50%;
    right: -21px;
    bottom: auto;
    left: auto;
    border-top: 2px solid var(--tone, var(--accent));
    border-bottom: 0;
    transform: translateY(-50%) rotate(45deg);
  }

  /* Under the row, from the last step back to the first. */
  .cycle:is(.n3, .n4)::after {
    top: auto;
    bottom: 0;
    width: auto;
    height: 26px;
    border: 2px solid var(--tone, var(--accent));
    border-top: 0;
    border-radius: 0 0 18px 18px;
  }

  .cycle.n3::after {
    inset-inline: calc((100% - 60px) / 6);
  }

  .cycle.n4::after {
    inset-inline: calc((100% - 90px) / 8);
  }

  .cycle:is(.n3, .n4)::before {
    top: auto;
    right: auto;
    bottom: 22px;
    border-top: 2px solid var(--tone, var(--accent));
    border-bottom: 0;
    transform: translateX(-50%) rotate(45deg);
  }

  .cycle.n3::before {
    left: calc((100% - 60px) / 6);
  }

  .cycle.n4::before {
    left: calc((100% - 90px) / 8);
  }
}

/* A timeline: moments on a rail, each with its when. */

.timeline {
  position: relative;
  display: grid;
  gap: 16px;
}

.timeline-moment {
  position: relative;
  padding-left: 30px;
}

.timeline-moment::before {
  position: absolute;
  top: 4px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: var(--tone, var(--accent));
  border-radius: 50%;
  content: "";
}

.timeline-moment:not(:last-child)::after {
  position: absolute;
  top: 20px;
  bottom: -14px;
  left: 7px;
  width: 2px;
  background: var(--tone, var(--accent));
  opacity: 0.4;
  content: "";
}

.timeline-moment em {
  display: block;
  margin-bottom: 2px;
  color: var(--tone, var(--accent-text));
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.timeline-moment.is-lit {
  border: 0;
  box-shadow: none;
}

.timeline-moment.is-lit::before {
  background: var(--lit-fill);
  box-shadow:
    0 0 0 5px rgb(255 154 77 / 0.22),
    0 0 24px 3px var(--lit-glow);
}

@media (min-width: 720px) {
  .timeline:is(.n2, .n3, .n4, .n5) {
    gap: 16px;
    padding-top: 2px;
  }

  .timeline.n2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline.n3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .timeline.n4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .timeline.n5 {
    grid-template-columns: repeat(5, 1fr);
  }

  .timeline:is(.n2, .n3, .n4, .n5) .timeline-moment {
    padding: 26px 4px 0;
    text-align: center;
  }

  .timeline:is(.n2, .n3, .n4, .n5) .timeline-moment::before {
    top: 0;
    left: calc(50% - 6px);
  }

  /* The rail between this moment and the next. */
  .timeline:is(.n2, .n3, .n4, .n5) .timeline-moment:not(:last-child)::after {
    top: 5px;
    right: calc(-50% - 8px);
    bottom: auto;
    left: calc(50% + 8px);
    width: auto;
    height: 2px;
  }
}

/* A decision: a question at a time; yes goes across to its answer, no goes down to the next. */

.decision {
  display: grid;
}

.decision-row {
  position: relative;
  display: grid;
  gap: 10px;
  padding-bottom: 34px;
}

.decision-row:last-child {
  padding-bottom: 0;
}

.decision-ask {
  position: relative;
  margin: 0;
  padding: 12px 14px;
  color: var(--ink);
  font-weight: 750;
  background: rgb(255 236 220 / 0.045);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.decision-answer {
  position: relative;
  margin-left: 22px;
  padding: 10px 14px;
  background: rgb(255 236 220 / 0.07);
  border: 1px solid var(--tone, var(--accent));
  border-radius: 14px;
}

.decision-otherwise .decision-answer {
  margin-left: 0;
}

.decision-yes {
  display: block;
  color: var(--tone, var(--accent-text));
  font-size: 0.6875rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* No: down to the next question. */
.decision-row:not(:last-child)::after {
  position: absolute;
  bottom: 4px;
  left: 18px;
  display: flex;
  align-items: center;
  height: 24px;
  padding-left: 12px;
  color: var(--ink-4);
  font-size: 0.75rem;
  font-weight: 800;
  border-left: 2px solid var(--edge);
  content: "No";
}

@media (min-width: 720px) {
  .decision-row {
    grid-template-columns: 1.15fr 1fr;
    gap: 34px;
    align-items: center;
  }

  .decision-answer {
    margin-left: 0;
  }

  /* Yes: across to the answer. */
  .decision-row:not(.decision-otherwise) .decision-ask::after {
    position: absolute;
    top: 50%;
    right: -30px;
    width: 24px;
    height: 2px;
    background: var(--tone, var(--accent));
    opacity: 0.8;
    content: "";
  }

  .decision-row:not(.decision-otherwise) .decision-answer::before {
    position: absolute;
    top: 50%;
    left: -12px;
    width: 9px;
    height: 9px;
    border-top: 2px solid var(--tone, var(--accent));
    border-right: 2px solid var(--tone, var(--accent));
    transform: translateY(-50%) rotate(45deg);
    content: "";
  }
}

/* A matrix: two questions crossed into four boxes. */

.matrix {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 10px;
}

.matrix-across,
.matrix-down {
  color: var(--tone, var(--accent-text));
  font-size: 0.6875rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.matrix-left {
  grid-row: 1;
  grid-column: 2;
}

.matrix-right {
  grid-row: 1;
  grid-column: 3;
}

.matrix-down {
  align-self: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.matrix-top {
  grid-row: 2;
  grid-column: 1;
}

.matrix-bottom {
  grid-row: 3;
  grid-column: 1;
}

.matrix-cell {
  min-height: 92px;
  padding: 12px 14px;
  background: rgb(255 236 220 / 0.045);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.matrix-cell-1 {
  grid-row: 2;
  grid-column: 2;
}

.matrix-cell-2 {
  grid-row: 2;
  grid-column: 3;
}

.matrix-cell-3 {
  grid-row: 3;
  grid-column: 2;
}

.matrix-cell-4 {
  grid-row: 3;
  grid-column: 3;
}

/* Parts: one whole, split into its shares, each named in the legend. */

.shares-track {
  overflow: hidden;
  border-radius: 10px;
}

.shares-bar {
  display: block;
  width: 100%;
  height: 34px;
  transform-origin: 0 50%;
}

.share-1 {
  fill: var(--star-1);
  background: var(--star-1);
}

.share-2 {
  fill: var(--star-2);
  background: var(--star-2);
}

.share-3 {
  fill: var(--star-3);
  background: var(--star-3);
}

.share-4 {
  fill: var(--star-4);
  background: var(--star-4);
}

.share-5 {
  fill: var(--star-5);
  background: var(--star-5);
}

.share-6 {
  fill: rgb(255 236 220 / 0.55);
  background: rgb(255 236 220 / 0.55);
}

.diagram .shares-legend {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.share {
  display: flex;
  gap: 10px;
  align-items: center;
}

.share.is-lit {
  border: 0;
  box-shadow: none;
}

.share-swatch {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.share-label {
  flex: 1;
}

.share.is-lit .share-label,
.share-value {
  color: var(--ink);
  font-weight: 800;
}

.share-value {
  font-variant-numeric: tabular-nums;
}

/* Steps and bars arrive as the reader reaches them, where the browser can tie motion to scrolling. */

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .flow-step,
    .cycle-step,
    .timeline-moment,
    .split-place,
    .decision-row,
    .compare-column,
    .matrix-cell {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }

    .meter-fill,
    .shares-bar {
      animation: grow linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 40%;
    }
  }
}

@keyframes grow {
  from {
    transform: scaleX(0.04);
  }
}

/* Questions and sources, after the body */

.guide-faq,
.sources {
  margin-top: 48px;
}

.guide-faq h2,
.sources h2,
.more h2 {
  margin: 0 0 14px;
  font-size: 1.5rem;
  font-weight: 800;
}

.guide-faq details {
  border-top: 1px solid var(--line);
}

.guide-faq details:last-of-type {
  border-bottom: 1px solid var(--line);
}

.guide-faq summary {
  padding: 16px 0;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 650;
  cursor: pointer;
}

.guide-faq details p {
  margin: 0 0 18px;
  line-height: 1.6;
}

.sources ol {
  padding-left: 1.4em;
  color: var(--ink-3);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.sources li {
  margin: 6px 0;
}

/* Magpie, once, at the end of the reading */

.magpie-card {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-top: 56px;
  overflow: hidden;
  padding: 28px 26px;
  background:
    radial-gradient(circle at 100% 0%, rgb(255 138 51 / 0.16), transparent 55%),
    linear-gradient(180deg, rgb(70 50 42 / 0.75), rgb(44 30 26 / 0.85));
  border: 1px solid rgb(255 176 113 / 0.3);
  border-radius: 28px;
  box-shadow: 0 40px 80px -40px rgb(0 0 0 / 0.8);
}

.magpie-card-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  color: var(--ink);
  font-weight: 800;
}

.magpie-card-kicker img {
  border-radius: 8px;
}

.magpie-card h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 800;
}

.magpie-card p {
  margin: 0 0 20px;
  line-height: 1.6;
}

.magpie-card-words {
  flex: 1;
}

.magpie-card-phone {
  display: none;
}

@media (min-width: 560px) {
  .magpie-card-phone {
    display: block;
    flex: 0 0 168px;
    width: 168px;
    height: auto;
    margin: -28px -6px -120px 0;
    border-radius: 22px;
    box-shadow: 0 30px 60px -24px rgb(0 0 0 / 0.8);
    transform: rotate(4deg);
    transition: transform 400ms cubic-bezier(0.2, 0.9, 0.25, 1.15);
  }

  .magpie-card:hover .magpie-card-phone {
    transform: rotate(1deg) translateY(-8px);
  }
}

.capsule {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 26px;
  color: var(--on-accent);
  font-size: 1.0625rem;
  font-weight: 800;
  text-decoration: none;
  background: linear-gradient(180deg, #ff9a4d, var(--accent));
  border-radius: 999px;
  box-shadow: 0 14px 30px -14px rgb(255 138 51 / 0.85);
}

.capsule:hover {
  color: var(--on-accent);
  filter: brightness(1.05);
}

/* A free tool that does what the article teaches (its front matter's `tool:`), offered right after the words. */
.tool-try {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px 18px;
  align-items: center;
  margin: 44px 0 0;
  padding: 22px 24px;
  background:
    radial-gradient(circle at 0% 0%, rgb(255 154 77 / 0.18), transparent 55%),
    linear-gradient(180deg, var(--card-top), var(--card-bottom));
  border: 1px solid rgb(255 176 113 / 0.35);
  border-radius: 24px;
  box-shadow:
    0 0 0 1px rgb(255 176 113 / 0.08),
    0 24px 50px -30px rgb(255 138 51 / 0.45);
}

.tool-try-mark svg {
  display: block;
  width: 56px;
  height: 56px;
}

.tool-try-kicker {
  margin: 0;
  color: var(--accent-text);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tool-try h2 {
  margin: 4px 0 0;
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.2;
}

.tool-try-words p:last-child {
  margin: 6px 0 0;
  color: var(--ink-2);
  line-height: 1.5;
}

.tool-try .capsule {
  grid-column: 1 / -1;
  justify-self: start;
}

@media (min-width: 640px) {
  .tool-try {
    grid-template-columns: auto 1fr auto;
  }

  .tool-try .capsule {
    grid-column: auto;
  }
}

.more {
  max-width: var(--page);
  margin: 72px auto 0;
}

.foot-links {
  display: flex;
  gap: 18px;
}
