/* The pricing page (/pricing), on top of site.css: the hero with the Free
   plan's monthly allowance beside it, and the plan table. Colours, type and
   radii are site.css's tokens. */

/* ---------------------------------------------------------------- hero */

.pr-hero { padding-bottom: clamp(56px, 8vw, 96px); }
.pr-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  gap: 64px;
  align-items: center;
}
.pr-hero .hero-title { margin-top: 20px; }
@media (max-width: 959px) {
  .pr-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .pr-free { max-width: 440px; }
}

/* The Free plan as a month's balance: the same full allowance a new
   workspace sees in its account menu. */
.pr-free {
  padding: 28px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-hero);
  animation: rise-in 760ms var(--ease-out) 320ms both;
  --rise: 20px;
}
@media (prefers-reduced-motion: reduce) {
  .pr-free { --rise: 0px; animation-duration: 300ms; animation-delay: 0ms; }
}
.pr-free-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.pr-free-name { font-size: 15px; line-height: 20px; font-weight: 500; }
.pr-free-price { font-size: 13px; line-height: 18px; color: var(--ink-3); }
.pr-free-amount {
  margin-top: 28px;
  font-size: 72px;
  line-height: 1;
  letter-spacing: -0.05em;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.pr-free-label { margin-top: 8px; font-size: 17px; line-height: 24px; color: var(--ink-2); }
.pr-free-meter {
  margin-top: 24px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
  overflow: hidden;
}
/* Full: none of the month's credits used yet. It fills once, with the
   card. */
.pr-free-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transform-origin: left center;
  animation: pr-fill 900ms var(--ease-out) 640ms both;
}
@keyframes pr-fill { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  .pr-free-meter span { animation: none; }
}
.pr-free-renew { margin-top: 10px; font-size: 13px; line-height: 18px; color: var(--ink-3); }
.pr-free-list {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15px;
  line-height: 22px;
  color: var(--ink-2);
}
.pr-free-list li { display: flex; gap: 10px; }
.pr-free-list svg { width: 16px; height: 16px; margin-top: 3px; fill: var(--green); }
.pr-free-list b { font-weight: 500; color: var(--ink); }

/* ---------------------------------------------------------------- table */

.pr-compare { padding-top: clamp(56px, 7vw, 88px); border-top: 1px solid var(--line); }
.pr-compare-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.pr-compare-head .section-title { margin-top: 0; }
.pr-billing { margin-top: 0; }
.segmented.pr-billing button { display: inline-flex; align-items: center; gap: 8px; }
.segmented.pr-billing button[aria-pressed="true"] {
  background: var(--bg);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-control);
}
.pr-save {
  height: 20px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  background: var(--green-tint);
  color: var(--green-text);
  font-size: 12px;
}
/* The switch needs pricing.js; without it the table shows monthly prices. */
html:not(.js) .pr-billing { display: none; }

.pt-scroll { margin-top: 40px; }
.pt-scroll:focus-visible { outline-offset: 4px; border-radius: var(--radius-sm); }
.pt {
  width: 100%;
  min-width: 680px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 15px;
  line-height: 22px;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--line);
}
.pt .pt-col-label { width: 28%; }
.pt th { font-weight: 400; }

/* Plan headers stay in view under the site header while the rows scroll. */
.pt thead th,
.pt thead td {
  position: sticky;
  top: 64px;
  z-index: 2;
  padding: 0 16px 20px;
  vertical-align: top;
  text-align: right;
  white-space: nowrap;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.pt thead th { border-left: 1px solid var(--line); }
.pt-name {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 20px;
  font-size: 18px;
  line-height: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.pt-tag {
  height: 20px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--on-ink);
  font-size: 11px;
  letter-spacing: 0;
}
.pt-price { display: block; margin-top: 6px; color: var(--ink-2); }
.pt-billed { display: block; font-size: 13px; line-height: 18px; color: var(--ink-3); }
.pt-cta { width: 100%; margin-top: 16px; }

/* A band names each group of rows. */
.pt-section th {
  padding: 14px 20px;
  text-align: left;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
}
.pt tbody + tbody .pt-section th { border-top: 1px solid var(--line); }

.pt tbody tr:not(.pt-section) > * {
  position: relative;
  padding: 18px 16px;
  vertical-align: top;
}
.pt tbody th[scope="row"] { padding-left: 20px; text-align: left; color: var(--ink-2); }
.pt tbody td { text-align: right; color: var(--ink); border-left: 1px solid var(--line); }
.pt-sub { display: block; margin-top: 2px; font-size: 13px; line-height: 18px; color: var(--ink-3); }

/* Dotted rules between rows, inset from the column lines. */
.pt tbody tr:not(.pt-section):not(:last-child) > *::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--ink-5) 0 1px, transparent 1px 5px);
}

