/* v2 resource pages (2026-10-07). Loaded after v2.css. Written for Codepit first and
   meant to be reused by the other resource pages: a single 640px column under the
   v2 header, the dot field kept to the side margins (no data-ambient="full"). */

.res-main {
  position: relative; z-index: 1;
  max-width: calc(var(--col) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 32px var(--gutter) 64px;
}
.res-main section { scroll-margin-top: 88px; margin-top: 52px; }
.res-main section:first-child { margin-top: 0; }

.res-main h1 {
  font-size: clamp(40px, 7.2vw, 60px); line-height: 0.98; font-weight: 600;
  letter-spacing: -0.045em; margin: 6px 0 16px;
}
.res-main h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 14px; }
.res-main h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 6px; }
.res-main p { color: var(--fg-2); line-height: 1.7; margin-bottom: 14px; }
.res-main p strong, .res-main li strong { color: var(--fg); }
.res-main a:not(.btn):not(.kd-download-card) { text-decoration-color: var(--accent); }
.res-main code {
  font-family: var(--font-mono); font-size: 0.88em;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 5px; padding: 1px 5px;
}

/* Hero */
.kd-resource-eyebrow { margin-bottom: 0; }
.kd-resource-lede { font-size: 18px; line-height: 1.55; }
.kd-resource-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 6px; }
.kd-resource-meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  margin-top: 26px; background: var(--rule); border: 1px solid var(--rule);
  border-radius: 10px; overflow: hidden;
}
.kd-resource-stat { background: var(--bg); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.kd-resource-stat strong { font-size: 14px; font-weight: 600; }
.kd-resource-stat > span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.kd-hero-shot { margin: 26px 0 0; }
.kd-hero-shot img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--rule); background: var(--surface); }
.kd-hero-shot figcaption { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

/* Lists */
.kd-step-list { list-style: none; counter-reset: step; margin: 6px 0 0; }
.kd-step-list li {
  counter-increment: step; position: relative;
  padding: 12px 0 12px 40px; border-top: 1px solid var(--rule);
  color: var(--fg-2); line-height: 1.65;
}
.kd-step-list li:last-child { border-bottom: 1px solid var(--rule); }
.kd-step-list li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 13px;
  font-family: var(--font-mono); font-size: 12px; color: var(--accent);
}
.res-main section > ul { margin: 0 0 14px 20px; color: var(--fg-2); line-height: 1.7; }
.res-main section > ul li { margin-bottom: 6px; }

/* Feature cards */
.kd-feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 6px; }
.kd-feature-card {
  border: 1px solid var(--rule); border-radius: 10px; padding: 16px 16px 4px;
  background: var(--bg); transition: border-color .2s;
}
.kd-feature-card:hover { border-color: var(--faint); }
.kd-feature-card p { font-size: 14px; line-height: 1.6; }

/* Download cards */
.kd-download-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 6px 0 16px; }
.kd-download-card {
  display: flex; flex-direction: column; gap: 4px; min-height: 44px;
  border: 1px solid var(--rule); border-radius: 10px; padding: 14px 14px 12px;
  text-decoration: none; background: var(--bg);
  transition: border-color .2s, transform .25s cubic-bezier(.2,.7,.2,1);
}
.kd-download-card:hover { border-color: var(--faint); transform: translateY(-1px); }
.kd-download-card strong { font-size: 14px; font-weight: 600; }
.kd-download-card > span { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* Callout */
.kd-callout {
  border-left: 2px solid var(--accent); background: var(--accent-wash);
  border-radius: 0 8px 8px 0; padding: 14px 16px; margin-bottom: 14px;
}
.kd-callout p { color: var(--fg); margin: 0; font-size: 15px; }

/* Code panel: scrolls inside its own box, never the page */
.kd-code-panel { border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; margin: 6px 0 16px; background: var(--surface); }
.kd-code-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
.kd-copy {
  height: 32px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 7px;
  background: var(--bg); color: var(--fg); font: 500 12px var(--font-mono); cursor: pointer;
}
.kd-copy:hover { border-color: var(--faint); }
.kd-code-panel pre { margin: 0; overflow-x: auto; padding: 14px; -webkit-overflow-scrolling: touch; }
.kd-code-panel pre code {
  font-family: var(--font-mono); font-size: 13px; line-height: 1.65;
  background: none; border: 0; padding: 0; white-space: pre; color: var(--fg);
}

/* Disclaimer */
.kd-disclaimer-box { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--rule); }
.kd-disclaimer-box p { font-size: 12px; line-height: 1.55; color: var(--muted); margin: 0; }

/* Phones */
@media (max-width: 640px) {
  .kd-resource-meta { grid-template-columns: 1fr; }
  .kd-feature-grid, .kd-download-grid { grid-template-columns: 1fr; }
  .kd-resource-actions .btn { height: 44px; flex: 1 1 auto; justify-content: center; }
  .kd-copy { height: 40px; }
  .kd-step-list li { padding-left: 34px; }
}

/* Hover typing (v2.js typeOnHover): the red line traces the card, so the cards are
   positioned and the grey hover border steps aside while it runs. */
.kd-resource-stat, .kd-feature-card, .kd-download-card { position: relative; }
.kd-feature-card.typing, .kd-download-card.typing { border-color: var(--rule); }
.kd-download-card.typing { transform: none; }
