/* ==========================================================================
   Sanagis — landing design system
   Tokens, type ramp and surface language are lifted verbatim from the product
   export (sanagis-dashboard-source/Sanagis Dashboard.dc.html). Do not drift:
   if a value here disagrees with the product, the product wins.
   ========================================================================== */

:root {
  /* Canvas ---------------------------------------------------------------- */
  --bg:            #06090A;
  --bg-2:          #0A0E0F;
  --panel:         #0C1112;
  --panel-2:       #0F1516;
  --panel-3:       #181F20;
  --line:          #18201F;
  --line-2:        #1A2223;
  --line-3:        #223231;

  /* Accents --------------------------------------------------------------- */
  --mint:          #35E08A;
  --mint-soft:     #7CF0B6;
  --mint-pale:     #9FEFC6;
  --cyan:          #38BDF8;
  --cyan-deep:     #1FA5C9;
  --amber:         #F5B455;   /* single warm signal — "needs attention" only  */
  --red:           #FF6B6B;
  --on-mint:       #04140C;

  /* Text ------------------------------------------------------------------
     --tx-3 and --tx-4 are lifted from the product's #6F817D / #5A6A67. Those
     two fail WCAG AA for small text on this canvas (4.49:1 and 3.51:1), which
     is defensible inside an authenticated dashboard and not on a public
     marketing page. Same hue, minimum viable lift: every surface they are
     used against now clears 4.5:1. Everything else is the product verbatim. */
  --tx:            #E6EDEA;
  --tx-2:          #8B9A96;
  --tx-3:          #768984;   /* was #6F817D — now ≥4.99:1 on all panels     */
  --tx-4:          #6E827E;   /* was #5A6A67 — now ≥4.53:1 on all panels     */
  --tx-hi:         #DCE6E3;

  /* Gradients ------------------------------------------------------------- */
  --grad:          linear-gradient(90deg, var(--mint), var(--cyan));
  --grad-135:      linear-gradient(140deg, var(--mint), var(--cyan-deep));

  /* Rhythm ---------------------------------------------------------------- */
  --gut:           clamp(20px, 5vw, 64px);
  --maxw:          1240px;
  --r-sm:          9px;
  --r:             14px;
  --r-lg:          18px;
  --r-xl:          24px;

  /* Motion ---------------------------------------------------------------- */
  --ease:          cubic-bezier(.2, .8, .3, 1);
  --ease-in-out:   cubic-bezier(.4, 0, .15, 1);
  --ease-over:     cubic-bezier(.2, .9, .3, 1.12);   /* slight overshoot      */

  color-scheme: dark;
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -.035em; line-height: 1.08; }
p  { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

a { color: var(--mint); text-decoration: none; }
a:hover { color: var(--mint-soft); }

::selection { background: rgba(53, 224, 138, .22); color: #fff; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1E2729; border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: #2A3634; }

:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Numbers are always mono — signature of the product. -------------------- */
.mono, .num {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 50%; top: 8px; transform: translate(-50%, -140%);
  background: var(--mint); color: var(--on-mint); font-weight: 800; font-size: 13px;
  padding: 10px 18px; border-radius: var(--r-sm); z-index: 200;
  transition: transform .18s var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); color: var(--on-mint); }

/* ==========================================================================
   Layout primitives
   ========================================================================== */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
}

/* overflow-x: clip (not hidden) with overflow-y: visible is a legal pair and
   the only one that works here: the .aura glows are deliberately larger than
   the viewport, so they must be prevented from widening the document, while
   still bleeding vertically between sections. `hidden` would compute the
   y-axis to `auto` and introduce a nested scroll container. */
.section {
  position: relative;
  padding-block: clamp(88px, 13vh, 160px);
  overflow-x: clip;
  overflow-y: visible;
}
.section--tight { padding-block: clamp(60px, 8vh, 100px); }

/* Grid and flex children default to min-width:auto and refuse to shrink below
   their content — which is how a wide <pre> or a long table row escapes. */
.hero__grid > *, .fourq__stage > *, .sage__stage > * { min-width: 0; }

/* Eyebrow ---------------------------------------------------------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: var(--mint-soft);
  margin-bottom: 22px;
}
.eyebrow::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--mint); flex: none;
  box-shadow: 0 0 10px rgba(53, 224, 138, .8);
  animation: sgpulse 2.4s ease-in-out infinite;
}

/* Display type ramp ------------------------------------------------------ */
.display   { font-size: clamp(38px, 7.2vw, 84px); }
.display-2 { font-size: clamp(32px, 5.2vw, 60px); }
.display-3 { font-size: clamp(26px, 3.4vw, 40px); }

