/* ============================================================================
   The Reflux ribbon: one header for every page on reflux.sh.
   Loaded on the product-led pages (with reflux.css) and on the older pages
   (with landing-cursor.css). It only uses tokens both sheets define.
   Modelled on chatbase.co: a 60px bar, menu buttons that open one shared
   full-width panel with icon tiles, a hover intent so the pointer can travel
   into the panel, and a full-screen sheet with accordions on phones.
   ============================================================================ */

:root {
  --header-height: 60px;
  --rb-width: 1240px;
  --rb-gutter: 24px;
}

/* Cross-document view transitions: the page body cross-fades on navigation
   and the ribbon stays put, so moving between pages feels like one app. */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
}
::view-transition-old(rb-header),
::view-transition-new(rb-header) {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

.rb {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  view-transition-name: rb-header;
  font-family: var(--font-sans, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif);
}
.rb *,
.rb *::before,
.rb *::after {
  box-sizing: border-box;
}
.rb-inner {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  width: min(var(--rb-width), calc(100% - var(--rb-gutter) * 2));
  height: 100%;
  margin: 0 auto;
}
.rb-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  color: var(--fg);
  font-weight: 750;
  letter-spacing: 0;
  text-decoration: none;
}
.rb-brand img,
.rb-brand .reflux-logo-mark {
  width: 28px;
  height: 32px;
  object-fit: contain;
}
:root[data-theme="dark"] .rb-brand img {
  filter: invert(1);
}
.rb-brand span {
  font-size: 1.01rem;
}

/* Centre nav */
.rb-nav {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 2px;
  transform: translate(-50%, -50%);
}
.rb-trigger,
.rb-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 8px 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--duration, 140ms) var(--ease, ease),
    color var(--duration, 140ms) var(--ease, ease);
}
.rb-trigger:hover,
.rb-link:hover,
.rb-trigger[aria-expanded="true"] {
  background: var(--card-2);
}
.rb-trigger svg {
  width: 10px;
  height: 10px;
  opacity: 0.6;
  transition: transform 160ms var(--ease, ease);
}
.rb-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* Right side */
.rb-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.rb-signin {
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--fg);
  font-size: 0.9rem;
  text-decoration: none;
  transition: background var(--duration, 140ms) var(--ease, ease);
}
.rb-signin:hover {
  background: var(--card-2);
}
.rb-cta {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.45em 0.95em 0.47em;
  border: 1px solid var(--button);
  border-radius: 999px;
  background: var(--button);
  color: var(--button-text);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition:
    background var(--duration, 140ms) var(--ease, ease),
    transform var(--duration, 140ms) var(--ease, ease);
}
.rb-cta:hover {
  background: var(--button-hover);
  border-color: var(--button-hover);
  transform: translateY(-1px);
}
.rb-burger {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  margin-left: 4px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--card);
  cursor: pointer;
}
.rb-burger span {
  position: absolute;
  left: 12px;
  width: 14px;
  height: 1.5px;
  background: var(--fg);
  transition: transform 180ms var(--ease, ease), top 180ms var(--ease, ease);
}
.rb-burger span:first-child {
  top: 15px;
}
.rb-burger span:last-child {
  top: 22px;
}
.rb-burger[aria-expanded="true"] span:first-child {
  top: 18.5px;
  transform: rotate(45deg);
}
.rb-burger[aria-expanded="true"] span:last-child {
  top: 18.5px;
  transform: rotate(-45deg);
}

