/* =========================================================================
   Volopay Developer Platform — Portal Design System
   Stone neutrals + Volopay indigo accent · Manrope · shared by all pages.
   Scope: homepage (custom) + Scalar reference (chrome only).
   ========================================================================= */

:root {
  /* Neutral scale */
  --stone-50:  #FAFAFA;
  --stone-100: #F3F4F6;
  --stone-150: #ECEEF1;
  --stone-200: #E5E6EA;
  --stone-300: #D6D8DE;
  --stone-400: #9AA1AC;
  --stone-500: #6B7280;
  --stone-600: #4B5561;
  --stone-700: #37414F;
  --stone-800: #1F2733;
  --stone-900: #101827;
  --stone-950: #0B0E16;

  /* Brand accent */
  --accent:        #4B4EFC;
  --accent-hover:  #1E22FB;

  /* Semantic */
  --bg:        var(--stone-50);
  --surface:   #ffffff;
  --ink:       var(--stone-900);
  --ink-soft:  var(--stone-600);
  --line:      var(--stone-200);
  --line-soft: var(--stone-150);

  --header-h: 60px;
  --maxw: 1080px;
  --radius: 12px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 2px rgba(11, 14, 22, 0.05);
  --shadow-md: 0 10px 28px -14px rgba(11, 14, 22, 0.22);

  --font: 'Manrope', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

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

.page { display: none; }
.page.active { display: block; }

/* ---------- Layout primitives ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section--tight { padding: 56px 0; }
.section--alt { background: var(--surface); border-block: 1px solid var(--line); }

.eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 14px;
}
.section-head { max-width: 640px; margin: 0 0 44px; }
.section-head h2 {
  font-size: clamp(26px, 3.4vw, 36px); font-weight: 800;
  letter-spacing: -0.025em; line-height: 1.12; margin: 0 0 12px;
}
.section-head p { font-size: 17px; color: var(--ink-soft); margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 14px/1 var(--font);
  text-decoration: none; cursor: pointer;
  padding: 12px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--stone-100); border-color: var(--stone-300); }
.btn .arr { transition: transform .15s; }
.btn:hover .arr { transform: translateX(3px); }

/* =========================================================================
   Header / Footer — rendered by <site-header> / <site-footer>
   ========================================================================= */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: rgba(250, 250, 250, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand .mark {
  width: 30px; height: 30px; border-radius: 7px; overflow: hidden;
  display: grid; place-items: center; flex: none;
}
.brand .mark img { width: 100%; height: 100%; object-fit: contain; }
.brand .name { font-weight: 700; font-size: 16px; letter-spacing: -0.2px; }
.brand .name span { font-weight: 500; color: var(--ink-soft); }

.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  text-decoration: none; color: var(--stone-700);
  font-size: 14px; font-weight: 500;
  padding: 8px 12px; border-radius: 7px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--stone-100); color: var(--ink); }
.nav a.active { color: var(--ink); font-weight: 600; }
.nav a.cta { background: var(--accent); color: #fff; font-weight: 600; margin-left: 6px; }
.nav a.cta:hover { background: var(--accent-hover); color: #fff; }

@media (max-width: 720px) {
  .nav a.hide-sm { display: none; }
  .brand .name span { display: none; }
}

.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 48px 0 40px; }
.site-footer .ft-grid { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; align-items: flex-start; }
.site-footer .ft-brand { max-width: 280px; }
.site-footer .ft-brand p { color: var(--ink-soft); font-size: 14px; margin: 12px 0 0; }
.site-footer .ft-col h4 {
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--stone-500); margin: 0 0 12px;
}
.site-footer .ft-col a { display: block; text-decoration: none; color: var(--stone-700); font-size: 14px; padding: 5px 0; }
.site-footer .ft-col a:hover { color: var(--accent); }
.site-footer .ft-base { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--stone-500); }

/* =========================================================================
   COMPONENT: Hero
   ========================================================================= */
