/* ============================================================
   OmCalculator — Main Stylesheet
   Structure: Tokens → Base → Layout → Components → Icons → Responsive
   ============================================================ */

/* ============================================================
   1. DESIGN TOKENS — LIGHT THEME
   ============================================================ */
:root {
    color-scheme: light;

    /* Brand */
    --primary: #1e3a8a;
    --primary-hover: #172554;
    --primary-light: #3b82f6;
    --primary-soft: #dbeafe;
    --accent: #f97316;
    --accent-hover: #ea580c;
    --accent-light: #fb923c;
    --accent-soft: #ffedd5;

    /* Surfaces */
    --bg: #f6f8fb;
    --bg-subtle: #eef2f8;
    --bg-elevated: #ffffff;
    --header-bg: rgba(255, 255, 255, 0.78);
    --footer-bg: #ffffff;

    /* Text */
    --text: #0a0f1e;
    --text-heading: #0f1d3a;
    --text-light: #4a5568;
    --text-subtle: #718096;
    --text-inverse: #ffffff;

    /* Cards & borders */
    --card-bg: #ffffff;
    --card-bg-hover: #fafbfd;
    --border: #e8edf3;
    --border-strong: #d4dde7;
    --divider: #eef2f6;

    /* Sidebar */
    --side-bg: #ffffff;
    --side-header: #1e3a8a;
    --side-section: #f4f7fb;

    /* Footer */
    --footer-text: #1e3a8a;
    --footer-muted: #64748b;

    /* Components */
    --box-header-bg: var(--primary);
    --link-color: #1e3a8a;
    --link-hover: var(--accent);
    --list-border: #eef2f6;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    --gradient-accent: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    --gradient-hero:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.45) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(249, 115, 22, 0.4) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(30, 58, 138, 0.5) 0px, transparent 50%),
        linear-gradient(135deg, #0a1e4d 0%, #1e3a8a 100%);
    --gradient-card-hover: linear-gradient(135deg, rgba(59, 130, 246, 0.04) 0%, rgba(249, 115, 22, 0.04) 100%);

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(10, 15, 30, 0.04);
    --shadow-sm: 0 1px 3px rgba(10, 15, 30, 0.06), 0 1px 2px rgba(10, 15, 30, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(10, 15, 30, 0.06), 0 2px 4px -2px rgba(10, 15, 30, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(10, 15, 30, 0.07), 0 4px 6px -4px rgba(10, 15, 30, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(10, 15, 30, 0.08), 0 8px 10px -6px rgba(10, 15, 30, 0.03);
    --shadow-2xl: 0 25px 50px -12px rgba(10, 15, 30, 0.18);
    --glow-primary: 0 0 32px rgba(59, 130, 246, 0.35);
    --glow-accent: 0 0 32px rgba(249, 115, 22, 0.35);
    --glow-brand: 0 0 60px rgba(59, 130, 246, 0.25), 0 0 100px rgba(249, 115, 22, 0.15);

    /* Radii */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 999px;

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;

    /* Motion */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration: 250ms;
    --duration-slow: 400ms;
    --theme-transition: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   2. DESIGN TOKENS — DARK THEME (FULL HD)
   ============================================================ */
[data-theme="dark"] {
    color-scheme: dark;

    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: #60a5fa;
    --primary-soft: #1e2b4a;
    --accent: #fb923c;
    --accent-hover: #f97316;
    --accent-light: #fdba74;
    --accent-soft: #2d1810;

    --bg: #06090f;
    --bg-subtle: #0a0f1a;
    --bg-elevated: #101827;
    --header-bg: rgba(10, 15, 26, 0.75);
    --footer-bg: #0a0f1a;

    --text: #f0f4fa;
    --text-heading: #ffffff;
    --text-light: #a0aec0;
    --text-subtle: #718096;
    --text-inverse: #0a0f1a;

    --card-bg: #101827;
    --card-bg-hover: #162136;
    --border: #1e2a3f;
    --border-strong: #2f3d57;
    --divider: #1a2538;

    --side-bg: #101827;
    --side-header: #1e3a8a;
    --side-section: #162136;

    --footer-text: #f0f4fa;
    --footer-muted: #8b97ad;

    --box-header-bg: #2563eb;
    --link-color: #60a5fa;
    --link-hover: #fb923c;
    --list-border: #1e2a3f;

    --gradient-primary: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    --gradient-accent: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    --gradient-hero:
        radial-gradient(at 0% 0%, rgba(96, 165, 250, 0.35) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(251, 146, 60, 0.3) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(30, 58, 138, 0.65) 0px, transparent 55%),
        linear-gradient(135deg, #02050d 0%, #0a1e4d 100%);
    --gradient-card-hover: linear-gradient(135deg, rgba(96, 165, 250, 0.08) 0%, rgba(251, 146, 60, 0.08) 100%);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.55);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
    --glow-primary: 0 0 40px rgba(96, 165, 250, 0.4);
    --glow-accent: 0 0 40px rgba(251, 146, 60, 0.4);
    --glow-brand: 0 0 80px rgba(96, 165, 250, 0.3), 0 0 120px rgba(251, 146, 60, 0.2);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background var(--theme-transition), color var(--theme-transition);
    overflow-x: hidden;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.25rem;
    width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* Base SVG reset */
svg {
    display: inline-block;
    vertical-align: middle;
}

/* Smooth theme transition on all themed elements */
header,
.express-container,
.category-card,
.featured-tool,
.activity-ticker,
.article-box,
.sidebar-menu,
footer,
.filter-tab,
.search-input,
.dropdown-menu,
.btn-cta-primary {
    transition:
        background-color var(--theme-transition),
        border-color var(--theme-transition),
        color var(--theme-transition),
        box-shadow var(--theme-transition);
}

/* ============================================================
   4. HEADER
   ============================================================ */
header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.header-inner {
    position: relative;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0;
    gap: 1rem;
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo {
    flex: 1;
    text-align: center;
}

.logo a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.logo img {
    height: 38px;
    width: auto;
    border-radius: var(--radius-sm);
}

.logo-text {
    font-weight: 800;
    font-size: 1.28rem;
    letter-spacing: -0.8px;
    line-height: 1;
}

.logo-text .om { color: var(--primary); }
.logo-text .calc { color: var(--accent); }

@media (max-width: 600px) {
    .logo-text { display: none; }
}

.menu-btn,
.theme-switch {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.55rem 0.95rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--duration-fast) var(--ease);
}

.menu-btn:hover,
.theme-switch:hover {
    background: var(--accent);
    color: var(--text-inverse);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .menu-btn:hover,
[data-theme="dark"] .theme-switch:hover {
    color: #0a0f1a;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 1.25rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    display: none;
    flex-direction: column;
    min-width: 240px;
    z-index: 1000;
    overflow: hidden;
    animation: menuIn var(--duration) var(--ease-out);
}

.dropdown-menu.show {
    display: flex;
}

@keyframes menuIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-menu a {
    padding: 0.75rem 1.1rem;
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--list-border);
    transition: all var(--duration-fast) var(--ease);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: var(--accent);
    color: var(--text-inverse);
    padding-left: 1.5rem;
}

.live-clock {
    background: var(--side-section);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.73rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    letter-spacing: 0.3px;
}

.live-clock .pulse-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

@media (max-width: 900px) {
    .live-clock { display: none; }
}

/* ============================================================
   5. BREADCRUMB
   ============================================================ */
.breadcrumb {
    padding: 1.1rem 0;
    font-size: 0.82rem;
    color: var(--text-subtle);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-weight: 500;
}

.breadcrumb a {
    color: var(--primary);
    position: relative;
    transition: color var(--duration-fast);
}

.breadcrumb a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 1.5px;
    background: var(--accent);
    transition: width var(--duration) var(--ease-out);
}

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb a:hover::after {
    width: 100%;
}

.breadcrumb-separator {
    color: var(--text-subtle);
    opacity: 0.5;
}

/* ============================================================
   6. HERO
   ============================================================ */
.hero-banner {
    background: var(--gradient-hero);
    background-size: 200% 200%;
    animation: heroShift 20s ease infinite;
    color: white;
    border-radius: var(--radius-xl);
    padding: 56px 40px;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-2xl), var(--glow-brand);
    isolation: isolate;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0%, transparent 65%);
    border-radius: 50%;
    animation: floatY 12s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

.hero-banner::after {
    content: '';
    position: absolute;
    bottom: -60%;
    left: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.35) 0%, transparent 65%);
    border-radius: 50%;
    animation: floatY 14s ease-in-out infinite reverse;
    z-index: -1;
    pointer-events: none;
}

@keyframes heroShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes floatY {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-25px) scale(1.08); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.hero-badge .dot {
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.hero-title {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 900;
    margin-bottom: 0.75rem;
    line-height: 1.05;
    letter-spacing: -1.5px;
}

.hero-title .orange {
    color: #fcd34d;
}

.hero-subtitle {
    font-size: clamp(0.95rem, 1.5vw, 1.08rem);
    opacity: 0.95;
    margin-bottom: 1.5rem;
    max-width: 600px;
    font-weight: 400;
    line-height: 1.55;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 2.25rem;
    margin-bottom: 1.75rem;
}

.hero-stat .num {
    font-size: 1.75rem;
    font-weight: 900;
    display: block;
    color: #fcd34d;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
}

.hero-stat .lbl {
    font-size: 0.7rem;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 0.35rem;
    display: block;
    font-weight: 600;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.hero-actions a {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    color: white;
    transition: all var(--duration) var(--ease-spring);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.hero-actions a:hover {
    background: white;
    color: var(--primary);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* ============================================================
   7. ACTIVITY TICKER
   ============================================================ */
.activity-ticker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.activity-ticker .at-label {
    background: var(--gradient-accent);
    color: white;
    padding: 0.28rem 0.7rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
    box-shadow: var(--glow-accent);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

[data-theme="dark"] .activity-ticker .at-label {
    color: #0a0f1a;
}

.activity-ticker .at-items {
    display: flex;
    gap: 2.5rem;
    animation: tickerScroll 35s linear infinite;
    white-space: nowrap;
    font-size: 0.82rem;
    color: var(--text-light);
}

.activity-ticker .at-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.activity-ticker .at-item .dot {
    width: 5px;
    height: 5px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
    display: inline-block;
    flex-shrink: 0;
}

.activity-ticker .at-item strong {
    color: var(--text);
    font-weight: 700;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.activity-ticker:hover .at-items {
    animation-play-state: paused;
}

/* ============================================================
   8. LAYOUT
   ============================================================ */
.layout {
    max-width: 1140px;
    margin: 0 auto 3rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    padding: 0 1.25rem;
    width: 100%;
    flex: 1;
}

@media (min-width: 880px) {
    .layout {
        flex-direction: row;
        align-items: flex-start;
    }

    .left-col {
        flex: 1;
        min-width: 0;
    }

    .right-col {
        width: 320px;
        flex-shrink: 0;
        position: sticky;
        top: 95px;
    }
}

h1 {
    color: var(--text-heading);
    font-size: clamp(1.6rem, 4.5vw, 2.2rem);
    margin-bottom: 0.5rem;
    font-weight: 900;
    letter-spacing: -0.8px;
}

h2 {
    color: var(--text-heading);
    font-size: 1.28rem;
    margin: 2.25rem 0 1.1rem;
    font-weight: 800;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    letter-spacing: -0.3px;
}

h2 .icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: var(--radius-sm);
    background: var(--side-section);
    color: var(--primary);
    flex-shrink: 0;
}

h2 .icon-badge svg {
    width: 1rem;
    height: 1rem;
}

h2 .count-pill {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 800;
    background: var(--side-section);
    color: var(--primary);
    padding: 0.22rem 0.7rem;
    border-radius: var(--radius-full);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

/* ============================================================
   9. SEARCH
   ============================================================ */
.express-container {
    border: 1px solid var(--border);
    background: var(--card-bg);
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--duration) var(--ease);
}

.express-container:focus-within {
    box-shadow: var(--shadow-lg), var(--glow-primary);
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

.express-header {
    background: var(--box-header-bg);
    color: white;
    padding: 0.85rem 1.15rem;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.express-header .header-hint {
    margin-left: auto;
    font-size: 0.7rem;
    opacity: 0.8;
    font-weight: 500;
}

.express-header .icon-inline {
    display: inline-flex;
    align-items: center;
    margin-right: 0.35rem;
}

.express-header .icon-inline svg {
    width: 1rem;
    height: 1rem;
}

.search-body {
    padding: 1rem;
    background: var(--bg);
}

.search-input-wrap {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.85rem 3.2rem 0.85rem 1rem;
    border: 2px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    outline: none;
    font-weight: 500;
    transition: all var(--duration) var(--ease);
    font-family: inherit;
}

.search-input::placeholder {
    color: var(--text-subtle);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .search-input:focus {
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2), var(--glow-primary);
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    pointer-events: none;
    display: inline-flex;
    align-items: center;
}

.search-icon svg {
    width: 1rem;
    height: 1rem;
    opacity: 0.55;
}

.search-kbd {
    position: absolute;
    right: 2.7rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--side-section);
    color: var(--text-subtle);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-xs);
    font-size: 0.68rem;
    font-weight: 700;
    border: 1px solid var(--border);
    pointer-events: none;
    font-family: var(--font-mono);
}

.search-results {
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    max-height: 340px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.search-results.show {
    display: block;
    animation: menuIn var(--duration) var(--ease-out);
}

.search-result-item {
    padding: 0.7rem 0.95rem;
    border-bottom: 1px solid var(--list-border);
    display: block;
    color: var(--text);
    transition: all var(--duration-fast) var(--ease);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--primary);
    color: var(--text-inverse);
    padding-left: 1.3rem;
}

.search-result-item .cat {
    font-size: 0.73rem;
    opacity: 0.7;
    font-weight: 500;
}

.search-result-item:hover .cat {
    color: rgba(255, 255, 255, 0.85);
}

/* ============================================================
   10. FEATURED TOOLS
   ============================================================ */
.featured-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.85rem;
    margin-bottom: 2rem;
}

.featured-tool {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    transition: all var(--duration) var(--ease-spring);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.featured-tool::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.08), transparent);
    transition: left var(--duration-slow) var(--ease);
}

.featured-tool:hover::before {
    left: 100%;
}

.featured-tool:hover {
    border-color: var(--accent);
    background: var(--card-bg-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), var(--glow-accent);
}

.featured-tool .ft-icon {
    width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--side-section);
    border-radius: var(--radius-sm);
    color: var(--primary);
    flex-shrink: 0;
    transition: all var(--duration) var(--ease-spring);
}

.featured-tool .ft-icon svg {
    width: 1.2rem;
    height: 1.2rem;
}

.featured-tool:hover .ft-icon {
    transform: scale(1.1) rotate(-5deg);
    background: var(--primary);
    color: var(--text-inverse);
}

[data-theme="dark"] .featured-tool:hover .ft-icon {
    color: #0a0f1a;
}

.featured-tool .ft-body {
    flex: 1;
    min-width: 0;
}

.featured-tool h4 {
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0 0 2px;
    letter-spacing: -0.2px;
}

.featured-tool span {
    color: var(--text-light);
    font-size: 0.73rem;
    font-weight: 500;
}

.featured-tool .ft-arrow {
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    transition: transform var(--duration) var(--ease-spring);
    flex-shrink: 0;
}

.featured-tool .ft-arrow svg {
    width: 1.1rem;
    height: 1.1rem;
}

.featured-tool:hover .ft-arrow {
    transform: translateX(5px);
}

/* ============================================================
   11. FILTER TABS
   ============================================================ */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.filter-tab {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-light);
    padding: 0.4rem 0.95rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.filter-tab svg {
    width: 0.85em;
    height: 0.85em;
}

.filter-tab:hover {
    background: var(--side-section);
    color: var(--primary);
    border-color: var(--primary);
}

.filter-tab.active {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
    box-shadow: 0 2px 10px rgba(30, 58, 138, 0.3);
}

[data-theme="dark"] .filter-tab.active {
    color: #0a0f1a;
    box-shadow: 0 2px 14px rgba(96, 165, 250, 0.4), var(--glow-primary);
}

/* ============================================================
   12. CATEGORY GRID
   ============================================================ */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 0.9rem;
    margin: 1rem 0 2rem;
}

.category-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: all var(--duration) var(--ease-spring);
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    isolation: isolate;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-accent);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform var(--duration) var(--ease-out);
}

