/* HookGenius /learn/ site-wide brand header — "Editorial Masthead"
 * ---------------------------------------------------------------
 * Design brief: sit on every SEO article page as a permanent brand bar.
 *   - 64px desktop / 56px mobile  (article H1 stays above the fold)
 *   - Sticky top, frosted-glass backdrop (blur 24px + saturate 180%)
 *   - Ghost CTA that fills on hover  (reads editorial, not banner-ad)
 *   - Vertical hairline divider between wordmark and tagline
 *       (classic publication-masthead move — Stratechery, Pitchfork, The Verge)
 *   - 8px SVG waveform as bottom divider  (audio-referential signature)
 *   - LCP-safe: inline SVG logo + CSS-only motion + reduced-motion respected
 *
 * Reference landscape: linear.app, raycast.com, vercel.com, cursor.com,
 *   stratechery.com, arc.net.  Premium dark-theme palette: navy +
 *   desaturated champagne-amber (#E8B86C at 85% saturation) — reads more
 *   expensive than full-saturation #F59E0B.
 */

.hg-masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 15, 30, 0.78);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  /* bottom waveform divider — 8px tall SVG baked in as a background image */
  background-image:
    linear-gradient(180deg, rgba(10,15,30,0.78) 0%, rgba(10,15,30,0.78) calc(100% - 8px), transparent calc(100% - 8px)),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 8' preserveAspectRatio='none'><defs><linearGradient id='w' x1='0' y1='0' x2='1' y2='0'><stop offset='0%25' stop-color='%23E8B86C' stop-opacity='0'/><stop offset='20%25' stop-color='%23E8B86C' stop-opacity='0.55'/><stop offset='50%25' stop-color='%23F59E0B' stop-opacity='0.75'/><stop offset='80%25' stop-color='%23E8B86C' stop-opacity='0.55'/><stop offset='100%25' stop-color='%23E8B86C' stop-opacity='0'/></linearGradient></defs><path d='M0 4 C 20 0.5, 40 7.5, 60 4 S 100 0.5, 120 4 S 160 7.5, 180 4 S 220 0.5, 240 4' fill='none' stroke='url(%23w)' stroke-width='1.1' stroke-linecap='round'/></svg>");
  background-position: 0 0, 0 100%;
  background-repeat: no-repeat, no-repeat;
  background-size: auto, 100% 8px;
}

.hg-masthead__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  height: 64px;
  box-sizing: border-box;
}

/* Brand block — logo + wordmark + hairline divider + tagline */
.hg-masthead__brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  flex: 0 1 auto;
}
.hg-masthead__brand:hover,
.hg-masthead__brand:focus-visible {
  text-decoration: none;
  outline: none;
}
.hg-masthead__brand:focus-visible {
  box-shadow: 0 0 0 2px rgba(232, 184, 108, 0.55);
  border-radius: 8px;
}
.hg-masthead__logo {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: block;
  animation: hg-masthead-breathe 7s ease-in-out infinite;
  transform-origin: center;
}
@keyframes hg-masthead-breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.92; transform: scale(1.018); }
}

.hg-masthead__text {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.hg-masthead__name {
  font-family: 'Inter', sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1;
  font-feature-settings: "ss01", "cv05", "cv08";
  /* Subtle gold accent on wordmark: gradient text (off-white → warm champagne) */
  background: linear-gradient(180deg, #f8fafc 0%, #f0e7d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}
.hg-masthead__divider {
  display: inline-block;
  width: 1px;
  height: 14px;
  background: rgba(148, 163, 184, 0.32);
  flex-shrink: 0;
}
.hg-masthead__tag {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Solid amber CTA — performance-marketer verdict: +15-35% CTR vs ghost.
 * Single-line button: `Start Free · 5 Credits →`
 * Hover: arrow nudges right 2px over 120ms cubic-bezier — Creative Director's
 * signature micro-interaction that separates "clean" from "made by hand."
 */
.hg-masthead__cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #E8B86C 0%, #F59E0B 100%);
  border: 1px solid transparent;
  color: #0f172a;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.86rem;
  text-decoration: none;
  line-height: 1;
  letter-spacing: -0.005em;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 2px 14px rgba(245, 158, 11, 0.22);
  transition:
    transform 0.18s cubic-bezier(0.2, 0, 0, 1),
    box-shadow 0.2s ease,
    filter 0.15s ease;
}
.hg-masthead__cta:hover,
.hg-masthead__cta:focus-visible {
  color: #0f172a;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 6px 22px rgba(245, 158, 11, 0.4);
  filter: brightness(1.04);
  outline: none;
}
.hg-masthead__cta-credits {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  margin-left: 0.38rem;
}
.hg-masthead__cta-dot {
  display: inline-block;
  opacity: 0.55;
  font-weight: 400;
}
.hg-masthead__cta-arrow {
  display: inline-block;
  transform: translateX(0);
  transition: transform 0.18s cubic-bezier(0.2, 0, 0, 1);
  margin-left: 0.1rem;
}
.hg-masthead__cta:hover .hg-masthead__cta-arrow,
.hg-masthead__cta:focus-visible .hg-masthead__cta-arrow {
  transform: translateX(2px);
}

/* Mobile: 56px. Drops divider, tagline, and the " · 5 Credits" section of the
 * CTA, leaving `Start Free →` as the single compact label.
 */
@media (max-width: 640px) {
  .hg-masthead__inner {
    padding: 0.7rem 1rem;
    gap: 0.8rem;
    height: 56px;
  }
  .hg-masthead__logo {
    width: 20px;
    height: 20px;
  }
  .hg-masthead__name {
    font-size: 0.93rem;
  }
  .hg-masthead__divider,
  .hg-masthead__tag,
  .hg-masthead__cta-dot,
  .hg-masthead__cta-credits {
    display: none;
  }
  .hg-masthead__cta {
    padding: 0.5rem 0.9rem;
    font-size: 0.82rem;
  }
}

/* Reduced motion — kill logo breathing + transforms */
@media (prefers-reduced-motion: reduce) {
  .hg-masthead__logo {
    animation: none;
  }
  .hg-masthead__cta {
    transition: background-color 0.15s ease, color 0.15s ease;
  }
  .hg-masthead__cta:hover {
    transform: none;
    box-shadow: none;
  }
}

/* Spacer — with sticky header, fixed overlap avoidance on in-page anchors */
.hg-masthead + .container,
.hg-masthead + main {
  scroll-margin-top: 80px;
}
