/* the founder essay, The speed of the organization: a chapter of the same book as the home page. Builds on base.css. */
::selection { background: rgba(142, 79, 36, .18); }
main { padding-top: 124px; }

/* the title page */
.title-page { width: min(100% - 32px, 820px); margin: 0 auto; text-align: center; }
.title-page .kicker { margin: 0 0 12px; }
.title-page h1 { font-weight: 500; font-size: clamp(2.5rem, 6.2vw, 4.6rem); line-height: 1.04; letter-spacing: -.005em; margin: 0 0 18px; text-wrap: balance; }
.subtitle { font-style: italic; font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.35; color: var(--ink-mid); max-width: 640px; margin: 0 auto 34px; text-wrap: balance; }
.byline { font-size: 1.15rem; line-height: 1.45; color: var(--ink-mid); margin: 0 0 6px; text-wrap: balance; }
.byline strong { font-weight: 500; color: var(--ink); }
.meta { font-size: 17px; color: var(--ink-mid); margin: 0; }

/* the cover, a little wider than the text */
.cover { width: min(100% - 32px, 860px); margin: 46px auto 0; }
.cover img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; background: var(--sheet); }
.cover figcaption { margin-top: 12px; text-align: center; font-style: italic; font-size: 16px; line-height: 1.45; color: var(--ink-mid); }

/* the text column, with the contents in the left margin on wide screens */
.essay-body { width: min(100% - 32px, 680px); margin: 72px auto 0; padding-bottom: 104px; }
.toc { display: none; }

/* the prose */
.prose { font-size: 1.28rem; line-height: 1.65; overflow-wrap: break-word; }
.prose p { margin: 0 0 1.05em; }
.prose a { text-decoration: underline; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: 4px; transition: text-decoration-color .3s; }
.prose a:hover { text-decoration-color: var(--ink-mid); }
.prose strong { font-weight: 600; }
.prose blockquote { margin: 1.5em 0; padding: 0 0 0 1.1em; border-left: 1px solid var(--ink-soft); font-style: italic; }
.prose blockquote p:last-child { margin-bottom: 0; }

/* the opening: a larger first paragraph with a drop cap where the browser can set one */
.opening .lead { font-size: 1.16em; line-height: 1.55; }
@supports (initial-letter: 3) or (-webkit-initial-letter: 3) {
  .opening .lead::first-letter { -webkit-initial-letter: 3; initial-letter: 3; color: var(--accent); font-weight: 500; margin-right: .1em; }
}

/* chapter heads: a hairline, the number as a kicker, the title, and a quiet copy link */
.chapter { margin-top: 4.4rem; }
.chead { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; border-top: 1px solid var(--rule); padding-top: 2.6rem; margin-bottom: 1.5rem; }
.chead h2 { margin: 0; min-width: 0; font-weight: 500; font-size: clamp(1.85rem, 3.6vw, 2.5rem); line-height: 1.12; letter-spacing: -.003em; text-wrap: balance; }
.chead h2 .num { display: block; margin-bottom: 6px; font-size: 20px; font-weight: 400; font-variant-numeric: lining-nums; letter-spacing: .08em; color: var(--ink-mid); } /* digits only: small-caps would shrink them to small-cap figures */
.share { flex: none; font-style: italic; font-size: 16px; line-height: 1.2; color: var(--ink-mid); border-bottom: 1px solid transparent; transition: color .3s, border-color .3s; }
.chapter:hover .share, .share:focus-visible { color: var(--ink-mid); }
.share:hover { color: var(--ink); border-bottom-color: var(--ink-soft); }
.share.copied, .chapter:hover .share.copied { color: var(--accent); }
.closing { margin-top: 1.8em; }
@media (hover: none) { .share { color: var(--ink-mid); } }

/* where to go next */
.next { margin-top: 5.2rem; padding-top: 3.6rem; border-top: 1px solid var(--rule); text-align: center; }
.next h2 { font-weight: 500; font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.12; margin: 0 0 18px; text-wrap: balance; }
.prose .next .lead { font-style: italic; font-size: 1.2rem; line-height: 1.55; color: var(--ink-mid); max-width: 600px; margin: 0 auto 30px; }
.prose .ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 32px; margin: 0; font-style: italic; font-size: 1.35rem; }
.prose .ctas a { text-decoration: none; color: var(--ink-mid); border-bottom: 1px solid var(--ink-soft); padding-bottom: 2px; transition: color .3s, border-color .3s; }
.prose .ctas a.primary { color: var(--accent); }
.prose .ctas a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* contents: one list, two places (the margin on wide screens, a folding block on narrow ones) */
.toc ol, .contents ol { list-style: none; margin: 0; padding: 0; }
.toc a, .contents a { display: grid; grid-template-columns: 1.7em 1fr; text-decoration: none; }
.toc .n, .contents .n { color: var(--ink-mid); font-variant-numeric: oldstyle-nums; }

