/* Black Friday 2026: the live countdown to the end of the sale, on every page that sells the kit.
   The founder (24 November 2026): at the top of the page, no black background, floating, no extra words: just the
   countdown with "Black Friday sale". So it is one slim strip in the page's own colours that stays at the top while the
   visitor scrolls. It counts to the one real end time (Monday 30 November 2026 at 23:59, South African time), the same
   for every visitor. The numbers are drawn by countdown.js. Lives in assets/bf/, so it is removed with the other Black
   Friday files. */

:root { --cd-h: 48px; }
.cd-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: center; gap: clamp(12px, 2vw, 24px); min-height: var(--cd-h); padding: 4px 16px; background: rgba(250, 249, 245, .9); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); color: var(--ink, #0e0e10); font-family: var(--sans); }
/* on a page that opens in an ad's colour, the strip takes that colour */
.bf .cd-top, .tp .cd-top { background: var(--ground); color: var(--paper, #fffdf7); -webkit-backdrop-filter: none; backdrop-filter: none; }
.cd-name { font: 600 15.5px/1.1 var(--sans); letter-spacing: -.005em; white-space: nowrap; }
.cd-ends { font: 500 15px/1.1 var(--sans); white-space: nowrap; }
.bf .cd-label, .tp .cd-label { opacity: .86; }

/* The numbers. Every digit has its own cell of one fixed width, and the four units share one width, so nothing shifts
   as they change. */
.cd { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: start; column-gap: 7px; font: 600 23px/1 var(--sans); letter-spacing: -.01em; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.cd-unit { display: grid; justify-items: center; gap: 3px; }
.cd-num { display: flex; justify-content: center; min-width: 1.24em; min-height: 1.04em; }
.cd-d { position: relative; display: block; width: .62em; height: 1.04em; overflow: hidden; }
.cd-d span { position: absolute; inset: 0; display: grid; place-items: center; }
.cd-label { font: 600 8.5px/1 var(--sans); letter-spacing: .09em; text-transform: uppercase; opacity: .72; }
.cd-sep { position: relative; width: .14em; height: 1.04em; }
.cd-sep::before, .cd-sep::after { content: ""; position: absolute; left: 0; width: 3px; height: 3px; background: currentColor; }
.cd-sep::before { top: 32%; }
.cd-sep::after { top: 62%; }
.cd-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Until the script has drawn the numbers, their place is kept and left empty, so nothing moves when they arrive. */
.cd-top:not(.on) .cd { visibility: hidden; }
/* A digit that is leaving is not shown unless it is moving: with motion reduced, the new digit simply takes its place. */
.cd-d .cd-leave { opacity: 0; }

/* The buy button (25 November 2026): always on screen while the sale is on. While it shows, the header's own
   "Get the kit" is hidden, so the two are never side by side; it comes back with the sale's end. */
/* the same colours as the header's own buy button on each kind of page */
.cd-buy { flex: none; display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 999px; background: var(--cta, #2b4bff); color: #fff; font: 600 15px/1 var(--sans); text-decoration: none; white-space: nowrap; }
/* a flex box drops the space before the price, so the price keeps its own gap */
.cd-buy-price { margin-left: .3em; }
.cd-buy:hover { background: var(--cta-hover, var(--cta, #2b4bff)); color: #fff; }
.cd-buy:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
.bf .cd-buy, .bf .cd-buy:hover, .tp .cd-buy, .tp .cd-buy:hover { background: var(--tag); color: var(--tag-ink); }
html:not([data-sale-state="ended"]) .cd-top[data-buy] ~ .masthead .nav-buy { display: none; }

/* While the sale is on, the page's own header (which also stays at the top on wide screens) sits under the strip. */
html:not([data-sale-state="ended"]) .cd-top ~ .masthead { top: var(--cd-h); }
/* ... and a link to a place on the page stops below both of them (site.css sets 92px for the header alone). */
html:not([data-sale-state="ended"]) { --header-offset: calc(92px + var(--cd-h)); }

@media (max-width: 760px) {
  /* phones are drawn at 85%, so the sizes here are a little larger than they look */
  :root { --cd-h: 54px; }
  .cd-top { gap: 14px; padding-inline: 12px; }
  .cd-name { font-size: 16.5px; }
  .cd { font-size: 25px; column-gap: 6px; }
  .cd-label { font-size: 9.5px; letter-spacing: .07em; }
  /* with the buy button there is less room: the words take two lines and the numbers are a little smaller */
  .cd-top[data-buy] { justify-content: space-between; gap: 10px; }
  .cd-top[data-buy] .cd-name { font-size: 15px; line-height: 1.05; }
  .cd-top[data-buy] .cd-name-end { display: block; }
  .cd-top[data-buy] .cd { font-size: 21px; column-gap: 4px; }
  .cd-top[data-buy] .cd-label { font-size: 8.5px; letter-spacing: .05em; }
  .cd-buy { min-height: 42px; padding: 0 14px; font-size: 16px; }
}
@media (max-width: 380px) {
  /* small phones: a little less space between the parts, so the strip never makes the page wider than the screen */
  .cd-top[data-buy] { gap: 6px; padding-inline: 8px; }
  .cd-top[data-buy] .cd { font-size: 19px; column-gap: 3px; }
  .cd-top[data-buy] .cd-name { font-size: 14px; }
  .cd-buy { padding: 0 11px; font-size: 15px; }
}
@media (max-width: 350px) {
  .cd-name { font-size: 15px; }
  .cd { font-size: 22px; column-gap: 4px; }
  .cd-top[data-buy] .cd { font-size: 18px; }
  .cd-buy-price { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  /* the numbers fade in once they are drawn */
  .cd-top.on .cd { animation: cd-show .3s ease both; }
  @keyframes cd-show { from { opacity: 0; } to { opacity: 1; } }
  /* the old digit leaves upwards, the new one arrives from below */
  .cd-d .cd-arrive { animation: cd-arrive .5s cubic-bezier(.2, .7, .2, 1) both; }
  .cd-d .cd-leave { animation: cd-leave .5s cubic-bezier(.2, .7, .2, 1) both; }
  @keyframes cd-arrive { from { transform: translateY(64%); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes cd-leave { from { transform: none; opacity: 1; } to { transform: translateY(-64%); opacity: 0; } }
}
