/* The pages beside the home page: pricing, business and the policies. Loaded after style.css,
   which holds the tokens, the type, the top bar, buttons, sections, cells, charts, the tiers
   and the footer. This file holds what only these pages need. */

/* A short page still ends with its footer at the foot of the window. */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
main { flex: 1 0 auto; }

/* 44 px to touch: the links in the top bar. */
.topnav a:not(.nav-cta) { padding-block: 0.9rem; }

/* The top of a page: what it is for, in a headline and one paragraph. */
.page-head { padding-block: clamp(2rem, 4.6vw, 3.6rem) clamp(2.6rem, 5vw, 4rem); }
.page-head h1 { max-width: 18ch; font-size: clamp(2.1rem, 5.2vw, 4.4rem); line-height: 1; letter-spacing: -0.04em; }
.page-head .lede { max-width: 42rem; margin-top: 1.4rem; }

/* Pricing: the three tiers, with everything a tier includes written out. */
.tiers-sec { padding-bottom: var(--sec-pad); }
.tier-price .price { margin-top: 1.2rem; }
.price-unset { margin-top: 1.2rem; font: 400 0.92rem/1.5 var(--mono); color: var(--ink); }
.tier-body { margin-top: 0.3rem; }

/* What you can do about a tier: install it, buy it, or leave an address. Polar's back button
   returns to Pro's, which lands in the middle of the window so its line about the charge is seen. */
#buy-pro { scroll-margin-top: 45vh; }
.buy-say { font-size: 0.93rem; line-height: 1.5; color: var(--ink); }
.buy-say:empty { display: none; }
.buy.done .buy-say { position: relative; padding-left: 1.2rem; }
.buy.done .buy-say::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 8px; height: 8px; border-radius: 2px; background: var(--violet); }

