/* Bernard Engine documentation (docs.bernardengine.com). Same family as bernardreview.com (Geist, Instrument Serif,
   dark), with Bernard's own accent: the yellow of his glasses. Fonts are served by this server (OFL, see fonts/). */
@font-face { font-family: "Geist"; src: url("fonts/Geist-Light.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/Geist-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/Geist-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/Geist-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Regular.ttf") format("truetype"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/InstrumentSerif-Italic-latin.woff2") format("woff2"); }

:root { --bg: #0D0D0F; --panel: #141417; --line: #24242A; --text: #ECEAE4; --muted: #A3A09A; --accent: #FFC94A; --link: #FFD978; }
html { scroll-padding-top: 76px; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.65 "Geist", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--accent); color: #111; padding: 8px 12px; }

.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; padding: 12px 32px;
  background: rgba(13,13,15,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand b { font-weight: 600; }
.brand span { font-weight: 300; }
.bar-links { margin-left: auto; display: flex; gap: 22px; font-size: 14px; }
.bar-links a { color: var(--muted); }
.bar-links a:hover { color: var(--text); text-decoration: none; }

.layout { display: grid; grid-template-columns: 240px minmax(0, 780px) 220px; gap: 48px; max-width: 1380px; margin: 0 auto; padding: 32px; }
.side, .toc { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 2px;
  max-height: calc(100vh - 110px); overflow-y: auto; font-size: 14px; }
.k { font: 11px "Geist Mono", monospace; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.side a, .toc a { color: var(--muted); padding: 5px 10px; border-left: 2px solid transparent; }
.side a:hover, .toc a:hover { color: var(--text); text-decoration: none; }
.side a[aria-current="page"] { color: var(--text); border-left-color: var(--accent); }
.toc a.l3 { padding-left: 22px; font-size: 13px; }

.doc h1 { font: italic 400 52px/1.05 "Instrument Serif", Georgia, serif; margin: 8px 0 28px; letter-spacing: -0.5px; }
.doc h2 { font-size: 26px; font-weight: 500; margin: 56px 0 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 19px; font-weight: 500; margin: 36px 0 10px; }
.doc h4 { font-size: 16px; font-weight: 600; margin: 26px 0 8px; }
.doc h2:target, .doc h3:target, .doc h4:target { color: var(--accent); }
.doc p, .doc li { color: #D9D6CF; }
.doc em { color: var(--text); }
.doc code, .doc kbd { font: 13.5px "Geist Mono", monospace; background: var(--panel); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 6px; color: var(--text); }
.doc pre { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; overflow-x: auto; }
.doc pre code { border: 0; padding: 0; }
.doc blockquote { margin: 20px 0; padding: 4px 20px; border-left: 3px solid var(--accent); color: var(--muted); }
.doc table { border-collapse: collapse; width: 100%; margin: 18px 0; font-size: 14.5px; }
.doc th, .doc td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { font: 11px "Geist Mono", monospace; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.doc img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; margin: 10px 0; }
.foot { max-width: 1380px; margin: 40px auto 0; padding: 28px 32px 40px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px; }

@media (max-width: 1180px) { .layout { grid-template-columns: 220px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; padding: 20px; gap: 20px; }
  .side { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; }
  .side .k { width: 100%; }
  .bar { padding: 10px 16px; } .bar-links { gap: 14px; font-size: 13px; }
  .doc h1 { font-size: 40px; }
}

/* FR / EN / ES */
.langs { display: inline-flex; gap: 2px; margin-left: 8px; }
.langs a { padding: 3px 7px; border-radius: 30px; font-size: 12px; }
.langs a[aria-current] { background: var(--accent, #FFC94A); color: #1a0c04; }

/* Search box (assets/search.js) */
.search { position: relative; flex: 0 1 320px; min-width: 0; }
.search-input { box-sizing: border-box; width: 100%; padding: 7px 12px; font: 14px "Geist", system-ui, sans-serif; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 30px; }
.search-input::placeholder { color: var(--muted); }
.search-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 30px; color: var(--muted);
  font-size: 18px; line-height: 1; width: 36px; height: 32px; cursor: pointer; }
.search-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-list { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(560px, calc(100vw - 32px)); margin: 0; padding: 4px;
  list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.search-list[hidden] { display: none; }
.search-list a { display: block; padding: 8px 10px; border-radius: 5px; color: var(--text); }
.search-list a:hover { text-decoration: none; }
.search-list li.on a { background: var(--line); }
.search-path { display: block; font-size: 13.5px; font-weight: 500; }
.search-ex { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; }
.search-list mark { background: none; color: var(--accent); font-weight: 600; }
@media (max-width: 700px) {
  .search { flex: 0 0 auto; margin-left: auto; }
  .search-toggle { display: block; }
  .search-input { display: none; }
  .search.open { position: static; flex: 1 1 100%; order: 3; }
  .search.open .search-toggle { display: none; }
  .search.open .search-input { display: block; }
  .bar { flex-wrap: wrap; }
  .bar-links { margin-left: 0; }
  .search-list { left: 16px; right: 16px; width: auto; top: 100%; }
}
