/* Finature design system.
   Ramp: warm paper, tight grotesk display, lime action color, dot fields, live counters.
   Cloudflare: warm-dark sections, monospace labels, outline pill buttons, docs layout.
   Rule: structure comes from type, rhythm and hairlines. No card grids, no icon-per-item. */

:root {
  --paper: #f5f4f0;
  --paper-2: #ebeae5;
  --surface: #fbfaf8;
  --white: #ffffff;
  --line: #e0dfd9;
  --line-strong: #cdccc5;
  --ink: #0f1624;
  --ink-2: #3d4556;
  --muted: #5f6676;
  --faint: #868c9b;
  --dot: #cdccc5;

  --accent: #2456f5;
  --accent-hover: #1c47d6;
  --accent-ink: #ffffff;
  --accent-soft: #dfe7ff;
  --navy: #0b1220;
  --cobalt: #163a9e;
  --good: #2f6b2a;
  --warn: #9a5b00;
  --bad: #a3321f;

  --code-bg: #0b1220;
  --code-ink: #e6ebf5;
  --code-muted: #7f8aa3;
  --code-key: #7fa3ff;
  --code-str: #dfe8fb;
  --code-num: #f5c38c;
  --code-line: #1c2740;

  --font: 'Inter Tight', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --gutter: 24px;
  --max: 1280px;
  --nav-h: 64px;
  --ticker-h: 44px;

  --ease: cubic-bezier(.2, .7, .1, 1);
  --shadow-soft: 0 1px 0 rgba(20, 20, 19, .04), 0 12px 32px -12px rgba(20, 20, 19, .14);
  --shadow-lift: 0 1px 0 rgba(20, 20, 19, .05), 0 24px 60px -24px rgba(20, 20, 19, .28);
  color-scheme: light;
}

/* Warm dark, Cloudflare registrar style. Apply to a section or to <html>. */
.theme-dark,
:root[data-theme="dark"] {
  --paper: #0b1220;
  --paper-2: #121b2c;
  --surface: #101828;
  --white: #16203a;
  --line: #1f2a3f;
  --line-strong: #2e3b57;
  --ink: #eef2f8;
  --ink-2: #c3cbd9;
  --muted: #8d98ad;
  --faint: #76829a;
  --dot: #1d2840;
  --accent: #7fa3ff;
  --accent-hover: #9bb8ff;
  --accent-ink: #0b1220;
  --accent-soft: #1a2a52;
  --shadow-soft: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6);
  --shadow-lift: 0 1px 0 rgba(0, 0, 0, .3), 0 24px 60px -24px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
.theme-dark { background: var(--paper); color: var(--ink); }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.theme-dark :focus-visible { outline-color: var(--accent); }

