/* BE Solutions landing: tokens, base, nav, hero + flow diagram. Sections live in sections.css. */
:root {
  --night: #071426;
  --night-2: #0b1d35;
  --night-3: #10264a;
  --grid: rgba(120, 180, 255, 0.05);
  --grid-strong: rgba(120, 180, 255, 0.1);
  --ink: #e8f0fb;
  --ink-2: #c3d2e6;
  --muted: #8ea3bf;
  /* One accent, used only for the brand mark, the serif words, primary buttons and the data itself. */
  --accent: #ffc629;
  --accent-ink: #121212;
  --orange: #ff8a1f;
  --ok: #3ee08f;
  --ok-ink: #05261a;
  --line: rgba(160, 200, 255, 0.16);
  --line-strong: rgba(160, 200, 255, 0.28);
  --glass: rgba(255, 255, 255, 0.035);
  --paper: #f4ecd6;
  --paper-ink: #2a2418;
  --font: 'Space Grotesk', system-ui, -apple-system, Segoe UI, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: 'Instrument Serif', Georgia, serif;
  --font-display: var(--font);
  /* "Generic software" mock: deliberately off-brand greys. */
  --gen-bg: #e9ecef; --gen-side: #d9dde2; --gen-active: #c5cbd2; --gen-field: #fff; --gen-border: #ced4da;
  --gen-text: #6c757d; --gen-faint: #9aa3ad; --gen-strong: #4b5560; --gen-warn-bg: #fff3cd; --gen-warn-text: #8a6d1a;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  background-color: var(--night);
  background-image:
    linear-gradient(var(--grid-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.005em; color: var(--accent); }
.ico { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 max(var(--gutter), env(safe-area-inset-right, 0px)) 0 max(var(--gutter), env(safe-area-inset-left, 0px)); }

/* ---------- buttons, kickers ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink);
  font: 600 16px/1 var(--font); text-decoration: none;
  transition: transform 0.16s var(--ease-out), background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.btn .ico { transition: transform 0.2s var(--ease-out); }
.btn:active { transform: scale(0.97); transition-duration: 0.1s; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); box-shadow: none; }
.btn--small { min-height: 40px; padding: 0 16px; font-size: 14px; }
/* Hover only where a real pointer can hover; on touch, a tap would leave these stuck on. */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-2px); }
  .btn:hover:active { transform: translateY(-2px) scale(0.97); }
  .btn:hover .ico { transform: translateX(3px); }
  .btn--ghost:hover { background: var(--glass); border-color: var(--muted); }
  .btn--ghost:hover .ico { transform: translateY(3px); }
  .nav__links a:hover { color: var(--ink); }
  .nav__links a:hover::after { transform: scaleX(1); }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }

/* Controls: no double-tap-zoom wait, no text selection on long-press. Content text stays selectable. */
a, button, [role="button"] { touch-action: manipulation; }
.btn, .seg__btn, .nav__links a { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

.skip { position: fixed; left: 16px; top: 12px; z-index: 50; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: var(--night); font-weight: 600; text-decoration: none; transform: translateY(-160%); transition: transform 0.2s var(--ease-out); }
.skip:focus { transform: none; }

.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 12px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
}
.kicker::before { content: ''; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
.kicker:has(.pulse)::before { display: none; }
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.pulse::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); animation: ping 2s var(--ease-out) infinite; }
@keyframes ping { to { transform: scale(3); opacity: 0; } }

/* ---------- reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
/* Above the fold: animate on load, don't wait for the observer. */
.js .hero .reveal { opacity: 1; transform: none; transition: none; animation: rise-in 0.8s var(--ease-out) var(--d, 0ms) backwards; }
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } }

/* ---------- scroll rail (wide screens) ---------- */
.rail { position: fixed; left: calc(22px + env(safe-area-inset-left, 0px)); top: 18vh; bottom: 18vh; width: 2px; z-index: 20; display: none; }
.rail__line { position: absolute; inset: 0; background: var(--line); border-radius: 2px; }
.rail__fill { position: absolute; inset: 0; width: 2px; background: var(--muted); border-radius: 2px; transform: scaleY(0); transform-origin: top; }
.rail__dot { position: absolute; left: -4px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
@media (min-width: 1320px) { .rail { display: block; } }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 30; transition: background-color 0.3s, border-color 0.3s, backdrop-filter 0.3s; border-bottom: 1px solid transparent; }
.nav.scrolled { background: rgba(7, 20, 38, 0.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom-color: var(--line); }
.nav__in { display: flex; align-items: center; gap: 24px; height: 68px; }
.nav__links { display: flex; gap: 26px; margin-left: auto; }
.nav__links a { font-size: 15px; color: var(--ink-2); text-decoration: none; position: relative; padding: 6px 0; }
.nav__links a.is-current { color: var(--ink); }
.nav__links a.is-current::after { transform: scaleX(1); }
.nav__links a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 0.25s var(--ease-out); }
.nav__btns { display: flex; gap: 8px; }
@media (max-width: 860px) { .nav__links { display: none; } .nav .btn, .nav .nav__btns { margin-left: auto; } .nav .nav__btns .btn { margin-left: 0; } }
@media (max-width: 400px) { .nav__in { gap: 12px; } .nav__btns .btn--small { padding: 0 12px; } .brand__name span { display: none; } }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__hat { width: 30px; height: 30px; fill: var(--accent); }
.brand__ridge { fill: var(--night); opacity: 0.35; }
.brand__name { font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.brand__name span { font-weight: 400; color: var(--ink-2); margin-left: 3px; }

/* ---------- hero ---------- */
.hero { padding: clamp(36px, 7vw, 84px) 0 clamp(64px, 9vw, 120px); }
.hero__in { display: grid; gap: clamp(40px, 6vw, 72px); }
.hero__copy { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-areas: 'k k' 'h l' 'h c' 'h x'; column-gap: clamp(32px, 6vw, 88px); align-items: end; }
.hero__copy .kicker { grid-area: k; }
.hero h1 { grid-area: h; font-size: clamp(40px, 6vw, 78px); font-weight: 700; margin: 22px 0 0; align-self: end; }
.hero h1 .serif { font-size: 1.08em; white-space: nowrap; }
.lede { grid-area: l; font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); max-width: 34em; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; align-items: center; }
.hero__copy .hero__ctas { grid-area: c; margin-top: 26px; }
.hero__chips { grid-area: x; display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 6px; padding: 0; list-style: none; font-size: 12px; color: var(--muted); }
.hero__chips li { padding: 6px 10px; border: 1px dashed var(--line-strong); border-radius: 999px; }
.hero__copy .reveal:nth-child(2) { --d: 80ms; }
.hero__copy .reveal:nth-child(3) { --d: 160ms; }
.hero__copy .reveal:nth-child(4) { --d: 240ms; }
.hero__copy .reveal:nth-child(5) { --d: 320ms; }
.flow.reveal { --d: 380ms; }
@media (max-width: 900px) {
  .hero__copy { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'k' 'h' 'l' 'c' 'x'; }
  .hero h1 { margin-bottom: 22px; }
}

