/* The pricing page (/pricing/). Loaded only there, via headExtra in build.mjs.
 *
 * Free first (chat #2603): a headline that Bridge is free, three ways to pay
 * for models (your own plan, your own keys, the optional Bridge Router), a
 * "how Bridge makes money" card with a worked receipt, a list of what is free,
 * then Enterprise. Chat #2019 made Enterprise a card whose button expands a
 * lead form (enhanced by /pricing.js) and gave the main card a
 * pointer-following light, which the money card keeps (class plan-one). The
 * calculator's stylesheet from before is archived in
 * docs/archive/pricing-2026-10/.
 *
 * Every rule is scoped under body.pricing and the colour tokens are --pr-*,
 * because generic names (.note, --line, --text) already mean something in
 * styles.css. */

body.pricing {
  --pr-raised: #191c21;
  --pr-sunken: #121418;
  --pr-line: #272b33;
  --pr-line-strong: #353a45;
  --pr-text: #c9ced8;
  --pr-bright: #f4f6fa;
  --pr-dim: #8d95a3;
  /* The --pr-blue* names predate the orange brand (chat #2603); they hold the
   * page's accent, which follows the site's accent scheme (styles.css). */
  --pr-blue: var(--accent);
  --pr-blue-soft: var(--accent-link);
  --pr-blue-line: rgb(var(--accent-rgb) / 0.55);
  --pr-blue-wash: rgb(var(--accent-rgb) / 0.12);
  --pr-green: #6fdda0;
  --pr-amber: #f3c26b;
}

/* The glow behind the intro, on main rather than body so it scrolls with the
 * page under the sticky header instead of sitting behind it. */
body.pricing main {
  background-image: radial-gradient(60rem 34rem at 50% -12rem, rgb(var(--accent-rgb) / 0.13), transparent 70%);
  background-repeat: no-repeat;
}

body.pricing .board {
  width: min(100% - 2.5rem, 62rem);
  margin: 0 auto;
  padding: 2.25rem 0 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: var(--pr-text);
  font-size: 0.875rem;
  line-height: 1.45;
}

/* styles.css pads every <section> for the long-form pages; these are panels.
 * :where() drops the element from the count, so this ties with a
 * `body.pricing .panel` rule and the panel's own padding, which comes later in
 * this file, wins. Without it this reset outranked .plan-one and the card's
 * content sat flush against its blue border. Keep panel rules below this one. */
body.pricing .board :where(section) {
  padding: 0;
}

body.pricing .board p {
  margin: 0;
}

/* Everything but the three cards keeps the old reading width. */
body.pricing .board > :not(.pay-grid) {
  width: 100%;
  max-width: 42rem;
  align-self: center;
}

body.pricing .intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

body.pricing .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  border: 0.0625rem solid var(--pr-line);
  border-radius: 999px;
  background: var(--pr-raised);
  color: var(--pr-dim);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
}

body.pricing .eyebrow b {
  color: var(--pr-green);
  font-weight: 620;
}

body.pricing .intro h1 {
  margin: 0;
  color: var(--pr-bright);
  font-size: clamp(1.75rem, 3.4vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

body.pricing .intro p {
  max-width: 34rem;
  color: var(--pr-dim);
}

/* --- The main card ---------------------------------------------------------
 *
 * No animation on a timer (chat #2019 tried a travelling border highlight and
 * a load-time sheen; both read as busy). The only motion is a soft light that
 * follows the pointer while it is over the card: pricing.js writes the
 * pointer's position into --pr-mx / --pr-my, and two layers read them.
 *   ::before  a wide, faint glow on the card's surface, under the content.
 *   ::after   the same spot, but masked to the 1px border ring, so the edge
 *             nearest the pointer brightens.
 * Both fade in on hover and are invisible otherwise, so touch screens and
 * no-script visitors see the plain card. */
body.pricing .plan-one {
  --pr-mx: 50%;
  --pr-my: 0%;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.75rem;
  border: 0.0625rem solid var(--pr-blue-line);
  border-radius: 0.875rem;
  background: linear-gradient(180deg, #1c2027, var(--pr-raised) 55%);
  box-shadow:
    0 0 2.5rem rgb(var(--accent-rgb) / 0.1),
    0 1.25rem 3rem rgba(0, 0, 0, 0.4);
}

body.pricing .plan-one::before,
body.pricing .plan-one::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 240ms ease;
}

body.pricing .plan-one::before {
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    22rem circle at var(--pr-mx) var(--pr-my),
    rgba(143, 194, 255, 0.09),
    transparent 60%
  );
}

/* The border ring: a padded box whose content area is masked out, leaving
 * only the 1px edge, painted with the same pointer-centred spot. */
body.pricing .plan-one::after {
  inset: -0.0625rem;
  padding: 0.0625rem;
  background: radial-gradient(
    12rem circle at var(--pr-mx) var(--pr-my),
    rgba(230, 241, 255, 0.95),
    rgb(var(--accent-rgb) / 0.5) 40%,
    transparent 70%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box exclude,
    linear-gradient(#000 0 0);
}

body.pricing .plan-one.is-lit::before,
body.pricing .plan-one.is-lit::after {
  opacity: 1;
}

/* A green check before each item of a list. */
body.pricing :is(.pay-card__list, .free-list__items) {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

body.pricing :is(.pay-card__list, .free-list__items) li {
  position: relative;
  padding-left: 1.25rem;
}

body.pricing :is(.pay-card__list, .free-list__items) li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.45em;
  width: 0.5rem;
  height: 0.28rem;
  border-left: 0.125rem solid var(--pr-green);
  border-bottom: 0.125rem solid var(--pr-green);
  transform: rotate(-45deg);
}

/* --- Three ways to pay for models -------------------------------------------
 * Two free cards and the optional Router, side by side; stacked on a phone.
 * The Router card is the only one with a price, and the only one in the
 * accent colour. */
body.pricing .pay-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0.5rem 0;
}

body.pricing .pay-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  border: 0.0625rem solid var(--pr-line);
  border-radius: 0.75rem;
  background: var(--pr-raised);
}

body.pricing .pay-card--router {
  border-color: var(--pr-blue-line);
  background: linear-gradient(180deg, #1a1f27, var(--pr-raised) 60%);
}

body.pricing .pay-card__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--pr-bright);
  font-size: 0.9375rem;
  font-weight: 620;
}

