/* CORTEX Docs kinetic layer — static-site safe */
:root {
    --kx: 50vw;
    --ky: 30vh;
    --kinetic-lime: #ccff00;
    --kinetic-mint: #38d39f;
    --kinetic-blue: #6ba6ff;
    --kinetic-bg: #050704;
    --kinetic-line: rgba(204, 255, 0, 0.15);
    --kinetic-panel: rgba(8, 14, 9, 0.78);
}

html {
    scroll-behavior: smooth;
    background: var(--kinetic-bg);
}

body {
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at var(--kx) var(--ky), rgba(204, 255, 0, 0.13), transparent 18rem),
        radial-gradient(circle at 82% 18%, rgba(107, 166, 255, 0.12), transparent 30rem),
        linear-gradient(180deg, #050704 0%, #080d08 54%, #030403 100%) !important;
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

body::before {
    opacity: 0.42;
    background-image:
        linear-gradient(rgba(204, 255, 0, 0.075) 1px, transparent 1px),
        linear-gradient(90deg, rgba(204, 255, 0, 0.075) 1px, transparent 1px);
    background-size: 58px 58px;
    mask-image: linear-gradient(180deg, black 0%, transparent 92%);
    animation: kinetic-grid 18s linear infinite;
}

body::after {
    background:
        linear-gradient(90deg, transparent, rgba(204, 255, 0, 0.10), transparent),
        repeating-linear-gradient(180deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 5px);
    opacity: 0.16;
    mix-blend-mode: screen;
    transform: translateX(-100%);
    animation: kinetic-scan 9s ease-in-out infinite;
}

.wrap,
main,
.hero,
.grid,
.langbar,
article,
section {
    position: relative;
    z-index: 1;
}

.wrap {
    animation: kinetic-page-in 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.langbar {
    padding: 8px 10px;
    border: 1px solid rgba(204, 255, 0, 0.10);
    border-radius: 999px;
    width: fit-content;
    margin-left: auto !important;
    background: rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(12px);
}

.hero {
    padding: 30px;
    border: 1px solid rgba(204, 255, 0, 0.13);
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(204, 255, 0, 0.08), rgba(56, 211, 159, 0.035)),
        rgba(0, 0, 0, 0.25);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(from var(--angle, 0deg), transparent, rgba(204,255,0,0.65), transparent 30%, rgba(107,166,255,0.5), transparent 62%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: kinetic-angle 4s linear infinite;
}

h1 {
    font-size: clamp(2.4rem, 7vw, 5.8rem) !important;
    line-height: 0.9 !important;
    letter-spacing: -0.075em !important;
    background: linear-gradient(180deg, #ffffff 0%, #dfff7b 46%, #6f7a6b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    filter: drop-shadow(0 20px 55px rgba(204, 255, 0, 0.12));
}

h2,
h3 {
    letter-spacing: -0.04em;
}

.hero p,
.card p,
article p,
section p {
    line-height: 1.7;
}

.cta,
.grid {
    perspective: 1200px;
}

.btn,
.card,
article {
    transform-style: preserve-3d;
    transition:
        transform 240ms cubic-bezier(0.16, 1, 0.3, 1),
        border-color 240ms ease,
        background 240ms ease,
        box-shadow 240ms ease,
        color 240ms ease;
}

.btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.035) !important;
    backdrop-filter: blur(12px);
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at var(--btn-x, 50%) var(--btn-y, 50%), rgba(204,255,0,0.34), transparent 34%);
    opacity: 0;
    transition: opacity 160ms ease;
}

.btn:hover {
    transform: translateY(-4px) scale(1.015);
    border-color: rgba(204, 255, 0, 0.65) !important;
    color: #ccff00 !important;
    box-shadow: 0 18px 44px rgba(204, 255, 0, 0.12);
}

.btn:hover::before {
    opacity: 1;
}

.card,
.grid article {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.045), rgba(204,255,0,0.025)),
        var(--kinetic-panel) !important;
    border-color: rgba(204, 255, 0, 0.12) !important;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.25);
}

.card::before,
.grid article::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at var(--kx-local, 50%) var(--ky-local, 50%), rgba(204,255,0,0.15), transparent 38%),
        linear-gradient(120deg, transparent, rgba(255,255,255,0.045), transparent);
    opacity: 0;
    transition: opacity 240ms ease;
}

.card:hover,
.grid article:hover {
    transform: translateY(-10px) rotateX(2deg) rotateY(-2deg);
    border-color: rgba(204, 255, 0, 0.46) !important;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.46), 0 0 45px rgba(204,255,0,0.08);
}

.card:hover::before,
.grid article:hover::before {
    opacity: 1;
}

.card h2,
.grid article h2,
.card h3,
.grid article h3 {
    position: relative;
    z-index: 1;
    color: #ccff00 !important;
}

.card p,
.grid article p,
.card a,
.grid article a {
    position: relative;
    z-index: 1;
}

.kinetic-field {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.kinetic-bit {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 999px;
    background: rgba(204, 255, 0, 0.62);
    box-shadow: 0 0 14px rgba(204, 255, 0, 0.7);
    animation: kinetic-float var(--duration, 12s) linear infinite;
    animation-delay: var(--delay, 0s);
    opacity: 0;
}

.reveal-ready {
    opacity: 0;
    transform: translateY(26px) scale(0.985);
}

.reveal-in {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 520ms ease, transform 620ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes kinetic-page-in {
    from { opacity: 0; transform: translateY(20px) scale(0.985); filter: blur(10px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes kinetic-grid {
    from { background-position: 0 0, 0 0; }
    to { background-position: 58px 58px, 58px 58px; }
}

@keyframes kinetic-scan {
    0%, 18% { transform: translateX(-100%); }
    44%, 100% { transform: translateX(100%); }
}

@property --angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

@keyframes kinetic-angle {
    to { --angle: 360deg; }
}

@keyframes kinetic-float {
    0% { opacity: 0; transform: translate3d(0, 110vh, 0) scale(0.6); }
    12% { opacity: 0.75; }
    88% { opacity: 0.75; }
    100% { opacity: 0; transform: translate3d(var(--drift, 40px), -12vh, 0) scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }

    .kinetic-field {
        display: none;
    }
}

@media (max-width: 700px) {
    .hero {
        padding: 22px;
        border-radius: 20px;
    }

    .card:hover,
    .grid article:hover,
    .btn:hover {
        transform: translateY(-3px);
    }
}
