/* ============================================================
   CoreGrid Technologies — SYSTEM
   "Deep Cobalt" · the foundation: tokens, type, chrome
   ============================================================ */

/* Fontshare — Clash Display (display) + General Sans (body) */
@import url('https://api.fontshare.com/v2/css?f[]=clash-display@400,500,600,700&f[]=general-sans@400,500,600&display=swap');
/* JetBrains Mono — technical / signal labels */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ---- deep cobalt canvas (blue-undertoned, never neutral black) ---- */
  --bg:        #02030a;
  --bg-2:      #04050d;
  --elev:      #070a16;
  --surface:   #0a0e1f;
  --surface-2: #0d1226;

  /* cobalt-tinted hairlines */
  --hair:    rgba(99, 140, 255, 0.09);
  --hair-2:  rgba(99, 140, 255, 0.17);
  --hair-3:  rgba(99, 140, 255, 0.28);

  /* ---- cobalt brand ramp ---- */
  --cobalt-900: #0e1f52;
  --cobalt-700: #1e3f9e;
  --cobalt-500: #3461e6;   /* core brand */
  --cobalt-400: #4c7bff;
  --cobalt-300: #79a0ff;   /* bright glow / highlight */
  --cobalt-glow: rgba(76, 123, 255, 0.55);

  /* ---- engine accents ---- */
  --revenue:      #e8b563;             /* warm gold — top line  */
  --revenue-soft: rgba(232, 181, 99, 0.13);
  --revenue-line: rgba(232, 181, 99, 0.42);
  --cost:         #5384ff;             /* cobalt — bottom line  */
  --cost-soft:    rgba(83, 132, 255, 0.14);
  --cost-line:    rgba(83, 132, 255, 0.45);

  /* ---- ink ---- */
  --ink:      #eceff8;
  --ink-soft: #b4bcd4;
  --ink-mute: #828ba6;
  --ink-dim:  #565f7a;

  /* ---- warm-white primary (CTA) ---- */
  --paper: #f1eee6;

  /* ---- type ---- */
  --display: 'Clash Display', sans-serif;
  --body:    'General Sans', sans-serif;
  --mono:    'JetBrains Mono', monospace;

  /* ---- layout ---- */
  --maxw: 1180px;
  --rail: 188px;                /* left journey rail width (desktop) */
  --pad:  clamp(20px, 4.5vw, 56px);
  --r:    14px;
  --r-lg: 22px;

  --ease: cubic-bezier(.22, .68, .28, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* deep cobalt atmospheric gradient under everything */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(120% 80% at 78% -5%, rgba(30, 63, 158, 0.16), transparent 55%),
    radial-gradient(90% 70% at 8% 110%, rgba(20, 40, 110, 0.13), transparent 60%);
}
/* slow-drifting cobalt aurora — gives the dark a living depth */
.bg-aurora {
  position: fixed; inset: -25%; z-index: -2; pointer-events: none; opacity: 0.55;
  background:
    radial-gradient(38% 46% at 22% 28%, rgba(30, 63, 158, 0.30), transparent 62%),
    radial-gradient(42% 50% at 82% 72%, rgba(76, 123, 255, 0.16), transparent 60%),
    radial-gradient(30% 36% at 60% 50%, rgba(40, 70, 170, 0.12), transparent 65%);
  filter: blur(26px);
  animation: auroraDrift 28s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes auroraDrift {
  0%   { transform: translate(-3%, -2%) scale(1); }
  50%  { transform: translate(3%, 2%) scale(1.09); }
  100% { transform: translate(-1%, 3%) scale(1.03); }
}
/* faint grid texture, fixed, very subtle */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(rgba(99,140,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,140,255,0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(120% 100% at 50% 0%, #000 30%, transparent 85%);
          mask-image: radial-gradient(120% 100% at 50% 0%, #000 30%, transparent 85%);
}

/* fixed canvases: journey field (behind) + cursor trail (above) */
#journey-field { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.trail-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 9998; pointer-events: none; mix-blend-mode: screen; }

::selection { background: var(--cobalt-400); color: #04060e; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- custom cursor ---------- */
.cursor, .cursor-dot { position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; border-radius: 50%; mix-blend-mode: difference; }
.cursor {
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1px solid rgba(255,255,255,0.85);
  transition: width .25s var(--ease), height .25s var(--ease), margin .25s var(--ease), opacity .25s, background .25s;
}
.cursor-dot { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; background: #fff; }
.cursor.is-hover { width: 56px; height: 56px; margin: -28px 0 0 -28px; background: rgba(255,255,255,0.12); }
.cursor.is-down  { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
body.using-cursor { cursor: none; }
body.using-cursor a, body.using-cursor button, body.using-cursor input { cursor: none; }
@media (hover: none), (pointer: coarse) { .cursor, .cursor-dot { display: none !important; } body.using-cursor { cursor: auto; } }

/* ---------- type ---------- */
.kicker {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.26em; text-transform: uppercase; color: var(--ink-mute);
  display: inline-flex; align-items: center; gap: 11px;
}
.kicker::before { content: ''; width: 26px; height: 1px; background: var(--hair-3); }
.kicker--rev  { color: var(--revenue); } .kicker--rev::before  { background: var(--revenue-line); }
.kicker--cost { color: var(--cost); }    .kicker--cost::before { background: var(--cost-line); }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.02; letter-spacing: -0.018em; }

.display {
  font-size: clamp(2.9rem, 7.4vw, 6.2rem);
  line-height: 0.96; letter-spacing: -0.03em; font-weight: 600;
}
.h2 { font-size: clamp(2.05rem, 4.6vw, 3.6rem); letter-spacing: -0.025em; line-height: 1.0; }
.h3 { font-size: clamp(1.4rem, 2.3vw, 1.95rem); letter-spacing: -0.015em; }

.lede {
  font-size: clamp(1.06rem, 1.65vw, 1.4rem); line-height: 1.5;
  color: var(--ink-soft); max-width: 58ch; text-wrap: pretty; font-weight: 400;
}
.muted { color: var(--ink-mute); }
.dim   { color: var(--ink-dim); }
.grad-rev  { color: var(--revenue); }
.grad-cost { color: var(--cobalt-300); }

/* gradient text for hero highlight */
.shine {
  background: linear-gradient(100deg, var(--ink) 0%, var(--cobalt-300) 55%, var(--ink) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--body); font-size: 15px; font-weight: 600;
  padding: 14px 24px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: transform .3s var(--ease), background .3s, border-color .3s, color .3s, box-shadow .3s;
  will-change: transform;
}
.btn--primary { background: var(--paper); color: #0a0d18; box-shadow: 0 0 0 0 var(--cobalt-glow); }
.btn--primary:hover { background: #fff; box-shadow: 0 8px 38px -8px var(--cobalt-glow); }
.btn--ghost { background: rgba(99,140,255,0.04); color: var(--ink); border-color: var(--hair-2); }
.btn--ghost:hover { border-color: var(--cobalt-400); background: rgba(76,123,255,0.10); }
.btn--sm { padding: 10px 18px; font-size: 13.5px; }
.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- tags ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--hair-2); color: var(--ink-mute);
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag--rev  { color: var(--revenue); border-color: var(--revenue-line); background: var(--revenue-soft); }
.tag--cost { color: var(--cost);    border-color: var(--cost-line);    background: var(--cost-soft); }
.tag--both { color: var(--ink-soft); border-color: var(--hair-2); background: linear-gradient(90deg, var(--revenue-soft), var(--cost-soft)); }
.tag--xform { color: var(--cobalt-300); border-color: var(--cost-line); background: var(--cost-soft); }

/* ============================================================
   CHROME — top nav, left journey rail, menu overlay, footer
   ============================================================ */

/* top nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  transition: background .35s, border-color .35s, backdrop-filter .35s;
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: rgba(4, 6, 14, 0.72);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--hair);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px var(--pad); }
.nav__links { display: flex; align-items: center; gap: 30px; }
.nav__link { font-size: 14.5px; color: var(--ink-soft); transition: color .2s; }
.nav__link:hover { color: var(--ink); }
.nav__cta { display: flex; align-items: center; gap: 14px; }

/* logo */
.logo { display: inline-flex; align-items: center; gap: 11px; }
.logo__mark { width: 28px; height: 28px; flex: none; }
.logo__word { font-family: var(--display); font-weight: 600; font-size: 18.5px; letter-spacing: -0.02em; color: var(--ink); }
.logo__word span { color: var(--ink-mute); font-weight: 500; }

/* hamburger */
.menu-btn { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--ink); font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; }
.menu-btn__bars { display: inline-flex; flex-direction: column; gap: 4px; width: 22px; }
.menu-btn__bars i { height: 1.5px; background: var(--ink); transition: transform .3s var(--ease), opacity .3s; display: block; }
.menu-btn__bars i:nth-child(1) { width: 22px; } .menu-btn__bars i:nth-child(2) { width: 14px; margin-left: auto; }

/* ---------- left journey rail ---------- */
.rail {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--rail); z-index: 70;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  padding-left: 32px; gap: 0; pointer-events: none;
  opacity: 0; transform: translateX(-12px); transition: opacity .6s, transform .6s;
}
.rail.is-on { opacity: 1; transform: none; }
.rail__line { position: absolute; top: 14%; bottom: 14%; left: 36px; width: 1px; background: var(--hair-2); }
.rail__line i { position: absolute; top: 0; left: 0; width: 100%; height: 0%; background: linear-gradient(180deg, var(--cobalt-300), var(--cobalt-500)); box-shadow: 0 0 12px var(--cobalt-glow); transition: height .2s linear; }
.rail__items { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: clamp(20px, 3.6vh, 42px); pointer-events: auto; }
.rail__item { position: relative; display: flex; align-items: center; gap: 15px; color: var(--ink-dim); transition: color .35s; cursor: pointer; }
.rail__node { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--hair-3); background: var(--bg); flex: none; transition: all .35s var(--ease); position: relative; z-index: 1; }
.rail__label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; display: inline-flex; align-items: center; transition: color .35s; }
.rail__num { font-family: var(--mono); font-size: 10px; color: var(--cobalt-300); opacity: .55; margin-right: 9px; transition: opacity .35s; }
.rail__item:hover { color: var(--ink-soft); }
.rail__item.is-active { color: var(--ink); }
.rail__item.is-active .rail__num { opacity: 1; }
.rail__item.is-active .rail__node { border-color: var(--cobalt-300); background: var(--cobalt-400); box-shadow: 0 0 0 4px var(--cost-soft), 0 0 16px var(--cobalt-glow); transform: scale(1.25); }
.rail__item.is-core .rail__node { border-radius: 2px; }

/* ---------- menu overlay (sidewave-style) ---------- */
.menu {
  position: fixed; inset: 0; z-index: 90; background: rgba(4,6,14,0.96);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: grid; grid-template-columns: 1.5fr 1fr; align-items: stretch;
  opacity: 0; visibility: hidden; transition: opacity .5s, visibility .5s;
}
.menu.is-open { opacity: 1; visibility: visible; }
.menu__close { position: absolute; top: 18px; right: var(--pad); z-index: 2; background: none; border: 0; color: var(--ink); font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.menu__nav { padding: clamp(80px, 14vh, 160px) var(--pad) 60px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.menu__link { position: relative; display: flex; align-items: baseline; gap: 18px; padding: 8px 0; overflow: hidden; }
.menu__link .mnum { font-family: var(--mono); font-size: 13px; color: var(--cobalt-300); flex: none; width: 34px; }
.menu__link .mname { font-family: var(--display); font-weight: 600; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: -0.02em; color: var(--ink-mute); transition: color .35s var(--ease), transform .45s var(--ease); }
.menu__link:hover .mname { color: var(--ink); transform: translateX(14px); }
.menu__aside { border-left: 1px solid var(--hair); padding: clamp(80px,14vh,160px) var(--pad) 60px; display: flex; flex-direction: column; justify-content: center; gap: 26px; background: linear-gradient(180deg, transparent, rgba(30,63,158,0.06)); }
.menu__aside h5 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 10px; }
.menu__aside a { color: var(--ink-soft); font-size: 16px; display: block; margin-bottom: 8px; transition: color .2s; }
.menu__aside a:hover { color: var(--cobalt-300); }
/* compact email capture inside the menu */
.menu__capture { margin-top: 18px; max-width: 340px; }
.menu__capture .capture__form { padding: 5px; }
.menu__capture .capture__input { font-size: 14px; padding: 8px 12px; }
/* generic capture success state (works outside .capt cards too) */
[data-capture].is-sent .capture__form { display: none; }
[data-capture].is-sent .capture__ok { display: flex; }

/* ---------- layout helpers ---------- */
.shell { padding-left: var(--rail); }                 /* make room for the rail */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }
.section { position: relative; padding-block: clamp(80px, 12vw, 168px); }
.section--tight { padding-block: clamp(56px, 8vw, 112px); }
.rule { height: 1px; background: var(--hair); border: 0; }

/* section heading block */
.shead { max-width: 66ch; }
.shead .kicker { margin-bottom: 24px; }
.shead h2 { margin-bottom: 20px; }
.shead .lede { color: var(--ink-mute); }
.shead--split { display: grid; grid-template-columns: 1.15fr .85fr; gap: 44px; align-items: end; max-width: none; }
.shead--split .lede { margin: 0; }

/* ---------- scroll reveal ----------
   Resting state is VISIBLE. The hidden start only exists while JS is
   present (html.js) and is removed by adding .in (transition plays).
   If JS never runs, content shows. If a transition stalls, the resting
   computed state is still opacity:1 — content is never stranded. */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(26px); filter: blur(7px); transition: opacity .8s var(--ease), transform .8s var(--ease), filter .8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; filter: none; }
.js .reveal[data-d="1"] { transition-delay: .08s; }
.js .reveal[data-d="2"] { transition-delay: .16s; }
.js .reveal[data-d="3"] { transition-delay: .24s; }
.js .reveal[data-d="4"] { transition-delay: .32s; }
.js .reveal[data-d="5"] { transition-delay: .40s; }

/* two-line clip reveal for the hero headline */
.hero__h1 .lr { display: block; overflow: hidden; padding-bottom: 0.04em; }
.js .hero__h1 .lr > span { display: block; transform: translateY(112%); transition: transform 1s var(--ease); }
.js .hero__h1.in .lr > span { transform: none; }
.js .hero__h1.in .lr:nth-child(2) > span { transition-delay: .12s; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--hair); padding-block: 64px 40px; position: relative; }
.footer__grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 40px; }
.footer__col h5 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 18px; }
.footer__col a { display: block; color: var(--ink-mute); font-size: 14.5px; margin-bottom: 11px; transition: color .2s; }
.footer__col a:hover { color: var(--ink); }
.footer__about { color: var(--ink-mute); font-size: 14.5px; max-width: 36ch; margin-top: 20px; }
.footer__bot { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--hair); flex-wrap: wrap; }
.footer__bot span { font-size: 13px; color: var(--ink-dim); font-family: var(--mono); }

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  :root { --rail: 0px; }
  .rail { display: none; }
  .shell { padding-left: 0; }
}
@media (max-width: 880px) {
  .nav__links { display: none; }
  .menu { grid-template-columns: 1fr; }
  .menu__aside { display: none; }
  .shead--split { grid-template-columns: 1fr; gap: 18px; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .footer__grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
  .js .hero__h1 .lr > span { transform: none !important; transition: none !important; }
  .bg-aurora { animation: none !important; }
  * { animation-duration: .001ms !important; }
}
