/* ============================================================
   NORDEX FREIGHT — global tokens, reset, shared primitives,
   and the imperative hero-globe widget styles.
   Loaded once by templates/layouts/nordex-base.hubl.html.
   ============================================================ */

:root {
  --ndx-bg:          #0A0C10;
  --ndx-surface:     #111318;
  --ndx-surface-2:   #15181F;
  --ndx-line:        #1E2230;
  --ndx-line-2:      #272C3B;
  --ndx-amber:       #F5A623;
  --ndx-amber-soft:  rgba(245, 166, 35, 0.16);
  --ndx-amber-glow:  rgba(245, 166, 35, 0.45);
  --ndx-blue:        #1E90FF;
  --ndx-text:        #FFFFFF;
  --ndx-muted:       #8A8F9E;
  --ndx-muted-2:     #5A6072;
  --ndx-green:       #3CCB7F;

  --ndx-pad:  clamp(20px, 4vw, 72px);
  --ndx-maxw: 1440px;
  --ndx-rad:  2px;

  --ndx-font-display: "Bebas Neue", Impact, sans-serif;
  --ndx-font-body:    "DM Sans", system-ui, -apple-system, sans-serif;
  --ndx-font-mono:    "JetBrains Mono", ui-monospace, monospace;
}

/* ── reset ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ndx-bg);
  color: var(--ndx-text);
  font-family: var(--ndx-font-body);
  -webkit-font-smoothing: antialiased;
}
body { overflow-x: hidden; }
html { scroll-behavior: smooth; }
/* anchored sections clear the fixed nav when jumped to */
section[id] { scroll-margin-top: 88px; }
.body-wrapper { background: var(--ndx-bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* ── shared primitives ──────────────── */
.ndx-container {
  max-width: var(--ndx-maxw);
  margin: 0 auto;
  padding: 0 var(--ndx-pad);
}

.ndx-display {
  font-family: var(--ndx-font-display);
  letter-spacing: 0.01em;
  line-height: 0.9;
  font-weight: 400;
}

.ndx-eyebrow {
  font-family: var(--ndx-font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ndx-muted);
  display: flex;
  align-items: center;
}
.ndx-eyebrow .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--ndx-amber);
  margin-right: 10px;
  box-shadow: 0 0 12px var(--ndx-amber-glow);
}

.ndx-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 26px;
  background: var(--ndx-amber);
  color: #0A0C10;
  font-family: var(--ndx-font-display);
  font-size: 18px;
  letter-spacing: 0.14em;
  border-radius: var(--ndx-rad);
  box-shadow: 0 0 0 1px rgba(245, 166, 35, 0.5),
              0 18px 50px -10px rgba(245, 166, 35, 0.55),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  text-transform: uppercase;
}
.ndx-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(245, 166, 35, 0.8),
              0 24px 60px -10px rgba(245, 166, 35, 0.7),
              inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.ndx-btn .arrow {
  width: 22px;
  height: 1.5px;
  background: #0A0C10;
  position: relative;
  flex-shrink: 0;
}
.ndx-btn .arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -4px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #0A0C10;
  border-top: 1.5px solid #0A0C10;
  transform: rotate(45deg);
}
.ndx-btn.ghost {
  background: transparent;
  color: var(--ndx-text);
  box-shadow: inset 0 0 0 1px var(--ndx-line-2);
}
.ndx-btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--ndx-amber); color: var(--ndx-amber); }
.ndx-btn.ghost .arrow { background: currentColor; }
.ndx-btn.ghost .arrow::after { border-color: currentColor; }

/* reveal-on-scroll (toggled by module IntersectionObservers) */
.ndx-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.ndx-reveal.in-view { opacity: 1; transform: none; }

/* ============================================================
   HERO GLOBE — imperative widget. All inner nodes are created
   by JS with generic class names; every rule is scoped under
   .ndx-globe-wrap so generic names never leak.
   ============================================================ */
