/* The Oriel manual, drawn like orielbrowser.com: the same Orpiment colors,
   the site's header, and its three self-hosted fonts. The tokens below are
   the site's values from site/style.css, plus code colors for listings. */

@font-face { font-family: "Bricolage Grotesque"; src: url(fonts/bricolage-grotesque-latin-full.woff2) format("woff2"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #0E0E0C;
  --bg-raised: #161614;
  --edge: #2A2925;
  --fg: #E6E2D5;
  --fg-dim: #ABA79A;
  --gold: #EDBB45;
  --tok-keyword: #EDBB45;
  --tok-special: #78B6F2;
  --tok-string: #6FD3A0;
  --tok-number: #F59A5B;
  --tok-comment: #989485;
  --tok-paren: #A09C8F;
  --warn: #F59A5B;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --sans: "Atkinson Hyperlegible", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #FFFFFF;
    --bg-raised: #F6F5F1;
    --edge: #E2E0DA;
    --fg: #17171A;
    --fg-dim: #55534D;
    --gold: #865B00;
    --tok-keyword: #865B00;
    --tok-special: #1F5F9E;
    --tok-string: #1D7A4A;
    --tok-number: #A4501A;
    --tok-comment: #6B675C;
    --tok-paren: #6B675C;
    --warn: #A4501A;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

html { background: var(--bg); scroll-padding-top: 1rem; }

body {
  margin: 0 auto;
  max-width: 76rem;
  padding: 0 1rem;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 var(--sans);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--gold); text-underline-offset: 0.18em; }
a:hover { color: var(--fg); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.skip { position: absolute; left: -10000px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 2; padding: 0.5rem 1rem; background: var(--bg); }

/* sigil-doc gives every heading a permalink whose label is for screen
   readers. The label stays off the screen, and the # shows on hover. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.permalink { margin-left: 0.4em; color: var(--fg-dim); font-weight: 400; text-decoration: none; opacity: 0; }
h2:hover .permalink, h3:hover .permalink, h4:hover .permalink,
.permalink:hover, .permalink:focus-visible { opacity: 1; }
@media (hover: none) { .permalink { opacity: 0.4; } }

/* Contents on the left, the page on the right. */
.layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
  padding-top: 2rem;
}
.contents {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.4;
}
.contents-group p {
  margin: 0 0 0.4rem;
  color: var(--fg-dim);
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.contents-group + .contents-group p { margin-top: 1.5rem; }
.contents ul { margin: 0; padding: 0; list-style: none; }
.contents li { margin: 0; }
.contents li a {
  display: block;
  padding: 0.3rem 0.6rem;
  border-left: 2px solid var(--edge);
  color: var(--fg);
  text-decoration: none;
}
.contents li a:hover { color: var(--gold); }
.contents li a[aria-current] { border-left-color: var(--gold); color: var(--gold); font-weight: 700; }
.mobile-contents { display: none; }
.mobile-contents summary { cursor: pointer; color: var(--fg-dim); font-family: var(--display); font-weight: 600; }

main { min-width: 0; }
article { max-width: 44rem; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; font-variation-settings: "opsz" 48; }
h1 { margin: 0 0 1.5rem; font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.12; letter-spacing: -0.01em; }
h2 { margin: 2.75rem 0 0.75rem; font-size: 1.55rem; line-height: 1.25; }
h3 { margin: 2rem 0 0.5rem; font-size: 1.2rem; line-height: 1.3; }
.anchor { display: block; }

article ul, article ol { padding-left: 1.2em; }
article li { margin: 0.4em 0; }
article li::marker { color: var(--gold); }
em { font-style: italic; }

code, kbd, pre { font-family: var(--mono); font-size: 0.88em; font-variant-ligatures: none; }
p code, li code, td code, figcaption code {
  padding: 0.05em 0.3em;
  border-radius: 3px;
  background: var(--bg-raised);
  overflow-wrap: anywhere;
}
kbd {
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--edge);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-raised);
  color: var(--fg);
  white-space: nowrap;
}
pre {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: var(--bg-raised);
  line-height: 1.5;
}
pre code { color: var(--fg); font-size: 0.86rem; }
.tok-keyword { color: var(--tok-keyword); }
.tok-special { color: var(--tok-special); }
.tok-string { color: var(--tok-string); }
.tok-number, .tok-boolean, .tok-quote { color: var(--tok-number); }
.tok-comment { color: var(--tok-comment); }
.tok-paren { color: var(--tok-paren); }
.example pre { margin-top: 0.25rem; }

figure { margin: 1.75rem 0; }
.shot { border: 1px solid var(--edge); border-radius: 8px; overflow: hidden; background: var(--bg-raised); }
.shot img { display: block; width: 100%; max-width: 1280px; height: auto; }
.shot-link { display: block; }
figcaption { padding: 0.75rem 1rem 0.9rem; color: var(--fg-dim); font-size: 0.95rem; line-height: 1.5; }

table { display: block; overflow-x: auto; margin: 1.25rem 0; border-collapse: collapse; font-size: 0.95rem; line-height: 1.45; }
th, td { padding: 0.5rem 0.9rem 0.5rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--edge); }
th { color: var(--fg-dim); font-weight: 700; }
td p { margin: 0; }

.admonition {
  margin: 1.5rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
  background: var(--bg-raised);
}
.admonition.warning { border-left-color: var(--warn); }
.admonition p { margin: 0.5rem 0; }
.admonition-title { font-weight: 700; }

/* The way on, at the end of every page. */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--edge);
}
.pager a { display: block; max-width: 48%; text-decoration: none; font-family: var(--display); font-weight: 600; }
.pager-next { margin-left: auto; text-align: right; }
.pager-label { display: block; color: var(--fg-dim); font-family: var(--sans); font-weight: 400; font-size: 0.85rem; }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; padding-top: 1.25rem; }
  .contents { position: static; max-height: none; overflow: visible; }
  .desktop-contents { display: none; }
  .mobile-contents { display: block; }
  .mobile-contents[open] summary { margin-bottom: 0.75rem; }
}

@media (max-width: 520px) {
  pre { padding: 0.75rem; }
  .pager a { max-width: 100%; }
}
