/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #4f6ef7;
    --primary-dark: #3b57d9;
    --primary-light: #eef2ff;
    --green: #10b981;
    --green-light: #d1fae5;
    --green-bg: #ecfdf5;
    --red: #ef4444;
    --red-light: #fee2e2;
    --red-bg: #fef2f2;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Navbar ────────────────────────────────────────────────────────────────── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.brand-icon {
    width: 38px; height: 38px;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    display: grid;
    place-items: center;
}

.brand-text {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--gray-900);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-500);
    transition: color var(--transition);
}

.nav-links a:hover { color: var(--primary); }

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
    position: relative;
    padding: 5rem 1.5rem 3rem;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 50%, #fef2f2 100%);
}

.hero-bg-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.4;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(79,110,247,0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(168,85,247,0.1) 0%, transparent 50%),
        radial-gradient(circle at 60% 80%, rgba(239,68,68,0.08) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 20px;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--gray-900);
    margin-bottom: 1.25rem;
}

.gradient-text {
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-alt {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--gray-500);
    max-width: 560px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    border-radius: 10px;
    text-decoration: none;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 14px rgba(79,110,247,0.35);
}

.hero-cta:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79,110,247,0.4);
}

/* Hero stats */
.hero-stats {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem 2rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 130px;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-400);
    font-weight: 500;
    margin-top: 0.15rem;
}

/* ── Sections ──────────────────────────────────────────────────────────────── */
.section {
    padding: 4rem 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 0.4rem;
}

.section-sub {
    text-align: center;
    color: var(--gray-400);
    font-size: 1rem;
    margin-bottom: 2.5rem;
}

/* ── How It Works ──────────────────────────────────────────────────────────── */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.step-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 2rem 1.75rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    border: 1px solid var(--gray-100);
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.step-icon {
    width: 64px; height: 64px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    margin: 0 auto 1.25rem;
}

.step-icon--upload { background: #dbeafe; color: #3b82f6; }
.step-icon--analyze { background: #fae8ff; color: #a855f7; }
.step-icon--result { background: #d1fae5; color: #10b981; }

.step-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.step-card p {
    font-size: 0.9rem;
    color: var(--gray-500);
    line-height: 1.6;
}

/* ── Detector Section ──────────────────────────────────────────────────────── */
.detector-section {
    padding-bottom: 2rem;
}

.detector-card {
    max-width: 560px;
    margin: 0 auto;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-100);
}

/* Drop zone */
.drop-zone {
    width: 100%;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    background: var(--gray-50);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.drop-zone__prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-icon-ring {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: grid;
    place-items: center;
    margin-bottom: 0.5rem;
}

.drop-text-main {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
}

.drop-text-alt {
    font-size: 0.88rem;
    color: var(--gray-400);
}

.drop-text-formats {
    font-size: 0.78rem;
    color: var(--gray-300);
    margin-top: 0.25rem;
}

/* Preview */
.preview-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-filename {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-500);
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-clear {
    background: var(--gray-100);
    border: none;
    border-radius: 8px;
    padding: 0.4rem;
    cursor: pointer;
    color: var(--gray-400);
    transition: background var(--transition), color var(--transition);
    display: grid;
    place-items: center;
}

.btn-clear:hover {
    background: var(--red-light);
    color: var(--red);
}

.preview-wrapper {
    width: 100%;
    max-height: 340px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-100);
}

.preview-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Detect button */
.btn-detect {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 14px rgba(79,110,247,0.3);
}

.btn-detect:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79,110,247,0.35);
}

/* Spinner */
.spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    font-size: 0.9rem;
    color: var(--gray-500);
}

.spinner__circle {
    width: 24px; height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Result card */
.result-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.75rem;
    border-radius: var(--radius);
    animation: fadeInUp 0.4s ease;
}

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

.result-card.real-bg { background: var(--green-bg); border: 1px solid #a7f3d0; }
.result-card.ai-bg   { background: var(--red-bg);   border: 1px solid #fecaca; }

.result-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
}

.result-icon.real { background: var(--green-light); }
.result-icon.ai   { background: var(--red-light); }

.result-label {
    font-size: 1.35rem;
    font-weight: 800;
}

.result-label.real { color: #059669; }
.result-label.ai   { color: #dc2626; }

.confidence-section {
    width: 100%;
}

.confidence-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 0.4rem;
}

.confidence-value {
    font-weight: 700;
    color: var(--gray-700);
}

.confidence-bar-track {
    width: 100%;
    height: 10px;
    background: rgba(0,0,0,0.06);
    border-radius: 5px;
    overflow: hidden;
}

.confidence-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 5px;
    transition: width 0.8s ease;
}

.confidence-bar-fill.real { background: linear-gradient(90deg, #10b981, #059669); }
.confidence-bar-fill.ai   { background: linear-gradient(90deg, #f87171, #dc2626); }

.result-explanation {
    font-size: 0.85rem;
    color: var(--gray-500);
    text-align: center;
    line-height: 1.6;
}

.btn-secondary {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition);
}

.btn-secondary:hover { background: #dde3fc; }

/* ── Tech Grid ─────────────────────────────────────────────────────────────── */
.tech-section { background: #fff; max-width: 100%; padding: 4rem 1.5rem; }

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    max-width: 1000px;
    margin: 0 auto;
}

.tech-card {
    text-align: center;
    padding: 1.75rem 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    transition: transform var(--transition), box-shadow var(--transition);
}

.tech-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.tech-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.tech-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.4rem;
}

.tech-card p {
    font-size: 0.85rem;
    color: var(--gray-500);
    line-height: 1.5;
}

/* ── FAQ ───────────────────────────────────────────────────────────────────── */
.faq-section { padding-bottom: 3rem; }

.faq-list {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.faq-item[open] { box-shadow: var(--shadow-md); }

.faq-item summary {
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gray-700);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--gray-400);
    transition: transform var(--transition);
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item p {
    padding: 0 1.25rem 1rem;
    font-size: 0.9rem;
    color: var(--gray-500);
    line-height: 1.7;
}

.faq-item code {
    background: var(--gray-100);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.82rem;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 3rem 1.5rem 1.5rem;
    margin-top: 2rem;
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-brand .brand-text {
    color: #fff;
    font-size: 1.1rem;
}

.footer-brand p {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    line-height: 1.5;
}

.footer-disclaimer {
    max-width: 400px;
}

.footer-disclaimer p {
    font-size: 0.82rem;
    line-height: 1.6;
}

.footer-bottom {
    max-width: 900px;
    margin: 2rem auto 0;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-700);
    text-align: center;
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* ── Utilities ─────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .hero { padding: 3.5rem 1rem 2rem; }
    .hero-stats { gap: 0.75rem; }
    .stat-card { padding: 1rem 1.25rem; min-width: 100px; }
    .stat-number { font-size: 1.2rem; }
    .nav-links { gap: 1rem; }
    .nav-links a { font-size: 0.82rem; }
    .detector-card { padding: 1.25rem; }
    .footer-inner { flex-direction: column; }
}

@media (max-width: 380px) {
    .nav-links { display: none; }
}
