/* ========================================
   MarkitPlace Landing Page — Design System
   ======================================== */

/* --- CSS Variables --- */
:root, [data-theme="light"] {
  /* Colors - Earthy Light Mode */
  --bg-primary: #faf9f6;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f3f0e8;
  --bg-glass: rgba(250, 249, 246, 0.85);
  --border-glass: rgba(0, 0, 0, 0.08);

  --green-400: #48bb78;
  --green-500: #38a169;
  --green-600: #2f855a;
  --green-glow: rgba(72, 187, 120, 0.15);

  --warm-400: #ed8936;
  --warm-500: #dd6b20;

  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --text-muted: #718096;

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --container-max: 1140px;
  --section-padding: 100px 0;
  --card-radius: 16px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-med: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  /* Colors - Earthy Dark Mode */
  --bg-primary: #1a202c;
  --bg-secondary: #2d3748;
  --bg-card: #2d3748;
  --bg-card-hover: #4a5568;
  --bg-glass: rgba(26, 32, 44, 0.85);
  --border-glass: rgba(255, 255, 255, 0.1);

  --green-400: #68d391;
  --green-500: #48bb78;
  --green-600: #38a169;
  --green-glow: rgba(104, 211, 145, 0.15);

  --warm-400: #fbd38d;
  --warm-500: #f6ad55;

  --text-primary: #f7fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #a0aec0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    /* Colors - Earthy Dark Mode */
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-card: #2d3748;
    --bg-card-hover: #4a5568;
    --bg-glass: rgba(26, 32, 44, 0.85);
    --border-glass: rgba(255, 255, 255, 0.1);

    --green-400: #68d391;
    --green-500: #48bb78;
    --green-600: #38a169;
    --green-glow: rgba(104, 211, 145, 0.15);

    --warm-400: #fbd38d;
    --warm-500: #f6ad55;

    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #a0aec0;
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

/* --- Utilities --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Scroll-triggered animation base */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Navigation
   ======================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.nav.scrolled {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border-glass);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav__brand svg {
  width: 32px;
  height: 32px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav__link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--green-400);
  border-radius: 1px;
  transition: width var(--transition-fast);
}

.nav__link:hover {
  color: var(--text-primary);
}

.nav__link:hover::after {
  width: 100%;
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--green-500);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.nav__cta:hover {
  background: var(--green-400);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--green-glow);
}

.footer__theme-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.footer__theme-toggle {
  appearance: none;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 32px 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.footer__theme-toggle:hover, .footer__theme-toggle:focus {
  background: var(--bg-card-hover);
  border-color: var(--green-400);
}

.footer__theme-wrapper::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0; 
  height: 0; 
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-secondary);
  pointer-events: none;
}

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
  padding: 160px 0 100px;
  position: relative;
  overflow: hidden;
}

/* Decorative gradient orbs */
.hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--green-glow) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.06) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
  pointer-events: none;
}

.hero__inner {
  display: flex;
  align-items: center;
  gap: 80px;
  position: relative;
  z-index: 1;
}

.hero__content {
  flex: 1;
  max-width: 560px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--green-400);
  margin-bottom: 24px;
}

.hero__badge__dot {
  width: 6px;
  height: 6px;
  background: var(--green-400);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero__title {
  font-family: var(--font-heading);
  font-size: 3.75rem;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero__title .highlight {
  background: linear-gradient(135deg, var(--green-400), var(--warm-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 480px;
}

.hero__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.store-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.store-badge:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.store-badge__icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.store-badge__text {
  display: flex;
  flex-direction: column;
}

.store-badge__label {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.store-badge__store {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Hero illustration */
.hero__visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero__map-graphic {
  width: 420px;
  height: 420px;
  border-radius: 32px;
  overflow: hidden;
  border: 1px solid var(--border-glass);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  background: var(--bg-secondary);
  position: relative;
  z-index: 1;
}

/* Custom Leaflet Tooltip */
.leaflet-tooltip.custom-map-tooltip {
  background: rgba(22, 24, 34, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  font-family: var(--font-body);
  padding: 8px 12px;
  white-space: nowrap;
}
.leaflet-tooltip.custom-map-tooltip::before {
  display: none; /* Hide default triangle */
}

/* ========================================
   Mission Section
   ======================================== */
.mission {
  padding: calc(var(--section-padding) * 1.5) 0 var(--section-padding);
  position: relative;
}

.mission .section__header {
  max-width: 800px;
  margin: 0 auto 80px;
}

.mission .section__title {
  font-size: 3rem;
  line-height: 1.2;
}

.mission .section__desc {
  font-size: 1.25rem;
  max-width: 600px;
}

.mission__grid {
  display: flex;
  flex-direction: column;
  gap: 120px;
  margin-top: 64px;
}

.mission__row {
  display: flex;
  align-items: center;
  gap: 48px;
}

.mission__row.reverse {
  flex-direction: row-reverse;
}

.mission__image {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mission__image img {
  max-width: 300px;
  height: auto;
  border-radius: 24px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.15);
  border: 4px solid var(--bg-glass);
}

.mission__content {
  flex: 1;
  max-width: 480px;
}

.mission__content h3 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.mission__content p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

@media (max-width: 900px) {
  .mission__grid {
    gap: 80px;
  }
  .mission__row, .mission__row.reverse {
    flex-direction: column;
    text-align: center;
    gap: 32px;
  }
  .mission__content {
    max-width: 100%;
  }
}

/* ========================================
   CTA Section
   ======================================== */
.cta {
  padding: var(--section-padding);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, var(--green-glow) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.cta__inner {
  position: relative;
  z-index: 1;
}

.cta__title {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.cta__desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 40px;
}

.cta__badges {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border-glass);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.footer__brand svg {
  width: 22px;
  height: 22px;
}

.footer__copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer__links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.footer__link {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer__link:hover {
  color: var(--green-400);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
  .hero__inner {
    gap: 48px;
  }

  .hero__title {
    font-size: 3rem;
  }

  .hero__map-graphic {
    width: 340px;
    height: 340px;
  }

  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 72px 0;
  }

  .nav__links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 17, 23, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    z-index: 99;
  }

  .nav__links.open {
    display: flex;
  }

  .nav__link {
    font-size: 1.25rem;
  }

  .nav__hamburger {
    display: flex;
    z-index: 101;
  }

  .nav__hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav__hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .nav__hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero {
    padding: 120px 0 64px;
  }

  .hero__inner {
    flex-direction: column;
    text-align: center;
    gap: 48px;
  }

  .hero__content {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero__title {
    font-size: 2.5rem;
  }

  .hero__subtitle {
    max-width: 400px;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__map-graphic {
    width: 300px;
    height: 300px;
  }

  .map-card--1 {
    left: -10px;
  }

  .map-card--2 {
    right: -10px;
  }

  .section__title {
    font-size: 2rem;
  }

  .features__grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 340px;
    margin: 0 auto;
  }

  .steps::before {
    display: none;
  }

  .cta__title {
    font-size: 2rem;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero__title {
    font-size: 2rem;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .store-badge {
    justify-content: center;
  }

  .hero__map-graphic {
    width: 260px;
    height: 260px;
  }
}
