:root {
    --bg-page: #ffffff;
    --bg-muted: #faf7f2;
    --bg-card: #ffffff;
    --bg-hero-green: #e6f6f0;
    --text-main: #202024;
    --text-muted: #6b6f76;
    --text-soft: #9a9faa;
    --accent: #9a9faa;
    --accent-soft: #d9f2e9;
    --border-subtle: #e4e6eb;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-pill: 999px;
    --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.08);
    --container-width: 1120px;
    --font-sans: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-heading: var(--font-sans);
    --font-mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --font-logo: "Bangers", sans-serif;
}

/* Reset-ish */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background: var(--bg-page);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

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

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

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1 0 auto;
}

/* Layout helpers */

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Top Banner */

.top-banner {
    width: 100%;
    padding: 12px 0;
    position: relative;
    z-index: 100;
}

.banner-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.banner-text {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.banner-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.banner-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 18px;
    background: #ffffff;
    color: #000000;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.banner-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.banner-close {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.banner-close:hover {
    opacity: 1;
}

/* Hero Section */

.hero-section {
    width: 100%;
    padding: 80px 0;
    background: linear-gradient(135deg, #fef5e7 0%, #fde8da 50%, #e6f6f0 100%);
    border-radius: 40px;
    margin: 0 24px 60px;
    max-width: calc(var(--container-width) - 48px);
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(255, 255, 255, 0.3) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 40px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 56px;
    line-height: 1.15;
    margin: 0 0 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0 0 36px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-hero {
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
}

.btn-secondary {
    background: #ffffff;
    color: #1c1c1f;
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: #f4f5f8;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
}

/* Header */

.site-header {
    padding: 60px 0 32px;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 48px;
}

.site-logo {
    display: inline-block;
    position: relative;
    transition: transform 0.2s ease-out;
}

.site-logo:hover {
    transform: translateY(-2px);
}

.site-logo:active {
    transform: translateY(0);
}

.site-logo-text {
    font-family: var(--font-logo);
    font-size: 52px;
    font-weight: 400;
    letter-spacing: 0.02em;
    transition: color 0.2s ease-out;
    display: inline-block;
    transform-origin: center;
}

.site-logo:hover .site-logo-text {
    color: var(--accent);
}

.site-logo:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 8px;
    border-radius: 8px;
}

.site-subtitle p {
    margin: 8px 0 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-muted);
    max-width: 520px;
    text-align: right;
}

/* Post grid */

.post-grid-section {
    padding-bottom: 72px;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}

.post-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card-image-wrapper {
    display: block;
    overflow: hidden;
}

.post-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.post-card-image.placeholder-bg {
    background: linear-gradient(135deg, var(--bg-hero-green), #fde8da);
    height: 220px;
}

.post-card-meta,
.post-card-title,
.post-card-excerpt,
.post-card-footer {
    padding: 0 28px;
}

.post-card-meta {
    margin-top: 20px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-soft);
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-separator {
    opacity: 0.5;
}

.post-card-title {
    margin: 10px 0 8px;
}

.post-card-title a {
    font-family: var(--font-heading);
    font-size: 22px;
    line-height: 1.3;
}

.post-card-excerpt {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-muted);
}

.post-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 22px;
    font-size: 13px;
    color: var(--text-soft);
}

.post-reading-time {
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.post-read-more {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.post-read-more .arrow {
    transition: transform 0.15s ease-out;
}

.post-read-more:hover .arrow {
    transform: translateX(2px);
}

/* Stay updated section & footer */

.site-footer {
    margin-top: 48px;
    background: var(--bg-muted);
}

.stay-updated {
    padding: 64px 0 48px;
}

.stay-updated-inner {
    text-align: center;
}

.stay-updated-title {
    font-family: var(--font-heading);
    font-size: 32px;
    margin-bottom: 8px;
}

.stay-updated-subtitle {
    font-size: 15px;
    max-width: 620px;
    margin: 0 auto 24px;
    color: var(--text-muted);
}

.stay-updated-actions {
    display: inline-flex;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 28px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: #1c1c1f;
    color: #ffffff;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-ghost {
    background: transparent;
    color: #1c1c1f;
    border-color: var(--border-subtle);
}

.btn-ghost:hover {
    background: #ffffff;
}

.footer-bottom {
    border-top: 1px solid rgba(0, 0, 0, 0.03);
    padding: 18px 0 26px;
}

.footer-bottom-inner {
    text-align: center;
    font-size: 13px;
    color: var(--text-soft);
}

/* Single post */

.single-post {
    padding-bottom: 80px;
}

.single-post-inner {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr);
    gap: 56px;
}

.single-post-breadcrumb {
    font-size: 13px;
    color: var(--text-soft);
    margin-bottom: 12px;
}

.single-post-breadcrumb span,
.single-post-breadcrumb a {
    opacity: 0.9;
}

.single-post-breadcrumb a:hover {
    color: var(--text-main);
}

.single-post-meta-top {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-soft);
    margin-bottom: 12px;
}

