/* =====================================================================
   58 - Cinematic header + HUD kit of the showcase pages (features, drop rates, limited rares)
   components/cine-hero.blade.php, js/ui/cine.js. Tones: red (default), gold, blue.
   Everything that moves sits in the prefers-reduced-motion block at the end.
   ===================================================================== */

.cine, .cine-body { --tone: var(--accent-hot); --tone-soft: rgba(220, 31, 41, .35); --tone-2: #ff7a2e; }
.tone-gold { --tone: #ffb02e; --tone-soft: rgba(255, 176, 46, .32); --tone-2: #ff5a2e; }
.tone-blue { --tone: #4aa3ff; --tone-soft: rgba(74, 163, 255, .3); --tone-2: #b46bff; }
.cine-mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace; letter-spacing: .06em; }

/* ---------- the header ---------- */
.cine {
    position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: flex-end;
    min-height: clamp(520px, 86vh, 860px); padding: calc(var(--nav-h) + 70px) 0 110px;
    background: var(--ink-950); color: var(--text);
}
.cine-art { position: absolute; inset: -30px; z-index: -6; transform: translate3d(var(--px, 0), var(--py, 0), 0); }
.cine-art-img { position: absolute; inset: 0; background: center 12% / cover no-repeat; filter: saturate(.85) contrast(1.08) brightness(.62); }
.cine-art::after { /* colour grade: crimson in the shadows, the page colour at the bottom */
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(7, 7, 8, .55) 0%, rgba(7, 7, 8, .05) 38%, rgba(7, 7, 8, .7) 78%, var(--ink-950) 100%),
        radial-gradient(90% 70% at 20% 30%, var(--tone-soft), transparent 60%);
    mix-blend-mode: normal;
}
.cine-fire { position: absolute; inset: 0; z-index: -5; width: 100%; height: 100%; object-fit: cover; opacity: .32; mix-blend-mode: screen; pointer-events: none; }
.cine-fog { position: absolute; z-index: -4; width: 70vw; height: 70vw; max-width: 1100px; max-height: 1100px; border-radius: 50%; pointer-events: none; filter: blur(40px); }
.cine-fog-1 { left: -18vw; bottom: -38vw; background: radial-gradient(circle, rgba(170, 170, 180, .16), transparent 62%); }
.cine-fog-2 { right: -22vw; top: -30vw; background: radial-gradient(circle, var(--tone-soft), transparent 64%); opacity: .55; }
.cine-embers { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; pointer-events: none; }
.cine-scan { /* CRT lines + grain */
    position: absolute; inset: 0; z-index: -2; pointer-events: none; opacity: .5;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .28) 0 1px, transparent 1px 3px), var(--tex-grunge) center / 600px;
    mix-blend-mode: multiply;
}
.cine-vignette { position: absolute; inset: 0; z-index: -1; pointer-events: none; box-shadow: inset 0 0 220px 40px rgba(0, 0, 0, .85); }

