/* ═══════════════════════════════════════════════════════════════════════
   Stars Engine — Dark Mode Stylesheet
   Shared by all community landing pages and demo tools.

   Palette:
     bg:        #0d1117  GitHub dark — deep, neutral, easy on eyes in low light
     card:      #161b22  Slightly lifted surface for cards and panels
     text:      #e6edf3  Primary body text — high contrast, readable
     gold:      #d4a853  Accent — amber/gold (occult tools, not corporate blue)
     dim:       #8b949e  Secondary/muted text
     border:    #30363d  Subtle separator, visible but not loud
     green:     #3fb950  Success / confirmed findings
     red:       #f85149  Error / bad news
     blue:      #58a6ff  Links (used sparingly — prefer gold for primary CTA)

   Typography:
     System font stack — fast load, native rendering, no FOUT.
     Georgia for headings on content pages (reads like a book).
     Monospace for code, API examples, source citations.

   Design principles:
     - Dark mode only. These tools are used in low light.
     - Source-cite everything. Citations are credibility.
     - Show, don't tell. Real output over marketing copy.
     - No framework. Single-file HTML, inline everything, fast to load and iterate.
   ═══════════════════════════════════════════════════════════════════════ */

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

html {
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    background: #0d1117;
    color: #e6edf3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans',
                 Helvetica, Arial, sans-serif, 'Apple Color Emoji',
                 'Segoe UI Emoji';
    line-height: 1.7;
    min-height: 100vh;
}

/* Content-heavy pages (landing pages, wiki-style) use a serif body */
body.serif {
    font-family: 'Georgia', 'Palatino Linotype', 'Book Antiqua', 'Palatino',
                 'Noto Serif', serif;
}