.single-post-title {
    font-family: var(--font-heading);
    font-size: 40px;
    margin: 0 0 16px;
}

.single-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 26px;
}

.tag-pill {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: #f4f5f8;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.11em;
}

.single-post-hero {
    margin-bottom: 32px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.single-post-hero img {
    width: 100%;
    height: auto;
    display: block;
}

.single-post-body {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-main);
}

.single-post-body h2,
.single-post-body h3 {
    font-family: var(--font-heading);
    margin-top: 28px;
    margin-bottom: 10px;
}

.single-post-body p {
    margin-bottom: 16px;
}

.single-post-body ul,
.single-post-body ol {
    margin: 0 0 18px 22px;
}

/* Aside */

.single-post-aside {
    padding-top: 72px;
}

.aside-card {
    position: sticky;
    top: 92px;
    padding: 20px 20px 18px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.aside-title {
    margin: 0 0 12px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-soft);
}

.aside-toc {
    font-size: 14px;
}

.aside-toc ul {
    list-style: none;
    padding-left: 0;
}

.aside-toc li {
    margin-bottom: 6px;
}

.aside-toc a {
    color: var(--text-muted);
}

.aside-toc a:hover {
    color: var(--text-main);
}

/* Pagination */

.pagination {
    margin: 60px 0 20px;
    padding: 32px 0;
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Pagination buttons (First, Prev, Next, Last) */
.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.pagination-btn:hover {
    background: #1c1c1f;
    color: #ffffff;
    border-color: #1c1c1f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.pagination-btn:active {
    transform: translateY(0);
}

.pagination-btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-icon {
    font-size: 16px;
    line-height: 1;
}

.pagination-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 13px;
}

/* Page numbers container */
.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 12px;
}

/* Individual page numbers */
.pagination-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.pagination-number:hover {
    background: #f4f5f8;
    border-color: #d0d4db;
    transform: translateY(-1px);
}

.pagination-number-active {
    background: #1c1c1f;
    color: #ffffff;
    border-color: #1c1c1f;
    box-shadow: 0 4px 12px rgba(28, 28, 31, 0.2);
    cursor: default;
}

.pagination-number-active:hover {
    transform: none;
}

/* Ellipsis */
.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    color: var(--text-soft);
    font-size: 14px;
    user-select: none;
}

/* Responsive */

@media (max-width: 1024px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .site-subtitle p {
        text-align: left;
    }

    .post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .single-post-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .single-post-aside {
        padding-top: 32px;
    }

    .aside-card {
        position: static;
    }
}

@media (max-width: 720px) {
    .site-header {
        padding-top: 36px;
    }

    .site-logo-text {
        font-size: 40px;
    }

    .post-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .single-post-title {
        font-size: 32px;
    }

    .stay-updated-actions {
        flex-direction: column;
    }

    .container {
        padding: 0 18px;
    }

    /* Banner mobile adjustments */
    .top-banner {
        padding: 10px 0;
    }

    .banner-content {
        flex-direction: column;
        gap: 12px;
    }

    .banner-text {
        font-size: 13px;
        text-align: center;
        padding: 0 10px;
    }

    /* Hero mobile adjustments */
    .hero-section {
        margin: 0 18px 40px;
        max-width: calc(100% - 36px);
        padding: 50px 0;
        border-radius: 24px;
    }

    .hero-content {
        padding: 0 24px;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 16px;
        margin-bottom: 28px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-hero {
        width: 100%;
        justify-content: center;
    }

    /* Pagination mobile adjustments */
    .pagination-btn-first,
    .pagination-btn-last {
        display: none;
    }

    .pagination-label {
        display: none;
    }

    .pagination-btn {
        min-width: 40px;
        padding: 10px 12px;
    }

    .pagination-numbers {
        margin: 0 4px;
        gap: 4px;
    }

    .pagination-number {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 13px;
    }
}

/* Code blocks and syntax highlighting */
:root {
    --code-font: var(--font-mono);
    --code-bg: #0f172a;
    /* slate-900 */
    --code-text: #e2e8f0;
    /* slate-200 */
    --code-border: #0b1220;
    --code-inline-bg: #f4f5f8;
    --code-ln-bg: rgba(255, 255, 255, 0.04);
    --code-ln-text: #94a3b8;
    /* slate-400 */
    --code-accent: #22c55e;
    /* green-500 */
}

/* Inline code */
.single-post-body :not(pre)>code {
    font-family: var(--code-font);
    font-size: 0.92em;
    background: var(--code-inline-bg);
    color: #1f2937;
    padding: 0.15em 0.45em;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
}

/* Hugo/Chroma fenced code container */
.single-post-body .highlight,
.single-post-body .chroma {
    position: relative;
    background: var(--code-bg);
    color: var(--code-text);
    border-radius: 14px;
    border: 1px solid var(--code-border);
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.35);
    overflow: hidden;
    margin: 18px 0 22px;
}

