/* The header and the footer of every page (src/chrome.ts), and the page edge they share
   with the content. The build puts this file in front of site.css and into the home
   page's own styles, so both read the same rules. */
:root {
  /* The left and right edge of everything: 16 px on a phone, up to 56 px, and a centred
     column of 1400 px on wide screens */
  --edge: max(16px, min(4vw, 56px), calc((100vw - 1400px) / 2));
  --top: 64px;
}

.top {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--top);
  padding: 0 var(--edge);
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.4;
}
.top .logo { display: block; flex: none; }
.top .logo img { display: block; width: 118px; height: 28px; }
.top-tools { display: flex; flex: 1 1 auto; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.top-nav { display: flex; flex: none; align-items: center; gap: 24px; margin-left: 16px; }
.top-nav a, .top-menu-panel a { font-weight: 500; text-decoration: none; }
.top-nav a { padding: 8px 0; }
.top-nav a:hover, .top-menu-panel a:hover { text-decoration: underline; }
.top-nav .top-lang { padding-left: 24px; border-left: 1px solid var(--rule); color: var(--muted); }
.top-nav .top-lang:hover { color: var(--text); }

/* Narrow screens: the entries go into a menu that opens without scripts */
.top-menu { display: none; position: static; flex: none; }
.top-menu summary {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.top-menu summary::-webkit-details-marker { display: none; }
.top-menu summary:hover { border-color: var(--muted); }
.top-menu[open] summary { border-color: var(--text); }
.top-menu-panel {
  position: absolute;
  top: calc(100% + 1px);
  right: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  padding: 8px var(--edge) 16px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.top-menu-panel a { display: flex; align-items: center; min-height: 48px; border-bottom: 1px solid var(--rule); }
.top-menu-panel a:last-child { border-bottom: 0; }
.top-menu-panel .top-lang { color: var(--muted); }

@media (max-width: 719px) {
  .top-nav { display: none; }
  .top-menu { display: block; }
}

/* Footer */
.foot {
  padding: 28px var(--edge) clamp(32px, 4vw, 56px);
  border-top: 1px solid var(--rule);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}
.foot-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 40px; }
.foot-line p { margin: 0; }
.foot-line nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot-line a { padding: 4px 0; }
.foot .wordmark { display: block; width: 100%; height: auto; margin-top: clamp(56px, 8vw, 120px); }

/* Tokens, fonts and base styles the docs share with the landing page. */
@font-face {
  font-family: "Funnel Display";
  src: url("/fonts/FunnelDisplay-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/IBMPlexSans-latin.woff2") format("woff2");
  font-weight: 100 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/IBMPlexMono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #141616;
  --text: #e4e7e7;
  --muted: #a3abad;
  --rule: #2c3131;
  --hover: #1c1f1f;
  --blue: #58a6ff;
  --lime: #a3e635;
  --teal: #3fd0c4;
  --warn: #f0b24a;
  --on-blue: #0c1b1e;
  --code: #0b0c0c;
  --code-inline: #222626;
  --backdrop: rgba(0, 0, 0, 0.6);
  --display: "Funnel Display", "IBM Plex Sans", system-ui, sans-serif;
  --sans: "IBM Plex Sans", system-ui, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
.only-light { display: none !important; }
@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --text: #1b1e1f;
    --muted: #566064;
    --rule: #dde1e2;
    --hover: #f3f5f5;
    --blue: #1f6feb;
    --lime: #3d7a06;
    --teal: #0b7a74;
    --warn: #8f5a00;
    --on-blue: #ffffff;
    --code: #f4f6f6;
    --code-inline: #eceff0;
    --backdrop: rgba(27, 30, 31, 0.45);
    color-scheme: light;
  }
  .only-dark { display: none !important; }
  .only-light { display: block !important; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 20px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
