/* ============================================================================
   CONVERTIX - Master Design System
   ============================================================================
   Premium design system with CSS custom properties, responsive layout,
   dark mode, micro-interactions, and performance-first architecture.
   Font: Plus Jakarta Sans (display) + JetBrains Mono (code/mono)
   ============================================================================ */

/* ============================================================================
   1. CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================================================ */
:root {
    /* ---- Color Palette: Indigo Core with Electric Accents ---- */
    --c-primary-50:  #eef2ff;
    --c-primary-100: #e0e7ff;
    --c-primary-200: #c7d2fe;
    --c-primary-300: #a5b4fc;
    --c-primary-400: #818cf8;
    --c-primary-500: #6366f1;
    --c-primary-600: #4f46e5;
    --c-primary-700: #4338ca;
    --c-primary-800: #3730a3;
    --c-primary-900: #312e81;
    --c-primary-950: #1e1b4b;

    --c-accent-400:  #34d399;
    --c-accent-500:  #10b981;
    --c-accent-600:  #059669;

    --c-warn-400:    #fbbf24;
    --c-warn-500:    #f59e0b;
    --c-danger-400:  #f87171;
    --c-danger-500:  #ef4444;

    /* ---- Neutral Scale ---- */
    --c-gray-50:   #f8fafc;
    --c-gray-100:  #f1f5f9;
    --c-gray-200:  #e2e8f0;
    --c-gray-300:  #cbd5e1;
    --c-gray-400:  #94a3b8;
    --c-gray-500:  #64748b;
    --c-gray-600:  #475569;
    --c-gray-700:  #334155;
    --c-gray-800:  #1e293b;
    --c-gray-900:  #0f172a;
    --c-gray-950:  #020617;

    /* ---- Semantic Tokens (Light Mode Defaults) ---- */
    --bg-body:       #f8fafc;
    --bg-surface:    #ffffff;
    --bg-surface-2:  #f1f5f9;
    --bg-surface-3:  #e2e8f0;
    --bg-elevated:   #ffffff;
    --bg-overlay:    rgba(15, 23, 42, 0.5);

    --text-primary:   #0f172a;
    --text-secondary: #475569;
    --text-tertiary:  #94a3b8;
    --text-inverse:   #f8fafc;
    --text-link:      #4f46e5;
    --text-link-hover:#4338ca;

    --border-default:  #e2e8f0;
    --border-subtle:   #f1f5f9;
    --border-strong:   #cbd5e1;
    --border-focus:    #818cf8;

    /* ---- Shadows ---- */
    --shadow-xs:   0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:   0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg:   0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl:   0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.02);

    /* ---- Typography ---- */
    --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body:    'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:    'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

    --text-xs:   0.75rem;     /* 12px */
    --text-sm:   0.8125rem;   /* 13px */
    --text-base: 0.9375rem;   /* 15px */
    --text-lg:   1.0625rem;   /* 17px */
    --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 */

    --leading-tight:  1.25;
    --leading-snug:   1.375;
    --leading-normal: 1.6;
    --leading-relaxed: 1.75;

    /* ---- Spacing Scale ---- */
    --space-1:  0.25rem;  /* 4px */
    --space-2:  0.5rem;   /* 8px */
    --space-3:  0.75rem;  /* 12px */
    --space-4:  1rem;     /* 16px */
    --space-5:  1.25rem;  /* 20px */
    --space-6:  1.5rem;   /* 24px */
    --space-8:  2rem;     /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */

    /* ---- Layout ---- */
    --container-max:  1280px;
    --container-narrow: 800px;
    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  14px;
    --radius-xl:  20px;
    --radius-2xl: 28px;
    --radius-full: 9999px;

    /* ---- Transitions ---- */
    --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out:     cubic-bezier(0, 0, 0.2, 1);
    --duration-fast:   150ms;
    --duration-normal: 250ms;
    --duration-slow:   400ms;

    /* ---- Z-index Scale ---- */
    --z-dropdown: 100;
    --z-sticky:   200;
    --z-modal:    300;
    --z-toast:    400;
    --z-tooltip:  500;

    /* ---- Header ---- */
    --header-height: 64px;
}

/* ============================================================================
   2. DARK MODE
   ============================================================================ */
