/* ==========================================================================
   News Objectivity Bot — Landing page styles
   Modern dark theme, mobile-first, responsive, animated.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
    /* Surfaces */
    --bg: #0a0e1a;
    --bg-2: #0f1424;
    --surface: #141a2e;
    --surface-2: #1a2138;
    --surface-3: #222b48;
    --border: #2a3354;
    --border-strong: #3a466e;

    /* Text */
    --text: #eef1f8;
    --text-muted: #9aa3bd;
    --text-dim: #6b7494;

    /* Accent */
    --accent: #6c8cff;
    --accent-2: #8b5cf6;
    --accent-glow: rgba(108, 140, 255, 0.35);

    /* FIMI classification colors (distinct visual cues) */
    --fimi-exile: #34d399;        /* independent exile — emerald */
    --fimi-exile-bg: rgba(52, 211, 153, 0.10);
    --fimi-exile-border: rgba(52, 211, 153, 0.35);

    --fimi-independent: #38bdf8;  /* independent — sky/cyan */
    --fimi-independent-bg: rgba(56, 189, 248, 0.10);
    --fimi-independent-border: rgba(56, 189, 248, 0.35);

    --fimi-private: #fbbf24;      /* private — amber */
    --fimi-private-bg: rgba(251, 191, 36, 0.10);
    --fimi-private-border: rgba(251, 191, 36, 0.35);

    --fimi-state: #f87171;        /* state-controlled — red */
    --fimi-state-bg: rgba(248, 113, 113, 0.10);
    --fimi-state-border: rgba(248, 113, 113, 0.40);

    /* Rating axis accents */
    --axis-truth: #34d399;
    --axis-objectivity: #38bdf8;
    --axis-constructiveness: #f472b6;

    /* Layout */
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 22px;
    --maxw: 1180px;
    --shadow: 0 18px 50px -22px rgba(0, 0, 0, 0.7);

    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
code { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace; }

/* ---------- Animated background ---------- */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(108, 140, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(108, 140, 255, 0.04) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
}
.bg-glow {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    pointer-events: none;
    animation: float 14s ease-in-out infinite;
}
.bg-glow--1 {
    width: 460px; height: 460px;
    top: -120px; left: -100px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
}
.bg-glow--2 {
    width: 420px; height: 420px;
    top: 120px; right: -120px;
    background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
    animation-delay: -7s;
}
@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 40px); }
}

/* ---------- Layout helpers ---------- */
.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: 20px;
}

/* ---------- Header ---------- */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 14, 26, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 64px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
}
.brand__mark {
    color: var(--accent);
    font-size: 1.15rem;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}
.brand__name { font-size: 1.02rem; }

.nav {
    display: flex;
    gap: 6px;
}
.nav__link {
    padding: 7px 13px;
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color .2s, background .2s;
}
.nav__link:hover { color: var(--text); background: var(--surface-2); }

/* Language toggle */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px;
}
.lang-toggle__btn {
    padding: 5px 13px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-dim);
    transition: color .2s, background .2s, transform .15s;
}
.lang-toggle__btn.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 4px 14px -4px var(--accent-glow);
}
.lang-toggle__btn:hover:not(.is-active) { color: var(--text); }
.lang-toggle__btn:active { transform: scale(0.94); }
.lang-toggle__sep { color: var(--text-dim); font-weight: 700; user-select: none; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 14px 26px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    transition: transform .18s, box-shadow .25s, background .2s, border-color .2s;
    white-space: nowrap;
}
.btn__icon { flex-shrink: 0; }
.btn--primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 14px 34px -12px var(--accent-glow);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -14px var(--accent-glow); }
.btn--ghost {
    border: 1px solid var(--border-strong);
    color: var(--text);
    background: var(--surface);
}
.btn--ghost:hover { border-color: var(--accent); color: #fff; transform: translateY(-2px); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: clamp(56px, 9vw, 110px) 0 clamp(40px, 6vw, 72px);
    text-align: center;
}
.hero__inner { display: flex; flex-direction: column; align-items: center; }
.hero__badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 26px;
}
.hero__title {
    font-size: clamp(2.2rem, 6.5vw, 4rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.035em;
    background: linear-gradient(135deg, #fff 20%, var(--accent) 70%, var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 22px;
    max-width: 14ch;
}
.hero__tagline {
    font-size: clamp(1rem, 2.4vw, 1.22rem);
    color: var(--text-muted);
    max-width: 640px;
    margin-bottom: 36px;
}
.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    margin-bottom: 52px;
}
.hero__stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 36px;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat__num {
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}
.stat__label { font-size: 0.82rem; color: var(--text-dim); margin-top: 6px; text-align: center; }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0; position: relative; }
.section--alt { background: var(--bg-2); border-block: 1px solid var(--border); }
.section__head { text-align: center; max-width: 680px; margin: 0 auto clamp(36px, 5vw, 56px); }
.section__eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 14px;
}
.section__title {
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin-bottom: 16px;
}
.section__lead { color: var(--text-muted); font-size: 1.05rem; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(22px, 3vw, 32px);
    box-shadow: var(--shadow);
}
.card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card__icon { font-size: 1.5rem; line-height: 1; }
.card__head h3 { font-size: clamp(1.15rem, 2.4vw, 1.4rem); font-weight: 700; letter-spacing: -0.01em; }
.card__text { color: var(--text-muted); }

.feature-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
    margin-top: 22px;
}
.card--accent {
    border-color: var(--accent);
    background: linear-gradient(180deg, rgba(108,140,255,0.08), var(--surface));
}

