/* ==========================================================================
 * blackfriday.css - the Black Friday costume (3.22.0).
 *
 * Loaded LAST and unlayered, only while the theme is on - the same contract as
 * christmas.css and halloween.css: unlayered declarations beat every @layer
 * whatever the specificity, so these win over app.css and the legacy Developr
 * sheets without !important. Everything is scoped to html.esz-blackfriday.
 *
 * THE IDEA: THE SHOP IS A MACHINE, AND THE MACHINE IS ON SALE.
 *
 * The chassis is already a carbon console with knobs and a valve-amp lamp, so
 * Black Friday does not need a new metaphor - it needs the machine powered up.
 * Circuit traces behind the wordmark, a chip and a bolt, an electric-green
 * diode on every section, a segmented data bar under every page title, a neon
 * strip under the header, a scanline crossing the page, and a viewfinder
 * bracket on every card.
 *
 * No JavaScript in this theme. The scanline is body::before (free - nothing in
 * the tree uses it), the traces are gradients, the flicker is a keyframe.
 *
 * PRESENTATION ONLY: no percentage, price or deadline is drawn anywhere here.
 * ========================================================================== */


/* --------------------------------------------------------------------------
 * 1. The palette
 * ----------------------------------------------------------------------- */

html.esz-blackfriday {
  --bf-neon:      #22e0a1;
  --bf-neon-lite: #7dffd0;
  --bf-cyan:      #3ad8ff;
  --bf-magenta:   #ff2e88;
  --bf-ink:       #05070a;
  --bf-glow:      rgb(34 224 161 / .55);
  --bf-glow-mag:  rgb(255 46 136 / .5);
}


/* --------------------------------------------------------------------------
 * 2. The sign in the search row
 *
 * Same placement as the other two seasonal signs: first child of .site-search,
 * margin-inline-end:auto, so it owns the empty left half of the row and the
 * field and button keep their place.
 * ----------------------------------------------------------------------- */

html.esz-blackfriday .site-search { align-items: center; }

html.esz-blackfriday .bf-banner {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-inline-end: auto;
  padding: 2px 12px 2px 4px;
  pointer-events: none;
  user-select: none;
}

/* The traces: a printed-circuit fragment behind the words. Three orthogonal
 * line patterns, cheap, and clipped to the banner so they never wander into
 * the search field. */
html.esz-blackfriday .bf-banner__traces {
  position: absolute;
  inset: -4px -6px;
  z-index: -1;
  opacity: .5;
  background-image:
    linear-gradient(90deg, transparent 0 92%, rgb(34 224 161 / .55) 92% 93%, transparent 93%),
    linear-gradient(180deg, transparent 0 60%, rgb(34 224 161 / .35) 60% 61%, transparent 61%),
    radial-gradient(circle 2px at 8px 9px, rgb(34 224 161 / .85) 96%, transparent 100%),
    radial-gradient(circle 2px at calc(100% - 10px) calc(100% - 7px), rgb(58 216 255 / .8) 96%, transparent 100%);
  background-size: 46px 100%, 100% 26px, 34px 20px, 41px 24px;
  background-repeat: repeat-x, repeat-x, repeat-x, repeat-x;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}

html.esz-blackfriday .bf-banner__bolt {
  inline-size: 18px;
  block-size: 18px;
  flex: 0 0 auto;
  filter:
    drop-shadow(0 0 5px var(--bf-neon))
    drop-shadow(0 0 12px rgb(34 224 161 / .5));
}

html.esz-blackfriday .bf-banner__chip {
  inline-size: 21px;
  block-size: 21px;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 6px rgb(34 224 161 / .45));
}

/* The words: a neon tube. White-hot core, two rings of green, and a rare
 * flicker - a sign on its last transformer, not a strobe. The dip is 2% of a
 * 9s cycle, which is one blink every nine seconds. */
html.esz-blackfriday .bf-banner__word {
  font-family: var(--esz-font-display);
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
  padding-inline: 2px;
  color: #eafff6;
  text-shadow:
    0 0 4px #ffffff,
    0 0 9px var(--bf-neon-lite),
    0 0 20px var(--bf-neon),
    0 0 36px rgb(34 224 161 / .55);
  animation: bf-flicker 9s linear infinite;
}

