/* ==========================================================================
   SatsRail navbar — SINGLE SOURCE OF TRUTH
   ==========================================================================

   ONE NAVBAR, THREE SURFACES. The portal, the marketing site and the
   developer docs all render the same `.navbar-bitcoin` markup, so they must
   not style it differently. This file is that style.

   It used to be a 289-line block duplicated verbatim in
   app/assets/stylesheets/satsrail.css and website/assets/css/satsrail.css,
   under a comment asking humans to "edit the two copies together". They were
   still byte-identical when the block was extracted here — which is luck, not
   a process. The same arrangement had already let flow_diagrams.css drift.

   Three consumers, one file:
     • Portal   — picked up by `require_directory .` in application.css.
     • Website  — copied to public/marketing/css/navbar.css by
                  `rake website:build`.
     • API docs — copied to public/developers/assets/css/navbar.css by
                  `rake api_docs:build`.

   The docs are the newest and the clearest argument for this file existing:
   they arrived from a repo of their own rendering a navbar of their own — a
   logo, a "Back to SatsRail" button and a gold "Get API Key" — which shared
   no markup, no styles and no links with this one, and so quietly missed
   every page the others gained.

   Depends on brand_tokens.css, which all three also load: the type scale,
   tracking and current-page colors are tokens there precisely so a size
   change lands on every navbar at once.

   One token this reads is deliberately NOT shared: --radius-sm. The portal
   uses 0.375rem and the other two 0.25rem, so each surface defines its own
   and the navbar takes whichever it is rendered on.

   Bootstrap 5.3.2 supplies the layout and behaviour underneath (.navbar,
   .dropdown, .collapse); this file is only the skin. A surface that renders
   this markup needs bootstrap.min.css and bootstrap.bundle.min.js from
   /vendor/, and bootstrap-icons for the `bi bi-*` glyphs.
   ========================================================================== */
.navbar-bitcoin {
  background: var(--gray-900);
  padding: 0;
  border-bottom: 1px solid rgba(232, 181, 60, 0.3);
}

