/* styles/main.css — layout, typography, base */

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

:root {
    --bg:          #0f1117;
    --bg-card:     #1a1d27;
    --bg-input:    #12151e;
    --bg-sidebar:  #13151f;
    --border:      #2a2d3a;
    --text:        #e2e4ef;
    --text-muted:  #6b7080;
    --accent:      #4f8ef7;
    --accent-dark: #3a72d4;
    --success:     #34c97a;
    --danger:      #e05252;
    --warning:     #f0a44a;
    --sidebar-w:   280px;
    --radius:      12px;
    --radius-sm:   7px;
}

/* Light Theme Variables */
:root.light-theme {
    --bg:          #fff;
    --bg-card:     #f9f9f9;
    --bg-input:    #f0f0f0;
    --bg-sidebar:  #f0f2f5;
    --border:      #dcdcdc;
    --text:        #333;
    --text-muted:  #777;
    --accent:      #007bff;
    --accent-dark: #0056b3;
    --success:     #28a745;
    --danger:      #dc3545;
    --warning:     #ffc107;
}

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* ── App shell ──────────────────────────────────────────────────────────── */
#app-shell {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
#sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.nav-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px 16px 20px;
    letter-spacing: 0.01em;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
    text-decoration: none;
    transition: opacity 0.15s;
}
.nav-brand:hover { opacity: 0.8; }

.nav-logo {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #4f8ef7 0%, #a78bfa 100%);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0;
    border-radius: 8px;
    padding: 5px 10px;
    line-height: 1.4;
    flex-shrink: 0;
}
.logo-ex { color: #fff; }
.logo-ai { color: #ddd6fe; margin-left: 2px; }

.nav-brand-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
}

.nav-copyright {
    margin: 8px 0 0;
    font-size: 0.68rem;
    color: var(--text-muted);
    opacity: 0.55;
    text-align: center;
}

.nav-list {
    list-style: none;
    flex: 1;
    padding: 4px 0;
}

.nav-item { border-radius: var(--radius-sm); margin: 3px 14px; }
.nav-item.active { background: rgba(79, 142, 247, 0.12); }

.nav-link {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.04); text-decoration: none; }
.nav-item.active .nav-link { color: var(--accent); }

.nav-icon  { font-size: 1.15rem; width: 24px; text-align: center; }
.nav-label { font-size: 1rem; font-weight: 500; }

.nav-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
}

/* ── Theme toggle button (in nav footer) ────────────────────────────────── */
#theme-toggle {
    width: 100%;
    margin-bottom: 8px;
    font-size: 0.85rem;
    padding: 8px 12px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
#theme-toggle:hover { color: var(--text); border-color: #555; }

/* ── Main content ───────────────────────────────────────────────────────── */
#app {
    flex: 1;
    padding: 52px 60px;
    max-width: 1320px;
    overflow-x: hidden;
}

.page-header { margin-bottom: 40px; }
.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}

/* ── Home / Landing page ─────────────────────────────────────────────────── */
.home-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 0 80px;
}

/* Hero */
.hero-section {
    text-align: center;
    padding: 80px 24px 64px;
}
.hero-badge {
    display: inline-block;
    background: rgba(79,142,247,0.12);
    color: var(--accent);
    border: 1px solid rgba(79,142,247,0.3);
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 14px;
    margin-bottom: 24px;
}
.hero-headline {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 20px;
}
.hero-accent {
    background: linear-gradient(135deg, #4f8ef7 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-sub {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto 36px;
    line-height: 1.7;
}
.hero-cta-row {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 48px;
}
.hero-btn {
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: opacity 0.15s, transform 0.1s;
}
.hero-btn:hover { opacity: 0.88; transform: translateY(-1px); }

.hero-stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
    color: var(--text-muted);
}
.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 32px;
}
.hero-stat-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}
.hero-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.hero-stat-sep {
    width: 1px;
    height: 36px;
    background: var(--border);
}

/* Sections */
.home-section {
    padding: 64px 24px;
    border-top: 1px solid var(--border);
}
.home-section--dark {
    background: var(--bg-sidebar);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 0 0;
}
.home-section-title {
    font-size: 1.7rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 48px;
    letter-spacing: -0.01em;
}

