/**
 * The Linchpin landing page.
 *
 * Deliberately the plugin's own palette and shapes — the same blues, the same
 * 10px radius, the same card with a coloured left rail. Somebody who sees this
 * page and then installs the plugin should recognise where they are, and a
 * landing page that looks like a different product is a small broken promise
 * before anybody has downloaded anything.
 *
 * Light only. The product shot is light, and a page that switches to dark
 * around a screenshot that does not is worse than one that never switches.
 */

.crk-linchpin {
	--lp-brand: #2563a8;
	--lp-deep: #122948;
	--lp-mist: #a9baca;

	--lp-bg: #f4f7fb;
	--lp-panel: #fff;
	--lp-line: #dde5ef;
	--lp-line-soft: #eef2f8;
	--lp-ink: #16233a;
	--lp-muted: #5f7086;

	--lp-critical: #b3352c;
	--lp-high: #b5730f;
	--lp-ok: #1f7a4d;

	--lp-radius: 10px;
	--lp-shadow: 0 1px 2px rgba(18, 41, 72, .05), 0 4px 14px rgba(18, 41, 72, .06);
}

/* ----------------------------------------------------------- headings */

.crk-linchpin .crk-eyebrow {
	font-size: .8rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--lp-brand);
	margin-bottom: .6rem;
}

.crk-linchpin h1 {
	font-size: clamp(2.1rem, 5vw, 3.2rem);
	line-height: 1.12;
	letter-spacing: -.02em;
	margin: 0 0 1rem;
	color: var(--lp-deep);
}

.crk-linchpin h2 {
	font-size: clamp(1.5rem, 3vw, 2.1rem);
	line-height: 1.2;
	letter-spacing: -.015em;
	color: var(--lp-deep);
	margin: 0 0 .75rem;
}

.crk-linchpin h3 {
	font-size: 1.05rem;
	line-height: 1.35;
	color: var(--lp-deep);
	margin: 0 0 .4rem;
}

.crk-lead {
	font-size: clamp(1.05rem, 2vw, 1.2rem);
	line-height: 1.65;
	color: var(--lp-muted);
	max-width: 46rem;
}

.crk-section {
	padding: clamp(3rem, 7vw, 5.5rem) 0;
}

.crk-section--tint { background: var(--lp-bg); }

.crk-section__intro { max-width: 46rem; margin-bottom: 2.5rem; }

/* --------------------------------------------------------------- bar */

.crk-announce {
	background: var(--lp-deep);
	color: #fff;
	text-align: center;
	padding: .7rem 1rem;
	font-size: .9rem;
	font-weight: 600;
}

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

.crk-hero {
	display: grid;
	gap: clamp(2rem, 4vw, 3rem);
	align-items: center;
	padding: clamp(2.5rem, 5vw, 4rem) 0 0;
}

@media (min-width: 60rem) {
	.crk-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
}

.crk-hero__note {
	font-size: .88rem;
	color: var(--lp-muted);
	margin-top: 1rem;
}

.crk-hero__support {
	margin-top: 1.4rem;
	padding-top: 1.2rem;
	border-top: 1px solid var(--lp-line);
	font-weight: 600;
	color: var(--lp-deep);
}

/* ------------------------------------------------------------- CTAs */

.crk-ctas {
	display: flex;
	gap: .75rem;
	flex-wrap: wrap;
	margin-top: 1.6rem;
}

.crk-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: .85rem 1.6rem;
	border-radius: 9px;
	font-weight: 650;
	font-size: 1rem;
	text-decoration: none;
	border: 1px solid var(--lp-line);
	background: var(--lp-panel);
	color: var(--lp-deep);
	transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.crk-cta:hover {
	border-color: var(--lp-brand);
	color: var(--lp-brand);
	transform: translateY(-1px);
}

.crk-cta--primary {
	background: var(--lp-deep);
	border-color: var(--lp-deep);
	color: #fff;
}

/* The label keeps its colour: white on a pale hover fill cannot be read. */
.crk-cta--primary:hover {
	background: var(--lp-brand);
	border-color: var(--lp-brand);
	color: #fff;
}

/* ------------------------------------------------------- answer block */

.crk-answer {
	background: var(--lp-panel);
	border: 1px solid var(--lp-line);
	border-left: 4px solid var(--lp-brand);
	border-radius: var(--lp-radius);
	box-shadow: var(--lp-shadow);
	padding: clamp(1.4rem, 3vw, 2rem);
	max-width: 52rem;
}

.crk-answer h2 { font-size: 1.15rem; margin-bottom: .5rem; }
.crk-answer p { margin: 0; color: var(--lp-muted); line-height: 1.7; }

