* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: #f5f3f0;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #2c1810 0%, #4a2c1a 50%, #6b3e2e 100%);
    color: #f5f3f0;
    padding: 50px 20px 40px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.15rem;
    margin-bottom: 24px;
    font-weight: 500;
    opacity: 0.95;
}

/* Avatar Array */
.avatar-array {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 28px 0;
    flex-wrap: wrap;
}

.avatar {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.95);
    transition: transform 0.2s;
}

.avatar:hover {
    transform: scale(1.1);
}

.avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-description {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 20px;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    opacity: 0.85;
}

.stat-item {
    font-weight: 500;
}

.stat-divider {
    opacity: 0.6;
}

/* Main Container */
.container {
    max-width: 900px;
    margin: -50px auto 0;
    position: relative;
    z-index: 2;
}

main {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    padding: 48px;
    margin-bottom: 32px;
}

/* Search Section */
.search-section {
    margin-bottom: 40px;
}

.search-title {
    font-size: 1.75rem;
    color: #1a202c;
    margin-bottom: 24px;
    text-align: center;
    font-weight: 700;
}

textarea {
    width: 100%;
    padding: 18px;
    font-size: 1.05rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    resize: vertical;
    font-family: inherit;
    transition: all 0.2s;
    background: #f8fafc;
    color: #2d3748;
}

textarea:focus {
    outline: none;
    border-color: #4f46e5;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea::placeholder {
    color: #a0aec0;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

button {
    background: linear-gradient(135deg, #4a2c1a 0%, #6b3e2e 100%);
    color: #f5f3f0;
    border: none;
    padding: 14px 32px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(44, 24, 16, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(44, 24, 16, 0.4);
    background: linear-gradient(135deg, #5c3720 0%, #7d4d38 100%);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.1rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #6b3e2e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results */
.results {
    margin-top: 48px;
}

.result-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #6b3e2e;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-left-color: #4a2c1a;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.result-person {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-person::before {
    content: "";
    display: inline-block;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4a2c1a 0%, #6b3e2e 100%);
    border-radius: 50%;
    flex-shrink: 0;
}

.result-similarity {
    background: linear-gradient(135deg, #4a2c1a 0%, #6b3e2e 100%);
    color: #f5f3f0;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.result-keywords {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.keyword {
    display: inline-flex;
    align-items: center;
    background: #f5e6d3;
    color: #4a2c1a;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 0.72rem;
    font-weight: 500;
}

.result-text {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 14px;
    font-size: 1.08rem;
}

.result-source {
    font-size: 0.85rem;
    color: #a0aec0;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

.result-source a {
    color: #6b3e2e;
    text-decoration: none;
    font-weight: 500;
}

.result-source a:hover {
    text-decoration: underline;
    color: #4a2c1a;
}

.no-results {
    text-align: center;
    padding: 80px 20px;
    color: #a0aec0;
}

.no-results h3 {
    font-size: 1.75rem;
    margin-bottom: 12px;
    color: #718096;
}

/* GitHub Link */
.github-link {
    position: fixed;
    top: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f5f3f0;
    transition: all 0.2s;
    z-index: 1000;
    opacity: 0.9;
}

.github-link:hover {
    opacity: 1;
    transform: scale(1.15);
}

.github-link svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-description {
        font-size: 0.95rem;
    }

    .avatar-array {
        gap: 8px;
    }

    .avatar {
        width: 50px;
        height: 50px;
        border: 2px solid rgba(255, 255, 255, 0.95);
    }

    .hero-stats {
        flex-direction: column;
        gap: 4px;
    }

    .stat-divider {
        display: none;
    }

    main {
        padding: 28px 20px;
    }

    button {
        width: 100%;
        justify-content: center;
    }

    .result-person {
        font-size: 1.25rem;
    }
}