/* How it works steps */
.steps-row {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}
.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    flex: 1;
    min-width: 200px;
    max-width: 280px;
    text-align: center;
    position: relative;
}
.step-num {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #4f8ef7, #a78bfa);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.step-icon {
    font-size: 2rem;
    margin: 8px 0 14px;
    opacity: 0.9;
}
.step-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}
.step-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.step-arrow {
    font-size: 1.5rem;
    color: var(--border);
    align-self: center;
    padding: 0 12px;
    margin-top: 20px;
}

/* Feature grid */
.feat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.feat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    transition: border-color 0.15s;
}
.feat-card:hover { border-color: rgba(79,142,247,0.4); }
.feat-card--highlight {
    border-color: rgba(79,142,247,0.35);
    background: linear-gradient(135deg, rgba(79,142,247,0.07) 0%, rgba(167,139,250,0.07) 100%);
}
.feat-icon { font-size: 1.6rem; display: block; margin-bottom: 14px; }
.feat-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.feat-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.65;
}
.feat-chip {
    display: inline-block;
    margin-top: 14px;
    background: rgba(79,142,247,0.14);
    color: var(--accent);
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    letter-spacing: 0.04em;
}

/* USP section */
.usp-row {
    display: flex;
    flex-direction: column;
    gap: 36px;
    max-width: 760px;
    margin: 0 auto;
}
.usp-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.usp-icon {
    font-size: 1.6rem;
    width: 46px;
    height: 46px;
    background: rgba(79,142,247,0.1);
    border: 1px solid rgba(79,142,247,0.2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}
.usp-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}
.usp-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.65;
}

/* CTA footer */
.home-cta-footer {
    text-align: center;
    padding: 72px 24px 48px;
    border-top: 1px solid var(--border);
}
.home-cta-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}
.home-cta-sub {
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 0.95rem;
}

/* Footer */
.home-footer {
    text-align: center;
    padding: 20px 24px;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.home-footer-sep { opacity: 0.4; }
.home-footer-link { color: var(--text-muted); text-decoration: none; }
.home-footer-link:hover { color: var(--text); }

/* Mobile responsive */
@media (max-width: 700px) {
    .hero-headline { font-size: 2rem; }
    .hero-stat { padding: 0 16px; }
    .step-arrow { display: none; }
    .steps-row { gap: 28px; }
    .step-card { max-width: 100%; }
    .usp-item { flex-direction: column; gap: 10px; }
    .home-section-title { font-size: 1.35rem; }
}

/* ── home-section subtitle ─────────────────────────────────────────────── */
.home-section-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-top: -32px;
    margin-bottom: 40px;
}

/* ── home-section--alt (lighter variant used for USP) ───────────────────── */
.home-section--alt {
    background: linear-gradient(135deg, rgba(79,142,247,0.04) 0%, rgba(167,139,250,0.04) 100%);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 0 0;
}

/* ── Labs showcase ───────────────────────────────────────────────────────── */
.labs-showcase-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 960px;
    margin: 0 auto;
}
.labs-showcase-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
}
.labs-showcase-card:hover { border-color: rgba(79,142,247,0.4); }
.labs-showcase-icon { font-size: 2.2rem; margin-bottom: 14px; display: block; }
.labs-showcase-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}
.labs-showcase-desc {
    font-size: 0.87rem;
    color: var(--text-muted);
    line-height: 1.65;
}
@media (max-width: 700px) {
    .labs-showcase-row { grid-template-columns: 1fr; }
}

/* ── Pricing section ─────────────────────────────────────────────────────── */
.pricing-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
    align-items: start;
}
.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}
.pricing-card--featured {
    border-color: rgba(79,142,247,0.5);
    background: linear-gradient(160deg, rgba(79,142,247,0.08) 0%, rgba(167,139,250,0.08) 100%);
    box-shadow: 0 0 0 1px rgba(79,142,247,0.25);
}
.pricing-tier-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #4f8ef7, #a78bfa);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 99px;
    white-space: nowrap;
    letter-spacing: 0.03em;
}
.pricing-tier-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}
.pricing-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1;
}
.pricing-period {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
}
.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.pricing-features li {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-left: 18px;
    position: relative;
    line-height: 1.45;
}
.pricing-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent, #4f8ef7);
    font-weight: 700;
    font-size: 0.8rem;
}
@media (max-width: 700px) {
    .pricing-row { grid-template-columns: 1fr; max-width: 360px; }
}

