/* keepworthy.photos — the /compare hub and its per-app pages.
   Loaded after site.css, which owns the tokens, type scale, header and footer. */

.cmp { padding: 56px 0 0; }
.cmp .wrap { max-width: 1120px; }

/* ---------- head ---------- */
.cmp-head { max-width: 46rem; }
.cmp-head .d1 { font-size: clamp(2.25rem, 4.8vw, 3.5rem); }
.cmp-head .lede { margin-left: 0; margin-right: 0; max-width: 42rem; }
.cmp-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 28px 0 0; font-size: 14px; color: var(--text-2); }
.cmp-byline .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border); }
.cmp-byline a { color: var(--link); }

/* The standing disclosure. Quiet, but on every page and above the fold. */
.cmp-flag { display: flex; gap: 12px; align-items: flex-start; margin: 32px 0 0; padding: 16px 18px; border-radius: 14px; background: var(--linen); box-shadow: inset 0 0 0 1px rgba(255, 182, 39, .38); font-size: 15px; color: var(--text-2); max-width: 46rem; }
.cmp-flag b { color: var(--text); font-weight: 600; }
.cmp-flag svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--marigold); }

/* ---------- section rhythm ---------- */
.cmp-section { padding-top: 96px; scroll-margin-top: 24px; }
.cmp-section > .d2 { max-width: 22ch; }
.cmp-section > .t1 { margin-bottom: 20px; }
.cmp-section > .lede { margin-left: 0; margin-right: 0; }
.cmp-kicker { font: 600 12px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--persimmon); margin: 0 0 14px; }

/* ---------- the annual-cost range plot (used on /compare/pricing) ----------
   Each row spans the cheapest paid option an app offers to the priciest, over one year.
   `--from` and `--to` are percentages of one shared scale whose 100% is $623.48, the highest figure
   on the chart. A hollow dot marks the cheap end, a filled dot the expensive end, so a single-price
   app resolves to one dot rather than a bar too short to read. */
.bars { --cols: minmax(0, 13rem) minmax(0, 1fr) 7.25rem; --gap: 20px; --ink: #6E625B;
        position: relative; margin: 44px 0 0; }
.bar, .bar-scale { display: grid; grid-template-columns: var(--cols); gap: var(--gap); align-items: center; }
.bar { padding: 9px 10px 9px 0; border-radius: 10px; position: relative; }
.bar:hover { background: var(--surface); }

.bar .who { font-size: 15px; font-weight: 600; line-height: 1.25; text-wrap: balance; }
.bar .who small { display: block; margin-top: 3px; font-weight: 400; font-size: 12.5px; line-height: 1.35; color: var(--text-2); font-variant-numeric: tabular-nums; }

.bar .track { position: relative; height: 22px; }
/* A hairline spine so a short mark still reads as belonging to its row. */
.bar .track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border); transform: translateY(-50%); }

.rng { position: absolute; top: 50%; left: var(--from, 0%); width: calc(var(--to, 0%) - var(--from, 0%));
       height: 5px; transform: translateY(-50%); border-radius: 3px; background: var(--ink); }
.rng::before, .rng::after { content: ""; position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%; transform: translate(-50%, -50%); }
.rng::before { left: 0; background: var(--canvas); box-shadow: inset 0 0 0 2.5px var(--ink); }
.rng::after { left: 100%; background: var(--ink); }
.bar:hover .rng::after { box-shadow: 0 0 0 4px rgba(110, 98, 91, .16); }

