/* ============================================================
   CLASSIC MOTION — gold animation layer for Original Cheats
   Sits on top of the classic palette. Zero dependencies.
   Hover lifts use `translate` (not transform) on purpose so
   page-entrance keyframes (fill: forwards) never block them.
   ============================================================ */

:root {
    --cm-ease-expo: cubic-bezier(.16, 1, .3, 1);
    --cm-ease-back: cubic-bezier(.34, 1.56, .64, 1);
    --cm-gold: #c9a227;
    --cm-brass: #d9b75a;
    --cm-parchment: #e8d9a8;
    --cm-ivory: #f4ead5;
}

/* ---------- entrance primitives ---------- */
@keyframes cmFadeUp {
    from { opacity: 0; transform: translateY(26px); }
    to   { opacity: 1; transform: none; }
}
@keyframes cmFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes cmScaleIn {
    from { opacity: 0; transform: scale(.93); }
    to   { opacity: 1; transform: none; }
}
@keyframes cmSlideRight {
    from { opacity: 0; transform: translateX(-22px); }
    to   { opacity: 1; transform: none; }
}

.cm-in       { animation: cmFadeUp   .7s  var(--cm-ease-expo) both; animation-delay: var(--d, 0s); }
.cm-in-scale { animation: cmScaleIn  .65s var(--cm-ease-back) both; animation-delay: var(--d, 0s); }
.cm-in-fade  { animation: cmFadeIn   .9s  ease                both; animation-delay: var(--d, 0s); }
.cm-in-left  { animation: cmSlideRight .6s var(--cm-ease-expo) both; animation-delay: var(--d, 0s); }

/* ---------- scroll reveal (armed by motion.js) ---------- */
.ui-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .75s var(--cm-ease-expo), transform .75s var(--cm-ease-expo);
    transition-delay: var(--d, 0s);
    will-change: opacity, transform;
}
.ui-reveal.ui-visible { opacity: 1; transform: none; }

/* ---------- stagger containers ---------- */
.stagger > * { animation: cmFadeUp .6s var(--cm-ease-expo) both; }
.stagger > *:nth-child(1)  { animation-delay: .04s; }
.stagger > *:nth-child(2)  { animation-delay: .10s; }
.stagger > *:nth-child(3)  { animation-delay: .16s; }
.stagger > *:nth-child(4)  { animation-delay: .22s; }
.stagger > *:nth-child(5)  { animation-delay: .28s; }
.stagger > *:nth-child(6)  { animation-delay: .34s; }
.stagger > *:nth-child(7)  { animation-delay: .40s; }
.stagger > *:nth-child(8)  { animation-delay: .46s; }
.stagger > *:nth-child(9)  { animation-delay: .52s; }
.stagger > *:nth-child(10) { animation-delay: .58s; }

/* ---------- gold shine sweep on hover ---------- */
.shine {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.shine::after {
    content: '';
    position: absolute;
    top: -40%;
    bottom: -40%;
    left: 0;
    width: 45%;
    background: linear-gradient(90deg, transparent, rgba(247, 231, 176, .38), transparent);
    transform: translateX(-170%) skewX(-18deg);
    pointer-events: none;
    z-index: 1;
}
.shine:hover::after { animation: cmShine .85s ease forwards; }
@keyframes cmShine {
    to { transform: translateX(360%) skewX(-18deg); }
}

/* ---------- hover lift (translate — survives fill:forwards) ---------- */
.lift {
    transition: translate .5s var(--cm-ease-back), box-shadow .5s ease, border-color .4s ease;
}
.lift:hover {
    translate: 0 -7px;
    box-shadow: 0 22px 46px rgba(0, 0, 0, .5), 0 0 0 1px rgba(201, 162, 39, .4);
}

/* ---------- slow float ---------- */
@keyframes cmFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-9px); }
}
.floaty { animation: cmFloat 5.5s ease-in-out infinite; }

/* ---------- click ripple ---------- */
.ripple { position: relative; overflow: hidden; }
.cm-wave {
    position: absolute;
    border-radius: 50%;
    background: rgba(232, 217, 168, .45);
    transform: scale(0);
    animation: cmWave .65s ease-out forwards;
    pointer-events: none;
    z-index: 2;
}
@keyframes cmWave {
    to { transform: scale(2.6); opacity: 0; }
}

