:root {
    --bg-main: #FAFAFA;
    --bg-panel: #FFFFFF;
    --text-main: #111111;
    --text-soft: #242424;
    --text-muted: #5F6875;
    --border-color: rgba(17, 17, 17, 0.08);
    --color-orange: #F47238;
    --color-orange-2: #ff8b5b;
    --color-slate: #6D7C8E;
    --color-beige: #E2C7B8;
    --color-dark: #0B1320;
    --shadow-soft: 0 18px 45px rgba(12, 18, 28, 0.08);
    --font-main: 'Inter', sans-serif;
    --radius-lg: 22px;
    --radius-md: 16px;
    --transition: all .28s cubic-bezier(.25, .8, .25, 1);
}

html[data-theme="dark"] {
    --bg-main: #090D14;
    --bg-panel: #111824;
    --text-main: #F7F8FA;
    --text-soft: #E8ECF2;
    --text-muted: #BAC6D6;
    --border-color: rgba(255, 255, 255, .10);
    --shadow-soft: 0 18px 45px rgba(0, 0, 0, .35);
}

* {
    box-sizing: border-box;
}

.text-muted {
    color: var(--text-muted) !important;
}

body {
    font-family: var(--font-main);
    background: radial-gradient(circle at top left, rgba(244, 114, 56, .08), transparent 34%), var(--bg-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-orange), #ffd2bf);
    z-index: 9999;
    transition: width .08s linear;
}

.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(250, 250, 250, .82);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border-color);
}

html[data-theme="dark"] .main-header {
    background: rgba(9, 13, 20, .82);
}

.brand-logo {
    color: var(--text-main);
    gap: .65rem;
}

.logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #111;
    color: var(--color-orange);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .12);
}

.logo-mark i {
    font-size: 1.25rem;
}

.brand-text {
    font-size: 1.55rem;
    letter-spacing: -.06em;
    line-height: 1;
}

.logo-bold {
    font-weight: 900;
}

.logo-light {
    font-weight: 500;
}

.logo-dot {
    color: var(--color-orange);
    font-weight: 900;
}

.nav-links {
    list-style: none;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    padding: .55rem .95rem;
    border-radius: 999px;
    color: var(--text-muted);
    font-weight: 650;
    font-size: .94rem;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
    background: rgba(109, 124, 142, .10);
}

.theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.btn-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .78rem 1.1rem;
    border-radius: 999px;
    font-weight: 800;
    border: 1px solid transparent;
    transition: var(--transition);
}

.btn-outline {
    border-color: var(--border-color);
    background: var(--bg-panel);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--color-orange);
    color: var(--color-orange);
    transform: translateY(-2px);
}

.btn-solid {
    background: var(--color-orange);
    color: #fff;
    box-shadow: 0 16px 35px rgba(244, 114, 56, .25);
}

.btn-solid:hover {
    background: #e85f27;
    color: #fff;
    transform: translateY(-2px);
}

.mobile-bottom-nav {
    display: none;
}

@media (max-width: 767px) {
    .desktop-nav {
        display: none !important;
    }

    body {
        padding-bottom: 78px;
    }

    .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, .94);
        border-top: 1px solid var(--border-color);
        z-index: 1050;
        padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
        box-shadow: 0 -8px 30px rgba(0, 0, 0, .08);
        backdrop-filter: blur(18px);
    }

    html[data-theme="dark"] .mobile-bottom-nav {
        background: rgba(17, 24, 36, .94);
    }

    .mobile-bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: var(--text-muted);
        font-size: .70rem;
        font-weight: 700;
        gap: 4px;
        min-width: 60px;
    }

    .mobile-bottom-nav .nav-item i {
        font-size: 1.35rem;
    }

    .mobile-bottom-nav .nav-item.active {
        color: var(--color-orange);
    }
}

.app-shell {
    min-height: 65vh;
}

.hero-section {
    padding: 5rem 0 3.5rem;
}

.badge-custom {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .44rem .9rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 850;
    letter-spacing: .1em;
    color: var(--text-muted);
    background: var(--bg-panel);
}

.hero-title {
    font-size: clamp(2.45rem, 6vw, 5.4rem);
    line-height: .96;
    letter-spacing: -.07em;
    font-weight: 900;
    max-width: 980px;
    margin: 0 auto;
}

.hero-title span {
    color: var(--color-orange);
}

.hero-lead {
    max-width: 760px;
    margin: 1.2rem auto 0;
    color: var(--text-muted);
    font-size: 1.08rem;
    line-height: 1.75;
}

.search-container {
    max-width: 680px;
    margin: 2.2rem auto 0;
}

