/* ============================================================
   TEMPORARY Black Week 2026 hero (27 Nov to 4 Dec 2026).
   Markup: templates/home-rebuild/_hero-black-week.html.twig
   Loaded by home.html.twig only while the hero is shown.

   Base rules describe the FINAL state: switch OFF, dark hero, all
   copy visible. The intro (switch ON on a light hero, flip to OFF,
   hero turns dark, copy appears line by line) is layered on top with
   CSS animations, only when the visitor accepts motion. Every element
   keeps its box from the first paint: opacity, colour and transform
   only, so the page never shifts.
   ============================================================ */

.cl-home .bw-hero {
  --bw-track-w: 112px;
  --bw-track-h: 56px;
  --bw-pad: 6px;
  --bw-knob: calc(var(--bw-track-h) - 2 * var(--bw-pad));
  --bw-travel: calc(var(--bw-track-w) - var(--bw-knob) - 2 * var(--bw-pad));
  --bw-flip: .75s;                       /* when the switch flips to OFF */
  --bw-copy: calc(var(--bw-flip) + .5s); /* when the first line of copy appears */
  background: #fff;
  color: #fff;
}
.cl-home .bw-hero .cl-hero__grid { padding-block: clamp(28px, 3.6vw, 52px) clamp(40px, 4.4vw, 64px); }

