/* ============================================================
   SYNTENSOR — Shared Stylesheet
   Light/dark via prefers-color-scheme
   ============================================================ */
:root {
    --bg: #000;
    --bg-card: #222226;
    --bg-card-alt: #26262b;
    --border: rgba(255, 255, 255, 0.08);
    --text: #f0f0f2;
    --text-muted: rgba(255, 255, 255, 0.45);
    --text-sub: rgba(255, 255, 255, 0.6);
    --accent: #7c3aed;
    --accent-hover: #6d28d9;
    --section-tag: #7c3aed;
    --stat-value: #a78bfa;
    --orb-top: #ffffff;
    --nav-link: rgba(255, 255, 255, 0.75);
    --icon-btn: rgba(255, 255, 255, 0.5);
    --footer-border: rgba(255, 255, 255, 0.08);
    --footer-meta: rgba(255, 255, 255, 0.35);
    --warning-bg: rgba(255, 255, 255, 0.04);
    --warning-border: rgba(255, 255, 255, 0.1);
}
@media (prefers-color-scheme: light) {
    :root {
        --bg: #fff;
        --bg-card: #ffffff;
        --bg-card-alt: #f0f0f4;
        --border: rgba(0, 0, 0, 0.08);
        --text: #111114;
        --text-muted: rgba(0, 0, 0, 0.45);
        --text-sub: rgba(0, 0, 0, 0.6);
        --accent: #7c3aed;
        --accent-hover: #6d28d9;
        --section-tag: #7c3aed;
        --stat-value: #6d28d9;
        --orb-top: #1a1a1e;
        --nav-link: rgba(0, 0, 0, 0.65);
        --icon-btn: rgba(0, 0, 0, 0.4);
        --footer-border: rgba(0, 0, 0, 0.1);
        --footer-meta: rgba(0, 0, 0, 0.35);
        --warning-bg: rgba(0, 0, 0, 0.03);
        --warning-border: rgba(0, 0, 0, 0.1);
    }
}

@media (prefers-color-scheme: dark) {
    #loading img,
    body > nav > a > img {
        filter: invert(1);
    }
}

/* ---- Reset ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html,
body {
    height: 100%;
    /* Prevent any element from causing horizontal scroll site-wide */
    overflow-x: hidden;
    max-width: 100%;
}
body {
    background-color: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition:
        background-color 0.2s,
        color 0.2s;
}
/* Make sure images/media can never blow out the viewport */
img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
    height: auto;
}
/* ---- Nav ---- */
nav {
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    padding: 14px 28px;
    z-index: 100;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
}
.nav-brand-dot {
    width: 10px;
    height: 10px;
    background: #555;
    border-radius: 50%;
}
.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 20px;
}
.nav-link {
    color: var(--nav-link);
    text-decoration: none;
    font-size: 14px;
}
.nav-icon {
    color: var(--icon-btn);
    font-size: 16px;
}
.btn-terminal {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.btn-terminal:hover {
    background: var(--accent-hover);
}
/* ---- Main wrapper ---- */
main {
    flex: 1;
    padding-top: 60px;
}
/* ---- Footer ---- */
footer {
    /*border-top: 1px solid var(--footer-border);*/
    padding: 28px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Allow footer to wrap on small screens */
    flex-wrap: wrap;
    gap: 16px;
    z-index: 100;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}
.footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.footer-links a,
.footer-links span {
    font-size: 12px;
    color: var(--footer-meta);
    text-decoration: none;
}
.footer-links a:hover {
    color: var(--text-sub);
}
/* ---- Utility ---- */
.section-tag {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--section-tag);
    text-transform: uppercase;
    margin-bottom: 12px;
}
.section-heading {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 14px;
    color: var(--text);
}
.section-body {
    font-size: 14px;
    color: var(--text-sub);
    max-width: 680px;
    line-height: 1.65;
}
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}
.icon-bubble {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #5b21b6, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

/* ============================================================
   MOBILE FIXES — apply to inline-styled grids site-wide
   These selectors target the common inline grid patterns used
   in the page templates so we can fix wrapping without editing
   each HTML file.
   ============================================================ */

/* On narrow screens, collapse any fixed multi-column grid to a
   single column. Using [style*=...] attribute selectors lets these
   rules reach inline-styled grids site-wide. */
@media (max-width: 720px) {
    [style*="grid-template-columns: repeat(4, 1fr)"],
    [style*="grid-template-columns:repeat(4,1fr)"],
    [style*="grid-template-columns: repeat(3, 1fr)"],
    [style*="grid-template-columns:repeat(3,1fr)"],
    [style*="grid-template-columns: repeat(2, 1fr)"],
    [style*="grid-template-columns:repeat(2,1fr)"] {
        grid-template-columns: 1fr !important;
    }

    /* Tighter container padding on phones */
    main > div[style*="max-width"],
    main > .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* Wrap the footer onto its own lines */
    footer {
        align-items: flex-start;
    }
    .footer-links {
        align-items: flex-start;
    }
}

/* Tablet: 4-col grids become 2-col */
@media (min-width: 721px) and (max-width: 960px) {
    [style*="grid-template-columns: repeat(4, 1fr)"],
    [style*="grid-template-columns:repeat(4,1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
