/* ============================================================================
   Widget: Plans and pricing
   The read-only comparison of the 2027 plans, inside the lander's full-screen pricing popup
   (html/widgets/templates/widget-pricing-plans.html, generated from the build folder's plans-2027.json).
   Two switches (Website + SEO or Website + ads; a 1-year or 3-year term), the set's plan cards on the show cards'
   dark glass with each plan's marketing mini-plans as chips, then every row of the plan chart for that set. One set shows at a time:
   js/widgets/pricing-plans.js puts is-set-<id> on the widget and every part of a plan carries data-in-set.
   Below 1200px one plan shows at a time (the script adds is-single and the plan switch chooses it); from
   1200px the set's plans sit side by side and the plan names stay pinned while the chart scrolls.
   The popup's shell (ground, hex, close button, the Book a Demo bar) is in css/overrides/components.css.
   Every class is pm-plan-* or pm-plans-*. Every text rule sets its own face, size and color, because a bare
   <p> on this site is 12px gray mono.
   ============================================================================ */

.pm-plans {
	--plans-copy: rgba(255, 255, 255, 0.8);      /* supporting copy on the dark ground: about 11:1 */
	--plans-muted: rgba(255, 255, 255, 0.62);    /* small labels: 6:1, the site's floor for 11 to 13px */
	--plans-quiet: rgba(255, 255, 255, 0.55);    /* "Not included": a clear step under a real value, 5.3:1 */
	--plans-line: rgba(255, 255, 255, 0.08);
	max-width: 1360px;
	margin-left: auto;
	margin-right: auto;
	color: var(--plans-copy);
	font-family: var(--bs-h5-family), sans-serif;
	font-size: 0.9375rem;
	line-height: 1.5;
	text-align: left;
}

/* The two switches do nothing until the script runs, so they wait for it */
.pm-plans-bar,
.pm-plans-picker {
	display: none;
}

/* --- The switches: which plans (website / with marketing) and which term (1-year / 3-year) ---
   Each is two equal halves, so the cyan pill slides by its own width and nothing is measured. Side by side
   where they fit, one above the other on a phone. */
.pm-plans.is-ready .pm-plans-bar {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem;
	margin-bottom: 1.5rem;
}

.pm-plans-switch {
	position: relative;
	display: grid;                   /* a flex item of the bar: an inline-grid would render as grid anyway */
	grid-template-columns: 1fr 1fr;
	padding: 3px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 50rem;
	background: rgba(255, 255, 255, 0.05);
}

