/* RobotPulse - Dark Machine Theme */
:root {
    --bg: #0b0d12;
    --bg-card: #14171f;
    --bg-card-hover: #1c212c;
    --bg-surface: #101319;
    --border: #262c3a;
    --text: #bcc3d2;
    --text-muted: #757f95;
    --text-bright: #f0f3f9;
    --accent: #ff8a3d;
    --accent-glow: #ff8a3d22;
    --accent2: #22d3ee;
    --accent3: #a78bfa;
    --gradient: linear-gradient(135deg, #ff8a3d 0%, #f43f5e 45%, #a78bfa 100%);
    --nav-bg: #07090d;
    --nav-text: #bcc3d2;
    --radius: 14px;
    --radius-sm: 8px;
    --pos: #34d399;
    --neg: #f87171;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(circle at 12% 0%, rgba(255,138,61,0.09), transparent 42%),
        radial-gradient(circle at 88% 12%, rgba(167,139,250,0.07), transparent 42%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
}

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

img { max-width: 100%; display: block; }

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

.container.narrow { max-width: 860px; }

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-bright);
    letter-spacing: -0.02em;
}

.logo:hover { text-decoration: none; }

.logo-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 900;
    color: #0b0d12;
}

.logo span.accent { color: var(--accent); }

.nav-links {
    display: flex;
    gap: 4px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--nav-text);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.nav-links a:hover, .nav-links a.active {
    background: var(--bg-card-hover);
    color: var(--text-bright);
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-bright);
    font-size: 18px;
    padding: 6px 10px;
    cursor: pointer;
}

/* Hero */
.hero {
    padding: 72px 0 56px;
    border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(255,138,61,0.3);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 900;
    color: var(--text-bright);
    letter-spacing: -0.03em;
    line-height: 1.1;
    max-width: 820px;
    margin-bottom: 18px;
}

.hero h1 .accent-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p.lead {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 660px;
    margin-bottom: 28px;
}

.hero-stats {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.hero-stat { display: flex; flex-direction: column; }

.hero-stat .num {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-bright);
}

.hero-stat .label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Section headers */
.section { padding: 56px 0; }
.section.tight { padding: 36px 0; }

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
    gap: 20px;
    flex-wrap: wrap;
}

.section-head h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-bright);
    letter-spacing: -0.02em;
}

.section-head p {
    color: var(--text-muted);
    font-size: 15px;
    margin-top: 6px;
}

/* Cards / Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
    border-color: rgba(255,138,61,0.4);
    transform: translateY(-2px);
}

/* Bill of materials bar */
.bom {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}

.bom h3 {
    color: var(--text-bright);
    font-size: 18px;
    font-weight: 750;
    margin-bottom: 4px;
}

.bom .sub { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }

.bom-bar {
    display: flex;
    height: 42px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.bom-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 800;
    color: #0b0d12;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
}

