.zf-global-header {
  --header-spot-x: 82%;
  --header-spot-y: 50%;
  position: sticky;
  top: 10px;
  z-index: 100;
  width: calc(100% - 28px);
  max-width: 1180px;
  margin: 10px auto 0;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 24px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .12);
  transition: background-color .3s ease, backdrop-filter .3s ease, box-shadow .3s ease;
  isolation: isolate;
}

.zf-global-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(280px circle at var(--header-spot-x) var(--header-spot-y), rgba(59, 130, 246, .52) 0%, rgba(59, 130, 246, .22) 34%, transparent 72%);
  transition: opacity .25s ease;
}

.zf-global-header::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 2;
  border: 1px solid rgba(59, 130, 246, .9);
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 24px rgba(59, 130, 246, .22);
  transition: opacity .25s ease;
}

.zf-global-header:hover::before,
.zf-global-header:hover::after,
.zf-global-header.is-header-glowing::before,
.zf-global-header.is-header-glowing::after {
  opacity: 1;
}

.zf-global-header:hover,
.zf-global-header.is-header-glowing {
  border-color: rgba(59, 130, 246, .9) !important;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .26), 0 0 36px rgba(59, 130, 246, .34) !important;
}

/* Header download: one smooth orbiting line, white in night mode and blue in light mode. */
/* Reusable blue action treatment: the same continuous line used in the header. */
.animated-border-btn {
  --download-orbit-color: #FFFFFF;
  isolation: isolate;
  border: 0 !important;
  overflow: hidden;
}

.animated-border-btn::before {
  inset: -3px;
  background: conic-gradient(
    from 0deg,
    transparent 0deg 242deg,
    rgba(255, 255, 255, 0) 243deg,
    var(--download-orbit-color) 266deg 338deg,
    rgba(255, 255, 255, 0) 359deg 360deg
  ) !important;
  animation: zf-download-orbit 2.8s linear infinite !important;
}

.animated-border-btn::after {
  inset: 2px;
  background: oklch(var(--p)) !important;
}

/* Header download: translucent glass surface with a deliberately thin orbit. */
#site-header .animated-border-btn {
  background: rgba(59, 130, 246, .16) !important;
  border: 1px solid rgba(255, 255, 255, .22) !important;
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .12);
}

#site-header .animated-border-btn::before {
  inset: -1px;
  padding: 0;
  -webkit-mask: none;
  mask: none;
}

#site-header .animated-border-btn::after {
  inset: 1px;
  background: rgba(10, 16, 32, .92) !important;
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}

[data-theme="emerald"] #site-header .animated-border-btn::after {
  background: rgba(17, 35, 68, .88) !important;
}

[data-theme="emerald"] .animated-border-btn {
  --download-orbit-color: #3B82F6;
}

/* All visible action buttons share the header's glass surface and thin orbit. */
.btn:not(.btn-ghost) {
  --download-orbit-color: #FFFFFF;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .22) !important;
  background: rgba(59, 130, 246, .16) !important;
  color: #FFFFFF !important;
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.btn:not(.btn-ghost)::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -2;
  pointer-events: none;
  border-radius: inherit;
  background: conic-gradient(
    from 0deg,
    transparent 0deg 242deg,
    rgba(255, 255, 255, 0) 243deg,
    var(--download-orbit-color) 266deg 338deg,
    rgba(255, 255, 255, 0) 359deg 360deg
  );
  animation: zf-download-orbit 2.8s linear infinite;
}

.btn:not(.btn-ghost)::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  background: rgba(10, 16, 32, .92) !important;
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}

[data-theme="emerald"] .btn:not(.btn-ghost) {
  --download-orbit-color: #3B82F6;
}

[data-theme="emerald"] .btn:not(.btn-ghost)::after {
  background: rgba(17, 35, 68, .88) !important;
}

/* FAQ glow is scoped to one question card at a time. */
:is(.faq-section, .faq-glow-content) .collapse {
  --faq-spot-x: 72%;
  --faq-spot-y: 50%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

:is(.faq-section, .faq-glow-content) .collapse::before,
:is(.faq-section, .faq-glow-content) .collapse::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity .25s ease;
}

:is(.faq-section, .faq-glow-content) .collapse::before {
  inset: 0;
  z-index: 0;
  background: radial-gradient(260px circle at var(--faq-spot-x) var(--faq-spot-y), rgba(59, 130, 246, .52), rgba(59, 130, 246, .18) 38%, transparent 72%);
}

:is(.faq-section, .faq-glow-content) .collapse::after {
  inset: -1px;
  z-index: 1;
  border: 1px solid rgba(59, 130, 246, .9);
  box-shadow: inset 0 0 24px rgba(59, 130, 246, .20), 0 0 26px rgba(59, 130, 246, .22);
}

:is(.faq-section, .faq-glow-content) .collapse:hover,
:is(.faq-section, .faq-glow-content) .collapse:focus-within,
:is(.faq-section, .faq-glow-content) .collapse.is-faq-glowing {
  transform: translateY(-2px);
  outline: 1px solid rgba(59, 130, 246, .96);
  outline-offset: -1px;
  background-color: rgba(59, 130, 246, .14) !important;
  border-color: rgba(59, 130, 246, .9) !important;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .22), 0 0 34px rgba(59, 130, 246, .52), inset 0 0 28px rgba(59, 130, 246, .16) !important;
}

:is(.faq-section, .faq-glow-content) .collapse:hover::before,
:is(.faq-section, .faq-glow-content) .collapse:hover::after,
:is(.faq-section, .faq-glow-content) .collapse:focus-within::before,
:is(.faq-section, .faq-glow-content) .collapse:focus-within::after,
:is(.faq-section, .faq-glow-content) .collapse.is-faq-glowing::before,
:is(.faq-section, .faq-glow-content) .collapse.is-faq-glowing::after {
  opacity: 1;
}

.animated-border-btn,
.animated-border-btn:hover,
.animated-border-btn:focus-visible {
  color: #FFFFFF !important;
}

.zf-blue-action,
.zf-blue-action:hover,
.zf-blue-action:focus-visible {
  background: #3B82F6 !important;
  color: #FFFFFF !important;
}

.zf-blue-action::after {
  background: #3B82F6 !important;
}

@keyframes zf-download-orbit {
  to { transform: rotate(360deg); }
}

.site-header.zf-global-header {
  background: rgba(11, 16, 32, .94);
}

.navbar.zf-global-header {
  background: oklch(var(--b1) / .94);
}

.zf-global-header.is-scrolled {
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .26);
}

.site-header.zf-global-header.is-scrolled {
  background: rgba(11, 16, 32, .60);
}

.navbar.zf-global-header.is-scrolled {
  background: oklch(var(--b1) / .60);
}

.site-header.zf-global-header .header-inner {
  min-height: 68px;
}

@media (max-width: 767px) {
  .zf-global-header {
    top: 8px;
    width: calc(100% - 16px);
    margin-top: 8px;
    border-radius: 20px;
  }
  .site-header.zf-global-header .header-inner > .button {
    display: inline-flex;
    min-height: 36px;
    padding-inline: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zf-global-header,
  .zf-global-header::before,
  .zf-global-header::after { transition: none; }
}