.smart-search-input {
    width: 100%;
    padding: 1.12rem 3.5rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    outline: 0;
    background: var(--bg-panel);
    color: var(--text-main);
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

.smart-search-input:focus {
    border-color: rgba(244, 114, 56, .45);
    box-shadow: 0 20px 55px rgba(244, 114, 56, .10);
}

.search-icon {
    position: absolute;
    left: 1.35rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.clear-search {
    position: absolute;
    right: 1.15rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    color: var(--text-muted);
    font-size: 1.15rem;
}

.category-strip {
    display: flex;
    gap: .7rem;
    overflow: auto;
    padding: .2rem .1rem 1rem;
    scrollbar-width: none;
}

.category-pill {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .65rem .95rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
    color: var(--text-muted);
    font-weight: 800;
    transition: var(--transition);
}

.category-pill:hover,
.category-pill.active {
    color: #fff;
    background: var(--text-main);
    transform: translateY(-2px);
}

html[data-theme="dark"] .category-pill:hover,
html[data-theme="dark"] .category-pill.active {
    background: var(--color-orange);
}

.section-title {
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    letter-spacing: -.05em;
    font-weight: 900;
}

.section-subtitle {
    color: var(--text-muted);
    line-height: 1.75;
}

.st-card {
    height: 100%;
    transition: var(--transition);
}

.st-card-link {
    height: 100%;
    display: block;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(12, 18, 28, .03);
    transition: var(--transition);
}

.st-card-link:hover {
    transform: translateY(-7px);
    box-shadow: var(--shadow-soft);
    color: inherit;
}

.card-img-wrapper,
.card-cover {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    background: linear-gradient(135deg, var(--color-slate), var(--color-orange));
    display: flex;
    align-items: center;
    justify-content: center;
}

.dynamic-bg {
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .25), transparent 30%), linear-gradient(135deg, var(--color-slate), var(--color-orange));
}

.card-icon {
    font-size: 3.25rem;
    color: #fff;
    opacity: .92;
}

.card-body-soft {
    padding: 1.35rem;
}

.card-kicker {
    display: flex;
    flex-wrap: wrap;
    gap: .42rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: .72rem;
    font-weight: 850;
    margin-bottom: .8rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1.32;
    letter-spacing: -.025em;
    color: var(--text-main);
    margin-bottom: .7rem;
}

.card-excerpt {
    color: var(--text-muted);
    line-height: 1.68;
    font-size: .96rem;
}

.feature-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.feature-content {
    padding: clamp(1.7rem, 4vw, 3.5rem);
}

