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

:root {
  --lime: #a3e635;
  --lime-dark: #84cc16;
  --green: #16a34a;
  --green-soft: #f0fdf4;
  --dark: #080f08;
  --dark-2: #111a11;
  --dark-3: #1a2a1a;
  --text: #0f1a0f;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --white: #ffffff;
  --off-white: #fafafa;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 8px 32px rgba(0,0,0,0.08);
  --card-shadow-hover: 0 4px 16px rgba(0,0,0,0.1), 0 16px 48px rgba(0,0,0,0.12);
  --radius: 20px;
  --radius-sm: 12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--off-white);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   HERO — dark, premium, bold
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.hero {
  background: var(--dark);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(100, 200, 80, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(60, 160, 60, 0.10) 0%, transparent 50%);
  padding: 56px 0 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle grid texture */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(163,230,53,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(163,230,53,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.logo {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -1.5px;
  margin-bottom: 32px;
  position: relative;
}
.logo-slim { color: #ffffff; }
.logo-twin { color: var(--lime); }

.hero-eyebrow {
  display: inline-block;
  background: rgba(163,230,53,0.12);
  border: 1px solid rgba(163,230,53,0.25);
  color: var(--lime);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 30px;
  padding: 5px 14px;
  margin-bottom: 20px;
}

.tagline {
  font-size: clamp(1.75rem, 5vw, 2.4rem);
  font-weight: 900;
  color: #ffffff;
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: -1px;
  position: relative;
}

.tagline em {
  font-style: normal;
  color: var(--lime);
}

.sub-tagline {
  color: #6b7f6b;
  font-size: 0.95rem;
  font-weight: 400;
  margin-bottom: 40px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
  position: relative;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SEARCH BAR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.search-form { position: relative; }

.search-wrap {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 16px;
  padding: 6px 6px 6px 20px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 8px 40px rgba(0,0,0,0.4);
  gap: 8px;
}

.search-icon {
  color: #9ca3af;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: transparent;
  min-width: 0;
  padding: 6px 0;
}
.search-input::placeholder { color: #9ca3af; }

.search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--lime);
  color: var(--dark);
  border: none;
  border-radius: 11px;
  padding: 12px 22px;
  font-size: 0.9rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.2px;
}
.search-btn:hover { background: #bef264; }
.search-btn:active { transform: scale(0.96); }

/* ── Location pill ── */
.location-row {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
  position: relative;
}

.location-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-family: inherit;
  color: #a3b8a3;
  cursor: pointer;
  transition: all 0.15s;
}
.location-pill:hover {
  background: rgba(163,230,53,0.1);
  border-color: rgba(163,230,53,0.25);
  color: var(--lime);
}
.location-pill svg { flex-shrink: 0; }
.location-edit {
  color: var(--lime);
  font-weight: 600;
  font-size: 0.75rem;
  margin-left: 4px;
  border-left: 1px solid rgba(163,230,53,0.3);
  padding-left: 8px;
}

/* ── Location modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 900;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.modal-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.location-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.loc-option {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.loc-option:hover {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.modal-custom {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.custom-loc-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  color: var(--text);
}
.custom-loc-input:focus { border-color: var(--green); }

.custom-loc-btn {
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.modal-close {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  padding: 6px;
  text-align: center;
}

.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  justify-content: center;
  align-items: center;
  position: relative;
}

.tag-label {
  color: #4a5f4a;
  font-size: 0.78rem;
  font-weight: 600;
}

.tag {
  background: rgba(255,255,255,0.07);
  color: #a3b8a3;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.tag:hover {
  background: rgba(163,230,53,0.12);
  color: var(--lime);
  border-color: rgba(163,230,53,0.3);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESULTS SECTION
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.results-section {
  padding: 48px 0 72px;
}

.results-header {
  margin-bottom: 32px;
}

.results-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 6px;
}

.results-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.results-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   LOADING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.loading {
  text-align: center;
  padding: 80px 0;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ERROR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.error-state { text-align: center; padding: 80px 0; }
.error-icon { font-size: 2.5rem; margin-bottom: 12px; }
.error-msg { color: var(--text-muted); margin-bottom: 20px; font-size: 0.95rem; }
.retry-btn {
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FILTER BAR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.filter-pill {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.filter-pill:hover {
  border-color: var(--green);
  color: var(--green);
}
.filter-pill.active {
  background: var(--dark);
  border-color: var(--dark);
  color: var(--lime);
}

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

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SWAP CARDS — the money shot
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.swap-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.swap-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.swap-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

/* Card top accent bar */
.swap-card::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--lime-dark), var(--lime));
}

.card-inner { padding: 22px 24px 24px; }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* Badge */
.swap-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-cal      { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-protein  { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.badge-taste    { background: #fdf4ff; color: #9333ea; border: 1px solid #e9d5ff; }
.badge-popular  { background: #fefce8; color: #ca8a04; border: 1px solid #fde68a; }
.badge-easy     { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.badge-value    { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.badge-default  { background: #f9fafb; color: #6b7280; border: 1px solid #e5e7eb; }

/* Flavor tags */
.flavor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.flavor-tag {
  background: var(--dark);
  color: var(--lime);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
}

.card-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.3px;
  margin-bottom: 2px;
}

.card-serving {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

/* ── Calorie comparison boxes ── */
.cal-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  background: #f9fafb;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.protein-box {
  border-left: 1px solid var(--border);
  padding-left: 12px;
}

.cal-box { text-align: center; }

.cal-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 4px;
}

.cal-number {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
}

.cal-number.original { color: #ef4444; }
.cal-number.swap { color: var(--green); }
.cal-number.protein { color: #2563eb; }

.cal-unit {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-light);
  margin-top: 2px;
}

.cal-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.arrow-icon { color: #d1d5db; font-size: 1.1rem; }

.saved-pill {
  background: var(--lime);
  color: var(--dark);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: -0.2px;
}

/* ── Info sections ── */
.card-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-section { }

.section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-label-icon { font-size: 0.9rem; }

.taste-value {
  font-size: 0.88rem;
  color: #166534;
  font-weight: 500;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 10px 14px;
  line-height: 1.55;
}

.section-value {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.55;
}

.where-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.where-tag {
  background: #f3f4f6;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.78rem;
  color: #374151;
  font-weight: 500;
}

.social-value {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  padding-left: 12px;
  border-left: 2px solid #d1d5db;
}

/* ── Buy links ── */
.buy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--dark);
  color: #a3b8a3;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  border: 1px solid rgba(255,255,255,0.06);
}
.buy-btn:hover {
  background: var(--lime);
  color: var(--dark);
  border-color: var(--lime);
}
.buy-arrow {
  font-size: 0.75rem;
  opacity: 0.6;
  transition: transform 0.15s;
}
.buy-btn:hover .buy-arrow {
  transform: translateX(2px);
  opacity: 1;
}

.difficulty-tag {
  display: inline-block;
  background: var(--green-soft);
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 0.78rem;
  color: var(--green);
  font-weight: 700;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SHARE BAR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.share-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  padding: 18px 22px;
  background: var(--dark);
  border-radius: var(--radius);
  flex-wrap: wrap;
}

.share-text {
  flex: 1;
  font-size: 0.88rem;
  color: #6b7f6b;
  min-width: 160px;
}

.share-text strong { color: #a3b8a3; font-weight: 600; }

.share-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--lime);
  color: var(--dark);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.share-btn:hover { background: #bef264; }

.share-copied {
  font-size: 0.82rem;
  color: var(--lime);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
}
.share-copied.visible { opacity: 1; }

.search-again-btn {
  display: block;
  margin: 24px auto 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  padding: 8px;
  transition: color 0.15s;
}
.search-again-btn:hover { color: var(--green); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   HOW IT WORKS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.how-section {
  background: var(--white);
  padding: 72px 0;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.section-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 44px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.step {
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--off-white);
  transition: border-color 0.15s;
}
.step:hover { border-color: #bbf7d0; }

.step-num {
  width: 36px;
  height: 36px;
  background: var(--dark);
  color: var(--lime);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 900;
  margin-bottom: 14px;
}

.step h3 {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.step p {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SOCIAL PROOF STRIP
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.proof-section {
  background: var(--dark);
  padding: 48px 0;
  text-align: center;
}

.proof-title {
  color: #6b7f6b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.proof-quotes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.proof-quote {
  background: var(--dark-2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 18px 16px;
  text-align: left;
}

.proof-text {
  font-size: 0.82rem;
  color: #8fa88f;
  line-height: 1.6;
  font-style: italic;
  margin-bottom: 10px;
}

.proof-source {
  font-size: 0.72rem;
  color: #4a5f4a;
  font-weight: 600;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FOOTER
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.footer {
  background: #040804;
  color: #2d3d2d;
  text-align: center;
  padding: 36px 0;
}

.footer-logo {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 6px;
}

.footer-tag {
  font-size: 0.8rem;
  margin-bottom: 14px;
  color: #2d3d2d;
}

.footer-copy { font-size: 0.75rem; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MOBILE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 600px) {
  .hero { padding: 44px 0 56px; }
  .tagline { font-size: 1.5rem; }
  .sub-tagline { font-size: 0.88rem; }
  .search-wrap { flex-direction: column; padding: 10px; gap: 6px; }
  .search-input { width: 100%; padding: 10px 8px; }
  .search-btn { width: 100%; justify-content: center; padding: 14px; font-size: 0.95rem; }
  .search-icon { display: none; }
  .steps { grid-template-columns: 1fr; }
  .proof-quotes { grid-template-columns: 1fr; }
  .cal-number { font-size: 1.25rem; }
  .share-bar { flex-direction: column; }
  .card-inner { padding: 18px 18px 20px; }
}
