/* ==========================================================================
   eety.ai sitewide navigation (2026-08-13 build)
   Self-contained: carries 100 percent of the header's styling. It does not
   rely on the site's purged Tailwind build or any per-page inline styles.
   Every class is prefixed "enav-" to avoid collisions with page CSS.

   Palette (from the site recon brief):
     page glass base  rgba(253, 253, 255, x)   (#FDFDFF)
     primary ink      #0f172a (slate-900)
     secondary text   #555555
     muted            #888888
     hover surfaces   #f8fafc / #fcfcfc
     hairlines        rgba(0, 0, 0, 0.05) and #e2e8f0
   Font: Inter (already loaded by every page), with system fallbacks.
   ========================================================================== */

/* ---- scoped reset -------------------------------------------------------- */

.enav,
.enav *,
.enav *::before,
.enav *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.enav ul {
  list-style: none;
}

.enav a {
  text-decoration: none;
  color: inherit;
}

.enav button {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  /* Inherit the face and rhythm, but NOT size/weight: the dropdown triggers
     carry .enav-link and must size identically to the plain <a> links. The
     `font` shorthand used to win on specificity and blew them up to 16px. */
  font-family: inherit;
  line-height: inherit;
  color: inherit;
  cursor: pointer;
  text-align: inherit;
}

.enav img {
  border: 0;
  max-width: none;
}

/* ---- header shell -------------------------------------------------------- */

.enav {
  position: sticky;
  top: 0;
  /* Above page content (old navs used z-50), below the index.html demo modal
     (z-index 200), so the modal still covers the header when open. */
  z-index: 100;
  width: 100%;
  background: rgba(253, 253, 255, 0.85);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  letter-spacing: -0.01em;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.enav-bar {
  position: relative;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 2rem;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.enav-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.enav-logo img {
  display: block;
  height: 36px;
  width: auto;
}

/* ---- shared link / trigger pieces --------------------------------------- */

.enav-link {
  font-size: 13px;
  font-weight: 500;
  color: #555555;
  transition: color 0.15s ease;
}

.enav-link:hover {
  color: #0f172a;
}

.enav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.enav-caret {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform 0.16s ease;
}

.enav-item.enav-open > .enav-trigger .enav-caret {
  transform: rotate(180deg);
}

.enav-menu-link {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #555555;
  border-radius: 8px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.enav-menu-link:hover {
  color: #0f172a;
  background: #f8fafc;
}

.enav-login {
  font-size: 13px;
  font-weight: 500;
  color: #555555;
  transition: color 0.15s ease;
}

.enav-login:hover {
  color: #0f172a;
}

.enav a.enav-cta {
  display: inline-block;
  background: #0f172a;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 8px;
  text-align: center;
  transition: background-color 0.15s ease;
}

.enav a.enav-cta:hover {
  background: #1e293b;
}

/* ---- focus visibility ---------------------------------------------------- */

.enav a:focus-visible,
.enav button:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
  border-radius: 6px;
}

/* ==========================================================================
   Desktop (768px and up)
   ========================================================================== */

@media (min-width: 768px) {
  .enav-burger {
    display: none;
  }

  .enav-panel {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 2.5rem;
    min-width: 0;
  }

  .enav-list {
    display: flex;
    align-items: center;
    gap: 2.25rem;
    margin: 0 auto;
  }

  .enav-item {
    position: relative;
  }

  .enav-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 2px;
  }

  /* dropdown card */
  .enav-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, 6px);
    min-width: 230px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
    z-index: 20;
  }

  /* invisible bridge over the 10px gap so hover does not drop out */
  .enav-menu::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -12px;
    height: 12px;
  }

  .enav-item.enav-open > .enav-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
  }

  .enav-menu-link {
    padding: 9px 12px;
    white-space: nowrap;
  }

  .enav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
  }
}

/* Pure-CSS hover fallback so dropdowns still work if JS fails to load.
   Restricted to real hover devices; touch devices use the JS click path. */
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  .enav-has-menu:hover > .enav-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
  }

  .enav-has-menu:hover > .enav-trigger {
    color: #0f172a;
  }

  .enav-has-menu:hover > .enav-trigger .enav-caret {
    transform: rotate(180deg);
  }
}

/* ==========================================================================
   Mobile (under 768px): hamburger + full-width panel
   ========================================================================== */

@media (max-width: 767.98px) {
  .enav-bar {
    min-height: 60px;
    padding: 0 1.25rem;
  }

  .enav-logo img {
    height: 32px;
  }

  /* hamburger button */
  .enav-burger {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-right: -8px;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .enav-burger:hover {
    background: #f8fafc;
  }

  .enav-burger-bar {
    display: block;
    width: 18px;
    height: 2px;
    background: #0f172a;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .enav.enav-panel-open .enav-burger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .enav.enav-panel-open .enav-burger-bar:nth-child(2) {
    opacity: 0;
  }

  .enav.enav-panel-open .enav-burger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* slide-under panel */
  .enav-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fdfdff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
    max-height: calc(100vh - 60px);
    max-height: calc(100dvh - 60px);
    overflow-y: auto;
    padding: 6px 0 16px;
  }

  .enav.enav-panel-open .enav-panel {
    display: block;
  }

  .enav-list {
    display: block;
  }

  .enav-link {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 13px 1.25rem;
    font-size: 14px;
  }

  .enav-caret {
    width: 16px;
    height: 16px;
    color: #888888;
  }

  /* accordion submenus */
  .enav-menu {
    display: none;
    padding: 2px 0 6px;
  }

  .enav-item.enav-open > .enav-menu {
    display: block;
  }

  .enav-item.enav-open > .enav-trigger {
    color: #0f172a;
  }

  .enav-menu-link {
    padding: 11px 1.25rem 11px 2.25rem;
    border-radius: 0;
  }

  /* actions */
  .enav-actions {
    margin-top: 10px;
    padding: 16px 1.25rem 4px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: grid;
    gap: 10px;
  }

  .enav-login {
    display: block;
    text-align: center;
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
  }

  .enav-cta {
    display: block;
    padding: 11px 16px;
    font-size: 14px;
    border-radius: 10px;
  }

  /* inset focus ring so it stays visible on full-width rows */
  .enav-panel a:focus-visible,
  .enav-panel button:focus-visible {
    outline-offset: -2px;
  }
}

/* ---- reduced motion ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .enav,
  .enav *,
  .enav *::before,
  .enav *::after {
    transition: none !important;
    animation: none !important;
  }
}
