/*
 * Homepage section 02: the five booking steps beside a day in the Inboxxit
 * calendar where the hero's 2:30 AC diagnostic lands.
 *
 * Static by default (reduced motion, print): every step lit, 2:30 booked,
 * 4:15 free. Only when motion is allowed does it replay on one 12 s loop:
 *
 *   0-18%   step 1  a scan line reads the day
 *   18%     step 2  2:30 and 4:15 are marked "Offered in the chat"
 *   40%     step 3  "2:30 works." appears on the 2:30 slot
 *   55%     step 4  2:30 shows "Re-checking it's still free"
 *   70%     step 5  2:30 becomes the booked AC diagnostic; 4:15 stays free
 *   97%             everything resets
 *
 * Steps light up cumulatively, like a checklist. Pure CSS, no script.
 */
.bk-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px; align-items: center;
}
.bk-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bk-step {
  display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: baseline;
  padding: 12px 0; border-top: 1px solid var(--border);
}
.bk-step:last-child { border-bottom: 1px solid var(--border); }
.bk-n { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--teal); }
.bk-step b { display: block; font-family: var(--archivo); font-size: 1.05rem; }
.bk-step span:not(.bk-n) { display: block; margin-top: 2px; color: var(--text-muted); font-size: .95rem; }

.bk-cal {
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 20px;
  padding: 22px 22px 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.bk-cal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.bk-cal-head b { display: block; font-family: var(--archivo); font-size: 1.15rem; }
.bk-cal-head span:not(.bk-live) { font-size: 12px; color: var(--text-muted); }
.bk-live {
  font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted); border: 1px solid var(--border-strong); border-radius: 99px; padding: 4px 9px;
}
.bk-rows { position: relative; margin-top: 8px; }
.bk-row {
  display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: center;
  min-height: 58px; border-bottom: 1px dashed rgba(255, 255, 255, .06);
}
.bk-row:last-child { border-bottom: 0; }
.bk-t { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.bk-busy {
  padding: 10px 12px; border-radius: 10px; font-size: 13px; color: var(--text-muted);
  background: rgba(255, 255, 255, .05); border-left: 3px solid rgba(255, 255, 255, .22);
}
.bk-slot { position: relative; height: 46px; }
.bk-free, .bk-check, .bk-booked {
  position: absolute; inset: 0; display: flex; align-items: center; gap: 10px;
  padding: 0 12px; border-radius: 10px; font-size: 13px;
}
.bk-free { border: 1px dashed rgba(79, 208, 193, .45); color: var(--ok); }
.bk-offered {
  margin-left: auto; font-family: var(--mono); font-size: 9px; letter-spacing: .1em;
  text-transform: uppercase; padding: 3px 7px; border-radius: 4px;
  background: rgba(18, 181, 166, .18); color: var(--ok); opacity: 0;
}
.bk-check { background: rgba(226, 169, 75, .12); border: 1px solid rgba(226, 169, 75, .4); color: var(--warm); opacity: 0; }
.bk-spin {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid rgba(226, 169, 75, .3); border-top-color: var(--warm);
}
.bk-booked { background: #0e6f66; border: 1px solid var(--teal); color: var(--text); }
.bk-booked b { display: block; font-size: 13px; line-height: 1.2; }
.bk-booked small {
  display: block; font-family: var(--mono); font-size: 9px; letter-spacing: .1em;
  text-transform: uppercase; color: #bff3ec;
}
.bk-tick { width: 22px; height: 22px; border-radius: 50%; flex: none; background: var(--ok); position: relative; }
.bk-tick::after {
  content: ""; position: absolute; left: 8px; top: 4px; width: 5px; height: 10px;
  border: solid #04201e; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
/* The 2:30 slot shows its end state unless the loop is running. */
.bk-free-230 { opacity: 0; }
.bk-yes {
  position: absolute; right: 10px; top: -30px; padding: 6px 10px; border-radius: 12px 12px 4px 12px;
  background: #1a2124; border: 1px solid var(--border-strong); font-size: 12px; opacity: 0;
}
.bk-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 2px; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(18, 181, 166, 0), var(--teal), rgba(18, 181, 166, 0));
  box-shadow: 0 0 14px var(--teal);
}

@media (max-width: 960px) {
  .bk-grid { grid-template-columns: 1fr; gap: 48px; }
}
@media (max-width: 420px) {
  .bk-cal { padding: 18px 14px 14px; }
  .bk-row { grid-template-columns: 58px 1fr; gap: 8px; }
  .bk-offered { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .bk-step-1 { animation: bk-step-1 12s infinite both; }
  .bk-step-2 { animation: bk-step-2 12s infinite both; }
  .bk-step-3 { animation: bk-step-3 12s infinite both; }
  .bk-step-4 { animation: bk-step-4 12s infinite both; }
  .bk-step-5 { animation: bk-step-5 12s infinite both; }
  .bk-scan { animation: bk-scan 12s infinite both; }
  .bk-offered-230 { animation: bk-offered-230 12s infinite both; }
  .bk-offered-415 { animation: bk-offered-415 12s infinite both; }
  .bk-yes { animation: bk-yes 12s infinite both; }
  .bk-free-230 { animation: bk-free-230 12s infinite both; }
  .bk-check { animation: bk-check 12s infinite both; }
  .bk-spin { animation: bk-spin .8s linear infinite; }
  .bk-booked { animation: bk-booked 12s infinite both; }

  @keyframes bk-step-1 { 0%, 96% { opacity: 1; } 98%, 100% { opacity: .35; } }
  @keyframes bk-step-2 { 0%, 17% { opacity: .35; } 19%, 96% { opacity: 1; } 98%, 100% { opacity: .35; } }
  @keyframes bk-step-3 { 0%, 39% { opacity: .35; } 41%, 96% { opacity: 1; } 98%, 100% { opacity: .35; } }
  @keyframes bk-step-4 { 0%, 54% { opacity: .35; } 56%, 96% { opacity: 1; } 98%, 100% { opacity: .35; } }
  @keyframes bk-step-5 { 0%, 69% { opacity: .35; } 71%, 96% { opacity: 1; } 98%, 100% { opacity: .35; } }

  @keyframes bk-scan {
    0%, 2% { top: 0; opacity: 0; }
    3% { opacity: 1; }
    17% { top: 100%; opacity: 1; }
    18%, 100% { top: 100%; opacity: 0; }
  }
  @keyframes bk-offered-230 { 0%, 18% { opacity: 0; } 20%, 54% { opacity: 1; } 56%, 100% { opacity: 0; } }
  @keyframes bk-offered-415 { 0%, 18% { opacity: 0; } 20%, 69% { opacity: 1; } 71%, 100% { opacity: 0; } }
  @keyframes bk-yes {
    0%, 39% { opacity: 0; transform: translateY(6px); }
    41%, 54% { opacity: 1; transform: none; }
    56%, 100% { opacity: 0; transform: none; }
  }
  @keyframes bk-free-230 { 0%, 54% { opacity: 1; } 56%, 100% { opacity: 0; } }
  @keyframes bk-check { 0%, 54% { opacity: 0; } 56%, 69% { opacity: 1; } 71%, 100% { opacity: 0; } }
  @keyframes bk-booked {
    0%, 69% { opacity: 0; transform: scale(.97); }
    71%, 96% { opacity: 1; transform: none; }
    98%, 100% { opacity: 0; transform: none; }
  }
  @keyframes bk-spin { to { transform: rotate(360deg); } }
}
