/* Zema Marketplace — responsive, vibrant UI (no external fonts/CDN) */
:root {
  --primary: #002569;
  --primary-container: #103a8f;
  --secondary: #006c48;
  --secondary-fixed: #7ffabf;
  --secondary-container: #7ffabf;
  --background: #fcf9f8;
  --surface: #fcf9f8;
  --surface-low: #f6f3f2;
  --surface-high: #ebe7e7;
  --on-surface: #1c1b1b;
  --on-variant: #444652;
  --outline: #747683;
  --error: #ba1a1a;
  --white: #fff;
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --shadow: 0 8px 32px rgba(0, 37, 105, 0.12);
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.06);
  --glow: 0 0 60px rgba(127, 250, 191, 0.35);
  --font: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 64px;
  --bottom-nav-h: 72px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--background);
  color: var(--on-surface);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

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

a {
  color: var(--primary-container);
  text-decoration-thickness: 2px;
}

a:hover {
  color: var(--secondary);
}

/* Mesh / gradient page backdrop */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(16, 58, 143, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(0, 108, 72, 0.12), transparent),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(127, 250, 191, 0.15), transparent),
    var(--background);
  pointer-events: none;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 28px);
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(252, 249, 248, 0.88);
  border-bottom: 1px solid rgba(0, 37, 105, 0.08);
  min-height: var(--header-h);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--primary);
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 10px;
}

.brand-text {
  font-weight: 900;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-desktop a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--on-variant);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.nav-desktop a:hover,
.nav-desktop a[aria-current="page"] {
  background: linear-gradient(135deg, rgba(0, 37, 105, 0.1), rgba(0, 108, 72, 0.08));
  color: var(--primary);
  transform: translateY(-1px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  color: var(--white);
  box-shadow: 0 8px 24px rgba(0, 37, 105, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: var(--glow), 0 8px 28px rgba(0, 37, 105, 0.4);
}

.btn-mint {
  background: var(--secondary-container);
  color: #002113;
  box-shadow: var(--shadow-soft);
}

.btn-mint:hover {
  filter: brightness(1.05);
  box-shadow: var(--glow);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.6);
  color: var(--primary);
  border: 1px solid rgba(0, 37, 105, 0.2);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 37, 105, 0.15);
  background: var(--white);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.site-header.nav-open .menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header.nav-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.site-header.nav-open .menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-mobile {
  display: none;
  width: 100%;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0 20px;
  border-top: 1px solid rgba(0, 37, 105, 0.08);
}

.nav-mobile a {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  color: var(--on-surface);
  background: var(--surface-low);
}

.nav-mobile a:hover {
  background: linear-gradient(90deg, rgba(0, 37, 105, 0.08), rgba(0, 108, 72, 0.06));
}

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

  .menu-toggle {
    display: flex;
  }

  .site-header.nav-open .nav-mobile {
    display: flex;
  }
}

/* —— Hero marketing —— */
.hero-market {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin: clamp(20px, 4vw, 36px) 0;
  padding: clamp(28px, 6vw, 56px);
  background: linear-gradient(135deg, var(--primary) 0%, #001a4d 45%, var(--primary-container) 100%);
  color: var(--white);
  box-shadow: var(--shadow);
}

.hero-market::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' opacity='.25'%3E%3Cpath fill='none' stroke='%237FFABF' stroke-width='2' d='M0 160 L40 120 L80 140 L120 80 L160 100 L200 40 L240 70 L280 30 L320 90 L360 50 L400 60'/%3E%3C/svg%3E")
    no-repeat right bottom / min(55%, 420px);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 4vw, 40px);
  align-items: center;
  position: relative;
  z-index: 1;
}

