/* Alpha Galactica — site styles */
:root {
    --bg: #050f19;
    --bg-elev: #131722;
    --bg-elev-2: #1b2030;
    --border: #232a3d;
    --text: #e6edf3;
    --text-dim: #98a2b3;
    --text-muted: #6b7280;
    --accent: #7c9cff;
    --accent-strong: #5b7cff;
    --positive: #34d399;
    --negative: #f87171;
    --code-bg: #0f1320;
    --max: 760px;
    --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }

.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(5, 15, 25, 0.78);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(124, 156, 255, 0.06),
                0 8px 24px -16px rgba(0, 0, 0, 0.6);
    margin-bottom: 32px;
}
.site-header::after {
    /* hairline gradient accent under the bar */
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(124, 156, 255, 0.35) 30%,
        rgba(180, 140, 255, 0.35) 70%,
        transparent 100%
    );
    pointer-events: none;
}
.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 64px;
    padding-top: 12px;
    padding-bottom: 12px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.1;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark {
    display: inline-block;
    width: 50px; height: 50px;
    object-fit: contain;
}
.brand-text {
    display: inline-flex;
    flex-direction: column;
}
.brand-name {
    font-size: 18px;
    font-weight: 700;
}
.brand-tagline {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-top: 2px;
}
.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
}
.site-nav a {
    position: relative;
    color: var(--text-dim);
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease;
}
.site-nav a:hover {
    color: var(--text);
    background: rgba(124, 156, 255, 0.08);
    text-decoration: none;
}
.site-nav a.active {
    color: var(--text);
    background: rgba(124, 156, 255, 0.12);
}
.site-nav a.active::after {
    content: "";
    position: absolute;
    left: 14px; right: 14px;
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), #b48cff);
}

@media (max-width: 520px) {
    .brand-tagline { display: none; }
    .site-nav a { padding: 8px 10px; }
}

/* Hero */
.hero {
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.hero-logo {
    display: block;
    width: 200px;
    height: 200px;
    flex-shrink: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}
.hero-text { min-width: 0; }
.hero h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
}
.hero .lede {
    color: var(--text-dim);
    margin: 0;
    font-size: 16px;
}

/* Article list */
.article-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}
.article-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.article-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}
.article-card a {
    display: block;
    padding: 18px 20px;
    color: inherit;
    text-decoration: none;
}
.article-card a:hover { text-decoration: none; }
.article-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-muted);
}
.article-card-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

.ticker {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--accent);
    background: rgba(124, 156, 255, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    letter-spacing: 0.04em;
}
.ticker-lg {
    font-size: 14px;
    padding: 4px 10px;
}

/* Report page */
.report-back {
    margin: 0 0 16px;
    font-size: 14px;
}
.report-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.report-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Markdown prose */
.prose {
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-size: 18px;
    line-height: 1.75;
    color: var(--text);
}
.prose h1, .prose h2, .prose h3, .prose h4 {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin-top: 2em;
    margin-bottom: 0.6em;
}
.prose h1 {
    font-size: 32px;
    font-weight: 700;
    margin-top: 0;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--border);
}
.prose h2 {
    font-size: 24px;
    font-weight: 600;
}
.prose h3 {
    font-size: 19px;
    font-weight: 600;
    color: var(--text-dim);
}
.prose p { margin: 1em 0; }
.prose strong { color: #fff; font-weight: 600; }
.prose em { color: var(--text-dim); }

.prose ul, .prose ol {
    padding-left: 1.4em;
    margin: 1em 0;
}
.prose li { margin: 0.4em 0; }
.prose li::marker { color: var(--accent); }

.prose blockquote {
    margin: 1.5em 0;
    padding: 0.6em 1.2em;
    border-left: 3px solid var(--accent);
    background: var(--bg-elev);
    color: var(--text-dim);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.prose code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88em;
    background: var(--code-bg);
    color: #f5d59f;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}
.prose pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.5;
}
.prose pre code {
    background: transparent;
    border: 0;
    padding: 0;
    color: var(--text);
}

.prose hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 2em 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
}
.prose th, .prose td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.prose th {
    background: var(--bg-elev);
    font-weight: 600;
    color: var(--text-dim);
}
.prose tr:hover td { background: rgba(124, 156, 255, 0.04); }

.prose a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(124, 156, 255, 0.4);
    text-underline-offset: 3px;
}
.prose a:hover { text-decoration-color: var(--accent); }

/* Empty / 404 */
.empty-state {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    color: var(--text-dim);
}
.empty-state h1 {
    font-size: 64px;
    margin: 0 0 8px;
    color: var(--accent);
    letter-spacing: -0.04em;
}

