/* ============================================
   CalcStack - Enhanced Visual Design System
   ============================================ */

/* ===== TYPOGRAPHY ===== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    /* Typography Scale */
    --font-display: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-ui: 'Manrope', sans-serif;

    /* Font Sizes */
    --text-xs: 0.75rem;
    /* 12px */
    --text-sm: 0.875rem;
    /* 14px */
    --text-base: 1rem;
    /* 16px */
    --text-lg: 1.125rem;
    /* 18px */
    --text-xl: 1.25rem;
    /* 20px */
    --text-2xl: 1.5rem;
    /* 24px */
    --text-3xl: 1.875rem;
    /* 30px */
    --text-4xl: 2.25rem;
    /* 36px */
    --text-5xl: 3rem;
    /* 48px */
    --text-6xl: 3.75rem;
    /* 60px */

    /* Enhanced Color Palette */
    --indigo-50: #eef2ff;
    --indigo-100: #e0e7ff;
    --indigo-200: #c7d2fe;
    --indigo-300: #a5b4fc;
    --indigo-400: #818cf8;
    --indigo-500: #6366f1;
    --indigo-600: #4f46e5;
    --indigo-700: #4338ca;
    --indigo-800: #3730a3;
    --indigo-900: #312e81;
    --indigo-950: #1e1b4b;

    --emerald-500: #10b981;
    --emerald-600: #059669;
    --amber-500: #f59e0b;
    --amber-600: #d97706;
    --rose-500: #f43f5e;
    --rose-600: #e11d48;

    /* Neutral Grays with Warm Undertones */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-indigo: 0 10px 30px -5px rgba(79, 70, 229, 0.3);
}

/* ===== BASE STYLES ===== */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    letter-spacing: -0.011em;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--slate-100);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--indigo-400), var(--indigo-600));
    border-radius: var(--radius-full);
    border: 2px solid var(--slate-100);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--indigo-500), var(--indigo-700));
}

/* ===== BACKGROUND PATTERNS ===== */
.bg-grid-slate-100 {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32' fill='none' stroke='%23f1f5f9'%3e%3cpath d='M0 .5H31.5V32'/%3e%3c/svg%3e");
}

.bg-grid-indigo-50 {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32' fill='none' stroke='%23e0e7ff' stroke-opacity='0.4'%3e%3cpath d='M0 .5H31.5V32'/%3e%3c/svg%3e");
}

.bg-dots-pattern {
    background-image: radial-gradient(circle, var(--slate-200) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* ===== GLASSMORPHISM ===== */
.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.08), 0 2px 8px -1px rgba(0, 0, 0, 0.04);
}