/* -------------------------------------------------------------- cards */

.crk-cards {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.crk-card {
	background: var(--lp-panel);
	border: 1px solid var(--lp-line);
	border-radius: var(--lp-radius);
	box-shadow: var(--lp-shadow);
	padding: 1.4rem 1.5rem;
	position: relative;
	overflow: hidden;
}

/*
 * The coloured left rail from the plugin's own cards, carried across so the
 * two surfaces read as one product.
 */
.crk-card::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 3px;
	background: var(--card-accent, var(--lp-brand));
}

.crk-card p { margin: 0; color: var(--lp-muted); line-height: 1.65; font-size: .95rem; }

.crk-card--critical { --card-accent: var(--lp-critical); }
.crk-card--high     { --card-accent: var(--lp-high); }
.crk-card--ok       { --card-accent: var(--lp-ok); }

/* --------------------------------------------------------- numbered */

.crk-steps {
	display: grid;
	gap: 1.1rem;
	counter-reset: step;
	max-width: 52rem;
}

.crk-step {
	display: flex;
	gap: 1.1rem;
	align-items: flex-start;
}

.crk-step::before {
	counter-increment: step;
	content: counter(step);
	flex: 0 0 auto;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	border: 1.5px solid var(--lp-brand);
	color: var(--lp-brand);
	font-weight: 700;
	font-size: .9rem;
	display: grid;
	place-items: center;
}

.crk-step p { margin: .2rem 0 0; color: var(--lp-muted); line-height: 1.65; }

/* ---------------------------------------------------------- verdicts */

.crk-verdicts { display: grid; gap: .6rem; max-width: 44rem; }

.crk-verdict {
	display: flex;
	gap: .9rem;
	align-items: baseline;
	padding: .8rem 1rem;
	background: var(--lp-panel);
	border: 1px solid var(--lp-line);
	border-radius: 8px;
	font-size: .95rem;
	color: var(--lp-muted);
}

.crk-pill {
	flex: 0 0 auto;
	font-size: .7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	padding: .2rem .6rem;
	border-radius: 999px;
	color: #fff;
}

.crk-pill--safe  { background: var(--lp-ok); }
.crk-pill--check { background: var(--lp-high); }
.crk-pill--break { background: var(--lp-critical); }
.crk-pill--unknown { background: #7d8fa3; }

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

.crk-compare {
	width: 100%;
	border-collapse: collapse;
	background: var(--lp-panel);
	border: 1px solid var(--lp-line);
	border-radius: var(--lp-radius);
	overflow: hidden;
	font-size: .95rem;
}

.crk-compare th,
.crk-compare td {
	padding: .85rem 1rem;
	text-align: left;
	border-bottom: 1px solid var(--lp-line-soft);
}

.crk-compare thead th {
	background: var(--lp-bg);
	font-size: .75rem;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--lp-muted);
}

.crk-compare tbody tr:last-child td { border-bottom: 0; }
.crk-compare td:last-child { color: var(--lp-deep); font-weight: 600; }

/* ------------------------------------------------------------ ticks */

.crk-ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; max-width: 46rem; }

.crk-ticks li {
	display: flex;
	gap: .7rem;
	align-items: flex-start;
	color: var(--lp-muted);
	line-height: 1.6;
}

.crk-ticks li::before {
	content: "✓";
	color: var(--lp-ok);
	font-weight: 700;
	flex: 0 0 auto;
}

.crk-callout {
	margin-top: 1.6rem;
	padding: 1rem 1.2rem;
	border-radius: 8px;
	background: var(--lp-panel);
	border: 1px solid var(--lp-line);
	border-left: 3px solid var(--lp-high);
	color: var(--lp-muted);
	font-size: .93rem;
	line-height: 1.65;
	max-width: 46rem;
}

/* -------------------------------------------------------------- FAQ */

.crk-faq { max-width: 52rem; display: grid; gap: .5rem; }

.crk-faq__item {
	background: var(--lp-panel);
	border: 1px solid var(--lp-line);
	border-radius: 9px;
	overflow: hidden;
}

.crk-faq__item summary {
	cursor: pointer;
	padding: 1rem 1.2rem;
	font-weight: 600;
	color: var(--lp-deep);
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.crk-faq__item summary::-webkit-details-marker { display: none; }

.crk-faq__item summary::after {
	content: "+";
	color: var(--lp-brand);
	font-size: 1.3rem;
	line-height: 1;
	flex: 0 0 auto;
}

.crk-faq__item[open] summary::after { content: "−"; }

.crk-faq__answer {
	padding: 0 1.2rem 1.1rem;
	color: var(--lp-muted);
	line-height: 1.7;
}

.crk-faq__answer p { margin: 0; }

/* ---------------------------------------------------------- pricing */

.crk-pricing__grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
	/* stretch, not start: with start, a card's height:100% resolved against
	   the shrink-wrapped row and the cards overflowed it, sitting on top of
	   the note below. Stretch makes the row the tallest card and the cards
	   fill it — equal heights, nothing overlapping. */
	align-items: stretch;
}

