/* ============================================================
   Sprite sheet generator guide — faithful dark guide styling.
   Loaded only on the sprite-sheet-generator page.
   ============================================================ */
body.page-sprite-guide { background: var(--sf-bg); }
body.page-sprite-guide main { background: var(--sf-bg); margin: 0; }
.sprite-guide {
  --sg-bg: var(--sf-bg);
  --sg-bg-2: var(--sf-surface);
  --sg-bg-3: var(--sf-surface-2);
  --sg-ink: var(--sf-text);
  --sg-muted: var(--sf-text-muted);
  --sg-faint: var(--sf-text-subtle);
  --sg-accent: var(--sf-accent-text);
  --sg-line: rgba(255,255,255,0.08);
  color: var(--sg-ink);
  background: var(--sg-bg);
  width: 100%;
}
.sprite-guide section {
  padding: 80px max(24px, calc((100% - 1280px) / 2));
  border-radius: 0;
  background: transparent;
  border: 0;
}
.sprite-guide a { color: inherit; text-decoration: none; }
.sprite-guide a:hover { text-decoration: none; }
.sprite-guide h1, .sprite-guide h2, .sprite-guide h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.1; }
.sprite-guide h1 { font-family: var(--sf-font-display); font-size: clamp(38px, 4.2vw, 54.4px); font-weight: 700; }
.sprite-guide h2 { font-family: var(--sf-font-display); font-size: clamp(28px, 3vw, 36px); font-weight: 600; }
.sprite-guide h3 { font-size: 20px; font-weight: 600; }
.sprite-guide p { margin: 0; }
.sprite-guide img { display: block; }

/* hero */
.sg-hero { background: var(--sg-bg-2) !important; padding-top: 96px !important; padding-bottom: 24px !important; }
.sg-hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.sg-eyebrow, .sg-kicker {
  font-family: var(--sf-font-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--sg-accent); font-weight: 600; margin-bottom: 16px !important;
}
.sg-lede { margin-top: 20px !important; max-width: 560px; color: var(--sg-muted); font-size: 18px; line-height: 1.7; }
.sg-cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.sg-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; border-radius: 8px;
  font-size: 16px; font-weight: 600; transition: transform .2s, background .2s;
}
.sg-btn:hover { transform: translateY(-1px); }
.sg-btn-primary, .sprite-guide a.sg-btn-primary { background: var(--sf-accent); color: var(--sf-accent-ink); }
.sg-btn-primary:hover { background: var(--sf-accent); }
.sg-btn-ghost { background: var(--sf-line-strong); color: var(--sg-ink); }
.sg-btn-ghost:hover { background: var(--sf-line-strong); }
.sg-trust {
  margin-top: 24px !important; font-family: var(--sf-font-mono);
  font-size: 10.5px; letter-spacing: 0.12em; color: var(--sf-text-subtle); text-transform: uppercase;
}
.sg-hero-figure { margin: 0; background: var(--sf-bg); border: 1px solid var(--sg-line); border-radius: 16px; padding: 16px; }
.sg-hero-figure img { width: 100%; border-radius: 8px; background: var(--sf-info-soft); }
.sg-hero-figure figcaption { margin-top: 14px; font-size: 12px; line-height: 1.6; color: var(--sg-faint); }
.sg-hero-figure figcaption strong { color: var(--sg-ink); }
.sg-jump-nav {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--sg-line);
}
.sg-jump-nav a {
  background: var(--sf-bg); border: 1px solid var(--sg-line); border-radius: 9999px;
  padding: 7px 14px; font-size: 12px; font-weight: 600; color: var(--sf-text-muted);
}
.sg-jump-nav a:hover { border-color: var(--sg-accent); color: var(--sg-accent); }

/* shared section pieces */
.sg-intro { margin-top: 20px !important; max-width: 760px; color: var(--sg-muted); font-size: 18px; line-height: 1.7; }
.sg-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.sg-two-col p { margin-top: 20px !important; color: var(--sg-muted); font-size: 18px; line-height: 1.7; max-width: 620px; }
.sg-what { background: var(--sg-bg-3) !important; border-top: 1px solid var(--sg-line); }
.sg-terms { display: grid; gap: 28px; }
.sg-term { display: grid; grid-template-columns: 18px 1fr; gap: 14px; align-items: start; }
.sg-dot { width: 12px; height: 12px; margin-top: 8px; border-radius: 50%; background: var(--sg-accent); }
.sg-term h3 { margin: 0 0 8px !important; }
.sg-term p { margin: 0 !important; font-size: 14px !important; line-height: 1.7 !important; }
.sg-code {
  margin: 0; padding: 16px; border-radius: 8px; background: var(--sf-info-soft);
  border: 1px solid var(--sg-line); color: var(--sf-text-muted); font-size: 13px; line-height: 1.6;
  font-family: var(--sf-font-mono); overflow-x: auto;
}

