.blog-references {
  list-style: decimal;
  padding-left: 1.5rem;
  margin-top: 1rem;
}

.blog-references li {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--secondary);
  margin-bottom: .5rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

.blog-references a {
  color: var(--amber);
  text-decoration: underline;
  text-decoration-color: rgba(255, 190, 39, 0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color .15s;
}
.blog-references a:hover { text-decoration-color: var(--amber); }

/* Citation superscripts: amber to match the brand accent. */
.blog-body sup a {
  color: var(--amber);
  text-decoration: none;
}
.blog-body sup a:hover {
  color: var(--amber);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Figure cards, as in the AlpaSim post. */
/* Figures keep the same space above and below (1.8rem); a paragraph before or after them adds no extra space. */
.ogf-figure { margin: 1.8rem 0; padding: 1rem; background: #111; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; font-family: var(--font-sans); scroll-margin-top: 90px; }
.ogf-figure > img { display: block; width: 100%; height: auto; border-radius: 10px; }
.ogf-figure figcaption { margin-top: 1rem; text-align: center; font-size: .88rem; line-height: 1.5; color: rgba(255, 255, 255, 0.6); }
.ogf-overview .ov-band { fill: #fff; fill-opacity: 0; transition: fill-opacity .15s; }
.ogf-overview .ov-name { opacity: 0; transition: opacity .15s; }
.ogf-overview .ov-row:hover .ov-band { fill-opacity: .04; }
.ogf-overview .ov-row:hover .ov-name { opacity: 1; }

.ogf-previews { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.ogf-preview { display: flex; flex-direction: column; align-items: center; gap: .75rem; min-width: 0; text-align: center; }
.ogf-preview strong { font-size: 1rem; color: var(--amber); }
.ogf-video { width: 100%; aspect-ratio: 8 / 9; border-radius: 12px; overflow: hidden; }
.ogf-video video { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 600px) { .ogf-previews { grid-template-columns: 1fr; } }

/* The compute explorer brings its own light and dark tokens; the dark color
   scheme on the frame makes it follow the dark page. */
.ogf-explorer iframe { display: block; width: 100%; height: 640px; border: 0; border-radius: 10px; color-scheme: dark; }

/* Tables: dark-theme rules that read like the surrounding body text. */
.ogf-table-title { margin: 0 0 .75rem; font-family: var(--font-sans); font-size: 1.05rem; font-weight: 600; color: var(--amber); }
.ogf-table-wrap { overflow-x: auto; }
.ogf-table { width: 100%; border-collapse: collapse; font-family: var(--font-sans); font-size: .9rem; color: #d2d8df; font-variant-numeric: tabular-nums; }
.ogf-table th,
.ogf-table td { padding: .55rem .8rem; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.1); white-space: nowrap; }
.ogf-table th { color: var(--text); font-weight: 600; }
.ogf-table tbody tr:last-child td { border-bottom: none; }
.ogf-table .is-ours td { color: var(--amber); background: var(--amber-soft); border-bottom-color: rgba(255, 190, 39, 0.25); }
.ogf-table .is-ours td:first-child { font-weight: 600; }
.ogf-table .is-ours + .is-ours td:first-child { font-weight: inherit; }
.ogf-table .is-ours b { color: var(--amber); }
.ogf-table .is-ours-col { color: var(--amber); background: var(--amber-soft); }
.ogf-table .is-section td { padding-top: .9rem; padding-bottom: .3rem; font-size: .76rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--amber); border-bottom: none; }
.ogf-table :is(.is-metric, .is-rl) td { color: #6e737a; }
.ogf-table :is(.is-metric, .is-rl) b { color: #82878e; }
.ogf-table .num { text-align: right; }
.ogf-table .mid { text-align: center; }
.ogf-table th.group { text-align: center; }
.ogf-table th[rowspan] { vertical-align: bottom; }
.ogf-table b { font-weight: 600; color: var(--text); }
.ogf-table .gap-pos { color: var(--text); font-weight: 600; }
.ogf-table .gap-neg { color: #d2d8df; }
/* Citations in a cell must not change the row height. */
.ogf-table sup { line-height: 0; }

/* Keep linked headings below the sticky/fixed navigation banner. */
.blog-body :is(h2, h3)[id] { scroll-margin-top: calc(var(--nav-h) + 1.5rem); }

/* Appendix subsections (Closed loop / Open loop). */
.blog-body h3 { color: #ffffff; font-family: var(--font-sans); font-size: clamp(1.1rem, 1.6vw, 1.35rem); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; margin: 2.5rem 0 1rem; }
.blog-body h3 + .ogf-figure { margin-top: 1rem; }

.blog-body .ogf-list { list-style: disc; padding-left: 1.5rem; margin: 1rem 0; }
.blog-body ol.ogf-list { list-style: decimal; }
.blog-body .ogf-list li { margin-bottom: .6rem; color: var(--secondary); }

.blog-body pre { margin: 1.25rem 0; padding: 1rem 1.25rem; overflow-x: auto; background: #111; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; font-size: .85rem; line-height: 1.6; }
.blog-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Citation tooltips (post.js): hovering or focusing a citation shows the
   matching entry of the reference list in a card next to it. */
.cite-tip { position: absolute; z-index: 300; box-sizing: border-box; width: max-content; max-width: min(30rem, calc(100vw - 1.5rem)); padding: .6rem .85rem; background: #161616; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55); font-family: var(--font-sans); font-size: .85rem; font-weight: 400; line-height: 1.5; color: var(--secondary); text-align: left; white-space: normal; }
.cite-tip[hidden] { display: none; }
.cite-tip-head { margin-bottom: .2rem; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--amber); }
.cite-tip-head.is-mismatch { color: #ff7b7b; }
.cite-tip-body { overflow-wrap: break-word; }
.cite-tip a { color: var(--amber); text-decoration: underline; text-decoration-color: rgba(255, 190, 39, 0.4); text-underline-offset: 3px; }
.cite-tip a:hover { text-decoration-color: var(--amber); }

/* 123D post: series toggles and dataset tabs. */
.ogf-figure svg { max-width: 100%; height: auto; }

/* OpenGigaflow post: authors, TLDR, controls, replay, video galleries. */
.ogf-figure svg { max-width: 100%; height: auto; }
.ogf-authors { margin: -.5rem 0 2rem; font-family: var(--font-sans); font-size: .95rem; line-height: 1.7; color: var(--secondary); }
.ogf-authors a { color: var(--text); text-decoration: underline; text-decoration-color: rgba(255,255,255,.25); text-underline-offset: 3px; }
.ogf-authors a:hover { text-decoration-color: var(--amber); }
.ogf-authors sup { font-size: .7em; color: var(--amber); margin-left: .05em; }
.ogf-authors .ogf-affil { margin-top: .35rem; font-size: .85rem; color: #8a9097; }
.blog-body .ogf-tldr { padding: 1rem 1.25rem; border-left: 3px solid var(--amber); background: var(--amber-soft); border-radius: 0 10px 10px 0; color: var(--text); }
.ogf-fig-title { margin: .2rem 0 1rem; text-align: center; font-size: 1.05rem; font-weight: 600; color: var(--text); }

.ogf-controls { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .75rem; justify-content: center; align-items: center; }
.ogf-controls + .ogf-controls { margin-top: -.25rem; }
.ogf-controls button { font: inherit; font-size: .82rem; padding: .35rem .8rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); background: #161616; color: #aab1b8; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.ogf-controls button:hover { border-color: rgba(255,255,255,.35); color: #edf2f7; }
.ogf-controls button[aria-pressed="true"] { color: #111; background: var(--amber); border-color: var(--amber); font-weight: 600; }

.ogf-replay { position: relative; width: 100%; aspect-ratio: 16 / 10; min-height: 22rem; border-radius: 10px; overflow: hidden; background: #000; }
.ogf-replay iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ogf-replay-load { position: absolute; inset: 0; display: flex; flex-direction: column; gap: .3rem; align-items: center; justify-content: center; font-size: .9rem; color: #aab1b8; }
.ogf-replay-load[hidden] { display: none; }
.ogf-replay-load small { color: #6e737a; }
.ogf-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; justify-content: center; list-style: none; margin: .8rem 0 0; padding: 0; font-size: .8rem; color: #aab1b8; }
.ogf-legend li { display: flex; align-items: center; gap: .4rem; }
.ogf-swatch { display: inline-block; width: .85rem; height: .85rem; border-radius: 2px; }
.ogf-swatch.is-followed { background: #f4f4f4; }
.ogf-swatch.is-car { background: #f57c0a; }
.ogf-swatch.is-goal { background: transparent; border: 2px solid #38bdf8; border-radius: 50%; }
.ogf-swatch.is-light { width: 1.5rem; height: .3rem; background: linear-gradient(90deg, #ef4444 0 33%, #facc15 33% 66%, #22c55e 66%); }
.ogf-swatch.is-edge { width: 1.5rem; height: .2rem; background: #f2c230; }

.ogf-video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; background: #000; }
.ogf-table-note { margin-top: .75rem; font-size: .85rem; color: #8a9097; text-align: center; }
