/* Every page except the home page, in the home page's design language (story/story.css).
   There are two layouts. A "hero" page lists things to open, and starts with Kofi in his ring.
   A "thread" page is for reading: one column, with a blue thread down the side that stops at a small Kofi for each part. */
:root { --bg:#FFFFFF; --ink:#0B1220; --muted:#4B5874; --blue:#2563EB; --card:#F3F6FC; --track:#DDE7FB;
        --gutter: 6vw; /* the page's side margin */
        --x: clamp(56px, 9.4vw, 160px); /* where the thread runs */ }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, -apple-system, sans-serif; -webkit-text-size-adjust: 100%; }
.eyebrow { font: 600 13px ui-monospace, Menlo, monospace; letter-spacing: .04em; word-spacing: -.2em; text-transform: uppercase; color: var(--blue); }
h1, h2 { font-weight: 800; letter-spacing: -.03em; line-height: 1.02; margin: 12px 0 16px; }
h1 { font-size: clamp(44px, 6vw, 84px); }
h1 span { display: block; }
h1.long { font-size: clamp(36px, 4.6vw, 64px); } /* a title that is a sentence, such as a post's */
h2 { font-size: 44px; }
h3 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 56px 0 0; }
p { color: var(--muted); font-size: 19px; line-height: 1.55; margin: 0 0 24px; text-wrap: pretty; }
a { color: var(--blue); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 22px; border-radius: 12px; background: var(--blue); color: #fff; text-decoration: none; font-weight: 600; }
.btn svg { flex: none; margin-right: -4px; }
.go { display: inline-flex; align-items: center; gap: 6px; margin: 8px 18px 0 0; font-weight: 600; text-decoration: none; }
.links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 26px; }
.links a { font-weight: 600; text-decoration: none; }
.links.site { margin-top: 52px; }
.links.site a { color: var(--muted); }
.ring { border-radius: 50%; border: 3px solid var(--blue); }

/* Header: the round photo goes to the home page. */
.top { display: flex; align-items: center; justify-content: space-between; padding: 28px var(--gutter) 0; }
.thread .top { padding-left: calc(var(--x) - 28px); } /* the photo sits on the thread */
.top nav { display: flex; gap: 28px; }
.top nav a { color: var(--muted); font-weight: 600; text-decoration: none; }
.top nav a[aria-current] { color: var(--ink); }
.me img { width: 56px; height: 56px; border-radius: 50%; display: block; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--blue); }

