/* Coded Header (desktop only for Home New) */
.header-coded {
  position: fixed;
  top: 32px;                 /* gap from top */
  left: 50%;
  transform: translateX(-50%);
  width: 1300px;             /* fixed width */
  padding-block: 16px;        /* vertical padding */
  --dropdown-gap: 16px;
  border-radius: 9999px;     /* pill */
  background: rgba(255, 255, 255, 0.8); /* 80% white */
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);            /* frosted glass */
  box-shadow: 0 0 24px rgba(0,0,0,.059);/* 30% reduced blur & alpha */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 45px;
  padding-right: 20px;
  z-index: 1100;             /* above page content */
}

/* Enforce brand green in header scopes (beats Divi blue) */
.header-coded,
.mobile-menu {
  --brand-green: #A0E672;
}

/* Ensure primary buttons in header use brand green */
.header-coded .btn.btn--primary,
.mobile-menu .btn.btn--primary {
  background-color: var(--brand-green) !important;
  border-color: var(--brand-green) !important;
  color: var(--brand-black) !important;
}

@media (min-width: 981px) {
  :root { --header-bottom: 94px; } /* 32px top offset + ~62px pill height */
  .boba-header-spacer { height: var(--header-bottom, 94px); }
}
/* Structure placeholders */
.header-coded__brand,
.header-coded__nav,
.header-coded__ctas {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Logo sizing: fill header inner height, keep natural width */
.header-coded__logo {
  display: flex;
  align-items: center;
  height: 100%;
  text-decoration: none;
}
.header-coded__logo-img {
  display: block;
  height: 30px;
  width: auto;
}

/* Menu link styles (match hero body size, smooth bold+green hover) */
.header-coded .header-coded__link {
  position: relative;
  display: inline-block;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  color: inherit;
  transition: color .25s ease;
}
.header-coded .header-coded__link::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  font-weight: 600;
  color: var(--brand-green);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.header-coded .header-coded__link[aria-current="page"] {
  font-weight: 600;
}
.header-coded .header-coded__link:not([aria-current="page"]):hover::after,
.header-coded .header-coded__link:not([aria-current="page"]):focus-visible::after {
  opacity: 1;
}

/* CTA icon: card — 8px tall, inherits text color via currentColor */
.header-coded .icon-card {
  display: inline-block;
  height: 1em;               /* scales with button text size */
  width: auto;               /* keep natural width */
  aspect-ratio: 1.5;         /* keep shape; adjust if needed */
  max-height: 100%;          /* never exceed the line box */
  margin-right: 4px;
  background-color: currentColor; /* follow text color in normal/hover states */
  -webkit-mask: url("../img/header/card.svg") no-repeat center / contain;
  mask: url("../img/header/card.svg") no-repeat center / contain;
  transform: scale(1.3);
  transform-origin: left center;
  vertical-align: -0.1em;    /* optical alignment with text */
}

/* CTA: tweak left padding for Boba Card only */
.header-coded .header-coded__ctas .btn--secondary { padding-left: 31px; }

/* Dropdown indicator: green down arrow to the right of label */
.header-coded .icon-down {
  display: inline-block;
  height: 0.9em;              /* sized relative to text */
  width: auto;
  aspect-ratio: 1;            /* square-ish icon */
  margin-left: 2px;           /* gap from word */
  background-color: var(--brand-green); /* always green */
  -webkit-mask: url("../img/header/down-arrow.svg") no-repeat center / contain;
  mask: url("../img/header/down-arrow.svg") no-repeat center / contain;
  vertical-align: -0.1em;     /* optical align with text baseline */
}

/* Dropdown (Accelerators) */
.header-coded .has-dropdown { position: relative; }
.header-coded .has-dropdown::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: calc(var(--dropdown-gap) + 8px); /* bridge spans the full gap */
}
.header-coded .menu-dropdown {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(100% + var(--dropdown-gap));     /* below header bar */
  min-width: 320px;
  padding: 14px 16px;
  border-radius: 20px;
  background: #ffffff;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);            /* frosted */
  box-shadow: 0 0 35px rgba(0,0,0,.084); /* no vertical offset */
  z-index: 1110;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.header-coded .has-dropdown:hover .menu-dropdown,
.header-coded .has-dropdown:focus-within .menu-dropdown {
  opacity: 1;
  pointer-events: auto;       /* fade in only */
}
.header-coded .menu-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 500;
  transition: color .25s ease, font-weight .25s ease;
}
.header-coded .menu-dropdown .dropdown-item:hover {
  color: var(--brand-green);
  font-weight: 600;
}
.header-coded .menu-dropdown .dropdown-item .icon-card {
  color: var(--brand-green);  /* icon green; text stays default */
  height: 1em;                /* match text height inside item */
  width: auto;
  aspect-ratio: 1.5;
  margin-right: 0;
}

