/*
 * Bonkverse UI base (v0.1.3): font, page, type, links, focus.
 * Needs tokens.css first. Sites add components.css after this.
 */

/* ── Jost (SIL Open Font License, fonts/OFL.txt) ─────────────────────────── */
@font-face { font-family: "Jost"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/jost-latin-400-normal.woff2") format("woff2");
  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: "Jost"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/jost-latin-500-normal.woff2") format("woff2");
  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: "Jost"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/jost-latin-600-normal.woff2") format("woff2");
  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: "Jost"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/jost-latin-700-normal.woff2") format("woff2");
  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; }
/* Accented letters in usernames and skin names */
@font-face { font-family: "Jost"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/jost-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/jost-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/jost-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/jost-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bv-page);
  color: var(--bv-text);
  font-family: var(--bv-font);
  font-size: var(--bv-text-md);
  line-height: var(--bv-leading-md);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

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

[hidden] {
  display: none !important;
}

/* ── Type ─────────────────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  margin: 0;
  color: var(--bv-heading);
  font-weight: 700;
  text-wrap: balance;
}
h1 { font-size: var(--bv-text-2xl); line-height: var(--bv-leading-2xl); }
h2 { font-size: var(--bv-text-xl); line-height: var(--bv-leading-xl); }
h3 { font-size: var(--bv-text-lg); line-height: var(--bv-leading-lg); }
h4 { font-size: var(--bv-text-md); line-height: var(--bv-leading-md); }

p {
  margin: 0;
}

small {
  font-size: var(--bv-text-xs);
  line-height: var(--bv-leading-xs);
}

a {
  color: var(--bv-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-thickness: 2px;
}

code,
kbd,
pre {
  font-family: var(--bv-mono);
  font-size: 0.9em;
}
:not(pre) > code {
  padding: 1px 5px;
  border-radius: var(--bv-radius-sm);
  background: var(--bv-thumb);
  border: 1px solid var(--bv-outline);
}

hr {
  border: 0;
  border-top: 1px solid var(--bv-outline);
  margin: var(--bv-space-6) 0;
}

::selection {
  background: var(--bv-selected);
  color: var(--bv-text);
}

/* ── Autofilled fields keep the theme's colors (browsers paint them yellow) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--bv-text);
  caret-color: var(--bv-text);
  box-shadow: 0 0 0 1000px var(--bv-input) inset;
  transition: background-color 600000s 0s;
}

/* ── Opt-in page frame: <body class="bv-app"> keeps the footer at the
   bottom of short pages. */
body.bv-app {
  display: flex;
  flex-direction: column;
}
/* Zero specificity, so anything that sets its own width (toasts, dialogs,
   fixed panels added to <body>) keeps it. */
:where(body.bv-app > :not(.bv-skip-link)) {
  width: 100%; /* a flex column would otherwise shrink centered children to their content */
}
:where(body.bv-app > dialog, body.bv-app > .bv-toasts) {
  width: auto;
}
body.bv-app > .bv-footer {
  margin-top: auto;
}

/* ── Focus: 2 px teal ring, 2 px away from the element ─────────────────── */
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--bv-link);
  outline-offset: 2px;
}

/* ── Helpers ──────────────────────────────────────────────────────────────── */
.bv-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.bv-skip-link {
  position: absolute;
  left: var(--bv-space-4);
  top: -100px;
  z-index: 100;
  padding: var(--bv-space-2) var(--bv-space-4);
  border-radius: var(--bv-radius);
  background: var(--bv-card);
  color: var(--bv-link);
  font-weight: 600;
}
.bv-skip-link:focus {
  top: var(--bv-space-2);
}

.bv-container {
  width: 100%;
  max-width: var(--bv-page-max);
  margin-inline: auto;
  padding-inline: var(--bv-gutter);
}

/* An element with data-bv-theme shows that theme inside it */
.bv-theme-scope {
  background: var(--bv-page);
  color: var(--bv-text);
}

.bv-muted { color: var(--bv-muted); }
.bv-small { font-size: var(--bv-text-xs); line-height: var(--bv-leading-xs); }
.bv-num { font-variant-numeric: tabular-nums; }

/* ── Reduced motion: state changes stay, movement goes ──────────────────── */
@media (prefers-reduced-motion: reduce) {
  :root {
    --bv-press: 0ms;
    --bv-fade: 0ms;
    --bv-enter: 0ms;
    --bv-pop: 0ms;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