.navbar-bitcoin .container-fluid {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.navbar-bitcoin .navbar-brand,
.navbar-bitcoin .nav-link,
.navbar-bitcoin .navbar-text {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: var(--nav-tracking);
  color: var(--nav-color) !important;
}

.navbar-bitcoin .navbar-brand {
  font-size: var(--nav-fs-brand);
  font-weight: 600;
  color: #fff !important;
  padding: 0.25rem 0;
  display: flex;
  align-items: center;
}

.navbar-bitcoin .navbar-brand i {
  color: var(--bitcoin-orange);
}

.navbar-bitcoin .navbar-brand .navbar-logo {
  height: var(--nav-logo-height);
  width: auto;
}

.navbar-bitcoin .nav-link {
  font-size: var(--nav-fs);
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  transition: color var(--t-fast, 120ms) var(--ease-out, ease),
              background var(--t-fast, 120ms) var(--ease-out, ease);
}

.navbar-bitcoin .navbar-brand,
.navbar-bitcoin .navbar-brand:hover,
.navbar-bitcoin .navbar-brand:focus,
.navbar-bitcoin .nav-link {
  text-decoration: none !important;
}

/* ── Current page ─────────────────────────────────────────────────────────
   A soft gold chip, not an underline. The marketing site used to slide a
   1px rule under the active link: it landed on the descenders, vanished
   under the icon on wrapped mobile rows, and was indistinguishable from
   the hover state it shared. The chip reads at a glance, survives
   wrapping, and matches the settings sidebar's active row — so "you are
   here" looks the same everywhere in the product.

   Gold now means current page and nothing else: hover brightens toward
   white instead of competing for the same color. */
.navbar-bitcoin .nav-link.active,
.navbar-bitcoin .nav-item.active > .nav-link {
  font-weight: 600;
  color: var(--nav-active-color) !important;
  background: var(--nav-active-bg);
}

.navbar-bitcoin .nav-link:hover,
.navbar-bitcoin .nav-link:focus {
  color: var(--nav-color-hover) !important;
  background: rgba(255, 255, 255, 0.07);
  text-decoration: none !important;
}

.navbar-bitcoin .nav-link.active:hover,
.navbar-bitcoin .nav-link.active:focus,
.navbar-bitcoin .nav-item.active > .nav-link:hover,
.navbar-bitcoin .nav-item.active > .nav-link:focus {
  color: var(--nav-active-color) !important;
  background: var(--nav-active-bg-hover);
}

/* Small count/status pill riding beside a nav label (open support
   tickets). Was five inline style declarations in the navbar partial. */
.navbar-bitcoin .nav-badge {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0;
  padding: 0.2em 0.45em;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* Navbar CTA Button — matches monospace theme */
.navbar-bitcoin .btn-navbar {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: var(--nav-tracking);
  font-size: var(--nav-fs-sm);
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: all var(--t-fast, 120ms) var(--ease-out, ease);
}

.navbar-bitcoin .btn-navbar-primary {
  background: var(--bitcoin-orange);
  border: 1px solid var(--bitcoin-orange);
  color: #fff;
}

.navbar-bitcoin .btn-navbar-primary:hover {
  background: var(--bitcoin-orange-dark);
  border-color: var(--bitcoin-orange-dark);
  color: #fff;
}

.navbar-bitcoin .btn-navbar-outline {
  background: transparent;
  border: 1px solid rgba(232, 181, 60, 0.5);
  color: var(--bitcoin-orange);
}

.navbar-bitcoin .btn-navbar-outline:hover {
  background: rgba(232, 181, 60, 0.12);
  border-color: var(--bitcoin-orange);
  color: var(--bitcoin-orange);
}

.navbar-bitcoin .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--nav-color);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: var(--nav-tracking);
  font-size: var(--nav-fs-sm);
}

.navbar-bitcoin .btn-outline-light:hover {
  background: var(--bitcoin-orange);
  border-color: var(--bitcoin-orange);
  color: #fff;
}

/* Dropdown styling — matches monospace theme */
.navbar-bitcoin .dropdown-menu {
  background: var(--gray-900);
  font-family: var(--font-mono);
  font-size: var(--nav-fs);
  text-transform: uppercase;
  letter-spacing: var(--nav-tracking);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(232, 181, 60, 0.3);
  margin-top: 0.25rem;
  padding: 0.35rem 0;
}

.navbar-bitcoin .dropdown-item {
  padding: 0.45rem 1rem;
  font-weight: 500;
  color: var(--nav-color);
  transition: background var(--t-fast, 120ms) var(--ease-out, ease),
              color var(--t-fast, 120ms) var(--ease-out, ease);
  text-decoration: none !important;
}

.navbar-bitcoin .dropdown-item:hover,
.navbar-bitcoin .dropdown-item:focus {
  background: rgba(255, 255, 255, 0.07);
  color: var(--nav-color-hover);
  text-decoration: none !important;
}

/* Same chip as the top-level links, so opening the menu you are already
   inside shows you which row you are on. Also beats Bootstrap's blue
   `.dropdown-item.active`, which the dark shell has no use for. */
.navbar-bitcoin .dropdown-item.active,
.navbar-bitcoin .dropdown-item:active {
  background: var(--nav-active-bg);
  color: var(--nav-active-color);
  font-weight: 600;
}

.navbar-bitcoin .dropdown-item.active:hover,
.navbar-bitcoin .dropdown-item.active:focus {
  background: var(--nav-active-bg-hover);
  color: var(--nav-active-color);
}

.navbar-bitcoin .dropdown-header {
  font-size: var(--nav-fs-sm);
  letter-spacing: var(--nav-tracking);
  color: rgba(255, 255, 255, 0.45);
}