/* Dropdown specific icons */
.header-coded .menu-dropdown .dropdown-item .icon-accelerator {
  color: var(--brand-green);
  background-color: currentColor;
  height: 1.2em;
  width: auto;
  aspect-ratio: 1.2;
  margin-right: 0;
  -webkit-mask: url("../img/header/accelerator.svg") no-repeat center / contain;
  mask: url("../img/header/accelerator.svg") no-repeat center / contain;
}
.header-coded .menu-dropdown .dropdown-item .icon-grants {
  color: var(--brand-green);
  background-color: currentColor;
  height: 1.4em;
  width: auto;
  aspect-ratio: 1.2;
  margin-right: 0;
  -webkit-mask: url("../img/header/grants-program.svg") no-repeat center / contain;
  mask: url("../img/header/grants-program.svg") no-repeat center / contain;
}

/* Users dropdown icons */
.header-coded .menu-dropdown .dropdown-item .icon-community {
  color: var(--brand-green);
  background-color: currentColor;
  height: 1.56em;
  width: auto;
  aspect-ratio: 1.2;
  margin-right: 0;
  -webkit-mask: url("../img/header/community.svg") no-repeat center / contain;
  mask: url("../img/header/community.svg") no-repeat center / contain;
}
.header-coded .menu-dropdown .dropdown-item .icon-education {
  color: var(--brand-green);
  background-color: currentColor;
  height: 1.2em;
  width: auto;
  aspect-ratio: 1.2;
  margin-right: 0;
  -webkit-mask: url("../img/header/education.svg") no-repeat center / contain;
  mask: url("../img/header/education.svg") no-repeat center / contain;
}
.header-coded .menu-dropdown .dropdown-item .icon-blog {
  color: var(--brand-green);
  background-color: currentColor;
  height: 1.2em;
  width: auto;
  aspect-ratio: 1.2;
  margin-right: 0;
  -webkit-mask: url("../img/header/blog.svg") no-repeat center / contain;
  mask: url("../img/header/blog.svg") no-repeat center / contain;
}

/* Mobile bottom nav pill (hidden by default on desktop) */
.mobile-nav-pill { display: none; }

@media (max-width: 980px) {
  /* Bottom-centered frosted pill */
  .mobile-nav-pill {
    --pill-h: 38px; /* approx. green button height for consistency */
    position: fixed;
    left: 50%;
    bottom: max(16px, env(safe-area-inset-bottom) + 12px);
    transform: translateX(-50%);
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    gap: 16px;
    box-sizing: border-box;
    height: auto;
    padding-inline: 30px;
    padding-block: 15px; /* 15px top/bottom padding */
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,0.8);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-soft);
    border: none;
  }
  .mobile-nav-pill .pill-logo {
    display: block;
    height: 22px; /* exact logo height requested */
    width: auto;
    position: relative; /* establish stacking context */
    z-index: 1;
  }
  .mobile-nav-pill .pill-menu {
    display: inline-block;
    position: relative;
    height: calc(var(--pill-h) * 0.56); /* match logo for balanced whitespace */
    width: auto;
    aspect-ratio: 1;
    z-index: 2; /* ensure icon (menu/X) renders above logo */
  }
  .mobile-nav-pill .pill-menu::before,
  .mobile-nav-pill .pill-menu::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--brand-black);
    transition: opacity .22s ease, transform .22s ease;
    will-change: opacity, transform;
  }
  /* menu (default) */
  .mobile-nav-pill .pill-menu::before {
    -webkit-mask: url("../img/header/menu.svg") no-repeat center / contain;
    mask: url("../img/header/menu.svg") no-repeat center / contain;
    opacity: 1;
    transform: rotate(0deg);
  }
  /* X (shown when open) */
  .mobile-nav-pill .pill-menu::after {
    -webkit-mask: url("../img/header/x.svg") no-repeat center / contain;
    mask: url("../img/header/x.svg") no-repeat center / contain;
    opacity: 0;
    transform: rotate(-90deg) scale(0.7);
  }
  .mobile-nav-pill.is-open .pill-menu::before { opacity: 0; transform: rotate(90deg); }
  .mobile-nav-pill.is-open .pill-menu::after  { opacity: 1; transform: rotate(0deg) scale(0.7); }

  /* Desktop-only: hide header on mobile for now */
}
@media (max-width: 980px) {
  .header-coded { display: none; }
}

