/* Long-form pages (tutorials, tutorials hub, video page): "Paper and Ink".
   Loaded after fonts.css + site.css, which hold the tokens, header, footer, buttons and
   the click-to-play frame. This file only lays out the article body. Colour rule as in
   site.css: yellow is a thin accent or a highlighter behind ink, never text on the paper. */

main {
  max-width: var(--wrap); margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) var(--gutter-r) clamp(3rem, 6vw, 5rem) var(--gutter);
  color: var(--body);
}
/* Everything reads in one ~720px column; the headline and the video may run wider. */
main > * { max-width: var(--measure); }
main > h1 { max-width: 900px; }
main > .video { max-width: 960px; }

/* ---------- breadcrumbs, eyebrow, headline ---------- */
.crumbs { margin: 0 0 clamp(1.8rem, 4vw, 3rem); font: 500 .72rem/1.4 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem .7rem; }
.crumbs li { margin: 0; padding: 0; font: inherit; color: var(--ink); }
.crumbs li::before { content: none; }
.crumbs li + li::before { content: "/"; position: static; display: inline; margin-right: .7rem; color: var(--soft); font: inherit; }
.crumbs a { color: var(--soft); text-decoration: none; }
.crumbs a:hover { background: none; color: var(--ink); text-decoration: underline; text-decoration-color: var(--uline); }

.doc-eyebrow {
  display: block; margin: 0 0 1rem;
  font: 500 .74rem/1.35 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--soft);
}
.doc-eyebrow::before { content: ""; display: block; width: 2.2rem; height: 3px; margin-bottom: .9rem; background: var(--y); }

main h1 {
  margin: 0; font-weight: 500; letter-spacing: -.045em; line-height: 1; max-width: 900px;
  font-size: clamp(2.2rem, 5.2vw, 4rem); text-wrap: balance;
}
.lede { font-size: clamp(1.15rem, 1.7vw, 1.35rem); line-height: 1.45; color: var(--soft); max-width: 52ch; margin: 1.3rem 0 0; }
.lede a { color: var(--ink); }
.byline { margin: 1.4rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); font: 500 .72rem/1.5 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }

/* ---------- body text ---------- */
main h2 {
  margin: clamp(2.8rem, 6vw, 4rem) 0 0; padding-top: 1.1rem; border-top: 1px solid var(--line-strong);
  font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.03em; line-height: 1.1; font-weight: 500; color: var(--ink);
}
main h3 { margin: 2rem 0 0; font-size: 1.25rem; letter-spacing: -.015em; line-height: 1.25; font-weight: 600; color: var(--ink); }
main p, main li { font-size: 1.0625rem; line-height: 1.7; color: var(--body); }
main p { margin: .9rem 0 0; }
main strong { color: var(--ink); font-weight: 600; }
main p a, main li a, main figcaption a {
  color: var(--ink); text-decoration: underline; text-decoration-color: var(--uline); text-decoration-thickness: 2px; text-underline-offset: .2em;
}
main p a:hover, main li a:hover, main figcaption a:hover { background: var(--y); color: var(--on-y); text-decoration: none; }
main em { font-family: var(--f-serif); font-style: italic; font-weight: 400; font-size: 1.06em; letter-spacing: -.01em; }
code, kbd {
  font: .88em var(--f-mono); background: var(--code-bg); padding: .1em .38em; border-radius: 3px; color: var(--ink);
  overflow-wrap: anywhere;
}
kbd { box-shadow: inset 0 0 0 1px var(--line); }

/* Bullets: a short ink dash. Steps: mono numbers, no boxes. */
main ul:not(.cards):not(.chapters), main ol:not(.chapters):not(.crumbs ol) { list-style: none; margin: .9rem 0 0; padding: 0; }
main ul:not(.cards):not(.chapters) li, main ol:not(.chapters):not(.crumbs ol) li { position: relative; margin: .5rem 0; padding-left: 1.7rem; }
main ul:not(.cards):not(.chapters) li::before { content: ""; position: absolute; left: 0; top: .85em; width: .8rem; height: 1px; background: var(--ink); }
main ol:not(.chapters):not(.crumbs ol) { counter-reset: step; }
main ol:not(.chapters):not(.crumbs ol) li { counter-increment: step; padding-left: 2.6rem; }
main ol:not(.chapters):not(.crumbs ol) li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: .42em;
  font: 500 .78rem/1 var(--f-mono); letter-spacing: .1em; color: var(--soft);
}

/* ---------- the short answer, contents, notes, examples ---------- */
.answer-box { margin: 2rem 0 0; padding: 1.3rem 0 1.4rem; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); }
.answer-box strong.label {
  display: block; margin-bottom: .7rem; font: 500 .74rem/1.35 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--soft);
}
.answer-box strong.label::before { content: ""; display: block; width: 2.2rem; height: 3px; margin-bottom: .8rem; background: var(--y); }
.answer-box p { margin: 0; font-size: 1.15rem; line-height: 1.55; color: var(--ink); }

.toc { margin: 2rem 0 0; padding: 1.1rem 0 1.2rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
main .toc h2 {
  margin: 0; padding: 0; border: 0;
  font: 500 .74rem/1.35 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--soft);
}
.toc ol { margin-top: .6rem; }
.toc li { margin: .25rem 0; font-size: 1rem; }

