/* =====================
   TIGERBEATZ — Intro
   4 kicks → drop (red flash + logo slam) → claw cuts → name → wipe out
   Flat colour, film grain, printed textures. No glows.
   ===================== */

html.tb-intro-lock, html.tb-intro-lock body { overflow: hidden !important; }

.tb-intro {
  --tb-red: #e60023;
  --tb-white: #f5f5f5;
  --tb-ease: cubic-bezier(.77, 0, .18, 1);
  /* speckle mask: mostly solid with small worn-out holes (printed look) */
  --tb-wear: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='w'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  -18 0 0 0 12.6'/></filter><rect width='100%25' height='100%25' filter='url(%23w)'/></svg>");

  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000;
  color: var(--tb-white);
  font-family: 'Inter', system-ui, sans-serif;
  overflow: hidden;
  clip-path: inset(0 0 0 0); /* needed so the exit wipe can interpolate */
  animation: tbExit .75s var(--tb-ease) 3.6s forwards;
}

/* ---------- Film grain (top layer) ---------- */
.tb-intro__grain {
  position: absolute;
  inset: -50%;
  z-index: 20;
  pointer-events: none;
  opacity: .13;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  animation: tbGrain .5s steps(6) infinite;
}

/* soft vignette, black only */
.tb-intro__vignette {
  position: absolute;
  inset: 0;
  z-index: 19;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.75) 100%);
}

/* ---------- Drop flash: one red frame with halftone ---------- */
.tb-intro__flash {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  background-color: var(--tb-red);
  background-image: radial-gradient(circle, #000 34%, transparent 36%);
  background-size: 7px 7px;
  animation: tbFlash .55s steps(1, end) 1.4s forwards;
}

/* ---------- Corner details ---------- */
.tb-intro__meta {
  position: absolute;
  z-index: 15;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: rgba(245,245,245,.5);
  opacity: 0;
  animation: tbMetaIn .4s ease-out .15s forwards;
}
.tb-intro__meta--tl { top: 22px; left: 22px; }
.tb-intro__meta--tr { top: 22px; right: 22px; }
.tb-intro__meta--bl { bottom: 24px; left: 22px; }
.tb-intro__meta b { color: var(--tb-red); font-weight: 600; }
.tb-intro__rec {
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 8px;
  vertical-align: 1px;
  background: var(--tb-red);
  border-radius: 50%;
  animation: tbBlink .6s steps(1) infinite;
}

/* ---------- Stage ---------- */
.tb-intro__stage {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.4vh, 22px);
  animation: tbShake .4s steps(8) 1.4s;
}

/* ---------- Equalizer ---------- */
.tb-intro__eq {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: clamp(3px, .5vw, 5px);
  height: clamp(80px, 14vh, 130px);
  transform: translate(-50%, -50%);
  animation: tbEqOut .2s var(--tb-ease) 1.36s forwards;
}
.tb-intro__eq span {
  display: block;
  width: clamp(3px, .45vw, 5px);
  height: 100%;
  background: var(--tb-red);
  transform: scaleY(.04);
  animation: tbBar .3s cubic-bezier(.1,.9,.2,1) calc(.2s + var(--d, 0s)) 4;
}
.tb-intro__eq span:nth-child(odd) { background: var(--tb-white); }

