:root {
    --primary-color: #333333;
    --secondary-color: #666666;
    /* --text-primary: #2F2722;
    --text-secondary: #2F2722; */
    --text-primary: #003b16;
    /* --text-primary: #002e59; */
    --text-secondary: #2F2722;
    --text-light: #999999;
    --background: #F8F5F0;
    --surface: #EFE8DE;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Source Serif 4', serif;
    font-size: 1rem;
    font-weight: 400;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    position: relative;
}

body strong {
    font-weight: 600;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 25% 25%, rgba(0, 0, 0, 0.01) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(0, 0, 0, 0.005) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: var(--background);
    /* background: var(--surface); */
    /* border-bottom: 1px solid rgba(47, 39, 34, 0.1); */
    z-index: 100;
}

.nav-logo {
    text-decoration: none;
}

.nav-logo img {
    height: 55px;
    width: auto;
    display: block;
}

.nav-logo h1 {
    /* font-family: 'IBM Plex Mono', monospace, sans-serif; */
    font-family: 'Lexend', sans-serif;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--primary-color);
    letter-spacing: -0.01em;
    text-transform: uppercase;
    text-decoration: none !important;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    font-family: 'Lexend', sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.04em;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    text-transform: none;
    transition: opacity 0.2s ease;
}

.nav-links a:hover {
    opacity: 0.5;
}

.nav-links a.nav-active {
    font-weight: 500;
}

.nav-links a.nav-emph {
    font-weight: 500;
    padding: 0.4rem 1rem;
    background: var(--text-primary);
    color: var(--background);
    transition: opacity 0.2s ease;
    border-radius: 4px;
}

.nav-links a.nav-emph:hover {
    opacity: 0.75;
}

/* Layout */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 6rem 2rem 2rem;
    position: relative;
    z-index: 2;
}

.content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.logo {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--primary-color);
    letter-spacing: -0.01em;
    text-align: center;
    white-space: nowrap;
}

.tagline {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    letter-spacing: 0.01em;
    max-width: 700px;
    line-height: 1.6;
    text-align: center;
}

.hero-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.hero-logo img {
    height: 120px;
    width: auto;
}

.launch-post {
    width: 100%;
    text-align: left;
    margin: 2rem 0;
    padding: 0 2rem;
}

.launch-post a {
    color: #c5a354;
    text-decoration: underline;
}

.launch-post h1 {
    font-family: 'Lexend', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.launch-post h2 {
    font-family: 'Lexend', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.launch-post p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.launch-post ul,
.launch-post ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.launch-post li {
    margin-bottom: 0.5rem;
}

.launch-post h3 {
    font-family: 'Lexend', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.launch-post h4 {
    font-family: 'Lexend', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.launch-post pre {
    background: var(--surface);
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin-bottom: 1.25rem;
    border-radius: 6px;
    line-height: 1.6;
}

.launch-post pre,
.launch-post code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.82rem;
}

.launch-post p code,
.launch-post li code {
    background: var(--surface);
    padding: 0.1em 0.35em;
    border-radius: 3px;
}

.launch-post pre code {
    background: none;
    padding: 0;
}

.tldr-box {
    background: var(--surface);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 10px;
}

.tldr-box > strong {
    display: block;
    margin-bottom: 0.75rem;
    font-family: 'Lexend', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
}

.tldr-box ul {
    padding-left: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
}

.tldr-box li {
    margin-bottom: 0.5rem;
}


.post-image {
    margin: 1.25rem 0;
}

.post-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

.post-image-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.post-image-pair img {
    width: 100%;
    height: auto;
    display: block;
}

.post-image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.post-image-grid img {
    max-width: 100%;
    height: auto;
    display: block;
}

.table-wrapper {
    overflow-x: auto;
    margin-bottom: 1.25rem;
}

.launch-post table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.82rem;
    white-space: nowrap;
}

.launch-post th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    border-bottom: 2px solid rgba(47, 39, 34, 0.15);
    font-family: 'Lexend', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
}

.launch-post td {
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid rgba(47, 39, 34, 0.08);
    color: var(--text-secondary);
}

.launch-post tr:last-child td {
    border-bottom: none;
}

.post-footnote {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(47, 39, 34, 0.1);
}

.contact-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    font-family: 'Lexend', sans-serif;
}

