/* ==========================================================================
   CRUCIBLE DESIGN SYSTEM  ·  v1.0  ·  drop-in stylesheet
   --------------------------------------------------------------------------
   A single self-contained stylesheet. Import it once, globally, then apply
   the documented classes (or just the tokens) across your app.

   FONTS — add these two <link>s to your <head> (or keep the @import below):
     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
     <link href="https://api.fontshare.com/v2/css?f[]=satoshi@400,500,600,700,900&display=swap" rel="stylesheet">
   ========================================================================== */

/* Fonts self-hosted via /css/fonts.css (@font-face, CSP 'self') — external @import removed. */

/* ========================================================================== */
/*  1. DESIGN TOKENS                                                           */
/* ========================================================================== */
:root {
  /* — Type families — */
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif; /* headings, numerals, brand */
  --font-body:    'Satoshi', system-ui, -apple-system, sans-serif;       /* body, UI, labels */
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', monospace;  /* code, IDs, metrics, tags */

  /* — Type scale — */
  --t-hero:    clamp(40px, 5.2vw, 66px);
  --t-h1:      36px;
  --t-h2:      clamp(26px, 3.2vw, 34px);
  --t-h3:      22px;
  --t-h4:      17px;
  --t-lead:    19px;
  --t-body:    16px;
  --t-sm:      14px;
  --t-xs:      12.5px;
  --t-eyebrow: 12.5px;

  /* — Ink (text) — */
  --text:   #1C2030;  /* primary text & headings */
  --text-2: #494E60;  /* secondary / body copy (darkened for legibility) */
  --text-3: #656A7D;  /* tertiary / meta (darkened — was near-invisible at #8C90A2) */
  --text-4: #868B9C;  /* faint / table headers, disabled (darkened from #AFB2C0) */

  /* — Surfaces — */
  --bg:        #F6F7FB;  /* app canvas / page background */
  --bg-2:      #FBFBFD;  /* subtle raised row hover */
  --surface:   #FFFFFF;  /* cards, panels, bars */
  --surface-2: #F2F3F8;  /* inset wells, chips, hover fills */
  --line:      #E7E8F0;  /* primary borders */
  --line-2:    #EEEFF5;  /* hairline dividers inside cards */

  /* — Brand — */
  --accent: #3E63DD;  /* primary blue — actions, links, focus */
  --violet: #8A5CF5;  /* secondary — webhooks, accents */
  --teal:   #0FB8A6;  /* tertiary — success-ish brand pop */
  --grad:      linear-gradient(105deg, #3E63DD, #8A5CF5 58%, #0FB8A6);
  --grad-soft: linear-gradient(105deg, rgba(62,99,221,.12), rgba(138,92,245,.12) 58%, rgba(15,184,166,.12));

  /* — Status (fg + tint pairs) — */
  --ok:   #18A368;  --ok-bg:   #E4F6EE;  /* pass / healthy */
  --fail: #E5484D;  --fail-bg: #FCEAEA;  /* fail / error */
  --warn: #E0930A;  --warn-bg: #FBF1DD;  /* warning / degraded */
  --run:  #3E63DD;  --run-bg:  #E8ECFB;  /* running / in-progress */
  --idle: #9499AD;  --idle-bg: #EEEFF4;  /* idle / queued / neutral */

  /* — Radii — */
  --r-lg: 16px;  /* cards, large panels */
  --r-md: 12px;  /* inner cards, wells */
  --r-sm: 9px;   /* buttons, inputs, nav items */
  --r-xs: 6px;   /* tags, tiny chips */
  --r-pill: 20px;

  /* — Elevation — */
  --shadow-sm:  0 1px 2px rgba(28,32,48,.04), 0 1px 3px rgba(28,32,48,.06);
  --shadow-md:  0 4px 16px rgba(28,32,48,.06), 0 1px 4px rgba(28,32,48,.05);
  --shadow-lg:  0 18px 50px -12px rgba(28,32,48,.22), 0 6px 18px rgba(28,32,48,.08);
  --shadow-pop: 0 12px 40px -8px rgba(28,32,48,.20);

  /* — Spacing rhythm (use multiples of 4) — */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-12: 48px;

  /* — Layout — */
  --rail-w: 240px;
  --maxw: 1400px;

  /* — Marketing aliases (so landing-page components read naturally) — */
  --ink:   var(--text);
  --ink-2: var(--text-2);
  --ink-3: var(--text-3);
  --paper:   var(--surface);
  --paper-2: var(--bg);
  --paper-3: var(--surface-2);
}

/* ========================================================================== */
/*  2. RESET + BASE                                                            */
/* ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,h2,h3,h4,h5 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; color: var(--text); }
h1 { font-size: var(--t-h1); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
h4 { font-size: var(--t-h4); }
p  { color: var(--text-2); }
a  { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: rgba(138,92,245,.20); }
/* Responsive safety: media never overflows its container on narrow viewports. */
img, video, canvas { max-width: 100%; }

/* scrollbars — slim, neutral */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #D7D9E4; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #C2C5D4; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ========================================================================== */
/*  3. TYPOGRAPHY UTILITIES                                                    */
/* ========================================================================== */
.display   { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.035em; line-height: 0.98; }
.hero-type { font-size: var(--t-hero); font-family: var(--font-display); font-weight: 700; letter-spacing: -0.04em; line-height: 0.98; }
.mono      { font-family: var(--font-mono); }
.lead      { font-size: var(--t-lead); line-height: 1.5; color: var(--text-2); }
.small     { font-size: var(--t-sm); color: var(--text-2); }
.meta      { font-size: var(--t-xs); color: var(--text-3); }
.eyebrow   { font-family: var(--font-body); font-size: var(--t-eyebrow); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ========================================================================== */
/*  4. BUTTONS                                                                 */
/* ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 15px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; color: var(--text);
  background: var(--surface); border: 1px solid var(--line);
  transition: background .12s, border-color .12s, box-shadow .12s, transform .04s;
  white-space: nowrap;
}
.btn:hover  { background: var(--surface-2); border-color: #DBDDE8; }
.btn:active { transform: translateY(.5px); }
.btn svg    { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; box-shadow: 0 2px 8px -2px rgba(62,99,221,.5); }
.btn.primary:hover { background: #3556c8; }
.btn.grad    { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 14px -3px rgba(62,99,221,.5); }
.btn.grad:hover { filter: brightness(1.05); }
.btn.ghost   { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger  { color: var(--fail); }
.btn.danger:hover { background: var(--fail-bg); border-color: rgba(229,72,77,.3); }
.btn.sm   { height: 32px; padding: 0 11px; font-size: 13px; }
.btn.lg   { height: 48px; padding: 0 22px; font-size: 15.5px; border-radius: 11px; }
.btn.icon { width: 38px; padding: 0; }
.btn.icon.sm { width: 32px; }

/* ========================================================================== */
/*  5. CARDS / SURFACES                                                        */
/* ========================================================================== */
.card     { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card.hover, .card-hover { transition: box-shadow .14s, transform .14s, border-color .14s; }
.card.hover:hover, .card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #DCDEEA; }
.divider  { height: 1px; background: var(--line); margin: 16px 0; border: none; }

/* ========================================================================== */
/*  6. CHIPS · TAGS · STATUS DOTS · BADGES                                     */
/* ========================================================================== */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px;
  border-radius: var(--r-pill); font-size: 12px; font-weight: 600; font-family: var(--font-body);
  background: var(--surface-2); color: var(--text-2); border: 1px solid transparent; white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.chip.ok   { background: var(--ok-bg);   color: var(--ok); }
.chip.fail { background: var(--fail-bg); color: var(--fail); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.run  { background: var(--run-bg);  color: var(--run); }
.chip.idle { background: var(--idle-bg); color: var(--idle); }
.chip.line { background: var(--surface); border-color: var(--line); color: var(--text-2); }

.dot-ok { background: var(--ok); } .dot-fail { background: var(--fail); }
.dot-warn { background: var(--warn); } .dot-run { background: var(--run); } .dot-idle { background: var(--idle); }

.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-xs);
  font-size: 11.5px; font-weight: 600; font-family: var(--font-mono);
  background: var(--surface-2); color: var(--text-3); letter-spacing: -.01em;
}
/* HTTP method badge — color set inline per method (GET #18A368, POST #3E63DD, PUT #8A5CF5, PATCH #E0930A, DELETE #E5484D) */
.method-badge { font-family: var(--font-mono); font-weight: 700; letter-spacing: .02em; padding: 2px 7px; border-radius: 5px; font-size: 11px; }

.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ========================================================================== */
/*  7. FORM CONTROLS                                                           */
/* ========================================================================== */
.input, .field-input {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-2);
  font-size: 14px; outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; padding: 8px 10px; resize: vertical; }
.input:focus, .field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(62,99,221,.12); background: var(--surface); }
.input.mono { font-family: var(--font-mono); font-size: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }

/* segmented control */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button { height: 30px; padding: 0 12px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* search field */
.search {
  display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--text-3);
}
.search input { border: none; background: none; outline: none; width: 100%; font-size: 14px; color: var(--text); }
.kbd { font-family: var(--font-mono); font-size: 11px; background: var(--surface); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; color: var(--text-3); }

/* ========================================================================== */
/*  8. TABLE                                                                   */
/* ========================================================================== */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-4); padding: 13px 16px 11px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); font-size: 14px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .1s; cursor: pointer; }
.tbl tbody tr:hover { background: var(--bg-2); }

/* ========================================================================== */
/*  9. METRIC / STAT CARD                                                      */
/* ========================================================================== */
.metric { padding: 18px; }
.metric .m-top { display: flex; align-items: center; justify-content: space-between; }
.metric .m-label { font-size: 13px; color: var(--text-3); font-weight: 600; }
.metric .m-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; } /* set bg/color inline w/ a status tint */
.metric .m-val { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin-top: 12px; }
.metric .m-sub { font-size: 12.5px; color: var(--text-3); margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.trend-up { color: var(--ok); font-weight: 700; } .trend-down { color: var(--fail); font-weight: 700; }

/* progress bar */
.bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 6px; background: var(--grad); }

/* mini sparkbars */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.spark > i { flex: 1; border-radius: 2px 2px 0 0; min-height: 2px; background: var(--surface-2); }

