/* ==========================================================================
   jonquil.b12n.app: Jonquil's brand and pages on top of the Northstar
   template's styles.css, which stays as shipped so it can be diffed.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Brand. The logo's yellow (#F5C518) and orange cup (#F76707). In light,
   links use a darker amber so they pass contrast on white.
   -------------------------------------------------------------------------- */

:root {
  --bg: #0d0c0a;
  --bg-alt: #12110e;
  --surface: #191712;
  --surface-2: #211e17;
  --line: rgba(255, 240, 200, 0.10);
  --line-strong: rgba(255, 240, 200, 0.18);
  --ink: #f6f2e8;
  --ink-2: #c9c1ae;
  --ink-3: #958c78;
  --accent: #f5c518;
  --accent-2: #ff8a3d;
  --warm: #ffa41b;
  --on-accent: #1d1600;
  --ok: #7bd389;
  --code-bg: #15130f;
  --hl-com: #8a8270; --hl-str: #b5d98a; --hl-kw: #f7b25c; --hl-num: #d9a6ff;
  --hl-def: #ff8a3d; --hl-fn: #f5c518;
  --br0: #f5c518; --br1: #ff8a3d; --br2: #7fb8ff; --br3: #c79bff;
}

html[data-theme="light"] {
  --bg: #fbf8f1;
  --bg-alt: #f4efe3;
  --surface: #ffffff;
  --surface-2: #f8f4ea;
  --line: rgba(60, 40, 0, 0.12);
  --line-strong: rgba(60, 40, 0, 0.22);
  --ink: #1f1a10;
  --ink-2: #4d4535;
  --ink-3: #6f6650;
  --accent: #a55300;
  --accent-2: #c2410c;
  --warm: #9a6200;
  --on-accent: #ffffff;
  --ok: #1d7a35;
  --code-bg: #fdfaf2;
  --hl-com: #8a7f66; --hl-str: #3d7a12; --hl-kw: #a55300; --hl-num: #7a3fb0;
  --hl-def: #c2410c; --hl-fn: #7a5b00;
  --br0: #b98a00; --br1: #c2410c; --br2: #2563eb; --br3: #7c3aed;
}

html[data-theme="light"] .btn--primary { background: #f5c518; color: #1d1600; border-color: #e0a800; }
html[data-theme="light"] .btn--primary:hover { background: #ffd43b; color: #1d1600; }

/* --------------------------------------------------------------------------
   Small pieces
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center;
  margin-left: 2px; padding: 1px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 999px;
  font: 600 10.5px/1.6 var(--mono); letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent);
}

.hero h1 { font-size: clamp(42px, 6.4vw, 84px); max-width: 15ch; line-height: 1.02; }
.hero__lede { max-width: 60ch; font-size: clamp(17px, 1.6vw, 20px); }
.logo-strip li { font-family: var(--mono); font-size: 14px; letter-spacing: 0; }
.card h3 a { color: inherit; }
.card h3 a:hover { color: var(--accent); }
.lede code, .checklist code, .card code, .tabpanel code, .news code, .fcard code, .dcard code, .chapter code, .dtable code {
  font-family: var(--mono); font-size: 0.88em;
  padding: 1px 5px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   Screenshots. The docs harness captures the whole 1800x1464 window, and
   most of that is a quiet editor. A window shot shows its top (the toolbar
   and the code) at 16:11, with the full image a click away in the lightbox.
   A GIF plays whole.
   -------------------------------------------------------------------------- */

button.shot {
  display: block; width: 100%; padding: 0; font: inherit; text-align: left;
  cursor: zoom-in; background: #fff;
}
button.shot:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shot--window img { display: block; width: 100%; height: auto; }
.shot--bands { display: flex; flex-direction: column; }
.shot--bands .band {
  display: block; width: 100%;
  background-repeat: no-repeat; background-size: 100% auto;
}
/* the seam where an empty stretch of the window was cut out */
.shot--bands .band + .band {
  border-top: 1px dashed rgba(0, 0, 0, 0.16);
  box-shadow: inset 0 6px 6px -6px rgba(0, 0, 0, 0.18);
}
.shot--gif { background: #fff; }
.spread__media .shot--gif, .chapter .shot--gif { max-width: 560px; margin-inline: auto; }

/* The hero shows the dark-theme capture on a dark page and the light one
   on a light page. */
.hero__shots { max-width: 980px; margin-inline: auto; }
html[data-theme="dark"] .only-light, html[data-theme="light"] .only-dark { display: none; }
.hero__figure .hero__float--a { left: auto; right: -18px; bottom: 30%; }

/* --------------------------------------------------------------------------
   Code: the terminal card, a code card, the build-from-source steps, and the
   highlighter's colours (static/js/highlight.js).
   -------------------------------------------------------------------------- */

.terminal, .codecard {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--code-bg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.terminal__bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  font: 12px var(--mono); color: var(--ink-3);
}
.terminal__bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); }
.terminal__bar em { margin-left: 8px; font-style: normal; }
.terminal pre, .codecard pre, pre.steps {
  margin: 0; padding: 20px 22px; overflow-x: auto;
  font: 13.5px/1.65 var(--mono); color: var(--ink);
}
.codecard__name { padding: 10px 16px; border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--ink-3); }
pre.steps {
  margin-top: 22px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--code-bg); white-space: pre;
}