/* The address field: a box with its button inside, like a command and its Copy. */
.wl { display: grid; gap: 0.4rem; width: 100%; max-width: 26rem; }
.wl label { font: 400 0.8rem/1.4 var(--mono); color: var(--ink-2); }
.wl-row {
  display: flex; align-items: center; min-height: 52px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
  transition: border-color 0.2s var(--out);
}
.wl-row:has(input:focus-visible) { outline: 2px solid var(--violet-ink); outline-offset: 3px; }
.wl-row:has([aria-invalid="true"]) { border-color: var(--st-amber); }
.wl input {
  flex: 1; min-width: 0; align-self: stretch; padding: 0 0.6rem 0 1rem;
  background: none; border: 0; outline: 0; color: var(--ink); font: 400 1rem/1.2 var(--sans);
}
.wl input::placeholder { color: var(--ink-2); opacity: 1; }
.wl input:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 100px var(--surface) inset; caret-color: var(--violet-ink); }
.wl-send {
  position: relative; flex: none; min-height: 38px; margin-right: 6px; padding: 0 0.95rem;
  background: var(--violet); color: var(--ink); border: 0; border-radius: 999px;
  font: 400 0.84rem/1 var(--mono); white-space: nowrap; cursor: pointer;
  transition: scale 0.35s var(--spring), background 0.2s var(--out);
}
.wl-send::after { content: ""; position: absolute; inset: -6px -4px; }  /* a 44 px touch target */
.wl-send:hover { background: #6346d4; }
.wl-send:active { scale: 0.965; }
.wl-send:disabled, .wl-send:disabled:hover { background: var(--surface-hi); color: var(--ink-2); cursor: default; scale: 1; }
.wl-terms { font-size: 0.86rem; line-height: 1.45; color: var(--ink-2); }
/* What went wrong takes the place of the line under the field. */
.buy:has(.buy-say:not(:empty)) .wl-terms { display: none; }

/* Pro's two periods. What a year at once saves is said under the yearly price, with the mark a
   winning row carries; under the monthly price the same line is the way over to yearly. */
.price-save { position: relative; flex-basis: 100%; font: 400 0.8rem/1.4 var(--mono); color: var(--ink); }
span.price-save { padding-left: 1.05rem; }
span.price-save::before { content: ""; position: absolute; left: 0; top: 0.36em; width: 8px; height: 8px; border-radius: 2px; background: var(--violet); }
label.price-save { color: var(--ink-2); cursor: pointer; }
label.price-save::after { content: ""; position: absolute; inset: -13px 0; }  /* a 44 px touch target */
label.price-save .go { color: var(--violet-ink); text-decoration: underline 1px; text-underline-offset: 0.2em; transition: color 0.2s var(--out); }
label.price-save:hover .go { color: var(--ink); }

/* Checkout. Polar's script puts its checkout in a frame over the page and styles that frame
   itself. This layer sits under the frame: the ground, the mark where the top bar has it, the
   hand-off to Polar while the frame loads, and three lines that hold while it is open. */
.pay {
  position: fixed; inset: 0; z-index: 2147483646; display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background: rgb(11 11 11 / 0.95); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  outline: 0; overflow: hidden;
}
.pay > .wrap { width: 100%; }
.pay-top { padding-block: 1.1rem 0.4rem; }
.pay-mid { align-self: center; justify-self: center; width: min(23rem, 100% - 2 * var(--gutter)); padding-bottom: 8vh; transition: opacity 0.25s var(--out), visibility 0s 0.25s; }
.pay-hop { --pill: 44px; display: flex; align-items: center; }
.pay-hop .from { padding-left: 0.4rem; background: var(--violet-deep); border-color: var(--violet); }
.pay-wire { position: relative; flex: 1; min-width: 3rem; height: 1px; background: var(--line); }
.pay-wire::before { content: ""; position: absolute; inset: -0.5px 0; background: var(--violet); transform-origin: 0 50%; }
.pay-wire i { position: absolute; left: 0; top: -4px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--ink); opacity: 0; }
.pay-hop .to { border-color: var(--violet); }
.pay-say { margin-top: 1.5rem; font: 700 1.5rem/1.2 var(--mono); letter-spacing: -0.03em; color: var(--ink); }
.pay-sub { margin-top: 0.55rem; font-size: 0.98rem; line-height: 1.55; }
/* The three lines stand in the margin left of Polar's checkout, which is 512 px wide and centered. */
.pay-notes {
  display: none; list-style: none; margin: 0; padding: 0 0 40px;
  width: min(20rem, calc(min(50vw - 256px, 404px) - var(--gutter) - 2.5rem));
  font-size: 0.9rem; line-height: 22px;   /* whole pixels, so each hairline lands on one row */
}
.pay-notes li { padding: 12px 0 13px; }
/* Once Polar's checkout is up it covers the middle of the window, and all of a narrow one. */
.pay.open .pay-mid { opacity: 0; visibility: hidden; }
.pay.open .pay-top { visibility: hidden; }
@media (min-width: 1280px) and (min-height: 620px) {
  .pay-notes { display: block; }
  .pay.open .pay-top { visibility: visible; }
}
/* Polar's script gives its frame a half-black wash and adds a loader of its own. The layer above
   is the backdrop and the loader, so both are turned off here; the page stops scrolling under it. */
body > iframe[src*="embed=true"] { background-color: transparent !important; }
/* The frame stays out of sight until Polar's checkout says it has loaded. A frame that fails
   draws the browser's own error page, which must never show over this one. */