.contact {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.875rem 1.5rem;
    /* background: var(--surface); */
    background: var(--background);
    transition: all 0.3s ease;
    position: relative;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--text-primary);
    border-radius: 7px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: -1;
}

.contact:hover {
    color: var(--surface);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--text-primary);
}

.contact:hover::before {
    opacity: 1;
}

.email-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.contact:hover .email-icon {
    transform: scale(1.1);
}

/* Latest Updates */
.updates-section {
    width: 100%;
    padding: 1.5rem 2rem;
    background: var(--surface);
    margin-bottom: 2rem;
    border-radius: 10px;
}

.updates-title {
    font-family: 'Lexend', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.updates-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.update-item {
    display: flex;
    gap: 1.5rem;
    align-items: baseline;
    font-size: 0.9rem;
}

.update-date {
    font-family: 'Lexend', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-light);
    white-space: nowrap;
    min-width: 5rem;
}

.update-text {
    color: var(--text-secondary);
    line-height: 1.5;
}

.update-text a {
    color: #c5a354;
    text-decoration: underline;
}

/* Blog index */
.blog-index {
    width: 100%;
    padding: 0 2rem;
}

.blog-index-title {
    font-family: 'Lexend', sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2.5rem;
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.post-item {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem 0;
    border-top: 1px solid rgba(47, 39, 34, 0.12);
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.post-item-text {
    flex: 1;
    min-width: 0;
}

.post-item-image {
    flex-shrink: 0;
    width: 180px;
}

.post-item-image img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.post-item:last-child {
    border-bottom: 1px solid rgba(47, 39, 34, 0.12);
}

.post-item:hover {
    opacity: 0.7;
}

.post-meta {
    margin-bottom: 0.5rem;
}

.post-date {
    font-family: 'Lexend', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-light);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.post-item .post-title {
    font-family: 'Lexend', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.post-excerpt {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Blog post */
.post-header {
    width: 100%;
    padding: 0 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.back-link {
    font-family: 'Lexend', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-secondary);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.back-link:hover {
    opacity: 0.6;
}

.post-header-meta .post-date {
    font-family: 'Lexend', sans-serif;
    font-size: 0.8rem;
    color: var(--text-light);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* TOC Sidebar */
.toc-sidebar {
    position: fixed;
    left: max(1rem, calc(50vw - 670px));
    top: 80px;
    width: 200px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding: 0.75rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.12) transparent;
}

.toc-sidebar::-webkit-scrollbar {
    width: 3px;
}

.toc-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.toc-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 2px;
}

.toc-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.22);
}

.toc-label {
    font-family: 'Lexend', sans-serif;
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    padding: 0 0.75rem;
}

.toc-link {
    display: block;
    font-family: 'Lexend', sans-serif;
    font-size: 0.78rem;
    color: var(--text-light);
    text-decoration: none;
    padding: 0.2rem 0.75rem;
    border-left: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
    line-height: 1.4;
}

.toc-link:hover {
    color: var(--text-secondary);
}

.toc-link.toc-active {
    color: var(--text-primary);
    border-left-color: var(--text-primary);
    font-weight: 500;
}

.toc-link[data-level="1"] { padding-left: 0.75rem; }
.toc-link[data-level="2"] { padding-left: 0.75rem; }
.toc-link[data-level="3"] { padding-left: 1.25rem; font-size: 0.74rem; }
.toc-link[data-level="4"] { padding-left: 1.75rem; font-size: 0.72rem; }
.toc-link[data-level="5"] { padding-left: 2.25rem; font-size: 0.7rem; }

.site-footer {
    margin-top: 4rem;
}

footer {
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: 2rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Lexend', sans-serif;
    font-size: 0.875rem;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--text-primary);
}

.footer-link svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

@media (max-width: 1200px) {
    .toc-sidebar {
        display: none;
    }
}

@media (max-width: 640px) {
    .post-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .post-item-image {
        width: 100%;
    }

    .post-item-image img {
        height: 180px;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
    }

    .nav-links {
        gap: 1.25rem;
    }

    .container {
        padding: 5rem 1rem 2rem;
    }

    .tagline {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .nav-links {
        gap: 1rem;
        font-size: 0.8rem;
    }

    .tagline {
        font-size: 1rem;
    }
}