body.pricing .pay-card__label em {
  padding: 0.05rem 0.45rem;
  border: 0.0625rem solid var(--pr-line-strong);
  border-radius: 999px;
  color: var(--pr-dim);
  font-size: 0.6875rem;
  font-style: normal;
  font-weight: 500;
}

body.pricing .pay-card__price {
  display: flex;
  flex-direction: column;
  color: var(--pr-bright);
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

body.pricing .pay-card__price--free {
  color: var(--pr-green);
}

body.pricing .pay-card__price small {
  margin-top: 0.2rem;
  color: var(--pr-dim);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0;
}

body.pricing .pay-card__lede {
  color: var(--pr-text);
}

body.pricing .pay-card__list {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 0.0625rem solid var(--pr-line);
  color: var(--pr-dim);
  font-size: 0.8125rem;
}

@media (max-width: 52rem) {
  body.pricing .pay-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- How Bridge makes money --------------------------------------------------
 * The one fee, said plainly, with a worked receipt. It is the plan-one card
 * (border, glow, pointer light) so it reads as the page's centrepiece. */
body.pricing .money__kicker {
  color: var(--pr-blue-soft);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body.pricing .money__title {
  margin: 0;
  color: var(--pr-bright);
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}

body.pricing .receipt {
  display: flex;
  flex-direction: column;
  padding: 0.25rem 1rem;
  border: 0.0625rem solid var(--pr-line);
  border-radius: 0.5rem;
  background: var(--pr-sunken);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

body.pricing .receipt__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  color: var(--pr-text);
}

body.pricing .receipt__row + .receipt__row {
  border-top: 0.0625rem dashed var(--pr-line-strong);
}

body.pricing .receipt__row--total {
  color: var(--pr-bright);
  font-weight: 600;
}

body.pricing .money__fine {
  color: var(--pr-dim);
  font-size: 0.75rem;
}

/* --- What is free ------------------------------------------------------------ */
body.pricing .free-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  border: 0.0625rem solid var(--pr-line);
  border-radius: 0.75rem;
  background: var(--pr-raised);
}

body.pricing .free-list__title {
  margin: 0;
  color: var(--pr-bright);
  font-size: 1.125rem;
  letter-spacing: -0.015em;
}

body.pricing .free-list__items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 1.5rem;
}

@media (max-width: 36rem) {
  body.pricing .free-list__items {
    grid-template-columns: minmax(0, 1fr);
  }
}

body.pricing .plan-one__cta {
  align-self: flex-start;
  padding: 0.55rem 1.1rem;
  border-radius: 0.5rem;
  background: var(--pr-blue);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 0.25rem 1rem rgb(var(--accent-rgb) / 0.25);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

body.pricing .plan-one__cta:hover {
  background: var(--pr-blue-soft);
  color: #0b1320;
  transform: translateY(-0.0625rem);
  box-shadow: 0 0.5rem 1.5rem rgb(var(--accent-rgb) / 0.4);
}

/* --- The Enterprise card ----------------------------------------------------
 *
 * A step below the main card: a quiet grey border, no glow. Enterprise used to
 * be one line of small grey text and was easy to miss; as a card with an icon
 * and its own button it reads as a real option while the 5.5% card stays the
 * headline. */
body.pricing .offer-card {
  border: 0.0625rem solid var(--pr-line);
  border-radius: 0.75rem;
  background: var(--pr-raised);
  transition: border-color 160ms ease;
}

body.pricing .offer-card:hover,
body.pricing .offer-card[open] {
  border-color: var(--pr-line-strong);
}

body.pricing .offer-card__head {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.125rem;
}

body.pricing .offer-card__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  background: var(--pr-blue-wash);
  color: var(--pr-blue-soft);
  box-shadow: inset 0 0 0 0.0625rem rgb(var(--accent-rgb) / 0.22);
}

body.pricing .offer-card__icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

body.pricing .offer-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: var(--pr-dim);
  font-size: 0.8125rem;
}