body > iframe[src*="embed=true"]:not(.in) { opacity: 0; pointer-events: none; }
html.anim body > iframe.in[src*="embed=true"] { transition: opacity 0.25s var(--out); }
body > div > .polar-loader-spinner { display: none; }
body.polar-no-scroll { overflow: hidden; }
/* The wire to Polar draws once, then a dot keeps crossing it for as long as the frame is loading. */
html.anim .pay:not(.go) .pay-wire::before { scale: 0 1; }
html.anim .pay.go .pay-wire::before { scale: 1 1; transition: scale 0.7s var(--out); }
html.anim .pay:not(.go) .pay-hop .to { border-color: var(--line); }
html.anim .pay.go .pay-hop .to { transition: border-color 0.3s var(--out) 0.5s; }
html.anim .pay.go:not(.open) .pay-wire i { animation: cross 1.5s var(--io) 0.8s infinite; }
@keyframes cross {
  0% { left: 0; opacity: 0; }
  12%, 82% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* Welcome: where Polar sends a buyer back. What was paid for, then the two things left to do. */
.paid { position: relative; margin-top: 1.5rem; padding-left: 1.3rem; font: 400 0.92rem/1.5 var(--mono); color: var(--ink); }
.paid::before { content: ""; position: absolute; left: 0; top: 0.38em; width: 10px; height: 10px; border-radius: 2px; background: var(--violet); }
.todo-sec { padding-bottom: var(--sec-pad); }
.todo { counter-reset: todo; }
.todo .cell { counter-increment: todo; }
.todo h2 { display: flex; align-items: baseline; gap: 0.9rem; font-size: 1.5rem; line-height: 1.25; letter-spacing: -0.03em; }
.todo h2::before { content: counter(todo); flex: none; color: var(--ink-2); }
.todo .cell > p { max-width: 34rem; }
.acts { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.3rem; }
.todo .cell > .acts { margin-top: 1.3rem; }
.todo .cmd { max-width: 26rem; }
.todo .hint { font-size: 0.9rem; color: var(--ink-2); }
.after-pay { margin-top: clamp(2.6rem, 5vw, 4rem); }
.page-head .acts { margin-top: 1.6rem; }

/* What one rule is worth: the mean run without it, struck through, and the mean run with it. */
.worth figcaption h3 { font-size: 1.14rem; }
.was { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.8rem clamp(1.6rem, 4vw, 3rem); }
.was .fig { flex: none; }
.was .fig b { font-size: clamp(2.6rem, 4.4vw, 3.4rem); line-height: 0.9; }
.was .fig:not(.to) b { color: var(--ink-2); text-decoration: line-through 2px var(--bar); }

/* Business: who pays what, three bills side by side, and the three steps to a team. */
.bills { display: grid; gap: 0 clamp(28px, 4vw, 64px); margin: 0; }
.bills div { padding: 1.5rem 0 1.4rem; }
.bills dt { font: 700 1.14rem/1.3 var(--mono); letter-spacing: -0.015em; color: var(--ink); }
.bills dt .tag { display: block; margin-bottom: 0.9rem; letter-spacing: 0; }
.bills dt b { margin-right: 0.35rem; font: 700 2.9rem/1 var(--mono); letter-spacing: -0.04em; color: var(--ink); }
.bills dt b small { margin-right: 0.08em; font-size: 0.5em; font-weight: 400; color: var(--ink-2); }
.bills dt:has(b) { font-weight: 400; font-size: 0.9rem; color: var(--ink-body); }
.bills dd { max-width: 26rem; margin: 0.7rem 0 0; }
.steps.start li { align-content: start; }
.steps.start .cmd pre { font-size: 0.8rem; }

/* The reading layout, for the policies: a short table of contents beside one measure of text. */
.doc-head { padding-block: clamp(2rem, 4.6vw, 3.6rem) 0; }
.doc-head h1 { max-width: 22ch; font-size: clamp(1.9rem, 3.1vw + 0.95rem, 3.1rem); line-height: 1.06; }
.doc-head .lede { max-width: 68ch; margin-top: 1.25rem; font-size: 1.1rem; line-height: 1.58; }
.doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; margin-top: 1.3rem; font: 400 0.8rem/1.5 var(--mono); color: var(--ink-2); }
.doc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.2rem clamp(48px, 5.5vw, 96px); padding-block: clamp(2.2rem, 4.5vw, 3.4rem) var(--sec-pad); }
.toc { align-self: start; padding-top: 1.1rem; font: 400 0.84rem/1.35 var(--mono); }
.toc-h { font: 400 0.8rem/1.4 var(--mono); letter-spacing: 0; color: var(--ink-2); }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc > ol { margin-top: 0.3rem; }
.toc ol ol { display: none; padding-left: 1rem; }
.toc a { display: block; padding: 0.82rem 0; color: var(--ink-body); text-decoration: none; }
.toc a:hover { color: var(--ink); }
.prose { max-width: 68ch; }
.prose > * + * { margin-top: var(--flow); }
.prose h2 { padding-top: 1.5rem; font-size: 1.6rem; line-height: 1.15; letter-spacing: -0.03em; scroll-margin-top: 24px; }
.prose > h2:not(:first-child) { margin-top: 3.4rem; }
.prose h2 + * { margin-top: 1.1rem; }
.prose h3 { margin-top: 2.2rem; scroll-margin-top: 24px; }
.prose h3 + * { margin-top: 0.6rem; }
.prose ul { padding-left: 1.2rem; }
.prose li + li { margin-top: 0.35rem; }
.prose li::marker { color: var(--ink-2); }
/* A run-in heading inside a paragraph. The page carries one weight of the text face, so it is set apart by its ink. */
.prose strong { font-weight: 400; color: var(--ink); }
/* The commitments: numbered, because the policy is cited by number. */
.prose .vows { list-style: none; padding: 0; counter-reset: vow; }
.vows li { counter-increment: vow; position: relative; padding: 0.9rem 0 0.95rem 2.6rem; color: var(--ink); font-size: 1.08rem; line-height: 1.5; }
.vows li + li { margin-top: 0; }
.vows li::after { content: counter(vow); position: absolute; left: 0; top: 0.8rem; font: 700 1.25rem/1.4 var(--mono); color: var(--ink); }
.vows code { white-space: nowrap; }
/* Policy text: an ordered list that is not the commitments, a sample record and the table of data. */
.prose ol:not(.vows) { padding-left: 1.4rem; }
.prose .sample { max-width: 100%; padding: 0.9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; overflow-x: auto; font-size: 0.84rem; line-height: 1.6; color: var(--ink); }
.prose .sample code { overflow-wrap: normal; }
.prose a { overflow-wrap: anywhere; }
/* The table of data in a policy: one card to a row on a phone, a table from 720 px up. */
.doc .tbl { max-width: none; margin-top: var(--flow); }
.doc .tbl table { font-size: 0.95rem; font-variant-numeric: normal; }
.doc .tbl tbody th { color: var(--ink); }
.doc .tbl td { display: block; padding: 0.5rem 0 0; }
.doc .tbl td::before { content: attr(data-label); display: block; font: 400 0.8rem/1.4 var(--mono); color: var(--ink-2); }
.notice { max-width: 68ch; padding: 1rem 1.2rem; border: 1px dashed var(--ink-2); border-radius: 4px; color: var(--ink); }
.return { display: inline-block; margin-top: 1rem; padding-block: 0.9rem; font: 400 0.92rem/1 var(--mono); }

@media (max-width: 480px) {
  .vows li { padding-left: 2.2rem; font-size: 1.02rem; }
}

@media (min-width: 720px) {
  .doc .tbl td { display: table-cell; padding: 0.8rem 0.9rem 0.85rem 0; }
  .doc .tbl td::before { content: none; }
}

@media (min-width: 860px) {
  .tiers-sec .tier { --rows: 4; }
  .bills { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .steps.start { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(28px, 4vw, 64px); }
}

@media (min-width: 960px) {
  .doc:has(.toc) { grid-template-columns: 13.5rem minmax(0, 1fr); }
  .toc { position: sticky; top: 20px; }
  .toc ol ol { display: block; }
}

@media (min-width: 960px) and (pointer: fine) {
  .toc a { padding: 0.42rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  .wl-send, .wl-row { transition: none; }
}

/* Forced colors drop backgrounds; keep the marks that carry data. */
@media (forced-colors: active) {
  .wl-send { border: 1px solid ButtonText; }
  .buy.done .buy-say::before { background: Highlight; }
}
