/* rNexa landing v2 - hero: every agent's light flows into the Nexa mark */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 40; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.nav.is-solid { background: var(--bar); box-shadow: 0 1px 0 var(--line); backdrop-filter: saturate(1.6) blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 32px; font-size: 14px; }
.nav-end { display: flex; align-items: center; gap: 16px; font-size: 14px; }

.hero { --overlap: clamp(120px, 20vw, 290px); position: relative; isolation: isolate; overflow: hidden; padding: 96px 24px calc(var(--overlap) + 64px); text-align: center; }
/* Backdrop: a fine dot field and one soft azure light, both still. */
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(var(--line-2) 1px, transparent 1.4px); background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(58% 46% at 50% 26%, #000, transparent 78%);
  mask-image: radial-gradient(58% 46% at 50% 26%, #000, transparent 78%);
}
.hero-bg::after {
  content: ""; position: absolute; left: 50%; top: -6%; width: min(1500px, 150vw); height: 760px; transform: translateX(-50%);
  background: radial-gradient(42% 46% at 50% 38%, rgba(var(--hi-rgb), 0.13), rgba(var(--az-rgb), 0.04) 58%, transparent 76%);
}
html[data-theme="dark"] .hero-bg::after { background: radial-gradient(42% 46% at 50% 38%, rgba(var(--hi-rgb), 0.18), rgba(var(--az-rgb), 0.05) 58%, transparent 76%); }

/* The flow: provider chips, fibres of light, the mark at the centre */
.flow { position: relative; max-width: 1040px; height: 228px; margin: 0 auto; }
.flow svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; opacity: 0; transition: opacity 0.9s var(--ease) 0.3s; }
.flow.is-ready svg { opacity: 1; }
.flow path { fill: none; stroke-width: 1.25; stroke-linecap: round; }
/* Colour comes from CSS: a var() inside an SVG attribute does not resolve. */
.flow stop { stop-color: rgb(var(--hi-rgb)); }
.flow-side { position: absolute; top: 6px; bottom: 6px; display: flex; flex-direction: column; justify-content: space-between; margin: 0; padding: 0; list-style: none; }
.flow-l { left: 0; align-items: flex-start; }
.flow-r { right: 0; align-items: flex-end; }
.flow-side li {
  display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px 0 11px; border-radius: 12px;
  background: var(--chip); box-shadow: inset 0 0 0 1px var(--line-2), var(--lift);
  font-size: 14px; font-weight: 500; color: var(--ink);
  animation: rise 0.9s var(--fly) both; animation-delay: calc(var(--i) * 70ms + 0.15s);
}
.flow-l li:nth-child(odd) { margin-left: 54px; }
.flow-r li:nth-child(odd) { margin-right: 54px; }
.flow-side img { width: 20px; height: 20px; }
.flow-side .mono, .helpers .mono { filter: brightness(0); }
html[data-theme="dark"] .flow-side .mono, html[data-theme="dark"] .helpers .mono { filter: brightness(0) invert(1); }
.flow-side b { font: 600 12px/1 ui-monospace, "Cascadia Code", Consolas, monospace; color: var(--az); }

.core { position: absolute; left: 50%; top: 50%; width: 112px; height: 112px; margin: -56px 0 0 -56px; animation: rise 1s var(--fly) both; }
.core::before {
  content: ""; position: absolute; inset: -110px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--hi-rgb), 0.28), rgba(var(--az-rgb), 0.08) 46%, transparent 72%);
  animation: halo 4.2s ease-in-out infinite;
}
@keyframes halo { 0%, 100% { opacity: 0.65; transform: scale(0.94); } 50% { opacity: 1; transform: scale(1.04); } }
/* A thin light circling the tile's edge. */
.core-ring { position: absolute; inset: -1.5px; border-radius: 29.5px; overflow: hidden; }
.core-ring i { position: absolute; inset: -50%; background: conic-gradient(from 0deg, transparent 0 52%, rgba(var(--hi-rgb), 0.95) 76%, #fff 86%, transparent 95%); animation: spin 4.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.core-tile {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 28px; overflow: hidden;
  background: linear-gradient(155deg, #1d2029, #0a0b0e 72%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.07), 0 26px 50px -26px rgba(5, 10, 22, 0.6), 0 16px 40px -20px rgba(var(--az-rgb), 0.42);
}
.core-tile img { width: 54px; height: 54px; filter: brightness(0) invert(1); }
.core-tile::after {
  content: ""; position: absolute; inset: -20% auto -20% -70%; width: 46%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.22), transparent); animation: sweep 5.6s ease-in-out infinite;
}
@keyframes sweep { 0%, 55% { transform: skewX(-18deg) translateX(0); } 88%, 100% { transform: skewX(-18deg) translateX(420px); } }

