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

:root {
  --bg: #f5f5f4;
  --bg-card: #ffffff;
  --border: #e7e5e4;
  --text: #0c0a09;
  --text-mid: #44403c;
  --text-muted: #78716c;
  --red: #dc2626;
  --red-dark: #991b1b;
  --green: #15803d;
  --accent: #fef2f2;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Hero ---- */
header {
  background: var(--text);
  color: #fff;
  border-bottom: 4px solid var(--red);
}

.hero {
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--red);
  background: rgba(220,38,38,0.15);
  padding: 0.3rem 0.85rem;
  border-radius: 50px;
  margin-bottom: 1.25rem;
}

h1 {
  font-size: 2.75rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.7;
  margin-bottom: 2.25rem;
}

.hero-numbers {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.hero-number {
  text-align: center;
}

.hero-vs {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-bottom: 1.5rem;
}

.hero-profit {
  font-size: 3.5rem;
  font-weight: 900;
  color: #4ade80;
  line-height: 1;
  letter-spacing: -0.03em;
}

.hero-zero {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--red);
  line-height: 1;
  letter-spacing: -0.03em;
}

.hero-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.6rem;
}

.hero-cta {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 2.25rem;
  border-radius: 50px;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.hero-cta:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(220,38,38,0.3);
  text-decoration: none;
}

/* ---- Human cost strip ---- */
.cost-strip {
  background: #1c1917;
  color: #fff;
  padding: 0.85rem 1.5rem;
}

.cost-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cost-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
}

.cost-item {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
}

.cost-num {
  font-weight: 800;
  color: #fff;
  font-size: 0.9rem;
}

/* ---- Break the zero ---- */
.break-zero {
  padding: 0 1rem;
}

.break-zero-inner {
  max-width: 640px;
  margin: 2rem auto;
  padding: 2rem 1.75rem;
  text-align: center;
  background: var(--accent);
  border: 1px solid #fecaca;
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
}

.break-zero h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
  color: var(--red-dark);
}

.break-zero p {
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.75;
}

.break-zero[hidden] { display: none; }

/* ---- Filter bar ---- */
.filter-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
}

.filter-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.filter-tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.5rem;
}

.filter-tabs::-webkit-scrollbar { display: none; }

.ftab {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.ftab:hover {
  border-color: var(--text-mid);
  color: var(--text);
}

.ftab.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.filter-search input {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: var(--font);
  background: var(--bg-card);
  color: var(--text);
}

.filter-search input:focus {
  outline: none;
  border-color: var(--text-mid);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

/* ---- Cards ---- */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.card-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, border-color 0.2s;
  flex: 1 1 300px;
  min-width: 0;
  position: relative;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: #d6d3d1;
}

/* Rank badge */
.card-rank {
  position: absolute;
  top: -1px;
  left: 1rem;
  background: var(--text);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 0 0 6px 6px;
  letter-spacing: 0.02em;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  padding-top: 0.15rem;
}

.card-name {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.card-tag {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-role {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0.85rem;
}

.card-numbers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.card-metric {
  background: var(--bg);
  border-radius: 8px;
  padding: 0.6rem;
  text-align: center;
}

.card-metric .metric-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.card-metric .metric-value {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.metric-value.profit { color: var(--green); }
.metric-value.donated { color: var(--red); }

.card-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-demand {
  flex: 1;
  background: var(--red);
  color: #fff;
  border: none;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn-demand:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
}

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

.btn-share {
  background: var(--bg);
  color: var(--text-mid);
  border: 1.5px solid var(--border);
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-share:hover {
  border-color: var(--text-mid);
  color: var(--text);
}

.card-sources {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

.card-sources a {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-right: 0.6rem;
}

.card-sources a:hover { color: var(--red); }

/* ---- Method link ---- */
.method-link {
  text-align: center;
  padding: 2rem 1.5rem;
}

.method-link a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  padding: 0.6rem 1.5rem;
  border-radius: 50px;
  transition: all 0.15s;
}

.method-link a:hover {
  color: var(--text);
  border-color: var(--text-mid);
  text-decoration: none;
}

/* ---- Footer ---- */
footer {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

footer p { margin-bottom: 0.5rem; }

footer a { color: var(--text-muted); text-decoration: underline; }
footer a:hover { color: var(--text); }

.disclaimer {
  font-size: 0.7rem;
  opacity: 0.7;
}

.updated {
  font-size: 0.7rem;
  opacity: 0.5;
}

/* ---- Modal (bottom sheet on mobile) ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal[hidden] { display: none; }

.modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.modal-sheet {
  position: relative;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 1.5rem;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 0 auto 1rem;
}

.modal-sheet h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

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

.modal-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.8rem;
  line-height: 1.7;
  margin-bottom: 1rem;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
  color: var(--text-mid);
}

.modal-cta {
  display: block;
  background: var(--red);
  color: #fff;
  text-align: center;
  padding: 0.9rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  text-decoration: none;
  transition: background 0.15s;
}

.modal-cta:hover {
  background: var(--red-dark);
  text-decoration: none;
}

.modal-dismiss {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: var(--font);
  padding: 0.6rem;
  cursor: pointer;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: #fff;
  padding: 0.65rem 1.25rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
}

.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ---- Desktop ---- */
@media (min-width: 768px) {
  .hero { padding: 4.5rem 2rem 3.5rem; }
  h1 { font-size: 3.75rem; }
  .hero-profit { font-size: 5.5rem; }
  .hero-zero { font-size: 5.5rem; }
  .hero-numbers { gap: 2.5rem; }
  .hero-vs { font-size: 1rem; }
  .hero-label { font-size: 0.8rem; }
  .hero-sub { font-size: 1.15rem; }
  .cost-inner { gap: 2.5rem; }
  .cost-num { font-size: 1.1rem; }

  .filter-inner { max-width: 1200px; }

  .modal {
    align-items: center;
  }

  .modal-sheet {
    border-radius: 16px;
    max-width: 480px;
  }
}
