/* ============================================================
   BNPLmart — V1 Design System
   Restrained, data-first, editorial. No frameworks.
   ============================================================ */

:root {
  /* Palette — restrained, financial, editorial */
  --ink:        #0a0a0a;
  --ink-soft:   #374151;
  --muted:      #6b7280;
  --faint:      #9ca3af;
  --border:     #e5e7eb;
  --border-2:   #d1d5db;
  --surface:    #f9fafb;
  --surface-2:  #f3f4f6;
  --bg:         #ffffff;
  --accent:     #0f766e;      /* deep teal — trust + data */
  --accent-ink: #134e4a;
  --accent-bg:  #f0fdfa;
  --warn:       #b45309;
  --warn-bg:    #fffbeb;
  --danger:     #991b1b;

  /* Typography */
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  /* Layout */
  --max: 1120px;
  --radius: 4px;
}

* { box-sizing: border-box; }

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

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

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

a {
  color: var(--accent-ink);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: var(--s-8) 0;
  border-top: 1px solid var(--border);
}
.section:first-of-type { border-top: 0; }

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand span { color: var(--accent); }

.nav {
  display: flex;
  gap: var(--s-5);
  font-size: 14px;
}
.nav a {
  color: var(--ink-soft);
  font-weight: 500;
}
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink);
}

@media (max-width: 720px) {
  .nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: var(--s-3) 20px var(--s-4);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .nav a:last-child { border-bottom: 0; }
  .nav-toggle { display: inline-block; }
}

/* ---------- Hero ---------- */

.hero {
  padding: var(--s-9) 0 var(--s-7);
  border-bottom: 1px solid var(--border);
}
.hero .kicker {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: var(--s-4);
  font-weight: 500;
}
.hero h1 {
  font-size: clamp(30px, 4.5vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-4);
  font-weight: 600;
  max-width: 720px;
}
.hero p.lede {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--ink-soft);
  max-width: 620px;
  margin: 0 0 var(--s-6);
}
.cta-row {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  transition: background .15s ease;
}
.btn:hover { background: #000; text-decoration: none; }
.btn.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-2);
}
.btn.secondary:hover { background: var(--surface); }

/* ---------- Data strip ---------- */

.datastrip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.datastrip .cell {
  padding: var(--s-5);
  border-right: 1px solid var(--border);
}
.datastrip .cell:last-child { border-right: 0; }
.datastrip .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}
.datastrip .value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.datastrip .value.small { font-size: 16px; }

@media (max-width: 720px) {
  .datastrip { grid-template-columns: repeat(2, 1fr); }
  .datastrip .cell:nth-child(2) { border-right: 0; }
  .datastrip .cell:nth-child(1),
  .datastrip .cell:nth-child(2) { border-bottom: 1px solid var(--border); }
}

/* ---------- Section headings ---------- */

.section-head { margin-bottom: var(--s-5); }
.section-head h2 {
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  font-weight: 600;
}
.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 620px;
}

/* ---------- Provider table ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table.providers {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 720px;
}
table.providers thead th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 12px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.providers tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--ink-soft);
}
table.providers tbody tr:last-child td { border-bottom: 0; }
table.providers tbody tr:hover { background: var(--surface); }
table.providers td.name { font-weight: 500; color: var(--ink); }
table.providers td.name a { color: var(--ink); }

/* Evidence badges */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge.documented { background: var(--accent-bg); color: var(--accent-ink); }
.badge.partial    { background: var(--warn-bg);   color: var(--warn); }
.badge.not-est    { background: var(--surface-2); color: var(--muted); }
.badge.not-res    { background: var(--surface-2); color: var(--faint); }
.badge.historical { background: #f3f0ff;          color: #5b21b6; }

/* ---------- Cards ---------- */

.grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-5);
  background: var(--bg);
}
.card h3 {
  font-size: 16px;
  margin: 0 0 6px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.card .meta {
  margin-top: var(--s-4);
  font-size: 12px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Methodology / Prose ---------- */

.prose { max-width: 720px; }
.prose h2 {
  font-size: 20px;
  margin: var(--s-6) 0 var(--s-3);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.prose h3 {
  font-size: 16px;
  margin: var(--s-5) 0 var(--s-2);
  font-weight: 600;
}
.prose p { margin: 0 0 var(--s-4); color: var(--ink-soft); }
.prose ul { padding-left: 20px; color: var(--ink-soft); }
.prose li { margin-bottom: 6px; }
.prose code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--s-7) 0 var(--s-6);
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
}
.site-footer .cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--s-5);
  margin-bottom: var(--s-5);
}
.site-footer h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin: 0 0 var(--s-3);
  font-weight: 600;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }
.disclaimer {
  border-top: 1px solid var(--border);
  padding-top: var(--s-5);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 760px;
}

@media (max-width: 720px) {
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
}

/* ---------- Utility ---------- */

.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono  { font-family: var(--font-mono); }
.hidden { display: none !important; }

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
/* ---------- Compare filters ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
  flex: 1 1 140px;
}

.filter-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 500;
}

.filter select {
  padding: 8px 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.filter select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.filter-reset {
  padding: 8px 14px;
  border: 1px solid var(--border-2);
  background: #fff;
  color: var(--ink-soft);
  border-radius: var(--radius);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.filter-reset:hover {
  background: var(--surface-2);
}

@media (max-width: 640px) {
  .filters {
    flex-direction: column;
    align-items: stretch;
  }
  .filter {
    flex: 1 1 auto;
    min-width: 0;
  }
}