/* ── Auth pages ─────────────────────────────────────────────────────────── */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 60px;
    min-height: 60vh;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 44px;
}

.auth-title {
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 30px;
}

.auth-form { display: flex; flex-direction: column; gap: 20px; }

.auth-switch {
    margin-top: 20px;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
}
.auth-switch a { color: var(--accent); text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* "or" divider between password form and Google button */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Container for the Google-rendered button — let GIS size it naturally */
.google-btn-wrap {
    display: flex;
    justify-content: center;
    min-height: 44px;
    margin-bottom: 8px;
}

/* Placeholder shown in dev when no Google client ID is configured */
.google-btn-placeholder {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: not-allowed;
    opacity: 0.6;
    justify-content: center;
}

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.form-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}
input[type="email"],
input[type="password"],
input[type="text"],
select,
textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 12px 16px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
}
textarea { resize: vertical; min-height: 90px; font-family: monospace; font-size: 0.875rem; }
select   { cursor: pointer; }

.field-error {
    font-size: 0.8rem;
    color: var(--danger);
    min-height: 1em;
}
.field-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 3px;
}
.form-error {
    font-size: 0.875rem;
    color: var(--danger);
    min-height: 1em;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
button { cursor: pointer; font-size: 0.9rem; border: none; border-radius: var(--radius-sm); transition: background 0.15s, opacity 0.15s; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary  { background: var(--accent); color: #fff; padding: 13px 26px; font-size: 1rem; }
.btn-primary:hover:not(:disabled)  { background: var(--accent-dark); }

.btn-ghost    { background: transparent; color: var(--text); padding: 11px 20px; font-size: 1rem; border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled)    { border-color: var(--text-muted); }

.btn-danger   { background: rgba(224, 82, 82, 0.12); color: var(--danger); padding: 6px 12px; border: 1px solid rgba(224,82,82,0.3); }
.btn-danger:hover:not(:disabled)   { background: rgba(224,82,82,0.22); }

.btn-block    { width: 100%; }
.btn-sm       { padding: 5px 10px; font-size: 0.82rem; }

/* ── Utilities ──────────────────────────────────────────────────────────── */
.loading  { color: var(--text-muted); padding: 32px 0; text-align: center; }
.muted    { color: var(--text-muted); }
.error-msg { color: var(--danger); padding: 12px 0; }
.hidden   { display: none !important; }

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

/* ── Toasts ─────────────────────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
}
.toast {
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    max-width: 320px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
}
.toast-visible { opacity: 1; transform: translateY(0); }
.toast-success { background: #1e3b2c; color: #6ee89f; border: 1px solid #2d5a3e; }
.toast-error   { background: #3a1e1e; color: #f08080; border: 1px solid #5a2d2d; }
.toast-info    { background: #1e2a3a; color: #80b4f0; border: 1px solid #2d3f5a; }

/* ── Modal ──────────────────────────────────────────────────────────────── */
#modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex; align-items: center; justify-content: center;
    z-index: 500;
}
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    margin: 0 16px;
    animation: modal-in 0.18s ease;
}
@keyframes modal-in { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.3rem; line-height: 1; padding: 2px 6px;
    cursor: pointer;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; }

/* ── Mobile topbar (hidden on desktop) ──────────────────────────────────── */
#mobile-topbar {
    display: none;
}
#sidebar-backdrop {
    display: none;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
    /* Top bar */
    #mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        height: 52px;
        background: var(--bg-sidebar);
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        z-index: 200;
        flex-shrink: 0;
    }
    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--text);
        letter-spacing: 0.01em;
        text-decoration: none;
    }
    #nav-hamburger {
        background: none;
        border: none;
        color: var(--text);
        font-size: 1.4rem;
        line-height: 1;
        padding: 6px 8px;
        cursor: pointer;
        border-radius: var(--radius-sm);
        transition: background 0.15s;
    }
    #nav-hamburger:hover { background: rgba(255,255,255,0.06); }

    /* Sidebar becomes a fixed off-screen drawer */
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        z-index: 300;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
    }
    #sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    }

    /* Backdrop that dims content when drawer is open */
    #sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.55);
        z-index: 299;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }
    #sidebar-backdrop.visible {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    /* Main content full width on mobile */
    #app { padding: 20px 16px; }

    /* Auth card padding */
    .auth-card { padding: 32px 20px; }

    /* Tables scroll horizontally */
    .table-scroll { -webkit-overflow-scrolling: touch; }
}

