:root {
  --ezw-header-text: #0f172a;
  --ezw-header-secondary: #475569;
  --ezw-header-muted: #64748b;
  --ezw-header-bg: #f7f9fc;
  --ezw-header-border: #e2e8f0;
  --ezw-header-blue: #2563eb;
  --ezw-header-purple: #7c3aed;
  --ezw-header-green: #22c55e;
  --ezw-anchor-offset: 124px;
}

html {
  scroll-padding-top: var(--ezw-anchor-offset);
}

:where(section, article, div, h1, h2, h3)[id] {
  scroll-margin-top: var(--ezw-anchor-offset);
}

.ezw-header-demo {
  min-height: 160vh;
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 75% 18%, rgba(37, 99, 235, 0.12), transparent 34%),
    radial-gradient(circle at 88% 74%, rgba(34, 197, 94, 0.08), transparent 30%),
    var(--ezw-header-bg);
  color: var(--ezw-header-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ezw-header,
.ezw-header * {
  box-sizing: border-box;
}

.ezw-header {
  position: sticky;
  top: 16px;
  z-index: 50;
  width: min(100% - 48px, 1240px);
  margin: 16px auto 0;
}

.ezw-header-nav {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 78px;
  padding: 8px 12px 8px 18px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px);
  transition: background 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out;
}

.ezw-header.is-scrolled .ezw-header-nav {
  border-color: rgba(203, 213, 225, 0.96);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 46px rgba(15, 23, 42, 0.11);
}

.ezw-header-brand {
  display: inline-flex;
  align-items: center;
  width: 270px;
  color: var(--ezw-header-text);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.ezw-header-logo {
  display: block;
  width: 246px;
  height: 68px;
  object-fit: contain;
  object-position: left center;
}

.ezw-header-links {
  display: flex;
  justify-content: center;
  gap: 4px;
  align-items: center;
}

.ezw-header-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 40px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #334155;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: background 160ms ease-out, color 160ms ease-out;
}

.ezw-header-nav-link:hover,
.ezw-header-dropdown:focus-within > .ezw-header-nav-link {
  background: #f1f5f9;
  color: var(--ezw-header-text);
}

.ezw-header-nav-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.ezw-header-dropdown {
  position: relative;
  z-index: 5;
}

.ezw-header-dropdown::after {
  position: absolute;
  top: 100%;
  right: -18px;
  left: -18px;
  height: 18px;
  content: "";
}

.ezw-header-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  z-index: 10;
  display: grid;
  width: 320px;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 54px rgba(15, 23, 42, 0.13);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity 160ms ease-out, transform 160ms ease-out;
  backdrop-filter: blur(18px);
}

.ezw-header-dropdown:hover .ezw-header-menu,
.ezw-header-dropdown:focus-within .ezw-header-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.ezw-header.is-menu-dismissed .ezw-header-menu {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
}

.ezw-header-menu a {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 16px;
  color: var(--ezw-header-text);
  text-decoration: none;
  transition: background 160ms ease-out;
}

.ezw-header-menu a:hover,
.ezw-header-menu a:focus-visible {
  background: #f8fafc;
}

.ezw-header-menu strong {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.15;
}

.ezw-header-menu span {
  color: var(--ezw-header-muted);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
}

.ezw-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ezw-header-login,
.ezw-header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.ezw-header-login {
  padding: 0 15px;
  color: var(--ezw-header-text);
}

.ezw-header-login:hover {
  background: #f1f5f9;
}

.ezw-header-cta {
  padding: 0 20px;
  background: linear-gradient(135deg, var(--ezw-header-blue), var(--ezw-header-purple));
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.25);
  transition: transform 160ms ease-out, box-shadow 160ms ease-out;
}

.ezw-header-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 32px rgba(37, 99, 235, 0.3);
}

.ezw-header a:focus-visible,
.ezw-header button:focus-visible,
.ezw-header summary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 3px;
}

.ezw-header-menu-button {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--ezw-header-border);
  border-radius: 999px;
  background: #ffffff;
}

.ezw-header-menu-button span {
  width: 17px;
  height: 2px;
  border-radius: 999px;
  background: var(--ezw-header-text);
  transition: transform 160ms ease-out, opacity 160ms ease-out;
}

.ezw-header.is-open .ezw-header-menu-button span:first-child {
  transform: translateY(7px) rotate(45deg);
}

.ezw-header.is-open .ezw-header-menu-button span:nth-child(2) {
  opacity: 0;
}

.ezw-header.is-open .ezw-header-menu-button span:last-child {
  transform: translateY(-7px) rotate(-45deg);
}

.ezw-header-mobile-panel {
  display: none;
}

@media (max-width: 920px) {
  .ezw-header {
    top: 12px;
    width: min(100% - 24px, 720px);
    margin-top: 12px;
  }

  :root {
    --ezw-anchor-offset: 104px;
  }

  .ezw-header-nav {
    grid-template-columns: auto 1fr auto;
    min-height: 64px;
    padding: 8px 10px 8px 14px;
  }

  .ezw-header-brand {
    width: 174px;
  }

  .ezw-header-logo {
    width: 166px;
    height: 46px;
  }

  .ezw-header-links,
  .ezw-header-actions {
    display: none;
  }

  .ezw-header-menu-button {
    display: inline-flex;
    justify-self: end;
  }

  .ezw-header-mobile-panel {
    display: grid;
    gap: 14px;
    max-height: 0;
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.11);
    opacity: 0;
    padding: 0 14px;
    transition: max-height 200ms ease-out, opacity 160ms ease-out, padding 160ms ease-out, border-color 160ms ease-out;
    backdrop-filter: blur(18px);
  }

  .ezw-header.is-open .ezw-header-mobile-panel {
    max-height: 640px;
    opacity: 1;
    padding: 14px;
    border-color: rgba(226, 232, 240, 0.9);
  }

  .ezw-header-mobile-links {
    display: grid;
    gap: 4px;
  }

  .ezw-header-mobile-links > a,
  .ezw-header-mobile-links summary {
    display: flex;
    min-height: 44px;
    align-items: center;
    padding: 0 12px;
    border-radius: 15px;
    color: var(--ezw-header-text);
    cursor: pointer;
    font-size: 0.96rem;
    font-weight: 800;
    list-style: none;
    text-decoration: none;
  }

  .ezw-header-mobile-links a[href="#ezw-use-cases-anchor"],
  .ezw-header-mobile-links a[href="index.html#ezw-use-cases-anchor"] {
    display: none;
  }

  .ezw-header-mobile-links summary::-webkit-details-marker {
    display: none;
  }

  .ezw-header-mobile-links > a:hover,
  .ezw-header-mobile-links summary:hover {
    background: #f8fafc;
  }

  .ezw-header-mobile-links details a {
    display: flex;
    min-height: 38px;
    align-items: center;
    margin-left: 12px;
    padding: 0 12px;
    border-left: 2px solid #dbeafe;
    color: var(--ezw-header-secondary);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
  }

  .ezw-header-mobile-actions {
    display: grid;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--ezw-header-border);
  }

  .ezw-header-mobile-actions .ezw-header-login,
  .ezw-header-mobile-actions .ezw-header-cta {
    width: 100%;
    min-height: 48px;
  }
}

@media (max-width: 430px) {
  .ezw-header {
    width: min(100% - 20px, 720px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ezw-header-nav,
  .ezw-header-menu,
  .ezw-header-cta,
  .ezw-header-mobile-panel,
  .ezw-header-menu-button span {
    transition: none;
  }
}