/* Cards: things you can open. */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
.card { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: 16px; background: var(--card); color: var(--ink); text-decoration: none; transition: background .2s; }
.card:hover { background: #E6EDFB; }
.card b { font-size: 16px; }
.card span { font-size: 14px; line-height: 1.4; color: var(--muted); }
.card i { font: 600 11px ui-monospace, Menlo, monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
.card.app { gap: 10px; }
.card.app header { display: flex; align-items: center; gap: 11px; }
.card.app header div { display: flex; flex-direction: column; gap: 3px; }
.card.big { grid-column: 1 / -1; padding: 24px; gap: 12px; }
.card.big b { font-size: 22px; letter-spacing: -.01em; }
.card.big span { font-size: 16px; }
.card .tags { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ico { width: 40px; height: 40px; border-radius: 10px; overflow: hidden; flex: none; display: grid; place-items: center; }
.ico img { width: 100%; height: 100%; }
.ico.zoom img { transform: scale(1.2); }

/* Lists: facts you cannot open. They sit flat on the page. */
.list { display: grid; gap: 30px; margin-top: 36px; }
.list small { font: 600 12px ui-monospace, Menlo, monospace; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.list h3, .list h4 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin: 6px 0 4px; }
.list p { font-size: 17px; margin: 0; }

/* Text that comes from a Markdown file. */
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2 { font-size: 32px; line-height: 1.1; margin: 48px 0 16px; }
.prose h3 { margin: 40px 0 12px; }
.prose ul, .prose ol { margin: 0 0 24px; padding-left: 22px; color: var(--muted); font-size: 19px; line-height: 1.7; }
.prose strong { color: var(--ink); }
blockquote { margin: 0 0 24px; font-size: 22px; font-weight: 600; line-height: 1.45; }
blockquote p { font-size: inherit; color: var(--ink); }
.body img { display: block; max-width: 100%; height: auto; border-radius: 16px; }
figure { margin: 32px 0; }
figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
/* A command to copy. */
.code { display: block; width: fit-content; max-width: 100%; margin: 20px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--card); font: 14px ui-monospace, Menlo, monospace; overflow-x: auto; white-space: nowrap; }

/* Hero page: the home page's two columns, then one centred column. */
.hero { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 40px; padding: 0 var(--gutter) 72px; }
.hero .copy { max-width: 540px; }
/* The art: a soft glow, a pale disc in a blue ring, a blue dot, and Kofi.
   He shows in full above the ring's middle line (y 360), and only inside the circle below it. */
.art { position: relative; width: 540px; height: 620px; }
.art .glow { position: absolute; left: -40px; top: 80px; width: 620px; height: 560px; border-radius: 50%; background: radial-gradient(circle, rgba(37,99,235,.14), rgba(37,99,235,0) 66%); }
.art .ring { position: absolute; left: 30px; top: 120px; width: 480px; height: 480px; background: #EEF3FF; }
.art .dot { position: absolute; right: 18px; top: 92px; width: 64px; height: 64px; border-radius: 50%; background: var(--blue); }
.art .fig { position: absolute; inset: 0; clip-path: path("M0 0 H540 V360 H510 A240 240 0 0 1 30 360 H0 Z"); }
.art .fig img { position: absolute; top: 34px; left: 50%; height: 760px; transform: translateX(-50%); }
.col { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.col section { padding: 56px 0; }
.col h2 { font-size: 40px; margin: 10px 0 24px; }
/* The last block of a hero page: the home page's last chapter, with Kofi at the left edge. */
.end { position: relative; margin-top: 72px; height: 600px; overflow: hidden; display: grid; place-items: center; text-align: center; }
.end .stage { display: contents; }
.end .peek { position: absolute; left: -10px; bottom: 0; height: 440px; }
.end .copy { max-width: 520px; padding: 0 20px; }
.end .links { justify-content: center; }

/* Thread page. Each part draws its own piece of the thread: a pale track, and a blue line that is --p (0 to 1) of its height.
   site.js sets --p from the scroll position. With no script the whole thread is blue. */
.s { position: relative; padding: 0 var(--gutter) 128px calc(var(--x) + 220px); }
.s::before, .s::after { content: ''; position: absolute; left: calc(var(--x) - 1.5px); top: 0; width: 3px; }
.s::before { bottom: 0; background: var(--track); }
.s::after { height: calc(var(--p, 1) * 100%); background: var(--blue); }
.s.head { padding-top: 112px; }
.s.head::before, .s.head::after { top: 18px; border-radius: 3px 3px 0 0; }
.s.head::after { height: calc(var(--p, 1) * (100% - 18px)); }
.s.last::before { bottom: auto; height: 74px; } /* the thread ends at the middle of the last ring */
.s.last::after { max-height: 74px; }
.body { max-width: 640px; }
.head .body { max-width: 820px; }
.head p { max-width: 640px; }
.meta { font-size: 15px; margin: 0; }
/* A stop: a small Kofi in a ring that touches the thread. His head is above the ring. The ring is pale until the thread reaches it. */
.av { position: absolute; z-index: 1; left: calc(var(--x) - 1.5px); top: -10px; width: 168px; height: 168px; }
.av .ring { position: absolute; inset: 0; background: #fff; }
.later .av .ring { border-color: var(--track); }
.av img { position: absolute; left: 50%; bottom: -8px; height: 198px; transform: translateX(-50%); }

@media (max-width: 1100px) { .art { zoom: .8; } }

/* Phone. */
@media (max-width: 760px) {
  :root { --gutter: 20px; --x: 30px; }
  .eyebrow { font-size: 12px; }
  h1, h2 { margin: 10px 0 12px; line-height: 1.04; }
  h1 { font-size: 38px; } h1.long, h2 { font-size: 32px; }
  h3 { margin-top: 40px; }
  p { font-size: 17px; margin: 0 0 20px; }
  .btn { min-height: 48px; padding: 0 22px; font-size: 16px; }
  .go { min-height: 44px; margin-top: 0; }
  .links { gap: 0 22px; }
  .links a { min-height: 44px; display: inline-flex; align-items: center; }
  .links.site { margin-top: 32px; }
  .top, .thread .top { padding: 10px 10px 0 8px; }
  .top nav { gap: 0; }
  .top nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px; font-size: 15px; }
  .me { width: 44px; height: 44px; display: grid; place-items: center; }
  .me img { width: 32px; height: 32px; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--blue); }
  .cards { grid-template-columns: 1fr; }
  .list { gap: 24px; margin-top: 24px; }
  .list h3, .list h4 { font-size: 17px; }
  .list p { font-size: 16px; }
  .prose h1, .prose h2 { font-size: 26px; margin-top: 36px; }
  .prose ul, .prose ol { font-size: 17px; }
  blockquote { font-size: 19px; }
  .code { white-space: normal; overflow-wrap: anywhere; }

  /* Hero page: the ring sits above the text, centred. */
  .hero { grid-template-columns: 1fr; gap: 8px; padding-bottom: 32px; text-align: center; }
  .hero .copy { order: 2; max-width: none; }
  .art { zoom: .63; margin: 0 auto; }
  .col section { padding: 32px 0; }
  .col h2 { font-size: 28px; margin: 8px 0 18px; }
  /* Kofi leans in from the right edge, above the last words. The cut at his foot fades out. */
  .end { margin-top: 32px; height: auto; display: block; place-items: normal; text-align: left; padding-bottom: 40px; }
  .end .stage { display: block; position: relative; height: 300px; overflow: hidden; }
  .end .peek { left: auto; right: -6px; height: 300px; transform: scaleX(-1); -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
  .end .links { justify-content: flex-start; }

  /* Thread page: the thread runs down the left edge, and each small Kofi sits above his part. */
  .s { padding: 0 20px 80px 56px; }
  .s.head { padding-top: 56px; }
  .s.head::before, .s.head::after { top: 6px; }
  .s.head::after { height: calc(var(--p, 1) * (100% - 6px)); }
  .s.stop { padding-top: 30px; }
  .s.last::before { height: 92px; }
  .s.last::after { max-height: 92px; }
  .av { position: relative; left: auto; top: auto; margin: 0 0 22px -27.5px; width: 124px; height: 124px; }
  .av img { height: 148px; bottom: -6px; }
}
