/* ── Site shell: sticky header, mobile nav, footer grid, access chrome ── */

#site-header:empty,
#site-footer:empty {
  min-height: 64px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(5, 12, 24, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  margin: 0;
  max-width: none;
  padding: 0;
}

.site-header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-header .header-nav a.nav-active,
.site-header .header-nav a[aria-current="page"] {
  color: var(--text);
  position: relative;
}
.site-header .header-nav a.nav-active::after,
.site-header .header-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--violet), var(--indigo));
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.site-header.is-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.is-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.site-header.is-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-nav-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 510;
  width: min(300px, 85vw);
  padding: calc(72px + env(safe-area-inset-top, 0px)) 20px calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--bg2);
  border-left: 1px solid var(--border);
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  pointer-events: none;
}
.mobile-nav-panel.is-open {
  transform: translateX(0);
  pointer-events: auto;
}
.mobile-nav-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 14px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.mobile-nav-panel a {
  display: block;
  padding: 12px 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.mobile-nav-panel a:hover,
.mobile-nav-panel a.nav-active { color: var(--violet-light); }
.mobile-nav-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 20px 0 8px;
  opacity: 0.75;
}
.mobile-nav-panel .btn-primary {
  width: 100%;
  justify-content: center;
  margin-top: 24px;
}

/* Access section chrome */
.access-strip {
  position: relative;
  z-index: 15;
  background: linear-gradient(180deg, rgba(27, 79, 232, 0.12) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}
.access-strip-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 0;
}
.access-strip h2 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--violet-light);
  margin-bottom: 12px;
}
.access-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 16px;
}
.access-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.access-tab:hover {
  color: var(--text);
  border-color: var(--border-hi);
}
.access-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(27, 79, 232, 0.5), rgba(227, 24, 35, 0.25));
  border-color: var(--border-hi);
}

.doc-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.doc-pager a {
  flex: 1 1 200px;
  display: block;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.doc-pager a:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
}
.doc-pager-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.doc-pager-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--violet-light);
}
.doc-pager a.doc-pager-next { text-align: right; }

/* Footer */
.site-footer {
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--border);
  padding: 56px 24px 32px;
  background: linear-gradient(180deg, transparent, rgba(8, 15, 31, 0.9));
}
.site-footer-grid {
  max-width: 1140px;
  margin: 0 auto 40px;
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px 32px;
}
.footer-brand img { height: 36px; width: auto; opacity: 0.95; margin-bottom: 14px; }
.footer-brand p {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
  max-width: 280px;
}
.footer-col h4 {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--violet-light);
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 5px 0;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  max-width: 1140px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.85;
}
.footer-bottom a { color: var(--amber-light); text-decoration: none; }
.footer-bottom a:hover { text-decoration: underline; }

body.nav-open { overflow: hidden; }

@media (max-width: 900px) {
  .site-footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 1024px) {
  .site-header .header-nav { gap: 16px; }
  .site-header .header-nav a { font-size: 0.78rem; white-space: nowrap; }
}

@media (max-width: 960px) {
  .site-header .header-cta { display: none !important; }
}

@media (max-width: 900px) {
  .site-header .header-nav { display: none !important; }
  .nav-toggle { display: flex; }
}

@media (max-width: 768px) {
  .site-header-inner {
    padding: 10px 14px;
    gap: 10px;
  }
  .site-header .header-badge { display: none; }
  .logo { flex-shrink: 0; min-width: 0; }
  .logo-img {
    height: 34px;
    width: auto;
    max-width: min(130px, 38vw);
  }
  .header-right {
    flex-shrink: 0;
    margin-left: auto;
  }
  .site-footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .access-strip-inner { padding: 16px 14px 0; }
  .access-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 12px;
    margin: 0 -4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .access-tabs::-webkit-scrollbar { display: none; }
  .access-tab { flex-shrink: 0; font-size: 0.76rem; padding: 7px 14px; }
  body[data-page^="access"] .page-sidebar { display: none !important; }
  .doc-pager a.doc-pager-next { text-align: left; }
  .doc-pager a { flex: 1 1 100%; }
}

/* Sidebar polish on access docs */
.page-sidebar {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.hub-card {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}