/* ── Layout ───────────────────────────────────────── */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.container-wide {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.container-narrow {
    max-width: 650px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ── Typography ───────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    color: #e6edf3;
    line-height: 1.3;
    font-weight: 600;
}

h1 { font-size: 2.4rem; letter-spacing: -0.02em; margin-bottom: 1rem; }
h2 { font-size: 1.6rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
h4 { font-size: 1rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; }

a {
    color: #d4a853;
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover {
    color: #e2c278;
    text-decoration: underline;
}

strong { color: #e6edf3; font-weight: 600; }

code {
    background: #161b22;
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas',
                 'Liberation Mono', monospace;
    font-size: 0.88em;
    color: #d4a853;
}

pre {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 1.25rem;
    overflow-x: auto;
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas',
                 'Liberation Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.55;
    margin-bottom: 1rem;
}

pre code {
    background: none;
    padding: 0;
    color: #e6edf3;
}

ul, ol { margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.35rem; }

blockquote {
    border-left: 3px solid #d4a853;
    margin: 1.5rem 0;
    padding: 0.75rem 1.25rem;
    background: #161b22;
    border-radius: 0 6px 6px 0;
    color: #8b949e;
    font-style: italic;
}

/* ── Cards ────────────────────────────────────────── */
.card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover {
    border-color: rgba(212, 168, 83, 0.35);
    transform: translateY(-1px);
}

/* ── Buttons ──────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: background 0.15s ease, transform 0.1s ease;
    text-align: center;
    text-decoration: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: #d4a853;
    color: #0d1117;
}
.btn-primary:hover {
    background: #e2c278;
    text-decoration: none;
    color: #0d1117;
}

.btn-outline {
    background: transparent;
    border: 1px solid #d4a853;
    color: #d4a853;
}
.btn-outline:hover {
    background: rgba(212, 168, 83, 0.1);
    text-decoration: none;
    color: #e2c278;
}

.btn-large {
    padding: 0.85rem 2rem;
    font-size: 1.05rem;
}

/* ── Badges ───────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-radius: 4px;
    text-transform: uppercase;
}
.badge-gold   { background: #d4a853; color: #0d1117; }
.badge-green  { background: #3fb950; color: #0d1117; }
.badge-blue   { background: #58a6ff; color: #0d1117; }
.badge-red    { background: #f85149; color: #0d1117; }

/* ── Forms ────────────────────────────────────────── */
input, select, textarea {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 0.55rem 0.75rem;
    color: #e6edf3;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #d4a853;
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15);
}
label {
    display: block;
    margin-bottom: 0.35rem;
    color: #8b949e;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ── Tables ───────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin: 1rem 0 1.5rem;
}
th {
    background: #161b22;
    color: #d4a853;
    text-align: left;
    padding: 0.6rem 0.85rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #30363d;
}
td {
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid #30363d;
}
tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.012);
}

/* ── Source citation line ─────────────────────────── */
.source-cite {
    font-size: 0.78rem;
    color: #8b949e;
    font-style: italic;
    margin-top: 0.35rem;
}
.source-cite::before {
    content: "📜 ";
}

/* ── Hero Section ─────────────────────────────────── */
.hero {
    text-align: center;
    padding: 4rem 0 3rem;
    border-bottom: 1px solid #30363d;
    margin-bottom: 3rem;
}
.hero h1 {
    color: #d4a853;
    font-size: 2.6rem;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
}
.hero .tagline {
    color: #8b949e;
    font-size: 1.1rem;
    max-width: 650px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}
.hero .cta-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* ── Feature Grid ─────────────────────────────────── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}
.feature-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1.5rem;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.feature-card:hover {
    border-color: rgba(212, 168, 83, 0.35);
    transform: translateY(-2px);
}
.feature-card .icon {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
}
.feature-card h3 {
    color: #d4a853;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}
.feature-card p {
    color: #8b949e;
    font-size: 0.9rem;
    margin-bottom: 0;
}
.feature-card .try-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ── Section Headers ──────────────────────────────── */
.section {
    margin-bottom: 4rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid #30363d;
}
.section:last-child {
    border-bottom: none;
    margin-bottom: 2rem;
}
.section h2 {
    color: #d4a853;
    font-size: 1.5rem;
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #30363d;
}
.section .section-desc {
    color: #8b949e;
    margin-bottom: 1.5rem;
}

/* ── Stat Row ─────────────────────────────────────── */
.stat-row {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}
.stat-item {
    text-align: center;
}
.stat-item .num {
    font-size: 2rem;
    color: #d4a853;
    font-weight: 700;
}
.stat-item .lbl {
    font-size: 0.72rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.2rem;
}

/* ── Footer ───────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 3rem 0;
    color: #8b949e;
    font-size: 0.78rem;
    border-top: 1px solid #30363d;
    margin-top: 3rem;
}
.footer a { color: #8b949e; }
.footer a:hover { color: #d4a853; }

/* ── Comparison Table ─────────────────────────────── */
.comparison-table th:first-child,
.comparison-table td:first-child {
    position: sticky;
    left: 0;
    background: #161b22;
    z-index: 1;
}
.comparison-table tr:nth-child(even) td:first-child {
    background: rgba(255, 255, 255, 0.025);
}
.comparison-table .check { color: #3fb950; font-weight: bold; }
.comparison-table .cross { color: #f85149; }

/* ── API Console ──────────────────────────────────── */
.api-console {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
}
.api-console .console-input {
    display: flex;
    border-bottom: 1px solid #30363d;
}
.api-console .console-input input {
    flex: 1;
    background: #0d1117;
    border: none;
    padding: 0.75rem 1rem;
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #e6edf3;
}
.api-console .console-input input:focus {
    outline: none;
    box-shadow: none;
}
.api-console .console-input button {
    background: #d4a853;
    color: #0d1117;
    border: none;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
}
.api-console .console-output {
    padding: 1rem;
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    color: #8b949e;
}

/* ── Spirit Result Card ───────────────────────────── */
.spirit-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-left: 3px solid #d4a853;
    border-radius: 0 8px 8px 0;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.spirit-card h3 {
    color: #d4a853;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}
.spirit-card .spirit-subtitle {
    color: #8b949e;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}
.spirit-card .spirit-detail {
    color: #e6edf3;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

/* ── Loading Spinner ──────────────────────────────── */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #30363d;
    border-top-color: #d4a853;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast / Status ───────────────────────────────── */
.status-msg {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.status-error {
    background: rgba(248, 81, 73, 0.12);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: #f85149;
}
.status-success {
    background: rgba(63, 185, 80, 0.12);
    border: 1px solid rgba(63, 185, 80, 0.3);
    color: #3fb950;
}
.status-info {
    background: rgba(88, 166, 255, 0.12);
    border: 1px solid rgba(88, 166, 255, 0.3);
    color: #58a6ff;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
    html { font-size: 15px; }
    .container, .container-wide, .container-narrow {
        padding: 1.25rem 1rem;
    }
    .hero { padding: 2.5rem 0 2rem; }
    .hero h1 { font-size: 1.8rem; }
    .hero .tagline { font-size: 0.95rem; }
    .feature-grid {
        grid-template-columns: 1fr;
    }
    .comparison-table {
        font-size: 0.75rem;
    }
    .comparison-table th,
    .comparison-table td {
        padding: 0.4rem 0.5rem;
    }
}

@media (max-width: 480px) {
    html { font-size: 14px; }
    .hero h1 { font-size: 1.5rem; }
    .btn-large { padding: 0.7rem 1.4rem; font-size: 0.95rem; }
    .stat-row { gap: 1rem; }
    .stat-item .num { font-size: 1.5rem; }
}