.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;
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: 920px; }
.section { padding: 128px 0; position: relative; }
.section-tight { padding: 88px 0; }
.hairline { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Type ---------- */
.display {
  font-size: clamp(48px, 6.6vw, 96px);
  font-weight: 500;
  line-height: .96;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.h2 {
  font-size: clamp(36px, 4.6vw, 64px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.h3 {
  font-size: clamp(22px, 2.1vw, 28px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.lead {
  font-size: clamp(19px, 1.7vw, 23px);
  line-height: 1.4;
  color: var(--muted);
  letter-spacing: -0.012em;
}
.dim { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
/* Ramp's two-tone headline: strong phrase + muted continuation. */
.two-tone .muted { color: var(--faint); }
.label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.mono { font-family: var(--mono); font-feature-settings: "zero" 0; }
.num { font-variant-numeric: tabular-nums; }
code, kbd {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .08em .38em;
}

/* Small counter box, as in Ramp's "0.9219476%" chip. Functional, not decorative. */
.counter {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 13px; letter-spacing: .02em;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
  font-variant-numeric: tabular-nums;
  min-width: 3ch;
}
.theme-dark .counter { background: var(--paper-2); }

/* ---------- Dot field (Ramp) ---------- */
.dot-field {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(var(--dot) 1.1px, transparent 1.2px);
  background-size: 14px 14px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 0%, rgba(0,0,0,.55) 45%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 0%, rgba(0,0,0,.55) 45%, transparent 75%);
  opacity: .9;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border-radius: 8px; border: 1px solid transparent;
  font-size: 16px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap;
  transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #1d2740; }
.theme-dark .btn-dark { background: var(--ink); color: var(--paper); }
.btn-pill { border-radius: 999px; border-color: var(--line-strong); background: transparent; }
.btn-pill:hover { border-color: var(--ink); }
.btn-lg { height: 52px; padding: 0 22px; font-size: 17px; border-radius: 10px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 7px; }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500; border-bottom: 1px solid var(--line-strong); padding-bottom: 2px;
  transition: border-color .2s var(--ease);
}
.link-arrow:hover { border-color: var(--ink); }
.link-arrow svg { transition: transform .2s var(--ease); }
.link-arrow:hover svg { transform: translate(2px, -2px); }

/* ---------- Email capture (Ramp) ---------- */
.capture {
  display: flex; align-items: stretch; gap: 0;
  width: 100%; max-width: 560px;
  padding: 7px;
  background: linear-gradient(180deg, #ffffff 0%, #f8f7f4 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(20, 20, 19, .03);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.capture:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.capture input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  padding: 0 14px 0 26px; font-size: 18px; color: var(--ink);
}
.capture input::placeholder { color: var(--muted); }
.capture .btn { height: 56px; padding: 0 26px; font-size: 18px; border-radius: 9px; }
.capture-note { margin-top: 12px; font-size: 14px; color: var(--muted); min-height: 1.5em; }
.capture.is-done { border-color: var(--line-strong); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
          backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); }
/* backdrop-filter makes the nav the containing block for fixed children,
   which would collapse the mobile sheet. Drop it while the sheet is open. */
.nav.is-open { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--paper); border-bottom-color: var(--line); }
.nav-inner {
  height: 100%; max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 36px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 23px; font-weight: 600; letter-spacing: -0.045em; }
.brand-mark { width: 24px; height: 24px; }
.nav-links { display: flex; align-items: center; gap: 30px; font-size: 16px; }
.nav-links a { color: var(--ink); opacity: .86; transition: opacity .15s; position: relative; }
.nav-links a:hover, .nav-links a[aria-current="page"] { opacity: 1; }
.nav-links a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -21px; height: 2px; background: var(--ink);
}
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-right .btn { height: 40px; }
.nav-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: transparent; align-items: center; justify-content: center; }
.nav-sheet { display: none; }

@media (max-width: 900px) {
  .nav-links, .nav-right .hide-sm { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-sheet.is-open {
    display: flex; flex-direction: column; gap: 2px;
    position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0; z-index: 49;
    background: var(--paper); padding: 16px var(--gutter) 40px;
    border-top: 1px solid var(--line);
  }
  .nav-sheet a { font-size: 28px; font-weight: 500; letter-spacing: -0.03em; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-sheet .btn { margin-top: 20px; font-size: 18px; height: 52px; }
}

/* ---------- Code blocks ---------- */
.code {
  position: relative;
  background: var(--code-bg); color: var(--code-ink);
  border-radius: 12px;
  border: 1px solid var(--code-line);
  overflow: hidden;
}
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 40px; padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--code-line);
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--code-muted);
}
.code pre {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.65; tab-size: 2;
}
.code pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.code .k { color: var(--code-key); }
.code .s { color: var(--code-str); }
.code .n { color: var(--code-num); }
.code .c { color: var(--code-muted); }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 6px;
  border: 1px solid #2a3654; background: transparent; color: var(--code-ink);
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em;
  transition: border-color .15s, background-color .15s;
}
.copy-btn:hover { border-color: #44527a; background: #141d31; }
.copy-btn.is-copied { border-color: var(--code-key); color: var(--code-key); }

/* ---------- Spinner of four dots (Ramp's agent glyph) ---------- */
.dots4 { display: inline-grid; grid-template-columns: repeat(3, 3px); grid-template-rows: repeat(3, 3px); gap: 2px; width: 13px; height: 13px; }
.dots4 i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .25; animation: dots4 1.2s infinite steps(1); }
.dots4 i:nth-child(1) { grid-area: 1 / 2; animation-delay: 0s; }
.dots4 i:nth-child(2) { grid-area: 2 / 3; animation-delay: .3s; }
.dots4 i:nth-child(3) { grid-area: 3 / 2; animation-delay: .6s; }
.dots4 i:nth-child(4) { grid-area: 2 / 1; animation-delay: .9s; }
@keyframes dots4 { 0% { opacity: 1; } 25% { opacity: .25; } }

/* ---------- Bottom ticker (Ramp "AGENTS AT WORK TODAY") ---------- */
.ticker {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: var(--ticker-h);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex; align-items: center;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-2);
  transform: translateY(100%);
  transition: transform .5s var(--ease);
}
.ticker.is-on { transform: none; }
.ticker-lead {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 0 18px 0 var(--gutter); height: 100%;
  color: var(--ink); border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  position: relative; z-index: 2;
}
.ticker-track { flex: 1; overflow: hidden; height: 100%; position: relative;
  -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
          mask-image: linear-gradient(90deg, #000 85%, transparent); }
.ticker-items { display: flex; align-items: center; height: 100%; white-space: nowrap; }
.ticker-item { display: inline-flex; align-items: center; gap: 10px; padding: 0 22px; height: 100%; border-right: 1px solid var(--line); }
.ticker-item .counter { font-size: 12.5px; padding: 2px 7px; }
.ticker-close { flex: none; width: 44px; height: 100%; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.ticker-close:hover { color: var(--ink); }
body.has-ticker { padding-bottom: var(--ticker-h); }
@media (max-width: 720px) {
  .ticker-lead .ticker-lead-text { display: none; }
  .ticker-items.is-marquee { animation: marquee 38s linear infinite; }
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 56px 0 40px; font-size: 15px; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 48px 72px; align-items: flex-start; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--ink-2); }
.footer-col a:hover { color: var(--ink); }
.footer-brand { flex: 1 1 280px; display: flex; flex-direction: column; gap: 14px; }
.footer-fine { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; color: var(--muted); font-size: 13px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: .08s; }
.reveal-delay-2 { transition-delay: .16s; }
.reveal-delay-3 { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .section { padding: 88px 0; }
  .section-tight { padding: 64px 0; }
  .capture { padding: 5px; }
  .capture input { padding: 0 8px 0 14px; font-size: 16px; }
  .capture .btn { height: 48px; padding: 0 16px; font-size: 16px; }
}
.code-head-sub { border-top: 1px solid var(--code-line); }
/* Menu button turns into a close mark while the sheet is open. */
.nav-toggle { position: relative; color: var(--ink); }
.nav-toggle svg { transition: opacity .15s var(--ease); }
.nav-toggle[aria-expanded="true"] svg { opacity: 0; }
.nav-toggle::before, .nav-toggle::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 1.6px; margin: -.8px 0 0 -8px;
  background: currentColor; border-radius: 2px; opacity: 0; transition: opacity .15s var(--ease), transform .2s var(--ease);
}
.nav-toggle[aria-expanded="true"]::before { opacity: 1; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"]::after { opacity: 1; transform: rotate(-45deg); }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px; font-size: 15px;
  transition: top .2s var(--ease);
}
.skip:focus { top: 12px; }
/* Rolling digits in live counters */
.counter { overflow: hidden; }
.counter .d { display: inline-block; }
.counter .d.roll { animation: digit-roll .26s var(--ease); }
@keyframes digit-roll { from { transform: translateY(60%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Custom scrollbar, site-wide ----------
   A slim floating pill: neutral at rest, Finature blue on hover. Colors resolve
   on each scrolling element, so dark sections and the dark docs get light thumbs
   automatically. Chrome/Edge/Safari use the ::-webkit-scrollbar parts; Firefox
   gets the standard properties (Chrome 121+ would ignore the pseudo-elements if
   these were set everywhere, so they are scoped to browsers without them). */
::-webkit-scrollbar { width: 12px; height: 12px; background: transparent; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb {
  background-color: color-mix(in srgb, var(--ink) 22%, transparent);
  border: 3px solid transparent; background-clip: content-box;
  border-radius: 999px; min-height: 48px;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--accent); }
::-webkit-scrollbar-thumb:active { background-color: var(--accent-hover); }
html::-webkit-scrollbar-track { background: var(--paper); }
/* Code blocks are dark inside light pages. */
.code ::-webkit-scrollbar-thumb, .prompts ::-webkit-scrollbar-thumb { background-color: rgba(226, 234, 255, .2); }
.code ::-webkit-scrollbar-thumb:hover, .prompts ::-webkit-scrollbar-thumb:hover { background-color: var(--code-key); }
.code pre::-webkit-scrollbar { height: 10px; }

@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 25%, transparent) transparent; }
  .theme-dark, :root[data-theme="dark"] { scrollbar-color: color-mix(in srgb, var(--ink) 28%, transparent) transparent; }
  .code pre { scrollbar-color: rgba(226, 234, 255, .25) transparent; }
}

/* Real card art thumbnail (issuer artwork, transparent rounded corners). */
.card-thumb {
  display: inline-block; flex: none; width: 30px; aspect-ratio: 1.586; height: auto;
  object-fit: contain; border-radius: 3px; vertical-align: middle;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(15, 22, 36, .18), 0 0 0 1px rgba(15, 22, 36, .06);
}
