/* ==========================================================================
   AJKAI Hub – Visual Refresh Layer (loaded after app.css)
   Pure CSS: works with the Tailwind CDN build and the compiled build alike.
   ========================================================================== */

:root {
    --brand: #4f46e5;
    --brand-600: #4338ca;
    --brand-2: #06b6d4;
    --accent: #f59e0b;
    --ink: #0f172a;
    --paper: #f6f7fc;
    --line: rgba(15, 23, 42, .08);
    --ease: cubic-bezier(.22, 1, .36, 1);
    --shadow-soft: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 28px -12px rgba(79, 70, 229, .16);
    --shadow-lift: 0 2px 6px rgba(15, 23, 42, .06), 0 28px 56px -20px rgba(79, 70, 229, .35);
}

/* ---------- Page canvas ---------- */
body[class] {
    background-color: var(--paper);
    background-image:
        radial-gradient(1100px 520px at 12% -8%, rgba(99, 102, 241, .10), transparent 60%),
        radial-gradient(900px 480px at 100% 4%, rgba(6, 182, 212, .08), transparent 55%);
    background-repeat: no-repeat;
}
.dark body[class], body.dark[class] {
    background-color: #080d1c;
    background-image:
        radial-gradient(1100px 520px at 12% -8%, rgba(99, 102, 241, .20), transparent 60%),
        radial-gradient(900px 480px at 100% 4%, rgba(6, 182, 212, .12), transparent 55%);
}

