/* Pricing page only (src/pricing.html). Tokens for every colour. Mobile first. */

/* ---------------------------------------------------------------- the two plan cards */
.plans { display: grid; gap: var(--s-5); align-items: stretch; }

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.plan--recommended { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan__badge {
  position: absolute;
  top: 0;
  left: var(--s-5);
  transform: translateY(-50%);
  margin: 0;
  background-clip: padding-box;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent);
  font-size: var(--fs--1);
  font-weight: 600;
  line-height: 1.5;
}
.plan__name { margin: 0; font-size: 1.5rem; font-weight: 600; line-height: 1.25; }
.plan__for { margin: 0; color: var(--ink-2); }
.plan__ideal {
  justify-self: start;
  align-self: start;
  margin: 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
}
.plan__ideal:empty { display: none; }
.plan__price { margin: var(--s-2) 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s-2); }
.plan__from { color: var(--muted); font-size: var(--fs--1); }
.plan__amount { font-size: 2.5rem; font-weight: 600; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.plan__period { color: var(--muted); font-size: var(--fs--1); }
.plan__terms { margin: 0; color: var(--muted); font-size: var(--fs--1); }
.plan__list { list-style: none; margin: 0; padding: var(--s-4) 0 0; border-top: 1px solid var(--line); display: grid; gap: var(--s-3); }
.plan__list li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: var(--s-2); align-items: start; }
.plan__list .icon { margin-top: 4px; color: var(--live-fg); }
.plan__cta { margin: 0; }
.plan__cta .btn { width: 100%; justify-content: center; }

@media (min-width: 720px) {
  /* Two across while there is only room for two: at this width three cards would each be too narrow
     for a bullet to sit on one line. */
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); }
  .plan { padding: var(--s-6); }
  .plan__badge { left: var(--s-6); }
}

@media (min-width: 1040px) {
  /* All three side by side, which is the only arrangement that lets somebody compare them at a glance -
     and it fills the row rather than leaving a third of it empty. */
  .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); }
  /* Wider than the text column, as the founder asked: the cards take the page's full 1280 measure
     rather than the 1120 a paragraph needs. Centred on the column, so they never pass the gutter. */
  .plans { width: min(1280px, calc(100vw - 2 * var(--gutter))); margin-inline: calc((100% - min(1280px, calc(100vw - 2 * var(--gutter)))) / 2); }
  /* The seven parts of every card share seven rows, so the prices, the buttons and the lists line up. */
  .plans { grid-template-rows: repeat(7, auto); row-gap: 0; }
  .plan { display: grid; grid-row: span 7; grid-template-rows: subgrid; row-gap: var(--s-3); }
}

.pricing-notes { list-style: none; margin: var(--s-5) 0 0; padding: 0; display: grid; gap: var(--s-1); color: var(--ink-2); }
.pricing-notes li { padding-left: var(--s-4); position: relative; }
.pricing-notes li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.pricing-start { margin: var(--s-4) 0 0; color: var(--muted); max-width: 46rem; }
.pricing-key { margin-top: var(--s-5); color: var(--muted); }
.pricing-key p { margin: 0 0 var(--s-3); }
.pricing-cta { margin: 0; }

/* ---------------------------------------------------------------- the comparison table */
.cmp-wrap { width: 100%; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.cmp { width: 100%; border-collapse: collapse; }
.cmp caption { text-align: left; }
.cmp th, .cmp td { padding: var(--s-3) var(--s-4); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.cmp tbody tr:last-child > * { border-bottom: 0; }
.cmp thead th { background: var(--surface-2); font-weight: 600; vertical-align: bottom; }
.cmp__plan { display: block; font-size: var(--fs-0); color: var(--ink); }
.cmp__plan-price { display: block; color: var(--muted); font-size: var(--fs--1); font-weight: 400; font-variant-numeric: tabular-nums; }
.cmp tbody th[scope="row"] { font-weight: 500; }
.cmp__name { margin-right: var(--s-2); }
.cmp th .chip { vertical-align: middle; white-space: nowrap; }
.cmp__grouprow th { background: var(--accent-soft); color: var(--ink); font-size: var(--fs-2); font-weight: 600; }
.cmp__lede { display: block; margin-top: 2px; color: var(--ink-2); font-size: var(--fs--1); font-weight: 400; }

.cmp__yes { display: inline-flex; align-items: center; color: var(--live-fg); }
.cmp__soon { display: inline-flex; align-items: center; gap: 6px; color: var(--built-fg); font-weight: 600; }
.cmp__addon { display: inline-block; padding: 1px 10px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink-2); font-size: var(--fs--1); }
.cmp__no { color: var(--muted); }
.cmp td .icon { flex: none; }

/* Wide: a real table with the plans as columns. */
@media (min-width: 720px) {
  .cmp thead th:not(:first-child), .cmp td { width: 22%; text-align: center; }
  .cmp thead th:not(:first-child) { text-align: center; }
  .cmp__no-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .cmp__yes, .cmp__soon { justify-content: center; }
  .cmp .icon--tick { width: 20px; height: 20px; }
}

/* Narrow: each row becomes a small card, with the plan names repeated in it. No sideways scrolling. */
@media (max-width: 719.98px) {
  .cmp, .cmp tbody, .cmp tr, .cmp th, .cmp td { display: block; }
  .cmp thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .cmp tbody tr:not(.cmp__grouprow) { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); }
  .cmp tbody tr:last-child { border-bottom: 0; }
  .cmp th, .cmp td { padding: 0; border: 0; }
  .cmp__grouprow th { padding: var(--s-3) var(--s-4); }
  .cmp tbody th[scope="row"] { margin-bottom: var(--s-2); }
  .cmp td { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 6px 0; }
  .cmp td + td { border-top: 1px dashed var(--line); }
  .cmp td::before { content: attr(data-label); color: var(--ink-2); font-size: var(--fs--1); }
}

@media (forced-colors: active) {
  .plan--recommended { border-width: 2px; }
}