/* ========================================================================== */
/*  10. APP SHELL — sidebar rail + topbar                                      */
/* ========================================================================== */
.app { display: grid; grid-template-columns: var(--rail-w) 1fr; height: 100vh; }

.rail { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; gap: 4px; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; flex: none; background: var(--grad); display: grid; place-items: center; box-shadow: 0 4px 14px -3px rgba(62,99,221,.5); }
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.03em; }
.brand-sub { font-size: 10.5px; color: var(--text-3); letter-spacing: .08em; text-transform: uppercase; font-weight: 600; margin-top: -2px; }

.nav-group-label { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-4); padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text-2); font-size: 14px; font-weight: 500; width: 100%; text-align: left; transition: background .12s, color .12s; position: relative; white-space: nowrap; }
.nav-item > span { flex: 1; min-width: 0; }
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--grad-soft); color: var(--accent); font-weight: 600; }
.nav-item.active svg { opacity: 1; }
.nav-item.active::before { content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%); width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--grad); }
.nav-badge { margin-left: auto; flex: none; font-family: var(--font-mono); font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--text-3); padding: 1px 7px; border-radius: var(--r-pill); }
.nav-item.active .nav-badge { background: rgba(62,99,221,.14); color: var(--accent); }

.avatar { border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; color: #fff; font-family: var(--font-display); } /* set width/height/background inline */

.topbar { height: 62px; flex: none; border-bottom: 1px solid var(--line); background: rgba(251,251,253,.85); backdrop-filter: blur(10px); display: flex; align-items: center; gap: 16px; padding: 0 26px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-3); }
.crumbs .cur { color: var(--text); font-weight: 600; }