/* Make the code area scroll if wide */
.single-post-body .chroma pre,
.single-post-body .chroma code {
    font-family: var(--code-font);
    font-size: 14px;
    line-height: 1.65;
}

.single-post-body .chroma pre {
    margin: 0;
    padding: 16px 18px;
    overflow-x: auto;
}

/* Line numbers layout (when Hugo lineNos = true) */
.single-post-body .chroma table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.single-post-body .chroma .lntd {
    padding: 0;
}

.single-post-body .chroma .lntd:first-child {
    width: 1%;
    background: var(--code-ln-bg);
    border-right: 1px solid rgba(148, 163, 184, 0.15);
}

.single-post-body .chroma .ln {
    display: block;
    padding: 0 12px;
    text-align: right;
    color: var(--code-ln-text);
    user-select: none;
}

.single-post-body .chroma .code {
    width: 100%;
}

.single-post-body .chroma .code .line {
    display: block;
    padding: 0 16px;
}

/* Subtle header bar with language placeholder (if set later) */
.single-post-body .chroma::before {
    content: attr(data-lang);
    position: absolute;
    top: 8px;
    right: 10px;
    font-family: var(--code-font);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9aa6b2;
}

/* Token colors (Chroma classnames) */
/* Comments */
.chroma .c {
    color: #94a3b8;
    font-style: italic;
}

/* Keywords */
.chroma .k,
.chroma .kc,
.chroma .kd,
.chroma .kn,
.chroma .kp,
.chroma .kr,
.chroma .kt {
    color: #93c5fd;
}

/* Strings */
.chroma .s,
.chroma .sa,
.chroma .sb,
.chroma .sc,
.chroma .sd,
.chroma .s2,
.chroma .se,
.chroma .sh,
.chroma .si,
.chroma .sx,
.chroma .sr,
.chroma .s1 {
    color: #f5d0fe;
}

/* Numbers */
.chroma .m,
.chroma .mb,
.chroma .mf,
.chroma .mh,
.chroma .mi,
.chroma .il,
.chroma .mo {
    color: #fca5a5;
}

/* Types, class, function names */
.chroma .nc,
.chroma .nf,
.chroma .nn,
.chroma .na {
    color: #86efac;
}

/* Operators, punctuation */
.chroma .o,
.chroma .p {
    color: #e2e8f0;
}

/* Attributes, constants */
.chroma .nt,
.chroma .nb {
    color: #fde68a;
}

/* Copy button hook (optional, add markup later) */
.single-post-body .code-copy {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(148, 163, 184, 0.15);
    color: var(--code-text);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
    backdrop-filter: blur(6px);
}

.single-post-body .code-copy:hover {
    background: rgba(148, 163, 184, 0.25);
}

/* Better scrollbars within code blocks */
.single-post-body .chroma pre::-webkit-scrollbar {
    height: 10px;
}

.single-post-body .chroma pre::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.15);
}

.single-post-body .chroma pre::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 6px;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    :root {
        --code-bg: #0b1220;
        --code-text: #dbeafe;
        --code-border: #050a17;
        --code-inline-bg: #0f172a;
        --code-ln-bg: rgba(0, 0, 0, 0.2);
        --code-ln-text: #64748b;
    }

    .single-post-body :not(pre)>code {
        color: #e2e8f0;
        border-color: rgba(148, 163, 184, 0.25);
    }
}

/* Social Share Buttons */
.social-share-buttons {
    margin: 48px 0;
    padding-top: 32px;
    border-top: 1px solid var(--border-subtle);
}

.social-share-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 16px 0;
}

.social-share-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.social-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}

.social-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.social-share-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Individual platform colors on hover */
.social-facebook:hover {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
}

.social-linkedin:hover {
    background: #0a66c2;
    color: white;
    border-color: #0a66c2;
}

.social-threads:hover {
    background: #000000;
    color: white;
    border-color: #000000;
}

.social-bluesky:hover {
    background: #0085ff;
    color: white;
    border-color: #0085ff;
}

.social-mastodon:hover {
    background: #6364ff;
    color: white;
    border-color: #6364ff;
}

.social-x:hover {
    background: #000000;
    color: white;
    border-color: #000000;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .social-share-icons {
        gap: 8px;
    }

    .social-share-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .social-share-btn svg {
        width: 18px;
        height: 18px;
    }
}