.pm-plans-switch::before {
	content: "";
	position: absolute;
	top: 3px;
	bottom: 3px;
	left: 3px;
	width: calc(50% - 3px);
	border-radius: 50rem;
	background: var(--bs-primary);
	box-shadow: 0 2px 8px rgba(var(--bs-primary-rgb), 0.25);
	transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.pm-plans.is-term-3 .pm-plans-term::before,
.pm-plans.is-set-marketing .pm-plans-set::before {
	transform: translateX(100%);
}

.pm-plans-switch-btn {
	position: relative;
	z-index: 1;
	min-height: 40px;                /* the house 40px touch target */
	padding: 0 0.875rem;             /* "Website + Paid ads" twice fits a 360px phone's sheet */
	border: 0;
	border-radius: 50rem;
	background: none;
	color: var(--plans-copy);
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.025em;
	white-space: nowrap;
	cursor: pointer;
	transition: color 220ms ease;
}

@media (min-width: 576px) {
	.pm-plans-switch-btn {
		padding: 0 1.25rem;
	}
}

.pm-plans-switch-btn:hover {
	color: #fff;
}

/* On the cyan pill: the page's dark ink, 7:1 */
.pm-plans-switch-btn.is-current {
	color: var(--bs-dark);
}

.pm-plans-switch-btn:focus-visible,
.pm-plans-pick:focus-visible {
	outline: 2px solid var(--bs-primary);
	outline-offset: 2px;
}

/* Each price is in the markup once per term; the switch shows one (the 1-year price without the script) */
.pm-plans [data-for-term="3"],
.pm-plans.is-term-3 [data-for-term="1"] {
	display: none;
}

.pm-plans.is-term-3 [data-for-term="3"] {
	display: inline;
}

.pm-plans.is-term-3 .pm-plan-amount[data-for-term="3"] {
	display: inline-flex;
}

.pm-plans.is-term-3 .pm-plans-th-price[data-for-term="3"] {
	display: block;
}

/* One set at a time: the other set's cards, pills, columns and note step out, and so does a row that is only
   dashes for the set in view. Without the script there is no is-set class and every plan shows. */
.pm-plans.is-set-website [data-in-set="marketing"],
.pm-plans.is-set-marketing [data-in-set="website"],
.pm-plans.is-set-website [data-empty-in~="website"],
.pm-plans.is-set-marketing [data-empty-in~="marketing"] {
	display: none;
}

/* --- Plan switch (one plan in view): a bar pinned to the top of the popup while the chart scrolls. The bar spans
   the sheet; the pills scroll inside a track that stops short of the popup's close button (40px, 12px in), so no
   pill ever passes under it, and the track fades at its right edge to show there is more. --- */
.pm-plans.is-single .pm-plans-picker {
	position: sticky;
	top: 0;
	z-index: 3;
	display: block;
	margin: 0 calc(var(--sheet-pad, 0px) * -1) 1rem;
	padding: 0.75rem 0 0.75rem var(--sheet-pad, 0px);
	border-bottom: 1px solid var(--plans-line);
	background: var(--bs-dark);
}

.pm-plans-picker-track {
	display: flex;
	gap: 0.5rem;
	margin: -4px 4rem -4px 0;          /* the right margin keeps the pills clear of the close button */
	padding: 4px 1.5rem 4px 4px;        /* room for the focus ring; the end padding lets the last pill clear the fade */
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	-webkit-mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent);
	mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent);
}

.pm-plans-picker-track::-webkit-scrollbar {
	display: none;
}

.pm-plans-pick {
	flex: 0 0 auto;
	min-height: 40px;
	padding: 0 1rem;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 50rem;
	background: transparent;
	color: var(--plans-copy);
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.025em;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 220ms ease, border-color 220ms ease, color 220ms ease;
}

.pm-plans-pick:hover {
	border-color: rgba(255, 255, 255, 0.5);
	color: #fff;
}

.pm-plans-pick.is-current {
	border-color: #fff;
	background: #fff;
	color: var(--bs-dark);
}