.contents { margin-top: 2.4rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.contents summary { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 14px 0; list-style: none; color: var(--ink-mid); font-size: 18px; }
.contents summary::-webkit-details-marker { display: none; }
.contents summary .show, .contents summary .hide { font-style: italic; font-size: 16px; }
.contents summary:hover .show, .contents summary:hover .hide { color: var(--ink); }
.contents[open] .show, .contents:not([open]) .hide { display: none; }
.contents nav { padding: 2px 0 20px; }
.contents li + li { margin-top: 10px; }
.contents a { font-size: 1.1rem; line-height: 1.35; color: var(--ink); }
.contents a:hover .t { text-decoration: underline; text-decoration-color: var(--ink-soft); text-decoration-thickness: 1px; }

/* on narrow screens the folding contents' lower rule already opens the first chapter */
@media (max-width: 1239px) { .contents + .chapter { margin-top: 2.8rem; } .contents + .chapter .chead { border-top: 0; padding-top: 0; } }

@media (min-width: 1240px) {
  .essay-body { width: auto; display: grid; grid-template-columns: minmax(0, 1fr) 680px minmax(0, 1fr); column-gap: 56px; padding: 0 32px 104px; }
  .prose { grid-column: 2; grid-row: 1; }
  .contents { display: none; }
  .toc { display: block; grid-column: 1; grid-row: 1; justify-self: end; align-self: start; width: 100%; max-width: 262px; position: sticky; top: 100px; max-height: calc(100vh - 124px); overflow-y: auto; padding: 4px 0 8px 22px; scrollbar-width: thin; }
  .toc-title { margin: 0 0 14px; font-size: 17px; color: var(--ink-mid); }
  .toc li + li { margin-top: 9px; }
  .toc a { position: relative; font-size: 16px; line-height: 1.3; color: var(--ink-mid); transition: color .3s; }
  .toc a:hover, .toc a.active { color: var(--ink); }
  .toc a.active .n { color: var(--accent); }
  .toc a::before { content: ""; position: absolute; left: -22px; top: .62em; width: 12px; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .4s ease; }
  .toc a.active::before { transform: scaleX(1); }
  .toc-actions { display: flex; gap: 20px; margin: 22px 0 0; padding-top: 14px; border-top: 1px solid var(--rule); font-style: italic; font-size: 16px; }
  .toc-actions button { color: var(--ink-mid); transition: color .3s; }
  .toc-actions button:hover { color: var(--ink); }
  .toc-actions button.copied { color: var(--accent); }
}

@media (max-width: 820px) {
  main { padding-top: 104px; }
  .cover { margin-top: 36px; }
  .essay-body { margin-top: 52px; padding-bottom: 80px; }
  .prose { font-size: 1.2rem; line-height: 1.65; }
  .chapter { margin-top: 3.4rem; }
  .chead { padding-top: 2rem; margin-bottom: 1.2rem; }
  .next { margin-top: 4rem; padding-top: 2.8rem; }
}
@media (max-width: 480px) {
  .title-page h1 { font-size: 2.45rem; }
  .prose { font-size: 1.16rem; }
  .chead { gap: 14px; }
  .chead h2 { font-size: 1.75rem; }
  .share { font-size: 15px; }
  .prose .ctas { flex-direction: column; align-items: center; font-size: 1.25rem; }
}

@media print {
  #top, .toc, .contents, .share, .ctas, footer { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding-top: 0; }
  .cover { width: 100%; }
  .essay-body { display: block; width: auto; margin: 32px 0 0; padding: 0; }
  .prose { font-size: 12pt; line-height: 1.55; }
  .chead { break-after: avoid; }
  .prose p { orphans: 3; widows: 3; }
  .opening .lead::first-letter { -webkit-initial-letter: normal; initial-letter: normal; color: inherit; font-weight: inherit; margin: 0; }
}
