/*
 * css/guide.css: the guide (/guide). Loaded after css/landing.css, which carries the shared header and footer.
 * A sticky table of contents beside one readable column; rows and hairlines instead of boxed cards, mono for
 * anything an agent would type. Colours come from css/tokens.css.
 */

.gd-main { background: var(--background); }
.gd-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 780px);
  gap: clamp(32px, 7vw, 112px);
  padding-block: clamp(36px, 6vw, 76px) clamp(64px, 8vw, 112px);
}

.gd-toc { position: sticky; top: 84px; align-self: start; min-width: 0; }
.gd-toc .eyebrow { color: var(--studio-dim); font-size: 10px; }
.gd-toc ol { margin: 16px 0 0; padding: 0; border-left: 1px solid var(--border); list-style: none; }
.gd-toc a {
  display: block; margin-left: -1px; padding: 7px 14px; border-left: 1px solid transparent;
  color: var(--muted-foreground); font-size: 13px; line-height: 1.35; text-decoration: none;
  transition: color 100ms ease-out, border-color 100ms ease-out;
}
.gd-toc a:hover { color: var(--foreground); }
.gd-toc a.is-active { border-left-color: var(--green); color: var(--foreground); }

.gd-doc { min-width: 0; }
.gd-head .eyebrow { color: var(--green-muted); }
.gd-head h1 { margin-top: 18px; font-size: clamp(40px, 6vw, 64px); font-weight: 450; line-height: 1.02; letter-spacing: -.055em; }
.gd-lead { max-width: 36em; margin-top: 20px; color: var(--muted-foreground); font-size: clamp(16px, 1.4vw, 18px); line-height: 1.65; }
.gd-live { display: flex; align-items: baseline; gap: 9px; margin-top: 22px; color: var(--muted-foreground); font: 11px/1.5 var(--font-mono); letter-spacing: .04em; }
.gd-live i { position: relative; top: -1px; width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 14%, transparent); }

.gd-doc section { margin-top: clamp(40px, 5vw, 60px); padding-top: clamp(40px, 5vw, 60px); border-top: 1px solid var(--border); scroll-margin-top: 52px; }
.gd-doc h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 500; line-height: 1.15; letter-spacing: -.035em; }
.gd-doc h3 { display: flex; align-items: center; gap: 10px; margin-top: 36px; font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.gd-doc h3 svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--green); }
.gd-doc p { margin-top: 14px; color: var(--sidebar-foreground); font-size: 15px; line-height: 1.7; }
.gd-doc p.gd-note { color: var(--muted-foreground); font-size: 14px; }
.gd-doc ul { margin: 14px 0 0; padding-left: 20px; color: var(--sidebar-foreground); font-size: 15px; line-height: 1.7; }
.gd-doc ul li { margin-top: 8px; padding-left: 4px; }
.gd-doc ul li::marker { color: var(--studio-dim); }
.gd-doc code { padding: 2px 5px; border-radius: 4px; background: var(--muted); color: var(--green-bright); font: 12.5px/1.4 var(--font-mono); overflow-wrap: anywhere; }
.gd-doc kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--studio-edge); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-soft); color: var(--sidebar-foreground); font: 11px/1.5 var(--font-mono); white-space: nowrap; }
.gd-link { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--green-bright); font-weight: 550; text-decoration: none; }
.gd-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.gd-link svg { width: 14px; height: 14px; }

/* numbered steps with mono counters */
.gd-steps { margin: 20px 0 0; padding: 0; list-style: none; counter-reset: gd-step; }
.gd-steps li { position: relative; min-height: 28px; margin-top: 14px; padding-left: 44px; color: var(--muted-foreground); font-size: 15px; line-height: 1.65; counter-increment: gd-step; }
.gd-steps li::before {
  content: counter(gd-step, decimal-leading-zero); position: absolute; left: 0; top: 1px; display: grid; place-items: center; width: 30px; height: 22px;
  border: 1px solid var(--border); border-radius: 5px; color: var(--green-muted); font: 600 10px/1 var(--font-mono); letter-spacing: .06em;
}
.gd-steps strong { color: var(--foreground); font-weight: 600; }

