/* ===========================================================
   Rival — Payments Aggregator
   Institutional / banking-grade. Calm, type-led. Dark canvas.
   =========================================================== */

@import url("https://fonts.bunny.net/css?family=dm-sans:400,500,600,700|jetbrains-mono:400,500,700&display=swap");
@import url("https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700,900&display=swap");

:root {
  /* Rival ink palette — sits one notch warmer + softer than pure black */
  --ink-900: #07090F;     /* canvas */
  --ink-800: #0C0F18;     /* surface */
  --ink-700: #131826;     /* elevated */
  --ink-600: #1B2233;     /* hover */
  --ink-500: #232C42;     /* border-strong */

  --line:   #1A2030;      /* hairline */
  --line-2: #252C42;      /* slightly stronger */

  --text:   #FFFFFF;
  --text-2: #B0B6C8;      /* secondary */
  --text-3: #6B7188;      /* tertiary */
  --text-4: #3E445A;      /* placeholder / dim */

  /* Accent — electric, premium */
  --accent: #3B6BFF;
  --accent-2: #6B91FF;
  --accent-glow: rgba(59, 107, 255, 0.18);
  --accent-soft: rgba(59, 107, 255, 0.08);

  --success: #34D399;
  --warn:    #F5B544;
  --error:   #FF5A6E;

  /* Radii — softer than Sooq, more institutional */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-full: 9999px;

  /* Spacing */
  --s-2xs: 2px;
  --s-xs:  4px;
  --s-sm:  8px;
  --s-md:  16px;
  --s-lg:  24px;
  --s-xl:  40px;
  --s-2xl: 64px;
  --s-3xl: 96px;
  --s-4xl: 128px;

  /* Type stacks */
  --font-display: "Satoshi", ui-sans-serif, system-ui, sans-serif;
  --font-body: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --container: 1240px;
}

/* Light surface section (optional flip) */
.section-light {
  --bg-local: #F4F4F0;
  --text-local: #07090F;
  --text-2-local: #4B5163;
  --line-local: #E2E2DC;
  background: var(--bg-local);
  color: var(--text-local);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink-900);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

img, svg { display: block; max-width: 100%; }

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  padding: 0;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: white; }

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

/* ============ Layout ============ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 720px) {
  .container { padding: 0 20px; }
}

/* ============ Typography ============ */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 1;
  letter-spacing: -0.035em;
  margin: 0;
}
.display .accent { color: var(--accent); }
.display em {
  font-style: italic;
  font-weight: 500;
  font-family: "Times New Roman", "Georgia", serif;
  letter-spacing: -0.02em;
  color: var(--text-2);
}

.h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 4.5vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
}
.h1 em {
  font-style: italic;
  font-weight: 500;
  font-family: "Times New Roman", "Georgia", serif;
  letter-spacing: -0.015em;
  color: var(--text-2);
}

.h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}

.h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
}

.lead {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.5;
  color: var(--text-2);
  margin: 0;
  max-width: 56ch;
}

.body { font-size: 16px; line-height: 1.55; color: var(--text-2); margin: 0; }
.small { font-size: 13px; color: var(--text-3); }

.t-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.t-mono { font-family: var(--font-mono); font-size: 13px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.005em;
  line-height: 1;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary {
  background: var(--text);
  color: var(--ink-900);
}
.btn-primary:hover {
  background: var(--accent);
  color: white;
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-2);
}
.btn-ghost:hover {
  border-color: var(--text);
}
.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-accent:hover {
  background: var(--accent-2);
}
.btn-lg {
  padding: 16px 28px;
  font-size: 15px;
}

.btn .arrow {
  width: 14px;
  height: 14px;
  transition: transform 180ms ease;
}
.btn:hover .arrow {
  transform: translateX(3px);
}

/* ============ Nav ============ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 18px 0;
  transition: backdrop-filter 200ms ease, background 200ms ease, border-color 200ms ease;
}
.nav-scrolled {
  background: rgba(7, 9, 15, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-link {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-2);
  transition: color 160ms ease;
}
.nav-link:hover { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 8px; }

@media (max-width: 880px) {
  .nav-links { display: none; }
}

/* ============ Logo / wordmark ============ */
.wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.wordmark-mark {
  display: inline-block;
  width: 22px;
  height: 22px;
  position: relative;
}
.wordmark-mark::before,
.wordmark-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 2px;
}
.wordmark-mark::before {
  background: var(--accent);
  transform: skewX(-12deg) translateX(-4px);
  opacity: 0.5;
}
.wordmark-mark::after {
  background: var(--text);
  transform: skewX(-12deg) translateX(2px);
}

/* ============ Section spacing ============ */
section { padding: 120px 0; }
@media (max-width: 720px) { section { padding: 80px 0; } }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 720px;
  margin-bottom: 64px;
}

/* ============ Card ============ */
.card {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  transition: border-color 200ms ease, background 200ms ease;
}
.card:hover {
  border-color: var(--line-2);
}

/* ============ Grain ============ */
.grain {
  position: relative;
  isolation: isolate;
}
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 160px;
  z-index: -1;
}

