/* Compare page styles — v1.0.1 (republish to force CDN upload of /compare/). */
/* Compare — Stripe-grade comparison page.
   Reuses the global design system (../styles.css): tokens, .btn, .site-header,
   .site-footer, .final-cta. This sheet only adds the hero + the comparison
   table component. */

.compare-body { background: var(--ds-bg); }

/* ============ HERO ============ */
.cmp-hero {
  width: min(calc(100% - 32px), 940px);
  margin: 0 auto;
  padding: 40px 0 30px;
  text-align: center;
  position: relative;
}
.cmp-hero::before {
  content: "";
  position: absolute;
  inset: 0 -40px auto -40px;
  height: 320px;
  background: radial-gradient(ellipse 60% 70% at 50% 0%, rgba(255, 110, 69, 0.12), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.cmp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--ds-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-accent-strong);
  margin-bottom: 18px;
}
.cmp-eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ds-accent-strong);
  box-shadow: 0 0 0 4px var(--ds-accent-soft);
}
.cmp-hero h1 {
  margin: 0 auto;
  max-width: 17ch;
  font-family: var(--ds-display);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.032em;
  font-weight: 600;
  color: var(--ds-text);
}
.cmp-hero p {
  margin: 22px auto 0;
  max-width: 62ch;
  font-size: 17px;
  line-height: 1.62;
  color: var(--ds-muted);
}
.cmp-hero p strong { color: var(--ds-text); font-weight: 600; }

/* ============ TABLE ============ */
.cmp-section {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 24px auto 0;
}
.cmp-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg);
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}
.cmp {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14.5px;
}
.cmp th,
.cmp td {
  text-align: center;
  padding: 15px 18px;
  border-bottom: 1px solid var(--ds-divider);
}

/* head */
.cmp thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--ds-surface);
  vertical-align: bottom;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--ds-border-strong);
}
.cmp-name {
  display: block;
  font-family: var(--ds-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ds-text);
}
.cmp-cat {
  display: block;
  margin-top: 5px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ds-muted-soft);
}

/* first (feature) column — pinned on horizontal scroll */
.cmp th[scope="row"],
.cmp .cmp-corner {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--ds-surface);
  min-width: 252px;
  font-weight: 550;
  color: var(--ds-text);
}
.cmp th[scope="row"] { z-index: 1; font-size: 14.5px; }
.cmp .cmp-corner { z-index: 3; }
.cmp .cmp-corner span {
  font-family: var(--ds-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-muted-soft);
}

/* group rows */
.cmp-group th {
  text-align: left;
  background: var(--ds-bg-soft);
  font-family: var(--ds-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ds-muted);
  padding: 11px 18px;
  position: sticky;
  left: 0;
  border-bottom: 1px solid var(--ds-divider);
}

/* cells */
.cmp-ic { width: 18px; height: 18px; vertical-align: middle; }
.cmp td.yes { color: var(--ds-success); }
.cmp td.no { color: var(--ds-border-strong); }
.cmp td.no .cmp-ic { width: 15px; height: 15px; }
.cmp-note { font-size: 12.5px; color: var(--ds-muted); }

/* Crossdeck column — tinted + lifted */
.cmp .c-cd {
  background: var(--ds-accent-soft);
  box-shadow: inset 1px 0 0 rgba(255, 110, 69, 0.28), inset -1px 0 0 rgba(255, 110, 69, 0.28);
}
.cmp thead .c-cd { border-bottom-color: var(--ds-accent-strong); }
.cmp thead .c-cd .cmp-name { color: var(--ds-accent-strong); }
.cmp thead .c-cd .cmp-cat { color: var(--ds-accent-strong); opacity: 0.85; }
.cmp tbody tr:last-child .c-cd { box-shadow: inset 1px 0 0 rgba(255, 110, 69, 0.28), inset -1px 0 0 rgba(255, 110, 69, 0.28), inset 0 -1px 0 rgba(255, 110, 69, 0.28); }
.cmp td.yes.c-cd { color: var(--ds-accent-strong); }

.cmp tbody tr:not(.cmp-group):hover th[scope="row"],
.cmp tbody tr:not(.cmp-group):hover td { background-color: rgba(23, 19, 17, 0.018); }
.cmp tbody tr:not(.cmp-group):hover .c-cd { background-color: rgba(255, 110, 69, 0.14); }