.feature-media {
    min-height: 100%;
    background: linear-gradient(145deg, #111, var(--color-orange));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.feature-media i {
    font-size: 7rem;
    opacity: .82;
}

.article-page {
    padding: 3.5rem 0;
}

.article-shell {
    max-width: 850px;
    margin: 0 auto;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    color: var(--text-muted);
    font-size: .86rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .045em;
}

.article-title {
    font-size: clamp(2.2rem, 5vw, 4.35rem);
    letter-spacing: -.065em;
    line-height: 1;
    font-weight: 900;
    text-align: center;
    margin: 1rem 0;
}

.article-chapeau {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.15rem;
    line-height: 1.75;
    max-width: 760px;
    margin: 0 auto;
}

.article-cover {
    margin: 2.2rem auto 3rem;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.article-cover img {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
}

.article-content {
    color: var(--text-soft);
    font-size: 1.08rem;
    line-height: 1.95;
}

.article-content p {
    margin-bottom: 1.35rem;
}

.article-content h1,
.article-content h2,
.article-content h3 {
    font-weight: 900;
    letter-spacing: -.035em;
    margin: 2.4rem 0 1rem;
    color: var(--text-main);
}

.article-content blockquote {
    border-left: 5px solid var(--color-orange);
    background: rgba(244, 114, 56, .08);
    margin: 2rem 0;
    padding: 1.3rem 1.6rem;
    border-radius: 0 18px 18px 0;
    font-weight: 650;
}

.article-content img {
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    margin: 1.5rem auto;
}

.article-content pre {
    background: #0B1320;
    color: #E8ECF2;
    border-radius: 18px;
    padding: 1rem;
    overflow: auto;
}

.article-content a {
    color: var(--color-orange);
    font-weight: 800;
}

.newsletter-box {
    background: linear-gradient(135deg, #111827, #0B1320);
    color: #fff;
    border-radius: 30px;
    padding: clamp(1.5rem, 4vw, 3rem);
    box-shadow: var(--shadow-soft);
}

.newsletter-box input {
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .08);
    color: #fff;
    border-radius: 999px;
    padding: .95rem 1.1rem;
    width: 100%;
    outline: 0;
}

.newsletter-box input::placeholder {
    color: rgba(255, 255, 255, .58);
}

.site-footer {
    background: #070A10;
    color: white;
    margin-top: 5rem;
}

.footer-title {
    font-size: .78rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .72);
    font-weight: 900;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: .8rem 0 0;
}

.footer-links li {
    margin: .55rem 0;
}

.footer-links a {
    color: rgba(255, 255, 255, .72);
    transition: var(--transition);
}

.footer-links a:hover,
.hover-white:hover {
    color: #fff !important;
}

.site-footer .text-white-50 {
    color: rgba(255, 255, 255, 0.72) !important;
}

.empty-state {
    background: var(--bg-panel);
    border: 1px dashed var(--border-color);
    border-radius: 24px;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.admin-link-mini {
    font-size: .85rem;
    color: var(--text-muted);
}

@media (max-width: 575px) {
    .hero-section {
        padding: 3rem 0 2rem;
    }

    .card-body-soft {
        padding: 1.1rem;
    }

    .article-content {
        font-size: 1rem;
        line-height: 1.85;
    }
}

/* Page transitions */
.fade-in {
    animation: fadeIn .32s cubic-bezier(.25, .8, .25, 1) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Skeleton Loaders */
.skeleton-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 100%;
}

.skeleton-img {
    width: 100%;
    aspect-ratio: 16/10;
    background: var(--border-color);
    position: relative;
    overflow: hidden;
}

.skeleton-body {
    padding: 1.35rem;
}

.skeleton-kicker {
    width: 45%;
    height: 12px;
    background: var(--border-color);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.skeleton-title {
    width: 85%;
    height: 20px;
    background: var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.8rem;
}

.skeleton-text {
    width: 100%;
    height: 14px;
    background: var(--border-color);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-text.short {
    width: 70%;
}

.skeleton-article {
    max-width: 850px;
    margin: 0 auto;
    padding: 3.5rem 0;
}

.skeleton-article-meta {
    width: 30%;
    height: 12px;
    background: var(--border-color);
    margin: 0 auto 1.5rem;
    border-radius: 4px;
}

.skeleton-article-title {
    width: 75%;
    height: 38px;
    background: var(--border-color);
    margin: 0 auto 1.5rem;
    border-radius: 8px;
}

.skeleton-article-chapeau {
    width: 85%;
    height: 16px;
    background: var(--border-color);
    margin: 0 auto 2.5rem;
    border-radius: 4px;
}

.skeleton-article-cover {
    width: 100%;
    height: 380px;
    background: var(--border-color);
    border-radius: 28px;
    margin-bottom: 3rem;
}

.skeleton-article-para {
    width: 100%;
    height: 14px;
    background: var(--border-color);
    border-radius: 4px;
    margin-bottom: 0.8rem;
}

/* Shimmer Animation */
.shimmer .skeleton-img,
.shimmer .skeleton-kicker,
.shimmer .skeleton-title,
.shimmer .skeleton-text,
.shimmer .skeleton-article-meta,
.shimmer .skeleton-article-title,
.shimmer .skeleton-article-chapeau,
.shimmer .skeleton-article-cover,
.shimmer .skeleton-article-para {
    position: relative;
    overflow: hidden;
}

.shimmer .skeleton-img::after,
.shimmer .skeleton-kicker::after,
.shimmer .skeleton-title::after,
.shimmer .skeleton-text::after,
.shimmer .skeleton-article-meta::after,
.shimmer .skeleton-article-title::after,
.shimmer .skeleton-article-chapeau::after,
.shimmer .skeleton-article-cover::after,
.shimmer .skeleton-article-para::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.4) 20%,
            rgba(255, 255, 255, 0.7) 60%,
            rgba(255, 255, 255, 0) 100%);
    animation: shimmer-anim 1.6s infinite;
    content: '';
}

html[data-theme="dark"] .shimmer .skeleton-img::after,
html[data-theme="dark"] .shimmer .skeleton-kicker::after,
html[data-theme="dark"] .shimmer .skeleton-title::after,
html[data-theme="dark"] .shimmer .skeleton-text::after,
html[data-theme="dark"] .shimmer .skeleton-article-meta::after,
html[data-theme="dark"] .shimmer .skeleton-article-title::after,
html[data-theme="dark"] .shimmer .skeleton-article-chapeau::after,
html[data-theme="dark"] .shimmer .skeleton-article-cover::after,
html[data-theme="dark"] .shimmer .skeleton-article-para::after {
    background-image: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.04) 20%,
            rgba(255, 255, 255, 0.08) 60%,
            rgba(255, 255, 255, 0) 100%);
}

