/* Resources: the index of YouTube videos and each video's page with its email gate (tools/gen-resources.mjs).
   Shares the header, cards, meta line and code panels with blog.css. */

.rs-lede { margin-top: 28px; max-width: 560px; font-size: 19px; line-height: 1.6; color: var(--muted); }
.rs-thumb { overflow: hidden; }
.rs-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Card cover for a resource whose video is not up yet: the title set in the brand type on graphite */
.rs-cover { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 22px 24px; background: var(--dark); color: #fff; border-color: var(--dark); overflow: hidden; }
.rs-cover .mono-xs { color: var(--dark-muted); }
.rs-cover strong { max-width: 15ch; font: 700 30px/1.05 var(--sans); letter-spacing: -0.03em; text-wrap: balance; }
.rs-cover i { position: absolute; right: 24px; top: 24px; width: 10px; height: 10px; background: var(--signal); }

/* ---------- Video, intro and "What's inside" beside the gate ---------- */
.rs { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.rs__main { display: flex; flex-direction: column; align-items: flex-start; padding: 40px var(--pad) 48px; border-right: 1px solid var(--line); }
.rs__main > * { width: 100%; }
.rs__main > .rs__watch { width: auto; }
.rs__main > .rs__h { margin-top: 48px; }
.rs__main > .rs__h:first-child { margin-top: 0; }
.rs__main > .yt + .rs__watch + .rs__h, .rs__main > .yt + .rs__watch + .rk--intro { margin-top: 48px; }
.rs__inside { margin-top: 20px; }
.rs__stick { position: sticky; top: 32px; }
.rs__p { margin-top: 12px; font-size: 15px; line-height: 1.55; color: var(--muted); }
.yt { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); background: var(--dark); }
.yt img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), opacity .3s; }
.yt__play { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 72px; height: 72px; margin: -36px 0 0 -36px; background: var(--ink); transition: background-color .25s var(--ease); }
.yt__play svg { width: 28px; height: 28px; fill: #fff; margin-left: 3px; }
.yt:hover .yt__play, .yt:focus-visible .yt__play { background: var(--signal); }
.yt:hover img { transform: scale(1.015); }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rs__watch { margin-top: 24px; }

.rs__side { padding: 40px var(--pad) 40px 40px; }
.rs__h { font: 600 22px/1.25 var(--sans); letter-spacing: -0.015em; }
.rs-inc { border-top: 1px solid var(--line); }
.rs-inc li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.4; }
.rs-inc__ic { width: 20px; height: 20px; margin-top: 1px; color: var(--signal); }
.rs-inc span { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.rs-inc em { font-style: normal; color: var(--muted); }

/* ---------- Email gate ---------- */
.gate { position: relative; margin-top: 28px; }
.gate__l { display: block; color: var(--ink); }
.gate__row { display: grid; gap: 8px; margin-top: 10px; }
.gate__in {
  width: 100%; height: 56px; padding: 0 16px; border: 1px solid #A4AAB1; border-radius: 0; background: #fff;
  font: 400 16px/1 var(--sans); color: var(--ink); transition: border-color .2s;
}
.gate__in::placeholder { color: #8A9098; }
.gate__in:hover { border-color: var(--ink); }
.gate__in:focus-visible { outline-offset: 0; border-color: var(--ink); }
.gate__in[aria-invalid="true"] { border-color: var(--signal); }
.gate__btn { width: 100%; }
.gate__btn[disabled] { cursor: progress; background: #4A4F54; }
.gate__hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.gate__err { margin-top: 12px; font-size: 14px; line-height: 1.45; color: var(--signal); }
.gate__note { margin-top: 14px; font-size: 13px; line-height: 1.5; color: var(--muted); }

.gate-ok { margin-top: 0; padding: 20px 22px; border: 1px solid var(--line); background: #fff; outline: none; }
.gate-ok__h { display: flex; align-items: center; gap: 10px; font: 600 18px/1.2 var(--sans); }
.gate-ok__ic { width: 22px; height: 22px; color: var(--signal); }
.gate-ok__p { margin-top: 10px; font-size: 15px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- Unlocked prompts and files ---------- */
.rs-out { padding: 72px var(--pad) 96px; }
.rs-out__h { margin-top: 24px; font: 600 40px/1.1 var(--sans); letter-spacing: -0.025em; }
.rs-out__prompts { display: grid; gap: 24px; margin-top: 48px; max-width: 860px; }
.rs-out .code { margin-top: 0; }
.rs-out .code__tab { gap: 12px; height: auto; min-height: 44px; padding: 6px 8px 6px 20px; text-transform: none; letter-spacing: 0; font-size: 14px; color: #fff; }
.rs-out .code__tab span { flex: 1; min-width: 0; padding: 6px 0; line-height: 1.35; }
.rs-out .code pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 400 15px/1.7 var(--mono); }
.rs-out .code code { white-space: inherit; }
.copy { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border: 1px solid var(--dark-line); font: 500 13px/1 var(--sans); color: var(--dark-muted); transition: color .2s, border-color .2s; }
.copy svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.copy:hover { color: #fff; border-color: #6A7078; }
.copy.is-done { color: var(--signal-on-dark); }

.rs-files { max-width: 860px; margin-top: 48px; border-top: 1px solid var(--line); }
.rs-files:empty { display: none; }
.rs-files li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.rs-files__n { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 16px; overflow-wrap: anywhere; }
.rs-files__n .mono-xs { color: var(--muted); }
.rs-files .link { flex: none; }

/* ---------- A finished page (page.html, intro.html, toc.html from resources/<slug>/) ----------
   The markup comes from the video's resource page as written; these rules set it in the site's type and grid. */
.rk { font-size: 17px; line-height: 1.65; color: var(--ink-2); }
.rk--page { display: flex; flex-direction: column; gap: 96px; padding: 72px var(--pad) 112px; }
.rk--page > * { width: 100%; max-width: 760px; }
.rk section { display: flex; flex-direction: column; gap: 24px; scroll-margin-top: 32px; }
.rk p { max-width: 65ch; }
.rk h2 { font: 600 40px/1.15 var(--sans); letter-spacing: -0.025em; color: var(--ink); text-wrap: balance; }
.rk h3 { font: 600 22px/1.35 var(--sans); letter-spacing: -0.015em; color: var(--ink); }
.rk b { font-weight: 600; color: var(--ink); }
.rk a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .2s; }
.rk a:hover { color: var(--signal); }
.rk .eyebrow { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; min-height: 26px; padding: 4px 10px; border: 1px solid var(--line); background: rgba(255,255,255,.35); font: 500 12px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.rk .eyebrow::before { content: ''; width: 6px; height: 6px; background: var(--signal); flex: none; }
.rk .step { display: flex; flex-direction: column; gap: 12px; }
.rk code { font: 400 .88em/1 var(--mono); padding: 3px 6px; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.rk kbd { display: inline-block; min-width: 24px; padding: 0 7px; border: 1px solid var(--line); border-bottom-width: 2px; background: #fff; font: 500 13px/22px var(--mono); text-align: center; color: var(--ink); white-space: nowrap; }

/* copy boxes: the site's dark code panel; the text keeps its line breaks and scrolls inside the box */
.rk .code { margin: 0; background: var(--dark); color: #ECEDEF; }
.rk .code figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 6px 8px 6px 20px; border-bottom: 1px solid var(--dark-line); }
.rk .file { display: flex; align-items: center; gap: 8px; min-width: 0; font: 500 13px/1.35 var(--sans); color: var(--dark-muted); }
.rk .file::before { content: ''; width: 6px; height: 6px; background: var(--signal); flex: none; }
.rk .code pre { margin: 0; padding: 22px 20px 24px; overflow-x: auto; font: 400 14px/1.65 var(--mono); white-space: pre; tab-size: 2; color: #ECEDEF; }
.rk .code .copy { min-height: 36px; padding: 0 14px; }
.rk .copy.is-done, .rk .copy-all.is-done { color: var(--signal-on-dark); }
.rk .copy-all { align-self: flex-start; display: inline-flex; align-items: center; height: 48px; padding: 0 20px; background: var(--ink); color: #fff; font: 500 15px/1 var(--sans); transition: background-color .25s var(--ease); }
.rk .copy-all:hover { background: #33373B; }
.rk .copy-all.is-done { background: var(--ink); }
.rk .handoff { display: flex; flex-direction: column; gap: 16px; }
body.copying .rk .copy, body.copying .rk .copy-all, body.copying .contents { display: none !important; }

.rk .note { display: flex; flex-direction: column; gap: 8px; padding: 20px 24px; border: 1px solid var(--line); border-left: 2px solid var(--signal); background: #fff; font-size: 16px; line-height: 1.6; }
.rk .steps { display: flex; flex-direction: column; gap: 8px; margin: 0; padding-left: 26px; list-style: decimal; max-width: 65ch; }
.rk .steps li::marker { font: 500 14px var(--sans); color: var(--signal); }
.rk .checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); counter-reset: c; }
.rk .checks li { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.5); counter-increment: c; }
.rk .checks li::before { content: counter(c, decimal-leading-zero); font: 500 12px/1.4 var(--sans); letter-spacing: .06em; color: var(--signal); }
.rk .checks b { font-size: 16px; }
.rk .checks small { font-size: 14px; line-height: 1.45; color: var(--muted); }
.rk .table { overflow-x: auto; border: 1px solid var(--line); background: #fff; }
.rk .table table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.rk .table th { padding: 12px 16px; background: var(--bg); text-align: left; font: 500 12px/1.4 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rk .table td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: top; }
.rk .table td:first-child { font-weight: 500; color: var(--ink); }
.rk .words { display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 1fr); gap: 0 24px; margin: 0; border-top: 1px solid var(--line); }
.rk .words dt, .rk .words dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rk .words dt { font-weight: 600; color: var(--ink); }
.rk .words dd { color: var(--muted); }
.rk--intro { display: flex; flex-direction: column; gap: 20px; }
.rk--intro h3 { margin-top: 8px; }

/* the page's own contents list, shown before the gate as "What's inside" */
.contents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; border-top: 1px solid var(--line); }
.contents li { border-bottom: 1px solid var(--line); }
.contents a { display: flex; gap: 14px; min-height: 48px; padding: 13px 0; font-size: 15px; font-weight: 500; line-height: 1.4; color: var(--ink); transition: color .2s; }
.contents a:hover { color: var(--signal); }
.contents span { min-width: 22px; font: 500 12px/21px var(--sans); letter-spacing: .06em; font-variant-numeric: tabular-nums; color: var(--signal); }

@media (max-width: 900px) {
  .rs { grid-template-columns: minmax(0, 1fr); }
  .rs__main { padding: 32px var(--pad) 40px; border-right: 0; }
  .rs__side { order: -1; padding: 32px var(--pad) 36px; border-bottom: 1px solid var(--line); } /* the form first on a phone */
  .rs__stick { position: static; }
  .rk--page { gap: 64px; padding: 48px var(--pad) 72px; }
  .rk h2 { font-size: 32px; }
  .rk .code pre { font-size: 13px; padding: 18px 16px 20px; }
  .yt__play { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
  .rs-out { padding: 48px var(--pad) 72px; }
  .rs-out__h { font-size: 32px; }
  .rs-out .code pre { font-size: 14px; }
}
@media (max-width: 640px) {
  .contents, .rk .checks { grid-template-columns: minmax(0, 1fr); }
  .rk .words { grid-template-columns: minmax(0, 1fr); }
  .rk .words dt { border-bottom: 0; padding-bottom: 0; }
  .rk .words dd { padding-top: 4px; }
}
@media (max-width: 600px) {
  .rs-files li { flex-direction: column; align-items: flex-start; gap: 10px; }
}
