:root {
  --navigation-header-size: 72px;
  --navigation-line: rgba(199, 154, 69, 0.22);
  --navigation-cold: rgba(111, 234, 255, 0.34);
}

body[data-surface] {
  --page-header-height: var(--navigation-header-size);
}

.site-header.site-header--continuous {
  position: sticky;
  top: 0;
  z-index: 40;
  width: min(var(--max, 1440px), calc(100% - clamp(24px, 4vw, 56px)));
  height: var(--navigation-header-size);
  min-height: var(--navigation-header-size) !important;
  max-height: var(--navigation-header-size);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(16px, 3vw, 42px);
  padding-block: 0 !important;
  border-bottom: 1px solid var(--navigation-line);
  background: linear-gradient(180deg, rgba(2, 2, 2, 0.97), rgba(2, 2, 2, 0.78));
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px) saturate(112%);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.site-header.site-header--continuous.is-condensed {
  height: var(--navigation-header-size);
  min-height: var(--navigation-header-size) !important;
  max-height: var(--navigation-header-size);
  background: linear-gradient(180deg, rgba(2, 2, 2, 0.985), rgba(2, 2, 2, 0.86));
  box-shadow: 0 15px 48px rgba(0, 0, 0, 0.42);
}

.site-header--continuous .brand {
  min-height: 44px;
  flex: 0 0 auto;
}

.site-header--continuous .primary-nav {
  grid-column: auto;
  order: initial;
  width: auto;
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(15px, 2.2vw, 30px);
  overflow-x: auto;
  padding: 0 2px;
  border: 0;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.site-header--continuous .primary-nav::-webkit-scrollbar {
  display: none;
}

.site-header--continuous .primary-nav a {
  position: relative;
  flex: 0 0 auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0;
  color: rgba(226, 220, 204, 0.56);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  scroll-snap-align: center;
}

.site-header--continuous .primary-nav a::before {
  bottom: 6px;
}

.site-header--continuous .primary-nav a::after {
  bottom: 2px;
}

.site-header--continuous .primary-nav a[aria-current="page"],
.site-header--continuous .primary-nav a.is-route-active {
  color: var(--ivory, #f3ecdc);
  text-shadow: 0.7px 0 rgba(111, 234, 255, 0.32), -0.7px 0 rgba(168, 137, 255, 0.2);
}

.site-header--continuous .primary-nav a[aria-current="page"]::before,
.site-header--continuous .primary-nav a.is-route-active::before {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.site-header--continuous .primary-nav a[aria-current="page"]::after,
.site-header--continuous .primary-nav a.is-route-active::after {
  right: 0;
  background: linear-gradient(90deg, var(--gold-bright, #efd28c), var(--cold-cyan, #6feaff));
  box-shadow: 0 0 16px rgba(111, 234, 255, 0.18);
}

.navigation-route {
  min-width: 168px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding-left: 13px;
  border-left: 1px solid rgba(199, 154, 69, 0.18);
  color: rgba(226, 220, 204, 0.54);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.navigation-route__index {
  color: var(--gold-bright, #efd28c);
}

.navigation-route__context {
  max-width: 86px;
  overflow: hidden;
  color: rgba(111, 234, 255, 0.68);
  text-overflow: ellipsis;
}

.navigation-route .status-dot {
  width: 6px;
  height: 6px;
  margin-left: 2px;
}

.route-entry-transition {
  position: fixed;
  inset: var(--navigation-header-size) 0 0;
  z-index: 35;
  pointer-events: none;
  overflow: hidden;
  background:
    linear-gradient(112deg, rgba(239, 210, 140, 0.08), transparent 34%, rgba(111, 234, 255, 0.06) 69%, transparent),
    rgba(1, 1, 1, 0.96);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  animation: route-entry-release 660ms cubic-bezier(.72, 0, .2, 1) both;
}

.route-entry-transition::before {
  content: attr(data-route-index) " / " attr(data-route-label);
  position: absolute;
  top: clamp(22px, 5vw, 64px);
  right: clamp(18px, 4vw, 64px);
  color: rgba(239, 210, 140, 0.72);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  animation: route-entry-label 420ms ease both;
}

.route-entry-transition::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(239, 210, 140, 0.74), rgba(111, 234, 255, 0.54), transparent);
  box-shadow: 0 0 24px rgba(111, 234, 255, 0.13);
}

.route-particle-wake {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.route-particle-wake span {
  position: absolute;
  left: var(--px);
  top: var(--py);
  width: var(--particle-size);
  height: var(--particle-size);
  border-radius: 50%;
  background: #6feaff;
  box-shadow: 0 0 9px rgba(111, 234, 255, 0.72);
  animation: route-particle-release 720ms cubic-bezier(.22, .72, .18, 1) var(--particle-delay) both;
}

.route-particle-wake span:nth-child(3n) {
  background: #efd28c;
  box-shadow: 0 0 10px rgba(239, 210, 140, 0.64);
}

.route-particle-wake span:nth-child(5n) {
  background: #a86bff;
  box-shadow: 0 0 10px rgba(168, 107, 255, 0.55);
}

body.is-route-leaving .route-entry-transition {
  animation: route-exit-cover 280ms cubic-bezier(.72, 0, .2, 1) both;
}

body.is-route-leaving .route-particle-wake span {
  animation: route-particle-gather 280ms cubic-bezier(.72, 0, .2, 1) both;
}

body[data-surface="about"] > .site-header--continuous {
  color: var(--t-fg);
}

body[data-surface="tap"] > .site-header--continuous {
  position: relative;
}

@keyframes route-entry-release {
  0% { opacity: 1; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  68% { opacity: 1; }
  100% { opacity: 0; clip-path: polygon(0 0, 100% 0, 100% 0, 0 12%); visibility: hidden; }
}

@keyframes route-entry-label {
  0% { opacity: 0; transform: translateX(14px); }
  28% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(-8px); }
}

@keyframes route-exit-cover {
  from { opacity: 0; clip-path: polygon(0 100%, 100% 88%, 100% 100%, 0 100%); visibility: visible; }
  to { opacity: 1; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); visibility: visible; }
}

@keyframes route-particle-release {
  0% { opacity: 0.92; transform: translate3d(0, 0, 0) scale(1.15); }
  58% { opacity: 0.62; }
  100% { opacity: 0; transform: translate3d(var(--dx), var(--dy), 0) scale(0.35); }
}

@keyframes route-particle-gather {
  from { opacity: 0; transform: translate3d(var(--dx), var(--dy), 0) scale(0.35); }
  to { opacity: 0.96; transform: translate3d(0, 0, 0) scale(1.2); }
}

@media (max-width: 760px) {
  :root {
    --navigation-header-size: 64px;
  }

  .site-header.site-header--continuous {
    width: calc(100% - (var(--page-gutter, 18px) * 2));
    grid-template-columns: auto minmax(0, 1fr) 30px;
    gap: 10px;
  }

  .site-header--continuous .brand-name {
    display: none;
  }

  .site-header--continuous .primary-nav {
    grid-column: 2;
    order: initial;
    width: auto;
    justify-content: flex-start;
    gap: clamp(11px, 3.8vw, 16px);
  }

  .site-header--continuous .primary-nav a {
    min-height: 44px;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
  }

  .navigation-route {
    min-width: 30px;
    grid-template-columns: 1fr;
    justify-items: end;
    padding-left: 8px;
  }

  .navigation-route__label,
  .navigation-route__context,
  .navigation-route .status-dot {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .route-entry-transition {
    display: none;
  }

  .site-header.site-header--continuous {
    backdrop-filter: none;
    transition: none;
  }
}