[data-theme="dark"] {
    --bg-body:       #0c0a1a;
    --bg-surface:    #151228;
    --bg-surface-2:  #1c1836;
    --bg-surface-3:  #252042;
    --bg-elevated:   #1c1836;
    --bg-overlay:    rgba(0, 0, 0, 0.7);

    --text-primary:   #e8e6f0;
    --text-secondary: #a5a0c0;
    --text-tertiary:  #6b6590;
    --text-inverse:   #0f172a;
    --text-link:      #a5b4fc;
    --text-link-hover:#c7d2fe;

    --border-default:  #2a2548;
    --border-subtle:   #1c1836;
    --border-strong:   #3a3460;
    --border-focus:    #818cf8;

    --shadow-xs:   0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.3);
    --shadow-md:   0 4px 6px rgba(0,0,0,0.3);
    --shadow-lg:   0 10px 15px rgba(0,0,0,0.3);
    --shadow-xl:   0 20px 25px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.03);
}

/* ============================================================================
   3. RESET & BASE
   ============================================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Selection */
::selection {
    background: var(--c-primary-200);
    color: var(--c-primary-900);
}
[data-theme="dark"] ::selection {
    background: var(--c-primary-800);
    color: var(--c-primary-100);
}

/* Links */
a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-default);
}
a:hover { color: var(--text-link-hover); }
a:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Images */
img, svg, video { max-width: 100%; display: block; }
img { height: auto; }

/* Lists */
ul, ol { list-style: none; }

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: var(--leading-tight);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl);  }
h4 { font-size: var(--text-lg);  }

/* ============================================================================
   4. ACCESSIBILITY
   ============================================================================ */
.cvx-skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--c-primary-600);
    color: #fff;
    padding: var(--space-3) var(--space-6);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    z-index: calc(var(--z-tooltip) + 1);
    font-weight: 600;
    font-size: var(--text-sm);
    transition: top var(--duration-fast);
}
.cvx-skip-link:focus {
    top: 0;
    color: #fff;
}

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

/* ============================================================================
   5. LAYOUT: CONTAINER
   ============================================================================ */
.cvx-container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-6);
}
.cvx-container-narrow {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* ============================================================================
   6. HEADER & NAVIGATION
   ============================================================================ */
.cvx-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
    height: var(--header-height);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    transition: box-shadow var(--duration-normal) var(--ease-default),
                background var(--duration-normal) var(--ease-default);
}
.cvx-header.scrolled {
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .cvx-header {
    background: rgba(12, 10, 26, 0.85);
}

.cvx-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    gap: var(--space-8);
}

/* Logo */
.cvx-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--text-primary);
    font-weight: 800;
    font-size: var(--text-lg);
    letter-spacing: -0.03em;
    flex-shrink: 0;
    transition: opacity var(--duration-fast);
}
.cvx-logo:hover { color: var(--text-primary); opacity: 0.85; }
.cvx-logo-icon { flex-shrink: 0; }

/* Nav Links */
.cvx-nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}
.cvx-nav-links a {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    transition: color var(--duration-fast), background var(--duration-fast);
    display: flex;
    align-items: center;
    gap: var(--space-1);
    white-space: nowrap;
}
.cvx-nav-links a:hover,
.cvx-nav-links a.active {
    color: var(--text-primary);
    background: var(--bg-surface-2);
}
.cvx-nav-links a.active {
    color: var(--c-primary-600);
    background: var(--c-primary-50);
}
[data-theme="dark"] .cvx-nav-links a.active {
    color: var(--c-primary-300);
    background: rgba(99, 102, 241, 0.1);
}

/* Dropdown */
.cvx-nav-dropdown { position: relative; }
.cvx-dropdown-menu {
    position: absolute;
    top: calc(100% + var(--space-2));
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--space-4);
    min-width: 480px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--duration-normal) var(--ease-default),
                transform var(--duration-normal) var(--ease-default),
                visibility var(--duration-normal);
}
.cvx-nav-dropdown:hover .cvx-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.cvx-dropdown-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}
.cvx-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    transition: background var(--duration-fast);
}
.cvx-dropdown-item:hover {
    background: var(--bg-surface-2);
    color: var(--text-primary);
}
.cvx-dropdown-icon {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}
.cvx-dropdown-item strong {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.cvx-dropdown-item small {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    line-height: var(--leading-snug);
}
.cvx-dropdown-footer {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}
.cvx-dropdown-footer a {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--c-primary-600);
}

