* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--b17-page);
  color: var(--b17-ink);
  font-family: var(--b17-font-sans);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: none;
  box-shadow: var(--b17-focus);
}

.brand-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 72px;
  border-bottom: 1px solid color-mix(in srgb, var(--b17-border) 84%, transparent);
  background: color-mix(in srgb, var(--b17-elevated) 92%, transparent);
  backdrop-filter: blur(16px);
}

.brand-header-inner {
  width: min(calc(100% - 40px), var(--b17-content-max));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand-wordmark {
  flex: 0 0 auto;
  color: var(--b17-ink);
  font-family: var(--b17-font-display);
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
}

.brand-wordmark span {
  color: var(--b17-product-accent);
}

.brand-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand-nav a {
  color: var(--b17-text-secondary);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: color var(--b17-transition);
}

.brand-nav a:hover {
  color: var(--b17-ink);
}

.product-switcher {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--b17-border);
  border-radius: 999px;
  background: var(--b17-page);
}

.product-switcher a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--b17-text-secondary);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.product-switcher a.active {
  background: var(--b17-ink);
  color: var(--b17-elevated);
}

.product-switcher a:not(.active):hover {
  color: var(--b17-ink);
}

.brand-footer {
  background: var(--b17-ink);
  color: var(--b17-elevated);
}

.brand-footer-inner {
  width: min(calc(100% - 40px), var(--b17-content-max));
  margin: 0 auto;
  padding: 56px 0 32px;
}

.brand-footer-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(360px, 1.2fr);
  gap: 56px;
}

.brand-footer h2 {
  margin: 0 0 12px;
  font-family: var(--b17-font-display);
  font-size: 32px;
}

.brand-footer p {
  margin: 0;
  color: #cbd4d1;
}

.brand-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 20px;
}

.brand-footer-links a {
  color: #eef2ef;
  font-size: 14px;
  font-weight: 700;
  text-underline-offset: 4px;
}

.brand-risk {
  padding-left: 20px;
  margin: 0;
  color: #d7dfdc;
}

.brand-risk li + li {
  margin-top: 8px;
}

.brand-footer-meta {
  margin-top: 36px !important;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: #91a3a1 !important;
  font-size: 12px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.status-badge.research {
  color: var(--b17-negative);
}

.status-badge.active,
.status-badge.healthy {
  color: var(--b17-positive);
}

.status-badge.waiting,
.status-badge.attention {
  color: var(--b17-warning);
}

.status-badge.archived,
.status-badge.unavailable {
  color: var(--b17-text-muted);
}

@media (max-width: 820px) {
  html {
    scroll-padding-top: 110px;
  }

  .brand-header-inner {
    width: min(calc(100% - 28px), var(--b17-content-max));
    min-height: 104px;
    flex-wrap: wrap;
    align-content: center;
    gap: 10px 16px;
    padding: 10px 0;
  }

  .brand-nav {
    order: 3;
    width: 100%;
    gap: 18px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .brand-nav::-webkit-scrollbar {
    display: none;
  }

  .brand-nav a {
    white-space: nowrap;
  }

  .product-switcher a {
    min-height: 34px;
    padding: 0 10px;
    font-size: 11px;
  }

  .brand-footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 480px) {
  .brand-wordmark {
    font-size: 21px;
  }

  .product-switcher {
    max-width: calc(100% - 110px);
  }

  .product-switcher a {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