.category-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-card-hover);
    opacity: 0;
    transition: opacity var(--duration);
    pointer-events: none;
    z-index: -1;
}

.category-card:hover::before {
    transform: scaleY(1);
}

.category-card:hover::after {
    opacity: 1;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl), var(--glow-accent);
    border-color: var(--primary-light);
    background: var(--card-bg-hover);
}

.cat-top {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.cat-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--side-section);
    border-radius: var(--radius-sm);
    color: var(--primary);
    flex-shrink: 0;
    transition: all var(--duration) var(--ease-spring);
}

.cat-icon svg {
    width: 1.3rem;
    height: 1.3rem;
}

.category-card:hover .cat-icon {
    transform: scale(1.08) rotate(-5deg);
    background: var(--primary);
    color: var(--text-inverse);
}

[data-theme="dark"] .category-card:hover .cat-icon {
    color: #0a0f1a;
}

.category-card h3 {
    color: var(--text-heading);
    font-size: 0.93rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.2px;
}

.category-card p {
    color: var(--text-light);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    line-height: 1.45;
    flex: 1;
}

.category-count {
    display: inline-block;
    align-self: flex-start;
    background: var(--side-section);
    color: var(--primary);
    padding: 0.22rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 800;
    transition: all var(--duration);
    letter-spacing: 0.3px;
}

