/* ========================================================================
   Bartmoss Website — Main Stylesheet
   ======================================================================== */

/* --- Fonts --- */

@font-face {
    font-family: 'JetBrains Mono';
    src: url('/static/fonts/jetbrains-mono/ttf/JetBrainsMono-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('/static/fonts/jetbrains-mono/ttf/JetBrainsMono-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* --- Reset & Base --- */

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

body {
    background-color: #0d0804;
    color: #e0e0e0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    line-height: 1.8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #fbbe51;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Navbar --- */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    border-bottom: 1px solid #ffffff1a;
}

.navbar-brand {
    color: #fbbe51;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 3px;
    text-decoration: none;
}

.navbar-brand:hover {
    text-decoration: none;
    opacity: 0.85;
}

.navbar-logo {
    height: 25px;
    width: auto;
    display: block;
}

.navbar-links {
    display: flex;
    gap: 32px;
}

.navbar-links a {
    color: #888;
    font-size: 13px;
    letter-spacing: 2px;
    text-decoration: none;
    transition: color 0.2s;
}

.navbar-links a:hover {
    color: #fbbe51;
    text-decoration: none;
}

/* --- Content Area --- */

.content {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 40px 80px 40px;
}

/* --- Footer --- */

.footer {
    border-top: 1px solid #ffffff1a;
    padding: 24px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.footer-logo {
    height: 25px;
    width: auto;
    opacity: 0.7;
}

.accelerate-logo {
    height: 25px;
    width: auto;
    opacity: 0.7;
    margin-top: 20px;
}

.x-logo {
    height: 25px;
    width: auto;
    opacity: 0.7;
    margin-top: 30px;
}

/* --- Home Page --- */

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0 20px 0;
}

.logo {
    width: 270px;
    height: auto;
}

.tagline {
    font-size: 20px;
    text-align: center;
    color: #c1c1c1;
    margin-top: 20px;
}

.home-section {
    margin-top: 60px;
}

.section-heading {
    font-size: 22px;
    text-align: center;
    margin-bottom: 8px;
}

.section-heading a {
    color: #ffffff;
    text-decoration: none;
}

.section-heading a:hover {
    color: #fbbe51;
}

.section-description {
    text-align: center;
    color: #666;
    font-size: 13px;
    margin-bottom: 24px;
}

.item-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 35px;
}

.list-item {
    font-size: 15px;
    color: #fbbe51;
    text-decoration: none;
}

.list-item:hover {
    text-decoration: underline;
}

.section-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: #666;
}

.section-link:hover {
    color: #fbbe51;
}

/* --- Listing Pages (Library, Journal, Analytics) --- */

.page-header {
    margin-bottom: 48px;
}

.page-title {
    font-size: 28px;
    color: #ffffff;
    margin-bottom: 8px;
}

.page-description {
    color: #666;
    font-size: 14px;
}

.listing-page {
    align-items: stretch;
    gap: 0;
}

.list-item-card {
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    border-bottom: 1px solid #ffffff0d;
    text-decoration: none;
    transition: padding-left 0.15s, background 0.15s;
}

.list-item-card:first-child {
    border-top: 1px solid #ffffff0d;
}

.list-item-card:hover {
    text-decoration: none;
    background: #ffffff05;
    padding-left: 12px;
}

.item-title {
    color: #fbbe51;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.item-description {
    color: #888;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 4px;
}

.item-date {
    color: #555;
    font-size: 12px;
}

/* --- Article Page --- */

.article {
    max-width: 800px;
}

.article-header {
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid #ffffff1a;
}

.article-title {
    font-size: 28px;
    color: #ffffff;
    margin-bottom: 8px;
    line-height: 1.3;
}

.article-date {
    color: #666;
    font-size: 13px;
    margin-bottom: 8px;
}

.article-description {
    color: #888;
    font-size: 14px;
    font-style: italic;
}

/* --- Article Content (rendered markdown) --- */