@keyframes bf-flicker {
  0%, 60.9%   { opacity: 1; }
  61%, 61.6%  { opacity: .55; }
  61.7%, 62.4% { opacity: 1; }
  62.5%, 62.9% { opacity: .7; }
  63%, 100%    { opacity: 1; }
}


/* --------------------------------------------------------------------------
 * 3. The header's bottom strip and lamp
 *
 * The mint backlit strip becomes a magenta-to-green neon rail; the warm lamp
 * under the header goes cold, so the cabinet reads as powered by something
 * else for the week.
 * ----------------------------------------------------------------------- */

html.esz-blackfriday .site-header::after {
  block-size: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--bf-magenta) 12%,
    var(--bf-neon) 50%,
    var(--bf-cyan) 88%,
    transparent 100%);
  box-shadow:
    0 0 8px var(--bf-glow),
    0 0 20px var(--bf-glow-mag);
  background-size: 200% 100%;
  animation: bf-rail 6s ease-in-out infinite;
}

@keyframes bf-rail {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

html.esz-blackfriday .site-header::before {
  background-image:
    linear-gradient(180deg,
      rgb(34 224 161 / .16) 0%,
      rgb(58 216 255 / .07) 8%,
      rgb(255 46 136 / .03) 18%,
      transparent 34%),
    radial-gradient(70% 120% at 50% 0%,
      rgb(34 224 161 / .14) 0%,
      rgb(58 216 255 / .05) 45%,
      transparent 75%);
}


/* --------------------------------------------------------------------------
 * 4. The section marker - a lit diode
 *
 * Square, not round, with a hard rim and a wide bloom: the LED on a front
 * panel rather than a glass bauble.
 * ----------------------------------------------------------------------- */

html.esz-blackfriday .section-head__label::before {
  background:
    radial-gradient(circle at 50% 45%, #ffffff 0 16%, var(--bf-neon-lite) 42%, var(--bf-neon) 78%, #0a3a2c 100%);
  border-radius: 1px;
  transform: scale(1.25) rotate(45deg);
  box-shadow:
    0 0 0 1px rgb(5 7 10 / .9),
    0 0 10px 2px var(--bf-glow),
    0 0 22px 4px rgb(34 224 161 / .3),
    inset 0 -1px 1px rgb(0 0 0 / .5);
}


/* --------------------------------------------------------------------------
 * 5. The rule under the page title - a segmented data bar
 *
 * Sixteen equal cells with a gap, the way a level meter or a data bus reads,
 * plus a highlight that travels along it. The base rule is 3px; this is 5px.
 * ----------------------------------------------------------------------- */

html.esz-blackfriday .page-head h1::after {
  inline-size: 7rem;
  block-size: 5px;
  border-radius: 1px;
  background-image:
    linear-gradient(90deg, rgb(255 255 255 / .85) 0 6px, transparent 6px 100%),
    repeating-linear-gradient(90deg,
      var(--bf-neon) 0 9px,
      transparent 9px 14px);
  background-size: 200% 100%, 100% 100%;
  background-repeat: no-repeat, no-repeat;
  box-shadow:
    0 0 10px 0 var(--bf-glow),
    0 0 24px -4px var(--bf-glow-mag);
  animation: bf-data 3.4s linear infinite;
}

@keyframes bf-data {
  0%   { background-position: -100% 0, 0 0; }
  100% { background-position: 200% 0, 0 0; }
}

@media (max-width: 47.99rem) {
  html.esz-blackfriday .page-head h1::after { inline-size: 5.5rem; }
}


/* --------------------------------------------------------------------------
 * 6. Panels - a neon rail along the top edge
 *
 * background-image, for the same reason as the other two themes: .panel is
 * not a positioning context and making it one could move positioned children.
 * ----------------------------------------------------------------------- */

html.esz-blackfriday .panel:not(.panel--flush) {
  background-image:
    linear-gradient(90deg,
      var(--bf-neon) 0%,
      var(--bf-cyan) 45%,
      var(--bf-magenta) 100%);
  background-repeat: no-repeat;
  background-size: 100% 2px;
  background-position: top left;
}

html.esz-blackfriday .panel--flush {
  /* The artwork variant: a rail across the masthead stage would cut the
   * picture, not decorate it. */
  background-image: none;
}


/* --------------------------------------------------------------------------
 * 7. Product cards - a viewfinder bracket
 *
 * Two corner marks and a hairline along the top: what a camera puts on the
 * frame. Four gradient layers on one pseudo-element, no extra markup, and the
 * card already clips its contents.
 * ----------------------------------------------------------------------- */

html.esz-blackfriday .product-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background-image:
    linear-gradient(var(--bf-neon), var(--bf-neon)),
    linear-gradient(var(--bf-neon), var(--bf-neon)),
    linear-gradient(var(--bf-neon), var(--bf-neon)),
    linear-gradient(rgb(34 224 161 / .55), rgb(34 224 161 / .55)),
    linear-gradient(var(--bf-magenta), var(--bf-magenta));
  background-size:
    16px 2px, 2px 16px, 16px 2px, 100% 1px, 22px  2px;
  background-position:
    0 0, 0 0, 100% 100%, 0 0, 100% 100%;
  background-repeat: no-repeat;
  opacity: .9;
  filter: drop-shadow(0 0 4px rgb(34 224 161 / .55));
}


/* --------------------------------------------------------------------------
 * 8. The footer
 * ----------------------------------------------------------------------- */

html.esz-blackfriday .site-footer {
  border-block-start: 2px solid transparent;
  border-image: linear-gradient(90deg,
      var(--bf-magenta) 0%,
      var(--bf-neon) 50%,
      var(--bf-cyan) 100%) 1;
}

html.esz-blackfriday .site-footer a { color: var(--bf-neon-lite); }
html.esz-blackfriday .site-footer a:hover { color: var(--bf-cyan); }


/* --------------------------------------------------------------------------
 * 9. The scanline
 *
 * One fixed band crossing the page every twelve seconds, at 7% opacity. It
 * sits above the page but under nothing interactive (pointer-events:none), and
 * body::before is unused everywhere else in the tree - which is why it can be
 * borrowed here without adding markup or wrapping the shell (a ::after on
 * .shell would become a grid item, and .shell IS a grid).
 * ----------------------------------------------------------------------- */

html.esz-blackfriday body::before {
  content: "";
  position: fixed;
  inset-inline: 0;
  block-size: 22vh;
  z-index: 44;
  pointer-events: none;
  background-image: linear-gradient(180deg,
    transparent 0%,
    rgb(34 224 161 / .05) 40%,
    rgb(58 216 255 / .07) 55%,
    transparent 100%);
  animation: bf-scan 12s linear infinite;
}

@keyframes bf-scan {
  from { inset-block-start: -22vh; }
  to   { inset-block-start: 100vh; }
}


/* --------------------------------------------------------------------------
 * 10. The legacy shell
 * ----------------------------------------------------------------------- */

html.esz-blackfriday .esz-legacy-season--blackfriday {
  display: flex;
  justify-content: center;
  padding-block: 8px;
  background-image: linear-gradient(180deg, rgb(5 7 10 / .9), transparent);
}

html.esz-blackfriday .esz-legacy-season--blackfriday .bf-banner {
  margin-inline: 0;
  padding-inline: 0;
}


/* --------------------------------------------------------------------------
 * 11. Small screens and reduced motion
 * ----------------------------------------------------------------------- */

@media (max-width: 63.99rem) {
  /* The words go first - the field needs the room - but the bolt and the chip
   * stay, so the sign still reads as hardware. */
  html.esz-blackfriday .bf-banner__word { display: none; }
  html.esz-blackfriday .bf-banner { padding-inline-end: var(--esz-space-2); gap: 5px; }
  html.esz-blackfriday .bf-banner__bolt { inline-size: 15px; block-size: 15px; }
  html.esz-blackfriday .bf-banner__chip { inline-size: 18px; block-size: 18px; }
}

@media (max-width: 20rem) {
  html.esz-blackfriday .bf-banner__chip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html.esz-blackfriday .bf-banner__word,
  html.esz-blackfriday .site-header::after,
  html.esz-blackfriday .page-head h1::after { animation: none; }

  html.esz-blackfriday .page-head h1::after { background-position: 0 0, 0 0; }

  /* A moving band across the page is exactly what this setting is about. */
  html.esz-blackfriday body::before { display: none; }
}