.category-card:hover .category-count {
    background: var(--primary);
    color: var(--text-inverse);
}

[data-theme="dark"] .category-card:hover .category-count {
    color: #0a0f1a;
}

.category-card[hidden] {
    display: none;
}

/* ============================================================
   13. POPULAR LISTS
   ============================================================ */
.common-conversions {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.conv-list {
    flex: 1;
    min-width: 260px;
    list-style-type: none;
    padding: 0;
    color: var(--text-light);
}

.conv-list li {
    margin-bottom: 0.15rem;
    font-size: 0.9rem;
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius-xs);
    transition: all var(--duration-fast) var(--ease);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.conv-list li::before {
    content: '›';
    color: var(--accent);
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1;
    transition: transform var(--duration-fast);
}

.conv-list li:hover {
    background: var(--side-section);
    padding-left: 1rem;
}

.conv-list li:hover::before {
    transform: translateX(3px);
}

.conv-list a {
    color: var(--link-color);
    font-weight: 500;
    transition: color var(--duration-fast);
}

.conv-list a:hover {
    color: var(--link-hover);
}

/* ============================================================
   14. ARTICLE
   ============================================================ */
.article-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.article-box h2 {
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.65rem;
    margin-bottom: 1.1rem;
    font-size: 1.15rem;
    margin-top: 0;
}

.article-box p {
    font-size: 0.92rem;
    color: var(--text-light);
    margin-bottom: 0.85rem;
    line-height: 1.7;
}

.article-box a {
    color: var(--link-color);
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: all var(--duration-fast);
}

.article-box a:hover {
    color: var(--link-hover);
    border-bottom-color: var(--link-hover);
}

.article-box ul {
    padding-left: 0;
    margin-bottom: 1rem;
    list-style: none;
}

.article-box ul li {
    font-size: 0.92rem;
    color: var(--text-light);
    margin-bottom: 0.55rem;
    position: relative;
    padding-left: 1.7rem;
    line-height: 1.55;
}

.article-box ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0.15rem;
    color: var(--text-inverse);
    background: var(--accent);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 800;
    box-shadow: var(--shadow-xs);
}