.article-content h1 {
    font-size: 26px;
    color: #ffffff;
    margin: 48px 0 16px 0;
}

.article-content h2 {
    font-size: 22px;
    color: #ffffff;
    margin: 40px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #ffffff1a;
}

.article-content h3 {
    font-size: 18px;
    color: #e0e0e0;
    margin: 32px 0 10px 0;
}

.article-content h4 {
    font-size: 16px;
    color: #ccc;
    margin: 24px 0 8px 0;
}

.article-content p {
    margin-bottom: 16px;
}

.article-content ul,
.article-content ol {
    margin: 12px 0 16px 24px;
}

.article-content li {
    margin-bottom: 6px;
}

.article-content strong {
    color: #ffffff;
}

.article-content em {
    color: #ccc;
}

/* Code blocks */
.article-content pre {
    background: #1a1612;
    border: 1px solid #ffffff1a;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 16px 0;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.5;
}

.article-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: 14px;
    color: #e0e0e0;
}

/* Inline code */
.article-content code {
    background: #1a1612;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    color: #fbbe51;
}

/* Tables */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.article-content th {
    text-align: left;
    padding: 10px 14px;
    background: #1a1612;
    border: 1px solid #ffffff1a;
    color: #ffffff;
    font-weight: 700;
}

.article-content td {
    padding: 8px 14px;
    border: 1px solid #ffffff0d;
}

/* Blockquotes */
.article-content blockquote {
    border-left: 4px solid #ffffff4d;
    background: #ffffff0a;
    padding: 12px 20px;
    margin: 16px 0;
    border-radius: 0 8px 8px 0;
}

.article-content blockquote p {
    margin-bottom: 8px;
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

.article-content blockquote strong {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

/* Styled blockquotes */
.article-content .blockquote-note {
    border-left-color: #4a9eff;
    background: rgba(74, 158, 255, 0.1);
}

.article-content .blockquote-note strong {
    color: #4a9eff;
}

.article-content .blockquote-warning {
    border-left-color: #ffa500;
    background: rgba(255, 165, 0, 0.1);
}

.article-content .blockquote-warning strong {
    color: #ffa500;
}

.article-content .blockquote-example {
    border-left-color: #9b59b6;
    background: rgba(155, 89, 182, 0.1);
}

.article-content .blockquote-example strong {
    color: #9b59b6;
}

.article-content .blockquote-important {
    border-left-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.article-content .blockquote-important strong {
    color: #e74c3c;
}

.article-content .blockquote-tip {
    border-left-color: #fbbe51;
    background: rgba(251, 190, 81, 0.1);
}

.article-content .blockquote-tip strong {
    color: #fbbe51;
}

/* MathJax */
.article-content .mjx-chtml {
    font-size: 120%;
    color: #e8e8e8;
}

.article-content .math.display .mjx-chtml {
    font-size: 130%;
}

.article-content .mjx-container {
    margin: 0.5em 0;
}

.article-content .math.display {
    display: block;
    text-align: center;
    margin: 1em 0;
    overflow-x: auto;
    padding: 0.5em;
}

.article-content .math.inline {
    display: inline-block;
}

/* TikZ diagrams */
.article-content .tikz-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    padding: 20px;
    background: #ffffff0a;
    border-radius: 8px;
}

/* Horizontal rule */
.article-content hr {
    border: none;
    border-top: 1px solid #ffffff1a;
    margin: 40px auto;
    width: 30%;
}

/* Images */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* --- Responsive --- */

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 12px;
        padding: 16px 20px;
    }

    .navbar-links {
        gap: 20px;
    }

    .content {
        padding: 20px 20px 60px 20px;
    }

    .logo {
        width: 200px;
    }

    .page-title {
        font-size: 22px;
    }

    .article-title {
        font-size: 22px;
    }

    .article-content pre {
        font-size: 12px;
    }

    .article-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 12px;
    }

    .article-content th,
    .article-content td {
        padding: 6px 8px;
    }
}