.bar .cost { font: 700 15px/1.2 var(--display); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.bar .cost i { font-style: normal; color: var(--text-2); padding: 0 1px; }
.bar .cost small { display: block; margin-top: 2px; font: 400 12px/1 var(--body); color: var(--text-2); }

/* Translucent, so the gridlines run through this row like every other one. */
.bar.is-us { background: rgba(255, 182, 39, .15); --ink: var(--persimmon); }
.bar.is-us .who, .bar.is-us .cost { color: var(--text); }
.bar.is-us:hover .rng::after { box-shadow: 0 0 0 4px rgba(255, 92, 60, .2); }
.bar.is-free { --ink: var(--sage); }

/* Gridlines, drawn behind every row through a copy of the same three-column grid. */
.bar-scale { position: absolute; inset: 0 0 30px; pointer-events: none; }
.bar-scale .track { position: relative; height: 100%; }
.bar-scale .track::before { display: none; }
.bar-scale i { position: absolute; top: 0; bottom: 0; left: var(--at); width: 1px; background: var(--border); }
.axis { padding-top: 6px; }
.axis .track { height: 14px; }
.axis .track::before { display: none; }
.axis i { position: absolute; top: 0; left: var(--at); transform: translateX(-50%); font: 500 11.5px/1 var(--body); font-style: normal; letter-spacing: .02em; color: var(--text-2); font-variant-numeric: tabular-nums; }
.axis i:first-child { transform: none; }
.bars-foot { margin: 22px 0 0; font-size: 14px; color: var(--text-2); max-width: 44rem; }
.bars-foot a { color: var(--link); }

/* ---------- free-tier tiers: what stops you, and whether you can see it coming ---------- */
.tiers { display: grid; gap: 22px; margin: 40px 0 0; }
.tier { border-radius: 20px; padding: 26px 28px 26px; background: var(--surface); border-left: 4px solid var(--border); }
.tier.open { background: var(--linen); border-left-color: var(--sage); }
.tier.posted { border-left-color: var(--marigold); }
.tier.unposted { border-left-color: var(--persimmon); }
.tier h3 { margin: 0; font: 700 21px/1.25 var(--display); letter-spacing: -0.012em; text-wrap: balance; }
.tier > p { margin: 8px 0 0; font-size: 15px; color: var(--text-2); max-width: 46rem; text-wrap: pretty; }
.tier ul { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 0; }
.tier li { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 10px 24px; padding: 13px 0; border-top: 1px solid var(--border); font-size: 15px; color: var(--text-2); text-wrap: pretty; }
.tier.open li { border-top-color: #E8DCC6; }
.tier li b { color: var(--text); font-weight: 600; }
.tier li .app { color: var(--text); font-weight: 600; }
.tier li .app em { display: block; font-style: normal; font-weight: 400; font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

/* ---------- the capability matrix ---------- */
.matrix-wrap { overflow-x: auto; margin: 40px 0 0; -webkit-overflow-scrolling: touch; }
.matrix { border-collapse: collapse; width: 100%; min-width: 860px; font-size: 14px; }
.matrix caption { text-align: left; padding: 0 0 16px; font-size: 14px; color: var(--text-2); max-width: 46rem; }
.matrix th, .matrix td { padding: 12px 10px; text-align: center; border-bottom: 1px solid var(--border); vertical-align: middle; }
.matrix thead th { font: 600 13px/1.25 var(--body); color: var(--text-2); vertical-align: bottom; border-bottom: 2px solid var(--text); padding-bottom: 12px; }
.matrix thead th:first-child { text-align: left; }
.matrix tbody th { text-align: left; font-weight: 600; white-space: nowrap; }
.matrix tbody th small { display: block; font-weight: 400; font-size: 12px; color: var(--text-2); }
.matrix tbody tr.is-us { background: var(--linen); }
.matrix tbody tr.is-us th { border-left: 3px solid var(--marigold); padding-left: 12px; }
.matrix .mk { display: inline-block; font-size: 15px; line-height: 1; }
.matrix .yes { color: var(--sage); font-weight: 700; }
.matrix .part { color: var(--marigold); font-weight: 700; }
.matrix .no { color: #C4BDB4; font-weight: 700; }
.matrix td .note { display: block; margin-top: 3px; font-size: 12px; line-height: 1.3; color: var(--text-2); }
.matrix-key { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 18px 0 0; font-size: 14px; color: var(--text-2); }
.matrix-key span { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- per-app cards on the hub ---------- */
.app-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 40px 0 0; }
.app-card { display: flex; flex-direction: column; gap: 14px; padding: 26px 26px 24px; border-radius: 20px; background: var(--surface); }
.app-card h3 { margin: 0; font: 700 21px/1.2 var(--display); letter-spacing: -0.012em; }
.app-card .meta { margin: -6px 0 0; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.app-card p { margin: 0; font-size: 15px; color: var(--text-2); text-wrap: pretty; }
.app-card .verdict { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); font-size: 15px; }
.app-card .verdict a { color: var(--link); font-weight: 600; }
.app-card dl { margin: 0; display: grid; gap: 10px; }
.app-card dt { font: 600 12px/1 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.app-card dd { margin: 4px 0 0; font-size: 15px; color: var(--text-2); text-wrap: pretty; }
.app-card dd b { color: var(--text); font-weight: 600; }

/* ---------- the "pick this one instead" block ---------- */
.picks { display: grid; gap: 2px; margin: 36px 0 0; border-top: 1px solid var(--border); }
.pick { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: 40px; padding: 22px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.pick .if { font: 600 17px/1.35 var(--display); text-wrap: pretty; }
.pick .then { margin: 0; font-size: 15px; color: var(--text-2); text-wrap: pretty; }
.pick .then b { color: var(--text); font-weight: 600; }

/* ---------- a two-column fact comparison on the spoke pages ---------- */
.versus { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 40px 0 0; border: 1px solid var(--border); border-radius: 20px; overflow: hidden; }
.versus > div { padding: 26px 26px 28px; }
.versus > div + div { border-left: 1px solid var(--border); }
.versus .side-us { background: var(--linen); }
.versus h3 { margin: 0 0 4px; font: 700 19px/1.2 var(--display); }
.versus .price { margin: 0 0 18px; font: 700 15px/1.3 var(--body); font-variant-numeric: tabular-nums; color: var(--persimmon); }
.versus ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 11px; }
.versus li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 11px; font-size: 15px; color: var(--text-2); text-wrap: pretty; }
.versus li b { color: var(--text); font-weight: 600; }
.versus li::before { content: ""; width: 13px; height: 7px; margin-top: 7px; border-left: 2.5px solid var(--sage); border-bottom: 2.5px solid var(--sage); transform: rotate(-45deg); }
.versus li.lacks::before { width: 13px; height: 2.5px; margin-top: 9px; border: 0; background: #C4BDB4; transform: none; }

/* ---------- pull quotes from store reviews ---------- */
.reviews { columns: 2 20rem; column-gap: 22px; margin: 36px 0 0; }
.reviews figure { break-inside: avoid; margin: 0 0 22px; padding: 20px 22px; border-radius: 16px; background: var(--surface); }
.reviews blockquote { margin: 0; font: 500 16px/1.45 var(--display); letter-spacing: -0.004em; text-wrap: pretty; }
.reviews figcaption { margin-top: 12px; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.reviews figcaption b { color: var(--text); font-weight: 600; }

/* ---------- checklist ---------- */
.checklist { margin: 36px 0 0; display: grid; gap: 0; counter-reset: chk; border-top: 1px solid var(--border); }
.checklist > div { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--border); }
.checklist > div::before { counter-increment: chk; content: counter(chk); font: 700 15px/2.25rem var(--display); text-align: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--muted); color: var(--text); }
.checklist h3 { margin: 0 0 6px; font: 700 18px/1.3 var(--display); }
.checklist p { margin: 0; font-size: 15px; color: var(--text-2); max-width: 44rem; text-wrap: pretty; }

/* ---------- sources and disclosure ---------- */
.sources { margin: 32px 0 0; padding: 0 0 0 20px; display: grid; gap: 10px; font-size: 14px; color: var(--text-2); max-width: 50rem; }
.sources li::marker { color: var(--persimmon); }
.sources a { color: var(--link); }
.disclosure { margin: 40px 0 0; padding: 30px 32px; border-radius: 20px; background: var(--surface); max-width: 46rem; }
.disclosure p { margin: 0 0 14px; color: var(--text-2); text-wrap: pretty; }
.disclosure p:last-child { margin-bottom: 0; }
.disclosure b { color: var(--text); font-weight: 600; }
.disclosure a { color: var(--link); }

/* ---------- next / cross links ---------- */
.more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 36px 0 0; }
.more a { display: grid; gap: 6px; padding: 20px 22px; border-radius: 16px; background: var(--surface); text-decoration: none; color: inherit; }
.more a:hover { background: var(--muted); }
.more .t { font: 700 16px/1.3 var(--display); }
.more .s { font-size: 14px; color: var(--text-2); }

/* ---------- closing call to action ---------- */
.cmp-close { margin: 96px 0 0; padding: 56px 32px; border-radius: 24px; background: var(--surface); text-align: center; }
.cmp-close .d2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
.cmp-close .lede { margin-top: 16px; }
.cmp-close .cta { margin-top: 28px; }

@media (max-width: 900px) {
  .app-cards, .versus, .more { grid-template-columns: minmax(0, 1fr); }
  .versus > div + div { border-left: 0; border-top: 1px solid var(--border); }
  .pick { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .cmp-section { padding-top: 72px; }
}
@media (max-width: 680px) {
  /* The label no longer fits beside the plot, so the mark drops to its own full-width row. */
  .bars { --cols: minmax(0, 1fr) auto; --gap: 6px 14px; }
  .bar, .bar-scale { grid-template-columns: var(--cols); }
  .bar { padding: 12px 0; border-radius: 0; border-bottom: 1px solid var(--border); }
  .bar:hover { background: none; }
  .bar .track { grid-column: 1 / -1; order: 3; }
  .bar .cost { align-self: start; }
  .bar .cost small { display: inline; margin-left: 4px; }
  /* Stacked, the plot spans the full width of each row, so a single overlaid scale can no longer
     line up with it. The per-row figures carry the reading instead. */
  .bar-scale, .axis { display: none; }
  .reviews { columns: 1; }
  .cmp-close { padding: 40px 22px; }
}
