/* deliverabilitymatrix.com — navy + teal, faceless, professional, mobile-friendly */
:root {
  --navy: #0B1F3A;
  --teal: #14B8A6;
  --teal-dark: #0D9488;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --text: #0B1F3A;
  --muted: #5c6570;
  --border: #e2e6eb;
  --accent: var(--teal-dark);
  --accent-soft: #e6f7f5;
  --warn-bg: #fff8e6;
  --warn-border: #e6c35c;
  --note-bg: #f0f4f8;
  --radius: 8px;
  --max: 800px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --tap: 44px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  /* Keep sideways scroll inside .table-wrap, not the page */
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  max-width: 100%;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; color: var(--teal); }

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

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
  max-width: 100%;
}

.wrap-wide {
  --max: 880px;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 rgba(11, 31, 58, 0.04);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: -0.02em;
  min-height: var(--tap);
  max-width: 100%;
}

.brand:hover { color: var(--accent); text-decoration: none; }

.brand-mark {
  display: block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 4px;
}

.brand-logo {
  display: block;
  height: 28px;
  width: auto;
  max-width: min(220px, 55vw);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  font-size: 0.9rem;
  max-width: 100%;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
}

.nav a:hover { color: var(--accent); background: var(--accent-soft); }

main { padding: 1.5rem 0 2.75rem; }

.hero {
  margin: 0 0 1.5rem;
  padding: 1.35rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(11, 31, 58, 0.04);
}

.hero h1 { margin-bottom: 0.55rem; }

.hero .lede { margin-bottom: 0.85rem; }

.hero-start {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
}

.hero-start strong { color: var(--navy); }

h1 {
  font-size: clamp(1.45rem, 4vw, 1.8rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 0.65rem;
  color: var(--navy);
  overflow-wrap: anywhere;
}

h2 {
  font-size: 1.2rem;
  margin: 1.75rem 0 0.65rem;
  letter-spacing: -0.015em;
  color: var(--navy);
  overflow-wrap: anywhere;
}

h3 {
  font-size: 1.05rem;
  margin: 1.35rem 0 0.45rem;
  color: var(--navy);
}

p { margin: 0 0 0.9rem; overflow-wrap: break-word; }

.lede {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 1.1rem;
  line-height: 1.65;
}

.meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.55;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.05rem 1.15rem;
  margin: 1.1rem 0;
}

.decision-tree ol > li {
  margin: 0.85rem 0;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.decision-tree ol > li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.decision-tree ul {
  margin-top: 0.4rem;
}

.disclosure {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  padding: 0.95rem 1.05rem;
  margin: 1.1rem 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

.disclosure strong { display: inline; }

.claim-note {
  background: var(--note-bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.85rem 1.05rem;
  margin: 1.1rem 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
}

.claim-note strong { color: var(--text); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.1rem 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0.65rem 1.1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  line-height: 1.3;
  text-align: center;
}

.btn:hover {
  text-decoration: none;
  background: var(--teal);
  color: #fff;
  filter: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--teal); color: #fff; }

.btn-secondary {
  background: var(--surface);
  color: var(--navy);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface);
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #eee;
  color: var(--muted);
  vertical-align: middle;
}

.badge-assumption { background: #e8e8f4; color: #3d3d6b; }

.table-wrap {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  scrollbar-width: thin;
  max-width: 100%;
}

.table-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2rem;
  pointer-events: none;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.92));
  border-radius: 0 var(--radius) var(--radius) 0;
  z-index: 3;
}

.table-wrap.scroll-hint::before {
  content: "Swipe to see more →";
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.5rem 0.85rem 0;
  line-height: 1.4;
}

@media (min-width: 860px) {
  .table-wrap::after { display: none; }
  .table-wrap.scroll-hint::before { display: none; }
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

th, td {
  padding: 0.65rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.45;
}

th {
  background: #eef2f6;
  color: var(--navy);
  font-weight: 600;
  white-space: nowrap;
}

tr:last-child td { border-bottom: none; }

/* Sticky first column: keeps labels readable while swiping cells */
.table-wrap th:first-child,
.table-wrap td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--border);
  max-width: 11rem;
  min-width: 6.5rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.table-wrap th:first-child {
  background: #eef2f6;
  z-index: 2;
}

td.pending {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.stub-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.stub-list li {
  margin: 0.45rem 0;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1.5;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.75rem 0 2.25rem;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
}

.site-footer .wrap > * + * { margin-top: 1rem; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
}

.footer-nav a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  text-decoration: none;
}

.footer-nav a:hover { color: var(--accent); background: var(--accent-soft); }

.footer-brand { font-weight: 600; color: var(--navy); }

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  align-items: center;
}