::selection { background: rgba(79, 70, 229, .9); color: #fff; }

html { scrollbar-color: #a5b4fc transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #818cf8; background-clip: content-box; border: 2px solid transparent; }
.dark ::-webkit-scrollbar-thumb { background: #334155; background-clip: content-box; }

/* ---------- Header: glass that tightens on scroll ---------- */
header.sticky[class] {
    background: rgba(255, 255, 255, .72);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid rgba(99, 102, 241, .10);
    box-shadow: none;
    transition: background .3s var(--ease), box-shadow .3s var(--ease);
}
.dark header.sticky[class] { background: rgba(8, 13, 28, .72); border-bottom-color: rgba(148, 163, 184, .12); }
header.sticky > div:not(#mobileNav) { transition: height .3s var(--ease); }
header.sticky.is-scrolled { background: rgba(255, 255, 255, .88); box-shadow: 0 10px 30px -18px rgba(30, 27, 75, .35); }
.dark header.sticky.is-scrolled { background: rgba(8, 13, 28, .9); box-shadow: 0 10px 30px -18px #000; }
header.sticky.is-scrolled > div:not(#mobileNav) { height: 4rem; }

/* ---------- Section headings ---------- */
.section-title {
    font-size: clamp(1.45rem, 1.15rem + 1.1vw, 2rem) !important;
    font-weight: 800 !important;
    letter-spacing: -.02em;
    position: relative;
    padding-bottom: .7rem;
}
.section-title::after {
    content: "";
    position: absolute; left: 0; bottom: 0;
    width: 3.25rem; height: 4px; border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

/* ---------- Hero ---------- */
.hero-mesh { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero-mesh .orb { position: absolute; border-radius: 999px; filter: blur(70px); opacity: .55; will-change: transform; }
.hero-mesh .orb-a { width: 460px; height: 460px; left: -120px; top: -140px; background: #818cf8; animation: orbFloat 16s ease-in-out infinite; }
.hero-mesh .orb-b { width: 420px; height: 420px; right: -100px; top: 10px; background: #22d3ee; opacity: .38; animation: orbFloat 19s ease-in-out -6s infinite reverse; }
.hero-mesh .orb-c { width: 340px; height: 340px; left: 38%; bottom: -170px; background: #f0abfc; opacity: .32; animation: orbFloat 22s ease-in-out -11s infinite; }
.dark .hero-mesh .orb { opacity: .28; }
.hero-grid {
    position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(rgba(79, 70, 229, .16) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 25%, transparent 72%);
            mask-image: radial-gradient(ellipse at 50% 30%, #000 25%, transparent 72%);
}
@keyframes orbFloat {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(40px, 30px, 0) scale(1.08); }
}
.hero-title { letter-spacing: -.03em; text-wrap: balance; }
.hero-title .grad-text { background-size: 200% auto; animation: gradShift 8s ease-in-out infinite; }
@keyframes gradShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* ---------- Cards ---------- */
main article.group,
main a.group[class*="rounded-2xl"][class*="shadow-sm"] {
    border-color: var(--line);
    box-shadow: var(--shadow-soft);
    transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s;
}
main article.group:hover,
main a.group[class*="rounded-2xl"][class*="shadow-sm"]:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lift);
    border-color: rgba(99, 102, 241, .45);
}
.dark main article.group, .dark main a.group[class*="rounded-2xl"][class*="shadow-sm"] { border-color: rgba(148, 163, 184, .14); box-shadow: 0 1px 2px #0006, 0 14px 30px -16px #000; }
main article.group img { transition: transform .8s var(--ease), filter .4s; }
main article.group:hover img { transform: scale(1.06); }
main article.group .aspect-video { position: relative; }
main article.group .aspect-video::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(180deg, transparent 55%, rgba(15, 23, 42, .28));
    opacity: .0; transition: opacity .4s;
}
main article.group:hover .aspect-video::after { opacity: 1; }

/* ---------- Buttons & links ---------- */
main a[class*="from-indigo-600"][class*="to-blue-600"],
main button[class*="from-indigo-600"][class*="to-blue-600"] {
    overflow: hidden; isolation: isolate;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), filter .25s;
}
main a[class*="from-indigo-600"][class*="to-blue-600"]:not(.absolute):not(.fixed):not(.sticky),
main button[class*="from-indigo-600"][class*="to-blue-600"]:not(.absolute):not(.fixed):not(.sticky) { position: relative; }
main a[class*="from-indigo-600"][class*="to-blue-600"]:hover,
main button[class*="from-indigo-600"][class*="to-blue-600"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -10px rgba(79, 70, 229, .65);
}
main a[class*="from-indigo-600"][class*="to-blue-600"]::before,
main button[class*="from-indigo-600"][class*="to-blue-600"]::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .28) 50%, transparent 65%);
    transform: translateX(-120%); transition: transform .7s var(--ease);
}
main a[class*="from-indigo-600"][class*="to-blue-600"]:hover::before,
main button[class*="from-indigo-600"][class*="to-blue-600"]:hover::before { transform: translateX(120%); }
main a:active, main button:active { transform: translateY(0) scale(.985); }

/* ---------- Form controls ---------- */
main input[type="text"], main input[type="email"], main input[type="search"], main input[type="tel"],
main input[type="password"], main input[type="number"], main textarea, main select {
    transition: border-color .2s, box-shadow .25s var(--ease);
}
main input:focus, main textarea:focus, main select:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .16) !important;
    outline: none;
}

/* ---------- Footer ---------- */
footer.bg-slate-900[class] {
    position: relative;
    background:
        radial-gradient(700px 260px at 15% 0%, rgba(99, 102, 241, .25), transparent 70%),
        radial-gradient(600px 260px at 90% 100%, rgba(6, 182, 212, .14), transparent 70%),
        #0b1020;
    border-top: 0;
}
footer.bg-slate-900::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
    background: linear-gradient(90deg, #22d3ee, #6366f1, #f59e0b);
}
footer a { transition: color .2s, transform .2s var(--ease); }
footer a:hover { color: #fff; }

/* ---------- Article typography ---------- */
.prose { --tw-prose-links: var(--brand); font-size: 1.0625rem; line-height: 1.85; }
.prose h2 { margin-top: 2.2em; padding-left: .8rem; border-left: 4px solid var(--brand); letter-spacing: -.015em; }
.prose h3 { margin-top: 1.8em; }
.prose a { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.prose img { border-radius: 1rem; box-shadow: 0 18px 40px -24px rgba(15, 23, 42, .55); margin-inline: auto; }
.prose blockquote {
    border-left: 4px solid var(--brand-2); background: rgba(99, 102, 241, .06);
    border-radius: 0 1rem 1rem 0; padding: .9rem 1.2rem; font-style: normal;
}
.dark .prose blockquote { background: rgba(99, 102, 241, .12); }
.prose table { border-radius: .9rem; overflow: hidden; }
.prose pre { border-radius: 1rem; }
.prose :not(pre) > code { background: rgba(99, 102, 241, .1); padding: .15em .4em; border-radius: .4rem; font-size: .9em; }

/* ---------- Scroll reveal (only active when JS adds .js-reveal) ---------- */
.js-reveal .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Misc polish ---------- */
main img { image-rendering: auto; }
:focus-visible { outline: 3px solid rgba(99, 102, 241, .55); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
    .hero-mesh .orb, .hero-title .grad-text { animation: none !important; }
    .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
    main article.group:hover, main article.group:hover img { transform: none; }
}
@media (max-width: 640px) {
    .hero-mesh .orb { filter: blur(50px); }
    main article.group:hover { transform: none; }
}

/* ---------- Category tiles: rotating accent colours ---------- */
main a.group[class*="rounded-2xl"][class*="text-center"] > div:first-child { transition: transform .4s var(--ease), background .3s, color .3s; }
main a.group[class*="rounded-2xl"][class*="text-center"]:nth-child(6n+1) > div:first-child { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: #4338ca; }
main a.group[class*="rounded-2xl"][class*="text-center"]:nth-child(6n+2) > div:first-child { background: linear-gradient(135deg, #cffafe, #a5f3fc); color: #0e7490; }
main a.group[class*="rounded-2xl"][class*="text-center"]:nth-child(6n+3) > div:first-child { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #047857; }
main a.group[class*="rounded-2xl"][class*="text-center"]:nth-child(6n+4) > div:first-child { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #b45309; }
main a.group[class*="rounded-2xl"][class*="text-center"]:nth-child(6n+5) > div:first-child { background: linear-gradient(135deg, #ffe4e6, #fecdd3); color: #be123c; }
main a.group[class*="rounded-2xl"][class*="text-center"]:nth-child(6n+6) > div:first-child { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #6d28d9; }
main a.group[class*="rounded-2xl"][class*="text-center"]:hover > div:first-child { transform: translateY(-2px) scale(1.12) rotate(-4deg); color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.dark main a.group[class*="rounded-2xl"][class*="text-center"] > div:first-child { filter: saturate(.9) brightness(.92); }

/* ---------- Dark-mode shades the views reference but Tailwind does not ship (slate-750 / slate-850) ---------- */
.dark .dark\:bg-slate-850 { background-color: #111a30; }
.dark .dark\:bg-slate-850\/90 { background-color: rgba(17, 26, 48, .9); }
.dark .dark\:bg-slate-750 { background-color: #1e293b; }
.dark .dark\:bg-slate-750\/70 { background-color: rgba(30, 41, 59, .7); }
.dark .dark\:hover\:bg-slate-750\/50:hover { background-color: rgba(30, 41, 59, .5); }
.dark .dark\:from-slate-850 { --tw-gradient-from: #111a30 var(--tw-gradient-from-position, ); --tw-gradient-to: rgba(17, 26, 48, 0) var(--tw-gradient-to-position, ); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.dark .dark\:to-slate-850 { --tw-gradient-to: #111a30 var(--tw-gradient-to-position, ); }
.dark .dark\:via-slate-850 { --tw-gradient-stops: var(--tw-gradient-from), #111a30 var(--tw-gradient-via-position, ), var(--tw-gradient-to); }
