/* ══════════════════════════════════════════════════════════════ */
/* Info-page topbar — shared by /docs, /downloads, etc.         */
/* Mirrors the landing-page topbar with fixed positioning.      */
/* ══════════════════════════════════════════════════════════════ */

/* ── Topbar variables ─────────────────────────────────────────── */
:root {
  --topbar-bg:          rgba(15, 24, 29, 0.6);
  --topbar-border:      rgba(255, 255, 255, 0.06);
  --topbar-glow-a:      rgba(47, 210, 255, 0.55);
  --topbar-glow-b:      rgba(196, 85, 255, 0.5);
  --topbar-bg-scrolled: rgba(15, 24, 29, 1);
  --topbar-shadow-color: rgba(4, 6, 12, 0.35);
  --brand-mark-glow:    rgba(52, 217, 161, 0.45);
  --topbar-muted:       #9aa2bd;
  --topbar-text:        #e5e9f5;
  --topbar-accent:      #34d9a1;
  --topbar-accent-2:    #2fd2ff;
  --topbar-btn-shadow:  rgba(52, 217, 161, 0.28);
  --topbar-btn-shadow-hover: rgba(52, 217, 161, 0.38);
  --topbar-btn-sheen:   rgba(255, 255, 255, 0.35);
  --topbar-ghost-border: rgba(255, 255, 255, 0.16);
  --topbar-ghost-border-hover: rgba(255, 255, 255, 0.3);
  --topbar-ghost-bg:    rgba(255, 255, 255, 0.02);
}

/* ── Bar ──────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  padding: 14px clamp(12px, 3vw, 35px);
}

/* ── Layout ───────────────────────────────────────────────────── */
.nav-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 2vw, 24px);
}

/* ── Brand (logo + wordmark) ──────────────────────────────────── */
.brand {
  display: inline-flex;
  align-items: center;
  gap: clamp(10px, 1.8vw, 18.5px);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover { text-decoration: none; }

.brand-mark {
  width: clamp(24px, 3.2vw, 33px);
  height: clamp(24px, 3.2vw, 33px);
  background: url("images/Pinako logo 256px.png") center / contain no-repeat;
  filter: brightness(0.9)
    drop-shadow(0 0 25px var(--brand-mark-glow))
    drop-shadow(0 0 16px var(--brand-mark-glow));
}

.brand-wordmark {
  --brand-wordmark-height: clamp(20px, 2.7vw, 28px);
  --brand-wordmark-width: calc(var(--brand-wordmark-height) * 4.9792531);
  position: relative;
  display: inline-flex;
  align-items: center;
  width: var(--brand-wordmark-width);
  height: var(--brand-wordmark-height);
}

.brand-wordmark .header-logo-svg {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 0 rgba(165, 44, 221, 0));
  transition: filter 1300ms ease;
}

.brand:hover .brand-wordmark .header-logo-svg {
  filter:
    drop-shadow(0 0 4px rgba(165, 44, 221, 0.9))
    drop-shadow(0 0 12px rgba(165, 44, 221, 0.8))
    drop-shadow(0 0 24px rgba(165, 44, 221, 0.65))
    drop-shadow(0 0 40px rgba(165, 44, 221, 0.45));
  transition-duration: 2600ms;
}

/* Streak line (visible after hover delay) */
.brand-wordmark::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 0.8px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%);
  z-index: 1;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(165, 44, 221, 0.22) 30%,
    rgba(165, 44, 221, 0.48) 50%,
    rgba(165, 44, 221, 0.22) 70%,
    transparent
  );
  transition: opacity 220ms ease;
}

/* Streak dot */
.brand-wordmark::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 38px;
  height: 3px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-115%, -50%);
  z-index: 1;
  border-radius: 999px;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(165, 44, 221, 0.82) 42%,
    rgba(165, 44, 221, 0) 78%
  );
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5))
    drop-shadow(0 0 10px rgba(165, 44, 221, 0.65));
}

.brand:hover .brand-wordmark::before {
  opacity: 1;
  transition-delay: 1600ms;
}

.brand:hover .brand-wordmark::after {
  animation: topbar-logo-streak 820ms cubic-bezier(0.45, 0, 0.95, 0.35) 1600ms 1;
}

