/**
 * Site shell: header nav, trial banner, mobile menu (BEM: site-*)
 * Mobile-first; complements /static/styles.css
 */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 10000;
  padding: 0.75rem 1rem;
  background: var(--primary-color, #32cd32);
  color: #000;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
  border: 2px solid #000;
}

.skip-link:focus {
  top: 1rem;
}

.site-header__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  height: 100%;
}

@media (min-width: 769px) {
  .site-header__nav {
    gap: 2rem;
  }
}

.site-header__nav-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.1rem;
  height: 100%;
  min-height: 45px;
  line-height: 1;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.site-header__nav-link:hover,
.site-header__nav-link:focus-visible {
  color: #b8f5b8;
  border-bottom-color: #32cd32;
  outline: none;
}

.site-header__nav-link:focus-visible {
  box-shadow: 0 0 0 2px #32cd32;
  border-radius: 4px;
}

.site-header__nav-link--current {
  color: #b8f5b8;
  border-bottom-color: #32cd32;
}

/* Beta label (Backtest and related surfaces) */
.tenachine-beta {
  display: inline-flex;
  align-items: center;
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.22rem 0.5rem;
  border-radius: 5px;
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fde68a;
  background: rgba(251, 191, 36, 0.14);
  line-height: 1;
  flex-shrink: 0;
}

.tenachine-beta--nav {
  font-size: 0.55rem;
  padding: 0.14rem 0.4rem;
  margin-left: 0.35rem;
  border-radius: 4px;
}

.mobile-menu-item.is-current .tenachine-beta--nav {
  border-color: rgba(10, 10, 10, 0.35);
  color: #1a1203;
  background: rgba(255, 255, 255, 0.35);
}

.trial-banner {
  display: none;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  padding: 0.75rem 0;
  text-align: center;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  position: relative;
  z-index: 99;
}

.trial-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.trial-banner__action {
  color: #fff;
  text-decoration: underline;
  font-weight: 700;
}

.trial-banner__action:hover,
.trial-banner__action:focus-visible {
  text-decoration: none;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.mobile-menu__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  padding: 0.75rem 0;
}

.mobile-menu__item:focus-visible {
  outline: 2px solid #32cd32;
  outline-offset: 2px;
}

/* Site footer — minimal, centered rows */
.site-footer {
  margin-top: 2rem;
  padding: 2.25rem 2rem 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--bg-primary, #0f0f0f);
}

.site-footer__container {
  max-width: min(42rem, 100%);
  margin: 0 auto;
  padding: 0 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.site-footer__disclaimer {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.52);
  text-align: center;
}

.site-footer__disclaimer a {
  color: var(--primary-color, #32cd32);
  text-decoration: none;
  font-weight: 600;
  margin-left: 0.25rem;
}

.site-footer__disclaimer a:hover,
.site-footer__disclaimer a:focus-visible {
  text-decoration: underline;
  outline: none;
}

/* Cookie consent (pairs with /static/js/cookie-consent.js) */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 11000;
  padding: 1rem;
  background: rgba(12, 12, 12, 0.96);
  border-top: 1px solid rgba(50, 205, 50, 0.28);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
}