/* ---------- brand sheen (living gold text) ---------- */
@keyframes cmSheen { to { background-position: 200% center; } }
.cm-sheen-text {
    background: linear-gradient(105deg, #c9a227 15%, #f7e7b0 35%, #e8d9a8 50%, #c9a227 65%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: cmSheen 4.5s linear infinite;
}

/* ---------- pulse ring (live dots, badges) ---------- */
@keyframes cmPulseRing {
    0%   { box-shadow: 0 0 0 0 rgba(201, 162, 39, .55); }
    70%  { box-shadow: 0 0 0 10px rgba(201, 162, 39, 0); }
    100% { box-shadow: 0 0 0 0 rgba(201, 162, 39, 0); }
}
.cm-pulse { animation: cmPulseRing 2s ease-out infinite; }

/* ---------- number pop ---------- */
@keyframes cmPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.14); }
    100% { transform: scale(1); }
}
.cm-pop { animation: cmPop .45s var(--cm-ease-back); display: inline-block; }

/* ---------- table rows sweep in ---------- */
@keyframes cmRowIn {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: none; }
}
.cm-row { animation: cmRowIn .55s var(--cm-ease-expo) both; animation-delay: calc(var(--i, 0) * .07s); }
tbody.cm-rows tr.cm-row:hover { background: rgba(201, 162, 39, .07); }

/* ---------- input focus halo ---------- */
.cm-field { transition: border-color .3s ease, box-shadow .3s ease, background .3s ease; }
.cm-field:focus {
    border-color: rgba(201, 162, 39, .5) !important;
    box-shadow: 0 0 0 3px rgba(201, 162, 39, .16), 0 0 18px rgba(201, 162, 39, .12) !important;
    background: rgba(201, 162, 39, .05) !important;
}

/* ---------- section divider draw ---------- */
.cm-rule {
    height: 1px;
    background: linear-gradient(90deg, rgba(201, 162, 39, .6), rgba(201, 162, 39, 0));
    transform-origin: left center;
    animation: cmRuleDraw .9s var(--cm-ease-expo) both;
    animation-delay: var(--d, .2s);
}
@keyframes cmRuleDraw {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .cm-in, .cm-in-scale, .cm-in-fade, .cm-in-left, .floaty,
    .cm-sheen-text, .cm-pulse, .cm-pop, .cm-row, .cm-rule {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .ui-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .shine:hover::after { animation: none !important; }
}

/* ============================================================
   CLASSIC MOTION v2 — power features
   spotlight · conic border · mask reveal · progress · marquee ·
   toast · skeleton · cursor ring · sparkle trail · magnetic ·
   tilt · typewriter caret
   ============================================================ */

/* ---------- mouse spotlight (light in the dark) ---------- */
.cm-spotlight { position: relative; }
.cm-spotlight::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(460px circle at var(--mx, 50%) var(--my, 50%),
                rgba(201, 162, 39, .12), transparent 65%);
    opacity: 0;
    transition: opacity .45s ease;
    pointer-events: none;
    z-index: 0;
}
.cm-spotlight:hover::before { opacity: 1; }

/* ---------- rotating conic gold border ---------- */
@property --cm-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.cm-conic {
    border: 1.5px solid transparent;
    border-radius: 10px;
    background:
        linear-gradient(#17140e, #17140e) padding-box,
        conic-gradient(from var(--cm-angle),
            rgba(201, 162, 39, 0) 0deg,
            rgba(201, 162, 39, .1) 60deg,
            #c9a227 130deg,
            #f7e7b0 165deg,
            #c9a227 200deg,
            rgba(201, 162, 39, .1) 280deg,
            rgba(201, 162, 39, 0) 360deg) border-box;
    animation: cmSpinAngle 4.5s linear infinite;
}
@keyframes cmSpinAngle { to { --cm-angle: 360deg; } }

/* ---------- mask reveal (wipe in) ---------- */
.cm-mask {
    clip-path: inset(0 100% 0 0);
    transition: clip-path .9s var(--cm-ease-expo);
    transition-delay: var(--d, 0s);
}
.cm-mask.ui-visible { clip-path: inset(0 0 0 0); }

/* ---------- progress bars (fill when revealed) ---------- */
.cm-progress {
    height: 9px;
    background: rgba(201, 162, 39, .12);
    border-radius: 999px;
    overflow: hidden;
}
.cm-progress i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #a8871f, #c9a227, #f7e7b0);
    border-radius: inherit;
    transition: width 1.5s var(--cm-ease-expo) var(--d, .15s);
}
.cm-progress.is-on i { width: var(--p, 60%); }