/* ── Home-portal button ───────────────────────────────────────── */
.topbar .btn-home-portal {
  position: absolute;
  left: calc(clamp(24px, 3.2vw, 33px) + clamp(10px, 1.8vw, 18.5px) + clamp(20px, 2.7vw, 28px) * 4.9792531 + clamp(20px, 2.7vw, 28px) + 25px);
  top: calc(50% - 14px + 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(22px, 2.7vw, 28px);
  height: clamp(22px, 2.7vw, 28px);
  color: #1f8164;
  text-decoration: none;
  border-radius: 5px;
  overflow: visible;
  isolation: isolate;
  transition: color 0.22s ease;
}

.topbar .btn-home-portal svg {
  width: clamp(18px, 2.2vw, 23px);
  height: clamp(18px, 2.2vw, 23px);
  position: relative;
  z-index: 3;
  filter: drop-shadow(0 0 0 rgba(165, 44, 221, 0));
  transition: filter 0.34s ease;
}

.btn-home-portal::before,
.btn-home-portal::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  pointer-events: none;
  opacity: 0;
  border-radius: 50%;
  mix-blend-mode: screen;
  background: url("/images/btn-home-spiral-galaxy.svg?v=20260305-1") center / contain no-repeat;
  transform: translate(-50%, -50%) scale(0.34) rotate(0deg);
  will-change: transform, opacity, filter;
}

.btn-home-portal::before {
  width: 43px;
  height: 43px;
  z-index: 1;
  filter: blur(1.8px) drop-shadow(0 0 8px rgba(255, 255, 255, 0.4))
    drop-shadow(0 0 18px rgba(165, 44, 221, 0.64));
}

.btn-home-portal::after {
  width: 53px;
  height: 53px;
  z-index: 2;
  filter: blur(4.8px) drop-shadow(0 0 10px rgba(255, 255, 255, 0.28))
    drop-shadow(0 0 22px rgba(165, 44, 221, 0.56));
}

.btn-home-portal:hover {
  color: #12bd78;
  text-decoration: none;
}

.btn-home-portal:hover svg {
  filter:
    drop-shadow(0 0 3px rgba(165, 44, 221, 0.88))
    drop-shadow(0 0 10px rgba(165, 44, 221, 0.75))
    drop-shadow(0 0 20px rgba(165, 44, 221, 0.55));
}

.btn-home-portal:hover::before {
  animation: portal-galaxy-tail-a 3.6s cubic-bezier(0.22, 0.9, 0.33, 1) infinite;
}

.btn-home-portal:hover::after {
  animation: portal-galaxy-tail-b 3.6s cubic-bezier(0.25, 0.85, 0.35, 1) infinite;
}

/* ── Nav links ────────────────────────────────────────────────── */
.nav {
  display: flex;
  gap: clamp(10px, 2vw, 22px);
  align-items: center;
}

.nav-link {
  color: #6cb39b;
  font-weight: 300;
  font-size: clamp(0.8rem, 1.69vw, 1.1rem);
  white-space: nowrap;
  position: relative;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  text-decoration: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--topbar-accent), var(--topbar-accent-2));
  filter: blur(0.5px);
  opacity: 0;
  transform: scaleX(0.6);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: color-mix(in srgb, var(--topbar-accent), transparent 11%);
  text-decoration: none;
  text-shadow: 0 0 11px rgb(175, 2, 255), 0 0 39px rgb(175, 2, 255);
  -webkit-text-stroke: 1.5px black;
  paint-order: stroke fill;
}

.nav-link:hover::after,
.nav-link.active::after {
  opacity: 1;
  transform: scaleX(1);
}

/* ── Nav actions (right side) ─────────────────────────────────── */
.nav-actions {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 16px);
  flex-shrink: 0;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.topbar .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(4px, 0.6vw, 6px) clamp(10px, 1.5vw, 16px);
  border-radius: 999px;
  font-weight: 600;
  font-size: clamp(0.78rem, 1.46vw, 0.95rem);
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.3s ease;
  text-decoration: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.topbar .btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--topbar-accent) 0%, var(--topbar-accent-2) 100%);
  color: #05070d;
  box-shadow: 0 14px 30px var(--topbar-btn-shadow);
}

.topbar .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px var(--topbar-btn-shadow-hover);
  text-decoration: none;
}

.topbar .btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, var(--topbar-btn-sheen) 45%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
  opacity: 0.7;
  pointer-events: none;
}

.topbar .btn-primary:hover::after {
  transform: translateX(120%);
}

.topbar .btn-ghost {
  border: 1px solid var(--topbar-ghost-border);
  color: var(--topbar-text);
  background: var(--topbar-ghost-bg);
}