.bom-seg.actuators { background: var(--accent); flex: 70; }
.bom-seg.compute   { background: var(--accent2); flex: 12; }
.bom-seg.structure { background: var(--accent3); flex: 10; }
.bom-seg.other     { background: #4b5468; color: var(--text-bright); flex: 8; }

.bom-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.bom-legend span { display: flex; align-items: center; gap: 7px; }

.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot.actuators { background: var(--accent); }
.dot.compute { background: var(--accent2); }
.dot.structure { background: var(--accent3); }
.dot.other { background: #4b5468; }

/* Article feed */
.article-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    text-decoration: none;
    color: inherit;
}

.article-card:hover { border-color: rgba(255,138,61,0.4); text-decoration: none; }

.article-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.tag {
    background: var(--accent-glow);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tag.alt { background: rgba(34,211,238,0.12); color: var(--accent2); }
.tag.alt2 { background: rgba(167,139,250,0.14); color: var(--accent3); }

.article-card h3 {
    font-size: 19px;
    font-weight: 750;
    color: var(--text-bright);
    margin-bottom: 8px;
    line-height: 1.35;
}

.article-card p { color: var(--text); font-size: 15px; }

/* Topic cards */
.topic-card h3 {
    color: var(--text-bright);
    font-size: 19px;
    font-weight: 750;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topic-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.topic-card p { color: var(--text-muted); font-size: 14.5px; }

/* Company cards */
.company-card { display: flex; flex-direction: column; gap: 12px; }

.company-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.company-name { font-size: 18px; font-weight: 750; color: var(--text-bright); }

.ticker {
    font-family: 'SF Mono', Menlo, monospace;
    font-size: 13px;
    font-weight: 800;
    color: var(--bg);
    background: var(--accent2);
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.company-card p.desc { color: var(--text); font-size: 14.5px; }

.company-tag { font-size: 12.5px; color: var(--accent); font-weight: 650; }

.company-role {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.quote {
    border-left: 3px solid var(--accent);
    padding: 4px 0 4px 14px;
    color: var(--text-muted);
    font-size: 14px;
    font-style: italic;
}

/* Risk pills */
.risk {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 9px;
    border-radius: 999px;
}

.risk.low { background: rgba(52,211,153,0.13); color: var(--pos); }
.risk.med { background: rgba(255,138,61,0.14); color: var(--accent); }
.risk.high { background: rgba(248,113,113,0.14); color: var(--neg); }

/* Stack / anatomy list */
.stack { display: flex; flex-direction: column; gap: 12px; }

.stack-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
}

.stack-num {
    font-family: 'SF Mono', Menlo, monospace;
    font-size: 13px;
    font-weight: 800;
    color: var(--accent);
    background: var(--accent-glow);
    border-radius: 8px;
    padding: 5px 10px;
    flex-shrink: 0;
}

.stack-body h4 {
    color: var(--text-bright);
    font-size: 16px;
    font-weight: 750;
    margin-bottom: 4px;
}

.stack-body p { font-size: 14.5px; color: var(--text-muted); }

/* Editorial */
.editorial {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
}

.editorial h2 {
    color: var(--text-bright);
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.editorial h3 {
    color: var(--text-bright);
    font-size: 17px;
    font-weight: 750;
    margin: 22px 0 10px;
}

.editorial .article-meta { margin-bottom: 16px; }

.editorial p { margin-bottom: 16px; font-size: 15.5px; }
.editorial p:last-child { margin-bottom: 0; }

.editorial ul { margin: 0 0 16px 20px; font-size: 15.5px; }
.editorial li { margin-bottom: 8px; }

/* Prose / about */
.prose h2 {
    color: var(--text-bright);
    font-size: 22px;
    font-weight: 800;
    margin: 28px 0 12px;
}

.prose h2:first-child { margin-top: 0; }
.prose p { margin-bottom: 16px; font-size: 16px; }
.prose ul { margin: 0 0 16px 20px; font-size: 16px; }
.prose li { margin-bottom: 8px; }

.callout {
    background: var(--accent-glow);
    border: 1px solid rgba(255,138,61,0.3);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 24px 0;
    color: var(--text-bright);
    font-size: 15.5px;
}

.callout.warn {
    background: rgba(248,113,113,0.09);
    border-color: rgba(248,113,113,0.3);
}

/* Table */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 14.5px;
}

th {
    text-align: left;
    padding: 14px 18px;
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: top;
}

tr:last-child td { border-bottom: none; }

td strong { color: var(--text-bright); }

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

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

.footer-links { display: flex; gap: 20px; list-style: none; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); font-size: 14px; }
.footer-links a:hover { color: var(--text-bright); }
.footer-note { color: var(--text-muted); font-size: 13px; }

.disclaimer {
    color: var(--text-muted);
    font-size: 12.5px;
    max-width: 900px;
    margin-top: 14px;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 780px) {
    .nav-links { display: none; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--nav-bg);
        border-bottom: 1px solid var(--border);
        padding: 12px;
        gap: 4px;
    }
    .nav-toggle { display: block; }
    .hero { padding: 48px 0 40px; }
    .hero-stats { gap: 20px; }
    .section { padding: 40px 0; }
    .editorial { padding: 22px; }
    .bom-seg { font-size: 11px; }
}

/* Live quote rows */
.stock-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    font-family: 'SF Mono', Menlo, monospace;
    padding-top: 4px;
    min-height: 24px;
}

.stock-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-bright);
}

.stock-change { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.stock-change.is-up { color: var(--pos); }
.stock-change.is-down { color: var(--neg); }

.stock-row.is-loading .stock-price,
.stock-row.is-loading .stock-change { opacity: 0.45; }

.stock-row.is-dead .stock-price {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
}

.quote-stamp {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