/* ---------- marquee ticker ---------- */
.cm-marquee {
    overflow: hidden;
    white-space: nowrap;
    border-top: 1px solid rgba(201, 162, 39, .25);
    border-bottom: 1px solid rgba(201, 162, 39, .25);
    background: rgba(201, 162, 39, .05);
    padding: 11px 0;
}
.cm-marquee .cm-track {
    display: inline-flex;
    gap: 46px;
    padding-right: 46px;
    animation: cmScroll 24s linear infinite;
}
.cm-marquee:hover .cm-track { animation-play-state: paused; }
@keyframes cmScroll { to { transform: translateX(-50%); } }

/* ---------- toast notifications ---------- */
.cm-toasts {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.cm-toast {
    min-width: 270px;
    max-width: 350px;
    background: rgba(23, 20, 14, .97);
    border: 1px solid rgba(201, 162, 39, .45);
    border-left: 3px solid #c9a227;
    color: #f4ead5;
    padding: 13px 16px;
    border-radius: 8px;
    font-size: .84rem;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
    transform: translateX(120%);
    opacity: 0;
    transition: transform .5s var(--cm-ease-back), opacity .35s ease;
}
.cm-toast.in { transform: none; opacity: 1; }
.cm-toast.out { transform: translateX(120%); opacity: 0; }
.cm-toast b { color: #e8d9a8; display: block; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 3px; }

/* ---------- skeleton shimmer (loading state) ---------- */
.cm-skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(201, 162, 39, .07) !important;
    color: transparent !important;
    border-radius: 6px;
    user-select: none;
}
.cm-skeleton * { visibility: hidden; }
.cm-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(247, 231, 168, .16), transparent);
    transform: translateX(-100%);
    animation: cmShimmer 1.5s infinite;
}
@keyframes cmShimmer { to { transform: translateX(100%); } }

/* ---------- custom cursor ring ---------- */
.cm-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 34px;
    height: 34px;
    border: 1.5px solid rgba(201, 162, 39, .8);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width .3s var(--cm-ease-back), height .3s var(--cm-ease-back),
                background .3s ease, opacity .3s ease;
    opacity: 0;
}
.cm-cursor.on { opacity: 1; }
.cm-cursor.hot {
    width: 58px;
    height: 58px;
    background: rgba(201, 162, 39, .14);
    border-color: rgba(247, 231, 168, .9);
}
@media (pointer: coarse) { .cm-cursor { display: none !important; } }

/* ---------- sparkle trail ---------- */
.cm-spark {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, #f7e7b0, #c9a227);
    pointer-events: none;
    z-index: 9998;
    animation: cmSpark .8s ease-out forwards;
}
@keyframes cmSpark {
    to { transform: translate(var(--dx, 0), var(--dy, 14px)) scale(0); opacity: 0; }
}

/* ---------- magnetic elements ---------- */
.cm-magnetic {
    transition: translate .35s var(--cm-ease-back), box-shadow .3s ease;
    will-change: translate;
}

/* ---------- 3D tilt ---------- */
.cm-tilt {
    transform-style: preserve-3d;
    transition: transform .35s ease-out;
    will-change: transform;
}

/* ---------- typewriter caret ---------- */
.cm-caret::after {
    content: '▌';
    color: #c9a227;
    animation: cmBlink .9s steps(1) infinite;
    margin-left: 3px;
}
@keyframes cmBlink { 50% { opacity: 0; } }

/* ---------- parallax layer ---------- */
.cm-parallax { will-change: transform; }

/* ---------- v2 reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .cm-conic, .cm-marquee .cm-track, .cm-skeleton::after,
    .cm-caret::after, .cm-spark { animation: none !important; }
    .cm-mask { clip-path: none !important; transition: none !important; }
    .cm-progress i { transition: none !important; width: var(--p, 60%) !important; }
    .cm-cursor, .cm-spark { display: none !important; }
    .cm-magnetic, .cm-tilt { transition: none !important; }
}