/* Footer */
.site-footer {
    margin-top: 80px;
    padding: 24px 0 40px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 600px) {
    .container { padding: 0 16px; }
    .prose { font-size: 17px; }
    .hero h1 { font-size: 26px; }
    .hero {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    .hero-logo { width: 140px; height: 140px; }
    .prose h1 { font-size: 26px; }
    .prose h2 { font-size: 21px; }
}

/* AI disclosure banner on article pages */
.ai-disclosure {
    margin-top: 18px;
    padding: 12px 16px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.5;
}
.ai-disclosure strong { color: var(--text); }
.ai-disclosure a { color: var(--accent); }

/* Article byline */
.report-byline {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 14px;
}
.report-byline a { color: var(--text-dim); text-decoration: none; }
.report-byline a:hover { color: var(--accent); }

/* Footer SEO/transparency block */
.site-footer .footer-disclosure {
    margin: 0 0 6px;
    color: var(--text-dim);
    font-size: 13px;
}
.site-footer .footer-links {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}
.site-footer .footer-links a {
    color: var(--text-dim);
    text-decoration: none;
}
.site-footer .footer-links a:hover { color: var(--accent); }

/* Static pages (about, contact) */
.static-page { max-width: var(--max); margin: 24px auto 64px; }
.static-page .lede { color: var(--text-dim); font-size: 18px; }
.static-page h2 { margin-top: 32px; }

/* Contact form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 24px 0 32px;
    padding: 20px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.contact-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: var(--text-dim);
}
.contact-form label span em {
    color: var(--text-muted);
    font-style: normal;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
    font-size: 15px;
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 156, 255, 0.15);
}
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form .btn-primary {
    align-self: flex-start;
    background: var(--accent-strong);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.contact-form .btn-primary:hover { background: var(--accent); }
.contact-form .contact-note {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}
/* Honeypot — hidden from real users; bots usually fill it. */
.hp-field {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.contact-errors {
    margin: 16px 0;
    padding: 12px 16px;
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.4);
    border-radius: 8px;
    color: var(--negative);
    font-size: 14px;
}
.contact-errors ul { margin: 6px 0 0 18px; padding: 0; }

.contact-success {
    margin: 24px 0;
    padding: 20px;
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.4);
    border-radius: var(--radius);
    color: var(--text);
}
.contact-success h2 { margin-top: 0; color: var(--positive); }

/* ----------------------------------------------------------------------
   Theme images, reactions, related strip, admin
---------------------------------------------------------------------- */

/* Article card: theme thumb on the left */
.article-card a {
    display: flex;
    align-items: center;
    gap: 16px;
}
.article-card-theme {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
}
.article-card-body { flex: 1; min-width: 0; }

/* Article body: theme image floated right */
.article-theme {
    float: right;
    margin: 0 0 16px 24px;
    width: 240px;
    max-width: 40%;
}
.article-theme img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
}
@media (max-width: 600px) {
    .article-theme {
        float: none;
        width: 160px;
        margin: 0 auto 16px;
        display: block;
    }
}

/* Reactions */
.reactions {
    margin: 32px 0 24px;
    padding: 18px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.reactions-title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.reactions-row {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.reaction {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.reaction:hover {
    border-color: var(--accent);
    background: rgba(124,156,255,0.08);
}
.reaction.voted {
    border-color: var(--accent);
    background: rgba(124,156,255,0.18);
}
.reaction.pending { opacity: 0.6; cursor: progress; }
.reaction-emoji { font-size: 18px; line-height: 1; }
.reaction-count {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-dim);
    font-size: 13px;
}

/* Related articles strip */
.related-articles {
    margin: 40px 0 0;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.related-title {
    margin: 0 0 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.article-list-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.article-list-grid .article-card a {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px;
}
.article-list-grid .article-card-theme {
    width: 48px;
    height: 48px;
}
@media (max-width: 720px) {
    .article-list-grid { grid-template-columns: 1fr; }
}

/* Editor disclosure (custom articles, no AI badge) */
.editor-disclosure { background: rgba(180,140,255,0.06); }

/* Admin */
.admin { max-width: 960px; margin: 0 auto; }
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
}
.admin-actions input[type=text] {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 10px;
    border-radius: 6px;
    font: inherit;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-table th, .admin-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table th { color: var(--text-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.admin-compose { display: flex; flex-direction: column; gap: 16px; max-width: 800px; }
.admin-compose label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-dim); }
.admin-compose input, .admin-compose select, .admin-compose textarea {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 8px;
    font: inherit;
}
.admin-compose textarea {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
}
.btn {
    display: inline-block;
    padding: 8px 16px;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent); color: #050f19; border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #050f19; }
.btn-danger { color: var(--negative); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
.flash-success { background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.3); }
.flash-error { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); }
.admin-login { max-width: 480px; margin: 60px auto; text-align: center; }
