/* ═══ Imago API gallery ═══ page styles on top of the app's imago.css ═══
   Everything here is prefixed g-, so the renderer's own rules (canvas,
   stage-title, fact-strip ...) stay exactly as they are in the app.
   Tokens come from imago.css :root. Ink and paper; amber only ever means
   "changed", and the gallery never has anything that changed. */

.g-body { font-size: 15px; line-height: 1.6; }
.g-wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 32px; }

.g-skip { position: absolute; left: 12px; top: -48px; z-index: 10; background: var(--ink); color: var(--card); padding: 8px 12px; border-radius: var(--r-xs); text-decoration: none; }
.g-skip:focus { top: 12px; }

.g-body a { color: inherit; }
.g-body a.btn { text-decoration: none; }
.g-body code { font-family: var(--mono); font-size: .88em; }

/* Header */
.g-top { border-bottom: 1px solid var(--line); background: var(--bg); }
.g-top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.g-brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.g-mark { flex: 0 0 auto; color: var(--ink); }
.g-nav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.g-nav a:not(.btn) { text-decoration: none; color: var(--ink-2); }
.g-nav a:not(.btn):hover { color: var(--ink); }
.g-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.g-body .g-nav-app { color: #fff; margin-left: 4px; }

/* Hero */
.g-hero { padding: 56px 0 36px; max-width: 760px; }
.g-hero-home { padding-top: 72px; }
.g-crumbs { display: flex; gap: 8px; padding-top: 28px; font-size: 13px; color: var(--muted); }
.g-crumbs a { color: var(--muted); text-decoration: none; }
.g-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.g-crumbs + .g-hero { padding-top: 20px; }
.g-hero h1 {
  font-family: var(--display); font-size: 54px; font-weight: 650; line-height: 1.04;
  letter-spacing: -0.035em; text-wrap: balance; margin-bottom: 22px;
}
.g-lede { font-size: 17.5px; line-height: 1.6; color: var(--ink-2); max-width: 64ch; text-wrap: pretty; }
.g-lede + .g-lede { margin-top: 12px; }

.g-endpoint {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 26px;
  padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.g-endpoint .method-chip { padding: 3px 7px; font-size: 11px; }
.g-endpoint code { font-size: 13px; line-height: 1.7; color: var(--ink-2); overflow-wrap: anywhere; word-break: break-all; }

.g-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 26px; }
.g-body .g-actions .btn-dark { color: #fff; text-decoration: none; }
.g-body .g-actions .btn-ghost { text-decoration: none; }
.g-link { font-size: 14.5px; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.g-link:hover { text-decoration-color: var(--ink); }

/* The live panel: the renderer's canvas on a white sheet */
.g-live { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); overflow: hidden; }
.g-live-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px;
  padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--card-2);
}
.g-live-status { font-size: 13px; color: var(--muted); }
.g-live[aria-busy="true"] .g-live-status::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%;
  background: var(--muted-2); vertical-align: 1px; animation: g-pulse 1.1s ease-in-out infinite;
}
.g-live.is-live .g-live-status::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%;
  background: var(--green); vertical-align: 1px;
}
@keyframes g-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .g-live .g-live-status::before { animation: none; } }
.g-credit { font-size: 13px; color: var(--ink-2); }
.g-credit a { color: var(--link); text-underline-offset: 3px; }
.g-credit span { color: var(--muted); }

.g-canvas { padding: 36px 48px 48px; }
.g-canvas .stage-title { margin: 0 0 28px; }
.g-shot { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r); }

/* Sections */
.g-section { margin-top: 64px; padding-top: 36px; border-top: 1px solid var(--line); }
.g-section.g-first { margin-top: 8px; }
.g-section h2 { font-size: 20px; letter-spacing: -0.02em; margin-bottom: 14px; }
.g-section > p, .g-split p { max-width: 64ch; color: var(--ink-2); }
.g-muted { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.g-split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.g-api { padding-bottom: 24px; }

/* Gallery cards */
.g-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 8px; }
.g-card a {
  display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--sh-xs); transition: box-shadow .18s ease-out, border-color .18s ease-out;
}
.g-card a:hover { border-color: #d6d3cb; box-shadow: var(--sh); }
.g-card-shot { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--card); }
/* The shots are the whole app at 1200x675; crop away the endpoint rail
   (260px) and the command bar (56px) so the card shows the drawn page. */