body.pricing .offer-card__title {
  margin: 0;
  color: var(--pr-bright);
  font-size: 0.9375rem;
  font-weight: 620;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

body.pricing .offer-card__button {
  flex: none;
  padding: 0.4rem 0.85rem;
  border: 0.0625rem solid var(--pr-line-strong);
  border-radius: 0.5rem;
  color: var(--pr-text);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background-color 160ms ease;
}

body.pricing .offer-card__head:hover .offer-card__button,
body.pricing .offer-card[open] .offer-card__button {
  border-color: var(--pr-blue-line);
  background: var(--pr-blue-wash);
  color: var(--pr-blue-soft);
}

/* The whole Enterprise header row is the <summary>, so a click anywhere on it
 * opens the form; the button is what it looks like. */
body.pricing .offer-card__head {
  cursor: pointer;
  list-style: none;
}

body.pricing .offer-card__head::-webkit-details-marker {
  display: none;
}

body.pricing .offer-card__head:focus-visible {
  outline: 0.125rem solid var(--pr-blue);
  outline-offset: -0.125rem;
  border-radius: 0.75rem;
}

body.pricing .offer-card .when-open,
body.pricing .offer-card[open] .when-closed {
  display: none;
}

body.pricing .offer-card[open] .when-open {
  display: inline;
}

/* --- The lead form ---------------------------------------------------------
 * Fields and wording match the accounts site's EnterpriseContactForm.tsx. */
body.pricing .lead {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 0 1.125rem 1.125rem;
  animation: pr-drop 220ms ease-out;
}

@keyframes pr-drop {
  from {
    opacity: 0;
    transform: translateY(-0.25rem);
  }
}

body.pricing .lead__intro {
  padding-top: 0.875rem;
  border-top: 0.0625rem solid var(--pr-line);
  color: var(--pr-dim);
  font-size: 0.8125rem;
}

body.pricing .lead__form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

body.pricing .lead__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 34rem) {
  body.pricing .lead__grid {
    grid-template-columns: 1fr;
  }

  body.pricing .offer-card__head {
    flex-wrap: wrap;
  }
}

body.pricing .lead__field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--pr-text);
  font-size: 0.75rem;
  font-weight: 560;
}

body.pricing .lead__field em {
  color: var(--pr-dim);
  font-style: normal;
  font-weight: 400;
}

body.pricing .lead__field input,
body.pricing .lead__field select,
body.pricing .lead__field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.625rem;
  border: 0.0625rem solid var(--pr-line-strong);
  border-radius: 0.5rem;
  background: var(--pr-sunken);
  color: var(--pr-bright);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 400;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

body.pricing .lead__field textarea {
  resize: vertical;
  min-height: 4.5rem;
}

body.pricing .lead__field input::placeholder,
body.pricing .lead__field textarea::placeholder {
  color: #5d6471;
}

body.pricing .lead__field input:focus,
body.pricing .lead__field select:focus,
body.pricing .lead__field textarea:focus {
  outline: none;
  border-color: var(--pr-blue);
  box-shadow: 0 0 0 0.1875rem rgb(var(--accent-rgb) / 0.18);
}

/* Only after a submit attempt (pricing.js adds .lead__form--tried), so a
 * blank form does not open covered in warnings. */
body.pricing .lead__form--tried :is(input, select):invalid {
  border-color: var(--pr-amber);
}

body.pricing .lead__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

body.pricing .lead__notice {
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
}

body.pricing .lead__notice[hidden] {
  display: none;
}

body.pricing .lead__notice--ok {
  border: 0.0625rem solid rgba(111, 221, 160, 0.35);
  background: rgba(111, 221, 160, 0.08);
  color: var(--pr-text);
}

body.pricing .lead__notice--ok strong {
  color: var(--pr-green);
}

body.pricing .lead__notice--warn {
  border: 0.0625rem solid rgba(243, 194, 107, 0.35);
  background: rgba(243, 194, 107, 0.08);
  color: var(--pr-amber);
}

body.pricing .lead__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

body.pricing .lead__submit {
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 0.5rem;
  background: var(--pr-blue);
  color: var(--accent-ink);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease;
}

body.pricing .lead__submit:hover {
  background: var(--pr-blue-soft);
  color: #0b1320;
}

body.pricing .lead__submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

body.pricing .lead__fine {
  color: var(--pr-dim);
  font-size: 0.75rem;
}

/* Motion off: no pointer light (pricing.js also skips it), and nothing drops
 * in or lifts. */
@media (prefers-reduced-motion: reduce) {
  body.pricing .lead {
    animation: none;
  }

  body.pricing .plan-one::before,
  body.pricing .plan-one::after {
    display: none;
  }

  body.pricing .plan-one__cta,
  body.pricing .plan-one__cta:hover {
    transform: none;
  }
}