/* --- Plan cards: the show cards' dark glass (section-trade-shows.css .ts-card), solid until a browser can blur --- */
.pm-plans-cards {
	display: grid;
	gap: 0.625rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Both sets' cards, without the script */
.pm-plans-cards + .pm-plans-cards {
	margin-top: 0.625rem;
}

.pm-plan {
	display: flex;
	flex-direction: column;
	padding: 1.5rem 1.25rem 1.25rem;
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: 1rem;
	background: rgba(30, 33, 46, 0.92);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

/* The pinned column heads (from 1200px) cover the rows passing under them: solid here, glass just below */
.pm-plans-table thead th {
	background: var(--bs-dark);
}

/* Plain @supports blocks, one per spelling: the platform's minifier voids an "or" */
@supports (backdrop-filter: blur(1px)) {
	.pm-plan {
		background: rgba(255, 255, 255, 0.04);
		backdrop-filter: blur(4px) saturate(180%);
	}

	.pm-plans.is-single .pm-plans-picker,
	.pm-plans-table thead th {
		background: rgba(var(--bs-dark-rgb), 0.86);
		backdrop-filter: blur(16px) saturate(180%);
	}
}

@supports (-webkit-backdrop-filter: blur(1px)) {
	.pm-plan {
		background: rgba(255, 255, 255, 0.04);
		-webkit-backdrop-filter: blur(4px) saturate(180%);
	}

	.pm-plans.is-single .pm-plans-picker,
	.pm-plans-table thead th {
		background: rgba(var(--bs-dark-rgb), 0.86);
		-webkit-backdrop-filter: blur(16px) saturate(180%);
	}
}

.pm-plans.is-single .pm-plan:not(.is-current) {
	display: none;
}

.pm-plan-name {
	margin: 0;
	font-family: var(--bs-h3-family), sans-serif;
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.625rem;
	color: rgba(255, 255, 255, 0.92);
}

/* The card's paragraphs are lifted to two classes: the platform's ".wf-active p" (0,1,1), on once the web fonts
   load, would otherwise give them the 12px mono paragraph face */
.pm-plans .pm-plan-for {
	margin: 0.5rem 0 0;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.45;
	color: rgba(255, 255, 255, 0.65);
}

.pm-plans .pm-plan-price {
	margin: 1.25rem 0 0;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1;
	color: #fff;
}

.pm-plan-amount {
	display: inline-flex;
	align-items: baseline;
	gap: 0.25rem;
}

.pm-plan-num {
	font-family: var(--bs-h3-family), sans-serif;
	font-size: 2.5rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	font-variant-numeric: tabular-nums;
}

.pm-plan-unit {
	color: var(--plans-muted);
}

.pm-plans .pm-plan-alt {
	margin: 0.5rem 0 0;
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.4;
	color: var(--plans-muted);
}

/* What the price commits to, on its own line above the other term's price */
.pm-plan-agreement {
	display: block;
	color: var(--plans-copy);
	font-weight: 500;
}

/* --- The marketing mini-plans in each plan, as cyan chips under the price, so the SEO that comes with a website
   plan is seen at a glance. A La Carte includes none, so its list is the add-ons, quieter. --- */
.pm-plan-marketing {
	margin-top: 1.25rem;
}

.pm-plans .pm-plan-marketing-label {
	margin: 0 0 0.5rem;
	font-family: var(--bs-p-family), monospace;
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bs-primary);
}

.pm-plan-minis {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pm-plan-minis li {
	display: inline-flex;
	align-items: baseline;
	gap: 0.375rem;
	padding: 0.25rem 0.625rem;
	border: 1px solid rgba(var(--bs-primary-rgb), 0.35);
	border-radius: 50rem;
	background: rgba(var(--bs-primary-rgb), 0.1);
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.3;
	color: rgba(255, 255, 255, 0.92);
}

.pm-plan-mini-note {
	font-size: 0.75rem;
	font-weight: 400;
	color: var(--plans-muted);
}

/* Add-ons (A La Carte) are not in the price, so they read as a plain list, not as chips: the cheapest plan should
   not look like the one with the most marketing */
.pm-plans .pm-plan-marketing[data-kind="add-on"] .pm-plan-marketing-label {
	color: var(--plans-muted);
}

.pm-plan-marketing[data-kind="add-on"] .pm-plan-minis {
	display: grid;
	gap: 0.25rem;
}

.pm-plan-marketing[data-kind="add-on"] .pm-plan-minis li {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--plans-muted);
	font-weight: 400;
}

/* What a plan's marketing does not cover (the ad budget on the paid-ads plans) */
.pm-plans .pm-plan-marketing-note {
	margin: 0.5rem 0 0;
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.4;
	color: var(--plans-copy);
}

.pm-plan-points {
	display: grid;
	align-content: start;
	gap: 0.5rem;
	margin: 1.25rem 0 0;
	padding: 1rem 0 0;
	border-top: 1px solid var(--plans-line);
	list-style: none;
	font-size: 0.875rem;
	line-height: 1.4;
	color: var(--plans-copy);
}

/* The check: Lucide's "check" in the brand cyan, drawn by CSS so the list and the cells stay plain text */
.pm-plan-points li,
.pm-plans-table .pm-plans-yes {
	position: relative;
	padding-left: 1.375rem;
}

.pm-plan-points li::before,
.pm-plans-table .pm-plans-yes::before {
	content: "";
	position: absolute;
	top: 0.2em;
	left: 0;
	width: 0.9375rem;
	height: 0.9375rem;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2313b5ea' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* In a cell the check starts under the cell's own top padding */
.pm-plans-table .pm-plans-yes::before {
	top: calc(0.75rem + 0.2em);
}

/* --- The full chart --- */
.pm-plans-title {
	margin: 3rem 0 0.25rem;
	font-family: var(--bs-h3-family), sans-serif;
	font-size: 1.69rem;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
}

.pm-plans-table {
	width: 100%;
	margin: 0;
	border-collapse: separate;
	border-spacing: 0;
	font-size: 0.875rem;
	line-height: 1.4;
	font-variant-numeric: tabular-nums;
}

.pm-plans-table th,
.pm-plans-table td {
	padding: 0.75rem 0;
	border: 0;
	text-align: left;
	vertical-align: top;
	font-weight: 400;
	color: var(--plans-copy);
}

.pm-plans-table tbody th[scope="row"] {
	width: 52%;
	padding-right: 1rem;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.92);
}

.pm-plans-table tbody tr:not(.pm-plans-group) > * {
	border-top: 1px solid var(--plans-line);
}

/* A group's name: the site's label voice (mono, uppercase, tracked) in the brand cyan, 7:1 */
.pm-plans-table .pm-plans-group th {
	padding: 2rem 0 0.625rem;
	font-family: var(--bs-p-family), monospace;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bs-primary);
}

