/**
 * Shared ivanadiaz.com floating pill header — canonical copy from index.html.
 * Pair with site-top-bar-mobile.css + site-top-bar.js on every page that uses .top-bar.
 */

@property --blob-x { syntax: '<percentage>'; inherits: true; initial-value: 50%; }
@property --blob-y { syntax: '<percentage>'; inherits: true; initial-value: 50%; }

.top-bar {
  position: sticky;
  top: 8px;
  z-index: 200;
  display: flex;
  justify-content: center;
  width: 100%;
  align-self: stretch;
  padding: 2px 24px 0;
}

.top-bar__pill {
  pointer-events: auto;
  width: 100%;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px 16px 24px;
  border-radius: var(--radius, 8px);
  background: transparent;
  border: 1px solid rgba(52, 58, 64, 0.14);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  --blob-x: 50%;
  --blob-y: 50%;
  transition:
    width 0.28s ease,
    max-width 0.28s ease,
    padding 0.22s ease,
    box-shadow 0.22s ease,
    background-color 0.22s ease,
    border-color 0.22s ease,
    --blob-x 0.3s ease-out,
    --blob-y 0.3s ease-out;
}

.top-bar__pill::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  background-image:
    linear-gradient(
      165deg,
      rgba(255, 255, 255, 0.42) 0%,
      rgba(255, 255, 255, 0.12) 55%,
      rgba(240, 245, 255, 0.08) 100%
    ),
    radial-gradient(
      circle at var(--blob-x, 50%) var(--blob-y, 50%),
      rgba(255, 255, 255, 0.85) 0%,
      rgba(170, 200, 255, 0.55) 14%,
      rgba(0, 102, 180, 0.32) 30%,
      rgba(0, 66, 136, 0.12) 48%,
      transparent 62%
    ),
    radial-gradient(
      circle at 78% 22%,
      rgba(11, 195, 65, 0.2) 0%,
      transparent 52%
    ),
    radial-gradient(
      circle at 18% 78%,
      rgba(100, 160, 255, 0.38) 0%,
      transparent 55%
    ),
    radial-gradient(
      circle at 52% 58%,
      rgba(0, 66, 136, 0.22) 0%,
      transparent 58%
    );
  background-size: 100% 100%, 100% 100%, 175% 175%, 165% 165%, 190% 190%;
  background-position: center, center, 0% 0%, 100% 100%, 50% 50%;
  background-repeat: no-repeat;
}

.top-bar__pill:hover::before {
  opacity: 1;
  animation: meshDrift 8s ease-in-out infinite;
}

.top-bar__brand,
.top-bar__menu-toggle,
.top-bar__links {
  position: relative;
  z-index: 1;
}

.top-bar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 26px;
  line-height: 1.15;
  min-width: 0;
  transition: font-size 0.22s ease, gap 0.22s ease;
}

.top-bar__brand span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-bar__mark {
  width: 44px;
  height: 44px;
  transition: width 0.22s ease, height 0.22s ease;
  object-fit: contain;
  display: block;
  border: 0;
  background: transparent;
  flex-shrink: 0;
}

.top-bar__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: flex-end;
}

.top-bar__links a {
  display: block;
  padding: 10px 16px;
  border-radius: 999px;
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink-soft, var(--soft, #6e6e73));
  text-decoration: none;
  transition: padding 0.22s ease, font-size 0.22s ease;
}

/* Sticky bar stays full-bleed so the hero can tuck underneath.
   The pill (menu) shrinks to the content column. */
.top-bar.is-compact {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding-inline: 24px;
  align-self: stretch;
}

.top-bar.is-compact .top-bar__pill {
  width: var(--site-content-width, min(920px, 100%));
  max-width: none;
  margin-inline: auto;
  padding: 8px 16px 8px 18px;
  background: #f8f9fa;
  border-color: rgba(52, 58, 64, 0.14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.top-bar.is-compact .top-bar__brand {
  font-size: 20px;
  gap: 0.5rem;
}

.top-bar.is-compact .top-bar__mark {
  width: 32px;
  height: 32px;
}

.top-bar.is-compact .top-bar__links a {
  padding: 6px 12px;
  font-size: 0.95rem;
}

.top-bar__links a[aria-current="page"] {
  color: var(--ink);
  font-weight: 800;
  background: transparent;
}

.top-bar__links a:hover {
  color: var(--ink);
}

@keyframes meshDrift {
  0%, 100% { background-position: center, center, 0% 20%, 100% 80%, 48% 52%; }
  50% { background-position: center, center, 100% 60%, 0% 40%, 58% 42%; }
}

@media (max-width: 720px) {
  .top-bar {
    padding: 2px 12px 0;
    top: 4px;
  }

  .top-bar.is-compact {
    padding-inline: 12px;
  }

  .top-bar.is-compact .top-bar__pill {
    width: 100%;
  }

  .top-bar__pill {
    padding: 12px 14px 12px 16px;
    gap: 10px;
    border-radius: var(--radius, 8px);
  }

  .top-bar__brand {
    font-size: 22px;
    gap: 0.55rem;
  }

  .top-bar__mark {
    width: 36px;
    height: 36px;
  }
}


@media (prefers-reduced-motion: reduce) {
  .top-bar__pill,
  .top-bar__brand,
  .top-bar__mark,
  .top-bar__links a {
    transition: none;
  }

  .top-bar__pill:hover::before {
    animation: none;
  }
}