/*
 * Black Friday 2026: the offer bar above every page and the offer strip on
 * the pricing cards. Both are built by /black-friday.js and only exist while
 * the offer runs; scripts/inject-black-friday.mjs adds the tags at build time.
 *
 * html.bf-on   the bar is showing (offer running, not dismissed)
 * html.bf-sale the offer is running (pricing shows the discount)
 */
:root { --bf-h: 44px; --bf-ink: #0b0b0b; --bf-ease: cubic-bezier(.23, 1, .32, 1); }

/* The bar sits in the page flow above everything and scrolls away with it.
   The room is reserved and painted on <html> before first paint, so nothing
   shifts when the script builds the bar. */
html.bf-on {
  padding-top: var(--bf-h);
  background-image: linear-gradient(var(--bf-ink), var(--bf-ink));
  background-repeat: no-repeat;
  background-size: 100% var(--bf-h);
}
/* The fixed header starts below the bar and rides back up to its own spot as
   the bar scrolls out. Its resting place differs by page family, so the
   script measures it; until the script runs, this holds it clear of the bar. */
html.bf-on:not(.bf-ready) .site-header { translate: 0 var(--bf-h); }

.bf-bar {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 39;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: var(--bf-h);
  padding: 0 44px 0 12px;
  background: var(--bf-ink);
  color: rgba(255, 255, 255, .72);
  font: 500 13.5px/1 var(--site-font-body, var(--font-sans, "Inter Variable", Inter, ui-sans-serif, system-ui, sans-serif));
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
.bf-bar *, .bf-offer * { box-sizing: border-box; }
.bf-bar-in {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  animation: bf-in 260ms var(--bf-ease) both;
}
@keyframes bf-in { from { opacity: 0; transform: translateY(-3px); } }

.bf-bar a { color: inherit; text-decoration: none; }
.bf-lead { display: inline-flex; align-items: center; gap: 10px; min-width: 0; white-space: nowrap; }
.bf-lead b { color: #fff; font-weight: 600; }

.bf-tag {
  position: relative;
  flex: none;
  overflow: hidden;
  padding: 5px 7px;
  border-radius: 5px;
  background: #fff;
  color: var(--bf-ink);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
}
/* One light pass across the tag as the bar arrives. Never loops. */
.bf-bar .bf-tag::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(11, 11, 11, .16) 50%, transparent 65%);
  transform: translateX(-110%);
  animation: bf-sheen 900ms 420ms cubic-bezier(.4, 0, .2, 1) both;
}
@keyframes bf-sheen { to { transform: translateX(110%); } }

.bf-ends { color: rgba(255, 255, 255, .45); font-size: 12.5px; white-space: nowrap; }
.bf-clock {
  display: inline-flex;
  flex: none;
  gap: 4px;
  font: 500 12px/1 ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.bf-clock span {
  display: inline-flex;
  align-items: baseline;
  padding: 5px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
}
.bf-clock i { padding-left: 1px; color: rgba(255, 255, 255, .55); font-style: normal; }

.bf-cta {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 7px;
  background: #fff;
  color: var(--bf-ink) !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: transform 150ms var(--bf-ease), background-color 150ms ease;
}
.bf-cta svg { width: 13px; height: 13px; transition: transform 150ms var(--bf-ease); }
.bf-cta:active { transform: scale(.97); }
.bf-short { display: none; }

.bf-x {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, .55);
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease, transform 150ms var(--bf-ease);
}
/* A 44px touch target around the 28px button. */
.bf-x::before { content: ""; position: absolute; inset: -8px; }
.bf-x svg { width: 14px; height: 14px; }
.bf-x:active { transform: scale(.95); }
.bf-bar a:focus-visible, .bf-x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 7px; }

@media (hover: hover) and (pointer: fine) {
  .bf-cta:hover { background: rgba(255, 255, 255, .9); }
  .bf-cta:hover svg { transform: translateX(2px); }
  .bf-x:hover { background: rgba(255, 255, 255, .1); color: #fff; }
  .bf-lead:hover .bf-long { color: #fff; }
}
.bf-long { transition: color 150ms ease; }

@media (max-width: 860px) {
  .bf-ends, .bf-more { display: none; }
}
@media (max-width: 620px) {
  .bf-bar { padding-left: 10px; padding-right: 38px; font-size: 13px; }
  .bf-bar-in { gap: 8px; }
  .bf-lead { gap: 8px; }
  .bf-long, .bf-full, .bf-clock .bf-sec { display: none; }
  .bf-short { display: inline; }
  .bf-x { right: 4px; }
  .bf-x::before { right: -4px; }
}
/* A phone has room for the tag, the offer, the clock and the button, not the arrow too. */
@media (max-width: 430px) {
  .bf-cta svg { display: none; }
  .bf-tag { letter-spacing: .05em; }
}

/* ---- pricing: the offer strip above the plan cards ---- */
.bf-offer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bf-ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .72);
  font: 500 14.5px/1.4 var(--site-font-body, var(--font-sans, "Inter Variable", Inter, ui-sans-serif, system-ui, sans-serif));
  text-align: center;
}
.bf-offer b { color: #fff; font-weight: 600; }
.bf-offer .bf-ends { display: inline-flex; align-items: center; gap: 8px; }

/* The monthly list price, struck, on its own line above the discounted one
   (beside it, the longer prices pushed "/ month" out of the card). */
.bf-was {
  display: block;
  flex-basis: 100%;
  width: 100%;
  margin: 0 0 4px;
  color: rgba(18, 18, 18, .42);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  text-decoration-thickness: 1.5px;
}
/* The price row has to wrap for the struck price to take its own line. */
html.bf-sale .price:has(> .bf-was) { flex-wrap: wrap; }
html.bf-sale .annual-list-price { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .bf-bar-in, .bf-bar .bf-tag::after { animation: none; }
  .bf-cta, .bf-cta svg, .bf-x, .bf-long { transition: none; }
}
@media print {
  html.bf-on { padding-top: 0; background-image: none; }
  .bf-bar, .bf-offer { display: none; }
}