.lede {
  font-size: clamp(15px, 1.5vw, 18px);
  color: var(--tx-2);
  line-height: 1.65;
  max-width: 56ch;
}

.accent    { color: var(--mint); }
.accent-gr {
  background: linear-gradient(96deg, var(--mint) 0%, var(--cyan) 62%, var(--cyan-deep) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ==========================================================================
   Atmosphere — volumetric light, grain, depth. No drop shadows for depth.
   ========================================================================== */

.aura {
  position: absolute; border-radius: 50%; pointer-events: none;
  filter: blur(30px); z-index: 0;
}
.aura--mint { background: radial-gradient(circle, rgba(53, 224, 138, .16), transparent 64%); }
.aura--cyan { background: radial-gradient(circle, rgba(56, 189, 248, .13), transparent 66%); }
.aura--amber{ background: radial-gradient(circle, rgba(245, 180, 85, .14), transparent 66%); }

/* Film grain — one fixed layer for the whole document. */
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none;
  opacity: .032; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Hairline rule that fades at both ends. */
.rule {
  height: 1px; border: 0; margin: 0;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

/* ==========================================================================
   Surfaces — glass, matching the product's card chrome
   ========================================================================== */

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
}

.glass {
  background: rgba(11, 17, 18, .72);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

/* Top-edge light catch — reads as a lit surface, not a shadowed one. */
.lit::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(53, 224, 138, .5), transparent);
  border-radius: inherit; pointer-events: none;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 0 22px;
  border: 1px solid transparent; border-radius: 11px;
  font-size: 13.5px; font-weight: 800; letter-spacing: -.01em;
  cursor: pointer; white-space: nowrap;
  transition: transform .2s var(--ease), background-color .2s var(--ease),
              border-color .2s var(--ease), box-shadow .3s var(--ease);
  will-change: transform;
}

.btn--primary {
  background: var(--mint); color: var(--on-mint);
  box-shadow: 0 8px 26px rgba(53, 224, 138, .2);
}
.btn--primary:hover {
  color: var(--on-mint);
  background: var(--mint-soft);
  box-shadow: 0 12px 38px rgba(53, 224, 138, .38);
  transform: translateY(-2px);
}

.btn--ghost {
  background: rgba(14, 19, 20, .8); border-color: var(--line-3); color: var(--tx);
}
.btn--ghost:hover {
  color: var(--tx);
  border-color: #2E403D; background: #101718; transform: translateY(-2px);
}

.btn--lg { min-height: 54px; padding: 0 30px; font-size: 14.5px; }
.btn--block { width: 100%; }

/* Magnetic pull — JS writes --mx/--my in px, clamped small on purpose. */
.magnetic { transform: translate3d(var(--mx, 0px), var(--my, 0px), 0); }
.magnetic:hover { transform: translate3d(var(--mx, 0px), calc(var(--my, 0px) - 2px), 0); }

.note {
  font-size: 12px; color: var(--tx-3);
  display: inline-flex; align-items: center; gap: 7px;
}
.note svg { flex: none; opacity: .8; }

/* ==========================================================================
   Chrome — nav + footer
   ========================================================================== */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background-color .3s var(--ease), border-color .3s var(--ease),
              backdrop-filter .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav[data-stuck='true'] {
  background: rgba(6, 9, 10, .82);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom-color: #141B1C;
}
.nav__in {
  display: flex; align-items: center; gap: 14px;
  height: 68px;
  max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut);
}
.nav__logo { display: flex; align-items: center; }
.nav__logo img { height: 21px; width: auto; }
.nav__links { display: flex; align-items: center; gap: 4px; margin-left: 18px; }
.nav__link {
  padding: 9px 13px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; color: var(--tx-2);
  transition: color .18s var(--ease), background-color .18s var(--ease);
}
.nav__link:hover { color: var(--tx); background: #101617; }
.nav__link[aria-current='page'] { color: var(--tx); background: #121A1A; }
.nav__cta { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav__toggle { display: none; }

/* Scroll progress hairline. */
.nav__prog {
  position: absolute; left: 0; bottom: -1px; height: 2px;
  width: 100%; transform-origin: left; transform: scaleX(var(--doc-p, 0));
  background: var(--grad); opacity: .85;
}

.footer { position: relative; border-top: 1px solid #121819; padding-block: 56px 40px; }
.footer__grid {
  display: grid; gap: 40px;
  grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr));
}
.footer__logo img { height: 22px; margin-bottom: 16px; }
.footer h4 {
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--tx-4); font-weight: 800; margin-bottom: 14px;
}
.footer li { margin-bottom: 9px; }
.footer li a { color: var(--tx-2); font-size: 13px; font-weight: 500; }
.footer li a:hover { color: var(--tx); }
.footer__base {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  margin-top: 44px; padding-top: 22px; border-top: 1px solid #121819;
  font-size: 11.5px; color: var(--tx-4);
}
.footer__base nav { margin-left: auto; display: flex; gap: 16px; }
.footer__base nav a { color: var(--tx-3); }

/* ==========================================================================
   Brand mark — trend-line + 8-ray sparkle, redrawn from the real logo.
   Reused everywhere as the "AI is here" signifier and as Sage herself.
   ========================================================================== */

.spark { display: block; overflow: visible; }
.spark .spark__line { stroke: currentColor; stroke-width: 2.1; fill: none;
  stroke-linecap: round; stroke-linejoin: round; }
.spark .spark__ray  { stroke: currentColor; stroke-width: 2.1; fill: none;
  stroke-linecap: round; }

.sage-avatar {
  position: relative; flex: none;
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--grad-135); color: var(--on-mint);
}
.sage-avatar--lg { width: 56px; height: 56px; border-radius: 17px; }