/* step by step */
.sg-steps { background: var(--sg-bg) !important; }
.sg-steps h2 { margin-top: 4px !important; }
.sg-step-list { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.sg-step-list li { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 24px; background: var(--sg-bg-2); border: 1px solid var(--sg-line); border-radius: 16px; }
.sg-step-no { color: var(--sg-accent); font-size: 24px; font-weight: 700; font-family: var(--sf-font-display); }
.sg-step-list h3 { margin-bottom: 10px !important; }
.sg-step-list p { color: var(--sg-muted); font-size: 14px; line-height: 1.7; }
.sg-preview { margin-top: 48px; padding: 24px; background: var(--sg-bg-2); border: 1px solid var(--sg-line); border-radius: 16px; }
.sg-preview-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.sg-preview-tabs button { font: inherit; cursor: pointer; font-size: 11px; font-weight: 700; letter-spacing: .1em; padding: 6px 12px; border-radius: 999px; color: var(--sg-faint); border: 1px solid var(--sg-line); background: transparent; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.sg-preview-tabs button:hover { color: var(--sg-ink); border-color: var(--sg-faint); }
.sg-preview-tabs button[aria-selected="true"] { background: var(--sf-accent); color: var(--sf-accent-ink); border-color: var(--sf-accent); }
.sg-preview-tabs button:focus-visible { outline: 2px solid var(--sg-accent); outline-offset: 2px; }
.sg-preview-img { width: 100%; max-height: 420px; object-fit: contain; background: var(--sf-info-soft); border-radius: 8px; }
.sg-preview > p { margin-top: 12px !important; font-size: 12px; color: var(--sg-faint); }
.sg-first-frame { display: flex; align-items: center; gap: 16px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--sg-line); }
.sg-first-frame img { width: 96px; height: 96px; object-fit: contain; background: var(--sf-info-soft); border-radius: 8px; }
.sg-first-frame span { font-size: 13px; color: var(--sg-faint); }

/* six decisions */
.sg-six { background: var(--sg-bg-3) !important; border-top: 1px solid var(--sg-line); }
.sg-rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; }
.sg-rules > div { padding: 24px; background: var(--sg-bg-2); border: 1px solid var(--sg-line); border-radius: 16px; }
.sg-rules h3 { margin-bottom: 10px !important; }
.sg-rules p { color: var(--sg-muted); font-size: 14px; line-height: 1.7; }
.sg-rules code, .sg-callout code { font-family: var(--sf-font-mono); color: var(--sg-accent); font-size: .92em; }
.sg-callout { margin-top: 32px !important; padding: 20px 24px; border-left: 3px solid var(--sg-accent); background: var(--sf-surface-2); color: var(--sg-muted); font-size: 14px; line-height: 1.8; }

/* engines */
.sg-engines { background: var(--sg-bg) !important; }
.sg-engine-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; }
.sg-engine { display: block; padding: 28px; background: var(--sg-bg-2); border: 1px solid var(--sg-line); border-radius: 16px; transition: border-color .2s, transform .2s; }
a.sg-engine:hover { border-color: var(--sg-accent); transform: translateY(-2px); }
.sg-engine img { width: 56px; height: 56px; object-fit: contain; margin-bottom: 20px; }
.sg-engine h3 { margin-bottom: 10px !important; }
.sg-engine p { color: var(--sg-muted); font-size: 14px; line-height: 1.7; min-height: 48px; }
.sg-engine span { display: inline-block; margin-top: 18px; color: var(--sg-accent); font-size: 13px; font-weight: 600; }

/* downloads */
.sg-downloads { background: var(--sg-bg-3) !important; border-top: 1px solid var(--sg-line); }
.sg-sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 40px 0 28px; }
.sg-sheet-grid figure { margin: 0; padding: 16px; background: var(--sg-bg-2); border: 1px solid var(--sg-line); border-radius: 16px; }
.sg-sheet-grid img { width: 100%; background: var(--sf-info-soft); border-radius: 8px; }
.sg-sheet-grid figcaption { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--sg-ink); }

/* FAQ */
.sg-faq { background: var(--sg-bg) !important; }
.sg-faq-list { max-width: 900px; margin-top: 32px; border-top: 1px solid var(--sg-line); }
.sg-faq-list details { border-bottom: 1px solid var(--sg-line); padding: 20px 0; }
.sg-faq-list summary { cursor: pointer; list-style: none; font-size: 18px; font-weight: 600; color: var(--sg-ink); }
.sg-faq-list summary::-webkit-details-marker { display: none; }
.sg-faq-list summary::after { content: "+"; float: right; color: var(--sg-accent); }
.sg-faq-list details[open] summary::after { content: "–"; }
.sg-faq-list p { margin-top: 14px !important; color: var(--sg-muted); font-size: 15px; line-height: 1.75; }

/* closing CTA + community */
.sg-cta { background: var(--sf-surface) !important; text-align: center; }
.sg-cta h2 { max-width: 820px; margin: 0 auto !important; font-size: clamp(28px, 3vw, 40px); }
.sg-cta .sg-cta-row { justify-content: center; }
.sg-community { background: var(--sg-bg) !important; border-top: 1px solid var(--sg-line); text-align: center; }
.sg-community h2 { font-size: clamp(24px, 2.4vw, 32px); }
.sg-community > p:not(.sg-kicker) { margin: 16px auto 0 !important; color: var(--sg-muted); max-width: 600px; }
.sg-community .sg-cta-row { justify-content: center; }

@media (max-width: 1024px) {
  .sg-hero-inner, .sg-two-col { grid-template-columns: 1fr; gap: 32px; }
  .sg-step-list, .sg-rules, .sg-engine-grid, .sg-sheet-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .sprite-guide section { padding: 56px 20px !important; }
  .sg-hero { padding-top: 64px !important; }
  .sg-step-list, .sg-rules, .sg-engine-grid, .sg-sheet-grid { grid-template-columns: 1fr; }
  .sg-lede, .sg-intro, .sg-two-col p { font-size: 16px; }
  .sg-btn { width: 100%; }
}
