/* ──────────────────────────────────────────────────────────────────────
   Gibrid.AI — shared brand wordmark
   Used by landing, blog, legal, status and admin pages.

   Visual idea:
     GIBRID.AI  in elegant all-caps with wide tracking.
     The wordmark is built from three weights so the eye gets a tiny
     rhythm — bold "GIBRID", a single sapphire "." accent, lighter "AI".
   ────────────────────────────────────────────────────────────────────── */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--fg, #ececee);
  user-select: none;
  -webkit-user-select: none;
}

/* ── Brand mark — the canonical Gibrid.AI app-icon.
   We use the full app-icon SVG (rounded black tile + tri-radial knot
   baked into one asset) instead of mark-only + a CSS tile. One source
   of truth for the logo across every surface.                           */
.brand-mark {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 9px;                   /* clips antialias edge cleanly */
  background-image: url('/static/brand/gibrid/gibrid-app-icon-1024.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 1;
  flex-shrink: 0;
  -webkit-font-smoothing: antialiased;
}

/* Legacy RGB-dot trio retired — the SVG mark already carries the colour
   triplet. We keep ::after as a no-op so old "loading" rules still match. */
.brand-mark::after { content: none; }

/* ── Loading variant — replaces the static dots with three animated bouncers
   that wave in sequence (red → blue → green). Used by the workspace splash
   screen ("Loading workspace · GIBRID.AI") and any future progress states.  */
.brand-mark.loading {
  background-image: none;     /* hide static tri-radial mark in loading state */
}
.brand-mark.loading::after { display: none; }     /* legacy no-op, kept for safety */
.brand-mark .loader-dots {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex; gap: 4px;
  pointer-events: none;
}
.brand-mark .loader-dot {
  width: 3px; height: 3px; border-radius: 50%;
  display: inline-block;
  animation: gibrid-dot-wave 1.4s cubic-bezier(.4, 0, .2, 1) infinite;
}
.brand-mark .loader-dot.r { background: #ef4444; animation-delay: 0s;    }
.brand-mark .loader-dot.b { background: #60a5fa; animation-delay: 0.16s; }
.brand-mark .loader-dot.g { background: #10b981; animation-delay: 0.32s; }

/* Larger marks scale the dot/gap up so the wave stays readable */
.brand-mark.md .loader-dots { gap: 5px; }
.brand-mark.md .loader-dot  { width: 3.5px; height: 3.5px; }
.brand-mark.lg .loader-dots { gap: 6px; }
.brand-mark.lg .loader-dot  { width: 4px;   height: 4px; }
.brand-mark.xl .loader-dots { gap: 8px; }
.brand-mark.xl .loader-dot  { width: 5px;   height: 5px; }

@keyframes gibrid-dot-wave {
  0%, 60%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.85;
    filter: drop-shadow(0 0 0 transparent);
  }
  30% {
    transform: translateY(-4px) scale(1.35);
    opacity: 1;
    filter: drop-shadow(0 0 4px currentColor);
  }
}

/* ── Loader brand block layout (used by chat-workspace splash) ── */
.loader-brand {
  display: flex; align-items: center; gap: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .brand-mark .loader-dot { animation: none; }
}

/* Larger sizes — same app-icon, only width/height grow. The SVG carries
   the rounded tile + the inner mark in one asset, so we just scale. */
.brand-mark.md  { width: 44px; height: 44px; border-radius: 12px; }
.brand-mark.lg  { width: 56px; height: 56px; border-radius: 14px; }
.brand-mark.xl  { width: 72px; height: 72px; border-radius: 18px; }

/* ── Wordmark — GIBRID·AI in uppercase, three-weight rhythm ─────────── */
.brand-wordmark {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.14em;          /* generous tracking → premium feel */
  font-size: 14.5px;
  line-height: 1;
  font-feature-settings: "ss01", "cv11";
  white-space: nowrap;
  color: var(--fg, #ececee);
}

.brand-wordmark > .gw-main {
  font-weight: 700;                /* GIBRID — bold but not heavy */
}

.brand-wordmark > .gw-dot {
  color: var(--accent, #60a5fa);   /* the only colour beat in the wordmark */
  font-weight: 800;
  /* The dot already has built-in side-bearings in Inter — pull it in by a
     hair so it sits visually attached to the next letter without crashing. */
  margin: 0 -0.06em 0 -0.02em;
  letter-spacing: 0;
}

.brand-wordmark > .gw-ai {
  font-weight: 500;                /* lighter AI for visual contrast */
  opacity: 0.92;
}

/* ── Larger sizes (footer / standalone) ─────────────────────────────── */
.brand-wordmark.lg { font-size: 17px; letter-spacing: 0.16em; }
.brand-wordmark.xl { font-size: 22px; letter-spacing: 0.18em; }

/* ── On hover: mark border brightens, wordmark dot warms up ────────── */
.brand:hover .brand-mark {
  border-color: rgba(255, 255, 255, 0.18);
}
.brand:hover .brand-wordmark > .gw-dot {
  color: #93c5fd;
}

/* ── Light theme support (rare for Gibrid.AI but the marks behave) ── */
@media (prefers-color-scheme: light) {
  .brand-mark {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.55),
      inset 0 -1px 0 rgba(0, 0, 0, 0.10),
      0 4px 14px -4px rgba(96, 165, 250, 0.30);
  }
}

/* ── Reduce motion — already minimal, but enforce no transition jumps  */
@media (prefers-reduced-motion: reduce) {
  .brand, .brand-mark, .brand-wordmark, .brand-wordmark > * {
    transition: none !important;
    animation: none !important;
  }
}

/* ─────────────────────────────────────────────────────────────────────
   Auth chip + dropdown widgets — shared across landing and every sub-page.
   Same look on /partners /privacy /persona /blog as on /. Depends only on
   the CSS variables (--bg, --fg, --fg-muted, --border…) that every gibrid
   page already defines; safe to load standalone.                          */
.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--fg, #ececee); color: var(--bg, #0a0a0f);
  padding: 9px 18px; border-radius: 10px;
  font: inherit; font-weight: 600; font-size: 14px;
  border: 0; cursor: pointer; text-decoration: none;
  transition: transform .15s ease, background .15s ease;
}
.nav-cta:hover { background: #fff; transform: translateY(-1px); }

.nav-dd { position: relative; display: inline-flex; }
.nav-dd-btn,
.nav-link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--fg-muted, #a1a1a9);
  font-size: 14px; font-weight: 500;
  background: transparent; border: 0; padding: 6px 4px;
  font-family: inherit; cursor: pointer;
  letter-spacing: -0.005em;
  text-decoration: none;
  transition: color .15s ease;
}
.nav-link:hover,
.nav-dd-btn:hover,
.nav-dd[data-open] .nav-dd-btn { color: var(--fg, #ececee); }
.nav-dd-menu {
  position: absolute;
  top: calc(100% + 10px); left: 0;
  min-width: 280px;
  background: rgba(15, 15, 22, 0.96);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--border-strong, rgba(255,255,255,0.14));
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 18px 50px -16px rgba(0, 0, 0, 0.65);
  z-index: 200;
  opacity: 0; transform: translateY(-4px) scale(.985);
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}
.nav-dd[data-open] .nav-dd-menu { opacity: 1; transform: none; pointer-events: auto; }
.nav-dd-menu > a,
.nav-dd-menu > [role="menuitem"] {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 9px;
  color: var(--fg, #ececee);
  text-decoration: none; font-size: 13.5px; font-weight: 500;
  transition: background .12s ease;
}
.nav-dd-menu > a:hover { background: var(--bg-elev-2, rgba(255,255,255,0.04)); }
.nav-dd-menu > a:hover .nav-dd-ic { color: var(--fg, #ececee); border-color: var(--border-strong, rgba(255,255,255,0.14)); }
.nav-dd-menu > a:hover .material-symbols-rounded { color: var(--fg, #ececee); }
.nav-dd-menu > a > .material-symbols-rounded {
  width: 20px; font-size: 20px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--fg-muted, #a1a1a9);
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' -25, 'opsz' 24;
  transition: color .12s ease;
}
.nav-dd-ic {
  width: 30px; height: 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border, rgba(255,255,255,0.10));
  color: var(--fg-muted, #a1a1a9);
  flex-shrink: 0;
  transition: color .12s ease, border-color .12s ease;
}
.nav-dd-ic .material-symbols-rounded {
  font-size: 18px; line-height: 1;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' -25, 'opsz' 24;
}
.nav-dd-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nav-dd-t { font-size: 13.5px; font-weight: 600; color: var(--fg, #ececee); letter-spacing: -.005em; }
.nav-dd-s { font-size: 11px; color: var(--fg-dim, #71717a); letter-spacing: .005em; }
.nav-dd-sep { height: 1px; background: var(--border, rgba(255,255,255,0.10)); margin: 6px 4px; }
.nav-dd-danger { color: #fca5a5 !important; }
.nav-dd-danger:hover { background: rgba(239, 68, 68, 0.10) !important; }

.nav-profile-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-elev-2, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(255,255,255,0.10));
  padding: 4px 10px 4px 4px;
  border-radius: 99px;
  color: var(--fg, #ececee); font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.nav-profile-btn:hover,
.nav-profile[data-open] .nav-profile-btn {
  border-color: var(--border-strong, rgba(255,255,255,0.14));
  background: var(--bg-elev-1, rgba(255,255,255,0.02));
}
.nav-profile-av {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; display: block; flex-shrink: 0;
  background: var(--accent, #60a5fa);
}
.nav-profile-av-init {
  display: inline-flex; align-items: center; justify-content: center;
  color: #0a0a0f; font-size: 13px; font-weight: 700;
}
.nav-profile-av-lg { width: 40px; height: 40px; font-size: 17px; }
.nav-profile-name {
  max-width: 120px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 480px) { .nav-profile-name { display: none; } }
.nav-profile-menu { right: 0; left: auto; min-width: 240px; }
.nav-profile-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.10));
  margin-bottom: 4px;
}
.nav-profile-meta { min-width: 0; flex: 1; }
.nav-profile-mname { font-size: 14px; font-weight: 700; color: var(--fg, #ececee); letter-spacing: -.01em; }
.nav-profile-muser { font-size: 11.5px; color: var(--fg-dim, #71717a); margin-top: 1px; }

/* ─────────────────────────────────────────────────────────────────────
   Shared lang-switch widget. Lives in every gibrid_*.html page so the
   user can toggle EN/RU from any sub-landing (partners, legal, blog…).
   Click handler sets the cookie AND adds ?lang= to the URL so the
   server-side render picks it up immediately.                         */
.lang-switch {
  display: inline-flex; padding: 3px;
  background: var(--bg-elev-2, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(255,255,255,0.10));
  border-radius: 999px;
}
.lang-btn {
  border: 0; background: transparent;
  padding: 6px 12px; border-radius: 999px;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--fg-muted, #a1a1a9); cursor: pointer;
  letter-spacing: 0.04em;
  transition: color .15s ease, background .15s ease;
}
.lang-btn.active { background: var(--bg, #0a0a0f); color: var(--fg, #ececee); }
.lang-btn:hover:not(.active) { color: var(--fg, #ececee); }
@media (max-width: 480px) {
  .lang-switch { padding: 2px; }
  .lang-btn { font-size: 11.5px; padding: 5px 10px; }
}