.ndx-globe-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 640px;
  justify-self: end;
  perspective: 1400px;
  perspective-origin: 50% 50%;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.ndx-globe-wrap.dragging { cursor: grabbing; }
.ndx-globe-wrap::before {
  content: "";
  position: absolute;
  inset: -10%;
  background: radial-gradient(circle at center, rgba(245, 166, 35, 0.18), rgba(245, 166, 35, 0) 55%);
  filter: blur(20px);
  z-index: 0;
  pointer-events: none;
}
.ndx-globe-wrap .globe {
  position: absolute;
  inset: 8%;
  transform-style: preserve-3d;
  will-change: transform;
}
.ndx-globe-wrap .dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ndx-amber);
  box-shadow: 0 0 6px var(--ndx-amber), 0 0 12px rgba(245, 166, 35, 0.6);
  margin-left: -1.5px;
  margin-top: -1.5px;
  transform-style: preserve-3d;
}
.ndx-globe-wrap .dot.big {
  width: 8px;
  height: 8px;
  margin-left: -4px;
  margin-top: -4px;
  background: #fff;
  box-shadow: 0 0 10px #fff, 0 0 22px var(--ndx-amber);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.ndx-globe-wrap .dot.big::before {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(245, 166, 35, 0.5);
  border-radius: 50%;
  animation: ndxHubPulse 2.4s ease-out infinite;
}
.ndx-globe-wrap .dot.big.active { background: var(--ndx-amber); box-shadow: 0 0 14px var(--ndx-amber), 0 0 36px var(--ndx-amber); }
.ndx-globe-wrap .dot.big.active::before { border-color: var(--ndx-amber); animation-duration: 1.6s; }
.ndx-globe-wrap .dot.big.linked { background: var(--ndx-amber); box-shadow: 0 0 10px var(--ndx-amber), 0 0 24px var(--ndx-amber); }
.ndx-globe-wrap .globe.has-active .dot:not(.big) { opacity: 0.12 !important; }
.ndx-globe-wrap .globe.has-active .dot.big { opacity: 0.18; }
.ndx-globe-wrap .globe.has-active .dot.big.linked,
.ndx-globe-wrap .globe.has-active .dot.big.active { opacity: 1; }
@keyframes ndxHubPulse {
  0%   { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.6); opacity: 0; }
}
.ndx-globe-wrap .meridian,
.ndx-globe-wrap .parallel {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(245, 166, 35, 0.13);
  border-radius: 50%;
  transform-style: preserve-3d;
}
.ndx-globe-wrap .globe-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}
.ndx-globe-wrap .globe-svg .arc-base { fill: none; stroke: rgba(245, 166, 35, 0.14); stroke-width: 0.5; stroke-linecap: round; }
.ndx-globe-wrap .globe-svg .arc {
  fill: none;
  stroke-width: 0.9;
  stroke-linecap: round;
  stroke-dasharray: 18 220;
  animation: ndxDash 7s cubic-bezier(0.55, 0.05, 0.25, 1) infinite;
}
.ndx-globe-wrap .globe-svg .arc.amber { stroke: var(--ndx-amber); }
.ndx-globe-wrap .globe-svg .arc.warm  { stroke: #f7d39a; }
.ndx-globe-wrap .globe-svg .arc:nth-of-type(2) { animation-delay: 2.2s; animation-duration: 8s; }
.ndx-globe-wrap .globe-svg .arc:nth-of-type(3) { animation-delay: 4.6s; animation-duration: 7.5s; }
@keyframes ndxDash {
  0%   { stroke-dashoffset: 238; opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
.ndx-globe-wrap .conn-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
  overflow: visible;
}
.ndx-globe-wrap .conn-svg .conn {
  fill: none;
  stroke: rgba(245, 166, 35, 0.7);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.45, 0.05, 0.15, 1), opacity 0.6s ease;
  vector-effect: non-scaling-stroke;
}
.ndx-globe-wrap .conn-svg .conn.drawn { stroke-dashoffset: 0; }
.ndx-globe-wrap .conn-svg .traveler {
  fill: var(--ndx-amber);
  opacity: 0;
  filter: drop-shadow(0 0 4px var(--ndx-amber));
  transition: opacity 0.6s ease 1s;
}
.ndx-globe-wrap .conn-svg .traveler.on { opacity: 1; }

/* tooltip card */
.ndx-globe-wrap .hub-card {
  position: absolute;
  z-index: 6;
  min-width: 200px;
  background: rgba(10, 12, 16, 0.92);
  border: 1px solid var(--ndx-amber);
  padding: 14px 16px;
  backdrop-filter: blur(10px);
  transform: translate(-50%, calc(-100% - 18px));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(245, 166, 35, 0.25);
}
.ndx-globe-wrap .hub-card.show { opacity: 1; }
.ndx-globe-wrap .hub-card::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: rgba(10, 12, 16, 0.92);
  border-right: 1px solid var(--ndx-amber);
  border-bottom: 1px solid var(--ndx-amber);
  transform: translateX(-50%) rotate(45deg);
}
.ndx-globe-wrap .hub-card .hub-name { font-family: var(--ndx-font-display); font-size: 22px; letter-spacing: 0.06em; line-height: 1; color: #fff; }
.ndx-globe-wrap .hub-card .hub-meta { font-family: var(--ndx-font-mono); font-size: 10px; letter-spacing: 0.16em; color: var(--ndx-muted); text-transform: uppercase; margin-top: 6px; }
.ndx-globe-wrap .hub-card .hub-row { display: flex; justify-content: space-between; gap: 24px; border-top: 1px solid var(--ndx-line); padding-top: 10px; margin-top: 10px; font-family: var(--ndx-font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ndx-muted); }
.ndx-globe-wrap .hub-card .hub-row b { color: var(--ndx-amber); font-weight: 500; }

/* drawer */
.ndx-globe-wrap .hub-drawer {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 8;
  background: rgba(10, 12, 16, 0.94);
  border: 1px solid var(--ndx-amber);
  backdrop-filter: blur(14px);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(245, 166, 35, 0.2);
  transform: translateY(calc(100% + 20px));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.35s ease;
}
.ndx-globe-wrap .hub-drawer.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.ndx-globe-wrap .hub-drawer::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--ndx-amber);
  box-shadow: 0 0 18px var(--ndx-amber);
}
.ndx-globe-wrap .hd-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 20px 14px; border-bottom: 1px solid var(--ndx-line); }
.ndx-globe-wrap .hd-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ndx-globe-wrap .hd-name { font-family: var(--ndx-font-display); font-size: 34px; letter-spacing: 0.06em; line-height: 1; color: #fff; }
.ndx-globe-wrap .hd-code { font-family: var(--ndx-font-mono); font-size: 11px; color: var(--ndx-amber); letter-spacing: 0.2em; }
.ndx-globe-wrap .hd-meta { font-family: var(--ndx-font-mono); font-size: 10px; color: var(--ndx-muted); letter-spacing: 0.18em; text-transform: uppercase; margin-top: 6px; }
.ndx-globe-wrap .hd-close { width: 28px; height: 28px; border: 1px solid var(--ndx-line-2); color: var(--ndx-muted); display: grid; place-items: center; transition: all 0.2s; flex-shrink: 0; }
.ndx-globe-wrap .hd-close:hover { border-color: var(--ndx-amber); color: var(--ndx-amber); }
.ndx-globe-wrap .hd-close svg { width: 12px; height: 12px; }
.ndx-globe-wrap .hd-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--ndx-line); }
.ndx-globe-wrap .hd-stat { padding: 14px 18px; border-left: 1px solid var(--ndx-line); }
.ndx-globe-wrap .hd-stat:first-child { border-left: 0; }
.ndx-globe-wrap .hd-stat .k { font-family: var(--ndx-font-mono); font-size: 9px; color: var(--ndx-muted); letter-spacing: 0.18em; text-transform: uppercase; }
.ndx-globe-wrap .hd-stat .v { font-family: var(--ndx-font-display); font-size: 26px; line-height: 1; letter-spacing: 0.02em; margin-top: 8px; color: #fff; }
.ndx-globe-wrap .hd-stat .v .u { color: var(--ndx-amber); font-size: 14px; margin-left: 3px; }
.ndx-globe-wrap .hd-stat .trend { font-family: var(--ndx-font-mono); font-size: 9px; color: var(--ndx-green); letter-spacing: 0.16em; margin-top: 6px; }
.ndx-globe-wrap .hd-body { display: grid; grid-template-columns: 1.2fr 1fr; }
.ndx-globe-wrap .hd-lanes { padding: 16px 20px; border-right: 1px solid var(--ndx-line); }
.ndx-globe-wrap .hd-section-title { font-family: var(--ndx-font-mono); font-size: 10px; color: var(--ndx-muted); letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 12px; display: flex; justify-content: space-between; }
.ndx-globe-wrap .hd-section-title b { color: var(--ndx-amber); font-weight: 500; }
.ndx-globe-wrap .hd-lane { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 7px 0; font-family: var(--ndx-font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--ndx-text); }
.ndx-globe-wrap .hd-lane .code { color: var(--ndx-muted); }
.ndx-globe-wrap .hd-lane .bar { height: 3px; background: var(--ndx-line); position: relative; overflow: hidden; }
.ndx-globe-wrap .hd-lane .bar::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--pct, 50%); background: linear-gradient(to right, var(--ndx-amber), rgba(245, 166, 35, 0.4)); }
.ndx-globe-wrap .hd-lane .pct { color: var(--ndx-amber); text-align: right; min-width: 42px; }
.ndx-globe-wrap .hd-side { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.ndx-globe-wrap .hd-mini { display: flex; justify-content: space-between; align-items: center; font-family: var(--ndx-font-mono); font-size: 11px; color: var(--ndx-muted); letter-spacing: 0.08em; text-transform: uppercase; }
.ndx-globe-wrap .hd-mini b { color: var(--ndx-text); font-weight: 500; }
.ndx-globe-wrap .hd-mini b.ok { color: var(--ndx-green); }
.ndx-globe-wrap .hd-mini b.warn { color: var(--ndx-amber); }
.ndx-globe-wrap .hd-mgr { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--ndx-line); padding-top: 14px; margin-top: auto; }
.ndx-globe-wrap .hd-mgr .av { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #2A2F40, #0A0C10); border: 1px solid var(--ndx-line-2); display: grid; place-items: center; color: var(--ndx-amber); font-family: var(--ndx-font-display); font-size: 14px; flex-shrink: 0; }
.ndx-globe-wrap .hd-mgr .info { font-size: 11px; color: var(--ndx-muted); line-height: 1.4; }
.ndx-globe-wrap .hd-mgr .info b { color: var(--ndx-text); font-weight: 500; display: block; font-size: 12px; letter-spacing: 0.04em; }
.ndx-globe-wrap .hd-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--ndx-line); padding: 12px 20px; font-family: var(--ndx-font-mono); font-size: 10px; color: var(--ndx-muted); letter-spacing: 0.18em; text-transform: uppercase; }
.ndx-globe-wrap .hd-foot .links { display: flex; gap: 14px; }
.ndx-globe-wrap .hd-foot .links a { color: var(--ndx-text); display: inline-flex; align-items: center; gap: 6px; }
.ndx-globe-wrap .hd-foot .links a:hover { color: var(--ndx-amber); }
.ndx-globe-wrap .hd-foot .links a::after { content: "\2192"; color: var(--ndx-amber); }
.ndx-globe-wrap.has-drawer .globe-hud,
.ndx-globe-wrap.has-drawer .globe-hint { opacity: 0; transition: opacity 0.3s; }