.crk-plan {
	background: var(--lp-panel);
	border: 1px solid var(--lp-line);
	border-radius: 12px;
	box-shadow: var(--lp-shadow);
	padding: 1.6rem 1.5rem;
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 100%;
	/* border-box, or 100% plus the padding overflows the row by 52px and
	   the card sits on the note beneath it. */
	box-sizing: border-box;
}

.crk-plan--featured {
	border-color: var(--lp-brand);
	box-shadow: 0 0 0 1px var(--lp-brand), 0 10px 30px rgba(37, 99, 168, .12);
}

.crk-plan__flag {
	position: absolute;
	top: -.7rem;
	left: 1.5rem;
	background: var(--lp-brand);
	color: #fff;
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	padding: .25rem .7rem;
	border-radius: 999px;
}

.crk-plan h3 { margin: 0 0 .2rem; font-size: 1.2rem; }

.crk-plan__tagline {
	font-size: .85rem;
	color: var(--lp-muted);
	line-height: 1.55;
	margin: 0 0 1rem;
	min-height: 2.7em;
}

.crk-plan__price { margin: 0; }

.crk-plan__amount {
	font-size: 2.2rem;
	font-weight: 700;
	color: var(--lp-deep);
	line-height: 1.1;
}

.crk-plan__per { margin: .1rem 0 1.1rem; font-size: .82rem; color: var(--lp-muted); }

.crk-plan__allowance {
	list-style: none;
	margin: 0 0 1.1rem;
	padding: 0 0 1.1rem;
	border-bottom: 1px solid var(--lp-line-soft);
	display: grid;
	gap: .3rem;
	font-size: .9rem;
	color: var(--lp-muted);
}

.crk-plan__allowance strong { color: var(--lp-deep); }

.crk-plan__lines {
	list-style: none;
	margin: 0 0 1.4rem;
	padding: 0;
	display: grid;
	gap: .45rem;
	font-size: .88rem;
	color: var(--lp-muted);
	line-height: 1.5;
}

.crk-plan__lines li { position: relative; padding-left: 1.1rem; }

.crk-plan__lines li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .55em;
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: var(--lp-mist);
}

.crk-plan__cta {
	margin-top: auto;
	display: block;
	text-align: center;
	padding: .75rem 1rem;
	border-radius: 8px;
	border: 1px solid var(--lp-line);
	color: var(--lp-deep);
	font-weight: 650;
	font-size: .93rem;
	text-decoration: none;
}

.crk-plan__cta:hover { border-color: var(--lp-brand); color: var(--lp-brand); }

.crk-plan__cta.is-primary {
	background: var(--lp-brand);
	border-color: var(--lp-brand);
	color: #fff;
}

