/* =============================================
   LIQUID GLASS GLASSMORPHISM - Articles CSS
   ============================================= */

/* =============================================
   CSS VARIABLES & GLASS TOKENS
   ============================================= */

:root {
    --glass-bg: var(--glass-bg);
    --glass-bg-hover: rgba(168, 255, 62, 0.08);
    --glass-border: rgba(148, 163, 184, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.7);
    --glass-blur: 0px;
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --glass-shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.5);
    --glass-glow: 0 0 60px rgba(168, 255, 62, 0.05);
    --liquid-transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    --shimmer-color: rgba(168, 255, 62, 0.08);
}

/* =============================================
   LAYOUT & CONTAINER
   ============================================= */

.articles-container {
    width: 100%;
    margin: 0 auto;
    padding: 0;
}
.article-col {
    max-width: 850px;
    margin: 0 auto;
    padding: 0 0 3rem;
}



/* =============================================
   ARTICLE HEADER
   ============================================= */

.article-header {
    margin-bottom: 2.5rem;
    padding: 2rem;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.article-tag {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.62rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(168, 255, 62, 0.08);
    border: 1px solid rgba(168, 255, 62, 0.25);
    padding: 5px 14px;
    border-radius: 50px;
    box-shadow: none;
}

.article-date {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
    background: rgba(148, 163, 184, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.15);
    padding: 5px 14px;
    border-radius: 50px;
}

.article-title {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    color: var(--accent-color);
    margin: 0 0 0.5rem 0;
    letter-spacing: 0.5px;
    line-height: 1.2;
    text-transform: none;
    position: relative;
    z-index: 1;
}

.article-subtitle {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-size: 1rem;
    color: var(--dim-text);
    margin: 0;
    font-style: italic;
    position: relative;
    z-index: 1;
}

/* =============================================
   ARTICLE GRID & CARDS - LIQUID GLASS
   ============================================= */

.articles-grid, .writeups-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
}
.articles-grid {
    width: 70%;
    margin: 0 auto;
}
.article-card, .writeup-card {
    display: block;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    padding: 1.5rem 2rem;
    cursor: pointer;
    box-shadow: var(--glass-shadow);
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden;
    transition: var(--liquid-transition);
}
.article-card:hover, .writeup-card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--glass-shadow-hover), var(--glass-glow);
}

.article-card-body, .writeup-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    position: relative;
    z-index: 2;
}

.article-card-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.article-card-title, .writeup-card-title {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif !important;
    font-size: 1.45rem !important;
    color: var(--accent-color) !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    text-shadow: 0 2px 20px rgba(255, 255, 255, 0.05);
}

.article-card-desc, .writeup-card-desc {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif !important;
    font-size: 1rem !important;
    color: var(--dim-text) !important;
    margin: 0 !important;
    line-height: 1.6 !important;
}

.article-date, .writeup-date {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif !important;
    font-size: 0.75rem !important;
    color: rgba(255, 255, 255, 0.8) !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    background: rgba(148, 163, 184, 0.05) !important;
    border: 1px solid rgba(148, 163, 184, 0.15) !important;
    padding: 6px 14px !important;
    border-radius: 50px !important;
    backdrop-filter: none !important;
}

/* Hide legacy elements */
.article-card-thumb, .writeup-card-thumb, .article-card-arrow {
    display: none !important;
}

/* =============================================
   ARTICLE CONTENT - GLASS PANELS
   ============================================= */

.article-content {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    color: var(--text-color);
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}
.article-content h1,
.article-content h2,
.article-content h3 {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.article-content h1 {
    font-size: 2.2rem;
    color: #ffffff;
    padding: 1rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--accent-color);
    border-radius: 0 16px 16px 0;
    letter-spacing: 2px;
}

.article-content h2 {
    font-size: 1.5rem;
    color: var(--accent-color);
    padding-bottom: 0.5rem;
    margin-top: 3rem;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--glass-border);
}

.article-content h3 {
    font-size: 1.3rem;
    color: #e0e0e0;
    margin-top: 2rem;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.article-content p,
.article-content li {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-color);
    text-align: justify;
}

.article-content a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    padding-bottom: 2px;
}

