/* ============================================================
   BestCryptoReferrals — Design System
   Modern, professional, crypto-finance aesthetic.
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #0a0e17;
  --bg-elev: #111726;
  --bg-card: #151c2e;
  --bg-card-hover: #1a2237;
  --border: #1f2940;
  --border-strong: #2a3756;

  /* Text */
  --text: #e8ecf4;
  --text-muted: #9099b0;
  --text-dim: #6b7388;

  /* Accent — amber/gold for "value/savings" cues */
  --accent: #f5b81a;
  --accent-hover: #ffc94a;
  --accent-soft: rgba(245, 184, 26, 0.12);

  /* Secondary accent — emerald for "save / win" cues */
  --success: #10d39e;
  --success-soft: rgba(16, 211, 158, 0.12);

  --danger: #ff5577;
  --info: #4f8cff;

  /* Shadows / radii / motion */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --container: 1200px;
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;       /* clear 68px sticky header on anchor jumps */
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 1200px 600px at 50% -10%, rgba(245, 184, 26, 0.08), transparent 60%),
    radial-gradient(ellipse 800px 500px at 90% 10%, rgba(79, 140, 255, 0.06), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

h1, h2, h3, h4 {
  font-family: "Manrope", "Inter", sans-serif;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(1.875rem, 3.8vw, 2.875rem); font-weight: 800; }
h2 { font-size: clamp(1.625rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1em; color: var(--text-muted); }

/* ----- Layout helpers ----- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 64px 0; }
.section-tight { padding: 40px 0; }
.center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(10, 14, 23, 0.78);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #ff8a00);
  display: grid;
  place-items: center;
  color: #0a0e17;
  font-weight: 900;
  font-size: 14px;
  box-shadow: 0 0 0 1px rgba(245, 184, 26, 0.3), 0 6px 18px rgba(245, 184, 26, 0.25);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color .15s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  align-items: center; justify-content: center;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0;
  transition: transform .12s var(--ease), background .15s var(--ease), box-shadow .2s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff9d2a);
  color: #0a0e17;
  box-shadow: 0 6px 20px rgba(245, 184, 26, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(245, 184, 26, 0.4);
}
.btn-ghost {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-card-hover); border-color: var(--accent); }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: 32px 0 12px;
  text-align: center;
  position: relative;
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 12px;
  border: 1px solid rgba(245, 184, 26, 0.25);
}
.hero h1 {
  max-width: 880px;
  margin: 0 auto 10px;
}
.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent), #ff9d2a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  max-width: 680px;
  margin: 0 auto;
  font-size: 1.02rem;
  color: var(--text-muted);
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Trust strip / metrics */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.metric {
  background: var(--bg-elev);
  padding: 24px 16px;
  text-align: center;
}
.metric-value {
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
}
.metric-label {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================================================
   Comparison table
   ============================================================ */
.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 40px;
}
.section-head .eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 12px;
}

.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.table-controls {
  display: flex;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: center;
}
.table-controls .label {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.sort-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sort-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all .15s var(--ease);
}
.sort-btn:hover { color: var(--text); border-color: var(--accent); }
.sort-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.cmp-table {
  width: 100%;
  border-collapse: collapse;
}
.cmp-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-elev);
  text-align: left;
  padding: 14px 18px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.cmp-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s var(--ease);
}
.cmp-table tbody tr:hover { background: var(--bg-card-hover); }
.cmp-table tbody tr:last-child { border-bottom: none; }
.cmp-table td {
  padding: 18px;
  vertical-align: middle;
}

.exch-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}
.exch-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  flex-shrink: 0;
}
.exch-name {
  font-weight: 700;
  font-size: 1rem;
}
.exch-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.star { color: var(--accent); }

.fee-num {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.fee-zero { color: var(--success); }

.discount-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid rgba(16, 211, 158, 0.3);
  white-space: nowrap;
}

.cta-cell { text-align: right; }
.cta-cell .btn { padding: 10px 18px; }

/* ============================================================
   Card grid (featured exchanges / mobile)
   ============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform .15s var(--ease), border-color .15s var(--ease), box-shadow .2s var(--ease);
  position: relative;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.card-title { font-size: 1.125rem; margin: 0; }
.card-rating { font-size: 0.85rem; color: var(--text-dim); }
.card-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-grow: 1;
}
.card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin-bottom: 18px;
  padding: 14px;
  background: var(--bg-elev);
  border-radius: var(--radius-sm);
}
.card-stat-label { font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.card-stat-value { font-weight: 600; font-size: 0.92rem; margin-top: 2px; }
.card .btn { width: 100%; }
.card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: 1px solid rgba(245, 184, 26, 0.3);
}

/* ============================================================
   Feature / value strip
   ============================================================ */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.value-item {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}
.value-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 14px;
  font-size: 22px;
}
.value-item h3 { margin: 0 0 6px; font-size: 1.05rem; }
.value-item p { margin: 0; font-size: 0.92rem; }

/* ============================================================
   FAQ
   ============================================================ */
.faq-list {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s var(--ease);
}
.faq-item[open] { border-color: var(--border-strong); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-weight: 600;
  color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 300;
  transition: transform .2s var(--ease);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-body {
  padding: 0 22px 18px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ============================================================
   CTA banner
   ============================================================ */
.cta-banner {
  background: linear-gradient(135deg, rgba(245, 184, 26, 0.12), rgba(255, 138, 0, 0.06));
  border: 1px solid rgba(245, 184, 26, 0.25);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
}
.cta-banner h2 { margin-bottom: 12px; }
.cta-banner p { max-width: 540px; margin: 0 auto 24px; }

/* ============================================================
   Exchange detail page
   ============================================================ */
.detail-hero {
  padding: 80px 0 40px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 32px;
  align-items: start;
}
.detail-main h1 { margin-bottom: 12px; }
.detail-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.detail-meta strong { color: var(--text); font-weight: 600; }

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: 88px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.summary-row:last-of-type { border-bottom: none; }
.summary-row span:first-child { color: var(--text-muted); }
.summary-row span:last-child { font-weight: 600; }

.proscons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 32px 0;
}
.proscons ul { list-style: none; padding: 0; margin: 0; }
.proscons li {
  padding: 8px 0 8px 26px;
  position: relative;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.pros li::before {
  content: "✓";
  position: absolute; left: 0;
  color: var(--success);
  font-weight: 700;
}
.cons li::before {
  content: "−";
  position: absolute; left: 0;
  color: var(--danger);
  font-weight: 700;
}
.proscons h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feature-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 24px;
}
.feature-tag {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: 64px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}
.footer-grid h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 14px;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-links a:hover { color: var(--accent); }

.disclaimer {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.7;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
  }
  .nav-links.open li { padding: 12px 24px; }

  .hero { padding: 64px 0 40px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .proscons { grid-template-columns: 1fr; }
  .cta-banner { padding: 32px 22px; }

  /* Hide non-essential table columns on small screens; cards take over */
  .cmp-table thead th.hide-sm,
  .cmp-table tbody td.hide-sm { display: none; }
}

@media (max-width: 640px) {
  .hide-mobile { display: none; }
  .table-wrap { display: none; }
  .cards-grid-mobile { display: grid !important; }
  .section { padding: 48px 0; }
  h1 { font-size: 2rem; }
  .cta-banner { padding: 28px 18px; }
}

.cards-grid-mobile { display: none; }

/* ============================================================
   Utilities
   ============================================================ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}
.lead { font-size: 1.1rem; color: var(--text-muted); }
.kbd {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--accent);
}