.cookie-consent__inner {
  max-width: 52rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-consent__text {
  margin: 0;
  flex: 1 1 16rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
}

.cookie-consent__text a {
  color: var(--primary-color, #32cd32);
  font-weight: 600;
}

.cookie-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cookie-consent__btn {
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cookie-consent__btn--primary {
  background: var(--primary-color, #32cd32);
  color: #0a0a0a;
}

.cookie-consent__btn--primary:hover,
.cookie-consent__btn--primary:focus-visible {
  background: #2dd42d;
  outline: none;
}

.cookie-consent__btn--secondary {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  border-color: rgba(255, 255, 255, 0.14);
}

.cookie-consent__btn--secondary:hover,
.cookie-consent__btn--secondary:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.site-footer__row {
  width: 100%;
  display: flex;
  justify-content: center;
}

.site-footer__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  row-gap: 0.35rem;
}

.site-footer__list li {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.site-footer__list li + li::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 0.85rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.22;
  flex-shrink: 0;
  vertical-align: middle;
}

.site-footer__list--meta li + li::before {
  opacity: 0.18;
  margin: 0 0.65rem;
}

.site-footer__divider {
  width: 2.5rem;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.site-footer__link {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.35rem 0.15rem;
  transition: color 0.15s ease;
}

.site-footer__link:hover,
.site-footer__link:focus-visible {
  color: var(--primary-color, #32cd32);
  outline: none;
}

.site-footer__link:focus-visible {
  outline: 1px solid rgba(50, 205, 50, 0.5);
  outline-offset: 2px;
  border-radius: 2px;
}

.site-footer__link--meta {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  padding: 0.25rem 0.2rem;
}

.site-footer__link--meta:hover,
.site-footer__link--meta:focus-visible {
  color: rgba(255, 255, 255, 0.75);
}

/* Navbar rewrite */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 15, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.header-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-section {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--primary-color, #32cd32);
  color: #0a0a0a;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(50, 205, 50, 0.24);
  flex-shrink: 0;
}

.logo i {
  font-size: 1.05rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.14rem;
}

.brand-name {
  font-size: 1.02rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-subtitle {
  font-size: 0.72rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.58);
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: auto;
  scrollbar-width: none;
}

.site-header__nav::-webkit-scrollbar {
  display: none;
}

.site-header__nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0 0.95rem;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.74);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.site-header__nav-link:hover,
.site-header__nav-link:focus-visible {
  color: #ffffff;
  background: rgba(50, 205, 50, 0.16);
  outline: none;
}

.site-header__nav-link--current {
  color: #0a0a0a;
  background: var(--primary-color, #32cd32);
  box-shadow: 0 8px 18px rgba(50, 205, 50, 0.22);
}

.site-header__nav-link--current:hover,
.site-header__nav-link--current:focus-visible {
  color: #0a0a0a;
  background: #2dd42d;
}

.site-header__nav-link--cta {
  color: #0a0a0a;
  background: var(--primary-color, #32cd32);
  border: 1px solid transparent;
}

.site-header__nav-link--cta:hover,
.site-header__nav-link--cta:focus-visible {
  color: #0a0a0a;
  background: #2dd42d;
}

.mobile-menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.mobile-menu-btn:hover,
.mobile-menu-btn:focus-visible {
  background: rgba(50, 205, 50, 0.16);
  border-color: rgba(50, 205, 50, 0.38);
  outline: none;
}

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 5, 0.66);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: none;
}

.mobile-menu-overlay.show {
  display: block;
}

.mobile-menu-content {
  position: absolute;
  top: 0;
  right: 0;
  width: min(88vw, 360px);
  height: 100%;
  background: #101010;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.35);
  transform: translateX(100%);
  transition: transform 0.24s ease;
  display: flex;
  flex-direction: column;
}

.mobile-menu-overlay.show .mobile-menu-content {
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-menu-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.mobile-menu-close {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.mobile-menu-nav {
  padding: 0.75rem;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.95rem 1rem;
  margin-bottom: 0.35rem;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-weight: 600;
  background: transparent;
  border: 1px solid transparent;
}

.mobile-menu-item:hover,
.mobile-menu-item:focus-visible {
  background: rgba(50, 205, 50, 0.14);
  border-color: rgba(50, 205, 50, 0.2);
  outline: none;
}

.mobile-menu-item.is-current {
  background: var(--primary-color, #32cd32);
  border-color: transparent;
  color: #0a0a0a;
}

@media (max-width: 768px) {
  .header-container {
    padding: 0.8rem 0.9rem;
  }

  .header-container.landing-header__container {
    padding: 0.8rem 0.9rem;
  }

  .brand-subtitle {
    display: none;
  }

  .site-header__nav {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }
}

/* Centered pill nav — same layout as marketing landing (logo | nav | menu) */
.header-container.landing-header__container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.header-container.landing-header__container > .logo-section {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
}

.header-container.landing-header__container > .landing-header__actions {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
}

@media (min-width: 769px) {
  .header-container.landing-header__container .landing-header__pill-nav.desktop-nav {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: max-content;
    max-width: min(96vw, 48rem);
    height: auto;
    min-height: 0;
    padding: 0.5rem 0.65rem;
    gap: 0.35rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(16, 16, 18, 0.82);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    overflow: visible;
    scrollbar-width: none;
  }

  .header-container.landing-header__container .landing-header__pill-nav.desktop-nav::-webkit-scrollbar {
    display: none;
  }

  .header-container.landing-header__container .landing-header__pill-nav .site-header__nav-link {
    border-bottom: none !important;
    box-shadow: none !important;
    min-height: 2.75rem;
    padding: 0.55rem 1rem !important;
    border-radius: 999px;
    font-size: clamp(0.92rem, 1.05vw, 1.05rem) !important;
    font-weight: 600 !important;
    color: rgba(250, 250, 250, 0.9) !important;
    outline: none;
  }

  .header-container.landing-header__container .landing-header__pill-nav .site-header__nav-link--current {
    color: #0a0a0a !important;
    background: var(--primary-color, #32cd32) !important;
    box-shadow: 0 8px 18px rgba(50, 205, 50, 0.22) !important;
  }

  .header-container.landing-header__container .landing-header__pill-nav .site-header__nav-link:hover:not(.site-header__nav-link--current),
  .header-container.landing-header__container .landing-header__pill-nav .site-header__nav-link:focus-visible:not(.site-header__nav-link--current) {
    background: rgba(255, 255, 255, 0.08);
    color: #fff !important;
  }

  .header-container.landing-header__container .landing-header__pill-nav .site-header__nav-link--current:hover,
  .header-container.landing-header__container .landing-header__pill-nav .site-header__nav-link--current:focus-visible {
    color: #0a0a0a !important;
    background: #2dd42d !important;
  }

  .header-container.landing-header__container .landing-header__pill-nav .site-header__nav-link:focus-visible {
    box-shadow: 0 0 0 2px rgba(50, 205, 50, 0.45);
  }

  .header-container.landing-header__container .landing-header__pill-nav .site-header__nav-link--cta:not(.site-header__nav-link--current) {
    background: rgba(50, 205, 50, 0.14) !important;
    border: 1px solid rgba(50, 205, 50, 0.35) !important;
    color: rgba(240, 253, 244, 0.98) !important;
    padding-left: 1.15rem !important;
    padding-right: 1.15rem !important;
  }

  .header-container.landing-header__container .landing-header__pill-nav .site-header__nav-link--cta:not(.site-header__nav-link--current):hover {
    background: rgba(50, 205, 50, 0.22) !important;
    color: #fff !important;
  }

  .header-container.landing-header__container .landing-header__pill-nav .tenachine-beta--nav {
    font-size: 0.68rem;
    padding: 0.2rem 0.5rem;
    margin-left: 0.45rem;
    border-radius: 6px;
  }
}

@media (min-width: 769px) and (max-width: 1040px) {
  .header-container.landing-header__container .landing-header__pill-nav .site-header__nav-link {
    padding: 0.48rem 0.72rem !important;
    font-size: clamp(0.85rem, 1.1vw, 0.95rem) !important;
    min-height: 2.5rem;
  }
}