.pm-plans-table .pm-plans-price-row td {
	font-weight: 600;
	color: #fff;
}

.pm-plans-table .pm-plans-no,
.pm-plans-table .pm-plans-na {
	color: var(--plans-quiet);
}

/* Plan names over the columns */
.pm-plans-th-name {
	display: block;
	font-family: var(--bs-h3-family), sans-serif;
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.25;
	color: #fff;
}

.pm-plans-th-price {
	display: block;
	margin-top: 0.25rem;
	font-family: var(--bs-p-family), monospace;
	font-size: 0.75rem;
	line-height: 1.3;
	color: var(--plans-muted);
}

/* One plan in view: its name is on the plan switch, so the column heads go quiet (still read to screen readers),
   and the other five plans' cells step out */
.pm-plans.is-single .pm-plans-table thead {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.pm-plans.is-single .pm-plans-table [data-plan]:not(.is-current) {
	display: none;
}

/* Without the script below 1200px, the whole chart scrolls sideways instead */
.pm-plans:not(.is-ready) .pm-plans-compare {
	overflow-x: auto;
}

.pm-plans:not(.is-ready) .pm-plans-table {
	min-width: 68rem;
}

.pm-plans:not(.is-ready) .pm-plans-table th,
.pm-plans:not(.is-ready) .pm-plans-table td {
	padding-right: 0.75rem;
}

/* --- The chart's own notes: fine print set as prose in the body face. The rule runs the chart's full width; the
   text keeps a reading measure. Every note shares one text edge, lined up with the chart's row names, and the
   footnote asterisk hangs in the margin before it, cyan like the asterisks in the cells it answers. --- */
.pm-plans-notes {
	display: grid;
	gap: 0.625rem;
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* Two classes: the platform's ".wf-active p" (0,1,1) would set the mono paragraph face */
.pm-plans .pm-plans-notes p {
	position: relative;
	max-width: 72ch;
	margin: 0;
	padding-left: 0.75rem;
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.6;
	color: var(--plans-muted);
	text-wrap: pretty;
}

.pm-plans-mark {
	color: var(--bs-primary);
	font-weight: 700;
}

.pm-plans-notes .pm-plans-mark {
	position: absolute;
	left: 0;
}

/* --- From 1200px: the set's plans side by side --- */
@media (min-width: 1200px) {
	/* One column per card, however many the set has. Each card is six rows (name, who it is for, price, the
	   other term, its marketing, what you get) on the grid's own rows, so the prices and the lists line up across
	   the set whatever wraps. Without subgrid a card keeps its own rows. */
	.pm-plans-cards {
		grid-template-rows: repeat(6, auto);
		grid-auto-flow: column;
		grid-auto-columns: minmax(0, 1fr);
		row-gap: 0;
	}

	/* The marketing set is two plans: a narrower sheet keeps their cards and columns at a reading width */
	.pm-plans.is-set-marketing {
		max-width: 64rem;
	}

	.pm-plan {
		display: grid;
		grid-row: span 6;
		grid-template-rows: subgrid;
		padding: 1.5rem 1.125rem 1.25rem;
	}

	.pm-plans-table {
		table-layout: fixed;
	}

	.pm-plans-table th,
	.pm-plans-table td {
		padding: 0.75rem;
	}

	/* The check keeps the cell's left padding */
	.pm-plans-table .pm-plans-yes {
		padding-left: 2.125rem;
	}

	.pm-plans-table .pm-plans-yes::before {
		left: 0.75rem;
	}

	.pm-plans-table .pm-plans-group th {
		padding: 2rem 0.75rem 0.625rem;
	}

	.pm-plans-table tbody th[scope="row"] {
		width: auto;
		padding-right: 0.75rem;
	}

	/* The plan names stay pinned under the popup's top band while the chart scrolls */
	.pm-plans-table thead th {
		position: sticky;
		top: 0;
		z-index: 2;
		padding: 0.875rem 0.75rem;
		border-bottom: 1px solid rgba(255, 255, 255, 0.12);
		vertical-align: bottom;
	}

	.pm-plans-table .pm-plans-corner {
		width: 22%;
		font-family: var(--bs-p-family), monospace;
		font-size: 0.7rem;
		font-weight: 700;
		letter-spacing: 0.08em;
		text-transform: uppercase;
		color: var(--plans-muted);
	}

	/* With two plan columns the row names get the room */
	.pm-plans.is-set-marketing .pm-plans-corner {
		width: 34%;
	}

	/* A long row is easier to follow across the columns with the pointer's row lifted */
	.pm-plans-table tbody tr:not(.pm-plans-group):hover > * {
		background: rgba(255, 255, 255, 0.03);
	}
}

/* --- Motion: the cards rise once as the popup opens (40ms apart), again when the other set comes in (a card
   that returns from display: none starts its animation over), and a price settles in when the term changes.
   Nothing loops. --- */
@media (prefers-reduced-motion: no-preference) {
	.pm-section-dialog.show .pm-plan {
		animation: pm-plan-rise 480ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
	}

	.pm-section-dialog.show .pm-plan:nth-child(2) { animation-delay: 40ms; }
	.pm-section-dialog.show .pm-plan:nth-child(3) { animation-delay: 80ms; }
	.pm-section-dialog.show .pm-plan:nth-child(4) { animation-delay: 120ms; }

	/* One plan in view: the card that comes in starts at once */
	.pm-section-dialog.show .pm-plans.is-single .pm-plan {
		animation-delay: 0ms;
	}

	.pm-plans.is-ready .pm-plan-num {
		display: inline-block;
		animation: pm-plan-settle 320ms cubic-bezier(0.16, 1, 0.3, 1);
	}
}

@keyframes pm-plan-rise {
	from {
		opacity: 0;
		transform: translateY(1rem);
	}
}

@keyframes pm-plan-settle {
	from {
		opacity: 0;
		transform: translateY(0.3em);
	}
}

@media (prefers-reduced-motion: reduce) {
	.pm-plans-switch::before,
	.pm-plans-switch-btn,
	.pm-plans-pick {
		transition: none;
	}
}

/* With the system's reduced-transparency setting: solid surfaces and no blur */
@media (prefers-reduced-transparency: reduce) {
	.pm-plan {
		background: rgb(37, 39, 51);
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}

	.pm-plans.is-single .pm-plans-picker,
	.pm-plans-table thead th {
		background: var(--bs-dark);
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}
}