/* footnote + cta */
.cmp-foot {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 18px auto 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ds-muted-soft);
  max-width: 88ch;
}
.cmp-foot strong { color: var(--ds-muted); font-weight: 600; }

@media (max-width: 760px) {
  .cmp-hero { padding: 56px 0 28px; }
  .cmp-hero h1 { font-size: clamp(30px, 8vw, 40px); }
  .cmp-hero p { font-size: 15.5px; }
  .cmp th, .cmp td { padding: 13px 14px; }
  .cmp th[scope="row"], .cmp .cmp-corner { min-width: 200px; }
}

/* ============ MOBILE: stack the comparison into cards ============ */
/* Under 600px the 5-column table + 252px sticky column is unusable side-scroll.
   Restructure each feature row into its own card: the feature name is the card
   title, and the four products read as a labelled list (product → check/dash).
   Per-cell product labels come from nth-of-type (column order is fixed), so NO
   markup change is needed. All overrides are scoped to this query — desktop is
   untouched. */
@media (max-width: 600px) {
  /* Drop the horizontal scroll container — cards flow vertically. */
  .cmp-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .cmp,
  .cmp thead,
  .cmp tbody,
  .cmp tr,
  .cmp th,
  .cmp td {
    display: block;
    min-width: 0;
    width: auto;
  }

  /* The product header row is redundant once each cell is self-labelled. */
  .cmp thead { display: none; }

  /* Reset the sticky first-column behaviour + 200px min-width from the table
     layout (the 760px block above sets those via a higher-specificity rule). */
  .cmp th[scope="row"],
  .cmp .cmp-corner,
  .cmp-group th {
    position: static;
    left: auto;
    min-width: 0;
  }

  /* Group label = a section heading above its block of cards. */
  .cmp-group th {
    background: transparent;
    padding: 22px 2px 6px;
    border-bottom: 0;
    color: var(--ds-muted);
  }

  /* Each feature row becomes a card. */
  .cmp tbody tr:not(.cmp-group) {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    box-shadow: var(--ds-shadow-sm, 0 1px 2px rgba(20, 17, 15, 0.05));
    padding: 4px 16px 12px;
    margin: 0 0 12px;
  }

  /* Card title = the feature name. */
  .cmp tbody tr:not(.cmp-group) th[scope="row"] {
    text-align: left;
    padding: 14px 0 10px;
    font-size: 15px;
    font-weight: 600;
    border-bottom: 1px solid var(--ds-divider);
    margin-bottom: 4px;
  }

  /* Each product cell = a labelled "Product …… mark" row. */
  .cmp tbody tr:not(.cmp-group) td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: right;
    padding: 9px 0;
    border-bottom: 1px solid var(--ds-divider);
  }
  .cmp tbody tr:not(.cmp-group) td:last-child { border-bottom: 0; }

  /* Inject the product name (column order is fixed: Sentry, TelemetryDeck,
     RevenueCat, Crossdeck) so no markup change is needed. */
  .cmp tbody tr:not(.cmp-group) td::before {
    font-family: var(--ds-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ds-muted-soft);
    text-align: left;
  }
  .cmp tbody tr:not(.cmp-group) td:nth-of-type(1)::before { content: "Sentry"; }
  .cmp tbody tr:not(.cmp-group) td:nth-of-type(2)::before { content: "TelemetryDeck"; }
  .cmp tbody tr:not(.cmp-group) td:nth-of-type(3)::before { content: "RevenueCat"; }
  .cmp tbody tr:not(.cmp-group) td:nth-of-type(4)::before { content: "Crossdeck"; }

  /* Crossdeck row stays the accent-tinted hero of each card. */
  .cmp tbody tr:not(.cmp-group) td.c-cd {
    box-shadow: none;
    margin: 4px -16px -12px;
    padding: 11px 16px;
    border-radius: 0 0 var(--ds-radius-lg) var(--ds-radius-lg);
  }
  .cmp tbody tr:not(.cmp-group) td.c-cd::before { color: var(--ds-accent-strong); }

  /* The injected label sits left, the mark/note sits right. */
  .cmp .cmp-ic { margin: 0; }
  .cmp-note { text-align: right; }
}
