/* =================================================================
   Keepframe — comparison page ("vs") components
   Reusable across every /compare/<competitor> page.
   -----------------------------------------------------------------
   Consumes the site's design tokens from styles.css. Theme switching
   is inherited from the site (data-theme attribute + prefers-color-
   scheme). Colour tokens (--cmp-*) follow the site's triple pattern:
     :root / @media(prefers dark):root:not([data-theme="light"]) / [data-theme="dark"]
   Layout tokens (--cmp-w-*, --cmp-space) are theme-independent.
   ================================================================= */

/* ---- Colour tokens: light (default) ---- */
:root {
  --cmp-kf-tint: rgba(124, 58, 237, 0.05);
  --cmp-kf-tint-hover: rgba(124, 58, 237, 0.09);
  --cmp-kf-border: rgba(124, 58, 237, 0.30);
  --cmp-kf-glow: 0 10px 26px rgba(124, 58, 237, 0.14);
  --cmp-gold: #e8cd86;                       /* constant across themes */
  --cmp-gold-border: rgba(169, 118, 10, 0.5);
  --cmp-row-hover: rgba(24, 18, 38, 0.025);
  --cmp-border-soft: rgba(24, 18, 38, 0.08);
  --cmp-tier-free: #c9b6f7;                  /* constant across themes */
  --cmp-tier-pro: #8d93a1;
  --cmp-tier-power: #a9760a;

  /* Layout: three widths only (capped by the real container --maxw 1120) */
  --cmp-w-prose: 800px;     /* NARROW  — reading measure, prose in details */
  --cmp-w-content: 920px;   /* STANDARD — hero-adjacent, pricing, faq, sources, cta */
  --cmp-w-wide: 1080px;     /* WIDE     — decision cards, workflow, feature table */
  --cmp-space: clamp(42px, 5.6vw, 70px);     /* single vertical rhythm unit */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cmp-kf-tint: rgba(124, 58, 237, 0.07);
    --cmp-kf-tint-hover: rgba(124, 58, 237, 0.11);
    --cmp-kf-border: rgba(124, 58, 237, 0.28);
    --cmp-kf-glow: 0 10px 28px rgba(124, 58, 237, 0.26);
    --cmp-gold-border: rgba(232, 205, 134, 0.22);
    --cmp-row-hover: rgba(255, 255, 255, 0.02);
    --cmp-border-soft: rgba(201, 182, 247, 0.09);
    --cmp-tier-pro: #ccd1dd;
    --cmp-tier-power: #e8cd86;
  }
}
[data-theme="dark"] {
  --cmp-kf-tint: rgba(124, 58, 237, 0.07);
  --cmp-kf-tint-hover: rgba(124, 58, 237, 0.11);
  --cmp-kf-border: rgba(124, 58, 237, 0.28);
  --cmp-kf-glow: 0 10px 28px rgba(124, 58, 237, 0.26);
  --cmp-gold-border: rgba(232, 205, 134, 0.22);
  --cmp-row-hover: rgba(255, 255, 255, 0.02);
  --cmp-border-soft: rgba(201, 182, 247, 0.09);
  --cmp-tier-pro: #ccd1dd;
  --cmp-tier-power: #e8cd86;
}

/* ---- Screen-reader-only utility ---- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* =================================================================
   LAYOUT — one .container everywhere; three width tokens; one rhythm.
   Section headings LEFT in content sections; hero + final CTA centred.
   ================================================================= */
.cmp-page .section { padding-block: var(--cmp-space); }
.cmp-wide    { max-width: var(--cmp-w-wide);    margin-inline: auto; }
.cmp-content { max-width: var(--cmp-w-content); margin-inline: auto; }
.cmp-prose   { max-width: var(--cmp-w-prose); }

.cmp-head { margin-bottom: 26px; }
/* Light section kicker — NOT the purple pill (used once, in the hero) */
.cmp-kicker {
  margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
}
.cmp-sub { margin: 8px 0 0; color: var(--muted); font-size: 1.02rem; line-height: 1.5; max-width: 60ch; }

/* =================================================================
   A · HERO — true 3-column comparison title, one optical axis
   ================================================================= */