.hl-com { color: var(--hl-com); font-style: italic; }
.hl-str { color: var(--hl-str); }
.hl-kw  { color: var(--hl-kw); }
.hl-num { color: var(--hl-num); }
.hl-def { color: var(--hl-def); font-weight: 600; }
.hl-fn  { color: var(--hl-fn); }
.hl-br0 { color: var(--br0); } .hl-br1 { color: var(--br1); }
.hl-br2 { color: var(--br2); } .hl-br3 { color: var(--br3); }

/* --------------------------------------------------------------------------
   "Recently added", from CHANGELOG.md
   -------------------------------------------------------------------------- */

.news {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 22px 24px;
}
.news__head {
  display: flex; justify-content: space-between; align-items: baseline;
  font: 600 12px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3);
}
.news__head a { text-transform: none; letter-spacing: 0; font-weight: 500; }
.news ol { margin-top: 14px; display: grid; gap: 14px; counter-reset: news; }
.news li {
  position: relative; padding-left: 22px;
  font-size: 14.5px; line-height: 1.55; color: var(--ink-2);
}
.news li::before {
  content: ""; position: absolute; left: 2px; top: 0.55em;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}

/* --------------------------------------------------------------------------
   Guide pages: nav, article, on-this-page
   -------------------------------------------------------------------------- */

.guide {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 210px;
  gap: clamp(24px, 3.2vw, 48px);
  padding-top: 32px; padding-bottom: 96px;
  align-items: start;
}
.guide__nav, .guide__toc {
  position: sticky; top: calc(var(--nav-h) + 20px);
  max-height: calc(100vh - var(--nav-h) - 40px); overflow-y: auto;
  font-size: 14px; padding-bottom: 24px;
}
.guide__nav-head, .guide__toc-head {
  margin-bottom: 10px;
  font: 600 11.5px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
}
.guide__nav-head a { color: inherit; }
.guide__nav a, .guide__toc a {
  display: block; padding: 5px 10px; border-radius: 7px;
  color: var(--ink-2); line-height: 1.4;
}
.guide__nav a:hover, .guide__toc a:hover { color: var(--ink); background: var(--surface); }
.guide__nav li.is-active > a {
  color: var(--ink); background: var(--surface-2);
  box-shadow: inset 2px 0 0 var(--accent);
}
.guide__sub { margin: 2px 0 6px 12px; padding-left: 8px; border-left: 1px solid var(--line); font-size: 13.5px; }
.guide__toc ul ul { margin-left: 10px; font-size: 13px; }
.guide__toc a { padding: 3px 8px; }

.guide__pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line);
}
.guide__pager a {
  display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink); font-weight: 600;
}
.guide__pager a:hover { border-color: var(--accent); }
.guide__pager span { display: block; font: 500 12px var(--mono); color: var(--ink-3); margin-bottom: 2px; }
.guide__next { text-align: right; grid-column: 2; }
.guide__source { margin-top: 18px; font-size: 13px; color: var(--ink-3); }