/* Nav Actions */
.cvx-nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

/* Theme Toggle */
.cvx-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
}
.cvx-theme-toggle:hover {
    background: var(--bg-surface-2);
    color: var(--text-primary);
    border-color: var(--border-strong);
}
[data-theme="light"] .cvx-icon-moon { display: none; }
[data-theme="dark"]  .cvx-icon-sun  { display: none; }

/* Mobile Toggle */
.cvx-mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    cursor: pointer;
}
.cvx-hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 18px;
}
.cvx-hamburger span {
    display: block;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: transform var(--duration-normal) var(--ease-spring),
                opacity var(--duration-fast);
}
.cvx-mobile-toggle[aria-expanded="true"] .cvx-hamburger span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.cvx-mobile-toggle[aria-expanded="true"] .cvx-hamburger span:nth-child(2) {
    opacity: 0;
}
.cvx-mobile-toggle[aria-expanded="true"] .cvx-hamburger span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ============================================================================
   7. MAIN CONTENT
   ============================================================================ */
.cvx-main {
    flex: 1;
    min-height: calc(100vh - var(--header-height) - 200px);
}

/* ============================================================================
   8. BUTTONS
   ============================================================================ */
.cvx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1;
    padding: var(--space-3) var(--space-6);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}
.cvx-btn:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}
.cvx-btn:active { transform: scale(0.97); }

.cvx-btn-primary {
    background: var(--c-primary-600);
    color: #fff;
    border-color: var(--c-primary-600);
}
.cvx-btn-primary:hover {
    background: var(--c-primary-700);
    border-color: var(--c-primary-700);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.cvx-btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-default);
}
.cvx-btn-secondary:hover {
    background: var(--bg-surface-2);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.cvx-btn-accent {
    background: var(--c-accent-500);
    color: #fff;
    border-color: var(--c-accent-500);
}
.cvx-btn-accent:hover {
    background: var(--c-accent-600);
    border-color: var(--c-accent-600);
    color: #fff;
}

.cvx-btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.cvx-btn-ghost:hover {
    background: var(--bg-surface-2);
    color: var(--text-primary);
}

.cvx-btn-lg {
    font-size: var(--text-base);
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-lg);
}

.cvx-btn-sm {
    font-size: var(--text-xs);
    padding: var(--space-2) var(--space-4);
}

/* ============================================================================
   9. CARDS
   ============================================================================ */
.cvx-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: border-color var(--duration-fast), box-shadow var(--duration-normal);
}
.cvx-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

/* Tool Card */
.cvx-tool-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-5);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    transition: all var(--duration-normal) var(--ease-default);
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}
.cvx-tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--tool-accent, var(--c-primary-500));
    opacity: 0;
    transition: opacity var(--duration-normal);
}
.cvx-tool-card:hover {
    border-color: var(--tool-accent, var(--c-primary-400));
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    color: var(--text-primary);
}
.cvx-tool-card:hover::before { opacity: 1; }

.cvx-tool-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    background: var(--bg-surface-2);
    transition: background var(--duration-fast);
}
.cvx-tool-card:hover .cvx-tool-card-icon {
    background: color-mix(in srgb, var(--tool-accent, var(--c-primary-500)) 10%, transparent);
}

.cvx-tool-card-title {
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: var(--leading-snug);
    color: var(--text-primary);
}
.cvx-tool-card-desc {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    line-height: var(--leading-normal);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cvx-tool-card-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--c-primary-50);
    color: var(--c-primary-700);
    align-self: flex-start;
}
[data-theme="dark"] .cvx-tool-card-badge {
    background: rgba(99, 102, 241, 0.15);
    color: var(--c-primary-300);
}

/* ============================================================================
   10. TOOL GRID
   ============================================================================ */
.cvx-tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-4);
}

/* ============================================================================
   11. HERO SECTION
   ============================================================================ */
.cvx-hero {
    padding: var(--space-20) 0 var(--space-16);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cvx-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 80% 50%, rgba(16, 185, 129, 0.05), transparent);
    pointer-events: none;
}
[data-theme="dark"] .cvx-hero::before {
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 50%, rgba(16, 185, 129, 0.08), transparent);
}

