/*
 * RentAIBox look for Paymenter (served at /rentaibox/rentaibox.css, loaded after the default theme's CSS).
 * Tokens are copied from site/src/styles/global.css (see site/DESIGN.md); keep them in sync.
 * Unlayered rules beat Tailwind's layered utilities, so keep selectors narrow.
 * Dark mode follows Paymenter's `.dark` class on <body> (system preference by default).
 */

/* ------------------------------------------------------------------ fonts (self-hosted, OFL) */
@font-face {
  font-family: 'Onest Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/onest-cyrillic-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/onest-latin-ext-wght-normal.woff2) format('woff2-variations');
  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: 'Onest Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/onest-latin-wght-normal.woff2) format('woff2-variations');
  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: 'JetBrains Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(fonts/jetbrains-mono-cyrillic-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(fonts/jetbrains-mono-latin-wght-normal.woff2) format('woff2-variations');
  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;
}

/* ------------------------------------------------------------------ tokens */
:root {
  --rb-bg: #f3f1ec;
  --rb-surface: #fbfaf7;
  --rb-surface-2: #e9e6df;
  --rb-ink: #16181b;
  --rb-ink-2: #4a4f57;
  --rb-ink-3: #6b7078;
  --rb-line: #d8d3c9;
  --rb-line-strong: #a7a196;
  --rb-led-free: #22b35e;
  --rb-btn-bg: #16181b;
  --rb-btn-ink: #fbfaf7;
  --rb-focus: #1f56d6;
  --rb-sans: 'Onest Variable', 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --rb-mono: 'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Tailwind v4 theme variables of the default theme (Nunito -> Onest) */
  --font-sans: var(--rb-sans);
  --font-mono: var(--rb-mono);
  --default-font-family: var(--rb-sans);
}
.dark {
  --rb-bg: #101214;
  --rb-surface: #171a1d;
  --rb-surface-2: #1f2327;
  --rb-ink: #ecebe6;
  --rb-ink-2: #b1b5bb;
  --rb-ink-3: #8d9298;
  --rb-line: #2a2f34;
  --rb-line-strong: #474d54;
  --rb-led-free: #43d17e;
  --rb-btn-bg: #ecebe6;
  --rb-btn-ink: #101214;
  --rb-focus: #8ab4ff;
}

/* ------------------------------------------------------------------ base */
body {
  font-family: var(--rb-sans);
  font-feature-settings: 'ss01', 'cv11';
  line-height: 1.6;
  color: var(--rb-ink);
  background: var(--rb-bg);
}
h1, h2, h3 { letter-spacing: -0.015em; font-weight: 650; text-wrap: balance; }
h1 { letter-spacing: -0.025em; }
:focus-visible { outline: 2px solid var(--rb-focus); outline-offset: 3px; border-radius: 3px; }
::selection { background: #dcefe2; color: #16181b; }

/* Primary buttons are ink on paper in light mode and invert in dark mode (Tailwind gives them text-white). */
.dark .bg-primary { color: hsl(var(--color-inverted)); }
.dark .bg-primary .fill-background { fill: hsl(var(--color-inverted)); }
.dark .bg-secondary.text-white { color: hsl(var(--color-inverted)); }
.bg-primary.text-white { letter-spacing: 0; }

/* Prices and money in mono, like the site */
.text-lg.font-semibold.flex.justify-between,
.font-semibold.flex.justify-between { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ header */
.rb-header {
  background: color-mix(in srgb, var(--rb-bg) 88%, transparent) !important;
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rb-line) !important;
}
.rb-brand {
  color: var(--rb-ink);
  text-decoration: none;
}
.rb-brand span:not(.rb-mark) {
  font-size: 1.08rem !important;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.rb-mark {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  background: var(--rb-ink);
  position: relative;
  flex: none;
}
.rb-mark::after {
  content: '';
  position: absolute;
  right: 0.3rem;
  bottom: 0.3rem;
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: var(--rb-led-free);
  box-shadow: 0 0 6px var(--rb-led-free);
}
.rb-header a.text-base,
.rb-header a.text-primary { font-weight: 450; color: var(--rb-ink-2); border-radius: 6px; }
.rb-header a.text-base:hover { color: var(--rb-ink); background: var(--rb-surface-2); }

.rb-lang {
  display: inline-flex;
  align-items: center;
  font-family: var(--rb-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 0.35rem 0.55rem;
  margin-inline: 0.5rem;
  border: 1px solid var(--rb-line-strong);
  border-radius: 6px;
  color: var(--rb-ink-2);
  line-height: 1.2;
}
.rb-lang:hover { color: var(--rb-ink); border-color: var(--rb-ink); }

/* ------------------------------------------------------------------ footer */
.rb-footer {
  margin-top: clamp(4rem, 3.4rem + 2.6vw, 5.5rem);
  border-top: 1px solid var(--rb-line);
  color: var(--rb-ink-2);
  font-size: 0.92rem;
}
.rb-footer__inner {
  max-width: 1380px;
  margin-inline: auto;
  padding: 2rem clamp(1rem, 0.6rem + 2vw, 2rem) 1.5rem;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 48rem) {
  .rb-footer__inner { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .rb-footer__base { grid-column: 1 / -1; }
}
.rb-footer__brand .rb-brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--rb-ink); }
.rb-footer__tagline { margin: 0.6rem 0 0; max-width: 46ch; }
.rb-footer__links { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; }
.rb-footer a { color: inherit; text-decoration: none; }
.rb-footer__links a:hover,
.rb-footer__base a:hover { color: var(--rb-ink); text-decoration: underline; text-underline-offset: 0.2em; }
.rb-footer__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rb-line);
  font-family: var(--rb-mono);
  font-size: 0.78rem;
  color: var(--rb-ink-3);
}

/* ------------------------------------------------------------------ cards, forms */
/* Cards on the site are surface + hairline border + 10px radius. */
.bg-background-secondary.rounded-md,
.bg-background-secondary.rounded-lg,
.bg-background-secondary.rounded-xl { border-radius: 10px; border: 1px solid var(--rb-line); }
/* Money in the order summary: mono, like prices on the site. */
.text-lg.font-semibold.flex.justify-between,
.text-2xl.font-semibold + .text-lg.font-semibold { font-family: var(--rb-mono); letter-spacing: -0.02em; }
.text-lg.font-semibold.flex.justify-between h4 { font-family: var(--rb-sans); letter-spacing: 0; }
input, select, textarea { font-family: inherit; }
.prose { color: var(--rb-ink-2); }
.dark .prose { color: var(--rb-ink-2); }
