/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
    font-size: 16px;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header and Navigation */
header {
    padding: 3rem 0 2rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 3rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.header-left {
    flex: 1;
}

.site-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #595959;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.site-subtitle {
    font-size: 1.1rem;
    color: #666;
    font-weight: 300;
    margin-bottom: 0;
}

/* Navigation */
.nav {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 0.5rem;
}

.nav-link {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: #595959;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #007acc;
    transition: width 0.2s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Main content */
main {
    min-height: calc(100vh - 200px);
    padding-bottom: 3rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: #595959;
    margin-bottom: 1rem;
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1.5rem;
    color: #555;
}

/* Links */
a {
    color: #007acc;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #0056b3;
}

/* Lists */
ul, ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    color: #555;
}

/* Remove default list styles for nav */
.nav {
    list-style: none;
    padding: 0;
}

.nav li {
    margin: 0;
}

/* Content sections */
.content {
    font-size: 1.1rem;
    line-height: 1.7;
}

.section {
    margin-bottom: 3rem;
}

/* Bio page specific styles */
.bio-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.bio-content h1 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    color: #595959;
}

/* Date styling */
.date {
    color: #999;
    font-size: 0.9rem;
    font-weight: 400;
}

/* Blog post list styling */
.section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.section ul li {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    line-height: 1.4;
}

.section ul li a {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}

.section ul li a:hover {
    color: #595959;
}

.section ul li a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #007acc;
    transition: width 0.2s ease;
}

.section ul li a:hover::after {
    width: 100%;
}

/* Images in content */
.content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Code blocks */
pre {
    background-color: #2f384d;
    border: 1px solid #4a5568;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #e2e8f0;
}

code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.9rem;
    background-color: #f0f0f0;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: #333;
}

/* Inline code within pre blocks */
pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
}

.code-block {
    min-width: 0;
    max-width: 100%;
    margin: 1.5rem 0;
    border: 1px solid #4a5568;
    border-radius: 8px;
    background-color: #1e1e2e;
}

.code-block-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.625rem;
    min-height: 2.75rem;
    padding: 0.25rem 0.5rem 0.25rem 1rem;
    border-bottom: 1px solid #45475a;
    border-radius: 7px 7px 0 0;
    background-color: #272733;
    color: #cdd6f4;
    font-size: 0.75rem;
    line-height: 1.4;
    letter-spacing: 0;
}

.code-language {
    min-width: 0;
    max-width: 50%;
    overflow-wrap: anywhere;
}

.code-copy-status {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.code-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.25rem;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.code-copy:hover {
    background-color: #45475a;
}

.code-copy:focus-visible {
    outline: 2px solid #89b4fa;
    outline-offset: 2px;
}

/* Lucide 0.468.0 icons; see icons/LICENSE-lucide.txt. */
.code-copy-icon {
    width: 1rem;
    height: 1rem;
    background-color: currentColor;
    -webkit-mask: url('icons/copy.svg') center / contain no-repeat;
    mask: url('icons/copy.svg') center / contain no-repeat;
}

.code-copy[data-state='copied'] .code-copy-icon {
    -webkit-mask-image: url('icons/check.svg');
    mask-image: url('icons/check.svg');
}

.code-block pre {
    margin: 0;
    border: 0;
    border-radius: 0 0 7px 7px;
}

.code-block > .compiler-listing {
    margin: 0;
    border: 0;
    border-radius: 0 0 7px 7px;
}

.compiler-listing-title + .code-block {
    margin-top: 0;
}

@media (pointer: coarse) {
    .code-copy {
        flex-basis: 2.75rem;
        width: 2.75rem;
        height: 2.75rem;
    }
}

/* Keep complete compiler listings visible without stretching the article. */
.compiler-listing-title {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.compiler-listing {
    max-height: min(32rem, 65vh);
    overflow: auto;
    scrollbar-gutter: stable;
    margin-bottom: 1.5rem;
    border: 1px solid #4a5568;
    border-radius: 8px;
    background-color: #2f384d;
}

.compiler-listing:focus-visible {
    outline: 3px solid #007acc;
    outline-offset: 3px;
}

.compiler-listing pre {
    width: max-content;
    min-width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    overflow: visible;
}

@media print {
    .code-copy,
    .code-copy-status {
        display: none;
    }

    .code-block-tools {
        background: none;
        color: #333;
    }

    .code-block pre {
        width: auto;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        overflow: visible;
    }

    .compiler-listing {
        max-height: none;
        overflow: visible;
    }

    .compiler-listing pre {
        width: auto;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
    }
}

/* Basic syntax highlighting for Ruby comments */
.comment {
    color: #87ceeb;
    font-style: italic;
}

.ruby-comment {
    color: #87ceeb;
}

/* Footer */
footer {
    border-top: 1px solid #eee;
    padding: 2rem 0;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.social-links a {
    color: #666;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover {
    color: #007acc;
    transform: translateY(-2px);
}

.social-links svg {
    width: 20px;
    height: 20px;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .header-content {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        text-align: center;
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.7rem;
    }
    
    .nav {
        gap: 1.5rem;
        margin-top: 0;
        justify-content: center;
        width: 100%;
    }
    
    header {
        padding: 2rem 0 1.5rem;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.8rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    /* Code blocks on mobile */
    pre {
        padding: 1rem;
        font-size: 0.8rem;
        margin: 1rem 0;
    }
}