@keyframes shimmer-anim {
    100% {
        transform: translateX(100%);
    }
}

/* Custom distraction-free formatting inside article body */
.article-content .ql-align-center {
    text-align: center;
}

.article-content .ql-align-right {
    text-align: right;
}

.article-content .ql-align-justify {
    text-align: justify;
}

.article-content .ql-indent-1 {
    padding-left: 3em;
}

.article-content .ql-indent-2 {
    padding-left: 6em;
}

.article-content .ql-indent-3 {
    padding-left: 9em;
}

.article-content pre.ql-syntax,
.article-content pre,
.ql-code-block-container {
    background: #282c34 !important;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.25rem;
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 1.8rem 0;
    overflow: auto;
    font-family: 'Fira Code', 'Courier New', Courier, monospace !important;
    box-shadow: var(--shadow-soft);
}

.article-content code {
    font-family: 'Fira Code', 'Courier New', Courier, monospace !important;
    background: rgba(109, 124, 142, 0.1);
    color: var(--color-orange);
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.article-content pre code {
    background: transparent !important;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

/* Protection against pasted black text / white backgrounds in dark mode */
html[data-theme="dark"] .article-content [style*="color: rgb(0, 0, 0)"],
html[data-theme="dark"] .article-content [style*="color: rgb(0,0,0)"],
html[data-theme="dark"] .article-content [style*="color: #000"],
html[data-theme="dark"] .article-content [style*="color:#000"],
html[data-theme="dark"] .article-content [style*="color: black"],
html[data-theme="dark"] .article-content [style*="color: #111"],
html[data-theme="dark"] .article-content [style*="color:#111"],
html[data-theme="dark"] .article-content [style*="color: #242424"],
html[data-theme="dark"] .article-content [style*="color:#242424"] {
    color: var(--text-main) !important;
}

html[data-theme="dark"] .article-content [style*="background-color: rgb(255, 255, 255)"],
html[data-theme="dark"] .article-content [style*="background-color: rgb(255,255,255)"],
html[data-theme="dark"] .article-content [style*="background-color: #fff"],
html[data-theme="dark"] .article-content [style*="background-color:#fff"],
html[data-theme="dark"] .article-content [style*="background-color: white"] {
    background-color: transparent !important;
}

/* Defensive syntax highlighting fallback styles (Atom One Dark theme compatible) */
.hljs {
    color: #abb2bf;
    background: #282c34;
}

.hljs-comment,
.hljs-quote {
    color: #5c6370;
    font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-section {
    color: #c678dd !important;
    /* purple */
    font-weight: 700;
}

.hljs-string,
.hljs-doctag,
.hljs-type,
.hljs-built_in,
.hljs-bullet,
.hljs-addition {
    color: #98c379 !important;
    /* green */
}

.hljs-number,
.hljs-attribute,
.hljs-symbol,
.hljs-link,
.hljs-meta {
    color: #d19a66 !important;
    /* orange/saffron */
}

.hljs-title,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class {
    color: #61afef !important;
    /* blue */
}

.hljs-variable,
.hljs-template-variable {
    color: #e06c75 !important;
    /* red */
}

.hljs-tag,
.hljs-attr {
    color: #e5c07b !important;
    /* yellow */
}

/* ==========================================================================
   Premium Frontend UX/UI Enhancements (Google & Notion-grade)
   ========================================================================== */

/* 1. Sleek Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(109, 124, 142, 0.22);
    border-radius: 99px;
    border: 2px solid var(--bg-main);
    transition: var(--transition);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-orange);
}

/* 2. Premium Copy Code Button inside HLJS Codeblocks */
pre.hljs, pre, .ql-code-block-container {
    position: relative;
    padding-top: 2.6rem !important; /* Make breathing room for the premium copy button */
}

.copy-code-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #abb2bf;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.copy-code-btn:hover {
    background: rgba(244, 114, 56, 0.15);
    border-color: rgba(244, 114, 56, 0.4);
    color: var(--color-orange-2);
    transform: scale(1.05);
}
.copy-code-btn.copied {
    background: rgba(46, 213, 115, 0.15);
    border-color: rgba(46, 213, 115, 0.4);
    color: #2ed573 !important;
}

/* 3. Equalizer Pulsing Wave Keyframes */
@keyframes pulseWave {
    0% { height: 25%; }
    100% { height: 100%; }
}