.hero { padding: 96px 0 80px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 0%, transparent 75%);
  opacity: .7;
}
.hero .container { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--stone-600);
  background: var(--surface); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 22px; box-shadow: var(--shadow-sm);
}
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #16A34A; }
.hero h1 {
  font-size: clamp(36px, 6vw, 60px); font-weight: 800;
  letter-spacing: -0.035em; line-height: 1.04; margin: 0 0 20px; max-width: 18ch;
}
.hero p.lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--ink-soft); max-width: 56ch; margin: 0 0 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* =========================================================================
   COMPONENT: Feature Grid
   ========================================================================= */
.feature-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }

.feature-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.feature-card:hover { border-color: var(--stone-300); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-card .ic {
  width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center;
  margin-bottom: 16px; background: var(--accent); color: #fff;
}
.feature-card .ic svg { width: 19px; height: 19px; }
.feature-card h3 { font-size: 16px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.01em; }
.feature-card p { font-size: 14px; color: var(--ink-soft); margin: 0; }

/* =========================================================================
   COMPONENT: Integration Flow (process cards + connectors)
   ========================================================================= */
.flow-wrap { position: relative; }
.flow-rail { display: grid; grid-template-columns: repeat(4, 1fr); gap: 44px; }
.flow-step {
  position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 20px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.flow-step:hover { border-color: var(--stone-300); box-shadow: var(--shadow-md); }
.flow-step .num {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; background: var(--stone-100); color: var(--accent);
  border: 1px solid var(--line);
}
.flow-step h3 { font-size: 15px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.flow-step p { font-size: 13.5px; color: var(--ink-soft); margin: 0; flex: 1; }
.flow-step a.flow-link {
  font-size: 13px; font-weight: 600; text-decoration: none; color: var(--accent);
  display: inline-flex; align-items: center; gap: 5px;
}
.flow-step a.flow-link .arr { transition: transform .15s; }
.flow-step a.flow-link:hover .arr { transform: translateX(3px); }
.flow-rail .flow-step::after {
  content: "→"; position: absolute; right: -34px; top: 50%; transform: translateY(-50%);
  font-size: 20px; color: var(--stone-400);
}
.flow-rail .flow-step:last-child::after { display: none; }

@media (max-width: 900px) {
  .flow-rail { grid-template-columns: repeat(2, 1fr); gap: 40px 44px; }
  .flow-rail .flow-step:nth-child(2)::after { display: none; }
}
@media (max-width: 520px) {
  .flow-rail { grid-template-columns: 1fr; gap: 36px; }
  .flow-rail .flow-step::after { content: "↓"; right: 50%; top: auto; bottom: -30px; transform: translateX(50%); }
  .flow-rail .flow-step:nth-child(2)::after { display: block; }
}

/* =========================================================================
   COMPONENT: Support CTA
   ========================================================================= */
.support-cta {
  background: var(--stone-900); color: var(--stone-50);
  border-radius: 18px; padding: 48px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px; flex-wrap: wrap; position: relative; overflow: hidden;
}
.support-cta::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 120% at 100% 0%, rgba(75, 78, 252, 0.35), transparent 60%),
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 90% 120% at 100% 0%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 120% at 100% 0%, #000, transparent 75%);
}
.support-cta > * { position: relative; z-index: 1; }
.support-cta h2 { font-size: clamp(24px, 3vw, 30px); font-weight: 800; letter-spacing: -0.025em; margin: 0 0 8px; }
.support-cta p { color: var(--stone-300); font-size: 16px; margin: 0; max-width: 46ch; }
.support-cta .sc-meta { font-size: 13px; color: var(--stone-400); margin-top: 12px; }
.support-cta .btn--primary { background: #fff; color: var(--stone-900); }
.support-cta .btn--primary:hover { background: var(--stone-200); }

/* =========================================================================
   Scalar reference host (chrome shares the same header)
   ========================================================================= */
#scalar-app { height: calc(100vh - var(--header-h)); }