[data-theme="dark"] .article-box ul li::before {
    color: #0a0f1a;
}

.highlight-box {
    background: var(--gradient-card-hover);
    padding: 0.9rem 1.15rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent);
    margin: 0.9rem 0;
    font-size: 0.88rem;
    color: var(--text);
}

/* ============================================================
   15. CTA
   ============================================================ */
.cta-section {
    background: var(--gradient-primary);
    color: white;
    padding: 2.5rem 1.75rem;
    border-radius: var(--radius-lg);
    text-align: center;
    margin: 2.5rem 0;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xl), var(--glow-primary);
    isolation: isolate;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatY 8s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

[data-theme="dark"] .cta-section::before {
    background: radial-gradient(circle, rgba(251, 146, 60, 0.35) 0%, transparent 70%);
}

.cta-section h2 {
    color: white;
    border: none;
    margin: 0 0 0.5rem;
    padding: 0;
    justify-content: center;
    font-size: 1.5rem;
}

.cta-section p {
    opacity: 0.92;
    margin-bottom: 1.35rem;
    font-size: 0.95rem;
    position: relative;
}

.cta-btns {
    display: flex;
    gap: 0.65rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

.btn-cta-primary {
    background: #fff;
    color: var(--primary);
    padding: 0.75rem 1.6rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.88rem;
    transition: all var(--duration) var(--ease-spring);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.btn-cta-primary:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.btn-cta-primary svg {
    width: 1em;
    height: 1em;
    transition: transform var(--duration-fast);
}

.btn-cta-primary:hover svg {
    transform: translateX(3px);
}

.btn-cta-secondary {
    background: transparent;
    color: #fff;
    padding: 0.75rem 1.6rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    border: 2px solid #fff;
    font-size: 0.88rem;
    transition: all var(--duration) var(--ease-spring);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-cta-secondary:hover {
    background: #fff;
    color: var(--primary);
    transform: translateY(-3px);
}

/* ============================================================
   16. SIDEBAR
   ============================================================ */
.ad-container {
    margin-bottom: 1.5rem;
    text-align: center;
    overflow: hidden;
    max-width: 100%;
}

.sidebar-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--side-bg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.sidebar-header {
    background: var(--side-header);
    color: white;
    padding: 0.85rem 1.1rem;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-header svg {
    width: 1rem;
    height: 1rem;
}

.sidebar-section {
    background: var(--side-section);
    padding: 0.55rem 1.1rem;
    font-weight: 800;
    font-size: 0.78rem;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.sidebar-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.1rem;
    padding: 0.6rem;
}

.sidebar-links a {
    color: var(--text-light);
    font-size: 0.85rem;
    transition: all var(--duration-fast) var(--ease);
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.sidebar-links a svg {
    width: 0.9em;
    height: 0.9em;
    color: var(--text-subtle);
    flex-shrink: 0;
}

.sidebar-links a svg:last-child {
    margin-left: auto;
    color: var(--accent);
    transition: transform var(--duration-fast);
}

.sidebar-links a:hover {
    color: var(--primary);
    background: var(--side-section);
    padding-left: 0.9rem;
}

.sidebar-links a:hover svg:first-child {
    color: var(--primary);
}

.sidebar-links a:hover svg:last-child {
    transform: translateX(3px);
}

.sidebar-promo {
    background: var(--gradient-accent);
    color: white;
    border-radius: var(--radius-md);
    padding: 1.15rem 1.2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    text-align: center;
    box-shadow: var(--shadow-md), var(--glow-accent);
}

.sidebar-promo::before {
    content: '⚡';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 4.5rem;
    opacity: 0.18;
    pointer-events: none;
}

.sidebar-promo h4 {
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
    font-weight: 800;
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.sidebar-promo h4 svg {
    width: 1rem;
    height: 1rem;
}

.sidebar-promo p {
    font-size: 0.78rem;
    opacity: 0.92;
    margin-bottom: 0.85rem;
}

.sidebar-promo a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #fff;
    color: var(--accent-hover);
    padding: 0.45rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.78rem;
    transition: all var(--duration) var(--ease-spring);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-promo a:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.sidebar-promo a svg {
    width: 0.9em;
    height: 0.9em;
    transition: transform var(--duration-fast);
}

.sidebar-promo a:hover svg {
    transform: translateX(2px);
}

/* ============================================================
   17. FOOTER
   ============================================================ */
footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border);
    color: var(--footer-text);
    text-align: center;
    padding: 2.5rem 1.25rem;
    margin-top: 4rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 1.25rem 0;
}

footer a {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color var(--duration-fast);
    position: relative;
}

footer a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0;
    height: 1.5px;
    background: var(--accent);
    transition: width var(--duration) var(--ease-out);
}

footer a:hover {
    color: var(--accent);
}

footer a:hover::after {
    width: 100%;
}

.footer-copyright {
    color: var(--footer-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* ============================================================
   18. MOBILE STICKY QUICK NAV
   ============================================================ */
.mobile-quick-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 0.5rem;
    z-index: 99;
    box-shadow: 0 -4px 20px rgba(10, 15, 30, 0.08);
}

.mobile-quick-nav .mqn-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.25rem;
}

.mobile-quick-nav a {
    text-align: center;
    padding: 0.5rem 0.25rem;
    border-radius: var(--radius-xs);
    font-size: 0.65rem;
    color: var(--text-light);
    font-weight: 600;
    transition: all var(--duration-fast) var(--ease);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.mobile-quick-nav a svg {
    width: 1.3rem;
    height: 1.3rem;
}

.mobile-quick-nav a:hover,
.mobile-quick-nav a:focus {
    background: var(--side-section);
    color: var(--primary);
}

@media (max-width: 768px) {
    .mobile-quick-nav {
        display: block;
    }

    body {
        padding-bottom: 70px;
    }
}

/* ============================================================
   19. BACK TO TOP
   ============================================================ */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 46px;
    height: 46px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--duration) var(--ease-spring);
    border: none;
    font-family: inherit;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: var(--shadow-2xl), var(--glow-primary);
}

.back-to-top svg {
    width: 1.2rem;
    height: 1.2rem;
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 80px;
        right: 16px;
    }
}

/* ============================================================
   20. RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .main-nav {
        gap: 0.5rem;
    }

    .logo img {
        height: 30px;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.65rem;
    }

    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
        gap: 0.7rem;
    }

    .hero-banner {
        padding: 36px 22px;
        border-radius: var(--radius-lg);
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .hero-actions {
        gap: 0.4rem;
    }

    .hero-actions a {
        font-size: 0.75rem;
        padding: 0.45rem 0.9rem;
    }

    .article-box {
        padding: 1.25rem;
    }

    .express-header {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .main-nav {
        gap: 0.25rem;
    }

    .theme-switch .theme-text,
    .menu-btn .menu-label {
        display: none;
    }

    .logo img {
        height: 24px;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        gap: 1rem;
    }

    .hero-stat .num {
        font-size: 1.2rem;
    }

    .hero-stat .lbl {
        font-size: 0.65rem;
    }

    .activity-ticker .at-items {
        animation-duration: 22s;
    }
}

/* ============================================================
   21. SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 10px;
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-accent);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1e40af 0%, #60a5fa 100%);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ea580c 0%, #fdba74 100%);
}

/* ============================================================
   22. ICON SYSTEM — Premium SVG Icons
   ============================================================ */
.icon,
svg.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    fill: currentColor;
    flex-shrink: 0;
    transition: transform var(--duration) var(--ease-spring);
}

