/*
 * 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.
 */
/* One text family, not two. Inter Tight carries display AND body: it is neutral
 * to the point of invisibility, which is exactly what the type should be when a
 * scene is the subject. Fraunces and Manrope both left with the editorial page -
 * a high-contrast serif was the wrong register for a real-time chain, and once
 * Inter Tight covers body there is no second family to justify.
 *
 * Net font payload: 74 kB across two files, against 80 kB for the three we
 * started the day with. */
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/shared-ui/fonts/inter-tight-latin.woff2") format("woff2-variations");
}

@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);
  /* The animatable ground, not --banx-bg. An act paints its own register, but
   * the body has to agree with it or the gap between two acts flashes the old
   * value during an overscroll bounce. */
  background: var(--banx-ground);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

/*
 * No font-variation-settings anywhere. Inter Tight has one axis, wght, and
 * `font-weight` already drives it - stating it explicitly would only be a way to
 * get it wrong later.
 */
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--banx-font-display);
  font-optical-sizing: auto;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: var(--banx-tracking-tight);
  text-wrap: balance;
}

/* Weight steps down as the size does: 700 reads as emphasis at 120px and as a
 * shout at 17px. Optical size needs no per-level value - `auto` above derives it
 * from each of these font sizes. */
h1 {
  font-size: var(--banx-text-display);
  letter-spacing: var(--banx-tracking-display);
  line-height: var(--banx-leading-display);
}

h2 {
  font-size: var(--banx-text-3xl);
  letter-spacing: -.035em;
}

h3 {
  font-size: var(--banx-text-2xl);
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.2;
}

h4 {
  font-size: var(--banx-text-lg);
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.3;
}

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;
  }
}
