/* KMAN AI - restrained interaction layer */
:root {
    --motion-ease: cubic-bezier(.22, .61, .36, 1);
}

/* Use the mark as a restrained system visual instead of enlarging the raw icon. */
.hero-brand-visual {
    position: absolute;
    top: 50%;
    right: 10%;
    width: 300px;
    height: 300px;
    z-index: 2;
    pointer-events: none;
    transform: translate3d(var(--brand-shift-x, 0px), calc(-50% + var(--brand-scroll-shift, 0px)), 0);
    transition: transform .2s var(--motion-ease);
}

.hero-brand-sequence {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 264px;
    height: 132px;
    border: 1px solid rgba(100, 116, 139, .22);
    border-radius: 36px;
    background: var(--bg-card);
    background: color-mix(in srgb, var(--bg-card) 76%, transparent);
    box-shadow: 0 22px 60px rgba(15, 23, 42, .12), inset 0 0 0 8px rgba(255, 255, 255, .08);
    transform: translate(-50%, -50%) rotate(-5deg);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.hero-brand-moving-mark {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 76px;
    height: 76px;
    padding: 10px;
    border-radius: 20px;
    background: var(--bg-card);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .16);
    transform: translate(-50%, -50%) rotate(-5deg);
    animation: heroMarkTravel 8s var(--motion-ease) infinite;
}

.hero-brand-moving-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 12px;
}

.hero-brand-lockup-wordmark {
    position: absolute;
    top: 50%;
    left: 122px;
    color: var(--text-main);
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1;
    opacity: 0;
    transform: translateY(-50%) translateX(10px);
    animation: heroWordmarkIn 8s var(--motion-ease) infinite;
}

@keyframes heroMarkTravel {
    0%, 44% { left: 50%; transform: translate(-50%, -50%) rotate(-5deg); }
    56%, 100% { left: 34px; transform: translate(0, -50%) rotate(0); }
}

@keyframes heroWordmarkIn {
    0%, 48% { opacity: 0; transform: translateY(-50%) translateX(10px); }
    58%, 100% { opacity: 1; transform: translateY(-50%) translateX(0); }
}

.hero-brand-halo {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(59, 130, 246, .22);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.hero-brand-halo-a { width: 220px; height: 220px; }
.hero-brand-halo-b { width: 286px; height: 286px; border-color: rgba(100, 116, 139, .14); }
.hero-brand-link { position: absolute; height: 1px; background: linear-gradient(90deg, transparent, rgba(59, 130, 246, .4), transparent); transform-origin: left center; }
.hero-brand-link-a { width: 112px; left: 8px; top: 62px; transform: rotate(-24deg); }
.hero-brand-link-b { width: 100px; right: 2px; bottom: 62px; transform: rotate(-24deg); }

@media (max-width: 900px) {
    .hero-brand-visual { right: -4%; width: 240px; height: 240px; opacity: .72; }
    .hero-brand-sequence { width: 220px; height: 112px; border-radius: 28px; }
    .hero-brand-moving-mark { width: 62px; height: 62px; padding: 8px; border-radius: 16px; }
    .hero-brand-lockup-wordmark { left: 98px; font-size: 1.15rem; }
    @keyframes heroMarkTravel {
        0%, 44% { left: 50%; transform: translate(-50%, -50%) rotate(-5deg); }
        56%, 100% { left: 26px; transform: translate(0, -50%) rotate(0); }
    }
    .hero-brand-halo-a { width: 176px; height: 176px; }
    .hero-brand-halo-b { width: 226px; height: 226px; }
}

@media (max-width: 600px) {
    .hero-brand-visual { display: none; }
}

.motion-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    --pointer-x: 50%;
    --pointer-y: 45%;
    --scroll-y: 0;
}

.motion-hero::before {
    content: "";
    position: absolute;
    inset: -20%;
    z-index: -2;
    pointer-events: none;
    background: radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(59, 130, 246, .11), transparent 29%), radial-gradient(circle at 78% 16%, rgba(16, 185, 129, .07), transparent 22%);
    transition: background-position .25s var(--motion-ease);
}

.motion-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .34;
    background-image: linear-gradient(rgba(100, 116, 139, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(100, 116, 139, .055) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, black, transparent 78%);
    transform: translateY(var(--grid-scroll-shift, 0px));
}

.motion-hero > .container {
    position: relative;
    z-index: 1;
}

.motion-orb {
    position: absolute;
    z-index: -1;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(2px);
    opacity: .32;
    background: radial-gradient(circle at 35% 35%, rgba(59, 130, 246, .2), transparent 68%);
    transform: translate3d(0, var(--orb-scroll-shift, 0px), 0);
    transition: transform .18s linear;
}

.motion-orb-a { top: 10%; right: 8%; }
.motion-orb-b { bottom: -14%; left: 8%; width: 180px; height: 180px; opacity: .2; background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, .18), transparent 70%); transform: translate3d(0, var(--orb-b-scroll-shift, 0px), 0); }

.motion-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s var(--motion-ease), transform .7s var(--motion-ease);
}

.motion-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.ui-tilt.ui-tilt {
    position: relative;
    --tilt-x: 0deg;
    --tilt-y: 0deg;
    --tilt-lift: 0px;
    transform: perspective(1100px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(var(--tilt-lift));
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform .45s var(--motion-ease), box-shadow .45s var(--motion-ease), border-color .3s ease;
}

.ui-tilt:hover {
    --tilt-lift: -6px;
}

.ui-tilt::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0;
    background: radial-gradient(circle at var(--shine-x, 50%) var(--shine-y, 20%), rgba(255, 255, 255, .22), transparent 34%);
    transition: opacity .35s ease;
}

.ui-tilt:hover::after { opacity: .7; }

.motion-cursor-glow {
    position: fixed;
    left: 0;
    top: 0;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9990;
    opacity: 0;
    mix-blend-mode: screen;
    background: radial-gradient(circle, rgba(59, 130, 246, .1), transparent 68%);
    transform: translate(-50%, -50%);
    transition: opacity .3s ease;
}

@media (max-width: 767px), (prefers-reduced-motion: reduce) {
    .motion-hero::before,
    .motion-hero::after,
    .motion-orb,
    .motion-cursor-glow { display: none; }

    .motion-reveal { opacity: 1; transform: none; transition: none; }
    .ui-tilt,
    .ui-tilt:hover,
    .ui-tilt.ui-tilt,
    .ui-tilt.ui-tilt:hover { transform: none; transition: none; }
    .ui-tilt::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-brand-moving-mark { left: 34px; transform: translate(0, -50%); animation: none; }
    .hero-brand-lockup-wordmark { opacity: 1; transform: translateY(-50%); animation: none; }
}