/* Mobile bottom sheet menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1210;              /* above pill */
  pointer-events: none;       /* enable when open */
}
.mobile-menu__backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
  opacity: 0;
  transition: opacity .5s ease;
}

/* Stack container for CTA row + sheet (centered and bottom-anchored) */
.mobile-menu__stack {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(84px + env(safe-area-inset-bottom, 0px)); /* sits above the pill (reduced by ~30%) */
  width: auto;
  max-width: min(calc(100dvw - 2*var(--gutter, 16px)), 520px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* CTA row above the white rectangle */
.mobile-cta-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  margin-bottom: 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s ease, transform .5s ease;
  flex-wrap: nowrap;          /* do not wrap buttons */
  overflow: visible;          /* allow intrinsic width even if wider than 60vw */
  order: 2;
}

/* Stagger CTA row in after sheet */
.mobile-menu.is-open .mobile-cta-row {
  opacity: 1;
  transform: none;
  transition-delay: 0ms;
}

/* CTA buttons: intrinsic sizing, single line */
.mobile-cta-row .btn {
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  white-space: nowrap;
}

/* Superscript fix for TM in mobile menu */
.mobile-menu .mobile-menu__link sup,
.mobile-menu .mobile-menu__toggle sup,
.mobile-menu .mobile-menu__sublink sup {
  font-size: 0.6em;
  line-height: 1;
  vertical-align: super;
  position: relative;
  top: -0.2em;
  margin-left: 2px;
}
.mobile-menu__sheet {
  transform: translateY(12px);
  border-radius: 30px;
  background: #ffffff;        /* 100% opaque, no frosted */
  box-shadow: 0 0 35px rgba(0,0,0,.12);
  opacity: 0;
  transition: opacity .5s ease, transform .5s ease;
  will-change: opacity, transform;
  order: 1;
  width: 100%;
}

/* Open state */
.mobile-menu.is-open { pointer-events: auto; }
.mobile-menu.is-open .mobile-menu__backdrop { opacity: 1; }
.mobile-menu.is-open .mobile-menu__sheet { opacity: 1; transform: translateY(0); transition-delay: 120ms; }

/* Page blur overlay (under pill, over page) */
.mobile-blur {
  position: fixed;
  inset: 0;
  z-index: 1150;                  /* below pill (1200), above page */
  pointer-events: none;
  opacity: 0;
  -webkit-backdrop-filter: blur(0px);
  backdrop-filter: blur(0px);
  transition: opacity .5s ease, -webkit-backdrop-filter .5s ease, backdrop-filter .5s ease;
}
.mobile-blur.is-open {
  opacity: 1;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* List */
.mobile-menu__nav { padding: 20px; }
.mobile-menu__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.mobile-menu__link {
  display: block;
  padding: 12px 16px;
  border-radius: 16px;
  background: #f5f5f5;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.mobile-menu__link[aria-current="page"] { font-weight: 600; }

/* Accordion rows */
.mobile-menu__accordion {
  background: transparent;
  border-radius: 12px;
}
.mobile-menu__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 0;
  background: #f5f5f5;
  border-radius: 16px;
  color: inherit;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.mobile-menu__toggle .chevron {
  display: inline-block;
  height: 1.4em;
  width: 1.4em;
  background-color: var(--brand-green);
  -webkit-mask: url("../img/header/down-arrow.svg") no-repeat center / contain;
  mask: url("../img/header/down-arrow.svg") no-repeat center / contain;
  transition: transform .4s ease;
}
.mobile-menu__accordion.is-open .mobile-menu__toggle .chevron { transform: rotate(180deg); }

/* Submenu */
.mobile-menu__submenu {
  margin: 0;
  padding: 0 6px 6px 6px; /* keep constant padding to avoid horizontal nudge */
  list-style: none;
  display: grid;
  gap: 10px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .5s ease;
}
.mobile-menu__accordion.is-open .mobile-menu__submenu { max-height: 480px; }

.mobile-menu__sublink {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 12px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

/* Coded header: fully suppress focus rings and tap highlight */
.header-coded a:focus,
.header-coded button:focus,
.header-coded [tabindex]:focus,
.header-coded a:focus-visible,
.header-coded button:focus-visible,
.header-coded [tabindex]:focus-visible,
.mobile-nav-pill:focus,
.mobile-menu__link:focus,
.mobile-menu__toggle:focus,
.mobile-menu__link:focus-visible,
.mobile-menu__toggle:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
.mobile-nav-pill,
.mobile-menu__link,
.mobile-menu__toggle {
  -webkit-tap-highlight-color: transparent;
}
