/* Canonical design tokens (B01) — pulled in here too so pages that inject the
   shared nav but don't load the full style.css (embed / standalone surfaces)
   still resolve the design vocabulary. The --nv-* fallbacks below remain as a
   belt-and-braces default if neither stylesheet is present. */
@import url('/tokens.css');
/* ─────────────────────────────────────────────────────────────────────────
   three.ws shared site navigation
   Single source of truth for the global header. Mirrors the homepage nav
   (pages/home.html) so every page that injects #nav-container looks identical
   to the homepage. Self-contained: design tokens fall back to the homepage
   palette when a host page doesn't define them.
   ───────────────────────────────────────────────────────────────────────── */

/* The header-height reservation that keeps a page from shifting when nav.js
   injects the header lives in tokens.css, not here: nav.css is injected by
   nav.js itself, so it always arrives too late to reserve anything on a page
   that does not also link it in <head>. See "Injected-nav height reservation"
   in public/tokens.css. */

.nav,
.nav-drawer {
	--nv-bg:              var(--bg, #050505);
	--nv-surface-1:       var(--surface-1, #111111);
	--nv-surface-2:       var(--surface-2, #181818);
	--nv-hairline:        var(--hairline, #1c1c1c);
	--nv-hairline-strong: var(--hairline-strong, #2a2a2a);
	--nv-text:            var(--text, #f6f6f6);
	--nv-text-2:          var(--text-2, #a8a8a8);
	--nv-text-3:          var(--text-3, #6a6a6a);
	--nv-text-4:          var(--text-4, #4a4a4a);
	--nv-font-display:    var(--font-display, "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif);
	--nv-font-mono:       var(--font-mono, "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace);
	box-sizing: border-box;
}
.nav *, .nav-drawer * { box-sizing: border-box; }

/* ── NAV ─────────────────────────────────────────────────────── */
.nav {
	position: sticky; top: 0; z-index: 100;
	border-bottom: 1px solid var(--nv-hairline);
	/* Token-driven so the header flips under [data-theme='light']; falls back to
	   the near-black brand bar when no theme var is set (dark default). */
	background: var(--nv-bar-bg, rgba(5,5,5,0.82));
	backdrop-filter: blur(20px) saturate(140%);
	-webkit-backdrop-filter: blur(20px) saturate(140%);
}
.nav a { color: inherit; text-decoration: none; }
.nav button { font-family: inherit; cursor: pointer; }
.nav-inner {
	display: flex; align-items: center; gap: 32px;
	padding: 16px 32px; max-width: 1440px; margin: 0 auto;
}
.nav .brand {
	display: flex; align-items: center; gap: 10px;
	font-family: var(--nv-font-display);
	font-weight: 600; letter-spacing: -0.025em; font-size: var(--text-base);
	color: var(--nv-text); flex-shrink: 0;
}
.nav .brand-mark {
	width: 24px; height: 24px;
	border-radius: 5px;
	display: block;
	flex-shrink: 0;
}
.nav-main { display: flex; align-items: center; gap: 2px; margin-left: 12px; flex: 1; }
.nav-main > a {
	display: inline-flex; align-items: center;
	padding: 7px 12px; font-size: var(--text-ui); font-weight: 450;
	color: var(--nv-text-2); transition: color 0.12s;
}
.nav-main > a:hover,
.nav-main > a[aria-current="page"] { color: var(--nv-text); }
.nav-mi[aria-current="page"] .nav-mi-t { color: var(--nv-text); }
.nav-mi[aria-current="page"] { background: var(--nv-surface-1); }
.nav-drawer a[aria-current="page"] { color: var(--nv-text); background: var(--nv-surface-1); }
.nav-end { display: flex; align-items: center; gap: 4px; }
.nav-end a {
	display: inline-flex; align-items: center;
	padding: 7px 12px; font-size: var(--text-ui); font-weight: 450; color: var(--nv-text-2);
	transition: color 0.12s, border-color 0.15s, background 0.15s;
}
.nav-end a:hover { color: var(--nv-text); }
.nav-end .console {
	color: var(--nv-text); font-weight: 500;
	border: 1px solid var(--nv-hairline-strong);
	padding: 7px 16px; border-radius: 7px; margin-left: 6px;
}
.nav-end .console:hover { border-color: var(--nv-text); background: rgba(255,255,255,0.04); }
.nav-end [hidden] { display: none; }

/* $THREE holder tier chip. The chip's own look (pill, tier colours) is injected
   by src/three-access.js (.tg-badge / .tg-tier-*), but `.nav-end a` would override
   its colour + padding at higher specificity — so restate the tier palette here,
   scoped above `.nav-end a`, to let the chip read true. */
.nav-end .nav-tier-badge:not([hidden]) { display: inline-flex; align-items: center; margin: 0 2px; }
.nav-end .nav-tier-badge a { padding: 5px 11px; font-weight: 600; color: #6ee7a8; }
.nav-end .nav-tier-badge a:hover { color: #8af0c0; }
.nav-end .nav-tier-badge a.tg-tier-silver { color: #cfd6e4; }
.nav-end .nav-tier-badge a.tg-tier-gold,
.nav-end .nav-tier-badge a.tg-tier-genesis { color: #f5c451; }
/* Collapse the chip to just the ◆ on the tightest viewports — the link's aria-label
   keeps the tier reachable and announced; no layout regression at any breakpoint. */
@media (max-width: 520px) {
	.nav-end .nav-tier-badge .tg-tier-label { display: none; }
	.nav-end .nav-tier-badge a { padding: 5px 8px; }
}

/* Global search button — opens the Cmd-K command palette */
.nav-search-btn {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 7px 12px; font-size: var(--text-ui); font-weight: 450;
	color: var(--nv-text-2); background: none;
	border: 1px solid var(--nv-hairline-strong); border-radius: 7px;
	font-family: inherit; cursor: pointer;
	transition: color 0.12s, border-color 0.15s, background 0.15s;
}
.nav-search-btn:hover { color: var(--nv-text); border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.04); }
.nav-search-btn:active { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.22); }
.nav-search-btn:focus-visible { outline: 2px solid rgba(255,255,255,0.4); outline-offset: 2px; }
.nav-search-ico { width: 14px; height: 14px; flex-shrink: 0; }
.nav-search-label { font-size: var(--text-md); }
.nav-search-hint {
	font-family: var(--nv-font-mono, ui-monospace, monospace);
	font-size: var(--text-xs); font-weight: 600; letter-spacing: .06em;
	color: var(--nv-text-2); background: var(--nv-surface-1);
	border: 1px solid var(--nv-hairline-strong);
	border-radius: 4px; padding: 2px 5px;
}
@media (max-width: 1080px) {
	.nav-search-label { display: none; }
	.nav-search-hint { display: none; }
	/* Collapse to a square icon button that matches the notifications bell,
	   instead of a wide pill wrapping a tiny off-balance icon. */
	.nav-search-btn {
		width: 36px; height: 36px; padding: 0;
		justify-content: center; border-radius: 8px;
		border-color: transparent;
	}
	.nav-search-ico { width: 16px; height: 16px; }
}

/* ── Notifications bell button ───────────────────────────────── */
.nav-notif-btn {
	position: relative;
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px;
	color: var(--nv-text-2); background: none;
	border: 1px solid transparent; border-radius: 8px;
	cursor: pointer; font-family: inherit;
	transition: color 0.12s, border-color 0.15s, background 0.15s;
	flex-shrink: 0;
}
.nav-notif-btn:hover { color: var(--nv-text); border-color: var(--nv-hairline-strong); background: rgba(255,255,255,0.04); }
.nav-notif-btn:focus-visible { outline: 2px solid rgba(255,255,255,0.4); outline-offset: 2px; }
.nav-notif-btn[aria-expanded="true"] { color: var(--nv-text); border-color: var(--nv-hairline-strong); background: rgba(255,255,255,0.06); }
.nav-notif-ico { display: block; }
.nav-notif-badge {
	position: absolute; top: 4px; right: 4px;
	min-width: 14px; height: 14px;
	padding: 0 3px;
	background: #ef4444; color: #fff;
	font-size: var(--text-xs); font-weight: 700; line-height: 14px;
	border-radius: 7px; text-align: center;
	border: 1.5px solid var(--nv-bg, #050505);
	pointer-events: none;
}

/* ── Theme toggle (dark ⇄ light) ─────────────────────────────────
   Same 36×36 icon-button chrome as the notifications bell. Shows the moon in
   dark (click → go light) and the sun in light (click → go dark); the icon swap
   is driven purely by the [data-theme] attribute on <html>, so it is correct on
   first paint with no JS. */
.nav-theme-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px;
	color: var(--nv-text-2); background: none;
	border: 1px solid transparent; border-radius: 8px;
	cursor: pointer; font-family: inherit;
	transition: color 0.12s, border-color 0.15s, background 0.15s;
	flex-shrink: 0;
}
.nav-theme-btn:hover { color: var(--nv-text); border-color: var(--nv-hairline-strong); background: var(--nv-tint, rgba(255,255,255,0.04)); }
.nav-theme-btn:active { background: var(--nv-tint-strong, rgba(255,255,255,0.08)); }
.nav-theme-btn:focus-visible { outline: 2px solid var(--focus-ring-color, rgba(255,255,255,0.4)); outline-offset: 2px; }
.nav-theme-ico { display: block; }
.nav-theme-ico.sun { display: none; }
/* In light mode, show the sun (offering a return to dark) and hide the moon. */
:root[data-theme='light'] .nav-theme-ico.moon { display: none; }
:root[data-theme='light'] .nav-theme-ico.sun { display: block; }

/* Light-mode nav polish — the shared header buttons hardcode faint white-tint
   hovers that wash out on a light bar; remap them to faint ink tints so hover
   and active states stay legible. */
:root[data-theme='light'] .nav-search-btn:hover,
:root[data-theme='light'] .nav-notif-btn:hover,
:root[data-theme='light'] .nav-end .console:hover {
	border-color: var(--nv-hairline-strong);
	background: rgba(15, 18, 28, 0.05);
}
:root[data-theme='light'] .nav-search-btn:active,
:root[data-theme='light'] .nav-notif-btn[aria-expanded="true"] {
	background: rgba(15, 18, 28, 0.08);
}

/* The three floating nav surfaces (dropdown, notifications popover, mobile
   drawer) were authored as opaque near-black panels, but the text inside them
   is token-driven and flips to dark ink under [data-theme='light'] — so in
   light mode every menu on every page rendered dark ink on a dark panel. The
   panels flip with the ink; their shadows stay dark, which is correct on a
   light canvas too. */
:root[data-theme='light'] .nav-pop {
	background: rgba(255, 255, 255, 0.98);
	box-shadow: 0 10px 40px rgba(15, 18, 28, 0.14), 0 2px 8px rgba(15, 18, 28, 0.08);
}
:root[data-theme='light'] .notif-panel {
	background: #ffffff;
	border-color: var(--stroke-strong, rgba(15, 18, 28, 0.16));
	box-shadow: 0 8px 40px rgba(15, 18, 28, 0.18), 0 2px 8px rgba(15, 18, 28, 0.1);
}
:root[data-theme='light'] .nav-drawer {
	background: rgba(255, 255, 255, 0.97);
}
/* Scrollbar thumb + any white-tint separators inside the popovers need the same
   inversion, or they vanish against the now-light panel. */
:root[data-theme='light'] .nav-pop::-webkit-scrollbar-thumb {
	background: rgba(15, 18, 28, 0.18);
}

/* ── Notifications popover panel ─────────────────────────────── */
.notif-panel {
	position: fixed; z-index: 9999;
	width: 360px; max-height: 480px;
	background: #0d0d0d;
	border: 1px solid rgba(255,255,255,0.12);
	border-radius: 12px;
	box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.4);
	display: flex; flex-direction: column;
	overflow: hidden;
	animation: notif-in 0.14s ease;
}
@keyframes notif-in {
	from { opacity: 0; transform: translateY(-6px) scale(0.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}
.notif-panel-head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 12px 16px 10px;
	border-bottom: 1px solid rgba(255,255,255,0.08);
	flex-shrink: 0;
}
.notif-panel-title {
	font-size: var(--text-md); font-weight: 600; color: rgba(255,255,255,0.9);
	letter-spacing: -0.01em;
}
.notif-mark-all {
	background: none; border: 0; padding: 3px 8px; border-radius: 6px;
	font-size: var(--text-2xs); font-weight: 500; color: rgba(255,255,255,0.4);
	cursor: pointer; font-family: inherit;
	transition: color 0.12s, background 0.12s;
}
.notif-mark-all:hover { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.06); }
.notif-mark-all:focus-visible { outline: 2px solid rgba(255,255,255,0.3); outline-offset: 1px; }
.notif-mark-all:disabled { opacity: 0.45; cursor: default; }
.notif-prefs-link {
	display: flex; align-items: center; justify-content: center;
	width: 24px; height: 24px; border-radius: 6px;
	font-size: var(--text-sm); color: rgba(255,255,255,0.4);
	text-decoration: none; line-height: 1;
	transition: color 0.12s, background 0.12s;
}
.notif-prefs-link:hover { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.06); }
.notif-prefs-link:focus-visible { outline: 2px solid rgba(255,255,255,0.3); outline-offset: 1px; }
.notif-panel-body { overflow-y: auto; flex: 1; }
.notif-panel-body::-webkit-scrollbar { width: 4px; }
.notif-panel-body::-webkit-scrollbar-track { background: transparent; }
.notif-panel-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
.notif-panel-viewall {
	display: block; text-align: center;
	padding: 10px; flex-shrink: 0;
	font-size: var(--text-sm); font-weight: 500; color: rgba(255,255,255,0.5);
	border-top: 1px solid rgba(255,255,255,0.08);
	text-decoration: none;
	transition: color 0.12s, background 0.12s;
}
.notif-panel-viewall:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.04); }
.notif-panel-viewall:focus-visible { outline: 2px solid rgba(255,255,255,0.3); outline-offset: -2px; }

/* notification rows */
.notif-row {
	display: flex; align-items: flex-start; gap: 10px;
	padding: 11px 14px;
	border-bottom: 1px solid rgba(255,255,255,0.05);
	cursor: pointer;
	transition: background 0.1s;
}
.notif-row:last-child { border-bottom: 0; }
.notif-row:hover { background: rgba(255,255,255,0.04); }
.notif-row:focus-visible { outline: 2px solid rgba(255,255,255,0.3); outline-offset: -2px; border-radius: 2px; }
.notif-row.is-unread { background: rgba(255,255,255,0.025); }
.notif-row.is-unread:hover { background: rgba(255,255,255,0.05); }
.notif-type-icon { font-size: 16px; line-height: 1; margin-top: 2px; flex-shrink: 0; }
.notif-row-body { flex: 1; min-width: 0; }
.notif-row-msg { font-size: var(--text-md); color: rgba(255,255,255,0.82); line-height: 1.45; word-break: break-word; }
.notif-row.is-unread .notif-row-msg { color: rgba(255,255,255,0.95); font-weight: 500; }
.notif-row-time { font-size: var(--text-2xs); color: rgba(255,255,255,0.35); margin-top: 2px; }
.notif-unread-dot {
	width: 7px; height: 7px; border-radius: 50%;
	background: #3b82f6; flex-shrink: 0; margin-top: 5px; align-self: flex-start;
}

/* empty / logged-out states */
.notif-empty {
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	padding: 36px 20px; text-align: center; gap: 6px;
}
.notif-empty-icon { font-size: 28px; line-height: 1; margin-bottom: 4px; }
.notif-empty-title { font-size: var(--text-md); font-weight: 600; color: rgba(255,255,255,0.75); }
.notif-empty-sub { font-size: var(--text-sm); color: rgba(255,255,255,0.38); line-height: 1.5; max-width: 240px; }
.notif-signin-btn {
	display: inline-flex; align-items: center; justify-content: center;
	margin-top: 10px; padding: 8px 18px; border-radius: 8px;
	font-size: var(--text-md); font-weight: 500; color: #fff;
	background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18);
	text-decoration: none;
	transition: background 0.12s, border-color 0.12s;
	/* Shared by the sign-in link and the retry <button>, so normalize both. */
	font-family: inherit; line-height: inherit; cursor: pointer;
}
.notif-signin-btn:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.28); }
.notif-signin-btn:focus-visible { outline: 2px solid rgba(255,255,255,0.4); outline-offset: 2px; }

/* Value-moment push prompt — shown inside the inbox panel, never on load. */
.notif-push-banner {
	display: flex; flex-direction: column; gap: 10px;
	margin: 8px; padding: 12px 14px; border-radius: 12px;
	background: linear-gradient(135deg, rgba(106,92,255,0.16), rgba(255,92,168,0.12));
	border: 1px solid rgba(106,92,255,0.32);
}
.notif-push-copy { display: flex; align-items: flex-start; gap: 8px; font-size: var(--text-sm); color: rgba(255,255,255,0.86); line-height: 1.45; }
.notif-push-icon { flex: none; }
.notif-push-actions { display: flex; gap: 8px; }
.notif-push-enable {
	flex: 1; padding: 7px 12px; border-radius: 8px; cursor: pointer;
	font-size: var(--text-sm); font-weight: 600; color: #fff;
	background: linear-gradient(135deg, #6a5cff, #ff5ca8); border: none;
	transition: filter 0.12s, transform 0.06s;
}
.notif-push-enable:hover:not(:disabled) { filter: brightness(1.08); }
.notif-push-enable:active:not(:disabled) { transform: translateY(1px); }
.notif-push-enable:disabled { opacity: 0.65; cursor: default; }
.notif-push-dismiss {
	padding: 7px 12px; border-radius: 8px; cursor: pointer;
	font-size: var(--text-sm); color: rgba(255,255,255,0.6);
	background: transparent; border: 1px solid rgba(255,255,255,0.16);
	transition: color 0.12s, border-color 0.12s;
}
.notif-push-dismiss:hover { color: rgba(255,255,255,0.85); border-color: rgba(255,255,255,0.3); }
.notif-push-enable:focus-visible, .notif-push-dismiss:focus-visible { outline: 2px solid rgba(255,255,255,0.5); outline-offset: 2px; }

@media (max-width: 480px) {
	.notif-panel { width: calc(100vw - 16px); }
}

/* Walk Companion toggle — lives in the nav, loads the avatar on demand */
.nav-walk-toggle {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 7px 12px; font-size: var(--text-ui); font-weight: 450;
	color: var(--nv-text-2); background: none;
	border: 1px solid transparent; border-radius: 7px;
	font-family: inherit; cursor: pointer;
	transition: color 0.12s, border-color 0.15s, background 0.15s;
}
.nav-walk-toggle:hover { color: var(--nv-text); border-color: var(--nv-hairline-strong); }
.nav-walk-toggle.is-on {
	color: var(--nv-text); border-color: var(--nv-hairline-strong);
	background: rgba(255,255,255,0.04);
}
.nav-walk-ico { font-size: var(--text-ui); line-height: 1; }

@media (max-width: 880px) {
	.nav-main { display: none; }
	.nav-inner { padding: 14px 20px; gap: 16px; }
	/* 44px minimum touch targets: expand the brand's hit area without moving it */
	.nav .brand { padding: 10px 8px; margin: -10px -8px; }
}

/* ── NAV DROPDOWNS ───────────────────────────────────────────── */
.nav-grp { position: relative; display: flex; }
.nav-trigger {
	display: inline-flex; align-items: center; gap: 5px;
	padding: 7px 12px; font-size: var(--text-ui); font-weight: 450;
	color: var(--nv-text-2); background: none; border: 0;
	border-radius: 7px; font-family: inherit; cursor: pointer;
	transition: color 0.12s, background 0.12s;
}
.nav-trigger:hover,
.nav-grp.open .nav-trigger { color: var(--nv-text); }
.nav-grp.open .nav-trigger { background: rgba(255,255,255,0.04); }
.nav-caret { font-size: var(--text-xs); opacity: 0.55; transition: transform 0.2s ease; }
.nav-grp.open .nav-caret { transform: rotate(180deg); }
.nav-pop {
	position: absolute; top: calc(100% + 9px); left: 0;
	min-width: 272px; padding: 7px;
	background: rgba(11,11,11,0.97);
	backdrop-filter: blur(24px) saturate(140%);
	-webkit-backdrop-filter: blur(24px) saturate(140%);
	border: 1px solid var(--nv-hairline-strong);
	border-radius: 13px;
	box-shadow: 0 20px 54px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.4);
	display: grid; gap: 1px;
	/* Cap every dropdown to the viewport so long menus (Build, Discover, …)
	   scroll their tail instead of running off the bottom of the screen where
	   the items become unclickable. The header is ~56px tall and the popover
	   opens 9px below it, so reserve ~90px total to keep a comfortable margin. */
	max-height: calc(100vh - 90px);
	overflow-y: auto;
	overscroll-behavior: contain;
	opacity: 0; transform: translateY(-6px) scale(0.985);
	transform-origin: top left; pointer-events: none;
	transition: opacity 0.16s ease, transform 0.16s ease;
	z-index: 200;
}
.nav-pop::-webkit-scrollbar { width: 4px; }
.nav-pop::-webkit-scrollbar-track { background: transparent; }
.nav-pop::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
/* invisible hover bridge so the menu doesn't close in the gap */
.nav-pop::before {
	content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 12px;
}
.nav-grp.open .nav-pop {
	opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
}
/* Two-column popover for mid-size menus (Integrations). */
.nav-pop.wide {
	grid-template-columns: 1fr 1fr;
	min-width: 540px;
	max-width: calc(100vw - 24px);
}
/* Categorized mega menu — intent-named columns. Left-anchored by default;
   add .anchor-right for the rightmost groups so they don't run off the viewport.
   Column count comes from .cols-N (set by the renderer from columns.length).
   The viewport cap + scroll are inherited from .nav-pop. */
.nav-pop.mega {
	max-width: calc(100vw - 24px);
	grid-template-columns: repeat(3, 1fr);
	gap: 2px 6px; padding: 8px;
}
.nav-pop.mega.cols-2 { grid-template-columns: repeat(2, 1fr); min-width: 460px; }
.nav-pop.mega.cols-3 { grid-template-columns: repeat(3, 1fr); min-width: 632px; }
.nav-pop.mega.cols-4 { grid-template-columns: repeat(4, 1fr); min-width: 824px; }
.nav-pop.mega.anchor-right {
	left: auto; right: 0;
	transform-origin: top right;
}
.nav-col { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nav-col-h {
	font-family: var(--nv-font-mono); font-size: var(--text-xs);
	text-transform: uppercase; letter-spacing: 0.14em;
	color: var(--nv-text-4); padding: 9px 12px 5px;
}
.nav-mi {
	display: block; padding: 9px 12px; border-radius: 9px;
	transition: background 0.12s;
}
.nav-mi:hover { background: var(--nv-surface-2); }
.nav-mi-t {
	display: flex; align-items: center; gap: 6px;
	font-size: var(--text-md); font-weight: 500; color: var(--nv-text);
	letter-spacing: -0.01em;
}
.nav-mi-d {
	display: block; font-size: var(--text-sm); color: var(--nv-text-3);
	margin-top: 1px; line-height: 1.4;
}
.nav-pill-sm {
	display: inline-block; padding: 1px 5px;
	font-family: var(--nv-font-mono); font-size: 8.5px; font-weight: 600;
	letter-spacing: 0.08em; line-height: 1.5; border-radius: 4px;
	background: rgba(255,255,255,0.1); color: var(--nv-text);
	text-transform: uppercase;
}
/* "live" tone — this feature is running right now, not merely new. */
.nav-pill-live {
	background: rgba(88,214,141,0.12); color: #6fdf9d;
	box-shadow: inset 0 0 0 1px rgba(88,214,141,0.22);
}
/* "new" tone — recently shipped. Distinct from "live" on purpose: a new
   surface is worth a look, a live one is worth watching. */
.nav-pill-new {
	background: rgba(139,92,246,0.16); color: var(--accent-violet);
	box-shadow: inset 0 0 0 1px rgba(139,92,246,0.3);
}

/* ── "Hot" top-level link — the one feature the nav spotlights ──────────── */
/* Iridescent thread shared with the Forge brand (home #home-forge --hf-iris). */
.nav-main > a.nav-hot {
	gap: 7px; margin-left: 4px; padding: 4px 12px 4px 10px;
	border: 1px solid rgba(255,255,255,0.14); border-radius: 999px;
	color: var(--nv-text); font-weight: 500; white-space: nowrap;
	/* explicit — pages like /forge set a 56px line-height on nav anchors */
	line-height: 1.4;
	background: rgba(255,255,255,0.03);
	transition: border-color 0.15s, background 0.15s, color 0.12s;
}
.nav-main > a.nav-hot:hover {
	border-color: rgba(255,255,255,0.3);
	background: rgba(255,255,255,0.06);
}
.nav-main > a.nav-hot:hover .nav-hot-label {
	background: linear-gradient(120deg, #ffb454, #ff6ad5 38%, #8b5cf6 64%, #4fc3ff);
	-webkit-background-clip: text; background-clip: text;
	-webkit-text-fill-color: transparent; color: transparent;
}
.nav-hot-dot {
	width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%;
	background: conic-gradient(from 210deg, #ffb454, #ff6ad5, #8b5cf6, #4fc3ff, #ffb454);
	animation: nav-hot-pulse 2.4s ease-in-out infinite;
}
@keyframes nav-hot-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(139,92,246,0.45); }
	50%      { box-shadow: 0 0 0 4px rgba(139,92,246,0); }
}
/* Drawer rendering of the same link: keep the dot, drop the pill chrome. */
.nav-drawer a.nav-hot {
	display: flex; align-items: center; gap: 8px; color: var(--nv-text);
}
/* Featured drawer row — highlighted links lead the drawer as a hairline
   iris card instead of hiding under "More". */
.nav-drawer a.dr-hot {
	display: flex; align-items: center; gap: 10px;
	margin: 4px 12px 8px; padding: 12px 14px;
	border: 1px solid rgba(139,92,246,0.35); border-radius: 12px;
	color: var(--nv-text); font-weight: 500;
	background: rgba(139,92,246,0.08);
	transition: border-color 0.15s, background 0.15s;
}
.nav-drawer a.dr-hot:active {
	border-color: rgba(139,92,246,0.6);
	background: rgba(139,92,246,0.14);
}
.dr-hot-arrow { margin-left: auto; color: var(--nv-text-3); }
/* Walk Companion switch row — the drawer's counterpart to the desktop nav
   toggle. Same iris card chrome as a featured row, but it flips an on/off pill
   in place instead of navigating. */
.nav-drawer button.dr-walk {
	display: flex; align-items: center; gap: 10px; width: calc(100% - 24px);
	margin: 4px 12px 8px; padding: 12px 14px;
	border: 1px solid rgba(139,92,246,0.35); border-radius: 12px;
	color: var(--nv-text); font: inherit; font-weight: 500; text-align: left;
	background: rgba(139,92,246,0.08); cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
}
.nav-drawer button.dr-walk:hover { border-color: rgba(139,92,246,0.5); }
.nav-drawer button.dr-walk:active {
	border-color: rgba(139,92,246,0.6); background: rgba(139,92,246,0.14);
}
.dr-walk .nav-walk-ico { font-size: 18px; line-height: 1; }
.dr-walk-label { flex: 1; }
.dr-walk-state {
	font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
	padding: 3px 9px; border-radius: 999px;
	color: var(--nv-text-3); background: var(--nv-surface-1);
	border: 1px solid var(--nv-hairline);
}
.nav-drawer button.dr-walk.is-on {
	border-color: rgba(139,92,246,0.6); background: rgba(139,92,246,0.16);
}
.dr-walk.is-on .dr-walk-state {
	color: #fff; background: rgba(139,92,246,0.85); border-color: transparent;
}
/* Light bar: white-alpha pill chrome washes out — remap to ink tints. */
:root[data-theme='light'] .nav-main > a.nav-hot {
	border-color: rgba(15, 18, 28, 0.18);
	background: rgba(15, 18, 28, 0.04);
}
:root[data-theme='light'] .nav-main > a.nav-hot:hover {
	border-color: rgba(15, 18, 28, 0.34);
	background: rgba(15, 18, 28, 0.07);
}
:root[data-theme='light'] .nav-pill-live {
	background: rgba(46, 160, 90, 0.12); color: #1e8e4e;
	box-shadow: inset 0 0 0 1px rgba(46, 160, 90, 0.3);
}
:root[data-theme='light'] .nav-pill-new {
	background: rgba(109, 40, 217, 0.1); color: #5b21b6;
	box-shadow: inset 0 0 0 1px rgba(109, 40, 217, 0.28);
}
.nav-pop-note {
	padding: 6px 12px 8px; font-size: var(--text-2xs); color: var(--nv-text-4);
	line-height: 1.45; grid-column: 1 / -1;
	border-bottom: 1px solid var(--nv-hairline); margin-bottom: 2px;
}

/* ── MOBILE NAV ─────────────────────────────────────────────── */
.nav-toggle {
	display: none; align-items: center; justify-content: center;
	width: 44px; height: 44px; padding: 0; margin-left: auto;
	background: none; border: 1px solid var(--nv-hairline-strong);
	border-radius: 9px; color: var(--nv-text); cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
}
.nav-toggle:hover { border-color: var(--nv-text); background: rgba(255,255,255,0.04); }
.nav .brand:focus-visible,
.nav-toggle:focus-visible,
.nav-trigger:focus-visible,
.nav-walk-toggle:focus-visible,
.nav-mi:focus-visible,
.nav-main > a:focus-visible,
.nav-end a:focus-visible,
.nav-drawer a:focus-visible,
.nav-drawer .btn:focus-visible {
	outline: 2px solid rgba(255,255,255,0.5); outline-offset: 2px;
	border-radius: 7px;
}
/* Skip-to-content link (injected by nav.js as the first focusable element).
   Off-screen until it receives keyboard focus, then slides into the top-left so
   keyboard / screen-reader users can jump past the header on any page.

   `.h-skip-link` is the hand-authored variant: eleven pages (/pricing, /billing,
   /crypto-api, /payments, /tutorials, …) write the anchor into their own markup
   with that class instead of relying on nav.js. It had no rule anywhere in the
   codebase, so on every one of those pages the link rendered as visible,
   unstyled text above the header. It shares this rule so it behaves — and
   hides — exactly like the injected one. */
.nav-skip,
.h-skip-link {
	position: fixed;
	top: 10px;
	left: 10px;
	z-index: 10000;
	transform: translateY(calc(-100% - 14px));
	padding: 11px 18px;
	background: var(--text, #f6f6f6);
	color: var(--bg, #050505);
	border-radius: 10px;
	font: 600 14px/1 var(--font-sans, system-ui, sans-serif);
	text-decoration: none;
	box-shadow: 0 8px 28px rgba(0,0,0,0.45);
	transition: transform 150ms ease;
}
.nav-skip:focus,
.h-skip-link:focus { transform: translateY(0); }
.nav-skip:focus-visible,
.h-skip-link:focus-visible {
	outline: 2px solid var(--focus-ring-color, #4f8cff);
	outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
	.nav-skip,
	.h-skip-link { transition: none; }
}

.nav-toggle svg { width: 16px; height: 16px; }
.nav-toggle .close { display: none; }
.nav-toggle[aria-expanded="true"] .open { display: none; }
.nav-toggle[aria-expanded="true"] .close { display: block; }
.nav-drawer {
	display: none; position: fixed; inset: 57px 0 0;
	z-index: 99; background: rgba(5,5,5,0.96);
	backdrop-filter: blur(24px) saturate(140%);
	-webkit-backdrop-filter: blur(24px) saturate(140%);
	padding: 20px 24px 40px; flex-direction: column; gap: 2px;
	overflow-y: auto; -webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	opacity: 0; transform: translateY(-8px);
	transition: opacity 0.25s ease, transform 0.25s ease;
}
.nav-drawer a { color: var(--nv-text-2); text-decoration: none; }
.nav-drawer.open { display: flex; opacity: 1; transform: translateY(0); }
.nav-drawer .dr-h {
	font-family: var(--nv-font-mono); font-size: var(--text-2xs);
	text-transform: uppercase; letter-spacing: 0.16em;
	color: var(--nv-text-4); padding: 18px 16px 6px;
}
.nav-drawer .dr-h:first-child { padding-top: 4px; }
.nav-drawer a {
	display: flex; align-items: center; min-height: 44px;
	padding: 11px 16px; font-size: var(--text-base); font-weight: 450;
	border-radius: 8px;
	transition: background 0.12s, color 0.12s;
}
.nav-drawer a:hover { background: var(--nv-surface-1); color: var(--nv-text); }
.nav-drawer [hidden] { display: none; }
.nav-drawer .sep { height: 1px; background: var(--nv-hairline); margin: 12px 0; }
.nav-drawer .btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	margin-top: 8px; padding: 13px 22px; border-radius: 8px;
	font-size: var(--text-ui); font-weight: 500;
	border: 1px solid var(--nv-hairline-strong);
	background: transparent; color: var(--nv-text);
	transition: border-color 0.15s, background 0.15s;
}
.nav-drawer .btn:hover { border-color: var(--nv-text); background: rgba(255,255,255,0.04); }
.nav-drawer .btn.primary { background: var(--nv-text); color: var(--nv-bg); border-color: var(--nv-text); }
.nav-drawer .btn.primary:hover { background: #fff; color: #0a0a0a; }
@media (max-width: 880px) {
	.nav-toggle { display: flex; }
	.nav-end { display: none; }
}

/* ── Microinteractions (B11) — press feedback + reduced motion ───────────── */
/* Active states: one tint deeper than hover so every press reads instantly. */
.nav-main > a:active,
.nav-end a:active { color: var(--nv-text); opacity: 0.78; }
.nav-end .console:active,
.nav-toggle:active,
.nav-drawer .btn:active { background: rgba(255,255,255,0.08); }
.nav-trigger:active,
.nav-walk-toggle:active { color: var(--nv-text); background: rgba(255,255,255,0.07); }
.nav-mi:active { background: var(--nv-surface-1); }
.nav-drawer a:active { background: var(--nv-surface-2); color: var(--nv-text); }
.nav-drawer .btn.primary:active { background: rgba(255,255,255,0.86); }
.notif-signin-btn:active { background: rgba(255,255,255,0.2); }
.notif-mark-all:active:not(:disabled) { background: rgba(255,255,255,0.09); }
.notif-row:active { background: rgba(255,255,255,0.06); }

/* Reduced motion: the nav uses literal durations (not the zeroed --duration-*
   tokens), so kill its transitions/animations explicitly. */
@media (prefers-reduced-motion: reduce) {
	.nav *,
	.nav-drawer,
	.nav-drawer *,
	.notif-panel,
	.nav-pop,
	.nav-caret {
		transition-duration: 0ms !important;
		animation: none !important;
	}
}

/* ── Progressive disclosure: the Simple ⇄ Everything tier ──────────────────
   New visitors get the ~20 destinations that carry the core journey; the
   ~80 power-user surfaces are tagged `tier: 'advanced'` in nav-data.js and
   hidden until asked for. `html.tws-lite` is applied by nav.js before the
   menus render (and pre-paint in <head> on the homepage), so nothing
   flashes. See public/nav.js → applyTier. */
html.tws-lite .nav [data-tier="advanced"],
html.tws-lite .nav-drawer [data-tier="advanced"] { display: none; }

/* A hidden column would otherwise leave an empty grid track: re-lay the mega
   popover to the number of columns the lite tier actually shows. */
html.tws-lite .nav-pop.mega.lite-cols-1 { grid-template-columns: 1fr; min-width: 288px; }
html.tws-lite .nav-pop.mega.lite-cols-2 { grid-template-columns: repeat(2, 1fr); min-width: 460px; }
html.tws-lite .nav-pop.mega.lite-cols-3 { grid-template-columns: repeat(3, 1fr); min-width: 632px; }

/* The in-menu switch. Spans every column as a footer row under the items. */
.nav-tier-toggle {
	grid-column: 1 / -1;
	display: flex; align-items: center; justify-content: center; gap: 8px;
	width: 100%; margin-top: 4px; padding: 10px 12px;
	border: 0; border-top: 1px solid var(--nv-hairline); border-radius: 0 0 9px 9px;
	background: transparent; cursor: pointer;
	font: inherit; font-size: var(--text-xs); font-weight: 500;
	color: var(--nv-text-3); text-align: center;
	transition: background 0.12s, color 0.12s;
}
.nav-tier-toggle:hover { background: var(--nv-surface-2); color: var(--nv-text); }
.nav-tier-toggle:focus-visible { outline: 2px solid var(--nv-text); outline-offset: -2px; color: var(--nv-text); }
.nav-tier-n {
	font-family: var(--nv-font-mono); font-size: var(--text-2xs);
	padding: 2px 7px; border-radius: 999px;
	background: var(--nv-surface-2); color: var(--nv-text-2);
}
.nav-tier-toggle:hover .nav-tier-n { background: var(--nv-surface-1); color: var(--nv-text); }
/* Only one of the two labels is ever live — whichever the current tier needs. */
.nav-tier-toggle .nav-tier-less { display: none; }
html:not(.tws-lite) .nav-tier-toggle .nav-tier-more { display: none; }
html:not(.tws-lite) .nav-tier-toggle .nav-tier-less { display: inline; }

/* Drawer counterpart: one control at the end of the flat mobile list. */
.nav-drawer button.dr-tier {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	width: calc(100% - 24px); min-height: 44px;
	margin: 10px 12px 4px; padding: 12px 14px;
	border: 1px solid var(--nv-hairline); border-radius: 12px;
	background: transparent; color: var(--nv-text-2);
	font: inherit; font-size: var(--text-base); font-weight: 500; cursor: pointer;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.nav-drawer button.dr-tier:hover,
.nav-drawer button.dr-tier:active {
	border-color: var(--nv-hairline-strong); background: var(--nv-surface-1); color: var(--nv-text);
}
