/* ── SpendGuard Design System ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-deep: #0a0e1a;
    --bg-card: #111827;
    --bg-elevated: #1a2236;
    --accent-amber: #f59e0b;
    --accent-amber-dim: rgba(245, 158, 11, 0.15);
    --accent-green: #10b981;
    --accent-green-dim: rgba(16, 185, 129, 0.12);
    --accent-red: #ef4444;
    --accent-red-dim: rgba(239, 68, 68, 0.12);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(148, 163, 184, 0.08);
    --border-hover: rgba(148, 163, 184, 0.16);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Nav ── */
nav {
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: rgba(10, 14, 26, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 100;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent-amber);
    border-radius: 50%;
    margin-left: 2px;
    vertical-align: super;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-link:hover { color: var(--text-primary); }

/* ── Hero ── */
.hero {
    padding: 100px 0 80px;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-badge {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-amber);
    background: var(--accent-amber-dim);
    padding: 6px 16px;
    border-radius: 100px;
    border: 1px solid rgba(245, 158, 11, 0.2);
    margin-bottom: 28px;
}

.hero h1 {
    font-size: clamp(2.8rem, 7vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1.05;
    margin-bottom: 24px;
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin-bottom: 40px;
    line-height: 1.7;
}

.hero-sub strong { color: var(--text-primary); }

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--bg-deep);
    background: var(--accent-amber);
    padding: 14px 32px;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.2);
}

.hero-cta:hover {
    background: #fbbf24;
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.35);
    transform: translateY(-1px);
}

/* ── Section Shared ── */
.section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-amber);
    margin-bottom: 12px;
}

section h2 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 560px;
    margin-bottom: 40px;
}

/* ── Oracle Section ── */
.oracle-section {
    padding: 80px 0 60px;
}

.oracle-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    position: relative;
}

.oracle-input-wrap {
    display: flex;
    gap: 12px;
}

.oracle-input-wrap input {
    flex: 1;
    font-family: 'DM Sans', sans-serif;
    font-size: 1.05rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s ease;
}

.oracle-input-wrap input::placeholder {
    color: var(--text-muted);
}

.oracle-input-wrap input:focus {
    border-color: var(--accent-amber);
    box-shadow: 0 0 0 3px var(--accent-amber-dim);
}

.oracle-input-wrap button {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    background: var(--accent-amber);
    color: var(--bg-deep);
    border: none;
    border-radius: var(--radius-md);
    padding: 16px 32px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 110px;
}

.oracle-input-wrap button:hover {
    background: #fbbf24;
    transform: translateY(-1px);
}

.oracle-input-wrap button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid rgba(10, 14, 26, 0.3);
    border-top-color: var(--bg-deep);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.oracle-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hint:hover {
    color: var(--accent-amber);
    border-color: rgba(245, 158, 11, 0.3);
    background: var(--accent-amber-dim);
}

/* ── Result Card ── */
.result-container {
    margin-top: 32px;
    animation: slideUp 0.35s ease;
}

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

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.result-card.eligible { border-color: rgba(16, 185, 129, 0.3); }
.result-card.ineligible { border-color: rgba(239, 68, 68, 0.3); }

.result-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border);
}

.result-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.result-icon.eligible {
    background: var(--accent-green-dim);
}

.result-icon.ineligible {
    background: var(--accent-red-dim);
}

.result-title-wrap h3 {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin-bottom: 4px;
}

.result-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 100px;
    display: inline-block;
}

.result-badge.eligible {
    color: var(--accent-green);
    background: var(--accent-green-dim);
}

.result-badge.ineligible {
    color: var(--accent-red);
    background: var(--accent-red-dim);
}

.result-body {
    padding: 24px 28px;
}

.result-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.field-label {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.field-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    color: var(--text-primary);
}

.result-reasoning {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.result-tip {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--accent-amber-dim);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-amber);
    font-size: 0.85rem;
    color: var(--accent-amber);
    line-height: 1.5;
}

.result-tip:empty { display: none; }

.result-tags {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.result-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 100px;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.result-footer {
    padding: 14px 28px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.result-disclaimer {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.result-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ── How It Works ── */
.how-section {
    padding: 80px 0;
    border-top: 1px solid var(--border);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: border-color 0.2s ease;
}

.step-card:hover {
    border-color: var(--border-hover);
}

.step-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--accent-amber);
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.step-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.step-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── Categories ── */
.categories-section {
    padding: 80px 0;
    border-top: 1px solid var(--border);
}

.cat-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px;
    width: fit-content;
    margin-bottom: 28px;
}

.cat-tab {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cat-tab:hover { color: var(--text-primary); }

.cat-tab.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.cat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: border-color 0.2s ease;
}

.cat-card:hover { border-color: var(--border-hover); }

.cat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.cat-card h4 {
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.cat-eligible-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 100px;
    white-space: nowrap;
    flex-shrink: 0;
}

.cat-eligible-badge.yes {
    color: var(--accent-green);
    background: var(--accent-green-dim);
}

.cat-eligible-badge.no {
    color: var(--accent-red);
    background: var(--accent-red-dim);
}

.cat-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 10px;
}

.cat-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.cat-example {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: 3px 8px;
    border-radius: 100px;
}

/* ── Recent Queries ── */
.recent-section {
    padding: 60px 0 80px;
    border-top: 1px solid var(--border);
}

.recent-grid {
    display: grid;
    gap: 8px;
}

.recent-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    transition: border-color 0.2s ease;
}

.recent-row:hover { border-color: var(--border-hover); }

.recent-status {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.recent-status.eligible { background: var(--accent-green); }
.recent-status.ineligible { background: var(--accent-red); }

.recent-product {
    flex: 1;
    font-weight: 500;
}

.recent-category {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.recent-conf {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.recent-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.loading-msg {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ── Footer ── */
footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ── Error state ── */
.error-msg {
    margin-top: 16px;
    padding: 14px 20px;
    background: var(--accent-red-dim);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: var(--accent-red);
    font-size: 0.88rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .hide-mobile { display: none; }
    .hero { padding: 60px 0 50px; }
    .steps-grid { grid-template-columns: 1fr; }
    .categories-grid { grid-template-columns: 1fr; }
    .oracle-input-wrap { flex-direction: column; }
    .oracle-input-wrap button { width: 100%; }
    .result-header { flex-direction: column; align-items: flex-start; }
    .result-footer { flex-direction: column; align-items: flex-start; }
    .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
    .recent-row { flex-wrap: wrap; }
    .recent-category { display: none; }
    .nav-links { gap: 14px; }
    .nav-link { font-size: 0.75rem; }
}

@media (max-width: 480px) {
    .nav-links { display: none; }
    .hero h1 { font-size: 2.2rem; letter-spacing: -1px; }
}
