/* header.css — agreed header template (2026-10). Global reset + body rule from the template
   are intentionally omitted so existing page layouts are unaffected. */

/* ================= HEADER STYLES ================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(8, 8, 8, 0.88);
  box-shadow: 0px 4px 24px 0px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 25px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo img {
  height: 24px;
  width: auto;
  display: block;
}

.header-nav {
  display: flex;
  gap: 40px;
  transition: max-height 0.3s ease;
}

.nav-link {
  color: var(--color-white);
  text-decoration: none;
  font-family: "DmSans-Medium", sans-serif;
  font-size: var(--fs-16);
  font-weight: 500;
  position: relative;
  padding: 5px 0;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--color-brand);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 25px;
  height: 2px;
  background-color: var(--color-brand);
  border-radius: 2px;
}

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

.cta-button {
  background-color: var(--color-brand);
  color: var(--color-ink);
  font-family: "Inter-SemiBold", sans-serif;
  font-size: var(--fs-14);
  font-weight: 600;
  letter-spacing: 1.5px;
  text-decoration: none;
  padding: 10px 24px;
  border-radius: 12px;
  transition: opacity 0.3s ease;
}

.cta-button:hover {
  opacity: 0.8;
}

/* Mobile Toggle Hamburger */
.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
  padding: 5px;
}

.mobile-toggle .divider {
  display: block;
  width: 25px;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 2px;
}


/* ================= RESPONSIVE BREAKPOINTS ================= */

/* Tablet & Smaller Desktop */
@media (max-width: 1024px) {
  /* Header Adjustments */
  .header-nav {
    display: none; /* Hidden by default on mobile, toggled via JS */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(8, 8, 8, 0.95);
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    gap: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
  }

  .header-nav.nav-open {
    display: flex; /* Class added by Javascript to open menu */
  }

  .mobile-toggle {
    display: flex;
  }
}

/* Mobile Screens */
@media (max-width: 767.98px) {
  .header-container {
    padding: 20px 20px;
  }

  .cta-button {
    font-size: var(--fs-12);
    padding: 8px 16px;
  }
}

/* Tiny Mobile */
@media (max-width: 479.98px) {
  .cta-button {
    display: none; /* Hide CTA to save space for logo and hamburger */
  }
}

/* Fixed header: keep in-page anchors clear of it */
html { scroll-padding-top: var(--header-h); }

/* Figma homepage: match its content offset to this header's real height */
body.home-figma { --hf-header-h: var(--header-h); }

/* ================= NAV v3 (2026-10-12): menu follows sitemap.xml ================= */
.header-nav { align-items: center; gap: 32px; }
.nav-item { position: relative; }
.nav-drop-btn {
  background: none; border: 0; padding: 5px 0; cursor: pointer;
  color: var(--color-white); font-family: "DM Sans", sans-serif; font-size: var(--fs-16); font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; position: relative;
}
.nav-drop-btn svg { width: 10px; height: 10px; transition: transform .2s ease; }
.nav-drop-btn:hover, .nav-item.open > .nav-drop-btn { color: var(--color-brand); }
.nav-item.open > .nav-drop-btn svg { transform: rotate(180deg); }
.nav-drop-btn.active::after { content: ""; position: absolute; bottom: -5px; left: 0; width: 25px; height: 2px; background: var(--color-brand); border-radius: 2px; }
.nav-sub {
  position: absolute; top: calc(100% + 18px); left: -20px; min-width: 260px;
  list-style: none; margin: 0; padding: 10px;
  background: rgba(13, 17, 23, 0.98); border: 1px solid rgba(255,255,255,.1); border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,.45);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .2s, transform .2s, visibility .2s;
}
.nav-sub::before { content: ""; position: absolute; top: -18px; left: 0; right: 0; height: 18px; }
.nav-item.open > .nav-sub { opacity: 1; visibility: visible; transform: none; }
@media (hover: hover) and (min-width: 1025px) {
  .nav-item:hover > .nav-sub { opacity: 1; visibility: visible; transform: none; }
}
.nav-sub a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--color-white); text-decoration: none; font-family: "DM Sans", sans-serif; font-size: var(--fs-15); font-weight: 500; line-height: 1.3; }
.nav-sub a small { display: block; font-family: "Inter", sans-serif; font-weight: 400; font-size: var(--fs-12); color: rgba(255,255,255,.55); margin-top: 2px; }
.nav-sub a:hover, .nav-sub a[aria-current] { background: rgba(255,255,255,.06); color: var(--color-brand); }

@media (max-width: 1024px) {
  .header-nav { align-items: stretch; padding: 12px 20px 24px; gap: 0; max-height: calc(100vh - 80px); overflow-y: auto; }
  .header-nav > .nav-link, .nav-drop-btn { padding: 14px 0; font-size: var(--fs-18); width: 100%; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.08); text-align: left; }
  .nav-link.active::after, .nav-drop-btn.active::after { display: none; }
  .nav-link.active, .nav-drop-btn.active { color: var(--color-brand); }
  .nav-sub { position: static; opacity: 1; visibility: visible; transform: none; display: none; box-shadow: none; border: 0; background: transparent; padding: 4px 0 12px 12px; min-width: 0; }
  .nav-item.open > .nav-sub { display: block; }
  .nav-sub::before { display: none; }
}
@media (max-width: 1024px) { .header-nav { background: var(--color-bg-deep); } }

/* Header height comes from --header-h (tokens.css): 92px desktop, 68px collapsed menu. */
.site-header .header-container { height: var(--header-h); padding-top: 0; padding-bottom: 0; box-sizing: border-box; }
