/* The one site header and footer. Every public page links this file last.
 *
 * React pages render src/components/BrandHeader.tsx or SiteHeader.tsx, static
 * pages carry the same classes in their HTML (scripts/generate-company-pages.mjs
 * copies it from public/join-us/index.html). Change the design here only.
 * `html body` outranks each page's older header rules regardless of load order.
 */

html:root {
  --brand-page-header-height: 64px;
  --brand-chrome-inline: clamp(20px, 3.4vw, 68px);
}

@media (max-width: 620px) {
  html:root {
    --brand-page-header-height: 58px;
    --brand-chrome-inline: 16px;
  }
}

/* Header */

html body:has(.brand-header--offset) {
  box-sizing: border-box;
  padding-top: calc(var(--brand-page-header-height) + env(safe-area-inset-top, 0px));
}

html body .brand-header {
  position: fixed;
  z-index: 1002;
  inset: 0 0 auto;
  width: 100%;
  height: calc(var(--brand-page-header-height) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 0 0;
  border-bottom: 1px solid var(--chrome-line);
  color: var(--chrome-text);
  background: var(--chrome-bg);
  box-shadow: none;
  backdrop-filter: none;
  font-family: var(--benji-font-sans);
  transition: none;
}

/* Light is the default. Only the homepage header carries brand-header--dark. */
html body .brand-header {
  --chrome-bg: #ffffff;
  --chrome-line: rgba(17, 19, 24, 0.1);
  --chrome-text: #111318;
  --chrome-muted: #4a505c;
  --chrome-current: rgba(17, 19, 24, 0.07);
  --chrome-outline: rgba(17, 19, 24, 0.24);
  --chrome-outline-hover: #111318;
  --chrome-ghost-hover: rgba(17, 19, 24, 0.05);
  --chrome-cta-bg: #111318;
  --chrome-cta-text: #ffffff;
  --chrome-cta-hover: #2b2f38;
  --chrome-disabled-bg: rgba(17, 19, 24, 0.07);
  --chrome-disabled-text: #5a6070;
  --chrome-logo-filter: brightness(0);
}

html body .brand-header.brand-header--dark {
  --chrome-bg: #121316;
  --chrome-line: rgba(255, 255, 255, 0.1);
  --chrome-text: #ffffff;
  --chrome-muted: #d4d6da;
  --chrome-current: rgba(255, 255, 255, 0.18);
  --chrome-outline: rgba(255, 255, 255, 0.28);
  --chrome-outline-hover: #ffffff;
  --chrome-ghost-hover: rgba(255, 255, 255, 0.08);
  --chrome-cta-bg: #ffffff;
  --chrome-cta-text: #111111;
  --chrome-cta-hover: #dedfe2;
  --chrome-disabled-bg: rgba(255, 255, 255, 0.12);
  --chrome-disabled-text: #cdd0d6;
  --chrome-logo-filter: brightness(0) invert(1);
}

html body .brand-header .brand-header__inner {
  display: grid;
  width: 100%;
  max-width: none;
  height: var(--brand-page-header-height);
  min-height: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0 var(--brand-chrome-inline);
}

html body .brand-header__logo {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-self: start;
  line-height: 0;
}

html body .brand-header__logo img {
  display: block;
  width: 150px;
  max-width: none;
  height: auto;
  filter: var(--chrome-logo-filter);
}

html body .brand-header__nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

html body .brand-header__nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--chrome-muted);
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}

html body .brand-header__nav a:hover {
  color: var(--chrome-text);
}

html body .brand-header__nav a[aria-current="page"] {
  color: var(--chrome-text);
  background: var(--chrome-current);
}

html body .brand-header__actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