.topbar .btn-ghost:hover {
  border-color: var(--topbar-ghost-border-hover);
  transform: translateY(-1px);
  text-decoration: none;
}

/* ── Sign-in button (matches theme-toggle dark-mode style) ───── */
.nav-link.sign-in {
  border: 1px solid color-mix(in srgb, #a52cdd 50%, transparent);
  color: #a52cdd;
  font-weight: 500;
  padding: clamp(3px, 0.4vw, 4px) clamp(8px, 1.3vw, 14px);
  border-radius: 999px;
  font-size: clamp(0.75rem, 1.35vw, 0.88rem);
  transition: box-shadow 0.15s ease, color 0.15s ease, border-color 0.15s ease, text-shadow 0.15s ease;
}

.nav-link.sign-in::after {
  display: none;
}

.nav-link.sign-in:hover {
  border-color: #a52cdd;
  color: var(--topbar-accent);
  text-shadow: 0 0 8px rgba(165, 44, 221, 0.6), 0 0 16px rgba(165, 44, 221, 0.3);
  box-shadow:
    0 0 9px color-mix(in srgb, #a52cdd 60%, transparent),
    inset 0 0 8px color-mix(in srgb, #3dad9a 80%, transparent);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 740px) {
  .nav-wrap {
    flex-wrap: wrap;
    justify-content: space-between;
    row-gap: 10px;
  }

  .brand {
    order: 1;
  }

  .topbar .btn-home-portal {
    top: 4px;
  }

  .nav-actions {
    order: 3;
    margin-left: auto;
  }

  .nav {
    order: 4;
    width: 100%;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 2px;
    padding-top: 4px;
  }

  .nav-actions {
    gap: 10px;
  }
}

/* ── Animations ───────────────────────────────────────────────── */
@keyframes topbar-logo-streak {
  0% {
    opacity: 0;
    transform: translate(-115%, -50%) scale(1);
  }
  10% {
    opacity: 1;
  }
  82% {
    opacity: 1;
    transform: translate(calc(var(--brand-wordmark-width) + 18px), -50%) scale(1);
  }
  92% {
    opacity: 1;
    transform: translate(calc(var(--brand-wordmark-width) + 24px), -50%) scale(2.8);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--brand-wordmark-width) + 24px), -50%) scale(7);
  }
}

@keyframes portal-galaxy-tail-a {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-8deg) scale(0.32);
  }
  22% {
    opacity: 0.95;
  }
  68% {
    opacity: 0.88;
    transform: translate(-50%, -50%) rotate(156deg) scale(0.9);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(288deg) scale(1.18);
  }
}

@keyframes portal-galaxy-tail-b {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(36deg) scale(0.36);
  }
  20% {
    opacity: 0.82;
  }
  70% {
    opacity: 0.68;
    transform: translate(-50%, -50%) rotate(-128deg) scale(1.06);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-252deg) scale(1.34);
  }
}

/* ══════════════════════════════════════════════════════════════ */
/* Legacy site-header — used by user pages (portal, library)    */
/* ══════════════════════════════════════════════════════════════ */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  flex-shrink: 0;
  padding: 0 26px;
  background: #000000;
  width: 100%;
}

#site-header .header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #ffffff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  gap: 8px;
  position: relative;
}

#site-header .header-logo img {
  height: 20px;
  width: auto;
}

#site-header .header-logo .header-logo-svg {
  height: 20px;
  width: auto;
  display: block;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 0 rgba(165, 44, 221, 0));
  transition: filter 1300ms ease;
}

#site-header .header-logo:hover .header-logo-svg {
  filter:
    drop-shadow(0 0 4px rgba(165, 44, 221, 0.9))
    drop-shadow(0 0 12px rgba(165, 44, 221, 0.8))
    drop-shadow(0 0 24px rgba(165, 44, 221, 0.65))
    drop-shadow(0 0 40px rgba(165, 44, 221, 0.45));
  transition-duration: 2600ms;
}

#site-header .header-logo::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: calc(20px * 4.9850746);
  height: 0.8px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%);
  z-index: 1;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(165, 44, 221, 0.22) 30%,
    rgba(165, 44, 221, 0.48) 50%,
    rgba(165, 44, 221, 0.22) 70%,
    transparent
  );
  transition: opacity 220ms ease;
}

#site-header .header-logo::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 38px;
  height: 3px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-115%, -50%);
  z-index: 1;
  border-radius: 999px;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(165, 44, 221, 0.82) 42%,
    rgba(165, 44, 221, 0) 78%
  );
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5))
    drop-shadow(0 0 10px rgba(165, 44, 221, 0.65));
}