/* Dot pattern */
.dots {
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: 168px 0 96px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 80px;
  align-items: center;
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
}
.hero-copy { display: flex; flex-direction: column; gap: 32px; }
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.hero-glow {
  position: absolute;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-glow), transparent 70%);
  filter: blur(40px);
  top: -200px;
  right: -200px;
  pointer-events: none;
  z-index: 0;
}

.hero > .container { position: relative; z-index: 1; }

/* ============ Stats strip ============ */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
@media (max-width: 880px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
}
.metric {
  padding: 32px 28px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.metric:last-child { border-right: none; }
@media (max-width: 880px) {
  .metric:nth-child(2n) { border-right: none; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
.metric-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.metric-label {
  font-size: 13px;
  color: var(--text-3);
}

/* ============ Logo wall ============ */
.logos {
  padding: 64px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.logos-title {
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 32px;
}
.logos-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 32px;
  align-items: center;
}
@media (max-width: 880px) {
  .logos-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}
.logo-cell {
  color: var(--text-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  filter: grayscale(1);
  opacity: 0.75;
  transition: opacity 200ms ease, color 200ms ease;
}
.logo-cell:hover { opacity: 1; color: var(--text); }

/* ============ Aggregator visual ============ */
.aggregator-visual {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 48px;
  position: relative;
  overflow: hidden;
}

/* ============ Method tiles ============ */
.methods-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
@media (max-width: 880px) {
  .methods-grid { grid-template-columns: repeat(2, 1fr); }
}
.method-tile {
  background: var(--ink-800);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 140px;
  transition: background 180ms ease;
  cursor: default;
}
.method-tile:hover { background: var(--ink-700); }
.method-name { font-size: 14px; font-weight: 500; color: var(--text); }
.method-type { font-size: 12px; color: var(--text-3); }
.method-logo {
  height: 24px;
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--text-2);
}

/* ============ Feature cards ============ */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 980px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .features { grid-template-columns: 1fr; } }
.feature {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 260px;
  transition: border-color 200ms ease, background 200ms ease;
}
.feature:hover { border-color: var(--line-2); background: var(--ink-700); }
.feature-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.feature-title { font-size: 18px; font-weight: 600; color: var(--text); margin: 0; }
.feature-body { font-size: 15px; color: var(--text-2); line-height: 1.5; margin: 0; }

/* ============ Developer block ============ */
.code-block {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
}
.code-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--ink-700);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-3);
}
.code-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-500); }
.code-body { padding: 24px; overflow-x: auto; }
.code-body .k { color: #C792EA; }
.code-body .s { color: #C3E88D; }
.code-body .n { color: #F78C6C; }
.code-body .c { color: var(--text-3); }
.code-body .p { color: var(--text-2); }
.code-body .fn { color: #82AAFF; }

/* ============ CTA section ============ */
.cta-section {
  position: relative;
  overflow: hidden;
}
.cta-card {
  background: linear-gradient(135deg, var(--ink-700) 0%, var(--ink-800) 100%);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2xl);
  padding: 80px 64px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}
.cta-card::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-glow), transparent 70%);
  filter: blur(40px);
  top: -200px;
  right: -200px;
  pointer-events: none;
}
@media (max-width: 880px) {
  .cta-card { grid-template-columns: 1fr; padding: 48px 32px; }
}

/* ============ Form ============ */
.form-row { display: flex; flex-direction: column; gap: 10px; }
.form-label { font-size: 13px; color: var(--text-2); }
.form-input,
.form-select,
.form-textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  width: 100%;
  transition: border-color 160ms ease, background 160ms ease;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(59, 107, 255, 0.06);
}
.form-input::placeholder { color: var(--text-4); }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid > .full { grid-column: 1 / -1; }

/* ============ Footer ============ */
.footer {
  border-top: 1px solid var(--line);
  padding: 64px 0 32px;
  color: var(--text-3);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}
@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
.footer-col h4 {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 18px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.footer-col a { font-size: 14px; color: var(--text-2); transition: color 160ms ease; }
.footer-col a:hover { color: var(--text); }
.footer-bot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 32px;
  font-size: 13px;
  color: var(--text-3);
  flex-wrap: wrap;
  gap: 16px;
}

/* ============ Animations ============ */
@keyframes pulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes drawLine {
  from { stroke-dashoffset: 1000; }
  to { stroke-dashoffset: 0; }
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.fade-in-up {
  animation: slideUp 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ============ Marquee ============ */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee {
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.marquee-track {
  display: flex;
  gap: 48px;
  animation: marquee 40s linear infinite;
  width: max-content;
}

/* ============ Pill / tag ============ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.05);
  color: var(--text-2);
  border: 1px solid var(--line);
}
.pill-accent {
  background: var(--accent-soft);
  color: var(--accent-2);
  border-color: rgba(59, 107, 255, 0.25);
}

/* ============ Tweaks (style is on the panel itself) ============ */
.t-radio-rival {
  display: inline-flex;
  background: var(--ink-700);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  padding: 4px;
  gap: 2px;
}

/* Hide scrollbars for marquee */
.marquee-track::-webkit-scrollbar { display: none; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
