/* === Guides (website/html/guides/) ===
   Loaded after base.css, which supplies the tokens, the reset, the focus ring
   and the pixel chrome (status bar, nav, windows, buttons, footer). Long-form
   reading wants what the landing page's cards do not: a narrow column, a
   larger and looser mono for body text, and quiet tables and callouts. */

/* --- Nav --- */
.nav-logo {
  font-size: 9px;
  letter-spacing: 0;
  gap: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-link {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--black);
  text-decoration: none;
  -webkit-font-smoothing: none;
}

.nav-link:hover,
.nav-link[aria-current='page'] {
  color: var(--blue);
}

/* --- Page column --- */
.guide-main {
  position: relative;
  z-index: 1;
  padding-block: 108px 72px;
}

.guide-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

.crumbs {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 28px;
  overflow-wrap: anywhere;
}

.crumbs a {
  color: var(--text-muted);
}

.crumbs a:hover {
  color: var(--blue);
}

/* --- Article header --- */
.guide-head {
  margin-bottom: 28px;
}

.guide-title {
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: clamp(15px, 3vw, 22px);
  line-height: 1.75;
  letter-spacing: -0.5px;
  color: var(--black);
  margin-bottom: 20px;
  -webkit-font-smoothing: none;
}

.guide-lede {
  font-family: var(--font-mono);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-prose);
}

.guide-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 16px;
  padding-bottom: 24px;
  border-bottom: var(--border);
}

/* --- Table of contents --- */
.toc {
  border: var(--border);
  background: var(--white);
  box-shadow: var(--shadow);
  margin-bottom: 40px;
}

.toc ol {
  padding: 14px 18px 16px 42px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-muted);
}

.toc a {
  color: var(--black);
  text-decoration: none;
}

.toc a:hover {
  color: var(--blue);
  text-decoration: underline;
}

/* --- Body text --- */
.guide-body {
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-prose);
}

.guide-body > * + * {
  margin-top: 1.1em;
}

.guide-body h2 {
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.8;
  color: var(--black);
  margin-top: 2.6em;
  scroll-margin-top: 72px;
  -webkit-font-smoothing: none;
}

.guide-body h2::before {
  content: '// ';
  color: var(--blue);
}

.guide-body h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.5;
  color: var(--black);
  margin-top: 1.8em;
}

.guide-body h2 + *,
.guide-body h3 + * {
  margin-top: 0.7em;
}

.guide-body a {
  color: var(--blue-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.guide-body a:hover {
  color: var(--black);
}

.guide-body strong {
  color: var(--black);
  font-weight: 600;
}

.guide-body ul,
.guide-body ol {
  padding-left: 1.5em;
}

.guide-body li + li {
  margin-top: 0.45em;
}

.guide-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-alt);
  border: var(--border);
  padding: 1px 5px;
  overflow-wrap: anywhere;
}

.guide-body pre {
  background: var(--black);
  color: var(--screen-text);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
}

.guide-body pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  overflow-wrap: normal;
}

.guide-body kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--white);
  border: 1px solid var(--gray);
  border-bottom-width: 2px;
  padding: 0 5px;
  white-space: nowrap;
}

/* Numbered steps: pixel badges instead of list markers */
.guide-body ol.steps {
  list-style: none;
  padding-left: 0;
  counter-reset: step;
}

.guide-body ol.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 46px;
  min-height: 28px;
}

.guide-body ol.steps > li + li {
  margin-top: 0.8em;
}

.guide-body ol.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 3px;
  font-family: var(--font-pixel);
  font-size: 9px;
  line-height: 1;
  color: var(--white);
  background: var(--blue);
  padding: 6px;
}

/* Callouts */
.guide-body .note {
  border: var(--border);
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
  padding: 12px 16px;
  font-size: 15px;
}

.guide-body .note--warn {
  border-left-color: var(--yellow);
  background: var(--gold-soft);
}

/* Tables scroll inside their own box on a phone, never the page */
.guide-body .table-wrap {
  overflow-x: auto;
  border: var(--border);
}

.guide-body table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 14px;
  line-height: 1.5;
  background: var(--white);
}

.guide-body th,
.guide-body td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: var(--border);
}

.guide-body th {
  font-family: var(--font-pixel);
  font-size: 8px;
  font-weight: 400;
  line-height: 1.7;
  background: var(--bg);
  -webkit-font-smoothing: none;
}

.guide-body tr:last-child td {
  border-bottom: 0;
}

/* --- Inline install box ({{cta}}) --- */
.guide-body .guide-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 16px;
  border: var(--border);
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-block: 2em;
}

.guide-cta img {
  image-rendering: pixelated;
  flex-shrink: 0;
}

.guide-cta p {
  flex: 1 1 260px;
  font-size: 15px;
  line-height: 1.6;
}

.guide-body .guide-cta .btn-primary {
  color: var(--white);
  text-decoration: none;
}

/* --- Bottom CTA window --- */
.guide-window {
  border: var(--border);
  background: var(--white);
  box-shadow: 6px 6px 0 var(--line);
  margin-top: 64px;
}

.guide-window .win-btn {
  width: 10px;
  height: 10px;
}

.guide-window-body {
  padding: 28px 24px;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

.guide-window-title {
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.7;
  color: var(--black);
  margin-bottom: 12px;
  -webkit-font-smoothing: none;
}

.guide-window-body .btn-primary {
  margin-top: 20px;
}

/* --- Guide lists (index page, "Keep reading") --- */
.guide-related {
  margin-top: 64px;
}

.guide-section-title {
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.7;
  color: var(--black);
  margin-bottom: 16px;
  -webkit-font-smoothing: none;
}

.guide-list {
  list-style: none;
  border: var(--border);
  background: var(--white);
}

.guide-card + .guide-card {
  border-top: var(--border);
}

.guide-card-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  text-decoration: none;
  color: inherit;
}

.guide-card-link:hover {
  background: var(--bg);
  box-shadow: inset 2px 0 0 var(--blue);
}

.guide-card-title {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.45;
  color: var(--black);
}

.guide-card-link:hover .guide-card-title {
  color: var(--blue-deep);
}

.guide-card-desc {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}

.guide-card-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

/* --- Phones --- */
@media (max-width: 640px) {
  .guide-main {
    padding-block: 88px 56px;
  }

  .guide-wrap {
    padding: 0 16px;
  }

  .nav-inner {
    padding: 0 16px;
    gap: 8px;
  }

  .nav-logo {
    font-size: 7px;
    gap: 6px;
    min-width: 0;
  }

  .nav-cta {
    font-size: 7px;
    padding: 8px 10px;
  }

  /* The footer and the breadcrumbs both link to /guides; the nav has no
     room for a third item beside the logo and the install button. */
  .nav-link {
    display: none;
  }

  .status-bar {
    font-size: 6px;
    gap: 8px;
  }

  .guide-lede {
    font-size: 15px;
  }

  .guide-body {
    font-size: 15px;
  }

  .guide-window-body {
    padding: 22px 18px;
  }

  .guide-window-body .btn-primary {
    white-space: normal;
  }
}