/* ===== TEXT GRADIENTS ===== */
.text-gradient-primary {
    background: linear-gradient(135deg, var(--indigo-600) 0%, #7c3aed 50%, var(--indigo-500) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
}

.text-gradient-dark {
    background: linear-gradient(135deg, var(--slate-800) 0%, var(--slate-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-success {
    background: linear-gradient(135deg, var(--emerald-600) 0%, var(--emerald-500) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== ENHANCED CARDS ===== */
.card-elevated {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.03),
        0 2px 4px rgba(0, 0, 0, 0.05),
        0 12px 24px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-elevated:hover {
    transform: translateY(-4px);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.03),
        0 4px 8px rgba(0, 0, 0, 0.08),
        0 20px 40px rgba(0, 0, 0, 0.08);
}

/* ===== FORM INPUTS ===== */
.input-premium {
    font-family: var(--font-ui);
    font-size: var(--text-base);
    padding: 0.875rem 1rem;
    border-radius: var(--radius-lg);
    border: 2px solid var(--slate-200);
    background: white;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.input-premium:hover {
    border-color: var(--slate-300);
}

.input-premium:focus {
    outline: none;
    border-color: var(--indigo-500);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), var(--shadow-md);
    transform: translateY(-1px);
}

.input-premium::placeholder {
    color: var(--slate-400);
    font-weight: 400;
}

/* ===== BUTTONS ===== */
.btn-primary {
    font-family: var(--font-ui);
    font-weight: 600;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--indigo-600) 0%, var(--indigo-700) 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    font-family: var(--font-ui);
    font-weight: 600;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-xl);
    background: white;
    color: var(--slate-700);
    border: 2px solid var(--slate-200);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.btn-secondary:hover {
    border-color: var(--indigo-200);
    background: var(--indigo-50);
    color: var(--indigo-700);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===== ANIMATIONS ===== */
@keyframes fade-in-up {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-down {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-left {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fade-in-right {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scale-in {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scale-up {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes gradient-x {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes gradient-y {

    0%,
    100% {
        background-position: 50% 0%;
    }

    50% {
        background-position: 50% 100%;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes float-slow {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(79, 70, 229, 0.3);
    }

    50% {
        box-shadow: 0 0 30px rgba(79, 70, 229, 0.5);
    }
}

@keyframes pulse-scale {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes rotate-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes slide-in-left {
    0% {
        opacity: 0;
        transform: translateX(-100%);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-in-right {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-3deg);
    }

    75% {
        transform: rotate(3deg);
    }
}

@keyframes glow {

    0%,
    100% {
        filter: drop-shadow(0 0 5px rgba(79, 70, 229, 0.5));
    }

    50% {
        filter: drop-shadow(0 0 20px rgba(79, 70, 229, 0.8));
    }
}

/* Animation Utilities */
.animate-fade-in-up {
    animation: fade-in-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in-down {
    animation: fade-in-down 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in-left {
    animation: fade-in-left 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in-right {
    animation: fade-in-right 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scale-in {
    animation: scale-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scale-up {
    animation: scale-up 0.3s ease-in-out;
}

.animate-bounce-in {
    animation: bounce-in 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

.animate-gradient {
    background-size: 200% auto;
    animation: gradient-x 4s ease infinite;
}

.animate-gradient-y {
    background-size: auto 200%;
    animation: gradient-y 4s ease infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-float-slow {
    animation: float-slow 6s ease-in-out infinite;
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

.animate-pulse-scale {
    animation: pulse-scale 2s ease-in-out infinite;
}

.animate-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.animate-rotate {
    animation: rotate 2s linear infinite;
}

.animate-rotate-slow {
    animation: rotate-slow 20s linear infinite;
}

.animate-wiggle {
    animation: wiggle 1s ease-in-out;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* Hover Animations */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-glow {
    transition: filter 0.3s ease;
}

.hover-glow:hover {
    filter: drop-shadow(0 0 15px rgba(79, 70, 229, 0.6));
}

/* ===== SCROLL ANIMATIONS ===== */
.scroll-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
        transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== TYPOGRAPHY ENHANCEMENTS ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.prose h2 {
    font-family: var(--font-display);
    color: var(--slate-900);
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-top: 3em;
    margin-bottom: 1.2em;
    letter-spacing: -0.02em;
}

.prose h3 {
    font-family: var(--font-display);
    color: var(--slate-800);
    font-size: var(--text-xl);
    font-weight: 600;
    margin-top: 2em;
    margin-bottom: 0.8em;
}

.prose h4 {
    font-family: var(--font-display);
    color: var(--slate-700);
    font-size: var(--text-lg);
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.6em;
}

.prose p {
    line-height: 1.8;
    color: var(--slate-600);
    font-size: var(--text-base);
    margin-bottom: 1.25em;
}

.prose strong {
    color: var(--indigo-600);
    font-weight: 600;
}

.prose ul,
.prose ol {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
}

.prose li {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    line-height: 1.75;
    color: var(--slate-600);
}

.prose ul li::marker {
    color: var(--indigo-500);
}

.prose ol li::marker {
    color: var(--indigo-500);
    font-weight: 600;
}

.prose a {
    color: var(--indigo-600);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.prose a:hover {
    color: var(--indigo-700);
    text-decoration: underline;
}

/* ===== INTERACTIVE ELEMENTS ===== */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    border-color: var(--indigo-500);
}

/* ===== LINK ANIMATIONS ===== */
a.link-animate {
    position: relative;
    text-decoration: none;
    transition: color 0.3s ease;
}

a.link-animate::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, var(--indigo-600), var(--indigo-400));
    transform-origin: bottom right;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a.link-animate:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* ===== UTILITY CLASSES ===== */
.gradient-border {
    position: relative;
    background: white;
    border-radius: var(--radius-xl);
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    padding: 2px;
    background: linear-gradient(135deg, var(--indigo-500), var(--indigo-300));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
}

.text-balance {
    text-wrap: balance;
}

.shadow-smooth {
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.03),
        0 1px 1px rgba(0, 0, 0, 0.02),
        0 4px 8px rgba(0, 0, 0, 0.04),
        0 16px 24px rgba(0, 0, 0, 0.04),
        0 24px 32px rgba(0, 0, 0, 0.02);
}

/* ===== RESPONSIVE TYPOGRAPHY ===== */
@media (max-width: 768px) {
    :root {
        --text-6xl: 2.5rem;
        --text-5xl: 2rem;
        --text-4xl: 1.75rem;
        --text-3xl: 1.5rem;
    }
}

/* ===== SELECTION STYLING ===== */
::selection {
    background-color: var(--indigo-100);
    color: var(--indigo-900);
}

::-moz-selection {
    background-color: var(--indigo-100);
    color: var(--indigo-900);
}