@media (max-width: 1180px) {
  .guide { grid-template-columns: 220px minmax(0, 1fr); }
  .guide__toc { display: none; }
}
@media (max-width: 860px) {
  .guide { grid-template-columns: minmax(0, 1fr); padding-top: 20px; }
  .guide__nav { position: static; max-height: none; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
  .guide__nav > ul { columns: 2; column-gap: 12px; }
  .guide__nav > ul > li { break-inside: avoid; }
}
@media (max-width: 520px) { .guide__nav > ul { columns: 1; } }

/* The article itself: docs-engine's markdown, rendered. */
.prose { font-size: 16.5px; line-height: 1.72; color: var(--ink-2); min-width: 0; }
.prose > * + *, .prose .doc-section-body > * + * { margin-top: 1.05em; }
.prose h1 { font-size: clamp(32px, 4vw, 46px); line-height: 1.1; letter-spacing: -0.035em; color: var(--ink); font-weight: 700; }
.prose h2 { margin-top: 2.2em; font-size: 26px; letter-spacing: -0.02em; color: var(--ink); font-weight: 680; line-height: 1.25; }
.prose h3 { margin-top: 1.8em; font-size: 19px; color: var(--ink); font-weight: 650; }
.prose h1 + p { font-size: 18.5px; color: var(--ink-2); }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.35em; }
.prose li::marker { color: var(--ink-3); }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; color: var(--accent); }
.prose img { display: block; margin: 1.6em 0; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-soft); max-height: 640px; width: auto; }
.prose code { font-family: var(--mono); font-size: 0.86em; padding: 1px 5px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); }
.prose pre {
  padding: 16px 18px; overflow-x: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--code-bg);
  font-size: 13.5px; line-height: 1.6;
}
.prose pre code { padding: 0; border: 0; background: none; font-size: inherit; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.prose th, .prose td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { color: var(--ink); font-weight: 620; border-bottom-color: var(--line-strong); white-space: nowrap; }
.prose blockquote { margin-left: 0; padding: 4px 18px; border-left: 3px solid var(--line-strong); color: var(--ink-3); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose .heading-anchor { margin-left: 8px; opacity: 0; text-decoration: none; color: var(--ink-3); font-weight: 400; }
.prose .heading-anchor::before { content: "#"; }
.prose h2:hover .heading-anchor, .prose h3:hover .heading-anchor, .prose .heading-anchor:focus { opacity: 1; }

/* Folded edge cases (<details> in the source) and docs-engine's folded
   long-page sections (<details class="doc-section">). */
.prose details {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); padding: 0 16px;
}
.prose details > summary {
  cursor: pointer; list-style: none; padding: 12px 0; color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
.prose details > summary::-webkit-details-marker { display: none; }
.prose details > summary::before {
  content: ""; flex: none; width: 7px; height: 7px;
  border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3);
  transform: rotate(-45deg); transition: transform 0.15s ease;
}
.prose details[open] > summary::before { transform: rotate(45deg); }
.prose details[open] { padding-bottom: 14px; }
.prose details.doc-section { margin-top: 1.4em; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; padding: 0; }
.prose details.doc-section > summary { padding: 18px 0 6px; }
.prose details.doc-section > summary h2 { margin: 0; }
.prose details.doc-section[open] { padding-bottom: 0; }

.markdown-alert { padding: 12px 16px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface); }
.markdown-alert-title { font-weight: 650; color: var(--ink); }
.markdown-alert-warning, .markdown-alert-caution { border-left-color: var(--accent-2); }

@media (max-width: 560px) {
  .brand .badge { display: none; }
}

.tile img { object-position: top left; }
.hero__shots { width: 100%; }
.prose .guide__pager a, .prose .guide__source a { text-decoration: none; }
.prose .guide__source a { text-decoration: underline; }

/* Mermaid diagrams (static/js/diagrams.js) */
.prose pre.mermaid {
  display: flex; justify-content: center;
  padding: 20px; background: var(--surface); text-align: center;
  font-family: var(--font); white-space: pre;
}
.prose pre.mermaid svg { max-width: 100%; height: auto; }
.prose pre.mermaid { cursor: zoom-in; }
.lightbox img[src^="data:image/svg"] { width: min(92vw, 1600px); height: auto; max-height: 82vh; object-fit: contain; }

/* The release's files in the download section */
.downloads { margin-top: 22px; display: grid; gap: 12px; }
.downloads li { display: grid; gap: 4px; font-size: 15px; }
.downloads a { font-weight: 600; }
.downloads span { color: var(--ink-3); font-size: 13.5px; }
.downloads code { font: 12px var(--mono); color: var(--ink-3); overflow-wrap: anywhere; }

/* With a release, the CTA carries a file list too: stack it, copy above,
   actions in a row below, the files in two columns. */
.cta--release { grid-template-columns: minmax(0, 1fr); }
.cta--release .cta__copy .lede { max-width: 62ch; }
.cta--release .cta__actions { justify-content: flex-start; }
.cta--release .downloads { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; max-width: 900px; }
@media (max-width: 720px) { .cta--release .downloads { grid-template-columns: minmax(0, 1fr); } }