.cvx-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-4);
    background: var(--c-primary-50);
    color: var(--c-primary-700);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    margin-bottom: var(--space-6);
    border: 1px solid var(--c-primary-100);
}
[data-theme="dark"] .cvx-hero-badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--c-primary-300);
    border-color: rgba(99, 102, 241, 0.2);
}
.cvx-hero-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-accent-500);
    animation: cvx-pulse 2s ease-in-out infinite;
}

.cvx-hero h1 {
    font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
    font-weight: 800;
    max-width: 800px;
    margin: 0 auto var(--space-6);
    letter-spacing: -0.03em;
    line-height: 1.1;
}
.cvx-hero-gradient {
    background: linear-gradient(135deg, var(--c-primary-500), var(--c-primary-400), var(--c-accent-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cvx-hero p {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-8);
    line-height: var(--leading-relaxed);
}

.cvx-hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

/* ============================================================================
   12. STATS BAR
   ============================================================================ */
.cvx-stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-10);
    padding: var(--space-8) 0;
    flex-wrap: wrap;
}
.cvx-stat-item {
    text-align: center;
}
.cvx-stat-number {
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: var(--space-1);
}
.cvx-stat-label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

/* ============================================================================
   13. SECTIONS
   ============================================================================ */
.cvx-section {
    padding: var(--space-16) 0;
}
.cvx-section-header {
    text-align: center;
    margin-bottom: var(--space-12);
}
.cvx-section-header h2 {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-3);
}
.cvx-section-header p {
    color: var(--text-secondary);
    font-size: var(--text-lg);
    max-width: 600px;
    margin: 0 auto;
}
.cvx-section-alt {
    background: var(--bg-surface-2);
}

/* ============================================================================
   14. CATEGORY TABS
   ============================================================================ */
.cvx-category-tabs {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding: var(--space-2) 0;
    margin-bottom: var(--space-8);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.cvx-category-tabs::-webkit-scrollbar { display: none; }

.cvx-category-tab {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--duration-fast);
    font-family: var(--font-body);
}
.cvx-category-tab:hover,
.cvx-category-tab.active {
    background: var(--c-primary-600);
    color: #fff;
    border-color: var(--c-primary-600);
}

/* ============================================================================
   15. FOOTER
   ============================================================================ */
.cvx-footer {
    margin-top: auto;
}

.cvx-footer-newsletter {
    background: linear-gradient(135deg, var(--c-primary-900), var(--c-primary-950));
    padding: var(--space-12) 0;
    color: #fff;
}
[data-theme="dark"] .cvx-footer-newsletter {
    background: linear-gradient(135deg, #1c1836, #0c0a1a);
    border-top: 1px solid var(--border-default);
}

.cvx-newsletter-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-8);
}
.cvx-newsletter-text h3 {
    font-size: var(--text-xl);
    color: #fff;
    margin-bottom: var(--space-2);
}
.cvx-newsletter-text p {
    color: var(--c-primary-200);
    font-size: var(--text-sm);
}
.cvx-newsletter-input-group {
    display: flex;
    gap: var(--space-2);
    min-width: 380px;
}
.cvx-newsletter-input-group input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: var(--text-sm);
    font-family: var(--font-body);
}
.cvx-newsletter-input-group input::placeholder { color: rgba(255,255,255,0.5); }
.cvx-newsletter-input-group input:focus {
    outline: none;
    border-color: var(--c-primary-400);
    background: rgba(255,255,255,0.15);
}

.cvx-footer-main {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-default);
    padding: var(--space-12) 0;
}
.cvx-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-10);
}
.cvx-footer-brand { max-width: 360px; }
.cvx-footer-desc {
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    margin: var(--space-4) 0;
}
.cvx-social-links {
    display: flex;
    gap: var(--space-3);
}
.cvx-social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-2);
    color: var(--text-secondary);
    transition: all var(--duration-fast);
}
.cvx-social-links a:hover {
    background: var(--c-primary-600);
    color: #fff;
}
.cvx-footer-links h4 {
    font-size: var(--text-sm);
    font-weight: 700;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}
.cvx-footer-links ul { display: flex; flex-direction: column; gap: var(--space-2); }
.cvx-footer-links a {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    transition: color var(--duration-fast);
}
.cvx-footer-links a:hover { color: var(--text-primary); }

.cvx-footer-bottom {
    background: var(--bg-surface-2);
    border-top: 1px solid var(--border-default);
    padding: var(--space-6) 0;
}
.cvx-footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}
.cvx-footer-meta strong { color: var(--c-accent-500); font-weight: 600; }

