:root {
    --bg: #ffffff;
    --text: #0f172a;
    --muted: #475569;
    --line: #e2e8f0;
    --panel: #ffffff;
    --panel-dark: #000000;
    --panel-dark-2: #111111;
    --panel-dark-text: #ffffff;
    --panel-dark-muted: #cbd5e1;
    --active: #555555;
    --hover: #333333;
    --shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    --radius: 16px;
    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

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

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

.container {
    width: min(100% - 2rem, var(--container));
    margin: 0 auto;
}

/* Header */
.topbar {
    position: sticky;
    top: 0;
    z-index: 999;
    background: #000000;
    border-bottom: 1px solid #1f2937;
    backdrop-filter: blur(6px);
}

.header-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    padding: 5px 12px;
    min-height: auto;
}

.site-brand {
    color: #ffffff;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 2.5rem;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
    flex: 0 0 auto;
}


.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    margin-left: auto;
    flex: 0 0 auto;
}

.desktop-nav a {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 25px;
    font-weight: 400;
    color: #ffffff;
    margin: 0 10px;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    line-height: 1.2;
    transition: background-color 0.3s ease;
}

.desktop-nav a:hover {
    background: #333333;
    color: #ffffff;
}

.desktop-nav a.active {
    background: #555555;
    color: #ffffff;
}

.site-main {
    min-height: calc(100vh - 140px);
}

.site-footer {
    margin-top: 3rem;
    background: #000000;
    color: #ffffff;
    border-top: 1px solid #1f2937;
}

.footer-inner {
    padding: 18px 0 24px;
    font-size: 0.95rem;
}

/* Hero */
.hero-shell {
    padding: 3.25rem 0 1rem;
}

.hero-inner {
    padding: 1rem 0 0.75rem;
}

