/* ============================================================
   XTHREAD RESEARCH LAB — Design System v4.0
   Bold. Dramatic. Zero clutter. Zero emojis.
   Ref: Linear.app + Vercel + VirusTotal UI aesthetics
   ============================================================ */

:root {
    --bg-base:              #060709;
    --bg-surface:           #0d0f13;
    --bg-surface-elevated:  #12151b;
    --bg-input:             #090b0f;
    --bg-glass:             rgba(13, 15, 19, 0.82);

    --border-subtle:        #161a24;
    --border-mid:           #1f2535;
    --border-strong:        #2a3044;
    --border-active:        #ffffff22;

    --text-high:    #f1f3f6;
    --text-medium:  #7a8499;
    --text-low:     #3e4558;

    --accent:       #ffffff;
    --accent-dim:   rgba(255,255,255,0.06);

    --status-green:    #2ea84c;
    --status-green-bg: rgba(46,168,76,0.08);
    --status-red:      #e5534b;
    --status-red-bg:   rgba(229,83,75,0.08);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', Consolas, Monaco, 'Courier New', monospace;

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
}

/* ─── RESET ────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-base);
    background-image:
        radial-gradient(ellipse 80% 40% at 50% -10%, rgba(255,255,255,0.04) 0%, transparent 70%),
        linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
    background-size: 100% 100%, 56px 56px, 56px 56px;
    color: var(--text-high);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* ─── HEADER ───────────────────────────────────────────────── */
.header {
    background: rgba(6, 7, 9, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 200;
}

.header-inner {
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-high);
    flex-shrink: 0;
}

.brand-symbol {
    width: 20px;
    height: 20px;
    color: #fff;
}

.brand-text {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.brand-muted {
    color: var(--text-low);
    font-weight: 600;
    margin-left: 1px;
}

.nav {
    display: flex;
    gap: 2px;
}

.nav-link {
    color: var(--text-medium);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

.nav-link:hover { color: var(--text-high); background: var(--accent-dim); }
.nav-link.active { color: var(--text-high); }

.auth-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ─── BUTTONS ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    letter-spacing: 0.1px;
    white-space: nowrap;
}

.btn-primary {
    background: #ffffff;
    color: #08090c;
    border-color: #ffffff;
}
.btn-primary:hover {
    background: #dde3ec;
    border-color: #dde3ec;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255,255,255,0.12);
}

.btn-outline {
    background: transparent;
    color: var(--text-high);
    border-color: var(--border-mid);
}
.btn-outline:hover {
    background: var(--accent-dim);
    border-color: var(--border-strong);
}

.btn-ghost {
    background: transparent;
    color: var(--text-medium);
    border-color: transparent;
}
.btn-ghost:hover { color: var(--text-high); }

.btn-lg {
    padding: 14px 28px;
    font-size: 14.5px;
    border-radius: var(--radius-lg);
    font-weight: 700;
}

.btn-sm  { padding: 5px 12px; font-size: 12px; }
.btn-xs  { padding: 3px 8px;  font-size: 11px; }
.btn-full { width: 100%; }

/* ─── HERO ─────────────────────────────────────────────────── */
.hero-section {
    padding: 96px 0 64px;
    text-align: center;
    position: relative;
}

/* glowing orb behind hero */
.hero-section::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(255,255,255,0.04) 0%, transparent 70%);
    pointer-events: none;
}

.pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-mid);
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-medium);
    margin-bottom: 28px;
    letter-spacing: 0.5px;
}

.pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-green);
    box-shadow: 0 0 6px rgba(46,168,76,0.8);
    animation: pulse-dot 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 6px rgba(46,168,76,0.8); }
    50%       { box-shadow: 0 0 14px rgba(46,168,76,0.4); }
}

.hero-title {
    font-size: 58px;
    font-weight: 900;
    letter-spacing: -2.5px;
    color: var(--text-high);
    line-height: 1.05;
    max-width: 820px;
    margin: 0 auto 20px;
}

.hero-title-muted {
    color: var(--text-medium);
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-medium);
    max-width: 580px;
    margin: 0 auto 40px;
    line-height: 1.65;
    font-weight: 400;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 64px;
}

/* ─── STATS STRIP ──────────────────────────────────────────── */
.stats-banner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 80px;
    overflow: hidden;
}

.stat-box {
    padding: 28px 20px;
    text-align: center;
    border-right: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    transition: background 0.2s;
}
.stat-box:last-child { border-right: none; }
.stat-box:hover      { background: var(--bg-surface-elevated); }