/* quiet rows: a term and its plain-word meaning */
.gd-rows { margin: 20px 0 0; border-top: 1px solid var(--border); }
.gd-rows > div { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); align-items: baseline; gap: 4px 28px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.gd-rows dt { color: var(--foreground); font-size: 14px; font-weight: 550; line-height: 1.5; }
.gd-rows dd { margin: 0; color: var(--muted-foreground); font-size: 14px; line-height: 1.65; }
.gd-keys dt { font-weight: 400; color: var(--muted-foreground); }

/* agent API routes */
.gd-code { margin: 14px 0 0; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--border); border-radius: 7px; background: var(--card); color: var(--sidebar-foreground); font: 12px/1.7 var(--font-mono); tab-size: 2; scrollbar-width: thin; scrollbar-color: var(--studio-scroll) transparent; }
.gd-code code { padding: 0; border-radius: 0; background: none; color: inherit; font: inherit; overflow-wrap: normal; white-space: pre; }
.gd-route { margin-top: 28px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); overflow: hidden; }
.gd-route-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-height: 46px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--card); }
.gd-get { padding: 4px 7px; border-radius: 99px; background: var(--teal-soft); color: var(--teal); font: 600 9px/1 var(--font-mono); letter-spacing: .08em; }
.gd-route-head code { padding: 0; background: none; color: var(--foreground); font-size: 13px; }
.gd-route-body { padding: 4px 16px 16px; }
.gd-route-body > p { font-size: 14px; }
.gd-doc p.gd-cap { margin-top: 18px; color: var(--studio-dim); font: 600 10px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.gd-cap + .gd-code { margin-top: 8px; }
.gd-fields { margin: 14px 0 0; border-top: 1px solid var(--border); }
.gd-fields > div { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); align-items: baseline; gap: 2px 20px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.gd-fields dt { color: var(--green-bright); font: 12px/1.6 var(--font-mono); overflow-wrap: anywhere; }
.gd-fields dd { margin: 0; color: var(--muted-foreground); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }

/* questions */
.gd-faq { margin-top: 20px; border-top: 1px solid var(--border); }
.gd-faq details { border-bottom: 1px solid var(--border); }
.gd-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 54px; padding: 12px 0; font-size: 16px; font-weight: 550; line-height: 1.35; cursor: pointer; list-style: none; }
.gd-faq summary::-webkit-details-marker { display: none; }
.gd-faq summary svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--studio-dim); transition: transform 140ms ease-out; }
.gd-faq details[open] summary svg { transform: rotate(45deg); color: var(--green); }
.gd-faq summary:hover svg { color: var(--foreground); }
.gd-faq details p { max-width: 40em; margin: 0; padding: 0 0 18px; color: var(--muted-foreground); }

@media (max-width: 900px) {
  .gd-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .gd-toc { position: static; margin: 0 calc(-1 * var(--site-gutter)) 28px; padding: 0 var(--site-gutter) 14px; border-bottom: 1px solid var(--border); }
  .gd-toc .eyebrow { display: none; }
  .gd-toc ol { display: flex; gap: 4px; margin: 0; overflow-x: auto; border-left: 0; scrollbar-width: none; }
  .gd-toc ol::-webkit-scrollbar { display: none; }
  .gd-toc a { display: inline-flex; align-items: center; min-height: 44px; margin: 0; padding: 8px 12px; border: 1px solid var(--studio-edge); border-radius: 6px; white-space: nowrap; }
  .gd-toc a.is-active { border-color: var(--green); }
}

@media (max-width: 760px) {
  .gd-layout { padding-top: 14px; }
  .gd-rows > div, .gd-fields > div { grid-template-columns: minmax(0, 1fr); }
  .gd-doc h3 { margin-top: 30px; }
  .gd-steps li { padding-left: 42px; }
  .gd-route-head { padding-inline: 12px; }
  .gd-route-body { padding-inline: 12px; }
  .gd-link { min-height: 44px; }
  .gd-code { padding: 12px; font-size: 11.5px; }
}