/* ---------- Claw cuts ---------- */
.tb-intro__claws {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: min(92vw, 640px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.tb-intro__claws svg { display: block; width: 100%; height: auto; overflow: visible; }
.tb-intro__claws path {
  fill: var(--tb-red);
  clip-path: inset(0 0 100% 0);
  animation:
    tbCut .22s cubic-bezier(.6,0,.2,1) forwards,
    tbScar .6s ease-out forwards;
}
.tb-intro__claws path:nth-child(1) { animation-delay: 1.85s, 2.2s; }
.tb-intro__claws path:nth-child(2) { animation-delay: 1.91s, 2.26s; }
.tb-intro__claws path:nth-child(3) { animation-delay: 1.97s, 2.32s; }

/* ---------- Logo ---------- */
.tb-intro__logo {
  position: relative;
  z-index: 3;
  width: clamp(84px, 16vmin, 150px);
  aspect-ratio: 760 / 640;
  opacity: 0;
  -webkit-mask-image: var(--tb-wear);
          mask-image: var(--tb-wear);
  animation: tbSlam .34s cubic-bezier(.2,1.25,.4,1) 1.4s forwards;
}
.tb-intro__logo img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Name ---------- */
.tb-intro__name {
  position: relative;
  z-index: 3;
  font-family: 'Road Rage', 'Inter', system-ui, sans-serif;
  font-size: clamp(50px, 13vw, 136px);
  line-height: .95;
  color: var(--tb-red);
  white-space: nowrap;
  -webkit-mask-image: var(--tb-wear);
          mask-image: var(--tb-wear);
  -webkit-mask-size: 120px; mask-size: 120px;
  clip-path: polygon(0 0, 0 0, -20% 100%, -20% 100%);
  animation: tbReveal .5s var(--tb-ease) 2.05s forwards;
}

/* ---------- Tagline ---------- */
.tb-intro__tag {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(10px, 1.3vw, 12px);
  font-weight: 600;
  letter-spacing: .32em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--tb-white);
  opacity: 0;
  animation: tbFadeUp .45s ease-out 2.45s forwards;
}
.tb-intro__tag::before, .tb-intro__tag::after {
  content: '';
  width: clamp(18px, 4vw, 40px);
  height: 1px;
  background: rgba(245,245,245,.35);
}
.tb-intro__tag b { color: var(--tb-red); font-weight: 600; }

/* ---------- Skip ---------- */
.tb-intro__skip {
  position: absolute;
  right: 22px;
  bottom: 18px;
  z-index: 21;
  padding: 6px 0;
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(245,245,245,.35);
  color: rgba(245,245,245,.7);
  font: 600 10px/1 'Inter', system-ui, sans-serif;
  letter-spacing: .22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.tb-intro__skip:hover, .tb-intro__skip:focus-visible { color: var(--tb-red); border-color: var(--tb-red); outline: none; }

/* ---------- Exit: wipe up with a hard red leading edge ---------- */
.tb-intro__edge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 22;
  height: 5px;
  background: var(--tb-red);
  transform: translateY(100%);
  animation: tbEdge .75s var(--tb-ease) 3.6s forwards;
}
.tb-intro.is-leaving,
.tb-intro.is-leaving .tb-intro__edge { animation-delay: 0s !important; }

/* ---------- Keyframes ---------- */
@keyframes tbGrain {
  0%   { transform: translate(0, 0); }
  17%  { transform: translate(-6%, 4%); }
  33%  { transform: translate(5%, -7%); }
  50%  { transform: translate(-3%, -4%); }
  67%  { transform: translate(7%, 3%); }
  83%  { transform: translate(-5%, 6%); }
  100% { transform: translate(2%, -2%); }
}
@keyframes tbMetaIn { to { opacity: 1; } }
@keyframes tbBlink { 50% { opacity: 0; } }
@keyframes tbBar {
  0%   { transform: scaleY(.04); }
  18%  { transform: scaleY(var(--h, 1)); }
  100% { transform: scaleY(.04); }
}
@keyframes tbEqOut { to { opacity: 0; transform: translate(-50%, -50%) scaleY(0); } }
@keyframes tbFlash {
  0%   { opacity: 1; background-size: 7px 7px; }
  20%  { opacity: 1; background-color: #000; background-image: radial-gradient(circle, var(--tb-red) 26%, transparent 28%); }
  38%, 100% { opacity: 0; }
}
@keyframes tbSlam {
  0%   { opacity: 1; transform: scale(1.5) translateX(-8px); }
  35%  { transform: scale(.96) translateX(5px); }
  60%  { transform: scale(1.01) translateX(-2px); }
  100% { opacity: 1; transform: scale(1) translateX(0); }
}
@keyframes tbShake {
  0%, 100% { transform: translate(0, 0); }
  12% { transform: translate(-7px, 3px); }
  25% { transform: translate(6px, -4px); }
  37% { transform: translate(-4px, -2px); }
  50% { transform: translate(3px, 3px); }
  62% { transform: translate(-2px, 1px); }
  75% { transform: translate(1px, -1px); }
}
@keyframes tbCut   { to { clip-path: inset(0 0 0 0); } }
@keyframes tbScar  { to { fill: #3a0009; } }
@keyframes tbReveal { to { clip-path: polygon(0 0, 120% 0, 100% 100%, -20% 100%); } }
@keyframes tbFadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes tbExit { to { clip-path: inset(0 0 100% 0); } }
@keyframes tbEdge { to { transform: translateY(0); bottom: 100%; } }

/* ---------- Reduced motion: short, calm fade ---------- */
@media (prefers-reduced-motion: reduce) {
  .tb-intro, .tb-intro * { animation: none !important; }
  .tb-intro__eq, .tb-intro__flash, .tb-intro__edge { display: none; }
  .tb-intro__logo, .tb-intro__tag, .tb-intro__meta { opacity: 1; transform: none; }
  .tb-intro__name { clip-path: none; }
  .tb-intro__claws path { clip-path: none; fill: #3a0009; }
  .tb-intro { transition: opacity .4s; }
  .tb-intro.is-leaving { opacity: 0; }
}