/* HUD frame */
.cine-hud { position: absolute; inset: calc(var(--nav-h) + 18px) 22px 22px; z-index: 1; pointer-events: none; color: rgba(241, 238, 232, .7); }
.cine-hud-corner { position: absolute; width: 34px; height: 34px; border: 0 solid var(--tone); opacity: .85; }
.cine-hud-corner.tl { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.cine-hud-corner.tr { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.cine-hud-corner.bl { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.cine-hud-corner.br { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }
.cine-hud-code, .cine-hud-rec { position: absolute; top: 10px; font: 600 .7rem/1 ui-monospace, Consolas, monospace; letter-spacing: .14em; }
.cine-hud-code { left: 48px; }
.cine-hud-rec { right: 48px; display: inline-flex; align-items: center; gap: 8px; }
.cine-hud-rec i { width: 8px; height: 8px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 10px var(--tone); }
.cine-hud-rec b { font-weight: 700; color: #fff; }
.cine-hud-ruler { /* tick marks along the bottom */
    position: absolute; left: 48px; right: 48px; bottom: 8px; height: 8px; opacity: .45;
    background: repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 12px) bottom / 100% 4px no-repeat,
        repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 120px) bottom / 100% 8px no-repeat;
}

/* the words */
.cine-inner { position: relative; z-index: 2; transform: translate3d(var(--px, 0), var(--py, 0), 0); }
.cine-eyebrow {
    display: inline-flex; align-items: center; gap: 12px; padding: 6px 14px 6px 0; margin-bottom: 18px;
    font: 700 .78rem/1 ui-monospace, Consolas, monospace; letter-spacing: .2em; text-transform: uppercase; color: var(--tone);
    background: linear-gradient(90deg, rgba(7, 7, 8, .75), rgba(7, 7, 8, 0));
}
.cine-stripes { width: 46px; height: 20px; background: repeating-linear-gradient(-45deg, var(--tone) 0 6px, transparent 6px 12px); }
.cine-title {
    position: relative; margin: 0; font: 400 clamp(3.6rem, 13vw, 10.5rem)/.86 var(--font-display); letter-spacing: .01em; color: #fff;

}
.cine-title > span { /* worn letters: bone-white paint, darker where it wore off (the grunge texture inside the letters) */
    display: inline-block; color: transparent;
    background: var(--tex-grunge) center / 380px, linear-gradient(180deg, #ffffff 0%, #e9e3d8 55%, #b9b0a2 100%);
    background-blend-mode: multiply; -webkit-background-clip: text; background-clip: text;
    filter: drop-shadow(0 0 26px var(--tone-soft)) drop-shadow(0 5px 0 rgba(0, 0, 0, .45));
}
.cine-title::before, .cine-title::after { /* glitch copies (shown only while .is-glitch) */
    content: attr(data-text); position: absolute; inset: 0; pointer-events: none; opacity: 0;
}
.cine-title::before { color: var(--tone); transform: translate(-4px, 0); }
.cine-title::after { color: #4af2ff; transform: translate(4px, 0); mix-blend-mode: screen; }
.cine-lead { max-width: 640px; margin: 18px 0 0; font-size: clamp(1rem, 1.6vw, 1.2rem); line-height: 1.7; color: rgba(241, 238, 232, .86); text-shadow: 0 2px 12px rgba(0, 0, 0, .8); }
.cine-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.cine-down { position: absolute; left: 50%; bottom: 36px; z-index: 3; width: 26px; height: 42px; margin-left: -13px; border: 2px solid rgba(241, 238, 232, .55); border-radius: 14px; }
.cine-down span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--tone); }

/* ---------- HUD kit (inside the pages) ---------- */
.cine-body { position: relative; padding-top: 70px; }
.hud-stat {
    position: relative; min-width: 150px; padding: 14px 18px 12px; background: rgba(7, 7, 8, .62); backdrop-filter: blur(6px);
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); border-top: 2px solid var(--tone);
}
.hud-stat b { display: block; font: 400 2.4rem/1 var(--font-display); color: #fff; font-variant-numeric: tabular-nums; }
.hud-stat span { display: block; margin-top: 4px; font: 600 .68rem/1.3 ui-monospace, Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; color: rgba(241, 238, 232, .65); }
.hud-stat small { font-size: .9rem; color: var(--text-faint); }

/* a panel with cut corners and a thin glowing frame */
.hud {
    --cut: 18px;
    position: relative; isolation: isolate; padding: 22px;
    background: linear-gradient(160deg, rgba(255, 255, 255, .035), transparent 40%), var(--plate);
    clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.hud::before { /* the frame, cut the same way */
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; padding: 1px;
    background: linear-gradient(135deg, var(--tone), rgba(255, 255, 255, .08) 30%, rgba(255, 255, 255, .04) 70%, var(--tone));
    clip-path: inherit;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.hud-tag { display: inline-flex; align-items: center; gap: 8px; font: 700 .72rem/1 ui-monospace, Consolas, monospace; letter-spacing: .16em; text-transform: uppercase; color: var(--tone); }
.hud-tag::before { content: ''; width: 18px; height: 2px; background: currentColor; box-shadow: 0 0 8px currentColor; }
.hud-divider { height: 14px; margin: 0 0 54px; opacity: .55;
    background: repeating-linear-gradient(-45deg, var(--tone) 0 8px, transparent 8px 22px); clip-path: polygon(0 0, 30% 0, 32% 100%, 0 100%, 0 0, 68% 0, 100% 0, 100% 100%, 70% 100%); }

@media (max-width: 767.98px) {
    .cine { min-height: 560px; padding-bottom: 90px; }
    .cine-hud { inset: calc(var(--nav-h) + 10px) 10px 12px; }
    .cine-hud-code { left: 40px; font-size: .58rem; max-width: 50%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .cine-hud-rec { right: 40px; font-size: .58rem; }
    .cine-stats { gap: 8px; }
    .hud-stat { min-width: calc(50% - 4px); flex: 1 1 calc(50% - 4px); padding: 12px 12px 10px; }
    .hud-stat b { font-size: 1.9rem; }
    .cine-down { display: none; }
}

/* =====================================================================
   Motion
   ===================================================================== */
@media (prefers-reduced-motion: no-preference) {
    .cine-art-img { animation: cine-kenburns 28s ease-in-out infinite alternate; }
    .cine-fog-1 { animation: cine-fog 22s ease-in-out infinite alternate; }
    .cine-fog-2 { animation: cine-fog 30s ease-in-out infinite alternate-reverse; }
    .cine-scan { animation: cine-flicker 6s steps(1) infinite; }
    .cine-hud-rec i { animation: cine-blink 1.2s steps(1) infinite; }
    .cine-hud-corner { animation: cine-corner .9s var(--ease-out) backwards; }
    .cine-hud-corner.tr { animation-delay: .1s; } .cine-hud-corner.bl { animation-delay: .2s; } .cine-hud-corner.br { animation-delay: .3s; }
    .cine-eyebrow { animation: cine-slide .8s .2s var(--ease-out) backwards; }
    .cine-title { animation: cine-title 1.1s .25s var(--ease-out) backwards; }
    .cine-title.is-glitch::before { animation: cine-glitch-a .42s steps(2) 1; }
    .cine-title.is-glitch::after { animation: cine-glitch-b .42s steps(2) 1; }
    .cine-title.is-glitch > span { animation: cine-jitter .42s steps(3) 1; }
    .cine-lead { animation: cine-up .9s .5s var(--ease-out) backwards; }
    .cine-stats > * { animation: cine-up .8s var(--ease-out) backwards; }
    .cine-stats > *:nth-child(1) { animation-delay: .65s; } .cine-stats > *:nth-child(2) { animation-delay: .75s; }
    .cine-stats > *:nth-child(3) { animation-delay: .85s; } .cine-stats > *:nth-child(4) { animation-delay: .95s; }
    .cine-down span { animation: cine-wheel 1.8s ease-in-out infinite; }
    .hud-divider { animation: cine-stripes 1.6s linear infinite; background-size: 31px 31px; }
}
@keyframes cine-kenburns { from { transform: scale(1.06) translate(0, 0); } to { transform: scale(1.18) translate(-2%, -2%); } }
@keyframes cine-fog { from { transform: translate(0, 0) scale(1); } to { transform: translate(8vw, -4vw) scale(1.15); } }
@keyframes cine-flicker { 0%, 100% { opacity: .5; } 41% { opacity: .38; } 42% { opacity: .62; } 77% { opacity: .45; } }
@keyframes cine-blink { 50% { opacity: .15; } }
@keyframes cine-corner { from { opacity: 0; transform: scale(2.2); } }
@keyframes cine-slide { from { opacity: 0; transform: translateX(-40px); } }
@keyframes cine-title { 0% { opacity: 0; transform: translateY(40px) scale(1.06); filter: blur(10px); } 60% { filter: blur(0); } }
@keyframes cine-up { from { opacity: 0; transform: translateY(26px); } }
@keyframes cine-wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
@keyframes cine-glitch-a { 0% { opacity: .9; clip-path: inset(10% 0 62% 0); transform: translate(-8px, -2px); } 50% { clip-path: inset(58% 0 12% 0); transform: translate(6px, 2px); } 100% { opacity: 0; } }
@keyframes cine-glitch-b { 0% { opacity: .8; clip-path: inset(48% 0 30% 0); transform: translate(8px, 1px); } 50% { clip-path: inset(6% 0 70% 0); transform: translate(-6px, -1px); } 100% { opacity: 0; } }
@keyframes cine-jitter { 33% { transform: translate(2px, -1px) skewX(-6deg); } 66% { transform: translate(-2px, 1px) skewX(4deg); } }
@keyframes cine-stripes { to { background-position: 31px 0; } }