.crk-plan__cta.is-primary:hover { background: var(--lp-deep); border-color: var(--lp-deep); color: #fff; }

.crk-plan__note { margin: .6rem 0 0; font-size: .78rem; color: var(--lp-muted); text-align: center; }

.crk-pricing__switch {
	display: inline-flex;
	background: var(--lp-panel);
	border: 1px solid var(--lp-line);
	border-radius: 999px;
	padding: 4px;
	margin: 0 auto 1.8rem;
	gap: 4px;
}

.crk-pricing__switch button {
	appearance: none;
	border: 0;
	background: none;
	padding: .5rem 1.1rem;
	border-radius: 999px;
	font-size: .9rem;
	font-weight: 600;
	color: var(--lp-muted);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: .5rem;
}

.crk-pricing__switch button.is-active { background: var(--lp-deep); color: #fff; }

.crk-pricing__save {
	font-size: .7rem;
	font-weight: 700;
	background: var(--lp-ok);
	color: #fff;
	padding: .1rem .45rem;
	border-radius: 999px;
}

.crk-pricing { text-align: center; }
.crk-pricing .crk-plan { text-align: left; }

.crk-pricing__foot {
	position: relative;
	clear: both;
	margin: 2rem auto 0;
	max-width: 46rem;
	font-size: .82rem;
	color: var(--lp-muted);
	line-height: 1.65;
}

/* --------------------------------------------------------- the shot */

.crk-pshot {
	height: var(--crk-pshot-h, 640px);
	margin: 0 auto;
	max-width: 1360px;
	overflow: hidden;
	border-radius: 12px;
	border: 1px solid var(--lp-line);
	box-shadow: 0 20px 60px rgba(18, 41, 72, .12);
	background: #f3f7fb;
}

/*
 * No transform here. The shot zooms itself from the inside — see
 * bin/render-shot.php — because scaling the iframe from outside rasterises it
 * at 1360px and then shrinks the bitmap, which reads as blurry text.
 */
.crk-pshot__stage {
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.crk-pshot__frame {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	background: #f3f7fb;
}

/* ------------------------------------------------------ sticky CTA */

/*
 * Only after the hero has gone. A bar that appears immediately covers the
 * thing it is asking somebody to read about.
 */
.crk-sticky {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 50;
	display: none;
	padding: .7rem 1rem;
	background: rgba(255, 255, 255, .96);
	backdrop-filter: blur(8px);
	border-top: 1px solid var(--lp-line);
	text-align: center;
}

.crk-sticky.is-shown { display: block; }

.crk-sticky .crk-cta { padding: .65rem 1.4rem; font-size: .95rem; }

@media (min-width: 48rem) {
	.crk-sticky { display: none !important; }
}

/* ------------------------------------------------------------- width */

/*
 * The theme constrains block content to 44rem, which is right for prose and
 * far too narrow for a hero beside a product shot, a four-card grid or a
 * pricing table. These sections take the wide measure instead.
 *
 * The override has to out-specify WordPress' own constrained-layout rule,
 * which is emitted per block with a :where() selector.
 */
.wp-block-group.crk-linchpin > * {
	max-width: 76rem;
	margin-left: auto;
	margin-right: auto;
	padding-left: clamp(1rem, 4vw, 2rem);
	padding-right: clamp(1rem, 4vw, 2rem);
	box-sizing: border-box;
}

.wp-block-group.crk-announce > *,
.wp-block-group.crk-announce {
	max-width: none;
	padding-left: 1rem;
	padding-right: 1rem;
}

/* The prose blocks inside a wide section keep a readable measure of their own. */
.crk-linchpin .crk-lead,
.crk-linchpin .crk-section__intro { max-width: 46rem; }

.crk-linchpin .crk-cards,
.crk-linchpin .crk-compare,
.crk-linchpin .crk-pricing { max-width: none; }

/* ------------------------------------------------------------- icons */

.crk-icon {
	width: 22px;
	height: 22px;
	display: block;
	color: var(--card-accent, var(--lp-brand));
}

/*
 * A tile is an icon, a short label and one line. Anything longer belongs in
 * the documentation — a landing page for a free plugin is competing with the
 * install button, not with an article.
 */
.crk-tiles {
	display: grid;
	gap: .9rem;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

.crk-tile {
	background: var(--lp-panel);
	border: 1px solid var(--lp-line);
	border-radius: var(--lp-radius);
	padding: 1.2rem 1.3rem;
	box-shadow: var(--lp-shadow);
}

.crk-tile__icon {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	display: grid;
	place-items: center;
	margin-bottom: .8rem;
	background: color-mix(in srgb, var(--card-accent, var(--lp-brand)) 11%, transparent);
}

.crk-tile h3 { font-size: .98rem; margin-bottom: .25rem; }
.crk-tile p { margin: 0; font-size: .88rem; line-height: 1.55; color: var(--lp-muted); }

.crk-tile--critical { --card-accent: var(--lp-critical); }
.crk-tile--high     { --card-accent: var(--lp-high); }
.crk-tile--ok       { --card-accent: var(--lp-ok); }

/* The three steps, side by side and short. */
.crk-flow {
	display: grid;
	gap: 1.2rem;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
	counter-reset: flow;
}

.crk-flow__step { position: relative; padding-top: 2.6rem; }

.crk-flow__step::before {
	counter-increment: flow;
	content: counter(flow);
	position: absolute;
	top: 0;
	left: 0;
	width: 1.9rem;
	height: 1.9rem;
	border-radius: 50%;
	background: var(--lp-deep);
	color: #fff;
	font-size: .82rem;
	font-weight: 700;
	display: grid;
	place-items: center;
}

.crk-flow__step h3 { margin-bottom: .3rem; }
.crk-flow__step p { margin: 0; color: var(--lp-muted); line-height: 1.6; font-size: .93rem; }

/* Safety, as a row of short guarantees rather than a list of paragraphs. */
.crk-guards {
	display: grid;
	gap: .7rem 2rem;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
	max-width: none;
}