.g-card-shot img { display: block; width: 128%; max-width: none; height: auto; margin: -6% 0 0 -27.7%; }
.g-card-body { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px 20px; flex: 1 1 auto; }
.g-card-label { font-size: 12.5px; color: var(--muted); }
.g-card-name { font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.g-card-text { font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.g-card-host { margin-top: auto; padding-top: 12px; font-family: var(--mono); font-size: 11.5px; color: var(--muted-2); }

.g-mini { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.g-mini a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; }
.g-mini a:hover { border-color: #d6d3cb; }
.g-mini-name { font-weight: 600; font-size: 14.5px; }
.g-mini-host { font-family: var(--mono); font-size: 11px; color: var(--muted-2); overflow-wrap: anywhere; }

/* Reels */
.g-reel { margin: 0; max-width: 760px; }
.g-reel video { display: block; width: 100%; height: auto; background: var(--ink); border-radius: var(--r); border: 1px solid var(--line); }
.g-reel figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* Press kit */
.g-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; margin: 0; max-width: 960px; }
.g-facts div { display: flex; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.g-facts dt { flex: 0 0 120px; color: var(--muted); font-size: 14px; }
.g-facts dd { margin: 0; color: var(--ink); }
.g-facts a { color: var(--link); text-underline-offset: 3px; }
.g-press-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.g-post img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.g-reel-tile { max-width: none; }
.g-dl { display: flex; gap: 10px; align-items: baseline; margin-top: 10px; font-size: 14px; }
.g-dl a { color: var(--ink); text-underline-offset: 3px; font-weight: 500; }
.g-dl span { font-family: var(--mono); font-size: 11.5px; color: var(--muted-2); }
.g-caption { margin-top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; }
.g-caption pre { margin: 0 0 12px; font-family: var(--sans); font-size: 13.5px; line-height: 1.55; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.g-brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.g-brand-grid li { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.g-brand-tile { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; padding: 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.g-brand-tile.is-dark { background: var(--ink); border-color: var(--ink); }
.g-brand-tile img { width: 100%; height: 100%; object-fit: contain; }
.g-brand-name { color: var(--ink-2); }
.g-brand-grid a { color: var(--ink); font-weight: 500; text-underline-offset: 3px; }

/* Footer */
.g-foot { margin-top: 88px; border-top: 1px solid var(--line); padding: 32px 0 48px; font-size: 13.5px; color: var(--muted); }
.g-foot-in { display: grid; grid-template-columns: auto 1fr; gap: 10px 32px; align-items: center; }
.g-foot-line { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.g-foot-line strong { color: var(--ink); }
.g-foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: flex-end; }
.g-foot-links a { color: var(--ink-2); text-underline-offset: 3px; }
.g-foot-note { grid-column: 1 / -1; max-width: 80ch; }

@media (max-width: 1000px) {
  .g-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-mini { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .g-body { font-size: 15px; }
  .g-wrap { padding: 0 20px; }
  .g-nav { gap: 14px; font-size: 13.5px; }
  .g-nav-app { display: none; }
  .g-hero { padding: 36px 0 28px; }
  .g-hero-home { padding-top: 44px; }
  .g-hero h1 { font-size: 36px; }
  .g-lede { font-size: 16px; }
  .g-actions .btn-lg { width: 100%; }
  .g-live { border-radius: var(--r); margin: 0 -8px; }
  .g-live-head { padding: 12px 16px; }
  .g-canvas { padding: 22px 18px 28px; }
  .g-canvas .stage-title { font-size: 32px; }
  .g-section { margin-top: 44px; padding-top: 28px; }
  .g-cards, .g-press-grid, .g-split, .g-facts { grid-template-columns: 1fr; }
  .g-split { gap: 28px; }
  .g-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-facts div { flex-direction: column; gap: 2px; }
  .g-facts dt { flex: none; }
  .g-foot-in { grid-template-columns: 1fr; }
  .g-foot-links { justify-content: flex-start; }
}

/* Waitlist form */
.g-form { max-width: 620px; display: grid; gap: 22px; padding-bottom: 24px; }
.g-field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; }
.g-field > span, .g-field legend { font-weight: 600; font-size: 15px; padding: 0; margin-bottom: 2px; }
.g-field em { font-style: normal; font-weight: 400; color: var(--muted); }
.g-field .text-input { font-family: var(--sans); width: 100%; }
.g-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.g-choice { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); cursor: pointer; font-size: 14.5px; min-height: 44px; }
.g-choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.g-check { display: flex; align-items: center; gap: 10px; font-size: 15px; min-height: 44px; }
.g-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.g-form-status { min-height: 1.5em; font-size: 15px; margin: 0; }
.g-form-status.is-ok { color: #2d7a45; }
.g-form-status.is-error { color: var(--red-ink); }