/* Axes */
.axes { margin-bottom: 22px; }
.axis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 22px;
}
.axis {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 4px solid var(--c, var(--accent));
    border-radius: var(--radius);
    padding: 20px;
}
.axis--truth { --c: var(--axis-truth); }
.axis--objectivity { --c: var(--axis-objectivity); }
.axis--constructiveness { --c: var(--axis-constructiveness); }
.axis__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.axis__dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--c);
    box-shadow: 0 0 12px var(--c);
    flex-shrink: 0;
}
.axis__head h4 { font-size: 1.02rem; font-weight: 700; }
.axis p { font-size: 0.92rem; color: var(--text-muted); }

/* 7/7/7 rule pills */
.rule-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    margin-right: 10px;
    padding: 7px 15px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    font-weight: 600;
    font-size: 0.9rem;
}
.rule-pill__n {
    font-weight: 900;
    color: var(--accent);
    font-size: 1.05rem;
}

/* ---------- Commands table ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.cmd-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 480px;
}
.cmd-table thead { background: var(--surface-2); }
.cmd-table th {
    text-align: left;
    padding: 16px 22px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    font-weight: 700;
}
.cmd-table td {
    padding: 15px 22px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    vertical-align: top;
}
.cmd-table tbody tr { transition: background .18s; }
.cmd-table tbody tr:hover { background: var(--surface-2); }
.cmd {
    display: inline-block;
    background: var(--surface-3);
    color: var(--accent);
    padding: 5px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.92rem;
    white-space: nowrap;
}

/* ---------- Sources ---------- */
.fimi-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 22px;
    margin-bottom: 34px;
}
.legend-item { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text-muted); }
.legend-dot { width: 13px; height: 13px; border-radius: 50%; }
.legend-item--exile .legend-dot { background: var(--fimi-exile); box-shadow: 0 0 10px var(--fimi-exile); }
.legend-item--independent .legend-dot { background: var(--fimi-independent); box-shadow: 0 0 10px var(--fimi-independent); }
.legend-item--private .legend-dot { background: var(--fimi-private); box-shadow: 0 0 10px var(--fimi-private); }
.legend-item--state .legend-dot { background: var(--fimi-state); box-shadow: 0 0 10px var(--fimi-state); }

.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
    gap: 22px;
}
.source-group {
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    background: var(--surface);
}
.source-group--exile { background: var(--fimi-exile-bg); border-color: var(--fimi-exile-border); }
.source-group--independent { background: var(--fimi-independent-bg); border-color: var(--fimi-independent-border); }
.source-group--private { background: var(--fimi-private-bg); border-color: var(--fimi-private-border); }
.source-group--state { background: var(--fimi-state-bg); border-color: var(--fimi-state-border); }

.source-group__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.source-group__badge { font-size: 1.2rem; }
.source-group__head h3 { font-size: 1.08rem; font-weight: 700; }
.source-group__tag {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-muted);
}
.source-group__tag--danger { background: var(--fimi-state-bg); color: var(--fimi-state); border: 1px solid var(--fimi-state-border); }

.source-list { display: flex; flex-direction: column; gap: 12px; }
.source {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-left: 14px;
    position: relative;
}
.source::before {
    content: '';
    position: absolute;
    left: 0; top: 7px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--c);
}
.source--exile { --c: var(--fimi-exile); }
.source--independent { --c: var(--fimi-independent); }
.source--private { --c: var(--fimi-private); }
.source--state { --c: var(--fimi-state); }
.source__name { font-weight: 700; font-size: 1rem; }
.source__desc { font-size: 0.85rem; color: var(--text-dim); }

/* ---------- Architecture ---------- */
.arch-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 12px;
}
.arch-step {
    flex: 1 1 220px;
    max-width: 320px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-align: center;
    box-shadow: var(--shadow);
}
.arch-step__icon { font-size: 2.2rem; display: block; margin-bottom: 14px; }
.arch-step h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 10px; }
.arch-step p { color: var(--text-muted); font-size: 0.92rem; }
.arch-arrow {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    color: var(--accent);
    font-weight: 700;
}

/* ---------- Tech stack ---------- */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.tech {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color .2s, transform .2s;
}
.tech:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.tech--ai {
    border-color: var(--accent);
    background: linear-gradient(180deg, rgba(108,140,255,0.10), var(--surface));
}
.tech__name { font-weight: 800; font-size: 1.1rem; }
.tech__role { font-size: 0.86rem; color: var(--text-dim); }

/* ---------- Footer ---------- */
.footer {
    border-top: 1px solid var(--border);
    background: var(--bg-2);
    padding: 48px 0;
}
.footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}
.footer__brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 800;
    font-size: 1.1rem;
}
.footer__note { color: var(--text-muted); max-width: 520px; font-size: 0.95rem; }
.footer__link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 20px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    font-weight: 600;
    font-size: 0.92rem;
    transition: border-color .2s, transform .2s, color .2s;
}
.footer__link:hover { border-color: var(--accent); color: #fff; transform: translateY(-2px); }
.footer__copy { color: var(--text-dim); font-size: 0.85rem; }

/* ---------- Reveal animation ---------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .nav { display: none; }
    .header__inner { justify-content: space-between; }
}

@media (max-width: 600px) {
    .hero__stats { gap: 18px 26px; }
    .hero__actions { flex-direction: column; align-items: stretch; width: 100%; max-width: 340px; }
    .hero__actions .btn { justify-content: center; }
    .btn { padding: 14px 22px; }
    .arch-arrow { transform: rotate(90deg); width: 100%; justify-content: center; }
    .arch-flow { flex-direction: column; align-items: center; }
    .arch-step { flex-basis: auto; width: 100%; max-width: 100%; }
    .section__head { text-align: left; }
}

@media (max-width: 375px) {
    .container { padding-inline: 16px; }
    .hero__title { font-size: 2rem; }
    .card { padding: 20px; }
    .lang-toggle__btn { padding: 5px 11px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
}
