/* ═══════════════════════════════════════════════
   CSS VARIABLES
═══════════════════════════════════════════════ */

:root {
  /* Hero (dark) */
  --hero-bg: #0d2440;

  /* Nav */
  --nav-bg: #0d2440;
  --nav-border: rgba(255, 255, 255, 0.07);

  /* Body (light) */
  --body-bg: #ffffff;
  --section-alt: #f7f8fa;
  --section-border: #e8eaed;

  /* Cards */
  --card-bg: #ffffff;
  --card-border: #e2e5ea;
  --card-border-hover: #b8bfc9;

  /* Text */
  --text-primary: #0d1117;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;

  /* Accent */
  --accent: #1d4ed8;
  --accent-light: #2563eb;
  --accent-bg: #eff6ff;
  --accent-border: #bfdbfe;

  /* Divider */
  --divider: #f0f1f3;

  /* Font */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
}

/* ═══════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--body-bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

::selection {
  background: var(--accent-light);
  color: #fff;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ═══════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════ */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.anim-fade-up {
  opacity: 0;
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay, 0ms);
}

.anim-fade-in {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
  animation-delay: var(--delay, 0ms);
}

.anim-scale-in {
  opacity: 0;
  animation: scaleIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay, 0ms);
}

.anim-header {
  animation: slideDown 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ═══════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════ */

.header {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.header-logo-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.header-nav {
  display: none;
  align-items: center;
  gap: 32px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.55);
  font-size: 13.5px;
  font-weight: 450;
  text-decoration: none;
  transition: color 0.18s ease;
  letter-spacing: 0.01em;
}

.nav-link:hover {
  color: #ffffff;
}

.header-cta {
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #4a90e2 0%, #1d4ed8 100%);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15), 0 3px 10px rgba(29,78,216,0.3), inset 0 1px 0 rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 20px;
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.header-cta:hover {
  box-shadow: 0 1px 2px rgba(0,0,0,0.15), 0 6px 20px rgba(37,99,235,0.45), inset 0 1px 0 rgba(255,255,255,0.18);
  transform: translateY(-1px);
}

.header-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.header-menu-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.header-mobile-menu {
  display: flex;
  flex-direction: column;
  background: #0d2440;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.header-mobile-menu.open {
  max-height: 320px;
  padding: 16px 20px 24px;
}

.header-mobile-link {
  display: block;
  padding: 14px 12px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
}

.header-mobile-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.header-mobile-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  background: linear-gradient(180deg, #4a90e2 0%, #1d4ed8 100%);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15), 0 3px 10px rgba(29,78,216,0.3);
  border-radius: 10px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 20px;
  text-decoration: none;
}

@media (min-width: 768px) {
  .header-logo-img {
    width: 72px;
    height: 72px;
  }
  
  .header-nav {
    display: flex;
  }
  
  .header-cta {
    display: inline-flex;
  }
  
  .header-menu-btn {
    display: none;
  }
  
  .header-mobile-menu {
    display: none;
  }
}

@media (max-width: 767px) {
  .header-inner {
    padding: 0 16px;
    height: 64px;
  }
}

/* ═══════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════ */

.hero {
  background: var(--hero-bg);
  padding: 112px 24px 96px;
  overflow: hidden;
}

.hero-content {
  max-width: 660px;
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  color: #ffffff;
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.04;
  margin-bottom: 24px;
}

.hero-title-italic {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.05em;
  color: rgba(255, 255, 255, 0.9);
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.0625rem;
  line-height: 1.75;
  max-width: 460px;
  margin: 0 auto 48px;
}

.hero-search-wrap {
  position: relative;
  max-width: 540px;
  margin: 0 auto;
}

.hero-search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.hero-search {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 17px 20px 17px 50px;
  color: #ffffff;
  font-size: 15px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.hero-search::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.hero-search:focus {
  border-color: rgba(99, 153, 255, 0.65);
  background: rgba(255, 255, 255, 0.13);
}

/* ═══════════════════════════════════════════════
   CATEGORY SECTION
═══════════════════════════════════════════════ */

.category-section {
  border-bottom: 1px solid var(--section-border);
  padding: 44px 24px 40px;
  background: var(--body-bg);
}

.section-label {
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.category-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 26px 30px;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  text-decoration: none;
  display: block;
  text-align: left;
  width: 100%;
  font-family: var(--font-sans);
}

.category-card:hover {
  border-color: var(--card-border-hover);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}

.category-card.active {
  border-color: var(--accent-light);
  background: var(--accent-bg);
  box-shadow: 0 0 0 1px var(--accent-light);
}

.category-icon {
  color: var(--text-muted);
  margin-bottom: 14px;
  transition: color 0.2s ease;
}

.category-card.active .category-icon {
  color: var(--accent-light);
}

.category-label {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14.5px;
  margin-bottom: 4px;
}

.category-sub {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════
   EXCHANGES SECTION
═══════════════════════════════════════════════ */

.exchanges-section {
  padding: 52px 24px 88px;
  background: var(--body-bg);
}

.exchanges-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 12px;
  flex-wrap: wrap;
}

.exchanges-title {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.exchanges-count {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.filter-tabs {
  display: flex;
  background: var(--section-alt);
  border: 1px solid var(--section-border);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}

.filter-tab {
  padding: 6px 16px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  letter-spacing: 0.01em;
}

.filter-tab:hover {
  background: #edf0f4;
  color: var(--text-primary);
}

.filter-tab.active {
  background: var(--accent-light);
  color: #ffffff;
}

.exchanges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 18px;
}

.no-results {
  text-align: center;
  padding: 80px 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* ═══════════════════════════════════════════════
   EXCHANGE CARDS
═══════════════════════════════════════════════ */

.exchange-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  display: block;
  text-decoration: none;
  position: relative;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.exchange-card:hover {
  border-color: #d0d5de;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05), 0 12px 36px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

.card-header {
  padding: 22px 22px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.card-header-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 10% 50%, rgba(255,255,255,0.12) 0%, transparent 65%);
  pointer-events: none;
}

.card-header-content {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}

.card-logo-wrap {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.card-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.card-logo-fallback {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.01em;
}

.card-name {
  color: #ffffff;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin-bottom: 6px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.card-type-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-arrow {
  color: rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), color 0.22s ease;
}

.exchange-card:hover .card-arrow {
  transform: translateX(5px);
  color: rgba(255, 255, 255, 1);
}

.card-body {
  padding: 20px 24px 22px;
  border-top-width: 3px;
  border-top-style: solid;
  transition: background 0.25s ease;
}

.exchange-card:hover .card-body {
  background: color-mix(in srgb, var(--card-accent) 12%, #ffffff);
}

.card-tagline {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 20px;
}

.card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.card-chip {
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
}

.card-cta {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.22s ease;
}

.exchange-card:hover .card-cta {
  color: var(--accent-light);
}

.card-response {
  color: var(--text-muted);
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ═══════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════ */

.footer {
  background: #080808;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.footer .container {
  padding: 60px 28px 44px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 52px;
}

.footer-logo img {
  display: block;
  object-fit: contain;
}

.footer-desc {
  color: rgba(255, 255, 255, 0.3);
  font-size: 13.5px;
  line-height: 1.75;
  max-width: 250px;
  margin-top: 18px;
}

.footer-heading {
  color: rgba(255, 255, 255, 0.24);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.footer-link {
  color: rgba(255, 255, 255, 0.32);
  font-size: 13.5px;
  text-decoration: none;
  transition: color 0.18s ease;
}

.footer-link:hover {
  color: rgba(255, 255, 255, 0.75);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.2);
  font-size: 12px;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  
  .footer-brand {
    grid-column: span 2;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-brand {
    grid-column: span 1;
  }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */

@media (max-width: 760px) {
  .hero {
    padding: 88px 24px 64px;
  }
  
  .exchanges-grid {
    grid-template-columns: 1fr;
  }
  
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .category-grid {
    grid-template-columns: 1fr 1fr;
  }
}