/* ==========================================================================
   Product UI primitives — reproduced from the real dashboard so the demos
   read as the actual product, not a landing-page illustration.
   ========================================================================== */

.ring { position: relative; flex: none; }
.ring__val {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
}
.ring__num { font-size: 30px; font-weight: 600; letter-spacing: -.03em; }
.ring__cap { font-size: 9.5px; color: var(--tx-3); letter-spacing: .12em; }
.ring circle { transform: rotate(-90deg); transform-origin: 50% 50%; }

.bars { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 0; }
.bar__top {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 10.5px; margin-bottom: 5px;
}
.bar__label { color: var(--tx-2); font-weight: 600; }
.bar__val   { color: var(--tx-hi); }
.bar__track { height: 4px; background: #161E1F; border-radius: 4px; overflow: hidden; }
.bar__fill  {
  height: 100%; border-radius: 4px; transform-origin: left;
  transform: scaleX(var(--fill, 0));
  transition: transform .9s var(--ease-in-out);
}

.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 15px; }
.kpi__label { font-size: 10.5px; color: var(--tx-2); font-weight: 600; margin-bottom: 8px; }
.kpi__val   { font-size: 22px; font-weight: 600; letter-spacing: -.03em; }
.kpi__delta { font-size: 10.5px; margin-top: 6px; font-weight: 600; color: var(--mint); }
.kpi__delta--warn { color: #FF9B9B; }

.tag {
  font-size: 9.5px; font-weight: 800; letter-spacing: .08em;
  padding: 4px 8px; border-radius: 6px; flex: none;
}
.tag--high { background: rgba(53, 224, 138, .14); color: var(--mint); }
.tag--med  { background: rgba(245, 180, 85, .14); color: var(--amber); }
.tag--low  { background: rgba(120, 140, 136, .14); color: var(--tx-2); }
.tag--type { background: #18211F; color: #8FE3BC; }

.opp {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel-2); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 12px 13px;
}
.opp__title { font-size: 12.5px; font-weight: 600; }
.opp__meta  { font-size: 10.5px; color: var(--tx-3); margin-top: 2px; }
.opp__fix {
  background: var(--mint); color: var(--on-mint); border: none;
  border-radius: 8px; padding: 7px 12px;
  font-size: 10.5px; font-weight: 800; flex: none; cursor: pointer;
}

.chip-engine {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 9.5px; font-weight: 700;
  color: var(--mint-pale); background: rgba(53, 224, 138, .08);
  border: 1px solid rgba(53, 224, 138, .16); border-radius: 7px; padding: 7px 4px;
}

/* ==========================================================================
   AI assistant marks + the "Brand Visibility" bar panel
   Same composition as a real per-assistant visibility/sentiment readout:
   icon, name, a long track, a filled portion, a mono percentage on the right.
   ========================================================================== */

.brandmark {
  display: grid; place-items: center; flex: none;
  width: 26px; height: 26px; border-radius: 7px;
}
.brandmark svg { width: 15px; height: 15px; }
.brandmark--sm { width: 20px; height: 20px; border-radius: 6px; background: transparent !important; }
.brandmark--sm svg { width: 16px; height: 16px; }

/* One fixed identity per assistant: an icon tint and a bar color. Reused by
   the chip row, the brandbar list, and the visibility node graph labels.
   Flat fills, not gradients — closer to the plain solid bar in the
   reference composition than our earlier per-brand gradient treatment. */
.brandmark--chatgpt     { background: rgba(116, 170, 156, .16); color: #A9D9CB; }
.brandmark--claude      { background: rgba(217, 119, 87, .16);  color: #E8875A; }
.brandmark--perplexity  { background: rgba(32, 184, 205, .16);  color: #4FC9DE; }
.brandmark--gemini      { background: rgba(139, 124, 246, .16); color: #9C8CF5; }

.bar--chatgpt    { background: #4E9C88; }
.bar--claude     { background: #C96A44; }
.bar--perplexity { background: #1FA6BD; }
.bar--gemini     { background: #6C63D6; }

.brandbar__head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
}
.brandbar__title { font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; }
.brandbar__pill {
  margin-left: auto; display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; color: var(--tx-2);
  background: #101617; border: 1px solid var(--line-2);
  border-radius: 20px; padding: 7px 12px 7px 13px;
}
.brandbar__pill svg { color: var(--tx-4); }

.brandbar__list { display: flex; flex-direction: column; gap: 16px; }
.brandbar__row { display: flex; align-items: center; gap: 11px; }
.brandbar__name { font-size: 13px; font-weight: 600; width: 90px; flex: none; }
.brandbar__track {
  flex: 1; height: 6px; border-radius: 999px; background: #161E1F; overflow: hidden;
}
.brandbar__fill {
  height: 100%; border-radius: 999px; transform-origin: left;
  transform: scaleX(var(--fill, 0)); transition: transform 1s var(--ease-in-out);
}
.brandbar__val {
  width: 52px; flex: none; text-align: right;
  font-size: 12.5px; color: var(--tx-2);
}

/* Map-visibility grid (real ranks from the product). */
.grid-map { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.grid-map i {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 6px;
  font-size: 10px; font-weight: 600; font-style: normal;
  font-family: 'JetBrains Mono', monospace;
}
.grid-map i[data-r='top']  { background: var(--mint);  color: var(--on-mint); }
.grid-map i[data-r='mid']  { background: var(--amber); color: #1A1204; }
.grid-map i[data-r='low']  { background: var(--red);   color: #fff; }

/* ==========================================================================
   Reveal — scroll-linked, never fire-once. Progress comes from JS as --p.
   ========================================================================== */

[data-reveal] {
  opacity: var(--rv-o, 0);
  transform: translate3d(0, var(--rv-y, 22px), 0);
  transition: opacity .1s linear, transform .1s linear;
  will-change: opacity, transform;
}

/* ==========================================================================
   Keyframes (named to match the product's own sg* set)
   ========================================================================== */

@keyframes sgpulse { 0%, 100% { opacity: .38; } 50% { opacity: 1; } }
@keyframes sgbob   { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes sgorbit { to { transform: rotate(360deg); } }
@keyframes sgring  {
  0%   { transform: scale(.85); opacity: .55; }
  70%  { transform: scale(1.5);  opacity: 0; }
  100% { opacity: 0; }
}
@keyframes sgsweep { 0% { transform: translateX(-130%); } 55%, 100% { transform: translateX(340%); } }
@keyframes sgcaret { 0%, 45% { opacity: 1; } 46%, 100% { opacity: 0; } }
@keyframes sgdrift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* ==========================================================================
   Responsive — 3D collapses to layered 2D parallax, narrative order intact.
   ========================================================================== */

@media (max-width: 1000px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__toggle {
    display: grid; place-items: center; margin-left: auto;
    width: 44px; height: 44px; border-radius: var(--r-sm);
    background: #0E1314; border: 1px solid var(--line-3); cursor: pointer;
  }
  .nav__cta { margin-left: 10px; }
  .nav__cta .btn--ghost { display: none; }

  /* Mobile drawer */
  .nav[data-open='true'] .nav__links {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; inset: 68px 0 auto 0; margin: 0;
    padding: 10px var(--gut) 20px;
    background: rgba(6, 9, 10, .97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid #141B1C;
  }
  .nav[data-open='true'] .nav__link { min-height: 46px; display: flex; align-items: center; }

  .footer__grid { grid-template-columns: 1fr; gap: 28px; }
  .footer__base nav { margin-left: 0; width: 100%; }
}

/* Anything with a real tap action clears 44px on touch. */
@media (pointer: coarse) {
  .btn, .nav__link, .opp__fix, .faq__q { min-height: 44px; }
}

/* ==========================================================================
   Reduced motion — serve the composed end state, kill every timeline.
   JS also reads this and stops writing progress vars.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .grain { display: none; }
}