.stat-number {
    display: block;
    font-size: 30px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-high);
    margin-bottom: 4px;
    letter-spacing: -1px;
}

.stat-title {
    font-size: 11px;
    color: var(--text-low);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

/* ─── SECTION HEADER ───────────────────────────────────────── */
.section-header {
    text-align: center;
    margin-bottom: 44px;
}

.section-label {
    display: block;
    font-size: 10.5px;
    font-family: var(--font-mono);
    color: var(--text-low);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

.section-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.8px;
    color: var(--text-high);
}

/* ─── FEATURE CARDS ────────────────────────────────────────── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 80px;
}

.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(255,255,255,0.03) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.feature-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.feature-card:hover::before { opacity: 1; }

.feature-icon-wrap {
    width: 38px;
    height: 38px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    color: var(--text-high);
}

.feature-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-high);
}

.feature-card p {
    font-size: 13px;
    color: var(--text-medium);
    line-height: 1.65;
}

/* ─── FAQ ──────────────────────────────────────────────────── */
.faq-section {
    max-width: 720px;
    margin: 0 auto 96px;
}

.faq-list { display: flex; flex-direction: column; gap: 8px; }

.faq-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.15s;
}
.faq-item:hover { border-color: var(--border-mid); }

.faq-question {
    width: 100%;
    padding: 16px 20px;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-high);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.faq-toggle-icon {
    font-size: 16px;
    color: var(--text-low);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-weight: 400;
}
.faq-item.open .faq-toggle-icon { transform: rotate(45deg); color: var(--text-medium); }

.faq-answer {
    padding: 0 20px 16px;
    color: var(--text-medium);
    font-size: 13px;
    line-height: 1.7;
    display: none;
}
.faq-item.open .faq-answer { display: block; }

/* ─── COOKIE BANNER ────────────────────────────────────────── */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 480px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: 0 20px 48px rgba(0,0,0,0.7);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideUp 0.3s ease;
}

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

.cookie-text {
    font-size: 12.5px;
    color: var(--text-medium);
    line-height: 1.5;
}
.cookie-text a { color: var(--text-high); text-decoration: underline; }
.cookie-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ─── PANEL (analyze page) ─────────────────────────────────── */
.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 32px;
}

.panel-header {
    padding: 14px 20px;
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.panel-body {
    padding: 28px;
    position: relative;
}

/* ─── DROPZONE ─────────────────────────────────────────────── */
.dropzone {
    border: 1px dashed var(--border-mid);
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 64px 24px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--border-strong);
    background: #0c0e12;
}

.file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone-icon  { color: var(--text-low); margin-bottom: 14px; }
.dropzone-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.dropzone-desc  { color: var(--text-medium); font-size: 12.5px; margin-bottom: 16px; }
.dropzone-meta  { display: inline-flex; gap: 8px; font-size: 11px; font-family: var(--font-mono); color: var(--text-low); }

/* ─── STRICT AUTH GATE ─────────────────────────────────────── */
/*
   The gate overlay REPLACES the dropzone visually.
   We keep both in DOM but toggle visibility cleanly.
*/
.strict-gate-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(6, 7, 9, 0.97);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    text-align: center;
    backdrop-filter: blur(2px);
}

.gate-symbol {
    width: 48px;
    height: 48px;
    color: var(--text-low);
    margin-bottom: 20px;
}

.strict-gate-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text-high);
    letter-spacing: -0.3px;
}

.strict-gate-desc {
    color: var(--text-medium);
    font-size: 13.5px;
    max-width: 480px;
    margin: 0 auto 28px;
    line-height: 1.65;
}

.strict-gate-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* When gate is shown, the dropzone below is still in DOM
   but pointer-events are blocked by the absolute overlay */
.locked-dropzone .file-input {
    pointer-events: none;
    display: none;
}

/* ─── PILL / BADGE ─────────────────────────────────────────── */
.pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-medium);
}

.pill-danger {
    background: var(--status-red-bg);
    border-color: rgba(229,83,75,0.25);
    color: var(--status-red);
}

/* ─── PROGRESS BAR ─────────────────────────────────────────── */
.progress-wrap { margin-top: 24px; }

/* ─── SANDBOX CONSOLE ──────────────────────────────────────── */
.sandbox-console {
    background: #050607;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 11.5px;
}

.console-top {
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-subtle);
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-low);
    font-size: 11px;
    letter-spacing: 0.5px;
}

.console-active {
    color: var(--status-green);
    font-weight: 700;
    letter-spacing: 1px;
}