@media (min-width: 880px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.eyebrow {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.9;
  margin-bottom: 10px;
}

.hero-market h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.hero-market .lead {
  margin: 0 0 24px;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  opacity: 0.92;
  max-width: 36ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-chart-card {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 20px;
  backdrop-filter: blur(8px);
}

.hero-chart-card svg {
  width: 100%;
  height: auto;
  max-height: 180px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(127, 250, 191, 0.2);
  color: var(--secondary-fixed);
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 12px;
}

/* —— Sections —— */
.section {
  padding: clamp(32px, 5vw, 56px) 0;
}

.section-title {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.section-sub {
  margin: 0 0 24px;
  color: var(--on-variant);
  font-size: 0.95rem;
  max-width: 60ch;
}

/* Bento / cards */
.card-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .card-grid.stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card-priority {
  border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 28px);
  background: linear-gradient(145deg, var(--primary), var(--primary-container));
  color: var(--white);
  box-shadow: 0 16px 40px rgba(0, 37, 105, 0.35);
  position: relative;
  overflow: hidden;
}

.card-priority::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 100%;
  background: radial-gradient(circle, rgba(127, 250, 191, 0.25), transparent 70%);
  pointer-events: none;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge-light {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
}

.stat-card {
  background: var(--surface-low);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid rgba(0, 37, 105, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
}

.stat-card .value {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 4px 0 0;
}

/* Archive grid */
.archive-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .archive-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .archive-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.archive-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 22px;
  border: 1px solid rgba(0, 37, 105, 0.08);
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.archive-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow);
  border-color: rgba(0, 108, 72, 0.35);
}

.archive-card.featured {
  background: linear-gradient(160deg, var(--white) 0%, rgba(127, 250, 191, 0.12) 100%);
  border-color: rgba(0, 108, 72, 0.25);
}

.archive-card .meta {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--outline);
}

.icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: rgba(0, 37, 105, 0.08);
  margin-bottom: 14px;
}

/* List rows */
.row-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface-low);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  margin-bottom: 12px;
  border: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.row-card:hover {
  border-color: rgba(0, 37, 105, 0.15);
  box-shadow: var(--shadow-soft);
}

.row-card .chev {
  margin-left: auto;
  color: var(--outline);
  font-size: 1.25rem;
}

/* News */
.news-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.news-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.news-thumb {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary-container), var(--secondary));
  flex-shrink: 0;
}

.cat {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--secondary);
  text-transform: uppercase;
}

/* Search page */
.search-hero {
  padding: clamp(28px, 5vw, 48px) clamp(16px, 4vw, 24px);
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  color: var(--white);
  margin: 0 calc(-1 * clamp(16px, 4vw, 28px));
  width: calc(100% + 2 * clamp(16px, 4vw, 28px));
  max-width: none;
}

.search-box-wrap {
  max-width: 720px;
  margin-top: 20px;
}

.search-field {
  display: flex;
  align-items: stretch;
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.search-field input {
  flex: 1;
  border: none;
  padding: 16px 20px;
  font-size: 1rem;
  font-family: inherit;
  min-width: 0;
}

.search-field input:focus {
  outline: 2px solid var(--secondary);
  outline-offset: -2px;
}

.search-field button {
  border: none;
  background: var(--primary);
  color: var(--white);
  padding: 0 18px;
  cursor: pointer;
  font-size: 1.25rem;
}

.filters-panel {
  margin-top: -24px;
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-soft);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.chip {
  padding: 10px 16px;
  border-radius: 999px;
  border: 2px solid rgba(0, 37, 105, 0.12);
  background: var(--white);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover,
.chip[aria-pressed="true"] {
  border-color: var(--secondary);
  background: rgba(127, 250, 191, 0.25);
  color: var(--secondary);
}

/* Contact form */
.form-grid {
  display: grid;
  gap: 20px;
  max-width: 560px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
  font-size: 0.85rem;
}

.form-grid input,
.form-grid textarea {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 37, 105, 0.15);
  font-family: inherit;
  font-size: 1rem;
  background: var(--white);
}

.form-grid input:focus,
.form-grid textarea:focus {
  outline: 2px solid var(--primary-container);
  border-color: transparent;
}

.form-grid textarea {
  min-height: 140px;
  resize: vertical;
}

/* Footer */
.site-footer {
  margin-top: 48px;
  padding: 40px 0 100px;
  border-top: 1px solid rgba(0, 37, 105, 0.08);
  color: var(--on-variant);
  font-size: 0.875rem;
}

.footer-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* Mobile bottom nav (app-like) */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  background: rgba(252, 249, 248, 0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0, 37, 105, 0.08);
  box-shadow: 0 -8px 32px rgba(0, 37, 105, 0.06);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--outline);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 12px;
  min-width: 64px;
  transition: color 0.2s, background 0.2s;
}

.bottom-nav a span.icon {
  font-size: 1.25rem;
  line-height: 1;
}

.bottom-nav a[aria-current="page"] {
  color: var(--primary);
  background: rgba(0, 37, 105, 0.08);
}

@media (min-width: 901px) {
  .bottom-nav {
    display: none;
  }

  body {
    padding-bottom: 0;
  }
}

@media (max-width: 900px) {
  .site-footer {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }
}

/* Utilities */
.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mt-0 {
  margin-top: 0;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