/* A comet rides one fibre from its chip into the mark. */
.comet {
  position: absolute; left: 0; top: 0; width: 46px; height: 2px; border-radius: 2px; opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(var(--hi-rgb), 0.7) 70%, #fff);
  box-shadow: 0 0 8px 0 rgba(var(--hi-rgb), 0.4);
  offset-anchor: 100% 50%; offset-rotate: auto; offset-distance: 0%;
}
html:not([data-theme="dark"]) .comet { background: linear-gradient(90deg, transparent, rgba(var(--hi-rgb), 0.75) 60%, rgb(var(--az-rgb))); }
.flow.is-ready .comet { animation: fly 4.4s cubic-bezier(0.55, 0, 0.25, 1) infinite; animation-delay: calc(var(--i) * 0.62s + 0.8s); }
@keyframes fly {
  0% { offset-distance: 0%; opacity: 0; }
  6% { opacity: 1; }
  30% { offset-distance: 100%; opacity: 1; }
  34%, 100% { offset-distance: 100%; opacity: 0; }
}
.hero.is-paused .comet, .hero.is-paused .core::before, .hero.is-paused .core-ring i, .hero.is-paused .core-tile::after { animation-play-state: paused; }

/* Copy */
.hero-copy { position: relative; max-width: 880px; margin: 32px auto 0; }
.hero h1 {
  margin: 0; font-size: clamp(38px, 5.4vw, 72px); line-height: 1.02; padding-bottom: 0.08em;
  background: linear-gradient(180deg, var(--ink) 42%, var(--h1-fade)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin: 18px auto 0; max-width: 640px; }
.hero-ctas { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-note { margin: 18px 0 0; font-size: 13px; color: var(--ink-3); }
.hero-note a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); transition: color 0.2s var(--ease); }
.hero-note a:hover { color: var(--ink); }
.hero-fade { position: absolute; inset: auto 0 0; height: 200px; background: linear-gradient(to bottom, transparent, var(--bg)); }

/* The app window, lit along its top edge */
.shot-wrap { position: relative; z-index: 2; margin-top: calc(clamp(120px, 20vw, 290px) * -1); padding: 0 16px; perspective: 1600px; }
/* Leans back at the top of the page and stands up as you scroll (rn2-light.js sets --shot-p, 0 to 1).
   The entrance uses translate/scale, so transform stays free for the lean. */
.shot {
  position: relative; max-width: 1180px; margin: 0 auto; border-radius: 16px; background: #141414;
  box-shadow: 0 0 0 1px var(--line-2), 0 40px 80px -44px rgba(5, 10, 22, 0.5), 0 -12px 56px -34px rgba(var(--hi-rgb), 0.36);
  animation: deal 1.1s var(--fly) 0.45s both;
  transform-origin: 50% 0;
  transform: rotateX(calc((1 - var(--shot-p, 1)) * var(--shot-lean, 18deg))) scale(calc(0.94 + 0.06 * var(--shot-p, 1)));
  transition: transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
}
.shot img { width: 100%; height: auto; border-radius: 16px; }
.shot::before {
  content: ""; position: absolute; left: 12%; right: 12%; top: -1px; height: 1px; z-index: 1;
  background: linear-gradient(90deg, transparent, rgba(var(--hi-rgb), 0.9) 30%, #fff 50%, rgba(var(--hi-rgb), 0.9) 70%, transparent);
}
@keyframes deal { from { opacity: 0; translate: 0 40px; scale: 0.985; } to { opacity: 1; translate: none; scale: none; } }

@media (max-width: 860px) {
  .nav-links, .nav-signin { display: none; }
  .hero { padding-top: 92px; }
  .flow { height: 208px; }
  .flow-side li { width: 40px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  .flow-side b { font-size: 12px; }
  .flow-l li:nth-child(odd) { margin-left: 30px; }
  .flow-r li:nth-child(odd) { margin-right: 30px; }
  .core { width: 88px; height: 88px; margin: -44px 0 0 -44px; }
  .core-ring { border-radius: 23.5px; }
  .core-tile { border-radius: 22px; }
  .core-tile img { width: 42px; height: 42px; }
  .comet { width: 30px; }
}
@media (max-width: 520px) { .hero-ctas .btn { width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .comet { display: none; }
  .core, .core::before, .core-ring i, .core-tile::after, .flow-side li, .shot { animation: none; }
  .shot { transform: none; will-change: auto; }
}