.hero-kicker {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.hero-inner h1 {
    margin: 0;
    font-size: clamp(2.1rem, 4vw, 3.5rem);
    line-height: 1.08;
    color: #000000;
    max-width: 900px;
}

.hero-copy {
    max-width: 720px;
    margin: 1rem 0 0;
    font-size: 1.1rem;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 1.5rem;
}

.button-primary,
.button-secondary {
    display: inline-block;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 700;
    transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.button-primary {
    background: #000000;
    color: #ffffff;
}

.button-primary:hover {
    background: #111111;
    transform: translateY(-1px);
}

.button-secondary {
    background: #f1f5f9;
    color: #000000;
    border: 1px solid var(--line);
}

.button-secondary:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

/* Sections */
.section-block {
    padding: 1rem 0 1.25rem;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.section-head h2,
.page-header h1 {
    margin: 0;
    color: #000000;
}

.section-subtitle {
    margin: 0;
    color: var(--muted);
}

.section-link {
    color: #000000;
    font-weight: 700;
}

/* Cards */
.app-grid,
.post-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.card-link {
    text-decoration: none;
}

.app-card,
.post-card,
.featured-post-card {
    background: var(--panel-dark);
    border: 1px solid #0b0b0b;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.app-card,
.post-card {
    padding: 1.25rem;
    min-height: 100%;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.app-card:hover,
.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.app-card h3,
.post-card h3,
.featured-copy h3 {
    margin: 0;
    color: var(--panel-dark-text);
    font-weight: 800;
    letter-spacing: 0.01em;
}

.app-card p,
.post-card p,
.featured-copy p {
    color: var(--panel-dark-muted);
    margin-top: 0.9rem;
    margin-bottom: 0;
}

.badge-tag {
    display: inline-block;
    background: #ffffff;
    color: #000000;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.featured-post-card {
    display: grid;
    grid-template-columns: minmax(260px, 1.1fr) 1fr;
    overflow: hidden;
}

.featured-image-wrap {
    min-height: 100%;
}

.featured-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-copy {
    padding: 1.5rem;
}

.featured-copy h3 {
    font-size: clamp(1.4rem, 2vw, 2rem);
    line-height: 1.2;
    margin-top: 0.65rem;
}

.featured-excerpt {
    font-size: 1rem;
}

/* Pills/meta */
.content-pill,
.pill {
    display: inline-block;
    background: #ffffff;
    color: #000000;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 800;
    margin-bottom: 0.65rem;
}

.content-meta,
.meta {
    color: #cbd5e1;
    font-size: 0.95rem;
    margin-top: 0.6rem;
    margin-bottom: 0.6rem;
}

/* Blog list/detail pages */
.page-header {
    padding: 2rem 0 1rem;
}

.page-header p {
    color: var(--muted);
    margin-top: 0.5rem;
}

.list-post,
.empty-state,
.empty-panel {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    padding: 1.25rem;
}

.list-post {
    margin-bottom: 1rem;
}

.list-post h2 {
    margin: 0.3rem 0 0.5rem;
    color: #000000;
}

.list-post p {
    color: var(--muted);
}

.list-post .pill,
.list-post .meta {
    color: inherit;
}

.list-post .meta {
    color: var(--muted);
}

.article-detail {
    max-width: 880px;
    margin-top: 2rem;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    padding: 1.5rem;
}

.article-detail h1 {
    margin: 0.35rem 0 0.75rem;
    color: #000000;
    line-height: 1.15;
}

.article-detail .meta {
    color: var(--muted);
}

.article-image {
    margin: 1rem 0 1.5rem;
    border-radius: 14px;
    width: 100%;
    height: auto;
}

.article-body {
    color: #0f172a;
    font-size: 1.05rem;
}

.article-body p {
    margin-bottom: 1rem;
}

.tag-row {
    margin-top: 1.5rem;
}

.tag {
    display: inline-block;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    background: #f1f5f9;
    color: #0f172a;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.9rem;
    font-weight: 700;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 1rem;
}

.pagination a {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 8px;
    background: #000000;
    color: #ffffff;
}

.pagination span {
    color: var(--muted);
}

/* Scroll button */
#scrollTopBtn {
    display: none;
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 9999;
    border: none;
    outline: none;
    background: #000000;
    color: #ffffff;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 15px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

#scrollTopBtn:hover {
    background: #333333;
}

/* Mobile menu */
#mobileMenuWrap {
    display: none;
}

#hamburgerBtn {
    background: #000000;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#hamburgerBtn:active {
    transform: translateY(1px);
}

#hamburgerMenu {
    display: none;
    position: absolute;
    top: 43px;
    right: 0;
    background: #000000;
    color: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 10px;
    min-width: 180px;
    padding: 6px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

#hamburgerMenu.open {
    display: block;
}

#hamburgerMenu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#hamburgerMenu li {
    margin: 0;
}

#hamburgerMenu a {
    display: block;
    padding: 10px 14px;
    text-decoration: none;
    color: inherit;
    font-size: 16px;
}

#hamburgerMenu a:hover,
#hamburgerMenu a.active {
    background: #f5f5f7;
    color: #000000;
}

/* Responsive */
@media (max-width: 1100px) {
    .app-grid,
    .post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .desktop-nav a {
        font-size: 22px;
        padding: 5px 8px;
        margin: 0 6px;
    }

    .site-brand {
        font-size: 2.1rem;
    }
}


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

    #mobileMenuWrap {
        display: block;
        position: fixed;
        top: 1px;
        right: 15px;
        z-index: 10000;
    }

    .site-brand {
        font-size: 28px;
    }

    .header-row {
        padding: 5px 12px;
        min-height: 48px;
    }

    .hero-shell {
        padding-top: 2rem;
    }

    .hero-copy {
        font-size: 1rem;
    }

    .app-grid,
    .post-grid {
        grid-template-columns: 1fr;
    }

    .featured-post-card {
        grid-template-columns: 1fr;
    }

    .featured-image {
        max-height: 300px;
    }

    .container {
        width: min(100% - 1.1rem, var(--container));
    }

    .section-head {
        align-items: start;
    }
}

@media (max-width: 420px) {
    .site-brand {
        font-size: 28px;
    }

    .hero-inner h1 {
        font-size: 2rem;
    }

    #scrollTopBtn {
        padding: 9px 12px;
        font-size: 14px;
    }
}