.cmp-page .vs-hero { padding-block: clamp(18px, 2.6vw, 38px); }
.vs-hero__inner {
  width: min(100%, 880px); margin-inline: auto;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding-inline: 8px;
}
.vs-hero .eyebrow { margin-bottom: 14px; }
.vs-h1 { margin: 0; font-size: clamp(2.4rem, 5.4vw, 3.9rem); line-height: 1.04; width: 100%; }
.vs-title {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  column-gap: clamp(14px, 2.2vw, 26px); width: 100%;
}
.vs-title__name { white-space: nowrap; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.vs-title__name--l { text-align: right; }
.vs-title__name--r { text-align: left; }
.vs-chip {
  justify-self: center; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 0.32em; font-weight: 800;
  letter-spacing: 0.06em; border-radius: 999px; padding: 0.5em 1em; line-height: 1;
  transform: translateY(0.04em);
}
/* Second heading line — part of the H1, always larger than the 18px sub */
.h1-q {
  display: block; font-size: max(0.5em, 20px); font-weight: 700; letter-spacing: -0.01em;
  color: var(--muted); margin-top: 12px; line-height: 1.25;
}
.hero-sub { max-width: 640px; margin: 14px auto 0; font-size: 18px; line-height: 1.5; color: var(--text-soft); }
.vs-hero .hero__cta { justify-content: center; margin: 18px 0 0; }
.micro { font-size: 13.5px; color: var(--muted); margin: 10px 0 0; }

/* =================================================================
   B · AN HONEST SPLIT — decision cards + shared bullet list
   ================================================================= */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.vs-card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 30px 26px; overflow: hidden; box-shadow: none;
}
.vs-card.kf { border-color: var(--cmp-gold-border); box-shadow: var(--cmp-kf-glow); }
.vs-card.kf::before {
  content: ""; display: block; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--cmp-gold); opacity: 0.8;
}
.vs-card h3 { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; color: var(--text); margin: 0 0 18px; }
.vs-card.kf h3 { color: var(--accent-ink); }

.vs-bullets { list-style: none; margin: 0; padding: 0; }
.vs-bullets li {
  position: relative; padding-left: 22px; margin-bottom: 15px;
  font-size: 14.5px; line-height: 1.55; color: var(--text-soft);
}
.vs-bullets li:last-child { margin-bottom: 0; }
.vs-bullets li::before {
  content: ""; position: absolute; left: 1px; top: 8px; width: 7px; height: 7px;
  background: var(--muted); transform: rotate(45deg); border-radius: 1.5px;
}
.vs-card.kf .vs-bullets li::before { background: var(--accent); }
.vs-bullets li b { color: var(--text); font-weight: 700; }

.reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.reasons__label { margin: 0 0 12px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* =================================================================
   C · WORKFLOW DIAGRAM — connected nodes, no outer card (centerpiece)
   ================================================================= */
.flow-diagram { display: grid; gap: 22px; }
.flow-row { display: grid; grid-template-columns: 108px 1fr; align-items: center; gap: 20px; }
.flow-row__label { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.flow-row--kf .flow-row__label { color: var(--accent-ink); }
.flow-track { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; row-gap: 14px; }
.flow-node {
  position: relative; display: inline-flex; align-items: center; padding: 10px 18px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font-size: 14px; font-weight: 650; color: var(--text); white-space: nowrap; box-shadow: var(--shadow-sm);
}
.flow-node:not(:last-child) { margin-right: 38px; }
.flow-node:not(:last-child)::after {
  content: "→"; position: absolute; right: -26px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-weight: 400; font-size: 17px; line-height: 1;
}
.flow-row--kf .flow-node { border-color: var(--cmp-kf-border); }

/* =================================================================
   D · FEATURE BY FEATURE — Keepframe vs one competitor table
   ================================================================= */
.tbl-note { font-size: 13.5px; color: var(--muted); margin-bottom: 16px; }
.tbl-shell { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.tbl-shell table { width: 100%; border-collapse: collapse; }
.tbl-shell caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tbl-shell th, .tbl-shell td { padding: 15px 20px; text-align: left; vertical-align: top; font-size: 14.5px; line-height: 1.55; }
.tbl-shell thead th { font-size: 12.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); }
.tbl-shell thead th.kf { color: var(--accent-ink); }
.tbl-shell tbody tr { border-bottom: 1px solid var(--cmp-border-soft); }
.tbl-shell tbody tr:last-child { border-bottom: none; }
.tbl-shell tbody th[scope="row"] { width: 22%; color: var(--text); font-weight: 700; font-size: 14px; }
.tbl-shell td.kf, .tbl-shell thead th.kf {
  width: 39%; background: var(--cmp-kf-tint);
  border-left: 1px solid var(--cmp-kf-border); border-right: 1px solid var(--cmp-kf-border);
}
.tbl-shell td.other { width: 39%; color: var(--muted); }
.tbl-shell tbody tr:hover th, .tbl-shell tbody tr:hover td { background: var(--cmp-row-hover); }
.tbl-shell tbody tr:hover td.kf { background: var(--cmp-kf-tint-hover); }

.cmp-tech-prose { margin-top: 22px; }
.cmp-tech-prose h3 { margin: 0 0 10px; }
.cmp-tech-prose p { max-width: 70ch; color: var(--text-soft); margin: 0 0 14px; }
.cmp-tech-prose strong, .cmp-tech-prose b { color: var(--text); font-weight: 700; }
.inline-cta {
  display: inline-block; margin-top: 4px; color: var(--accent-ink); text-decoration: none;
  font-weight: 700; font-size: 15.5px; border-bottom: 1px solid var(--cmp-kf-border);
  padding-bottom: 2px; transition: border-color 0.15s ease;
}
.inline-cta:hover { border-bottom-color: var(--accent-ink); text-decoration: none; }

/* =================================================================
   Shared disclosure — section-level accordions (.cmp-more)
   ================================================================= */
.cmp-more { margin-top: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.cmp-more > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; font-weight: 700; font-size: 15px; color: var(--text);
}
.cmp-more > summary::-webkit-details-marker { display: none; }
.cmp-more > summary::before { content: "+"; color: var(--accent); font-weight: 800; font-size: 17px; flex: none; transition: transform 0.18s ease; }
.cmp-more[open] > summary::before { transform: rotate(45deg); }
.cmp-more > summary:hover { color: var(--accent-ink); }
.cmp-more__body { padding: 4px 18px 18px; }
.cmp-more__body .tbl-shell { border-radius: 10px; }

/* =================================================================
   F · PRICING — one band, three segments, price dominant
   ================================================================= */
.price-band {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--cmp-kf-border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.price-seg { display: flex; flex-direction: column; gap: 6px; padding: 20px 22px; }
.price-seg + .price-seg { border-left: 1px solid var(--border); }
.price-seg__name { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.price-seg__dot { width: 8px; height: 8px; transform: rotate(45deg); border-radius: 1.5px; flex: none; }
.price-seg.free  .price-seg__dot, .price-seg__dot.free  { background: var(--cmp-tier-free); }
.price-seg.pro   .price-seg__dot, .price-seg__dot.pro   { background: var(--cmp-tier-pro); }
.price-seg.power .price-seg__dot, .price-seg__dot.power { background: var(--cmp-tier-power); }
.price-seg__price { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); line-height: 1.1; }
.price-seg__per { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 3px; }
.price-seg__limit { font-size: 13px; color: var(--muted); }
.price-meta { margin: 12px 0 0; font-size: 13.5px; color: var(--muted); }
.price-meta a { color: var(--accent-ink); border-bottom: 1px solid var(--cmp-kf-border); text-decoration: none; }
.price-meta a:hover { border-bottom-color: var(--accent-ink); text-decoration: none; }

.plan-list { margin: 0; }
.plan-list dt { display: flex; align-items: center; gap: 9px; font-weight: 800; color: var(--text); font-size: 14.5px; margin-top: 14px; }
.plan-list dt:first-child { margin-top: 0; }
.plan-list dd { margin: 4px 0 0; padding-left: 17px; color: var(--text-soft); font-size: 13.8px; line-height: 1.55; }
.plan-list__note { margin: 16px 0 0; font-size: 13.5px; color: var(--muted); }

.vendor-band {
  margin-top: 18px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; font-size: 14.5px; line-height: 1.6; color: var(--muted);
}
.vendor-band b { color: var(--text); font-weight: 800; }
.vendor-band a { color: var(--accent-ink); border-bottom: 1px solid var(--cmp-kf-border); }
.vendor-band a:hover { border-bottom-color: var(--accent-ink); text-decoration: none; }

/* =================================================================
   G · FAQ
   ================================================================= */
.faq { max-width: 74ch; }
.faq > details { border-bottom: 1px solid var(--cmp-border-soft); padding: 2px 0; }
.faq > details > summary {
  cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 14px;
  padding: 14px 2px; color: var(--text); font-weight: 700; font-size: 15.5px; border-radius: 6px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq > details > summary::before { content: "+"; color: var(--accent); font-weight: 800; font-size: 17px; flex: none; transition: transform 0.18s ease; }
.faq > details[open] > summary::before { transform: rotate(45deg); }
.faq > details > summary:hover { color: var(--accent-ink); }
.faq > details > p { padding: 0 0 16px 31px; font-size: 14.5px; max-width: 66ch; color: var(--text-soft); margin: 0; }
.faq-more { margin-top: 14px; }
.faq-more .cmp-more__body > details { border-bottom: 1px solid var(--cmp-border-soft); }
.faq-more .cmp-more__body > details:last-child { border-bottom: none; }
.faq-more .cmp-more__body > details > summary {
  cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 14px;
  padding: 13px 2px; color: var(--text); font-weight: 700; font-size: 15px;
}
.faq-more .cmp-more__body > details > summary::-webkit-details-marker { display: none; }
.faq-more .cmp-more__body > details > summary::before { content: "+"; color: var(--accent); font-weight: 800; font-size: 16px; flex: none; transition: transform 0.18s ease; }
.faq-more .cmp-more__body > details[open] > summary::before { transform: rotate(45deg); }
.faq-more .cmp-more__body > details > p { padding: 0 0 14px 29px; font-size: 14px; color: var(--text-soft); margin: 0; }

/* =================================================================
   H · SOURCES (collapsed, tight, before the final CTA)
   ================================================================= */
.cmp-page .vs-sources { padding-block: clamp(16px, 2.4vw, 26px); }
.vs-sources .checked { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.vs-sources p { font-size: 13.5px; line-height: 1.65; color: var(--muted); max-width: 82ch; margin: 0 0 12px; }
.vs-sources p:last-child { margin-bottom: 0; }
.vs-sources a { color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid var(--cmp-kf-border); }
.vs-sources a:hover { border-bottom-color: var(--accent-ink); }

/* =================================================================
   I · FINAL CTA (centred bookend, strongest section)
   ================================================================= */
.closing { text-align: center; padding-block: clamp(44px, 5.5vw, 72px); border-top: 1px solid var(--border); }
.closing h2 { font-size: clamp(28px, 3.6vw, 36px); }
.closing > .container > .cmp-content > p { max-width: 56ch; margin: 12px auto 0; }
.closing .btn { margin-top: 24px; }
.closing .signature { margin-top: 38px; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--accent-ink); }

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 820px) {
  .choice { grid-template-columns: 1fr; }
  .reasons { grid-template-columns: 1fr; gap: 18px; }

  /* Workflow -> vertical, down connectors */
  .flow-row { grid-template-columns: 1fr; gap: 10px; }
  .flow-track { flex-direction: column; align-items: flex-start; row-gap: 8px; }
  .flow-node:not(:last-child) { margin-right: 0; margin-bottom: 24px; }
  .flow-node:not(:last-child)::after { content: "↓"; right: auto; left: 22px; top: auto; bottom: -21px; transform: none; }

  /* Table -> compact grouped rows (not one card per feature) */
  .tbl-shell table, .tbl-shell tbody, .tbl-shell tr, .tbl-shell th, .tbl-shell td { display: block; width: 100%; }
  .tbl-shell thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl-shell tbody tr { border-bottom: 1px solid var(--border); }
  .tbl-shell tbody tr:last-child { border-bottom: none; }
  .tbl-shell tbody th[scope="row"] { width: auto; padding: 12px 16px 4px; font-size: 13px; font-weight: 800; letter-spacing: 0.02em; color: var(--text); }
  .tbl-shell tbody td { width: auto; padding: 2px 16px; border: 0; font-size: 13.5px; line-height: 1.5; }
  .tbl-shell tbody td:last-child { padding-bottom: 12px; }
  .tbl-shell tbody td::before { content: ""; display: inline; margin-right: 7px; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
  .tbl-shell td.kf::before { content: "Keepframe:"; color: var(--accent-ink); }
  .tbl-shell td.other::before { content: "Eightify:"; color: var(--muted); }
  .tbl-shell tbody tr:hover th, .tbl-shell tbody tr:hover td { background: transparent; }
  .tbl-shell tbody tr:hover td.kf { background: transparent; }
}

@media (max-width: 640px) {
  .price-band { grid-template-columns: 1fr; }
  .price-seg + .price-seg { border-left: 0; border-top: 1px solid var(--border); }
}

/* Hero title: stack "Keepframe / VS / Eightify" on small screens */
@media (max-width: 600px) {
  .vs-title { grid-template-columns: 1fr; row-gap: 8px; justify-items: center; }
  .vs-title__name--l, .vs-title__name--r { text-align: center; }
}