html body .brand-header__login,
html body .brand-header .brand-header__cta,
html body .brand-header .header-enroll {
  display: inline-flex;
  width: auto;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

html body .brand-header__login {
  order: -1;
  border: 1px solid var(--chrome-outline);
  color: var(--chrome-text);
  background: transparent;
}

html body .brand-header__login:hover {
  border-color: var(--chrome-outline-hover);
  color: var(--chrome-text);
  background: var(--chrome-ghost-hover);
}

html body .brand-header .brand-header__cta,
html body .brand-header .header-enroll {
  border: 1px solid var(--chrome-cta-bg);
  color: var(--chrome-cta-text);
  background: var(--chrome-cta-bg);
}

html body .brand-header .brand-header__cta:hover,
html body .brand-header .header-enroll:hover {
  border-color: var(--chrome-cta-hover);
  color: var(--chrome-cta-text);
  background: var(--chrome-cta-hover);
}

html body .brand-header .header-enroll--disabled,
html body .brand-header .header-enroll--disabled:hover {
  border-color: transparent;
  color: var(--chrome-disabled-text);
  background: var(--chrome-disabled-bg);
  opacity: 1;
}

html body .brand-header__toggle {
  display: none;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  color: var(--chrome-text);
  background: transparent;
  cursor: pointer;
}

html body .brand-header__toggle svg {
  width: 24px;
  height: 24px;
}

html body .brand-header a:focus-visible,
html body .brand-header button:focus-visible {
  outline: 2px solid var(--chrome-text);
  outline-offset: 2px;
}

html body .brand-header__drawer {
  position: absolute;
  display: none;
  max-height: calc(100dvh - var(--brand-page-header-height));
  padding: 8px var(--brand-chrome-inline) 16px;
  overflow-y: auto;
  border-bottom: 1px solid var(--chrome-line);
  background: var(--chrome-bg);
  box-shadow: none;
  inset: 100% 0 auto;
  transform: none;
}

html body .brand-header__drawer a,
html body .brand-header__drawer > .button,
html body .brand-header__drawer > span {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--chrome-muted);
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

html body .brand-header__drawer a[aria-current="page"] {
  color: var(--chrome-text);
}

/* The account link in the drawer reads as one more row, not a filled button. */
html body .brand-header__drawer .mobile-navigation__account,
html body .brand-header__drawer .mobile-navigation__account:hover {
  border: 0;
  color: var(--chrome-muted);
  background: transparent;
}

@media (max-width: 900px) {
  html body .brand-header .brand-header__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  html body .brand-header__nav,
  html body .brand-header__login,
  html body .brand-header .header-purchase__original {
    display: none;
  }

  html body .brand-header__toggle {
    display: grid;
  }

  html body .brand-header__drawer.brand-header__drawer--open,
  html body .brand-header__drawer.mobile-navigation--open {
    display: grid;
  }
}

@media (max-width: 620px) {
  html body .brand-header__logo img {
    width: 132px;
  }

  html body .brand-header .brand-header__cta,
  html body .brand-header .header-enroll {
    padding: 0 14px;
    font-size: 13px;
  }
}

@media (max-width: 340px) {
  html body .brand-header .brand-header__cta {
    display: none;
  }
}

/* Short pages still end with the footer at the bottom of the screen. */
html body:has(.brand-header--offset) #root {
  min-height: calc(100dvh - var(--brand-page-header-height) - env(safe-area-inset-top, 0px));
}

html body .brand-page,
html body .checkout-page {
  display: flex;
  min-height: calc(100dvh - var(--brand-page-header-height) - env(safe-area-inset-top, 0px));
  flex-direction: column;
}

html body .brand-page > main,
html body .checkout-page > main {
  min-height: 0;
  flex: 1 0 auto;
}

/* Footer */

html body .site-footer {
  margin-top: auto;
  padding: clamp(40px, 4vw, 56px) var(--brand-chrome-inline) 32px;
  background-color: #030303;
  color: #d4dae3;
}

html body .site-footer {
  position: relative;
}

/* The skyline artwork has a fine dot pattern baked in; soften it. */
html body .site-footer::before {
  position: absolute;
  z-index: 0;
  content: "";
  inset: 0;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  pointer-events: none;
}

html body .site-footer > * {
  position: relative;
  z-index: 1;
}

html body .site-footer__inner {
  display: grid;
  width: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
  gap: clamp(36px, 4vw, 56px);
  margin: 0;
}

html body .site-footer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

html body .site-footer__brand {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}

html body .site-footer a.site-footer__brand-lockup {
  display: inline-flex;
  width: auto;
  min-height: 0;
  margin: 0;
}

html body .site-footer__brand-lockup img {
  display: block;
  width: 168px;
  height: auto;
}

html body .site-footer__brand p {
  margin: 0;
  color: #9197a1;
  font-size: 14px;
  line-height: 1.5;
}

html body .site-footer__contact {
  min-height: 0;
  margin: 0;
  color: #d4dae3;
  font-size: 14px;
  white-space: nowrap;
}

html body .site-footer__main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}

html body .site-footer__menus {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 32px clamp(48px, 6vw, 96px);
}

html body .site-footer__menus section {
  min-width: 0;
}

html body .site-footer__menus h2 {
  margin: 0 0 12px;
  color: #9197a1;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
}

html body .site-footer__menus nav {
  display: grid;
  gap: 2px;
}

html body .site-footer__menus a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  color: #d4dae3;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  text-decoration: none;
}

html body .site-footer a:hover {
  color: #fff;
}

html body .site-footer__company {
  display: grid;
  flex: 0 0 auto;
  gap: 4px;
  color: #d4dae3;
  font-size: 12px;
  line-height: 1.6;
  text-align: right;
}

@media (max-width: 720px) {
  html body .site-footer {
    padding: 32px var(--brand-chrome-inline) calc(24px + env(safe-area-inset-bottom, 0px));
  }

  html body .site-footer__top,
  html body .site-footer__main {
    flex-direction: column;
    align-items: flex-start;
  }

  html body .site-footer__main {
    gap: 28px;
  }

  html body .site-footer__menus {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 24px;
  }

  html body .site-footer__menus a,
  html body .site-footer__contact {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
  }

  html body .site-footer__company {
    text-align: left;
  }
}

/* The course pages' sticky buy bar sits over the bottom of the page. */
@media (max-width: 720px) {
  html body:has(.sticky-checkout) .site-footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
}