/* The shared panel. Its top padding is the bridge the pointer crosses. */
.rb-panel {
  position: absolute;
  inset: 100% 0 auto 0;
  padding-top: 10px;
}
.rb-panel[hidden] {
  display: none;
}
.rb-panel-inner {
  width: min(var(--rb-width), calc(100% - var(--rb-gutter) * 2));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  transform-origin: top center;
  transition: height 200ms var(--ease, ease);
}
:root[data-theme="dark"] .rb-panel-inner {
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.rb-panel[data-state="open"] .rb-panel-inner {
  animation: rb-in 150ms var(--ease, ease) both;
}
.rb-panel[data-state="closing"] .rb-panel-inner {
  animation: rb-out 120ms var(--ease, ease) both;
}
@keyframes rb-in {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes rb-out {
  to {
    opacity: 0;
    transform: scale(0.98) translateY(-3px);
  }
}
.rb-menu {
  display: none;
}
.rb-menu[data-active] {
  display: block;
  animation: rb-fade 160ms var(--ease, ease) both;
}
@keyframes rb-fade {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.rb-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
}
.rb-col {
  padding: 18px 18px 14px;
}
.rb-col + .rb-col {
  border-left: 1px solid var(--border);
  background: var(--card);
}
.rb-label {
  margin: 0 0 8px 10px;
  color: var(--fg-mid);
  font-family: var(--font-mono, "SFMono-Regular", Menlo, Consolas, monospace);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.rb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
}
.rb-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  color: var(--fg);
  text-decoration: none;
  transition: background var(--duration, 140ms) var(--ease, ease);
}
.rb-item:hover,
.rb-item:focus-visible {
  background: var(--card-2);
  outline: none;
}
.rb-item b {
  display: block;
  font-size: 0.93rem;
  font-weight: 500;
  line-height: 1.3;
}
.rb-item small {
  display: block;
  margin-top: 2px;
  color: var(--fg-mid);
  font-size: 0.8rem;
  line-height: 1.35;
}
.rb-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--accent);
}
.rb-col + .rb-col .rb-icon {
  background: var(--bg);
}
.rb-icon svg {
  width: 18px;
  height: 18px;
}
.rb-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.rb-foot .rb-item {
  flex: 1;
  padding: 8px 10px;
}
.rb-foot .rb-item:hover {
  background: var(--card-2);
}
.rb-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--fg);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.rb-more:hover {
  background: var(--card-2);
}
.rb-more svg {
  width: 12px;
  height: 12px;
}

/* Mobile sheet */
.rb-sheet {
  position: fixed;
  inset: var(--header-height) 0 0 0;
  z-index: 59;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: var(--bg);
  animation: rb-fade 160ms var(--ease, ease) both;
}
.rb-sheet[hidden] {
  display: none;
}
.rb-rows {
  flex: 1;
}
.rb-row {
  border-bottom: 1px solid var(--border);
}
.rb-row > a,
.rb-row > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 20px var(--rb-gutter);
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 1.05rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.rb-row > button svg {
  width: 12px;
  height: 12px;
  opacity: 0.6;
  transition: transform 160ms var(--ease, ease);
}
.rb-row > button[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
.rb-row-body {
  padding: 0 calc(var(--rb-gutter) - 10px) 12px;
}
.rb-row-body[hidden] {
  display: none;
}
.rb-row-body .rb-label {
  margin-top: 8px;
}
.rb-row-body .rb-grid {
  grid-template-columns: 1fr;
}
.rb-sheet-actions {
  display: grid;
  gap: 8px;
  padding: 16px var(--rb-gutter) 28px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.rb-sheet-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--fg);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
}
.rb-sheet-actions a.rb-sheet-primary {
  border-color: var(--button);
  background: var(--button);
  color: var(--button-text);
}
html.rb-locked,
html.rb-locked body {
  overflow: hidden;
}

/* A stripped ribbon for the sign-up page: logo and one link, like an auth page. */
.rb-minimal .rb-nav,
.rb-minimal .rb-cta,
.rb-minimal .rb-burger,
.rb-minimal .rb-panel {
  display: none;
}

@media (max-width: 900px) {
  :root {
    --rb-gutter: 16px;
  }
  .rb-nav,
  .rb-panel,
  .rb-signin {
    display: none;
  }
  .rb-burger {
    display: block;
  }
}
@media (max-width: 640px) {
  .rb-cols {
    grid-template-columns: 1fr;
  }
}
