@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

/* Base */
body {
    margin: 0;
    padding: 0;
    background-color: #0a0a0a;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    color: #eaeaea;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.7;
    font-size: 17px;
}

/* Container */
.container {
    max-width: 780px;
    margin: 0 auto;
    padding: 60px 32px 80px;
}

/* Typography */
h1 {
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin-bottom: 0.5em;
    color: #fff;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin-top: 2.5em;
    margin-bottom: 0.8em;
    padding-bottom: 0.4em;
    border-bottom: 1px solid #222;
    color: #fff;
}

h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 2em;
    margin-bottom: 0.6em;
    color: #ddd;
}

h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.5em;
    color: #bbb;
}

p {
    margin: 1.2em 0;
    color: #ccc;
}

.meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 2.5em;
}

/* Links */
a {
    color: #00ff41;
    text-decoration: none;
    transition: all 0.15s ease;
}

a:hover {
    color: #33ff66;
    text-decoration: underline;
}

/* Images */
.container img {
    display: block;
    margin: 32px auto 12px auto;
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid #222;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.container img + em,
.container p > em:only-child {
    display: block;
    text-align: center;
    margin: 0 auto 32px auto;
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 32px 0;
    font-size: 0.9rem;
    background: #0f0f14;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #1a1a2e;
}

th {
    background-color: #0f0f14;
    color: #ffffff;
    text-align: left;
    padding: 14px 16px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    border-bottom: 2px solid #222;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid #1a1a2e;
    color: #aaa;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: #14141e;
}

/* Code blocks */
pre {
    background: #0c0c10;
    padding: 20px 24px;
    border-radius: 8px;
    border: 1px solid #1a1a2e;
    margin: 24px 0;
    overflow-x: auto;
    white-space: pre;
    word-wrap: normal;
}

code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    color: #ddd;
    font-size: 0.85rem;
}

/* Inline code */
p code, li code, td code {
    background: #0f0f14;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #ffffff;
    border: 1px solid #222
}

/* Syntax highlighting */
.highlight .k, .highlight .kt, .highlight .kd { color: #569cd6 !important; }
.highlight .s, .highlight .s2, .highlight .se { color: #ce9178 !important; }
.highlight .c, .highlight .c1 { color: #6a9955 !important; font-style: italic; }
.highlight .nf, .highlight .fm { color: #dcdcaa !important; }
.highlight .mi, .highlight .mh, .highlight .m { color: #b5cea8 !important; }
.highlight .p { color: #d4d4d4 !important; }
.highlight .nc, .highlight .nn { color: #4ec9b0 !important; }

/* Lists */
ul, ol {
    margin: 1.2em 0;
    padding-left: 1.5em;
    color: #bbb;
}

li {
    margin: 0.5em 0;
}

/* Blockquotes */
blockquote {
    margin: 1.5em 0;
    padding: 1em 1.5em;
    border-left: 3px solid #444;
    background: #0f0f14;
    border-radius: 0 8px 8px 0;
    color: #ccc;
    font-style: italic;
}

blockquote p {
    margin: 0;
}

/* Horizontal rule */
hr {
    border: none;
    border-top: 1px solid #222;
    margin: 3em 0;
}

/* Back link */
.back-link {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #1a1a2e;
}

.back-link a {
    color: #666;
    font-size: 0.9rem;
}

.back-link a:hover {
    color: #00ff41;
}

/* Blog index */
.blog-list {
    list-style: none;
    padding: 0;
}

.blog-list li {
    margin: 16px 0;
    padding: 16px 20px;
    background: #0f0f14;
    border: 1px solid #1a1a2e;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.blog-list li:hover {
    border-color: #2a2a4e;
    transform: translateX(4px);
}

.blog-list a {
    color: #eaeaea;
    font-weight: 500;
}

.blog-list a:hover {
    color: #00ff41;
    text-decoration: none;
}

/* Animation */
.section {
    opacity: 0;
    animation: fadeUp 0.5s ease-out forwards;
}

.glossary-term {
    color: #00ff41 !important;
    border-bottom: 1px dashed #00ff41;
    cursor: help;
    font-weight: 500;
}


#glossary-tooltip {
    position: absolute;
    display: none;
    background: #0f0f14;
    color: #ccc;
    padding: 14px;
    border: 1px solid #00ff41;
    border-radius: 4px;
    font-size: 0.85rem;
    max-width: 300px;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    line-height: 1.5;
    pointer-events: none; 
}

#glossary-tooltip strong {
    color: #00ff41;
    display: block;
    margin-bottom: 6px;
    border-bottom: 1px solid #222;
    padding-bottom: 4px;
}


@keyframes fadeUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (hover: none) {
    .glossary-term {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
}

@media (hover: none) {
    #glossary-tooltip {
        position: fixed;
        left: 16px !important;
        right: 16px;
        bottom: 16px;
        top: auto !important;
        max-width: calc(100vw - 32px);
    }
}


/* Responsive */
@media (max-width: 600px) {
    body {
        font-size: 16px;
    }
    
    .container {
        padding: 40px 20px 60px;
    }
    
    h1 {
        font-size: 1.7rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    pre {
        padding: 16px;
        font-size: 0.8rem;
    }
    
    table {
        font-size: 0.8rem;
    }
    
    th, td {
        padding: 10px 12px;
    }
}