/*
 * Pickle base layer: self-hosted fonts, reset, document, elements, a11y.
 * Loads after tokens.css and before components.css.
 */

/* ------------------------------------------------------------------- fonts
 * Latin subsets, self-hosted from shared-ui/fonts/ so the strict
 * `font-src 'self'` CSP holds and no request leaves the origin.
 * Sora and Manrope are variable (400–700 in one file each).
 */
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/shared-ui/fonts/sora-400-700.woff2") format("woff2");
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/shared-ui/fonts/manrope-400-700.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/shared-ui/fonts/ibm-plex-mono-400.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/shared-ui/fonts/ibm-plex-mono-500.woff2") format("woff2");
}

/* -------------------------------------------------------------------- reset */

*, *::before, *::after { box-sizing: border-box; }

* { min-width: 0; }

html {
  min-width: 320px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--banx-surface-4) transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  /* The page never scrolls sideways; wide content scrolls inside .ex-scroll. */
  overflow-x: hidden;
  font-family: var(--banx-font);
  font-size: var(--banx-text-md);
  font-weight: 400;
  line-height: 1.65;
  color: var(--banx-text);
  background: var(--banx-bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ----------------------------------------------------------------- elements */

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--banx-font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: var(--banx-tracking-tight);
  text-wrap: balance;
}

h1 { font-size: var(--banx-text-3xl); letter-spacing: -.03em; }
h2 { font-size: var(--banx-text-2xl); }
h3 { font-size: var(--banx-text-lg); }
h4 { font-size: var(--banx-text-base); }

p { margin: 0; text-wrap: pretty; }

a {
  color: var(--banx-mint);
  text-decoration: none;
  transition: color var(--banx-fast) var(--banx-ease);
}

a:hover { color: var(--banx-mint-hi); }

a, button { -webkit-tap-highlight-color: transparent; }

button, input, textarea, select { font: inherit; color: inherit; }

img, svg, video, canvas { max-width: 100%; }

img { border-style: none; }

table { border-collapse: collapse; }

hr {
  height: 0;
  margin: var(--banx-space-6) 0;
  border: 0;
  border-top: 1px solid var(--banx-line);
}

code, kbd, samp, pre, .mono {
  font-family: var(--banx-font-mono);
  font-variant-ligatures: none;
}

pre { margin: 0; }

strong { color: var(--banx-text); font-weight: 500; }

::placeholder { color: var(--banx-faint); opacity: 1; }

::selection { background: rgb(0 231 136 / 30%); }

/* Thin, flat scrollbars for horizontal scrollers and the stream console. */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--banx-surface-4);
  border: 3px solid transparent;
  border-radius: 2px;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-clip: content-box; background-color: var(--banx-subtle); }

/* ------------------------------------------------------------- accessibility */

:focus-visible {
  outline: 2px solid var(--banx-focus);
  outline-offset: 2px;
  border-radius: var(--banx-radius);
}

:focus:not(:focus-visible) { outline: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: var(--banx-z-skip);
  top: var(--banx-space-3);
  left: var(--banx-space-3);
  padding: .7rem 1.1rem;
  color: var(--banx-mint-ink);
  font-weight: 600;
  background: var(--banx-mint);
  border-radius: var(--banx-radius);
  transform: translateY(-200%);
  transition: transform var(--banx-base) var(--banx-ease);
}

.skip-link:focus-visible { transform: none; }

[hidden] { display: none !important; }

[aria-disabled="true"], :disabled { cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
