/* —— Site header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .site-header {
  background: color-mix(in srgb, var(--surface) 90%, transparent);
}

.site-header.is-hero {
  position: absolute;
  inset: 0 0 auto 0;
  background: transparent;
  border-bottom: none;
  color: #fff;
}

.site-header.is-hero.is-scrolled {
  position: fixed;
  background: color-mix(in srgb, var(--brand-bg) 92%, transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-header__inner {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  z-index: 2;
  min-width: 0;
  flex-shrink: 1;
  max-width: min(52vw, 12.5rem);
}

.brand img {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.brand__meta {
  display: block;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand__version {
  display: none;
}

@media (max-width: 899px) {
  .brand {
    font-size: 0.84rem;
    max-width: calc(100% - 9.5rem);
  }
  .brand img {
    width: 24px;
    height: 24px;
  }
  /* Hero already has Request demo — free header space on small phones */
  .header-actions .btn-sm {
    display: none;
  }
}

@media (min-width: 420px) and (max-width: 899px) {
  .header-actions .btn-sm {
    display: inline-flex;
  }
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.15rem;
}

.nav-desktop > a,
.nav-mega__btn {
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--ink-muted);
  transition: color 0.2s, background 0.2s;
}

.nav-desktop > a:hover,
.nav-desktop > a.is-active,
.nav-mega__btn:hover,
.nav-mega.is-open .nav-mega__btn {
  color: var(--ink);
  background: var(--surface-3);
}

.site-header.is-hero .nav-desktop > a,
.site-header.is-hero .nav-mega__btn {
  color: rgba(255, 255, 255, 0.78);
}
.site-header.is-hero .nav-desktop > a:hover,
.site-header.is-hero .nav-desktop > a.is-active,
.site-header.is-hero .nav-mega__btn:hover,
.site-header.is-hero .nav-mega.is-open .nav-mega__btn {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* Multi-column pages mega menu */
.nav-mega {
  position: relative;
}

.nav-mega__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.nav-mega__btn svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s var(--ease);
}

.nav-mega.is-open .nav-mega__btn svg {
  transform: rotate(180deg);
}

.nav-mega__panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: min(720px, calc(100vw - 2rem));
  padding: 1.15rem 1.25rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid rgba(228, 184, 74, 0.22);
  background:
    linear-gradient(165deg, rgba(19, 72, 67, 0.98) 0%, rgba(11, 46, 43, 0.99) 60%, #071c1a 100%);
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  color: #e8f2ef;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
  z-index: 120;
}

.nav-mega.is-open .nav-mega__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-mega__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.nav-mega__col h4 {
  margin: 0 0 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.nav-mega__col a {
  display: block;
  padding: 0.35rem 0.4rem;
  margin: 0 -0.4rem;
  border-radius: 5px;
  font-size: 0.84rem;
  color: rgba(232, 242, 239, 0.82);
  transition: background 0.15s, color 0.15s;
}

.nav-mega__col a:hover,
.nav-mega__col a.is-active {
  color: #fff;
  background: rgba(228, 184, 74, 0.14);
}

.nav-mega__foot {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(228, 184, 74, 0.18);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: rgba(232, 242, 239, 0.55);
}

.nav-mega__foot a {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.nav-mega__foot a:hover {
  color: #fff;
}

@media (max-width: 899px) {
  .nav-mega { display: none; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  z-index: 2;
}

.header-actions .btn-sm {
  min-height: 36px;
  height: 36px;
  padding: 0 0.9rem;
  border-radius: 8px;
  box-sizing: border-box;
}

.header-actions .icon-btn {
  width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 8px;
  box-sizing: border-box;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  box-sizing: border-box;
  flex-shrink: 0;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

[data-theme-toggle] svg {
  color: var(--brand-bg);
}

[data-theme="dark"] [data-theme-toggle] svg {
  color: var(--accent);
}

.icon-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-3);
}

.site-header.is-hero .icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.site-header.is-hero [data-theme-toggle] svg {
  color: #fff;
}

.menu-toggle {
  display: inline-flex;
}

@media (min-width: 900px) {
  .nav-desktop { display: flex; }
  .menu-toggle { display: none; }
}

/* Mobile drawer */
.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  visibility: hidden;
}

.nav-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

.nav-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 28, 0.45);
  opacity: 0;
  transition: opacity 0.25s;
}