button svg.icon,
a svg.icon {
    pointer-events: none;
}

.icon-xs { width: 0.75em; height: 0.75em; }
.icon-sm { width: 0.9em; height: 0.9em; }
.icon-md { width: 1.1em; height: 1.1em; }
.icon-lg { width: 1.4em; height: 1.4em; }
.icon-xl { width: 1.8em; height: 1.8em; }

.menu-btn svg.icon {
    width: 1.1em;
    height: 1.1em;
}

.theme-switch svg.icon {
    width: 1em;
    height: 1em;
    transition: transform var(--duration) var(--ease-spring), color var(--duration);
}

.theme-switch:hover svg.icon {
    transform: rotate(15deg) scale(1.1);
}

/* Spinner (for loading states) */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.icon-spin svg.icon {
    animation: spin 1s linear infinite;
}

/* Ensure inline alignment for icon+text pairs */
.menu-label,
.theme-text,
.hero-actions a,
.featured-tool h4,
.filter-tab,
.cat-top h3,
.sidebar-links a,
.btn-cta-primary,
.btn-cta-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* ============================================================
   23. ANIMATIONS & ACCESSIBILITY
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.show {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   24. PRINT STYLES
   ============================================================ */
@media print {
    header,
    footer,
    .mobile-quick-nav,
    .back-to-top,
    .activity-ticker,
    .ad-container {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .hero-banner {
        background: white;
        color: black;
        box-shadow: none;
    }
}