/* ============================================================================
   16. AD SLOTS
   ============================================================================ */
.cvx-ad-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-4) 0;
}
.cvx-ad-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-1);
}
.cvx-hide-mobile { display: flex; }
.cvx-hide-desktop { display: none; }

/* ============================================================================
   17. ANIMATIONS
   ============================================================================ */
@keyframes cvx-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

@keyframes cvx-fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes cvx-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.cvx-animate-in {
    animation: cvx-fadeInUp var(--duration-slow) var(--ease-out) forwards;
    opacity: 0;
}
.cvx-delay-1 { animation-delay: 100ms; }
.cvx-delay-2 { animation-delay: 200ms; }
.cvx-delay-3 { animation-delay: 300ms; }
.cvx-delay-4 { animation-delay: 400ms; }

/* ============================================================================
   18. FORM ELEMENTS
   ============================================================================ */
.cvx-input, .cvx-select, .cvx-textarea {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    width: 100%;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.cvx-input:focus, .cvx-select:focus, .cvx-textarea:focus {
    outline: none;
    border-color: var(--c-primary-400);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.cvx-input::placeholder { color: var(--text-tertiary); }
.cvx-textarea { resize: vertical; min-height: 120px; }
.cvx-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

/* ============================================================================
   19. UTILITIES
   ============================================================================ */
.cvx-text-center { text-align: center; }
.cvx-text-gradient {
    background: linear-gradient(135deg, var(--c-primary-500), var(--c-accent-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.cvx-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.cvx-divider {
    height: 1px;
    background: var(--border-default);
    margin: var(--space-8) 0;
}

/* ============================================================================
   20. RESPONSIVE
   ============================================================================ */
@media (max-width: 1024px) {
    .cvx-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-8);
    }
}

@media (max-width: 768px) {
    :root { --header-height: 56px; }

    .cvx-nav-links { display: none; }
    .cvx-mobile-toggle { display: flex; }
    .cvx-dropdown-menu { display: none !important; }

    /* Mobile menu */
    .cvx-nav-links.open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-surface);
        padding: var(--space-6);
        gap: var(--space-1);
        z-index: var(--z-modal);
        overflow-y: auto;
        animation: cvx-fadeIn var(--duration-normal) var(--ease-default);
    }
    .cvx-nav-links.open a {
        padding: var(--space-4);
        font-size: var(--text-base);
        border-radius: var(--radius-md);
    }

    .cvx-hero { padding: var(--space-12) 0 var(--space-10); }
    .cvx-hero h1 { font-size: var(--text-3xl); }

    .cvx-tool-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: var(--space-3);
    }

    .cvx-stats-bar { gap: var(--space-6); }
    .cvx-stat-number { font-size: var(--text-2xl); }

    .cvx-newsletter-inner { flex-direction: column; text-align: center; }
    .cvx-newsletter-input-group { min-width: 100%; flex-direction: column; }

    .cvx-footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    .cvx-footer-brand { max-width: 100%; }
    .cvx-footer-bottom-inner { flex-direction: column; gap: var(--space-2); text-align: center; }

    .cvx-section { padding: var(--space-10) 0; }
    .cvx-section-header { margin-bottom: var(--space-8); }
    .cvx-section-header h2 { font-size: var(--text-2xl); }

    .cvx-hide-mobile { display: none !important; }
    .cvx-hide-desktop { display: flex; }

    .cvx-hero-actions { flex-direction: column; width: 100%; }
    .cvx-hero-actions .cvx-btn { width: 100%; }
}

@media (max-width: 480px) {
    .cvx-container { padding: 0 var(--space-4); }
    .cvx-tool-grid { grid-template-columns: 1fr 1fr; }
    .cvx-tool-card { padding: var(--space-4); }
    .cvx-hero h1 { font-size: var(--text-2xl); }
}

/* ============================================================================
   21. PRINT STYLES
   ============================================================================ */
@media print {
    .cvx-header, .cvx-footer, .cvx-ad-slot,
    .cvx-theme-toggle, .cvx-mobile-toggle,
    .cvx-footer-newsletter { display: none !important; }

    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
    }
    .cvx-main { padding: 0; }
    a { color: #000; text-decoration: underline; }
    a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}
