
@font-face {
  font-family: 'Redacted';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/assets/fonts/Redacted/Redacted-Regular.woff2') format('woff2');
}

/**
 * Shared skeleton tokens for the market content blocks.
 *
 * Every block concatenates this with its own `style.css` into
 * `makeElement({ style })` — via `./skeleton.ts`, which also prepends the
 * Redacted @font-face — so a block carries everything `[skeleton]` needs and
 * nothing has to be linked globally for the mode to work.
 *
 * The values are the wireframe's grey ramp expressed against `--text` /
 * `--background` rather than the flat hexes it was drawn with, so a skeleton
 * follows the site into dark mode instead of staying a light-mode artifact.
 */
:root {
  /* Redacted has no italic or bold cut — the fallback keeps metrics sane if the
     woff2 is missing, in which case a skeleton degrades to plain grey text. */
  --market-skeleton-font: 'Redacted', var(--font-primary, sans-serif);

  --market-skeleton-heading: color-mix(in srgb, var(--background), var(--text) 70%);
  --market-skeleton-copy: color-mix(in srgb, var(--background), var(--text) 30%);
  --market-skeleton-kicker: color-mix(in srgb, var(--background), var(--text) 24%);
  --market-skeleton-media: color-mix(in srgb, var(--background), var(--text) 38%);
  --market-skeleton-rule: color-mix(in srgb, var(--background), var(--text) 12%);
  --market-skeleton-surface: color-mix(in srgb, var(--background), var(--text) 2%);
}

market-pricing {
  --pricing-columns: 3;
  --pricing-muted: color-mix(in srgb, var(--background), var(--text) 62%);
  --pricing-rule: color-mix(in srgb, var(--background), var(--text) 12%);
  position: relative;
  display: block;
  width: 100%;
  padding: 44px;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  market-pricing {
    padding: 32px 20px;
  }
}

market-pricing [tiers] {
  display: grid;
  grid-template-columns: repeat(var(--pricing-columns), minmax(0, 1fr));
  align-items: start;
  gap: 28px;
  width: 100%;
  max-width: var(--max-page-width, 1400px);
  margin: 0 auto;
}

@media (max-width: 900px) {
  market-pricing [tiers] {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
}

market-pricing [tier] {
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* The featured tier is drawn with a heavier border, so every tier reserves
     the same 2px — otherwise picking one out shifts the whole row by a pixel. */
  border: 2px solid transparent;
  outline: 1px solid var(--pricing-rule);
  outline-offset: -2px;
  padding: 30px;
}

market-pricing [tier][featured] {
  border-color: var(--text);
  outline: 0;
}

market-pricing [name] {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}

market-pricing [price] {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 10px 0 14px;
}

market-pricing [amount] {
  font-size: clamp(1.75rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
}

market-pricing [period] {
  font-size: 0.875rem;
  color: var(--pricing-muted);
}

market-pricing [features] {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

market-pricing [features] li {
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--pricing-muted);
}

/* Not pushed to the bottom of a stretched card: the kit lets tiers with fewer
   features be shorter, so the buttons sit under their own feature list rather
   than on a shared baseline. */
market-pricing [cta] {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding: 0.75rem 1.25rem;
  border: 2px solid color-mix(in srgb, var(--background), var(--text) 30%);
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  transition: all ease 300ms;
  cursor: pointer;
}

market-pricing [tier][featured] [cta] {
  border-color: var(--text);
  background: var(--text);
  color: var(--background);
}

market-pricing a[cta]:hover {
  border-color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  market-pricing [cta] {
    transition: none;
  }
}

market-pricing :is([name], [amount], [period], [cta]):empty,
market-pricing [features]:empty {
  display: none;
}

/* The price row is furniture around two spans; with neither filled it would
   still hold its own margins open. */
market-pricing [price]:not(:has(:not(:empty))) {
  display: none;
}

/* ---------------- SKELETON ---------------- */

market-pricing[skeleton],
market-pricing[skeleton] * {
  font-family: var(--market-skeleton-font);
  font-weight: 400;
  letter-spacing: normal;
}

market-pricing[skeleton] {
  background: var(--market-skeleton-surface);
  pointer-events: none;
  user-select: none;
}

market-pricing[skeleton] :is([name], [amount], [period]):empty {
  display: revert;
}

market-pricing[skeleton] [cta]:empty,
market-pricing[skeleton] [price]:not(:has(:not(:empty))) {
  display: flex;
}

market-pricing[skeleton] [tier] {
  outline-color: var(--market-skeleton-rule);
}

market-pricing[skeleton] [tier][featured] {
  border-color: var(--market-skeleton-heading);
}

market-pricing[skeleton] :is([name], [amount]) {
  color: var(--market-skeleton-heading);
}

market-pricing[skeleton] [period] {
  color: var(--market-skeleton-copy);
}

market-pricing[skeleton] [features] li {
  color: var(--market-skeleton-copy);
}

market-pricing[skeleton] [cta] {
  border-color: var(--market-skeleton-copy);
  color: var(--market-skeleton-copy);
}

market-pricing[skeleton] [tier][featured] [cta] {
  border-color: var(--market-skeleton-heading);
  background: var(--market-skeleton-heading);
  color: var(--background);
}

market-pricing[skeleton] [name]:empty::before {
  content: 'Standard';
}

market-pricing[skeleton] [tier][featured] [name]:empty::before {
  content: 'Plus';
}

/* Prices of different digit counts — a pricing table is scanned by comparing
   the numbers, so three identical slabs would say nothing. */
market-pricing[skeleton] [tier]:nth-child(3n + 1) [amount]:empty::before {
  content: '£19';
}

market-pricing[skeleton] [tier]:nth-child(3n + 2) [amount]:empty::before {
  content: '£49';
}

market-pricing[skeleton] [tier]:nth-child(3n + 3) [amount]:empty::before {
  content: '£129';
}

market-pricing[skeleton] [period]:empty::before {
  content: 'per month';
}

market-pricing[skeleton] [features] li:empty::before {
  content: 'A line describing what is in this tier';
}

market-pricing[skeleton] [features] li:nth-child(2n):empty::before {
  content: 'A shorter feature line';
}

market-pricing[skeleton] [cta]:empty::before {
  content: 'Choose this plan';
}
