/* Guide pages (what/why/how/links.html) — a deliberately distinct LIGHT
 * "paper" reading theme, separate from the app-shell's dark/colored
 * pages. This matches the original SuiTools/SolTools guide-page design:
 * long-form content reads better on white than on a saturated or dark
 * background. The .gbar top bar (navbar.css) stays dark/chain-colored
 * for continuity with the app shell; everything below it here is light.
 * Colors plug in via each chain's --accent/--accent-2/--chrome-bg/
 * --chrome-bg-2 (already set by chains/<chain>/css/theme.css) so this
 * file itself never needs a chain-specific variant. */
:root {
  --paper: #ffffff;
  --wash: #f7f7fa;
  --ink: #14121b;
  --ink-2: #3a3648;
  --muted: #6b6478;
  --line: #e8e6ee;
  --line-2: #eeecf2;
  --green: #12a150;
  --red: #d0342c;
  --sidebar-w: 290px;
  --bar-h: 80px;
}
body.guide-page {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif; font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
/* :where() keeps this scoped to guide pages without adding specificity —
 * a plain, unscoped `a{...}` rule (matching SuiTools' own original CSS)
 * would otherwise be safely overridden by .gbar-nav a / .toc a's own
 * color, but `body.guide-page a` accidentally out-specifies both (extra
 * element in the selector), turning the topbar's What/Why/How/Links text
 * and the TOC sidebar links the chain's accent color instead of white —
 * nearly unreadable against the dark .gbar bar. :where() fixes this by
 * contributing zero specificity, same as SuiTools' bare `a` selector. */
:where(body.guide-page) a { color: var(--accent); text-decoration: none; }
:where(body.guide-page) a:hover { text-decoration: underline; }

/* ── shell: TOC pinned to the true viewport edge + centered content ── */
/* .toc used to be `position: sticky` inside a centered flex .shell, so
 * it drifted away from the left edge on wide screens along with the
 * whole shell — the only page template on the site where the nav
 * column doesn't stay pinned to the true left edge (the app-shell's
 * .sidebar in navbar.css is `position: fixed; left: 0` and always is).
 * Fixed here to match: .toc is pinned at the real viewport edge, and
 * .shell (now just a margin-left offset, not a flex container) gives
 * .content the remaining width to center itself within — same pattern
 * as .main/.page in the app-shell. */
.shell { margin-left: var(--sidebar-w); }
.toc {
  position: fixed; top: var(--bar-h); left: 0; bottom: 0; width: var(--sidebar-w);
  overflow-y: auto; padding: 26px 16px 60px 24px; border-right: 1px solid var(--line);
  background: var(--paper); z-index: 10;
}
.toc-title { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); margin: 0 0 12px 8px; }
.toc-part { font-family: 'Space Grotesk', sans-serif; font-size: 14px; font-weight: 700; letter-spacing: .3px; color: var(--chrome-bg); margin: 20px 0 6px; padding: 4px 8px; display: block; border-radius: 7px; }
.toc-part:first-of-type { margin-top: 0; }
.toc-part:hover { background: var(--wash); text-decoration: none; }
.toc a { display: block; font-size: 13px; line-height: 1.4; color: var(--ink-2); padding: 5px 8px; border-radius: 7px; text-decoration: none; }
.toc a:hover { background: var(--wash); color: var(--ink); text-decoration: none; }
.toc a.toc-h2 { padding-left: 20px; font-size: 12.5px; color: var(--muted); }
.toc a.active { background: color-mix(in srgb, var(--accent) 12%, white); color: var(--chrome-bg); font-weight: 600; }