/* Row labels start where their text does. */
.pt tbody tr:not(.pt-section):not(:last-child) > th[scope="row"]::after { left: 20px; }

/* The row that matters most: what a plan's price buys. */
.pt-key th[scope="row"] { color: var(--ink); font-weight: 500; }
.pt-key td { font-size: 18px; line-height: 22px; font-weight: 500; letter-spacing: -0.01em; }

.pt-checks td svg { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; fill: var(--ink); }
.pt-checks td svg:has(use[href="#i-minus"]) { fill: var(--ink-5); }

/* Business and Enterprise, under the table. */
.pr-more { margin-top: 48px; }
.pr-more-title { font-size: 20px; line-height: 28px; font-weight: 500; letter-spacing: -0.01em; }
.pr-more-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.pr-more-plan {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.pr-more-plan + .pr-more-plan { border-left: 1px solid var(--line); }
.pr-more-head {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.pr-more-head h4 { margin: 0; font-size: 18px; line-height: 24px; font-weight: 500; letter-spacing: -0.01em; }
.pr-more-price { text-align: right; color: var(--ink-2); font-size: 15px; line-height: 22px; }
.pr-more-billed { display: block; font-size: 13px; line-height: 18px; color: var(--ink-3); }
.pr-more-plan > p { max-width: 52ch; font-size: 15px; line-height: 22px; color: var(--ink-3); }
.pr-more-plan .btn { margin-top: auto; }
@media (max-width: 767px) {
  .pr-more-grid { grid-template-columns: minmax(0, 1fr); }
  .pr-more-plan + .pr-more-plan { border-left: 0; border-top: 1px solid var(--line); }
}

.pr-footnote {
  margin-top: 24px;
  max-width: 760px;
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-3);
}
.pr-footnote a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Narrower than the table: it scrolls sideways with the row labels held in
   place. A scroll container would also hold the sticky headers, so they
   only stick on wider screens. */
@media (max-width: 767px) {
  .pt-scroll {
    overflow-x: auto;
    margin-left: calc(var(--gutter) * -1);
    margin-right: calc(var(--gutter) * -1);
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    overscroll-behavior-x: contain;
  }
  .pt { min-width: 720px; }
  .pt .pt-col-label { width: 160px; }
  .pt thead th { position: static; }
  .pt thead td, .pt tbody th[scope="row"] {
    position: sticky;
    top: auto;
    /* Sticky offsets count from inside the scroller's padding. */
    left: calc(var(--gutter) * -1);
    z-index: 1;
    background: var(--bg);
    box-shadow: inset -1px 0 0 var(--line);
  }
  /* The band spans the table; its title stays at the left edge. */
  .pt-section th > span { position: sticky; left: calc(20px - var(--gutter)); }
}
@media (max-width: 639px) {
  .pt { font-size: 14px; }
  .pt .pt-col-label { width: 150px; }
  .pt { min-width: 700px; }
  .pt thead th, .pt thead td { padding-left: 14px; padding-right: 14px; }
  .pt tbody tr:not(.pt-section) > * { padding: 16px 14px; }
  .pt tbody tr:not(.pt-section):not(:last-child) > *::after { left: 14px; right: 14px; }
  .pt tbody tr:not(.pt-section):not(:last-child) > th[scope="row"]::after { left: 14px; }
  .pt-section th { padding-left: 14px; }
  .pt-section th > span { left: calc(14px - var(--gutter)); }
  .pr-free-amount { font-size: 60px; }
}