.note { margin: 1.8rem 0 0; padding: 1rem 0 1.1rem; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); }
.note > :first-child { margin-top: 0; }
.note > :last-child { margin-bottom: 0; }
.note.caution { padding-left: 1.1rem; border-left: 3px solid var(--y); }

.example { margin: 1.4rem 0 0; padding: .2rem 0 .2rem 1.2rem; border-left: 2px solid var(--ink); }
.example .ex-label { display: block; margin-bottom: .4rem; font: 500 .72rem/1.35 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }
.example p { margin: 0; font-family: var(--f-serif); font-style: italic; font-size: 1.2rem; line-height: 1.5; color: var(--ink); }
.example p em { font-style: normal; font-family: var(--f-serif); }

/* ---------- tables ---------- */
.table-wrap, .table-scroll { overflow-x: auto; margin: 1.4rem 0 0; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 34rem; margin: 0; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: .7rem 1rem .7rem 0; border-bottom: 1px solid var(--line); }
th { font: 500 .72rem/1.35 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--soft); border-bottom-color: var(--line-strong); }
td { color: var(--body); }
td:first-child { color: var(--ink); font-weight: 600; }

/* ---------- screenshots ---------- */
figure.shot { margin: 2rem 0 0; max-width: 300px; }
figure.shot img { width: 100%; height: auto; border-radius: 24px; box-shadow: 0 0 0 1px var(--line); background: var(--paper-2); }
figure.shot figcaption { margin-top: .7rem; font: 500 .72rem/1.5 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }

/* ---------- video: click-to-play frame comes from site.css (assets/js/video-embed.js) ---------- */
.video { margin: 2rem 0 0; }
.video-frame { box-shadow: 0 0 0 1px var(--line); }
.video-frame .play { padding: .85rem; border-radius: 50%; }
.video-frame .play svg { width: 24px; height: 24px; margin-left: 2px; }
.video figcaption { margin-top: .8rem; font-size: .92rem; line-height: 1.5; color: var(--soft); max-width: var(--measure); }
.video-frame:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.chapters { list-style: none; margin: 1.2rem 0 0; padding: 0; border-top: 1px solid var(--line-strong); counter-reset: none; }
.chapters li { margin: 0; padding: 0; }
.chapters li::before { content: none; }
.chapters a {
  display: grid; grid-template-columns: 4.5rem 1fr; gap: 1rem; align-items: baseline;
  padding: .8rem 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 1.0625rem;
}
.chapters a:hover { background: var(--y); color: var(--on-y); }
.chapters a:hover .t { color: var(--on-y); }
.chapters .t { font: 500 .8rem var(--f-mono); letter-spacing: .1em; color: var(--soft); }

.transcript p { margin-top: .9rem; }
.transcript .ts { display: inline-block; min-width: 3.4rem; margin-right: .5rem; font: 500 .74rem var(--f-mono); letter-spacing: .1em; color: var(--soft); }

/* ---------- "keep reading" lists and the tutorials hub: hairline rows, no cards ---------- */
.cards { list-style: none; margin: 1.4rem 0 0; padding: 0; border-top: 1px solid var(--line-strong); }
.cards li { margin: 0; padding: 0; }
.cards li::before { content: none; }
.cards a {
  display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: .2rem 1.4rem; align-items: baseline;
  padding: 1.1rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.cards .kind { grid-column: 1; grid-row: 1 / span 2; font: 500 .72rem/1.35 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }
.cards strong { grid-column: 2; font-size: 1.2rem; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; color: var(--ink); }
.cards span.d { grid-column: 2; font-size: .98rem; line-height: 1.5; color: var(--soft); }
.cards a:hover { background: none; color: var(--ink); }
.cards a:hover strong { background: linear-gradient(transparent 60%, var(--y) 60%, var(--y) 90%, transparent 90%); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
@media (prefers-color-scheme: dark) { .cards a:hover strong { background: none; text-decoration: underline; text-decoration-color: var(--y); text-decoration-thickness: 2px; text-underline-offset: .2em; } }

/* ---------- closing call to action ---------- */
.cta-card { margin: clamp(3rem, 6vw, 4.5rem) 0 0; padding: 0; border: 0; }
.cta-card h2 { margin: 0; }
.cta-card p { max-width: 52ch; }
.cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; margin-top: 1.5rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .9rem 1.6rem; border: 0; border-radius: 2px;
  font: 600 1rem/1.2 var(--f-text); text-decoration: none; cursor: pointer; transition: background .2s, color .2s;
}
.button.primary { background: var(--btn); color: var(--on-btn); }
.button.primary:hover { background: var(--btn-hover); color: var(--on-btn-hover); }
.button.secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.button.secondary:hover { background: var(--ink); color: var(--paper); }

@media (max-width: 620px) {
  .cards a { grid-template-columns: minmax(0, 1fr); }
  .cards .kind, .cards strong, .cards span.d { grid-column: 1; grid-row: auto; }
  .chapters a { grid-template-columns: 3.6rem 1fr; gap: .6rem; }
  main h1 { letter-spacing: -.04em; }
}