.content { flex: 1; min-width: 0; padding: 44px 56px 120px; max-width: clamp(820px, 58vw, 1500px); margin: 0 auto; }
.gsec { scroll-margin-top: calc(var(--bar-h) + 12px); }
.content h1 { font-family: 'Space Grotesk', sans-serif; font-size: clamp(30px, 0.67vw + 20.4px, 38px); line-height: 1.2; font-weight: 700; letter-spacing: -0.6px; color: var(--ink); margin: 54px 0 18px; scroll-margin-top: calc(var(--bar-h) + 14px); }
.content h2 { font-family: 'Space Grotesk', sans-serif; font-size: clamp(21px, 0.47vw + 14.3px, 26px); font-weight: 600; color: var(--ink); letter-spacing: -0.2px; margin: 32px 0 12px; scroll-margin-top: calc(var(--bar-h) + 14px); }
.content h3 { font-size: clamp(17px, 0.38vw + 11.5px, 21px); font-weight: 700; color: var(--ink); margin: 22px 0 8px; }
.content p { font-size: clamp(16px, 0.36vw + 10.9px, 20px); margin: 0 0 16px; color: var(--ink-2); }
.content strong { color: var(--ink); font-weight: 700; }
.content ul, .content ol { font-size: clamp(16px, 0.36vw + 10.9px, 20px); margin: 0 0 18px; padding-left: 22px; color: var(--ink-2); }
.content li { margin: 6px 0; }
.content hr { border: none; border-top: 1px solid var(--line-2); margin: 32px 0; }
.content code { background: var(--wash); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-family: 'SF Mono', ui-monospace, monospace; font-size: 13.5px; color: var(--chrome-bg); }
.content pre { background: #14121b; color: #ece8f7; border: 1px solid #34303f; border-radius: 12px; padding: 18px 20px; overflow-x: auto; margin: 8px 0 22px; line-height: 1.9; }
.content pre code { background: none; border: none; color: inherit; padding: 0; font-size: 14px; white-space: pre-wrap; }

.content > h1:first-child { font-size: clamp(40px, 0.89vw + 27.1px, 50px); margin-top: 0; padding-top: 8px; }
#why, #how { border-top: 2px solid var(--line); margin-top: 64px; padding-top: 20px; }

.content table { width: 100%; border-collapse: collapse; margin: 8px 0 24px; font-size: 14.5px; }
.content th, .content td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.content th { background: var(--wash); font-weight: 700; color: var(--ink); }
.content td { color: var(--ink-2); }

.callout { border-radius: 12px; padding: 18px 22px; margin: 8px 0 24px; border: 1px solid var(--line); background: var(--wash); }
.callout p:last-child { margin-bottom: 0; }
.cal-label { font-weight: 700; font-size: 13px; letter-spacing: .4px; text-transform: uppercase; margin-bottom: 6px; }
.cal-warn { background: #fff5f4; border-color: #f6cfcb; } .cal-warn .cal-label { color: var(--red); }
.cal-tip { background: #eefaf2; border-color: #bfe6cd; } .cal-tip .cal-label { color: var(--green); }
.cal-note { background: color-mix(in srgb, var(--accent) 6%, white); border-color: color-mix(in srgb, var(--accent) 22%, white); }
.cal-hero { background: linear-gradient(135deg, var(--chrome-bg), var(--chrome-bg-2)); border: none; padding: 30px 32px; }
.cal-hero h2 { font-family: 'Space Grotesk', sans-serif; color: #fff; font-size: 26px; line-height: 1.25; margin: 0 0 14px; letter-spacing: -0.4px; }
.cal-hero p { color: rgba(255,255,255,.9); } .cal-hero p:last-child { margin-bottom: 0; }

.backtop { position: fixed; right: 22px; bottom: 22px; background: var(--accent); color: #fff; width: 44px; height: 44px; border-radius: 12px; border: none; font-size: 18px; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.backtop.show { opacity: 1; pointer-events: auto; }
.toc-backdrop { display: none; }

@media (max-width: 1024px) {
  .gbar-menu { display: inline-flex; align-items: center; justify-content: center; }
  /* .shell's desktop margin-left exists to clear the permanently-pinned
   * .toc rail — below this width .toc becomes a slide-in overlay
   * instead (drawer, hidden off-screen until .open), so content should
   * go back to using the full width rather than leaving a permanent
   * gap for a rail that isn't there anymore. */
  .shell { margin-left: 0; }
  .toc {
    z-index: 45;
    width: 300px; transform: translateX(-100%); transition: transform .25s;
    box-shadow: 0 10px 40px rgba(20,18,27,.15);
  }
  .toc.open { transform: translateX(0); }
  .toc-backdrop.show { display: block; position: fixed; inset: var(--bar-h) 0 0 0; background: rgba(20,18,27,.35); z-index: 44; }
  .content { padding: 32px 24px 100px; }
}
@media (max-width: 820px) {
  .gbar-brand { width: auto; padding: 0 12px; }
  .wm-sub { display: none; }
  .wm-side { font-size: 23px; }
  .wm-logo-side { width: 38px; height: 38px; }
  .gbar-row1 { padding: 0 14px 0 12px; gap: 8px; }
  .gbar-nav { gap: 8px; } .gbar-nav a { padding: 6px 12px; font-size: 12px; }
  .gbar-cta { padding: 6px 13px; font-size: 12px; }
  .gbar-ticker { padding: 1px 14px 9px; gap: 16px; font-size: 13px; flex-wrap: wrap; }
  .content > h1:first-child { font-size: 30px; }
}
@media (max-width: 560px) {
  .gbar-ticker { gap: 6px 14px; }
  /* Plain inline text (not flex) so it wraps at word boundaries — see
     overrides.css's .ticker-pill rule for the full reasoning; this is
     the guide pages' own copy since .gbar-ticker is a separate class. */
  .gbar-ticker .ticker-pill { white-space: nowrap; display: inline-block; }
}
@media (max-width: 480px) {
  /* .gbar-inner keeps the brand block and .gbar-main (nav/CTA + ticker)
     side by side at every other breakpoint — fine down to ~560px, but
     below that .gbar-main (and therefore the ticker) is squeezed into
     less than half the viewport, so content that fits fine full-width
     (the same ticker markup works on the plain app shell) overflows
     here instead. Wrapping .gbar-main onto its own full-width row (via
     flex-basis, not a straight column stack) keeps the hamburger and
     logo grouped together on row 1, exactly as before. */
  .gbar-inner { flex-wrap: wrap; }
  .gbar-main { flex-basis: 100%; }
  .gbar-brand { width: auto; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.12); padding: 10px 14px; }

  /* .gbar-row1 is a fixed-height single flex row (nav + spacer + CTA) —
     it cannot wrap without breaking that height, so at this width the
     four nav links (What/Why/How/Links) plus the CTA button simply
     overflowed/got cut off at the edge. The CTA (the actual "do the
     thing" action) and the hamburger's own TOC drawer stay; the nav
     links step aside rather than compress further. */
  .gbar-nav { display: none; }
  .gbar-sp { display: none; }
}

/* ── end-of-page CTA (matches the app's Create Token button) ── */
.end-cta { text-align: center; margin: 52px 0 8px; }
.end-cta .create-btn { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; background: var(--accent); color: #fff; border: 1px solid color-mix(in srgb, var(--accent) 65%, black 15%); border-radius: 11px; font-size: 16px; font-weight: 700; padding: 16px 40px; font-family: 'Inter', sans-serif; text-decoration: none; box-shadow: 0 4px 18px color-mix(in srgb, var(--accent) 32%, transparent); transition: all 0.15s; }
.end-cta .create-btn:hover { filter: brightness(1.08); text-decoration: none; }
.end-cta .create-btn-sub { font-size: 14px; font-weight: 500; color: rgba(255,255,255,0.85); }

/* ── tutorial video ── */
.vid { margin: 22px 0 10px; }
.vid-frame { position: relative; width: 100%; padding-bottom: 56.25%; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 4px 18px rgba(20,18,27,.08); background: #000; }
.vid-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ── page-to-page journey link ── */
.page-next-wrap { display: flex; justify-content: flex-end; margin: 14px 0 0; }
.page-next { display: inline-flex; align-items: center; gap: 14px; padding: 15px 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--wash); text-decoration: none; transition: all .15s; }
.page-next:hover { border-color: var(--accent); box-shadow: 0 2px 14px color-mix(in srgb, var(--accent) 14%, transparent); text-decoration: none; }
.page-next .pn-k { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; }
.page-next b { font-size: 16px; color: var(--ink); }
.page-next .pn-a { font-size: 22px; color: var(--accent); line-height: 1; }

/* ── pull quotes ── */
.pquote { font-family: 'Space Grotesk', sans-serif; font-size: clamp(27px, 0.6vw + 18.3px, 34px); font-weight: 700; line-height: 1.32; color: var(--chrome-bg); letter-spacing: -0.4px; border-left: 4px solid var(--accent); padding: 6px 0 6px 26px; margin: 34px 0; }
@media (max-width: 820px) { .pquote { font-size: 22px; padding-left: 18px; } }

/* ── how.html: reading progress bar + part-jump chips ── */
.read-progress { position: fixed; top: var(--bar-h); left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); z-index: 49; transition: width .08s linear; }
.part-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 6px; }
.part-chips a { padding: 9px 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--wash); font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-decoration: none; transition: all .15s; }
.part-chips a:hover { border-color: var(--accent); color: var(--chrome-bg); text-decoration: none; }

/* ── flow stepper (used on what.html/how.html for pipeline diagrams) ── */
.flow { background: color-mix(in srgb, var(--chrome-bg) 90%, black 10%); border: 1px solid color-mix(in srgb, var(--chrome-bg) 60%, white 15%); border-radius: 16px; padding: 24px 26px; margin: 16px 0 24px; }
.flow-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 15px; }
.flow-row + .flow-row { margin-top: 16px; }
.flow-node { display: inline-flex; align-items: center; gap: 9px; color: #f3ecff; font-size: 16px; font-weight: 600; }
.flow-node .fic { font-size: 21px; line-height: 1; }
.flow-arrow { display: inline-flex; align-items: center; }
.flow-line { width: 40px; height: 3px; background: var(--accent-2); border-radius: 2px; display: inline-block; }
.flow-head { width: 0; height: 0; flex-shrink: 0; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 13px solid var(--accent-2); margin-left: -1px; }
@media (max-width: 820px) {
  .flow-node { font-size: 14px; } .flow-node .fic { font-size: 18px; }
  .flow-line { width: 24px; height: 2.5px; }
  .flow-head { border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 10px solid var(--accent-2); }
}

/* ── links.html ── */
.lk-list { list-style: none; margin: 10px 0 0; padding: 0; }
.lk-list li { padding: 13px 0; border-bottom: 1px solid var(--line-2); font-size: 15px; line-height: 1.6; }
.lk-list li:last-child { border-bottom: none; }
.lk-list li b { color: var(--ink); }
.lk-list a { word-break: break-all; }
