/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scrollbar-gutter: stable; }

:root {
    --primary: #1a56db;
    --primary-dark: #1342a8;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #ffffff;
    --bg-alt: #f9fafb;
    --border: #e5e7eb;
    --success: #059669;
    --error: #dc2626;
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Navigation */
nav {
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    padding: 0 1rem;
}
.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}
.logo:hover { text-decoration: none; }
.beta-badge {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--primary);
    color: #fff;
    padding: 0.15em 0.45em;
    border-radius: 4px;
    vertical-align: super;
    margin-left: 0.2rem;
}
.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.nav-links a { color: var(--text); font-size: 0.95rem; }
.nav-links a:hover { color: var(--primary); text-decoration: none; }
.nav-link-button {
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}
.nav-link-button:hover { color: var(--primary); }
.inline-form { display: inline; }

/* Sections */
.section { padding: 4rem 1rem; }
.section-alt { background: var(--bg-alt); }
.container { max-width: 1100px; margin: 0 auto; }

/* Hero */
.hero {
    text-align: center;
    padding: 5rem 1rem 4rem;
}
.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}
.hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-dark);
    text-decoration: none;
    color: #fff;
}
.btn-secondary {
    background: var(--bg-alt);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); text-decoration: none; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Feature grid */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}
.feature {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}
.feature h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}
.feature p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Demo page */
.demo-container {
    max-width: 700px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.demo-container h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}
.demo-container > p {
    color: var(--text-light);
    margin-bottom: 2rem;
}
.upload-form {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    background: var(--bg);
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.form-group input[type="file"] {
    display: block;
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
}
.form-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}
.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}
.alert-error {
    background: #fef2f2;
    color: var(--error);
    border: 1px solid #fecaca;
}
.alert-success {
    background: #ecfdf5;
    color: var(--success);
    border: 1px solid #a7f3d0;
}
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.spinner.active { display: inline-block; }
.status-text {
    font-size: 0.9rem;
    color: var(--text-light);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Privacy notice */
.privacy-notice {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #166534;
    line-height: 1.5;
}

/* Scope notice */
.scope-notice {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #1e40af;
    line-height: 1.5;
}

.feedback-notice {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: #92400e;
    line-height: 1.5;
}

/* How it works */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    text-align: center;
}
.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

/* Auth pages */
.auth-container {
    max-width: 400px;
    margin: 3rem auto;
    padding: 0 1rem;
}
.auth-container h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    display: block;
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
}
.form-group textarea {
    display: block;
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
}
.contact-container {
    max-width: 700px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.contact-container h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}
.contact-container > p {
    color: var(--text-light);
    margin-bottom: 2rem;
}
.contact-info {
    text-align: center;
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-alt);
}
.contact-info p {
    color: var(--text-light);
    margin-bottom: 0.75rem;
}
.contact-email {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}
.contact-email:hover {
    text-decoration: underline;
}

/* Article / Compare page */
.article-hero {
    text-align: center;
    padding: 4rem 1rem 2rem;
    background: var(--bg-alt);
}
.article-hero h1 {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}
.article-subtitle {
    font-size: 1.15rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}
.article-body {
    padding: 3rem 1rem;
}
.container-narrow {
    max-width: 760px;
    margin: 0 auto;
}
.article-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2.5rem 0 0.75rem;
}
.article-body h2:first-child {
    margin-top: 0;
}
.article-body p {
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 1rem;
    line-height: 1.7;
}
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0 2rem;
}
.comparison-card {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-alt);
}
.comparison-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}
.comparison-card p {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}
.comparison-card p:last-child {
    margin-bottom: 0;
}
.feature-list {
    list-style: none;
    margin: 1rem 0 2rem;
    padding: 0;
}
.feature-list li {
    padding: 0.5rem 0 0.5rem 1.5rem;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.6;
}
.feature-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.85rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}
.article-body ol {
    margin: 1rem 0 2rem 1.25rem;
}
.article-body ol li {
    padding: 0.35rem 0;
    font-size: 0.95rem;
    line-height: 1.6;
}
.article-cta {
    text-align: center;
    margin-top: 3rem;
    padding: 2.5rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
}
.article-cta h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}
.article-cta p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* API docs page */
.api-endpoint {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 1rem 0 2rem;
    font-size: 1rem;
}
.api-method {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    letter-spacing: 0.03em;
}
.api-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 2rem;
    font-size: 0.95rem;
}
.api-table th,
.api-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
.api-table th {
    background: var(--bg-alt);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-light);
}
.article-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 0.75rem 0 2rem;
    font-size: 0.88rem;
    line-height: 1.6;
}
.article-body pre code {
    background: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
}
.article-body code {
    background: var(--bg-alt);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}
.article-body h3 {
    font-size: 1.15rem;
    margin: 2rem 0 0.5rem;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
}
.footer-container { max-width: 1100px; margin: 0 auto; }
.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}
.footer-links a {
    color: var(--text-light);
    font-size: 0.85rem;
}
.footer-links a:hover {
    color: var(--primary);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 640px) {
    .hero h1 { font-size: 1.75rem; }
    .hero p { font-size: 1rem; }
    .nav-links { gap: 1rem; font-size: 0.85rem; }
    .section { padding: 2.5rem 1rem; }
}