.navbar-bitcoin .dropdown-item i {
  font-size: 0.9em;
  opacity: 0.8;
}

.navbar-bitcoin .dropdown-divider {
  border-color: rgba(255, 255, 255, 0.1);
  margin: 0.25rem 0;
}

/* The language menu: a globe and the page's language (EN, ES, PT), opening
   every language named in its own. Rendered by the marketing site's build
   (website/build.rb lang_switch_html) and by the portal's signed-out navbar
   (layouts/_language_switch). The page's own language is the current row. */
.navbar-bitcoin .nav-lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}

.navbar-bitcoin .nav-lang-toggle > .bi {
  font-size: 1.05em;
  opacity: 0.8;
}

.navbar-bitcoin .nav-lang-menu {
  min-width: 10rem;
}

.navbar-bitcoin .nav-lang-menu span.dropdown-item {
  cursor: default;
}

/* Proportional icon sizing */
.navbar-bitcoin .nav-link i,
.navbar-bitcoin .navbar-brand i {
  font-size: 1em;
}

/* Mobile responsiveness */
@media (max-width: 991.98px) {
  .navbar-bitcoin .navbar-toggler {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    border-color: rgba(255, 255, 255, 0.2);
  }

  .navbar-bitcoin .navbar-toggler-icon {
    width: 1.2em;
    height: 1.2em;
  }

  /* Stacked rows are their own tap targets — the chip needs to read as a
     full-width row here, not a label-width pill. */
  .navbar-bitcoin .nav-link {
    padding: 0.55rem 0.75rem;
  }

  .navbar-bitcoin .dropdown-menu {
    background: rgba(17, 24, 39, 0.95);
    border: none;
    margin-top: 0;
  }

  /* Navbar CTA buttons — full-width stacked on mobile */
  .navbar-bitcoin .navbar-cta-buttons {
    border-color: rgba(255, 255, 255, 0.1) !important;
    padding-top: 0.75rem !important;
    margin-top: 0.5rem !important;
  }

  .navbar-bitcoin .navbar-cta-buttons .btn {
    font-size: var(--nav-fs);
    padding: 0.55rem 1rem;
    text-align: center;
  }

  .navbar-bitcoin .navbar-cta-buttons .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.25);
  }

  .navbar-bitcoin .navbar-cta-buttons .btn-navbar-primary {
    padding: 0.55rem 1rem;
    font-size: var(--nav-fs);
  }
}

