/* ============================================================
   Missing Middle SA — Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600&display=swap');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { max-width: 100%; display: block; }

/* ── Tokens ── */
:root {
  --green-900: #052E1C;
  --green-800: #0B4D2F;
  --green-700: #0B6E4F;
  --green-600: #0F8A60;
  --green-500: #1D9E75;
  --green-400: #3DBFA0;
  --green-200: #A8EDD8;
  --green-100: #D6F5EB;
  --green-50:  #F0FBF7;

  --amber-700: #92400E;
  --amber-600: #B45309;
  --amber-400: #F59E0B;
  --amber-100: #FEF3C7;
  --amber-50:  #FFFBEB;

  --red-700:   #991B1B;
  --red-600:   #B91C1C;
  --red-100:   #FEE2E2;

  --blue-700:  #1E3A8A;
  --blue-600:  #1D4ED8;
  --blue-100:  #DBEAFE;

  --ink:       #0F1A14;
  --ink-soft:  #374151;
  --muted:     #6B7280;
  --subtle:    #9CA3AF;
  --border:    #E5E7EB;
  --border-mid:#D1D5DB;
  --surface:   #FFFFFF;
  --base:      #F9FAFB;
  --base-mid:  #F3F4F6;

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.05);

  --max-w: 1100px;
  --max-w-tight: 720px;

  --transition: 0.18s ease;
}

/* ── Base ── */
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
}

p { color: var(--ink-soft); }
a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.container--tight { max-width: var(--max-w-tight); margin: 0 auto; padding: 0 1.5rem; }

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 60px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.nav__logo {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav__logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-500);
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}
.nav__links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}
.nav__links a:hover { color: var(--ink); text-decoration: none; }
.nav__cta {
  background: var(--green-700) !important;
  color: #fff !important;
  padding: 7px 18px !important;
  border-radius: 100px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  transition: background var(--transition) !important;
}
.nav__cta:hover { background: var(--green-800) !important; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
  line-height: 1;
}
.btn--primary { background: var(--green-700); color: #fff; }
.btn--primary:hover { background: var(--green-800); color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--outline { background: transparent; color: var(--green-700); border: 1.5px solid var(--green-700); }
.btn--outline:hover { background: var(--green-50); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn--ghost:hover { background: var(--base); text-decoration: none; color: var(--ink); }
.btn--lg { padding: 16px 32px; font-size: 17px; }
.btn--full { width: 100%; justify-content: center; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card--raised {
  box-shadow: var(--shadow);
  border-color: transparent;
}
.card--green {
  background: var(--green-700);
  color: #fff;
  border-color: transparent;
}

/* ── Badges ── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
}
.badge--green  { background: var(--green-100);  color: var(--green-800); }
.badge--amber  { background: var(--amber-100);  color: var(--amber-700); }
.badge--red    { background: var(--red-100);    color: var(--red-700); }
.badge--blue   { background: var(--blue-100);   color: var(--blue-700); }
.badge--subtle { background: var(--base-mid);   color: var(--muted); }

/* ── Forms ── */
.field { margin-bottom: 1.25rem; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}
.field input:focus,
.field select:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(29,158,117,0.12); }
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.range-wrap { display: flex; align-items: center; gap: 12px; }
.range-wrap input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  padding: 0;
  border: none;
  box-shadow: none;
}
.range-wrap input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green-700);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--green-500), var(--shadow-sm);
}
.range-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  min-width: 100px;
  text-align: right;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem; }

/* ── Section ── */
.section { padding: 5rem 0; }
.section--sm { padding: 3rem 0; }
.section--alt { background: var(--base); }

.section-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-600);
  margin-bottom: 10px;
}
.section-title {
  font-size: clamp(28px, 4vw, 42px);
  margin-bottom: 1rem;
}
.section-sub {
  font-size: 17px;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.6;
}

/* ── Utilities ── */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.5s ease both; }
.fade-up-2 { animation: fadeUp 0.5s 0.1s ease both; }
.fade-up-3 { animation: fadeUp 0.5s 0.2s ease both; }
.fade-up-4 { animation: fadeUp 0.5s 0.3s ease both; }

/* ── Footer ── */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,0.6);
  padding: 3rem 0;
}
.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer__brand { font-family: var(--font-display); font-size: 18px; color: #fff; margin-bottom: 6px; }
.footer__tagline { font-size: 13px; line-height: 1.5; max-width: 280px; }
.footer__links { display: flex; gap: 1.5rem; }
.footer__links a { font-size: 13px; color: rgba(255,255,255,0.5); text-decoration: none; }
.footer__links a:hover { color: #fff; }
.footer__bottom { max-width: var(--max-w); margin: 1.5rem auto 0; padding: 1.5rem 1.5rem 0; border-top: 1px solid rgba(255,255,255,0.08); font-size: 12px; color: rgba(255,255,255,0.3); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav__links { display: none; }
  .section { padding: 3rem 0; }
  .section-title { font-size: 26px; }
}