#site-header .header-logo:hover::before {
  opacity: 1;
  transition-delay: 1600ms;
}

#site-header .header-logo:hover::after {
  animation: header-logo-streak 820ms cubic-bezier(0.45, 0, 0.95, 0.35) 1600ms 1;
}

#site-header .btn-home-portal {
  position: absolute;
  left: calc(26px + 20px * 4.9850746 + 100px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: #09875d;
  text-decoration: none;
  border-radius: 5px;
  overflow: visible;
  isolation: isolate;
  transition: color 0.22s ease;
}

#site-header .btn-home-portal svg {
  width: 23px;
  height: 23px;
  position: relative;
  z-index: 3;
  filter: drop-shadow(0 0 0 rgba(165, 44, 221, 0));
  transition: filter 0.34s ease;
}

#site-header .btn-home-portal::before,
#site-header .btn-home-portal::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  pointer-events: none;
  opacity: 0;
  border-radius: 50%;
  mix-blend-mode: screen;
  background: url("/images/btn-home-spiral-galaxy.svg?v=20260305-1") center / contain no-repeat;
  transform: translate(-50%, -50%) scale(0.34) rotate(0deg);
  will-change: transform, opacity, filter;
}

#site-header .btn-home-portal::before {
  width: 43px;
  height: 43px;
  z-index: 1;
  filter: blur(1.8px) drop-shadow(0 0 8px rgba(255, 255, 255, 0.4))
    drop-shadow(0 0 18px rgba(165, 44, 221, 0.64));
}

#site-header .btn-home-portal::after {
  width: 53px;
  height: 53px;
  z-index: 2;
  filter: blur(4.8px) drop-shadow(0 0 10px rgba(255, 255, 255, 0.28))
    drop-shadow(0 0 22px rgba(165, 44, 221, 0.56));
}

#site-header .btn-home-portal:hover {
  color: #12bd78;
}

#site-header .btn-home-portal:hover svg {
  filter:
    drop-shadow(0 0 3px rgba(165, 44, 221, 0.88))
    drop-shadow(0 0 10px rgba(165, 44, 221, 0.75))
    drop-shadow(0 0 20px rgba(165, 44, 221, 0.55));
}

#site-header .btn-home-portal:hover::before {
  animation: portal-galaxy-tail-a 3.6s cubic-bezier(0.22, 0.9, 0.33, 1) infinite;
}

#site-header .btn-home-portal:hover::after {
  animation: portal-galaxy-tail-b 3.6s cubic-bezier(0.25, 0.85, 0.35, 1) infinite;
}

#site-header .header-auth-btn {
  background: transparent;
  border: 1px solid color-mix(in srgb, #a52cdd 50%, transparent);
  color: #a52cdd;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 12px;
  padding: 4px 14px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  outline: none;
  transition: box-shadow 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

#site-header .header-auth-btn:hover {
  border-color: #a52cdd;
  color: #ffffff;
  box-shadow:
    0 0 9px color-mix(in srgb, #a52cdd 60%, transparent),
    inset 0 0 8px color-mix(in srgb, #3dad9a 80%, transparent);
}

@keyframes header-logo-streak {
  0% {
    opacity: 0;
    transform: translate(-115%, -50%) scale(1);
  }
  10% {
    opacity: 1;
  }
  82% {
    opacity: 1;
    transform: translate(calc(20px * 4.9850746 + 18px), -50%) scale(1);
  }
  92% {
    opacity: 1;
    transform: translate(calc(20px * 4.9850746 + 24px), -50%) scale(2.8);
  }
  100% {
    opacity: 0;
    transform: translate(calc(20px * 4.9850746 + 24px), -50%) scale(7);
  }
}

@media (max-width: 1366px) and (orientation: landscape) {
  #site-header {
    padding: 0 18px;
  }
}

@media (max-width: 1180px) and (orientation: landscape) {
  #site-header {
    padding: 0 12px;
  }
}

/* ══════════════════════════════════════════════════════════════ */
/* Custom tooltips — universal across all pinako.pro pages      */
/* ══════════════════════════════════════════════════════════════ */
.custom-tooltip {
  position: fixed;
  z-index: 200000;
  padding: 2px 5px;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  border-radius: 4px;
  background: rgba(32, 32, 32, 0.96);
  color: #c4c4c4;
  border: 1px solid rgba(0, 0, 0, 0.45);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.custom-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}