/* Remove border-top on desktop for navbar CTA */
@media (min-width: 992px) {
  .navbar-bitcoin .navbar-cta-buttons {
    border-top: none !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
}

/* ============================================
   Animated hamburger → X toggle
   ============================================
   Part of the component, not a surface tweak: the shared markup carries
   `navbar-toggler-x` and without these rules the collapsed nav shows three
   unstyled bars. Lived in the marketing site's stylesheet until it was
   shared. The portal's own navbar markup does not use the class, so it
   renders exactly as before.
   ============================================ */
.navbar-toggler.navbar-toggler-x {
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.5rem 0.65rem;
  width: 44px;
  height: 38px;
  position: relative;
  background: transparent;
}
.navbar-toggler.navbar-toggler-x:focus {
  box-shadow: 0 0 0 0.2rem rgba(232, 181, 60, 0.35);
  outline: none;
}
.navbar-toggler.navbar-toggler-x .bar {
  display: block;
  position: absolute;
  left: 50%;
  width: 22px;
  height: 2px;
  margin-left: -11px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}
.navbar-toggler.navbar-toggler-x .bar-top { top: 12px; }
.navbar-toggler.navbar-toggler-x .bar-mid { top: 18px; }
.navbar-toggler.navbar-toggler-x .bar-bot { top: 24px; }

/* Open state: collapse top + bottom bars to the middle and rotate into an X.
 * Middle bar fades out. */
.navbar-toggler.navbar-toggler-x:not(.collapsed) .bar-top {
  top: 18px;
  transform: rotate(45deg);
}
.navbar-toggler.navbar-toggler-x:not(.collapsed) .bar-mid {
  opacity: 0;
}
.navbar-toggler.navbar-toggler-x:not(.collapsed) .bar-bot {
  top: 18px;
  transform: rotate(-45deg);
}

/* Public navigation: shared by the home page, site and developer docs.
   Keep every destination in the shared partial; presentation belongs here. */
.navbar-bitcoin.navbar-public {
  background: rgba(10,10,10,0.97);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.navbar-public > .container-fluid {
  max-width: 1440px;
  min-height: 80px;
  padding: 16px 32px;
  gap: 24px;
}
.navbar-public .navbar-brand { margin-right: 0; }
.navbar-public .navbar-brand .navbar-logo { height: 27px; }
.navbar-public .nav-link,
.navbar-public .dropdown-menu,
.navbar-public .btn-navbar {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
}
.navbar-public .nav-link {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  white-space: nowrap;
}
.navbar-public .nav-link > .bi { display: none; }
/* Talk to us opens the inquiry form (owner, 2026-11-25). A quiet chip with a
   hairline, never gold: Start free stays the bar's one primary action. */
@media (min-width: 992px) {
  .navbar-public .nav-link.nav-link-talk {
    padding-block: 8px;
    border: 1px solid rgba(255,255,255,0.16);
  }
  .navbar-public .nav-link.nav-link-talk:hover { border-color: rgba(255,255,255,0.3); }
}
.navbar-public .nav-link.nav-lang-toggle > .bi { display: inline-block; }
.navbar-public .dropdown-menu.nav-lang-menu { min-width: 168px; }
.navbar-public .dropdown-toggle::after {
  margin-left: 7px;
  vertical-align: 0.16em;
  opacity: 0.5;
}
.navbar-public .dropdown-menu {
  min-width: 248px;
  padding: 8px;
  margin-top: 10px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}
.navbar-public .dropdown-item {
  padding: 11px 12px;
  border-radius: 6px;
  color: var(--text);
  font-weight: 400;
}
.navbar-public .dropdown-item i { color: var(--bitcoin-orange); }
.navbar-public .dropdown-divider { margin: 6px 12px; }
.navbar-public .btn-navbar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 17px;
  border-radius: 6px;
  white-space: nowrap;
}
.navbar-public .btn-navbar-outline {
  color: var(--text);
  border-color: rgba(255,255,255,0.16);
}
.navbar-public .btn-navbar-outline:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.3);
}
.navbar-public .btn-navbar-primary {
  background: var(--bitcoin-orange);
  border-color: var(--bitcoin-orange);
  color: var(--ink);
}
.navbar-public .btn-navbar-primary:hover,
.navbar-public .btn-navbar-primary:focus {
  background: #f0c14d;
  border-color: #f0c14d;
  color: var(--ink);
}
.navbar-public .btn-navbar-outline > .bi { display: none; }
.navbar-public a:focus-visible,
.navbar-public button:focus-visible {
  outline: 2px solid var(--bitcoin-orange);
  outline-offset: 3px;
  box-shadow: none;
}
/* Sign In and Start Free are one pair, the same width: as wide as whichever
   label is longer in this language. The grid's two 1fr columns do that (the
   first column is the language switch); its gap spaces the three instead of
   margins, which would come out of the button beside them. On phones the
   buttons are already full width, stacked. */