.nav-drawer.is-open .nav-drawer__backdrop {
  opacity: 1;
}

.nav-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(80vw, 288px);
  height: 100%;
  background: var(--surface);
  color: var(--ink);
  padding: 0.75rem 0.65rem 1rem;
  transform: translateX(100%);
  transition: transform 0.3s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.nav-drawer.is-open .nav-drawer__panel {
  transform: none;
}

.nav-drawer__panel a,
.nav-drawer__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.5rem;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.2;
  min-height: 32px;
}

.nav-drawer__panel a svg,
.nav-drawer__link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--brand-bg);
  opacity: 0.88;
}

[data-theme="dark"] .nav-drawer__panel a svg,
[data-theme="dark"] .nav-drawer__link svg {
  color: var(--accent);
}

.nav-drawer__panel a:hover,
.nav-drawer__panel a.is-active {
  background: var(--surface-2);
}

.nav-drawer__panel a.is-active {
  color: var(--brand-bg);
}

[data-theme="dark"] .nav-drawer__panel a.is-active {
  color: var(--accent);
}

.nav-drawer__close {
  align-self: flex-end;
  width: 34px;
  height: 34px;
  margin-bottom: 0.2rem;
}

.nav-drawer__close svg {
  width: 16px;
  height: 16px;
}

.nav-drawer__label {
  margin: 0.55rem 0.55rem 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
}

/* Bottom nav (mobile) */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

[data-theme="dark"] .bottom-nav {
  background: rgba(18, 21, 42, 0.94);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--ink-faint);
  min-height: var(--bottom-nav-h);
}

.bottom-nav a.is-active,
.bottom-nav a:hover {
  color: var(--brand-bg);
}

[data-theme="dark"] .bottom-nav a.is-active,
[data-theme="dark"] .bottom-nav a:hover {
  color: var(--brand-accent);
}

.bottom-nav svg {
  width: 20px;
  height: 20px;
}

@media (min-width: 900px) {
  .bottom-nav { display: none; }
}

body.page-hero .bottom-nav {
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: #071c1a;
  color: #e8eaf5;
  padding: 3.5rem 0 2rem;
}

[data-theme="dark"] .site-footer {
  background: #0a0c18;
  border-top: 1px solid var(--border);
}

.site-footer a {
  color: rgba(232, 234, 245, 0.75);
  transition: color 0.2s;
}
.site-footer a:hover {
  color: #fff;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 1.4fr repeat(3, 1fr);
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-brand p {
  color: rgba(232, 234, 245, 0.65);
  max-width: 28ch;
  font-size: 0.925rem;
  margin: 0;
}

.footer-col h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
  color: rgba(232, 234, 245, 0.45);
  margin-bottom: 1rem;
}

.footer-col ul {
  display: grid;
  gap: 0.55rem;
}

.footer-col a {
  font-size: 0.9rem;
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(232, 234, 245, 0.55);
}

.footer-sonojs {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--brand-accent) !important;
}

.footer-sonojs:hover {
  color: #f0d078 !important;
}

/* Hero-page chrome overlays */
.hero-chrome {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

.hero-chrome .pointer-auto {
  pointer-events: auto;
}

.hero-cta-row {
  position: absolute;
  left: 1.5rem;
  bottom: calc(var(--bottom-nav-h) + 1.25rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  pointer-events: auto;
  z-index: 40;
}

@media (min-width: 900px) {
  .hero-cta-row {
    left: 2.5rem;
    bottom: 2rem;
  }
}
