/* =====================================================================
   EPCORAW lockedin.css : the "LOCKED IN" easter egg (#lockedin)
   A heavy steel padlock: chamfered gunmetal body, squared chrome shackle.
   Idle = open, violet pilot light (the cover's colour). Press = the shackle
   slams shut while the vocal plays and the lock lights up acid green.
   JS contract (on button.lockin[data-lockin]):
     data-state idle|playing, .is-hit (one-shots), --px --py (-1..1),
     --hover --press --level (0..1)
   ===================================================================== */

/* ---------- stage: takes the place of the two tapes at the top of #booking ---------- */
.lockin-stage {
  --s: 112px;
  position: relative; display: grid; place-items: center; isolation: isolate; overflow: clip;
  height: clamp(230px, 30vw, 280px); margin-bottom: clamp(8px, 2vw, 28px);
}
/* the invitation: a quiet sonar of hairline rings, a dotted field that fades out, a thin horizon like the tape's edge */
.lockin-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; display: grid; place-items: center;
  --ring: 165, 107, 255;
  -webkit-mask: radial-gradient(ellipse 62% 78% at 50% 50%, #000 20%, transparent 78%);
          mask: radial-gradient(ellipse 62% 78% at 50% 50%, #000 20%, transparent 78%);
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16) 30%, rgba(255, 255, 255, 0.16) 70%, transparent) 50% 50% / 100% 1px no-repeat,
    radial-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1.6px) 50% 50% / 22px 22px;
}
.lockin-stage:has(.lockin[data-state="playing"]) .lockin-bg { --ring: 200, 255, 31; }
.lockin-bg i {
  position: absolute; width: 150px; aspect-ratio: 1; border-radius: 50%; opacity: 0;
  border: 1px solid rgba(var(--ring), 0.55);
  transition: border-color 400ms var(--ease-out);
}
@media (prefers-reduced-motion: no-preference) {
  html:not(.lite) .lockin-bg i { animation: lk-sonar 7.5s cubic-bezier(0.2, 0.6, 0.3, 1) infinite; }
  html:not(.lite) .lockin-bg i:nth-child(2) { animation-delay: 2.5s; }
  html:not(.lite) .lockin-bg i:nth-child(3) { animation-delay: 5s; }
  html:not(.lite) .lockin[data-state="idle"] .lockin__shackle { animation: lk-nudge 7.5s ease-in-out 3s infinite; }
}
@keyframes lk-sonar { 0% { opacity: 0; transform: scale(0.7); } 12% { opacity: 0.5; } 100% { opacity: 0; transform: scale(3.6); } }
@keyframes lk-nudge { 0%, 90%, 100% { rotate: 0deg; } 93% { rotate: 3.5deg; } 96% { rotate: -1.8deg; } 98% { rotate: 0.8deg; } }
@media (prefers-reduced-motion: reduce), (hover: none) { .lockin-bg i:nth-child(1) { opacity: 0.16; transform: scale(1.5); } }
html.lite .lockin-bg i:nth-child(1) { opacity: 0.16; transform: scale(1.5); }

/* ---------- button root ---------- */
.lockin {
  --px: 0; --py: 0; --hover: 0; --press: 0; --level: 0;
  --acc: 165, 107, 255;
  position: relative; display: block; width: var(--s); height: var(--s);
  margin: 0; padding: 0; flex: none; color: var(--fg);
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  perspective: 560px;
}
.lockin[data-state="playing"] { --acc: 200, 255, 31; }
.lockin:focus-visible { outline: 2px solid var(--acid); outline-offset: 8px; }
.lockin > * { pointer-events: none; }
:where(.lockin) :where(span, svg) { display: block; }
:where(.lockin) :where([class*="lockin__"]) { position: absolute; }

/* ---------- glow behind the lock, breathes with the voice ---------- */
.lockin__glow {
  inset: -30%; z-index: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--acc), 0.5) 0, rgba(var(--acc), 0.14) 36%, transparent 64%);
  opacity: calc(0.16 + var(--hover) * 0.14 + var(--level) * 0.78);
  transform: scale(calc(0.86 + var(--level) * 0.22));
  transition: opacity 300ms var(--ease-out);
}
.lockin.is-hit .lockin__glow { animation: lk-glow 600ms var(--ease-out); }
@keyframes lk-glow { 0% { scale: 1.15; filter: brightness(2.4); } 100% { scale: 1; filter: none; } }