/* ── Site footer ─────────────────────────────────────────────────────────── */
#site-footer {
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border);
    padding: 56px 60px 28px;
    width: 100%;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 48px;
    max-width: 960px;
    margin: 0 auto 40px;
}

.footer-brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 14px;
}
.footer-logo { font-size: 0.95rem; padding: 4px 8px; }
.footer-brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.footer-tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 18px;
}

.footer-social {
    display: flex;
    gap: 10px;
}
.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    text-decoration: none;
}
.footer-social-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(79,142,247,0.08);
}

.footer-col-heading {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-link {
    font-size: 0.88rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}
.footer-link:hover { color: var(--text); }

.footer-legal {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.6;
    max-width: 960px;
    margin: 0 auto;
}

/* ── Info pages (About, Vision, Team, Contact, Technology) ───────────────── */
.info-page {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 0 80px;
}

.info-hero {
    padding: 64px 0 52px;
    text-align: center;
}
.info-hero-badge {
    display: inline-block;
    background: rgba(79,142,247,0.12);
    color: var(--accent);
    border: 1px solid rgba(79,142,247,0.3);
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 4px 14px;
    margin-bottom: 20px;
}
.info-hero h1 {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    color: var(--text);
}
.info-hero p {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.75;
}

.info-section {
    margin-bottom: 52px;
}
.info-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.info-section p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.78;
    margin-bottom: 14px;
}
.info-section p:last-child { margin-bottom: 0; }

.info-highlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 8px;
}
.info-highlight-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 20px;
}
.info-highlight-icon { font-size: 1.6rem; margin-bottom: 10px; }
.info-highlight-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.info-highlight-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* Team card */
.team-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 32px;
    display: flex;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 16px;
}
.team-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f8ef7 0%, #a78bfa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}
.team-avatar-photo {
    object-fit: cover;
    background: none;
}
.team-card-body { flex: 1; min-width: 0; }
.team-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}
.team-title {
    font-size: 0.88rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 12px;
}
.team-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.stat-pill {
    background: rgba(79,142,247,0.1);
    border: 1px solid rgba(79,142,247,0.2);
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #7eb5f9;
    padding: 3px 12px;
}
.team-bio {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 20px;
}
.profile-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.profile-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 12px;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
}
.profile-link:hover { color: var(--accent); border-color: var(--accent); }

/* Vision roadmap list */
.roadmap-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}
.roadmap-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.roadmap-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 6px;
    flex-shrink: 0;
}
.roadmap-text { font-size: 0.92rem; color: var(--text-muted); line-height: 1.65; }
.roadmap-text strong { color: var(--text); }

/* Technology page — pipeline steps diagram */
.tech-pipeline {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    justify-content: center;
    margin: 24px 0;
}
.tech-pipeline-step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 18px;
    text-align: center;
    flex: 1;
    min-width: 140px;
    max-width: 180px;
}
.tech-pipeline-step-icon { font-size: 1.6rem; margin-bottom: 8px; }
.tech-pipeline-step-label { font-size: 0.8rem; font-weight: 700; color: var(--text); }
.tech-pipeline-step-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
.tech-pipeline-arrow {
    font-size: 1.2rem;
    color: var(--accent);
    padding: 0 6px;
    flex-shrink: 0;
}

