/* ═══════════════════════════════════════════════════════════ pricing ══
   Three plans (Pricing.razor). The ruled band, the window that hangs over
   it, the closing band and the footer are the front page's own, from
   home.css; this sheet only lays out what is in them, and
   compare.css the table. No new colours: teal only on the sample's rising
   number and its line, because it means grew and nothing else.

   ONE PICKER, three radios in .switch, drives the page through :has(); no
   script is needed. It sits over the plans and the sample and stays on
   screen through both, so a pick changes what is under it, never something
   a scroll away. It lights the picked card and the table's column, a phone
   shows the picked card alone, and the sample bars out the figures the
   plan lacks. Barred, not folded or blurred: a fold showed nothing to
   want, and a blur read as a broken screen. Without :has() every card
   shows and nothing is barred (visible by default, docs/design/README.md). */

/* Not built yet: said once over its own list in soft ink, with a hollow ring where a built line
   has a tick. Grey, never an accent. The table's tag is compare.css's. */
.soon-h { margin-top: 1.4rem; font-size: var(--t-micro); font-weight: 600; color: var(--ink-soft); }
.plan-soon { color: var(--ink-soft); }

/* ── head: the front page's band, the words given its whole width ── */
.pr-hero .hero-in { grid-template-columns: minmax(0, 1fr); }
.pr-hero h1 { max-width: none; }
.pr-hero .hero-lead { max-width: 62ch; }
/* The band's entrance (home.css's .rise). */
.pr-hero .hero-copy > h1 { --d: 40ms; }
.pr-hero .hero-copy > .hero-lead { --d: 120ms; }
.pr-hero .hero-copy > .hero-fine { --d: 260ms; }

@media (max-width: 40rem) {
  .pr-hero h1 br { display: none; }
}

/* ── the picker: on the band's lower edge, then at the top of the screen ── */
/* The band grows by the picker's room, so the window under it still hangs over the edge by --hang.
   Only that hang reads it: a picker taller than this, its prices wrapped on a narrow phone or the
   text enlarged, just hangs the window a little less. */
.pricing { --pick-room: 5rem; }
.pr-hero { padding-bottom: calc(var(--hang) + var(--pick-room)); }
.plans-area { position: relative; z-index: 1; margin-top: calc(-1 * (var(--hang) + var(--pick-room))); }
.plans-area .board-wrap { margin-top: 0; }

/* Sticky inside .plans-area, so it lets go with the sample, before the table and its own head. Flush
   under the header where that sticks (header.css's --topbar-h, 0 on a phone), so nothing scrolling
   under it shows above it. */
.pick { position: sticky; top: var(--topbar-h); z-index: 2; margin-bottom: 1rem; }

/* A link or button reached with Tab stops below the picker, never under it (WCAG 2.4.11). The
   page's scroll padding adds the header above it (header.css). */
.plans-area :is(.board, .sample) :is(a, button) { scroll-margin-top: calc(var(--pick-room) + .5rem); }

/* Square-shouldered, like the buttons (site.css). Each plan says its price, so all three show at once. */
.switch {
  display: flex;
  gap: 2px;
  width: min(100%, 32rem);
  min-inline-size: 0;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-sm);
  background: var(--card);
  box-shadow: 0 10px 24px -12px var(--shadow);
}
.switch label { position: relative; flex: 1 1 0; min-width: 0; cursor: pointer; }
.switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.switch span {
  display: grid;
  gap: 1px;
  padding: .5rem .75rem;
  border-radius: 4px;
  text-align: center;
  line-height: 1.3;
  color: var(--ink-soft);
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.switch b { font-size: 1rem; font-weight: 650; }
.switch small { font-size: var(--t-micro); }
.switch input:not(:checked) + span b,
.switch label:hover input:not(:checked) + span { color: var(--ink); }
.switch input:checked + span { background: var(--ink); color: var(--paper); }
.switch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ── plans: the window's columns ── */
.plan-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }

.plan {
  display: flex;
  flex-direction: column;
  padding: 2.25rem 2rem;
  transition: background-color .2s var(--ease);
}
.plan + .plan { border-left: 1px solid var(--line); }