.console-stream { padding: 14px; display: flex; flex-direction: column; gap: 4px; min-height: 80px; }

.stream-line { color: var(--text-medium); }
.stream-line.crit { color: var(--status-red); }
.stream-line.warn { color: #c09230; }

/* ─── REPORT CONTAINER ─────────────────────────────────────── */
.report-container { margin-top: 24px; }

/* ─── MODAL LAYER ──────────────────────────────────────────── */
.modal-layer {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,0.7);
    animation: modalIn 0.18s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.97) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-box.modal-wide { max-width: 880px; }

.modal-top {
    padding: 12px 18px;
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-tabs { display: flex; gap: 4px; }

.modal-tab {
    background: transparent;
    border: none;
    color: var(--text-low);
    font-size: 12.5px;
    font-weight: 600;
    padding: 5px 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}
.modal-tab.active  { background: var(--bg-surface); color: var(--text-high); }
.modal-tab:hover   { color: var(--text-medium); }

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-low);
    font-size: 16px;
    cursor: pointer;
    transition: color 0.15s;
    line-height: 1;
}
.modal-close:hover { color: var(--text-high); }

.modal-inner { padding: 24px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: var(--text-medium); margin-bottom: 6px; font-weight: 500; }

.input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    color: var(--text-high);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.input:focus { border-color: var(--border-strong); }
.input::placeholder { color: var(--text-low); }

.alert-box {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    margin-bottom: 16px;
    line-height: 1.5;
}
.alert-box.danger  { background: var(--status-red-bg); border: 1px solid rgba(229,83,75,0.25); color: var(--status-red); }
.alert-box.success { background: var(--status-green-bg); border: 1px solid rgba(46,168,76,0.25); color: var(--status-green); }

/* ─── LEGAL PAGES ──────────────────────────────────────────── */
.legal-layout { max-width: 800px; margin: 40px auto 96px; }

.legal-header {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 24px;
    margin-bottom: 36px;
}

.legal-header h1 {
    font-size: 34px;
    font-weight: 900;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.legal-meta {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-low);
}

.legal-body section { margin-bottom: 36px; }
.legal-body h2 { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.legal-body p  { color: var(--text-medium); font-size: 13.5px; line-height: 1.75; margin-bottom: 14px; }
.legal-body ul { margin-left: 20px; margin-bottom: 16px; color: var(--text-medium); }
.legal-body li { margin-bottom: 6px; font-size: 13.5px; }

/* ─── 404 PAGE ─────────────────────────────────────────────── */
.error-page { text-align: center; padding: 120px 0; margin: auto; }
.error-code  { font-size: 80px; font-weight: 900; font-family: var(--font-mono); letter-spacing: -3px; color: var(--text-low); margin-bottom: 8px; }
.error-title { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.error-desc  { color: var(--text-medium); font-size: 14px; max-width: 440px; margin: 0 auto 28px; }

/* ─── FOOTER ───────────────────────────────────────────────── */
.footer {
    margin-top: auto;
    border-top: 1px solid var(--border-subtle);
    padding: 28px 0;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-low);
    gap: 16px;
}

.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-low); text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: var(--text-medium); }

/* ─── LANG BUTTON ──────────────────────────────────────────── */
.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid var(--border-mid);
    color: var(--text-medium);
    padding: 4px 9px;
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.5px;
}
.lang-btn:hover { border-color: var(--border-strong); color: var(--text-high); }

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

/* ─── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .hero-title { font-size: 40px; letter-spacing: -1.5px; }
    .stats-banner { grid-template-columns: repeat(2, 1fr); }
    .stat-box { border-right: none; border-bottom: 1px solid var(--border-subtle); }
    .stat-box:nth-child(2n) { }
    .stat-box:last-child, .stat-box:nth-last-child(-n+2):nth-child(odd) { border-bottom: none; }
    .features-grid { grid-template-columns: 1fr; }
    .section-title { font-size: 26px; }
}

@media (max-width: 640px) {
    .hero-title    { font-size: 32px; letter-spacing: -1px; }
    .hero-section  { padding: 64px 0 40px; }
    .hero-actions  { flex-direction: column; align-items: center; }
    .btn-lg        { width: 100%; max-width: 320px; justify-content: center; }
    .nav           { display: none; }
    .footer-inner  { flex-direction: column; text-align: center; gap: 12px; }
    .footer-links  { flex-wrap: wrap; justify-content: center; }
    .modal-box     { border-radius: var(--radius-md); }
    .strict-gate-actions { flex-direction: column; align-items: center; }
}