.main { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; }
.page { padding: 24px 28px 48px; max-width: none; margin: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h1 { white-space: nowrap; }
.page-head p { margin-top: 6px; font-size: 15px; max-width: 560px; }

/* layout helpers */
.kbar { display: flex; gap: 8px; align-items: center; }
.grid { display: grid; gap: 16px; }
.metric-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1180px) { .metric-grid { grid-template-columns: repeat(2, 1fr); } }
.two-col { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

/* ========================================================================== */
/*  11. CODE BLOCK (dark)                                                      */
/* ========================================================================== */
.code-block { background: #0E0E18; color: #C8CBE0; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.75; padding: 18px 20px; border-radius: var(--r-md); overflow: auto; }
.code-block .c-key { color: #A9BEFF; }   /* keys */
.code-block .c-ok  { color: #6DD7B8; }   /* values / pass */
.code-block .c-dim { color: #686C88; }   /* comments */
.code-block .c-err { color: #F0888C; }   /* errors */

/* ========================================================================== */
/*  12. ENTRANCE ANIMATION (transform-only — safe for print/reduced-motion)    */
/* ========================================================================== */
.fade-in { animation: fadeIn .4s cubic-bezier(.2,.7,.2,1) both; }
@keyframes fadeIn { from { transform: translateY(9px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } }

/* ========================================================================== */
/*  13. MARKETING / LANDING COMPONENTS                                         */
/*  (Use these on marketing pages; the app uses sections 4–11.)                */
/* ========================================================================== */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

/* sticky translucent nav */
.m-nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.m-nav-inner { display: flex; align-items: center; gap: 28px; height: 70px; }
.m-nav-links { display: flex; align-items: center; gap: 26px; }
.m-nav-links a { font-size: 15px; font-weight: 500; color: var(--text-2); white-space: nowrap; transition: color .12s; }
.m-nav-links a:hover { color: var(--text); }
/* icon button + dark-mode toggle (sun in dark → switch to light; moon in light → switch to dark) */
.btn.icon { padding: 0; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; }
.theme-toggle .i-sun { display: none; }
.theme-toggle .i-moon { display: inline; }
html[data-theme="dark"] .theme-toggle .i-sun { display: inline; }
html[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.m-nav-burger { display: none !important; }   /* beat .btn.icon at desktop */
.m-nav-links .m-only { display: none; }
/* Mobile: hide the inline links, reveal them (plus Log in) from the hamburger. */
@media (max-width: 860px) {
  .m-nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column;
                 align-items: flex-start; gap: 16px; background: var(--surface); border-bottom: 1px solid var(--line);
                 padding: 18px 22px; box-shadow: var(--shadow-md); z-index: 60; }
  .m-nav-links.open { display: flex; }
  .m-nav-links .m-only { display: block; }
  .m-nav-desktop { display: none !important; }
  .m-nav-burger { display: inline-flex !important; }
}

/* hero */
.m-hero { position: relative; padding: 88px 0 70px; overflow: hidden; }
.m-hero::before { content: ''; position: absolute; top: -180px; left: 50%; transform: translateX(-50%); width: 1100px; height: 620px; background: radial-gradient(ellipse at center, rgba(138,92,245,.16), rgba(62,99,221,.10) 40%, transparent 68%); z-index: -1; }
.m-hero h1 { font-size: clamp(42px, 6vw, 76px); font-weight: 700; letter-spacing: -0.04em; line-height: 0.98; max-width: 920px; }
.m-hero .sub { font-size: clamp(18px, 2.1vw, 21px); color: var(--text-2); max-width: 620px; margin-top: 24px; line-height: 1.5; }
.hero-badge { display: inline-flex; align-items: center; gap: 9px; height: 34px; padding: 0 14px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--text-2); box-shadow: var(--shadow-sm); }
.hero-badge .pip { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }

/* section scaffolding */
.section { padding: 96px 0; }
.section-head { max-width: 680px; margin-bottom: 54px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(32px, 4vw, 48px); font-weight: 700; letter-spacing: -0.035em; margin-top: 14px; }
.section-head p { font-size: 19px; color: var(--text-2); margin-top: 18px; line-height: 1.5; }

/* split feature row */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split.flip .split-media { order: -1; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 36px; } .split.flip .split-media { order: 0; } }
.split h3 { font-size: 30px; letter-spacing: -0.03em; margin: 16px 0; }
.feat-list { margin-top: 26px; display: flex; flex-direction: column; gap: 16px; }
.feat-item { display: flex; gap: 13px; align-items: flex-start; }
.feat-item span { color: var(--text-2); }
.feat-check { width: 24px; height: 24px; border-radius: 7px; background: var(--grad-soft); color: var(--accent); display: grid; place-items: center; flex: none; margin-top: 1px; }
.feat-check svg { width: 14px; height: 14px; }

/* feature grid card */
.fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .fgrid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .fgrid { grid-template-columns: 1fr; } }
.fcard { padding: 26px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); transition: box-shadow .16s, transform .16s; }
.fcard:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.fcard .fi { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 18px; } /* set a status tint bg/color inline */
.fcard h4 { font-size: 18.5px; margin-bottom: 9px; }
.fcard p { font-size: 15px; color: var(--text-2); }

/* dark stats band */
.stats-band { background: var(--text); color: #fff; border-radius: 22px; padding: 52px; display: grid; grid-template-columns: repeat(4,1fr); gap: 30px; position: relative; overflow: hidden; }
.stats-band::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 85% 10%, rgba(138,92,245,.35), transparent 50%), radial-gradient(circle at 10% 90%, rgba(15,184,166,.22), transparent 45%); }
.stat { position: relative; }
.stat .v { font-family: var(--font-display); font-weight: 700; font-size: 46px; letter-spacing: -0.03em; background: linear-gradient(120deg,#fff,#C7D0FF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .l { font-size: 15px; color: #A8ACC4; margin-top: 6px; }
@media (max-width: 820px) { .stats-band { grid-template-columns: 1fr 1fr; gap: 28px; padding: 36px; } }

/* comparison table */
.cmp { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.cmp table { width: 100%; border-collapse: collapse; }
.cmp th, .cmp td { padding: 16px 20px; text-align: left; font-size: 15px; border-bottom: 1px solid var(--line); }
.cmp thead th { background: var(--bg); font-family: var(--font-display); font-weight: 600; }
.cmp thead th.us { background: var(--grad-soft); color: var(--accent); }
.cmp td.col-us { background: rgba(62,99,221,.04); }
.cmp .yes { color: var(--ok); font-weight: 700; } .cmp .no { color: #C4C8D6; } .cmp .partial { color: var(--warn); font-weight: 600; }
.cmp tbody tr:last-child td { border-bottom: none; }

/* pricing tiers */
.tiers { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; align-items: stretch; }
@media (max-width: 900px) { .tiers { grid-template-columns: 1fr; max-width: 440px; margin: 0 auto; } }
.tier { padding: 32px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; }
.tier.featured { position: relative; box-shadow: var(--shadow-lg); background: linear-gradient(var(--surface),var(--surface)) padding-box, var(--grad) border-box; border: 2px solid transparent; }
.tier .badge { position: absolute; top: -13px; left: 32px; height: 26px; padding: 0 13px; border-radius: var(--r-pill); background: var(--grad); color: #fff; font-size: 12.5px; font-weight: 700; display: grid; place-items: center; }
.tier .price { font-family: var(--font-display); font-weight: 700; font-size: 46px; letter-spacing: -0.03em; margin: 16px 0 4px; white-space: nowrap; }
.tier .price span { font-size: 16px; color: var(--text-3); font-weight: 500; }
.tier ul { list-style: none; margin: 22px 0; display: flex; flex-direction: column; gap: 12px; }
.tier li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--text-2); }
.tier li svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 2px; }
.tier .btn { margin-top: auto; width: 100%; }

/* dark CTA band */
.cta-band { text-align: center; padding: 84px 40px; border-radius: 24px; background: var(--text); color: #fff; position: relative; overflow: hidden; }
.cta-band::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 0%, rgba(138,92,245,.4), transparent 55%); }
.cta-band > * { position: relative; }
.cta-band h2 { color: #fff; font-size: clamp(32px, 4.5vw, 52px); letter-spacing: -0.035em; }
.cta-band p { color: #B6BAD0; font-size: 19px; margin: 18px auto 32px; max-width: 540px; }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 60px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
.footer-col h5 { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 16px; }
.footer-col a { display: block; font-size: 15px; color: var(--text-2); margin-bottom: 11px; transition: color .12s; }
.footer-col a:hover { color: var(--text); }

/* reveal-on-scroll (pair with an IntersectionObserver that adds .in) */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }


/* ---- responsive additions ---- */
@media (max-width: 1020px) {
  .tiers { grid-template-columns: repeat(2, 1fr) !important; }
  .fgrid { grid-template-columns: repeat(2, 1fr) !important; }
  .metric-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .two-col { grid-template-columns: 1fr !important; }
  .split { grid-template-columns: 1fr !important; }
}
@media (max-width: 640px) {
  .tiers, .fgrid { grid-template-columns: 1fr !important; }
  .m-nav-inner { height: 60px; gap: 14px; }
  .section { padding: 44px 0 !important; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 26px !important; }
  .cta-band { padding: 52px 22px !important; }
  .page { padding: 18px 14px !important; }
  .page-head { flex-direction: column !important; align-items: flex-start !important; gap: 12px !important; }
  .metric-grid { grid-template-columns: 1fr 1fr !important; }
  .tbl { display: block; overflow-x: auto; }
  .kbar { flex-wrap: wrap; }
  .m-hero { padding: 48px 0 20px !important; }
}


/* ========================================================================== */
/*  MOBILE APP-SHELL DRAWER — CA / Admin / Customer portals                    */
/* ========================================================================== */
.rail-toggle { display: none; }
.rail-backdrop { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr !important; }
  .main { grid-column: 1 / -1 !important; }
  .rail {
    position: fixed; top: 0; left: 0; bottom: 0; width: 270px; max-width: 82vw;
    z-index: 130; transform: translateX(-100%);
    transition: transform .24s cubic-bezier(.2,.7,.2,1);
    box-shadow: 0 24px 60px -12px rgba(10,12,24,.5);
  }
  .app.rail-open .rail { transform: none; }
  .rail-backdrop { position: fixed; inset: 0; z-index: 120; background: rgba(12,14,26,.46); }
  .app.rail-open .rail-backdrop { display: block; }
  .rail-toggle {
    display: grid; place-items: center; width: 38px; height: 38px; flex: none;
    border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
    color: var(--text-2); cursor: pointer;
  }
  .rail-toggle:hover { color: var(--text); border-color: var(--line-2); }
  .topbar { padding: 0 12px !important; gap: 10px !important; }
  .topbar .search { width: 168px !important; }
  .crumbs { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .page { padding: 18px 14px 40px !important; }
}
@media (max-width: 560px) {
  .topbar .search { display: none !important; }
  .tb-hide-xs { display: none !important; }
  .crumbs { font-size: 12.5px; }
}

/* ========================================================================== */
/*  DARK MODE — html[data-theme="dark"] flips the token layer                  */
/* ========================================================================== */
html[data-theme="dark"] {
  color-scheme: dark;
  --text:   #F1F2F8;
  --text-2: #C2C5D6;
  --text-3: #8F93A8;
  --text-4: #63677E;
  --bg:        #12141D;
  --bg-2:      #171A26;
  --surface:   #1C2030;
  --surface-2: #262B3F;
  --line:      #2E3349;
  --line-2:    #272C3F;
  --accent: #6D89F2;
  --grad-soft: linear-gradient(105deg, rgba(62,99,221,.22), rgba(138,92,245,.22) 58%, rgba(15,184,166,.22));
  --ok:   #34C088;  --ok-bg:   rgba(24,163,104,.16);
  --fail: #F2555A;  --fail-bg: rgba(229,72,77,.16);
  --warn: #F0A32E;  --warn-bg: rgba(224,147,10,.15);
  --run:  #7B96F0;  --run-bg:  rgba(62,99,221,.2);
  --idle: #7C8199;  --idle-bg: rgba(148,153,173,.14);
  --shadow-sm:  0 1px 2px rgba(0,0,0,.3), 0 1px 3px rgba(0,0,0,.35);
  --shadow-md:  0 4px 16px rgba(0,0,0,.35), 0 1px 4px rgba(0,0,0,.3);
  --shadow-lg:  0 18px 50px -12px rgba(0,0,0,.6), 0 6px 18px rgba(0,0,0,.35);
  --shadow-pop: 0 12px 40px -8px rgba(0,0,0,.55);
}
html[data-theme="dark"] .topbar { background: rgba(18,20,29,.85); }
html[data-theme="dark"] .m-nav { background: rgba(18,20,29,.84); }
html[data-theme="dark"] .cta-band,
html[data-theme="dark"] .stats-band { background: #1C2030; }
html[data-theme="dark"] .btn.primary { background: #3E63DD; }
html[data-theme="dark"] .btn.primary:hover { background: #4a6ee6; }
html[data-theme="dark"] .cmp table thead th.us,
html[data-theme="dark"] .cmp .col-us { background: rgba(62,99,221,.12); }
html[data-theme="dark"] img { filter: brightness(.92); }
/* Gradient hero text was the light blue→teal ramp on a dark bg → unreadable. Use a bright ramp. */
html[data-theme="dark"] .grad-text {
  background: linear-gradient(120deg, #8AA0FF, #B39DFF 52%, #3EE0C8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
