/* Body Byte — shared design layer (icons, interactions, focus, mobile menu) used by every page.
   Page-specific component styles stay in each page's inline <style>. Tokens (--mint, --card, …)
   are defined per page in :root and are read here via var(). */

/* ---- icon glyphs (referenced via <svg class="gi"><use href="#ic-…"></use></svg>) ---- */
.gi { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex: none; }
.gi-sm { width: 15px; height: 15px; }
.gi-md { width: 20px; height: 20px; }
.gi-lg { width: 23px; height: 23px; }

/* ---- logo + focus ---- */
.logo { transition: opacity .2s; }
.logo:hover { opacity: .85; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; border-radius: 4px; }

/* ---- skip link ---- */
.skip { position: absolute; left: -999px; top: 8px; background: var(--mint); color: #06241a; padding: 10px 16px; border-radius: 10px; font-weight: 700; z-index: 300; }
.skip:focus { left: 12px; }

/* ---- "why this" popover ---- */
.why { user-select: none; cursor: pointer; }
.why-pop { display: none; margin-top: 12px; background: var(--card-2); border: 1px solid rgba(56,211,159,0.25); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.why-pop.show { display: block; animation: bbfade .3s ease; }
@keyframes bbfade { from { opacity: .2; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- back-to-top (button injected by shared.js) ---- */
.to-top { position: fixed; right: 22px; bottom: 22px; width: 44px; height: 44px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--line-2); color: var(--text); display: grid; place-items: center; cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .25s, transform .25s, color .15s, border-color .15s; z-index: 90; font-size: 18px; font-family: inherit; }
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { border-color: var(--mint); color: var(--mint); }

/* ---- footer social (SVG) ---- */
.foot-social { display: flex; gap: 14px; }
.foot-social a { display: inline-grid; place-items: center; width: 22px; height: 22px; color: var(--muted); }
.foot-social a:hover { color: var(--text); }
.foot-social .gi { width: 19px; height: 19px; }

/* ---- mobile menu (off-canvas drawer; .menu-btn display:block stays per page) ---- */
@media (max-width: 900px) {
  .nav-links { position: fixed; inset: 72px 12px auto 12px; flex-direction: column; align-items: stretch; gap: 0; background: rgba(13,19,27,0.98); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 16px; padding: 8px 14px; box-shadow: var(--shadow); display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 6px; font-size: 16px; border-bottom: 1px solid var(--line); }
  .nav-links a:last-child { border-bottom: 0; }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none !important; }
  *, ::before, ::after { animation-duration: .001ms !important; }
}

/* ---- hero connected-signal constellation (svg#heroNet built by shared.js) ---- */
.hero { isolation: isolate; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 60%, transparent 92%);
          mask-image: linear-gradient(180deg, #000 0%, #000 60%, transparent 92%); }
.hero::before { z-index: 1; }
.hero-inner { position: relative; z-index: 2; }
.hero-bg .net-edges line { stroke: rgba(56,211,159,0.14); stroke-width: 1; }
.hero-bg .net-mid { fill: rgba(91,156,255,0.30); }
.hero-bg .net-dots circle { fill: rgba(56,211,159,0.42); }
.hero-bg .net-icon { color: rgba(158,178,198,0.17); transition: color .5s ease; }
.hero-bg .net-accent { color: rgba(56,211,159,0.34); }
.hero-bg .net-icon.net-fire { color: rgba(150,255,216,0.72) !important; }
.hero-bg .flow-trail { stroke: rgba(130,255,210,0.6); stroke-width: 2.2; stroke-linecap: round; filter: drop-shadow(0 0 3px rgba(56,211,159,0.55)); }
.hero-bg .flow-head { fill: rgba(232,255,246,0.95); filter: drop-shadow(0 0 5px rgba(120,255,205,0.85)); }
.hero-bg .flow-ping { fill: none; stroke: rgba(120,255,205,0.5); stroke-width: 1.4; }
.hero-bg .net-nodes use, .hero-bg .net-dots circle { animation: netBreathe 17s ease-in-out infinite; }
@keyframes netBreathe { 0%, 100% { opacity: 1; } 50% { opacity: .72; } }
@media (max-width: 760px) {
  .hero-bg { -webkit-mask-image: linear-gradient(180deg, #000 0, #000 210px, transparent 360px);
                     mask-image: linear-gradient(180deg, #000 0, #000 210px, transparent 360px); }
}
@media (prefers-reduced-motion: reduce) { .hero-bg .net-nodes use, .hero-bg .net-dots circle { animation: none; } }