.article-content a:hover {
    border-bottom-color: var(--accent-color);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

/* =============================================
   CODE BLOCKS & SYNTAX HIGHLIGHTING (Cyberpunk Neon)
   ============================================= */

.article-content pre.code {
    background: transparent; /* Background handled by window */
    border: none; /* Border handled by window */
    border-radius: 0;
    padding: 1rem;
    margin: 0;
    overflow-x: auto;
}

.article-content code {
    font-family: 'Cascadia Code', 'SFMono-Regular', Consolas, monospace;
    font-size: 0.92em;
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.article-content pre.code code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 0.95em;
    border: none;
}

/* PrismJS Syntax Highlighting Tokens */
code[class*="language-"],
pre[class*="language-"] {
    color: #e0e0e0;
    text-shadow: none;
    font-family: 'Cascadia Code', 'SFMono-Regular', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    direction: ltr;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    line-height: 1.5;
    tab-size: 4;
    hyphens: none;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #5c6370; /* Grey */
    font-style: italic;
}

.token.punctuation {
    color: #abb2bf; /* Light Grey */
}

.token.namespace {
    opacity: .7;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: #d19a66; /* Orange */
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #98c379; /* Green */
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #56b6c2; /* Cyan */
}

.token.atrule,
.token.attr-value,
.token.keyword {
    color: #c678dd; /* Purple */
}

.token.function,
.token.class-name {
    color: #61afef; /* Blue */
}

.token.regex,
.token.important,
.token.variable {
    color: #e06c75; /* Red */
}
.article-content pre:not(.code) {
    background: rgba(5, 5, 5, 0.6);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-left: 3px solid var(--accent-color);
    border-radius: 0 16px 16px 0;
    padding: 1rem 1.2rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    box-shadow: var(--glass-shadow);
}

.article-content pre:not(.code) code {
    background: none;
    padding: 0;
    color: #e0e0e0;
    border: none;
}

/* Syntax Highlighting */
code[class*="language-"],
pre[class*="language-"] {
    color: #e0e0e0;
    text-shadow: none;
    font-family: 'Cascadia Code', 'SFMono-Regular', Consolas, Monaco, monospace;
    direction: ltr;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    line-height: 1.5;
    tab-size: 4;
    hyphens: none;
}

.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #5c6370; font-style: italic; }
.token.punctuation { color: #abb2bf; }
.token.namespace { opacity: .7; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted { color: #d19a66; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #98c379; }
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #56b6c2; }
.token.atrule, .token.attr-value, .token.keyword { color: #c678dd; }
.token.function, .token.class-name { color: #61afef; }
.token.regex, .token.important, .token.variable { color: #e06c75; }

/* =============================================
   IMAGES - GLASS FRAME
   ============================================= */

.article-content figure {
    margin: 2rem 0;
    text-align: center;
}

.article-content img {
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    transition: var(--liquid-transition);
}

/* =============================================
   BLOCKQUOTE - LIQUID GLASS CALLOUT
   ============================================= */

.article-content blockquote {
    margin: 1.5rem 0;
    padding: 1.5rem 1.8rem;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--accent-color);
    border-radius: 0 20px 20px 0;
    box-shadow: var(--glass-shadow);
    position: relative;
    overflow: hidden;
}

.article-content blockquote p {
    text-align: left;
    color: var(--dim-text);
    font-style: italic;
    margin: 0.4rem 0;
    position: relative;
    z-index: 1;
}

.article-content blockquote p:first-child {
    color: var(--text-color);
    font-style: normal;
    font-weight: 600;
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* =============================================
   HR - GLASS DIVIDER
   ============================================= */

.article-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--glass-border),
        rgba(255, 255, 255, 0.3),
        var(--glass-border),
        transparent
    );
    margin: 3rem 0;
    position: relative;
}

.article-content hr::after {
    content: '◇';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-color, #000);
    padding: 0 1rem;
    color: var(--glass-border);
    font-size: 0.8rem;
}

/* =============================================
   LINK INTEGRATIONS - GLASS CHIP
   ============================================= */

.article-content .link-integration {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 12px 24px;
    margin: 1.5rem 0;
    transition: var(--liquid-transition);
    text-decoration: none;
    max-width: 100%;
    box-sizing: border-box;
}

.article-content .link-integration:hover {
    border-color: var(--glass-border-hover);
    background: var(--glass-bg-hover);
    transform: translateX(5px);
    box-shadow: var(--glass-shadow);
}

.article-content .link-integration .site-favicon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    filter: grayscale(0%);
    flex-shrink: 0;
}

.article-content .link-integration a {
    color: var(--text-color);
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border-bottom: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-content .link-integration:hover a {
    color: var(--accent-color);
}

/* =============================================
   REFERENCES - GLASS GRID
   ============================================= */

.article-refs {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.article-refs-title {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-size: 1.2rem;
    color: var(--accent-color);
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.refs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.ref-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--liquid-transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.ref-card:hover {
    border-color: var(--glass-border-hover);
    background: var(--glass-bg-hover);
    transform: translateY(-3px);
}

.ref-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.7rem;
    color: var(--dim-text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ref-card-header img {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.ref-card:hover .ref-card-header img {
    filter: grayscale(0%);
    opacity: 1;
}

.ref-card-title {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
    transition: color 0.3s ease;
}

.ref-card:hover .ref-card-title {
    color: var(--accent-color);
}

/* =============================================
   MODAL / LIGHTBOX - GLASS OVERLAY
   ============================================= */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    cursor: zoom-out;
}

.modal-content {
    margin: auto;
    display: block;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    width: fit-content;
    max-width: 95%;
    max-height: 95vh;
}

.modal-image {
    display: block;
    max-width: 100%;
    max-height: 95vh;
    width: auto;
    height: auto;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8), var(--glass-glow);
    animation: zoomIn 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes zoomIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--accent-color);
    padding: 15px;
    cursor: pointer;
    z-index: 1001;
    transition: var(--liquid-transition);
    user-select: none;
}

.modal-nav:hover {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

.modal-nav-prev { left: 5vw; }
.modal-nav-next { right: 5vw; }

/* =============================================
   WRITEUPS CONTENT (Shared Styles)
   ============================================= */

.writeups-container {
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

.writeups-title {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-size: 2.5rem;
    color: var(--accent-color);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: 2px;
    padding: 1.5rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    box-shadow: var(--glass-shadow);
}

.writeup-content {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    color: var(--text-color);
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

.writeup-content .page-title {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-size: 2.5rem;
    color: var(--accent-color);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

.writeup-content h1,
.writeup-content h2,
.writeup-content h3 {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.writeup-content h1 {
    font-size: 2.2rem;
    color: #ffffff;
    padding: 1rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--accent-color);
    border-radius: 0 16px 16px 0;
    text-transform: none;
    letter-spacing: 2px;
}

.writeup-content h2 {
    font-size: 1.5rem;
    color: var(--accent-color);
    padding-bottom: 0.5rem;
    margin-top: 3rem;
    letter-spacing: 1px;
    text-transform: none;
    border-bottom: 1px solid var(--glass-border);
}

.writeup-content h3 {
    font-size: 1.3rem;
    color: #e0e0e0;
    margin-top: 2rem;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.writeup-content p, .writeup-content li {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-color);
}

.writeup-content a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.writeup-content a:hover {
    border-bottom-color: var(--accent-color);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.writeup-content code {
    font-family: 'Cascadia Code', 'SFMono-Regular', Consolas, monospace;
    font-size: 0.92em;
    background: var(--glass-bg);
    backdrop-filter: none;
    color: var(--accent-color);
    padding: 0.25em 0.5em;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.writeup-content pre.code {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 1rem;
    margin: 0;
    overflow-x: auto;
}

.writeup-content pre.code code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 0.95em;
    border: none;
}

/* Image & Figure */
.writeup-content figure.image {
    margin: 2rem 0;
    text-align: left;
    background: transparent;
    border: none;
    padding: 0;
    display: block;
    max-width: 100%;
}

.writeup-content img {
    max-width: 100%;
    max-height: 50vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    margin: 0;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    transition: var(--liquid-transition);
    cursor: zoom-in;
}

.writeup-content img:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--glass-shadow-hover);
    transform: scale(1.01);
}

.writeup-content figcaption {
    font-size: 0.8rem;
    color: var(--dim-text);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Link Integrations */
.writeup-content .link-integration {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 12px 24px;
    margin: 1.5rem 0;
    transition: var(--liquid-transition);
    text-decoration: none;
    max-width: 100%;
    box-sizing: border-box;
}

.writeup-content .link-integration:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    transform: translateX(5px);
    box-shadow: var(--glass-shadow);
}

.writeup-content .link-integration .site-favicon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    filter: grayscale(0%);
    transition: filter 0.2s;
}

.writeup-content .link-integration a {
    color: var(--text-color);
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    border-bottom: none;
}

.writeup-content .link-integration:hover a {
    color: var(--accent-color);
}

/* =============================================
   MOBILE RESPONSIVENESS
   ============================================= */

@media (max-width: 768px) {
    :root {
        --glass-blur: 0px;
    }

    .article-col { 
        max-width: 100%;
    }

    .article-header {
        padding: 2rem 1rem;
        border-radius: 0;
        text-align: center;
        background: none;
        border-bottom: 1px solid var(--glass-border);
        margin-bottom: 2rem;
    }

    .article-meta {
        justify-content: center;
        margin-bottom: 1.5rem;
    }

    .article-title { 
        font-size: 1.8rem;
        margin: 0 auto;
        line-height: 1.2;
    }

    .article-subtitle {
        font-size: 1rem;
        margin-top: 0.8rem;
    }

    .article-content p,
    .article-content li { 
        font-size: 0.95rem; 
        line-height: 1.6;
        text-align: justify; 
    }

    .article-content h1,
    .article-content h2 { 
        text-align: center;
        width: 100%;
        padding: 0;
        background: none;
        border: none;
        margin-top: 2.5rem;
    }

    .article-content h1 { 
        font-size: 1.6rem; 
        color: #ffffff;
    }

    .article-content h2 { 
        font-size: 1.4rem;
        color: var(--accent-color);
        border-top: 1px solid var(--glass-border);
        padding-top: 2rem;
    }

    .article-content h3 { font-size: 1.1rem; }

    .article-content img { 
        max-height: 50vh;
        border-radius: 8px;
        width: 100%;
        object-fit: cover;
    }

    .article-card, .writeup-card {
        padding: 1.2rem 1.5rem;
        border-radius: 16px;
    }

    .article-card-title, .writeup-card-title {
        font-size: 1.2rem !important;
    }

    .article-content pre.code { padding: 0.8rem; font-size: 0.8rem; }

    .back-link { 
        font-size: 0.9rem; 
        margin-bottom: 1rem;
        padding: 8px 14px;
    }

    .code-window {
        border-radius: 12px;
        margin: 1rem 0;
    }

    .writeups-title {
        font-size: 1.6rem;
        padding: 1rem 1.5rem;
        border-radius: 16px;
    }

    .writeups-grid {
        gap: 1rem;
    }

    .writeup-card {
        padding: 1rem;
        min-height: 48px;
    }

    .writeup-content h1 {
        font-size: 1.5rem;
        padding: 0.8rem 1rem;
        border-radius: 0 12px 12px 0;
    }

    .writeup-content h2 { font-size: 1.2rem; }
    .writeup-content h3 { font-size: 1.1rem; }

    .writeup-content p, .writeup-content li {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .writeup-content img {
        max-height: 40vh;
        border-radius: 12px;
    }

    .writeup-content .link-integration {
        padding: 10px 16px;
        gap: 10px;
        margin: 1rem 0;
        border-radius: 30px;
    }

    .writeup-content .link-integration a {
        font-size: 0.95rem;
    }

    .modal-nav {
        display: none !important;
    }

    .modal-image {
        max-width: 95%;
        max-height: 80vh;
        border-radius: 12px;
    }

    .article-content blockquote {
        padding: 1.2rem 1.5rem;
        border-radius: 0 16px 16px 0;
    }

    .article-content blockquote::before {
        font-size: 3rem;
        top: 5px;
        left: 15px;
    }

    .refs-grid {
        grid-template-columns: 1fr;
    }

    .ref-card {
        border-radius: 12px;
    }
}

/* =============================================
   ANIMATION UTILITIES
   ============================================= */

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

.article-card, .writeup-card {
    animation: fadeInUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) backwards;
}

.article-card:nth-child(1) { animation-delay: 0.1s; }
.article-card:nth-child(2) { animation-delay: 0.2s; }
.article-card:nth-child(3) { animation-delay: 0.3s; }
.article-card:nth-child(4) { animation-delay: 0.4s; }
.article-card:nth-child(5) { animation-delay: 0.5s; }
/* =============================================
   ARTICLE TABLE OF CONTENTS (Interactive TOC)
   ============================================= */
.article-layout {
    display: flex;
    gap: 4rem;
    align-items: flex-start;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem;
}

.article-toc {
    position: sticky;
    top: 120px;
    width: 260px;
    flex-shrink: 0;
    display: none; /* Responsive toggle */
    padding: 2rem 1.5rem;
    background: var(--surface-raised);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    z-index: 100;
}

@media (min-width: 1400px) {
    .article-toc {
        display: block;
    }
}

.toc-header {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.65rem;
    color: var(--dim-text);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toc-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toc-link {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.88rem;
    color: var(--dim-text);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    display: block;
    line-height: 1.4;
}

.toc-link:hover {
    color: #FFF;
    transform: translateX(8px);
}

.toc-link::before {
    content: '→';
    margin-right: 8px;
    opacity: 0;
    transition: all 0.3s;
    display: inline-block;
    transform: translateX(-10px);
}

.toc-link:hover::before {
    opacity: 1;
    transform: translateX(0);
    color: var(--accent-color);
}

/* =============================================
   LIGHT MODE — Articles & Writeups Overrides
   ============================================= */

/* Cards */
html[data-theme="light"] .article-card,
html[data-theme="light"] .writeup-card {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(30, 28, 48, 0.1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}
html[data-theme="light"] .article-card:hover,
html[data-theme="light"] .writeup-card:hover {
    border-color: rgba(30, 28, 48, 0.28);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.09);
}

/* Badges */
html[data-theme="light"] .article-date,
html[data-theme="light"] .writeup-date {
    color: rgba(30, 28, 48, 0.6) !important;
    background: rgba(30, 28, 48, 0.05) !important;
    border-color: rgba(30, 28, 48, 0.11) !important;
}

html[data-theme="light"] .article-tag {
    color: rgba(30, 28, 48, 0.72);
    background: rgba(80, 140, 10, 0.07);
    border-color: rgba(80, 140, 10, 0.18);
}

/* Headings with hardcoded colours */
html[data-theme="light"] .article-content h1,
html[data-theme="light"] .writeup-content h1 {
    color: var(--text-color);
}
html[data-theme="light"] .article-content h3,
html[data-theme="light"] .writeup-content h3 {
    color: #3a3858;
}
html[data-theme="light"] .article-content h1 {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(30, 28, 48, 0.08);
}
html[data-theme="light"] .writeup-content h1 {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(30, 28, 48, 0.08);
}
html[data-theme="light"] .article-content h2 {
    border-bottom-color: rgba(30, 28, 48, 0.1);
}

/* TOC hover */
html[data-theme="light"] .toc-link:hover {
    color: var(--text-color);
}
html[data-theme="light"] .article-toc {
    border-color: rgba(30, 28, 48, 0.1);
}
html[data-theme="light"] .toc-header::after {
    background: rgba(30, 28, 48, 0.1);
}

/* Inline code */
html[data-theme="light"] .article-content code,
html[data-theme="light"] .writeup-content code {
    background: rgba(30, 28, 48, 0.07);
    color: #2d2b55;
    border-color: rgba(30, 28, 48, 0.12);
}


/* pre not wrapped in code-window */
html[data-theme="light"] .article-content pre:not(.code) {
    background: rgba(30, 28, 48, 0.04);
    border-color: rgba(30, 28, 48, 0.08);
    border-left-color: var(--accent-color);
}
html[data-theme="light"] .article-content pre:not(.code) code {
    color: var(--text-color);
}

/* Blockquote */
html[data-theme="light"] .article-content blockquote {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(30, 28, 48, 0.08);
    border-left-color: var(--accent-color);
}
html[data-theme="light"] .article-content blockquote p {
    color: var(--dim-text);
}
html[data-theme="light"] .article-content blockquote p:first-child {
    color: var(--text-color);
}

/* Link integrations */
html[data-theme="light"] .article-content .link-integration,
html[data-theme="light"] .writeup-content .link-integration {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(30, 28, 48, 0.1);
}
html[data-theme="light"] .article-content .link-integration:hover,
html[data-theme="light"] .writeup-content .link-integration:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(30, 28, 48, 0.3);
}

/* Reference cards */
html[data-theme="light"] .ref-card {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(30, 28, 48, 0.08);
}
html[data-theme="light"] .ref-card:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(30, 28, 48, 0.22);
}
html[data-theme="light"] .ref-card-header {
    color: var(--dim-text);
}
html[data-theme="light"] .ref-card-title {
    color: var(--text-color);
}

/* Writeups index title banner */
html[data-theme="light"] .writeups-title {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(30, 28, 48, 0.08);
}
