/* Krivalabs Core Design System */

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #ffffff;
    color: #18181b; /* zinc-900 */
}

:root {
    --nav-scrolled-bg: rgba(255, 255, 255, 0.7);
    --nav-border-color: rgb(191 191 191 / 20%);
}

.sky-gradient {
    background: linear-gradient(180deg, #9cc1e7 0%, #ffffff 100%);
}

.sky-gradient-reverse {
    background: linear-gradient(180deg, #ffffff 0%, #9cc1e7 100%);
}

/* Navigation Transitions */
.nav-transition {
    transition: background-color 0.4s ease,
                border-color 0.4s ease,
                box-shadow 0.4s ease;
}

#main-nav {
    max-width: 940px; 
    margin: 1.25rem auto 0;
    border-radius: 9999px;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--nav-border-color);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    padding: 0.75rem 1.25rem;
}

@media (min-width: 768px) {
    #main-nav { padding: 1rem 2rem; }
}

@media (max-width: 1024px) {
    #main-nav {
        max-width: calc(100% - 2.5rem);
    }
}

/* Glass Morph Hover for Nav Links */
.glass-nav-link {
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-nav-link:hover {
    background: rgba(0, 0, 0, 0.03);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #000;
}

.glass-nav-link:hover {
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-color: rgba(24, 24, 27, 0.1);
    color: #000;
}

/* Premium Button Roll-up Animation */
.btn-rollup {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s ease;
}

.btn-rollup:active { transform: scale(0.95); }

.btn-rollup-inner {
    position: relative;
    display: block;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding: var(--btn-py, 0.75rem) var(--btn-px, 1.5rem);
}

.btn-rollup-inner::after {
    content: attr(data-text);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn-rollup:hover .btn-rollup-inner {
    transform: translateY(-100%);
}

/* Custom shadow for cards */
.card-shadow {
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

/* Ultra-Realistic Cloud System */
.cloud {
    position: absolute;
    pointer-events: none;
    filter: drop-shadow(0 25px 40px rgba(0,0,0,0.08));
}

@keyframes drift {
    0% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(30px) translateY(-10px); }
    100% { transform: translateX(0) translateY(0); }
}

.animate-drift { animation: drift 25s ease-in-out infinite; }
.animate-drift-slow { animation: drift 40s ease-in-out infinite; }
.animate-drift-reverse { animation: drift 30s ease-in-out infinite reverse; }

/* Micro-animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#mobile-menu {
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
}

#mobile-menu.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

/* Interactive hover lift (Deprecated site-wide for static model) */
.hover-lift {
    transition: all 0.3s ease;
    border: 1px solid rgba(24, 24, 27, 0.05);
}
.hover-lift:hover {
    border-color: rgba(24, 24, 27, 0.2);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
}

/* Heading Weight Policy */
h1, h2, h3, h4 {
    font-weight: 200 !important;
}

/* Allow bolder headings for cards to maintain hierarchy */
.card-bold h1, .card-bold h2, .card-bold h3, .card-bold h4,
.blog-card h1, .blog-card h2, .blog-card h3, .blog-card h4 {
    font-weight: 600 !important;
}

/* Premium Blog Card System (Updated to static model) */
.blog-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(24, 24, 27, 0.05);
}

.blog-card:hover {
    border-color: rgba(24, 24, 27, 0.2);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
}

.blog-card-tag {
    background: #18181b;
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.blog-card-img-wrapper {
    overflow: hidden;
    border-radius: 2rem;
    position: relative;
}

.blog-card:hover img {
    transform: none;
}

/* Premium Static Card (Universal interaction model) */
.premium-card-static {
    transition: all 0.3s ease;
    border: 1px solid rgba(24, 24, 27, 0.05);
}

.premium-card-static:hover {
    border-color: rgba(24, 24, 27, 0.2);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
}

/* Backwards compatibility */
.blog-card-static { @extend .premium-card-static; }

/* Blog Table of Contents */
.toc-sticky {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.toc-link {
    transition: all 0.2s ease;
}

.toc-link:hover {
    color: #18181b;
    padding-left: 4px;
}

.toc-link.active {
    color: #18181b !important;
    font-weight: 600;
}

.toc-indent {
    padding-left: 1.25rem;
    font-size: 0.825rem;
}

/* Global Content Styling (Prose) */
.prose h2 {
    font-size: 2.25rem;
    line-height: 2.5rem;
    font-weight: 600;
    color: #18181b;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
}

.prose h3 {
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 700;
    color: #18181b;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose p {
    margin-bottom: 1.5rem;
    line-height: 1.75;
    color: #52525b; /* zinc-600 */
}

.prose ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 2rem;
}

.prose ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
    margin-bottom: 2rem;
}

.prose li {
    margin-bottom: 0.75rem;
    color: #52525b;
}

.prose li::marker {
    color: #18181b;
    font-weight: 600;
}

.prose a {
    color: #2563eb;
    text-decoration-line: underline;
    text-underline-offset: 4px;
    font-weight: 500;
    transition: color 0.2s;
}

.prose a:hover {
    color: #1d4ed8;
}

/* Reset prose link styles for premium buttons */
.prose a.btn-rollup,
.prose a.btn-rollup *,
.prose a.btn-rollup:hover,
.prose a.btn-rollup:hover * {
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 700 !important;
}

.prose img {
    border-radius: 2rem;
    border: 1px solid #f4f4f5;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.prose table {
    width: 100%;
    margin-bottom: 2rem;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.prose th {
    background-color: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
}

.prose td {
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem;
    vertical-align: top;
}