/* ---------- tilt + press ---------- */
.lockin__tilt {
  inset: 0; z-index: 1; transform-style: preserve-3d;
  transform: rotateX(calc(var(--py) * -12deg)) rotateY(calc(var(--px) * 14deg))
             scale(calc(1 + var(--hover) * 0.04 - var(--press) * 0.07));
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.7));
}
.lockin__kick { inset: 0; }
.lockin.is-hit .lockin__kick { animation: lk-kick 360ms linear; }
@keyframes lk-kick {
  0% { translate: 0 0; } 14% { translate: 0 5%; } 30% { translate: 3% 0; } 46% { translate: -2% 1%; }
  62% { translate: 1% 0; } 100% { translate: 0 0; }
}

/* ---------- shackle: pivots on its right leg, slams shut ---------- */
.lockin__shackle {
  left: 22%; top: 5%; width: 56%; height: 53%; z-index: 0; overflow: visible;
  transform-origin: 81% 100%;
  transform: translateY(-17%) rotate(calc(-25deg - var(--hover) * 5deg));
  transition: transform 300ms var(--ease-out);
}
.lockin[data-state="playing"] .lockin__shackle {
  transform: none;
  transition: transform 150ms cubic-bezier(0.6, 0, 0.9, 0.4);
}

/* ---------- body: chamfered gunmetal slab ---------- */
.lockin__body {
  left: 11%; right: 11%; top: 46%; height: 46%; z-index: 1;
  clip-path: polygon(7% 0, 93% 0, 100% 15%, 100% 85%, 93% 100%, 7% 100%, 0 85%, 0 15%);
  background: linear-gradient(180deg, #5b6068 0, #23262b 14%, #0e0f12 60%, #2c3036 100%);
}
.lockin__plate {
  inset: 3.5%; clip-path: polygon(7% 0, 93% 0, 100% 15%, 100% 85%, 93% 100%, 7% 100%, 0 85%, 0 15%);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px),
    linear-gradient(calc(160deg + var(--px) * 28deg), #2a2d33 0, #14161a 42%, #0a0b0d 100%);
}
/* light edge along the bottom, takes the state colour */
.lockin__plate::after {
  content: ""; position: absolute; left: 8%; right: 8%; bottom: 0; height: 2px;
  background: rgb(var(--acc)); opacity: calc(0.35 + var(--level) * 0.65);
  box-shadow: 0 0 calc(5px + var(--level) * 12px) rgb(var(--acc));
}
.lockin__plate::before {
  content: ""; position: absolute; left: 8%; top: 12%; width: 6%; aspect-ratio: 1; border-radius: 50%;
  background: #3d4148; box-shadow: calc(var(--s) * 0.5) 0 0 #3d4148;
}

/* keyhole: slit + round, lit from inside */
.lockin__key { left: 50%; top: 20%; width: 15%; aspect-ratio: 1; margin-left: -7.5%; border-radius: 50%; background: #000; box-shadow: 0 0 0 1.5px rgba(var(--acc), 0.9), 0 0 calc(4px + var(--level) * 14px) rgba(var(--acc), 0.9); z-index: 2; }
.lockin__key::after {
  content: ""; position: absolute; left: 50%; top: 78%; width: 56%; height: 120%; margin-left: -28%;
  background: #000; clip-path: polygon(0 0, 100% 0, 80% 100%, 20% 100%);
  box-shadow: 0 0 0 1px rgba(var(--acc), 0.5);
}
.lockin__key::before {
  content: ""; position: absolute; inset: 30%; border-radius: 50%; background: rgb(var(--acc)); opacity: calc(0.25 + var(--level) * 0.75);
}

/* light sweep across the plate on press */
.lockin__sweep { inset: 0; z-index: 3; opacity: 0; background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%); }
.lockin.is-hit .lockin__sweep { animation: lk-sweep 520ms var(--ease-out) 60ms; }
@keyframes lk-sweep { 0% { opacity: 1; transform: translateX(-70%); } 100% { opacity: 0; transform: translateX(70%); } }

/* ---------- reduced motion: keep open/closed, drop shake and sweep ---------- */
@media (prefers-reduced-motion: reduce) {
  .lockin__tilt { transform: none; }
  .lockin.is-hit .lockin__kick, .lockin.is-hit .lockin__sweep, .lockin.is-hit .lockin__glow { animation: none; }
  .lockin__shackle, .lockin[data-state="playing"] .lockin__shackle { transition-duration: 0.001ms; }
}

/* ---------- lite (phones): no filter shadow ---------- */
html.lite .lockin__tilt { filter: none; }