/* HUD + ticks + hint */
.ndx-globe-wrap .globe-hud { position: absolute; font-family: var(--ndx-font-mono); font-size: 10px; letter-spacing: 0.18em; color: var(--ndx-muted); text-transform: uppercase; z-index: 5; }
.ndx-globe-wrap .globe-hud.tl { top: 8px; left: 8px; }
.ndx-globe-wrap .globe-hud.tr { top: 8px; right: 8px; text-align: right; }
.ndx-globe-wrap .globe-hud.bl { bottom: 8px; left: 8px; }
.ndx-globe-wrap .globe-hud.br { bottom: 8px; right: 8px; text-align: right; }
.ndx-globe-wrap .globe-hud .v { color: var(--ndx-amber); display: block; font-size: 12px; margin-top: 4px; }
.ndx-globe-wrap .globe-hud .crosshair { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--ndx-amber); position: relative; vertical-align: middle; margin-right: 6px; }
.ndx-globe-wrap .globe-hud .crosshair::before,
.ndx-globe-wrap .globe-hud .crosshair::after { content: ""; position: absolute; background: var(--ndx-amber); }
.ndx-globe-wrap .globe-hud .crosshair::before { left: 50%; top: -3px; bottom: -3px; width: 1px; }
.ndx-globe-wrap .globe-hud .crosshair::after { top: 50%; left: -3px; right: -3px; height: 1px; }
.ndx-globe-wrap .ticks { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.ndx-globe-wrap .ticks .corner { position: absolute; width: 24px; height: 24px; border: 1px solid var(--ndx-amber); opacity: 0.7; }
.ndx-globe-wrap .ticks .corner.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.ndx-globe-wrap .ticks .corner.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.ndx-globe-wrap .ticks .corner.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.ndx-globe-wrap .ticks .corner.br { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.ndx-globe-wrap .globe-hint {
  position: absolute;
  left: 50%;
  bottom: -32px;
  transform: translateX(-50%);
  font-family: var(--ndx-font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ndx-muted-2);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 5;
  pointer-events: none;
  white-space: nowrap;
}
.ndx-globe-wrap .globe-hint .icon { width: 18px; height: 10px; border: 1px solid var(--ndx-muted-2); border-radius: 6px; position: relative; }
.ndx-globe-wrap .globe-hint .icon::before { content: ""; position: absolute; left: 3px; top: 50%; width: 4px; height: 4px; background: var(--ndx-amber); border-radius: 50%; animation: ndxHintDrag 2.4s ease-in-out infinite; }
@keyframes ndxHintDrag {
  0%, 100% { transform: translate(0, -50%); }
  50%      { transform: translate(8px, -50%); }
}

/* floating hero particles */
.ndx-particles { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.ndx-particles span { position: absolute; width: 2px; height: 2px; background: var(--ndx-amber); border-radius: 50%; opacity: 0.4; animation: ndxFloat linear infinite; }
@keyframes ndxFloat {
  from { transform: translateY(0); opacity: 0; }
  10%  { opacity: 0.5; }
  90%  { opacity: 0.5; }
  to   { transform: translateY(-100vh); opacity: 0; }
}

@media (max-width: 1024px) {
  section[id] { scroll-margin-top: 72px; }
  .ndx-globe-wrap { max-width: 460px; margin: 0 auto; justify-self: center; }
  .ndx-globe-wrap .hd-stats { grid-template-columns: repeat(2, 1fr); }
  .ndx-globe-wrap .hd-stat:nth-child(3) { border-left: 0; }
  .ndx-globe-wrap .hd-body { grid-template-columns: 1fr; }
  .ndx-globe-wrap .hd-lanes { border-right: 0; border-bottom: 1px solid var(--ndx-line); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ndx-globe-wrap .globe-svg .arc,
  .ndx-globe-wrap .dot.big::before,
  .ndx-globe-wrap .globe-hint .icon::before,
  .ndx-particles span { animation: none !important; }
  .ndx-reveal { transition-duration: 0.01ms; }
}