@media (min-width: 992px) {
  .navbar-public .navbar-cta-buttons {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    column-gap: 8px;
    align-items: center;
  }
  .navbar-public .navbar-cta-buttons .btn-navbar { width: 100%; }
}
/* Room between the links (owner, 2026-11-21: "give more space between the
   navbar items"). The gap is the list's, not the links' padding, so the
   chip a link lights on hover and on its own page stays its size. There are
   seven links (Products, Who it's for, Resources, Developers, Pricing,
   Charts, Talk to us), and the gap narrows with the window in three steps.
   The Spanish and Portuguese bars are the widest ("Desarrolladores",
   "Gráficos", two buttons as wide as "Empieza gratis"; the language menu is
   a globe and two letters in every language), and each step leaves room for
   a desktop scrollbar, which the media query counts and the bar does not
   get. The first thing to go is the arrow in the sign-up button, which takes
   its width twice (the pair is one width). At these widths Bootstrap pads a
   link from --bs-navbar-nav-link-padding-x, ahead of any .nav-link padding
   here. */
@media (min-width: 992px) {
  .navbar-bitcoin.navbar-public { --bs-navbar-nav-link-padding-x: 10px; }
  .navbar-public .navbar-collapse > .navbar-nav.me-auto { column-gap: 16px; }
}
@media (min-width: 992px) and (max-width: 1359.98px) {
  .navbar-public .btn-navbar-primary > .bi { display: none; }
  .navbar-public > .container-fluid { padding-inline: 20px; }
  .navbar-public .navbar-collapse > .navbar-nav.me-auto { column-gap: 6px; }
}
@media (min-width: 992px) and (max-width: 1259.98px) {
  .navbar-bitcoin.navbar-public { --bs-navbar-nav-link-padding-x: 8px; }
  .navbar-public > .container-fluid { padding-inline: 16px; gap: 14px; }
  .navbar-public .navbar-collapse > .navbar-nav.me-auto { column-gap: 4px; }
  .navbar-public .nav-link,
  .navbar-public .btn-navbar { font-size: 13px; }
  .navbar-public .dropdown-toggle::after { margin-left: 4px; }
  .navbar-public .btn-navbar { padding-inline: 10px; }
  .navbar-public .navbar-brand .navbar-logo { height: 24px; width: auto; }
}
@media (min-width: 992px) and (max-width: 1099.98px) {
  .navbar-bitcoin.navbar-public { --bs-navbar-nav-link-padding-x: 6px; }
  .navbar-public > .container-fluid { padding-inline: 12px; gap: 10px; }
  .navbar-public .navbar-collapse > .navbar-nav.me-auto { column-gap: 2px; }
  .navbar-public .nav-link,
  .navbar-public .btn-navbar { font-size: 12px; }
  .navbar-public .btn-navbar { padding-inline: 8px; }
  .navbar-public .navbar-cta-buttons { column-gap: 6px; }
  .navbar-public .navbar-brand .navbar-logo { height: 21px; width: auto; }
}
@media (max-width: 991.98px) {
  .navbar-public > .container-fluid { min-height: 72px; padding: 14px 20px; gap: 0; }
  .navbar-public .navbar-collapse {
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #454545 var(--ink);
  }
  .navbar-public .navbar-collapse > .navbar-nav:first-child { padding-top: 16px; }
  .navbar-public .nav-link { padding: 13px 12px; font-size: 16px; }
  .navbar-public .dropdown-menu { margin: 4px 0 8px; box-shadow: none; min-width: 0; }
  .navbar-public .dropdown-item { white-space: normal; }
  .navbar-public .navbar-cta-buttons { padding-bottom: 8px; }
  .navbar-public .navbar-cta-buttons .btn-navbar { font-size: 14px; min-height: 44px; }
  /* In the stacked menu the language switch is a row of its own, centred
     like the buttons under it, its languages listed beneath it. */
  .navbar-public .navbar-cta-buttons .nav-lang { width: 100%; text-align: center; }
  .navbar-public .navbar-cta-buttons .nav-lang-toggle { justify-content: center; }
  .navbar-public .dropdown-menu.nav-lang-menu { min-width: 0; }
  .navbar-public .navbar-toggler { width: 44px; height: 44px; border-radius: var(--radius-md); }
  .navbar-public .navbar-toggler-x .bar { margin-top: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  .navbar-public *, .navbar-public *::after { transition: none !important; }
}