.tech-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.tech-fact {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.55;
}
.tech-fact strong { color: var(--accent); display: block; margin-bottom: 3px; }

/* Contact form */
.contact-form-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 32px;
    max-width: 640px;
    margin: 0 auto;
}
.contact-success {
    text-align: center;
    padding: 60px 24px;
}
.contact-success-icon { font-size: 3rem; margin-bottom: 16px; }
.contact-success h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 10px; }
.contact-success p { color: var(--text-muted); font-size: 0.95rem; }

/* ── Responsive tweaks for footer + info pages ───────────────────────────── */
@media (max-width: 860px) {
    #site-footer {
        padding: 40px 24px 24px;
    }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .footer-brand-col { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .team-card { flex-direction: column; gap: 20px; }
    .info-hero h1 { font-size: 1.9rem; }
    .tech-pipeline { flex-direction: column; }
    .tech-pipeline-arrow { transform: rotate(90deg); }
}

/* ── Edge AI Export (model_detail.js) ──────────────────────────────────── */
.md-edge-intro {
    color: var(--text-secondary, #6b7280);
    margin-bottom: 1.25rem;
    max-width: 70ch;
    line-height: 1.6;
}
.md-edge-preview {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}
.md-edge-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--surface-secondary, #f3f4f6);
    border-bottom: 1px solid var(--border, #e5e7eb);
    font-size: 0.8rem;
}
.md-edge-preview-label {
    font-family: monospace;
    color: var(--text-secondary, #6b7280);
}
.md-edge-code {
    margin: 0;
    padding: 1rem 1.25rem;
    background: #1e1e2e;
    color: #cdd6f4;
    font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
}
.md-edge-actions {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.md-edge-targets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.md-edge-target {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    background: var(--surface, #fff);
}
.md-edge-target strong {
    font-size: 0.9rem;
}
.md-edge-target span {
    font-size: 0.82rem;
    color: var(--text-secondary, #6b7280);
    line-height: 1.5;
}
.md-edge-note {
    font-size: 0.85rem;
    min-height: 1.2em;
    color: var(--text-secondary, #6b7280);
}
.md-edge-note.md-edge-ok  { color: #16a34a; }
.md-edge-note.md-edge-err { color: #dc2626; }
.md-edge-copy-btn.btn-ghost { background: transparent; border: none; cursor: pointer; font-size: 0.8rem; color: var(--text-secondary, #6b7280); }
.md-edge-copy-btn.btn-ghost:hover { color: var(--text, #111); }
.btn-sm { padding: 0.25rem 0.5rem; }

/* Additional styles remain unchanged */
/* ── Edge AI page (pages/edge-ai.js) ───────────────────────────────────── */
.aregai-edge-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem 4rem;
}
.aregai-edge-hero {
    padding: 3.5rem 0 2.5rem;
    text-align: center;
}
.aregai-edge-hero-inner { max-width: 680px; margin: 0 auto; }
.aregai-edge-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: var(--primary-light, #dbeafe);
    color: var(--primary, #2563eb);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}
.aregai-edge-hero h1 { font-size: 2.2rem; margin-bottom: 1rem; }
.aregai-edge-hero-sub {
    font-size: 1.05rem;
    color: var(--text-secondary, #6b7280);
    line-height: 1.7;
    margin-bottom: 1.75rem;
}
.aregai-edge-hero-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.aregai-edge-section { margin-bottom: 3rem; }
.aregai-edge-section h2 { font-size: 1.4rem; margin-bottom: 1.25rem; }
.aregai-edge-steps {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.aregai-edge-steps li {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}
.aregai-edge-step-num {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--primary, #2563eb);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.aregai-edge-steps li > div > strong { display: block; margin-bottom: 0.3rem; font-size: 1rem; }
.aregai-edge-steps li > div > p { color: var(--text-secondary, #6b7280); line-height: 1.6; margin: 0; font-size: 0.9rem; }
.aregai-edge-examples { display: flex; flex-direction: column; gap: 1.5rem; }
.aregai-edge-example {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
}
.aregai-edge-example h3 { padding: 0.85rem 1.25rem 0; font-size: 1rem; margin-bottom: 0.5rem; }
.aregai-edge-example > p { padding: 0 1.25rem 0.75rem; font-size: 0.875rem; color: var(--text-secondary, #6b7280); margin: 0; }
.aregai-edge-code {
    margin: 0;
    padding: 1rem 1.25rem;
    background: #1e1e2e;
    color: #cdd6f4;
    font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.65;
    overflow-x: auto;
    white-space: pre;
}
.aregai-edge-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.aregai-edge-table th,
.aregai-edge-table td {
    padding: 0.65rem 1rem;
    border: 1px solid var(--border, #e5e7eb);
    text-align: left;
    vertical-align: top;
}
.aregai-edge-table th { background: var(--surface-secondary, #f3f4f6); font-weight: 600; }
.aregai-edge-cta {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: var(--surface-secondary, #f9fafb);
    border-radius: 12px;
    border: 1px solid var(--border, #e5e7eb);
}
.aregai-edge-cta h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.aregai-edge-cta p { color: var(--text-secondary, #6b7280); margin-bottom: 1.5rem; }

/* ── Edge AI locked/upgrade callout ─────────────────────────────────────── */
.md-edge-locked {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.5rem 2rem;
    border: 2px dashed var(--border, #e5e7eb);
    border-radius: 12px;
    background: var(--surface-secondary, #f9fafb);
    gap: 0.75rem;
}
.md-edge-locked-icon {
    font-size: 2.5rem;
    color: var(--text-tertiary, #9ca3af);
}
.md-edge-locked-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}
.md-edge-locked-desc {
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
    max-width: 52ch;
    line-height: 1.6;
    margin: 0;
}

/* ── Platform Edge AI page (exai-edge-*) ────────────────────────────────── */
.exai-edge-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem 4rem;
}
.exai-edge-hero {
    padding: 3.5rem 0 2.5rem;
    text-align: center;
}
.exai-edge-hero-inner { max-width: 680px; margin: 0 auto; }
.exai-edge-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: var(--primary-light, #dbeafe);
    color: var(--primary, #2563eb);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}
.exai-edge-hero h1 { font-size: 2.2rem; margin-bottom: 1rem; }
.exai-edge-hero-sub {
    font-size: 1.05rem;
    color: var(--text-secondary, #6b7280);
    line-height: 1.7;
    margin-bottom: 1.75rem;
}
.exai-edge-hero-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.exai-edge-section { margin-bottom: 3rem; }
.exai-edge-section h2 { font-size: 1.4rem; margin-bottom: 1.25rem; }
.exai-edge-steps {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.exai-edge-steps li {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}
.exai-edge-step-num {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--primary, #2563eb);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.exai-edge-steps li > div > strong { display: block; margin-bottom: 0.3rem; font-size: 1rem; }
.exai-edge-steps li > div > p { color: var(--text-secondary, #6b7280); line-height: 1.6; margin: 0; font-size: 0.9rem; }
.exai-edge-examples { display: flex; flex-direction: column; gap: 1.5rem; }
.exai-edge-example {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
}
.exai-edge-example h3 { padding: 0.85rem 1.25rem 0; font-size: 1rem; margin-bottom: 0.5rem; }
.exai-edge-example > p { padding: 0 1.25rem 0.75rem; font-size: 0.875rem; color: var(--text-secondary, #6b7280); margin: 0; }
.exai-edge-code {
    margin: 0;
    padding: 1rem 1.25rem;
    background: #1e1e2e;
    color: #cdd6f4;
    font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.65;
    overflow-x: auto;
    white-space: pre;
}
.exai-edge-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.exai-edge-table th,
.exai-edge-table td {
    padding: 0.65rem 1rem;
    border: 1px solid var(--border, #e5e7eb);
    text-align: left;
    vertical-align: top;
}
.exai-edge-table th { background: var(--bg-card, #1e2130); color: var(--text-muted, #9ca3af); font-weight: 600; }
.exai-edge-cta {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
}
.exai-edge-cta h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.exai-edge-cta p { color: var(--text-secondary, #6b7280); margin-bottom: 1.5rem; }
