:root {
    /* Colors - Professional Mesh Theme */
    --bg-color: #0B0F19;
    /* Rich Dark Blue/Black */
    --surface-color: rgba(255, 255, 255, 0.03);
    /* Extremely subtle glass */
    --surface-hover: rgba(255, 255, 255, 0.06);

    /* Accents - Sophisticated Gradients */
    --primary-color: #6366f1;
    /* Indigo 500 */
    --secondary-color: #ec4899;
    /* Pink 500 */
    --accent-cyan: #06b6d4;
    /* Cyan 500 */

    /* Text Colors */
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    /* Slate 400 */

    /* Functional Colors */
    --error-color: #f43f5e;
    --success-color: #10b981;

    /* Borders & Glass */
    --border-color: rgba(255, 255, 255, 0.08);
    /* Crisp 1px border */
    --border-hover: rgba(255, 255, 255, 0.2);
    --glass-bg: rgba(11, 15, 25, 0.7);
    /* Darker glass for readability */
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-blur: blur(20px);

    /* Shadows */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);

    /* Transitions */
    --transition-speed: 0.2s;
    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
    /* Remove mobile tap highlight */
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    font-size: 16px;
    /* Base font size for mobile readability */
}

/* Background Mesh Animation */
.mesh-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(at 0% 0%, #0B0F19 0, transparent 50%),
        radial-gradient(at 100% 0%, #0f172a 0, transparent 50%);
}

.mesh-blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.4;
    animation: floating 20s infinite ease-in-out alternate;
}

.mesh-blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, #4f46e5 0%, transparent 70%);
    animation-delay: -5s;
}

.mesh-blob-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, #ec4899 0%, transparent 70%);
    animation-delay: 0s;
}

.mesh-blob-3 {
    top: 40%;
    left: 40%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
    opacity: 0.2;
    animation-delay: -10s;
}

@keyframes floating {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, 50px) scale(1.1);
    }
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition-speed);
}

/* Nav Link Animations (Ghost Pill Style) */
.nav-links a {
    position: relative;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s var(--ease-out);
    font-weight: 500;
}

.nav-links a::after {
    display: none;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
    opacity: 1 !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Utilities */
.container {
    margin: 0 auto;
    padding: 0 24px;
    max-width: 1200px;
    width: 100%;
}

/* Tool Container & Drop Zone (Standardized) */
.tool-container {
    width: 100%;
    max-width: 1000px;
    margin: 60px auto;
    text-align: center;
}

.drop-zone {
    width: 100%;
    height: 320px;
    border: 1px dashed var(--border-color);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.01) 0%, rgba(255, 255, 255, 0.03) 100%);
    transition: all 0.3s var(--ease-out);
}

.drop-zone:hover,
.drop-zone.highlight {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.1);
}

/* Tool Grid Layout */
.tools-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding-bottom: 60px;
}

@media (min-width: 640px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (min-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 32px;
    }
}

/* --- Professional Glass Card --- */
.neumorphic-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
}

.tool-card-modern {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    transition: all 0.3s var(--ease-out);
    height: 100%;
    position: relative;
    backdrop-filter: blur(10px);
}

.tool-card-modern:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.tool-card-modern .icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.tool-card-modern:hover .icon-box {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.tool-card-modern h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.tool-card-modern p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Neumorphic/Modern Button */
.neumorphic-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 14px 28px;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-speed);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.95rem;
    white-space: nowrap;
    /* Prevent text wrap inside button */
}

.neumorphic-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

.neumorphic-btn.primary {
    background: var(--text-main);
    color: var(--bg-color);
    border: none;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.neumorphic-btn.primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
}

.neumorphic-btn.primary:hover::after {
    left: 100%;
}

.neumorphic-btn.primary:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.glass-panel {
    background: rgba(11, 15, 25, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
}

/* Input Styles */
input,
textarea,
select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 12px;
    color: var(--text-main);
    width: 100%;
    outline: none;
    margin-bottom: 1rem;
    font-size: 1rem;
    transition: all 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.4);
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.fade-up {
    opacity: 0;
    animation: fadeUp 0.8s var(--ease-out) forwards;
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

@keyframes pulseGlow {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(99, 102, 241, 0);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(99, 102, 241, 0);
    }
}

.pulse {
    animation: pulseGlow 3s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

.text-shimmer {
    background: linear-gradient(to right, #a5b4fc 20%, #ffffff 40%, #a5b4fc 60%, #c084fc 80%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 5s linear infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.float-anim {
    animation: float 6s ease-in-out infinite;
}

.hidden {
    display: none !important;
}

/* FAQ Section */
.faq-section {
    max-width: 800px;
    margin: 60px auto;
    text-align: left;
}

.faq-item {
    background: #1f2937;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.faq-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
}

.faq-answer {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Mobile & Responsive Overrides - CRITICAL FIXES */
@media (max-width: 768px) {

    /* Container Padding */
    .container {
        padding: 0 20px;
    }

    /* Navigation */
    nav.glass-panel {
        padding: 12px 16px !important;
        height: auto !important;
    }

    nav .container {
        flex-wrap: wrap;
        gap: 12px;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        gap: 16px !important;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-links a {
        padding: 6px 12px;
        font-size: 0.85rem !important;
    }

    .nav-links .ai-chat-link {
        font-size: 0.85rem;
    }

    /* Typography scale down */
    h1 {
        font-size: 2.25rem !important;
        /* clamp fallback */
    }

    h2 {
        font-size: 1.75rem;
    }

    /* Spacing */
    .tool-container {
        margin: 30px auto;
    }

    .drop-zone {
        height: 220px;
        /* Smaller drop zone on mobile */
    }

    /* Cards */
    .neumorphic-card,
    .tool-card-modern {
        padding: 24px;
        /* Reduced padding */
    }

    .tool-card-modern .icon-box {
        width: 40px;
        height: 40px;
        margin-bottom: 16px;
    }

    /* Buttons */
    .neumorphic-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        width: 100%;
        /* Full width buttons on mobile */
    }

    .hero-btns {
        flex-direction: column;
        width: 100%;
    }

    /* Adjust spacers */
    div[style*="height: 100px"] {
        height: 120px !important;
        /* Account for wrapped nav */
    }

    header.container {
        padding-top: 40px !important;
    }
}

/* Very Small Screens */
@media (max-width: 380px) {
    h1 {
        font-size: 1.8rem !important;
    }

    .nav-links {
        gap: 8px !important;
    }

    .nav-links a {
        font-size: 0.8rem !important;
        padding: 4px 8px;
    }
}

/* Loading Spinner */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(11, 15, 25, 0.2);
    /* Dark track */
    border-radius: 50%;
    border-top-color: #0B0F19;
    /* Dark spinner to match text */
    animation: spin 0.6s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}