@media (min-width: 62.0625rem) {
  /* Side by side, the picked card is lit like its column in the table. */
  .pricing:has(#show-free:checked) .plan-free,
  .pricing:has(#show-scout:checked) .plan-scout,
  .pricing:has(#show-pro:checked) .plan-pro { background: var(--tint); }

  /* The window slides over the picker: all three cards show, so there is nothing to pick until
     the sample. Focused, the picker comes back on top, so a Tab into it is never hidden. */
  .pick { z-index: 1; }
  .plans-area .board-wrap { z-index: 2; }
  .pick:focus-within { z-index: 3; }
}

.plan h2,
.plan-biz h2 { font-size: 1.75rem; font-weight: 650; letter-spacing: -.025em; }
.plan-blurb { margin-top: .6rem; min-height: 3.2em; max-width: 32ch; color: var(--ink-soft); }

.plan-price {
  display: flex;
  align-items: baseline;
  gap: .45rem;
  margin-top: 1.75rem;
  font-size: 1.35rem;
  font-weight: 650;
}
.plan-price b { font-size: 4rem; font-weight: 650; letter-spacing: -.045em; line-height: .9; font-variant-numeric: tabular-nums; }
.plan-price span { font-family: var(--body); font-size: var(--t-small); font-weight: 400; color: var(--ink-soft); }
.plan-note { margin-top: .6rem; font-size: .8rem; color: var(--ink-faint); }

/* One is filled: the plan the page opens on (Pricing.razor). */
.plan-cta { margin-top: 1.6rem; width: 100%; }

/* Said once a paid plan was asked for: dashed, so it reads as done rather than as a button. */
.btn.soon-cta {
  border-style: dashed;
  border-color: var(--stroke-hi);
  background: none;
  color: var(--ink-soft);
  opacity: 1;
}

.plan-lead,
.plan-cta + .plan-list {
  margin-top: 1.75rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--stroke);
}
.plan-lead { font-size: var(--t-small); font-weight: 600; }

.plan-list { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .7rem; font-size: .94rem; line-height: 1.45; }
.plan-list li { position: relative; padding-left: 1.6rem; }

/* One tick for the plan lists and the table (compare.css). */
.plan-list li::before,
.cmp .yes {
  content: "";
  width: .6rem;
  height: .32rem;
  border-left: 1.6px solid var(--ink-soft);
  border-bottom: 1.6px solid var(--ink-soft);
  transform: rotate(-45deg);
}
.plan-list li::before { position: absolute; left: .15rem; top: .4em; }

/* The hollow ring, after the tick so it wins. */
.plan-soon li::before,
.spec-soon li::before {
  content: "";
  position: absolute;
  left: .15rem;
  top: .4em;
  width: .5rem;
  height: .5rem;
  border: 1.6px solid var(--ink-soft);
  border-radius: 50%;
  transform: none;
}
.plan .soon-h + .plan-list { margin-top: .6rem; }

/* ── one real product, three plans ── */
.sample {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
  padding-top: var(--bay-lg);
}

.sample-copy { display: grid; gap: 1.25rem; }
.sample-copy h2 { font-size: var(--t-h2); }
.sample-copy p { max-width: 40ch; font-size: var(--t-lead); color: var(--ink-soft); text-wrap: pretty; }

/* A plan a line under the lead: its name and tag in ink, what it unlocks in soft ink. */
.sample-plans { display: grid; gap: 1.1rem; max-width: 44ch; margin: .5rem 0 0; }
.sample-plans dt { font-weight: 600; }
.sample-plans dd { margin: .25rem 0 0; color: var(--ink-soft); text-wrap: pretty; }

.specimen { overflow: hidden; }
.spec-head { padding: 1.6rem 1.75rem 1.4rem; }
.spec-kicker { font-size: var(--t-small); color: var(--ink-faint); }
.spec-head h3 { margin-top: .3rem; font-family: var(--display); font-size: var(--t-h3); }
.spec-head a { color: var(--ink); text-decoration: none; }
.spec-head a:hover { text-decoration: underline; text-underline-offset: 4px; }

.layer { padding: 1.5rem 1.75rem 1.6rem; border-top: 1px solid var(--stroke); }
/* As tall as the label that takes the tag's place, so a pick moves nothing. */
.layer-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 2rem; margin-bottom: 1.1rem; }
.layer-top h4 { margin: 0; font-size: var(--t-body); font-weight: 600; }
.tag { display: var(--tag); padding: .05rem .6rem; border: 1px solid var(--stroke-hi); border-radius: var(--r-sm); font-size: var(--t-micro); color: var(--ink-soft); white-space: nowrap; }

/* What the picked plan lacks keeps its shape: the labels stay and each figure is a bar, so a
   reader sees what there is to know and not the answer. One rule says which layers; the rest read
   what it sets. Hidden, not painted over, so a screen reader skips the figures too. Nothing
   changes height, so nothing scrolls away on a pick. */
.layer { --tag: inline-block; --unlock: none; --fig: visible; --bar: none; }
.pricing:has(#show-free:checked) .layer-scout,
.pricing:has(#show-free:checked, #show-scout:checked) .layer-pro { --tag: none; --unlock: inline-flex; --fig: hidden; --bar: block; }

.layer-body :is(.sat-stat dd, .spec-verdict) { position: relative; }
.layer-body :is(.sat-stat dd, .spec-verdict) > * { visibility: var(--fig); }
.layer-body :is(.sat-stat dd, .spec-verdict)::before,
.layer-body .sat-stat dd:has(span)::after {
  content: "";
  display: var(--bar);
  position: absolute;
  left: 0;
  border-radius: 4px;
  background: var(--stroke-hi);
}
.layer-body .sat-stat dd::before { top: 0; width: 4.5rem; height: 2rem; }
.layer-body .sat-stat dd:has(span)::after { bottom: .15rem; width: min(100%, 9rem); height: .7rem; }
.layer-body .spec-verdict::before { top: .2rem; bottom: .2rem; width: min(100%, 22rem); }

/* The tag's place, while its layer is barred: picks the plan that shows it. */
.tag.unlock {
  display: var(--unlock);
  align-items: center;
  gap: .4rem;
  padding: .3rem .7rem;
  border-color: var(--ink);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
.tag.unlock:hover { background: var(--tint); }

/* The caption beside its number, not pushed to the far edge as on a tile. */
.specimen .chart-row { justify-content: flex-start; gap: .9rem; }
.specimen .now { font-size: 2.6rem; }
.specimen .now.up { color: var(--grow); }
.specimen .sat-stats { margin-bottom: 0; }

/* The money under the adverts: the price as a figure, the answer as its sentence. */
.spec-money { margin-top: 1.5rem; }
/* product.css pulls a note up under the figures it qualifies; this one is its own answer. */
.specimen .spec-money + .spec-verdict { margin: .9rem 0 0; }
.spec-verdict .answer-figure { color: var(--ink); font-weight: 650; }

.layer .soon-h { margin-top: 1.1rem; }
.layer-body > .soon-h:first-child { margin-top: 0; }
.spec-soon { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .55rem; font-size: var(--t-small); color: var(--ink-soft); }
.spec-soon li { position: relative; padding-left: 1.6rem; }

/* ── Business: name, what it adds, one button, between two rules ── */
/* Room under it too: the closing band follows, with no section between to give it. */
.biz { padding-block: var(--bay-lg); }
.plan-biz {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr) auto;
  align-items: center;
  gap: 1.5rem clamp(2rem, 5vw, 4rem);
  padding-block: 2rem;
  border-block: 1px solid var(--line);
}
.plan-biz .plan-blurb { min-height: 0; }
.plan-biz .plan-list { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }

/* Stacked, the window shows the picked plan alone, so comparing two never means scrolling between
   them; the picker above says every price. Without :has() all three stack, with a rule between. */
@media (max-width: 62rem) {
  .plan-row { grid-template-columns: minmax(0, 1fr); }
  .plan + .plan { border-left: 0; border-top: 1px solid var(--line); }
  .plan-blurb { min-height: 0; }
  .plan-biz { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .plan-biz .btn { justify-self: start; }
  .sample { grid-template-columns: minmax(0, 1fr); }

  /* The three share one cell, so the window is the tallest card's height and a pick made from the
     sample, the card above out of sight, moves nothing; Safari has no scroll anchoring to hide a
     card that grew. Their Coming soon lists go, which evens the three out (483px each, not up to
     665), and the table right under them tags the same rows. The old card goes at once and only
     the new one fades in, so two never show over each other. */
  @supports selector(:has(*)) {
    .plan-row { grid-template-areas: "plan"; }
    .plan { grid-area: plan; transition: opacity .2s var(--ease); }
    .plan + .plan { border-top: 0; }
    .plan .soon-h, .plan-soon { display: none; }
    .pricing:has(#show-free:checked) .plan:not(.plan-free),
    .pricing:has(#show-scout:checked) .plan:not(.plan-scout),
    .pricing:has(#show-pro:checked) .plan:not(.plan-pro) { visibility: hidden; opacity: 0; transition: none; }
  }
}

@media (max-width: 40rem) {
  .plan { padding: 1.5rem 1.25rem; }
  .plan-biz .plan-list { grid-template-columns: minmax(0, 1fr); }
  .spec-head, .layer { padding-inline: 1.25rem; }
  .switch span { padding-inline: .25rem; }
}
