/* ========== Hero Section ========== */
.home-hero {
    position: relative;
    padding: 48px 40px 140px;
    margin: -24px -24px 0;
    overflow: hidden;
    isolation: isolate;
    -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}

/* ---------- Dark Theme Hero ---------- */
:root.dark .home-hero {
    background: linear-gradient(160deg, #0a0e27 0%, #0d1133 40%, #111540 100%);
}

/* ---------- Light Theme Hero ---------- */
:root:not(.dark) .home-hero {
    background: linear-gradient(160deg, #e8f0fe 0%, #eef2ff 45%, #f0f7ff 100%);
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: auto;
}

/* Split Hero Layout */
.home-hero-split {
    position: relative;
    z-index: 1;
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 40px;
    min-height: 420px;
    pointer-events: none;
}

.home-hero-split > * {
    pointer-events: auto;
}

.hero-left {
    flex: 1;
    text-align: left;
    max-width: 560px;
    padding-left: 20px;
}

.hero-right {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 420px;
    pointer-events: none !important;
}

/* ========== Title ========== */
.home-hero-title {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 14px;
}

:root.dark .home-hero-title {
    color: #f1f5f9;
}

:root:not(.dark) .home-hero-title {
    color: #0f172a;
}

.wave-emoji {
    display: inline-block;
    animation: wave-hand 2s ease-in-out infinite;
    transform-origin: 70% 70%;
}

@@keyframes wave-hand {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    30% { transform: rotate(14deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(10deg); }
    60%, 100% { transform: rotate(0deg); }
}

/* ========== Subtitle ========== */
.home-hero-subtitle {
    font-size: 16px;
    line-height: 1.65;
    margin: 0 0 32px;
}

:root.dark .home-hero-subtitle { color: #94a3b8; }
:root:not(.dark) .home-hero-subtitle { color: #546e8a; }

/* ========== Custom Prompt Box ========== */
.home-prompt-box {
    margin-top: 0;
}

.prompt-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 18px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

:root.dark .prompt-input-wrapper {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

:root:not(.dark) .prompt-input-wrapper {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px rgba(22, 119, 255, 0.08), 0 0 0 1px #fff inset;
}

.prompt-input-wrapper:focus-within {
    border-color: rgba(124, 58, 237, 0.5);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12), 0 12px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.prompt-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 15px;
    padding: 6px 0;
}

:root.dark .prompt-input { color: #e2e8f0; }
:root:not(.dark) .prompt-input { color: #0f172a; }
:root.dark .prompt-input::placeholder { color: rgba(148, 163, 184, 0.6); }
:root:not(.dark) .prompt-input::placeholder { color: rgba(100, 116, 139, 0.6); }

.prompt-send-btn {
    width: 36px; height: 36px;
    border-radius: 10px;
    border: none;
    background: #1677ff;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.prompt-send-btn:hover {
    background: #4096ff;
    transform: scale(1.05);
}

.prompt-suggestions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    padding-left: 4px;
    font-size: 12px;
}

:root.dark .prompt-suggestions { color: #64748b; }
:root:not(.dark) .prompt-suggestions { color: #94a3b8; }

.suggest-btn {
    padding: 5px 14px;
    border-radius: 99px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

:root.dark .suggest-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
}

:root:not(.dark) .suggest-btn {
    background: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.06);
    color: #64748b;
}

.suggest-btn:hover {
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(124, 58, 237, 0.3);
    color: #c084fc;
}

/* ========== AI Status Bar ========== */
.ai-status-bar {
    position: relative;
    z-index: 10;
    display: flex;
    width: max-content;
    margin: 32px auto 0;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 24px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s;
}

:root.dark .ai-status-bar { 
    color: rgba(248, 250, 252, 0.9);
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
:root:not(.dark) .ai-status-bar { 
    color: rgba(15, 23, 42, 0.8);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(200, 210, 255, 0.5);
    box-shadow: 0 4px 12px rgba(100, 110, 255, 0.1);
}

.ai-status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
    animation: status-blink 2s ease-in-out infinite;
}

@@keyframes status-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.ai-status-wave {
    font-size: 11px;
    letter-spacing: 1px;
    opacity: 0.6;
}

/* ========== Categories Section ========== */
.home-cats-section {
    padding: 20px 40px 64px;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.home-cats-header {
    text-align: center;
    margin-bottom: 32px;
}

.home-cats-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 6px;
}

:root.dark .home-cats-title { color: #f8fafc; }
:root:not(.dark) .home-cats-title { color: #101828; }

.home-cats-subtitle {
    font-size: 14px;
}

:root.dark .home-cats-subtitle { color: #94a3b8; }
:root:not(.dark) .home-cats-subtitle { color: #667085; }

/* Spotlight Card (Knowledge Node) */
.home-cat-card {
    border-radius: 20px;
    padding: 28px 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    will-change: transform;
    transition: all 0.3s ease;
}

:root.dark .home-cat-card {
    background: #141414;
    border: 1px solid #333;
}

:root:not(.dark) .home-cat-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.home-cat-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

:root.dark .home-cat-card::before {
    background: radial-gradient(
        600px circle at var(--mouse-x) var(--mouse-y), 
        rgba(124, 58, 237, 0.15),
        transparent 40%
    );
}

:root:not(.dark) .home-cat-card::before {
    background: radial-gradient(
        600px circle at var(--mouse-x) var(--mouse-y), 
        rgba(22, 119, 255, 0.1),
        transparent 40%
    );
}

.home-cat-card:hover::before {
    opacity: 1;
}

.home-cat-card > * {
    position: relative;
    z-index: 1;
}

.home-cat-card-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    transition: all 0.3s;
}

:root.dark .home-cat-card-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
    color: #a78bfa;
}

:root:not(.dark) .home-cat-card-icon {
    background: linear-gradient(135deg, #eff6ff 0%, #f0e7ff 100%);
    color: #7c3aed;
}

.home-cat-card-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
}

:root.dark .home-cat-card-title { color: #f8fafc; }
:root:not(.dark) .home-cat-card-title { color: #101828; }

.home-cat-card-desc {
    font-size: 13px;
    line-height: 1.6;
    flex: 1;
}

:root.dark .home-cat-card-desc { color: #94a3b8; }
:root:not(.dark) .home-cat-card-desc { color: #667085; }

.home-cat-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    padding-top: 14px;
}

:root.dark .home-cat-card-footer { border-top: 1px solid rgba(255,255,255,0.06); }
:root:not(.dark) .home-cat-card-footer { border-top: 1px solid #f2f4f7; }

.home-cat-card-tag {
    font-size: 11px;
    border-radius: 4px;
    padding: 2px 8px;
}

:root.dark .home-cat-card-tag {
    border: 1px solid rgba(124,58,237,0.3);
    color: #a78bfa;
    background: rgba(124,58,237,0.1);
}

:root:not(.dark) .home-cat-card-tag {
    border: 1px solid rgba(22,119,255,0.3);
    color: #1677ff;
    background: #eff6ff;
}

.home-cat-card-link {
    font-size: 13px;
    font-weight: 600;
    color: #1677ff;
    display: flex; align-items: center; gap: 4px;
    transition: gap 0.2s;
}

.home-cat-card:hover .home-cat-card-link {
    gap: 8px;
}

/* ========== Mobile Responsiveness ========== */
@media (max-width: 991px) {
    /* Hero layout stacking */
    .home-hero-split {
        flex-direction: column;
        text-align: center;
        padding-top: 20px;
        gap: 20px;
    }
    
    .hero-left {
        max-width: 100%;
        padding: 0 16px;
        display: flex;
        flex-direction: column;
        align-items: center;
        z-index: 10;
    }
    
    .home-hero-title {
        font-size: 32px;
    }
    
    .home-hero-subtitle {
        font-size: 15px;
    }
    
    .prompt-input-wrapper {
        width: 100%;
    }
    
    /* Make canvas container smaller and pull up */
    .hero-right {
        height: 460px;
        width: 100%;
        margin-top: 10px;
    }
    
    .ai-status-bar {
        margin-top: 70px; /* Push down away from the AI core */
    }
    
    .prompt-suggestions {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 576px) {
    .home-hero {
        padding: 72px 16px 120px;
        margin: -24px -24px 0;
    }
    .home-hero-title {
        font-size: 28px;
    }
    .home-cats-section {
        padding: 16px 0;
    }
}