/* ---- dark scene + orange halo (fade in over the light hero) ---- */
.bw-hero__dark, .bw-hero__halo { position: absolute; inset: 0; pointer-events: none; }
.bw-hero__dark { background: linear-gradient(135deg, #014360 0%, #012838 46%, #010b11 100%); }
.bw-hero__halo {
  background:
    radial-gradient(42% 58% at 74% 46%, rgba(255, 151, 53, .30), transparent 70%),
    radial-gradient(30% 40% at 12% 8%, rgba(255, 151, 53, .14), transparent 70%);
}

/* ---- switch ---- */
.bw-hero__switch-row { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.cl-home .bw-switch {
  display: inline-flex; align-items: center; gap: 16px;
  min-height: 56px; padding: 4px 6px 4px 0; margin: 0;
  border: 0; background: none; color: #fff; border-radius: 999px;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.bw-switch__label {
  font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1; letter-spacing: .06em;
}
.bw-switch__track {
  position: relative; flex: none; width: var(--bw-track-w); height: var(--bw-track-h); border-radius: 999px;
  background: #010f17;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, .65),
    inset 0 -1px 0 rgba(255, 255, 255, .10),
    0 0 0 2px rgba(255, 151, 53, .60),
    0 0 34px 2px rgba(255, 151, 53, .45);
}
.bw-switch__knob {
  position: absolute; top: var(--bw-pad); left: var(--bw-pad);
  width: var(--bw-knob); height: var(--bw-knob); border-radius: 50%;
  background-color: #ff9735;
  background-image: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0) 46%);
  box-shadow: inset 0 -5px 9px rgba(0, 0, 0, .22), 0 4px 10px rgba(0, 0, 0, .45), 0 0 22px rgba(255, 151, 53, .75);
}
.bw-switch__state { display: grid; flex: none; }
.bw-switch__on, .bw-switch__off {
  grid-area: 1 / 1; justify-self: start; padding: 7px 13px; border-radius: 999px;
  font-family: var(--mono); font-weight: 700; font-size: 13px; line-height: 1; letter-spacing: .16em;
}
.bw-switch__on { background: #014360; color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); opacity: 0; }
.bw-switch__off { background: #ff9735; color: #011a23; }

/* switched back on by the visitor (JS), before it falls back to OFF */
.bw-switch.is-on .bw-switch__track { background: #0a5b79; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .45), 0 0 0 2px rgba(255, 255, 255, .55); }
.bw-switch.is-on .bw-switch__knob { transform: translateX(var(--bw-travel)); background-color: #fff; box-shadow: inset 0 -5px 9px rgba(0, 0, 0, .16), 0 4px 10px rgba(0, 0, 0, .4); }
.bw-switch.is-on .bw-switch__on { opacity: 1; }
.bw-switch.is-on .bw-switch__off { opacity: 0; }

/* "Nice try" line: its room is always reserved, so showing it moves nothing */
.cl-home .bw-hero__egg {
  margin: 0; min-height: 1.45em; font-size: 15px; font-weight: 700; line-height: 1.45; color: #ffb56e;
}

/* ---- copy ---- */
.cl-home .bw-hero .bw-hero__title {
  margin-top: var(--s4); color: #fff;
  font-size: clamp(60px, 7.4cqw, 96px); font-weight: 800; line-height: .88; letter-spacing: -.02em;
}
.bw-hero__title span { display: block; }
.bw-hero__title .accent { color: #ff9735; }
.cl-home .bw-hero__tagline {
  margin: var(--s4) 0 0; color: #fff;
  font-family: var(--display); font-weight: 700; font-size: clamp(26px, 3.2cqw, 40px); line-height: 1.08;
}
.cl-home .bw-hero__detail {
  margin: var(--s2) 0 0; max-width: 540px; color: rgba(255, 255, 255, .88);
  font-size: var(--t-lead); line-height: 1.45;
}
.cl-home .bw-hero__vip {
  margin: var(--s4) 0 0; max-width: 540px; padding: 12px 16px; border-radius: 14px;
  border: 1px solid rgba(255, 151, 53, .55); background: rgba(255, 151, 53, .10);
  color: #fff; font-size: 15px; font-weight: 600; line-height: 1.45;
}
.cl-home .bw-hero__terms { margin: var(--s4) 0 0; font-size: 13px; }
.cl-home .bw-hero__terms a { color: rgba(255, 255, 255, .82); text-decoration: underline; text-underline-offset: 3px; }
.cl-home .bw-hero__terms a:hover { color: #fff; }
.cl-home .bw-hero .receipt-print { filter: drop-shadow(0 30px 46px rgba(0, 0, 0, .55)); }

@container app (max-width: 680px) {
  .cl-home .bw-hero { --bw-track-w: 100px; --bw-track-h: 52px; }
  .bw-switch__label { font-size: 26px; }
  .cl-home .bw-hero__egg { min-height: 2.9em; }
  .cl-home .bw-hero .cl-hero__cta .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   INTRO (motion allowed): starts from the light hero with the
   switch ON, then plays once to the final state above.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .bw-hero__dark, .bw-hero__halo { animation: bw-fade .7s ease var(--bw-flip) both; }
  .bw-switch__label { animation: bw-label .5s ease var(--bw-flip) both; }
  .bw-switch__track { animation: bw-track .5s ease var(--bw-flip) both; }
  .bw-switch__knob { animation: bw-knob .55s cubic-bezier(.3, 1.5, .5, 1) var(--bw-flip) both; }
  .bw-switch__on { animation: bw-fade .3s ease var(--bw-flip) both reverse; }
  .bw-switch__off { animation: bw-fade .3s ease var(--bw-flip) both; }

  .bw-step { animation: bw-rise .6s cubic-bezier(.2, .7, .2, 1) both; }
  .bw-step--1 { animation-delay: var(--bw-copy); }
  .bw-step--2 { animation-delay: calc(var(--bw-copy) + .14s); }
  .bw-step--3 { animation-delay: calc(var(--bw-copy) + .28s); }
  .bw-step--4 { animation-delay: calc(var(--bw-copy) + .42s); }
  .bw-step--5 { animation-delay: calc(var(--bw-copy) + .56s); }
  .bw-step--6 { animation-delay: calc(var(--bw-copy) + .70s); }

  /* once the visitor has used the switch, the intro no longer drives it */
  .bw-touched .bw-switch__track, .bw-touched .bw-switch__on, .bw-touched .bw-switch__off { animation: none; transition: background-color .25s ease, box-shadow .25s ease, opacity .2s ease; }
  .bw-touched .bw-switch__knob { animation: none; transition: transform .26s cubic-bezier(.3, 1.3, .5, 1), background-color .26s ease; }
  .bw-touched .bw-switch.is-bounce .bw-switch__knob { animation: bw-bounce .62s cubic-bezier(.3, .7, .3, 1) both; }
  .bw-hero__egg.is-shown { animation: bw-rise .35s ease both; }
}

@keyframes bw-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bw-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes bw-label { from { color: #014360; } }
@keyframes bw-track {
  from { background: #014360; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .35), 0 0 0 2px rgba(1, 67, 96, .25), 0 0 0 0 rgba(255, 151, 53, 0); }
}
@keyframes bw-knob {
  from { transform: translateX(var(--bw-travel)); background-color: #fff; box-shadow: inset 0 -5px 9px rgba(0, 0, 0, .16), 0 4px 10px rgba(0, 0, 0, .3), 0 0 0 rgba(255, 151, 53, 0); }
}
@keyframes bw-bounce {
  0%   { transform: translateX(var(--bw-travel)); }
  48%  { transform: translateX(-7px); }
  70%  { transform: translateX(4px); }
  86%  { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}