/* ---------- flow diagram ---------- */
.flow {
  position: relative; margin: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr); gap: clamp(40px, 9vw, 130px);
  align-items: center;
  padding: clamp(28px, 4vw, 44px) clamp(16px, 4vw, 48px);
  border: 1px solid var(--line); border-radius: 22px;
  background: rgba(11, 29, 53, 0.6);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.flow::before { content: 'live data flow'; position: absolute; top: -10px; left: 22px; padding: 0 8px; background: var(--night); font: 600 11px/20px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border-radius: 4px; }
.flow__wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.flow__wires .w-in { fill: none; stroke: rgba(142, 163, 191, 0.35); stroke-width: 1.5; stroke-dasharray: 3 5; }
.flow__wires .w-out { fill: none; stroke: rgba(62, 224, 143, 0.32); stroke-width: 1.5; }
.flow__wires .pk { fill: var(--accent); }
.flow__wires .pk--out { fill: var(--ok); }
.flow__col { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.chip {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 10px 14px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.3;
  background: var(--night-2); border: 1px solid var(--line);
  transition: transform 0.35s var(--ease-out), border-color 0.35s, box-shadow 0.35s;
}
.chip span { min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip b { display: block; color: var(--ink); font-weight: 600; font-size: 14px; }
.chip > .ico { font-size: 18px; color: var(--muted); }
.chip--in { transform: rotate(var(--r)); border-style: dashed; }
.chip--in.emit { transform: rotate(var(--r)) scale(1.04); border-color: var(--muted); }
.chip--out .tick { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid rgba(62, 224, 143, 0.5); color: var(--night); font-size: 13px; transition: background-color 0.3s; }
.chip--out .tick .ico { stroke-width: 2.5; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset 0.4s var(--ease-out) 0.05s; }
.chip--out.done .tick { background: var(--ok); border-color: var(--ok); }
.chip--out.done .tick .ico { stroke-dashoffset: 0; }
.chip--out.hit { transform: translateX(4px); border-color: rgba(62, 224, 143, 0.6); box-shadow: 0 0 0 4px rgba(62, 224, 143, 0.08); }

.flow__core { position: relative; z-index: 1; display: grid; place-items: center; }
.core {
  position: relative; width: 150px; height: 150px; border-radius: 50%;
  display: grid; place-content: center; justify-items: center; gap: 2px;
  background: var(--night-2);
  border: 1px solid var(--line-strong);
  transition: transform 0.25s var(--ease-out);
}
.core.beat { transform: scale(1.05); }
.core__ring { position: absolute; inset: -10px; border-radius: 50%; border: 1.5px dashed var(--line-strong); animation: spin 18s linear infinite; }
.core__ring--b { inset: -20px; border-style: solid; border-color: transparent; border-top-color: rgba(62, 224, 143, 0.5); border-right-color: rgba(62, 224, 143, 0.15); animation-duration: 4s; }
@keyframes spin { to { transform: rotate(360deg); } }
.core__hat { width: 36px; height: 36px; fill: var(--ink-2); }
.core__label { font-weight: 700; font-size: 15px; }
.core__verb { font-size: 11px; color: var(--ok); min-height: 1.3em; }

@media (max-width: 620px) {
  .flow { grid-template-columns: minmax(0, 1fr); gap: 44px; padding: 26px 16px 22px; }
  .flow__col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .flow .hide-sm { display: none; }
  .chip { padding: 8px 10px; font-size: 12px; gap: 8px; }
  .chip b { font-size: 12px; }
  .chip span { white-space: normal; }
  .core { width: 112px; height: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .hero .reveal { opacity: 1; transform: none; transition: none; animation: none; }
  .core__ring, .pulse::after { animation: none; }
}