.footer-social a {
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.footer-social a:hover { color: var(--accent); text-decoration: underline; background: var(--accent-soft); }

ul.clean { padding-left: 1.2rem; }
ul.clean li { margin: 0.35rem 0; }
ol.clean { padding-left: 1.2rem; }
ol.clean > li { margin: 0.5rem 0; }

/* Stack multiple outbound CTAs in matrix cells (e.g. Instantly + Lemlist) */
.outbound-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  min-width: 7.5rem;
}
.outbound-stack .btn {
  text-align: center;
  white-space: nowrap;
  width: 100%;
}

/* Phone / narrow: ~390px target */
@media (max-width: 520px) {
  .wrap {
    width: min(100% - 1.5rem, var(--max));
  }

  .site-header {
    padding: 0.55rem 0;
  }

  .site-header .wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .brand {
    font-size: 1rem;
  }

  .nav {
    width: 100%;
    gap: 0.1rem 0.2rem;
  }

  .nav a {
    padding: 0.35rem 0.5rem;
  }

  main { padding: 1.15rem 0 2.25rem; }

  .hero {
    padding: 1.1rem 0.95rem;
    margin-bottom: 1.25rem;
  }

  .card {
    padding: 0.95rem 0.95rem;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .cta-row .btn {
    width: 100%;
  }

  /* Buttons inside table cells stay compact; still meet tap height */
  .table-wrap .btn {
    width: 100%;
    white-space: nowrap;
  }

  th, td { padding: 0.55rem 0.65rem; }

  /* Fallback swipe tables (no .table-cards): keep compact min-width */
  .table-wrap:not(.table-cards) table {
    min-width: 580px;
    font-size: 0.88rem;
  }

  .table-wrap:not(.table-cards) th:first-child,
  .table-wrap:not(.table-cards) td:first-child {
    max-width: 38vw;
    min-width: 5.75rem;
    padding-left: 0.65rem;
    padding-right: 0.55rem;
  }

  .table-wrap:not(.table-cards).scroll-hint::before {
    font-size: 0.78rem;
    padding: 0.45rem 0.75rem 0.1rem;
  }

  /*
   * Card-stack compare/TCO tables (~390px primary path).
   * Requires data-label on each td (from column headers).
   * Desktop/tablet table layout unchanged above this breakpoint.
   */
  .table-wrap.table-cards {
    overflow-x: visible;
    border: none;
    background: transparent;
    margin: 0.75rem 0 1.25rem;
  }

  .table-wrap.table-cards::after,
  .table-wrap.table-cards.scroll-hint::before {
    display: none;
  }

  .table-wrap.table-cards table {
    min-width: 0;
    width: 100%;
    font-size: 0.88rem;
    border-collapse: separate;
    border-spacing: 0;
  }

  .table-wrap.table-cards thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .table-wrap.table-cards caption {
    display: block;
    width: 100%;
    text-align: left;
    caption-side: top;
    padding: 0 0 0.55rem;
    font-size: 0.8rem;
    color: var(--muted);
  }

  .table-wrap.table-cards tbody tr {
    display: block;
    margin: 0 0 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
  }

  .table-wrap.table-cards tbody tr:last-child {
    margin-bottom: 0;
  }

  .table-wrap.table-cards tbody td {
    display: grid;
    grid-template-columns: minmax(6.5rem, 36%) 1fr;
    gap: 0.35rem 0.65rem;
    align-items: start;
    width: 100%;
    max-width: none;
    min-width: 0;
    position: static;
    left: auto;
    z-index: auto;
    box-shadow: none;
    background: transparent;
    white-space: normal;
    overflow-wrap: anywhere;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
  }

  .table-wrap.table-cards tbody td:last-child {
    border-bottom: none;
  }

  .table-wrap.table-cards tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--navy);
    font-size: 0.78rem;
    line-height: 1.35;
    letter-spacing: 0.01em;
  }

  /* First column = card title (row label / merchant / tool) */
  .table-wrap.table-cards tbody td:first-child {
    display: block;
    grid-template-columns: none;
    background: #eef2f6;
    color: var(--navy);
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.4;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
    max-width: none;
    min-width: 0;
  }

  .table-wrap.table-cards tbody td:first-child::before {
    content: none;
    display: none;
  }

  .table-wrap.table-cards .outbound-stack {
    min-width: 0;
  }

  .table-wrap.table-cards .btn {
    white-space: normal;
  }

  .disclosure {
    padding: 0.9rem 0.95rem;
    font-size: 0.9rem;
  }

  .claim-note {
    padding: 0.8rem 0.9rem;
  }

  .site-footer {
    padding: 1.5rem 0 2rem;
  }

  .footer-nav,
  .footer-social {
    width: 100%;
  }

  h2 { margin-top: 1.5rem; }
}

/* Very narrow phones */
@media (max-width: 380px) {
  .wrap {
    width: min(100% - 1.25rem, var(--max));
  }

  .brand span {
    font-size: 0.95rem;
  }

  .table-wrap:not(.table-cards) th:first-child,
  .table-wrap:not(.table-cards) td:first-child {
    max-width: 34vw;
    min-width: 5.25rem;
  }
}
