:root {
    --ink: #101226;
    --ink-soft: #1c1f3a;
    --muted: #5b6078;
    --accent: #4f46e5;
    --accent-2: #7c3aed;
    --accent-soft: #eef0ff;
    --bg: #f7f8fd;
    --card: #ffffff;
    --border: #e6e8f4;
    --success: #16a34a;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 16px 40px rgba(31, 27, 70, 0.10);
    --shadow-sm: 0 4px 14px rgba(31, 27, 70, 0.07);
    --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
    line-height: 1.15;
    letter-spacing: -0.02em;
}

p {
    margin: 0 0 1rem;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 0.6rem;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(180%) blur(12px);
    color: var(--ink);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.brand {
    color: var(--ink);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.brand:hover {
    text-decoration: none;
}

.brand .logo {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: inline-block;
    object-fit: contain;
}

.brand-accent {
    color: var(--accent);
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav > a:not(.btn) {
    color: var(--ink-soft);
    font-size: 0.95rem;
    font-weight: 500;
}

.nav > a:not(.btn):hover,
.nav > a:not(.btn).active {
    color: var(--accent);
    text-decoration: none;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.4;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--grad);
    color: #fff;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(79, 70, 229, 0.38);
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--border);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-lg {
    padding: 0.9rem 1.9rem;
    font-size: 1rem;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.7rem;
    line-height: 1;
    color: var(--ink);
    cursor: pointer;
}

/* Hero */
.hero {
    padding: 5.5rem 0 4rem;
    text-align: center;
    background:
        radial-gradient(50% 60% at 15% 0, rgba(79, 70, 229, 0.14), transparent 60%),
        radial-gradient(45% 55% at 90% 5%, rgba(124, 58, 237, 0.12), transparent 60%),
        var(--bg);
}

.hero h1 {
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    margin: 0 0 1rem;
    font-weight: 800;
}

.hero h1 .grad {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p.lead {
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 640px;
    margin: 0 auto 1.8rem;
}

.hero .cta-row {
    display: flex;
    gap: 0.9rem;
    justify-content: center;
    flex-wrap: wrap;
}

.blog-hero {
    padding: 5rem 0 3rem;
}

/* Sections and cards */
.section {
    padding: 3.75rem 0;
}

.section-alt {
    background: var(--card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin: 0 0 0.5rem;
}

.section .section-sub {
    color: var(--muted);
    margin-top: 0;
    max-width: 640px;
}

.grid {
    display: grid;
    gap: 1.4rem;
}

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

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

/* Post list */
.blog-list-section {
    padding-top: 0;
    padding-bottom: 3.75rem;
}

.post-grid {
    align-items: stretch;
}

.post-card {
    display: flex;
    flex-direction: column;
}

.post-card-meta {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.65rem;
}

.post-card-title {
    font-size: 1.35rem;
    margin: 0 0 0.65rem;
}

.post-card-title a {
    color: var(--ink);
}

.post-card-title a:hover {
    color: var(--accent);
    text-decoration: none;
}

.post-card-summary {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
}

.post-card-summary p {
    margin: 0;
}

.post-card-link {
    margin-top: auto;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--accent);
}

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

.post-card-link span {
    display: inline-block;
    transition: transform 0.2s ease;
}

.post-card-link:hover span {
    transform: translateX(3px);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--muted);
}

.empty-state h2 {
    margin: 0 0 0.5rem;
    color: var(--ink);
}

/* Single post */
.post-hero {
    padding: 3.5rem 0 2.25rem;
    text-align: left;
    background:
        radial-gradient(50% 70% at 15% 0, rgba(79, 70, 229, 0.12), transparent 60%),
        radial-gradient(45% 65% at 90% 5%, rgba(124, 58, 237, 0.1), transparent 60%),
        var(--bg);
}

.post-hero h1 {
    font-size: clamp(2rem, 4.5vw, 3rem);
    margin: 0 0 0.75rem;
}

.post-hero .muted {
    font-size: 0.92rem;
    margin: 0;
}

.breadcrumb {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--muted);
}

.breadcrumb a:hover {
    color: var(--accent);
    text-decoration: none;
}

.post-wrap {
    max-width: 860px;
}

.post-section {
    padding-top: 0;
    padding-bottom: 3.75rem;
}

.post-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: clamp(1.5rem, 4vw, 3rem);
}

.post-content > :first-child {
    margin-top: 0;
}

.post-content > :last-child {
    margin-bottom: 0;
}

.post-content h1 {
    text-align: center;
    font-size: 2rem;
    margin: 0 0 1.25rem;
}

.post-content h2 {
    font-size: clamp(1.4rem, 2.5vw, 1.75rem);
    margin: 2.25rem 0 0.75rem;
}

.post-content h3 {
    font-size: 1.22rem;
    margin: 1.75rem 0 0.6rem;
}

.post-content h4 {
    font-size: 1.05rem;
    margin: 1.5rem 0 0.5rem;
}

.post-content p,
.post-content li {
    color: var(--ink-soft);
}

.post-content ul,
.post-content ol {
    padding-left: 1.4rem;
    margin: 0 0 1.2rem;
}

.post-content li {
    margin: 0.35rem 0;
}

.post-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: var(--accent-soft);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--ink-soft);
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.88em;
    background: var(--accent-soft);
    color: #3730a3;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
}

.post-content pre {
    background: var(--ink);
    color: #e8e9f5;
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius-sm);
    overflow: auto;
    margin: 1.5rem 0;
    line-height: 1.55;
    font-size: 0.88rem;
}

.post-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

.post-content img {
    display: block;
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 1.5rem auto;
    box-shadow: var(--shadow-sm);
}

.post-content hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.92rem;
}

.post-content th,
.post-content td {
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.post-content th {
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.post-content strong {
    color: var(--ink);
}

.post-footer-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.post-not-found {
    text-align: center;
    padding: 1rem 0 2rem;
}

.post-not-found .icon {
    font-size: 3rem;
    line-height: 1;
}

.post-not-found h2 {
    margin: 0.75rem 0 0.5rem;
    font-size: 1.6rem;
}

.post-not-found p {
    color: var(--muted);
    margin-bottom: 1.5rem;
}

/* Footer */
.site-footer {
    background: var(--ink);
    color: #c6c9e0;
    margin-top: 3.5rem;
}

.site-footer .container {
    padding: 3rem 1.25rem 2rem;
}

.site-footer .cols {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2.5rem;
}

.site-footer h4 {
    color: #fff;
    margin: 0 0 0.9rem;
    font-size: 0.95rem;
}

.site-footer a {
    color: #c6c9e0;
    display: block;
    margin-bottom: 0.55rem;
    font-size: 0.9rem;
}

.site-footer a:hover {
    color: #fff;
    text-decoration: none;
}

.site-footer .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0;
    font-size: 1.25rem;
    color: #fff;
}

.site-footer .brand .logo {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    object-fit: contain;
}

.site-footer .brand-accent {
    color: #8ab4ff;
}

.site-footer p {
    color: #c6c9e0;
    font-size: 0.92rem;
}

.site-footer .bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin-top: 2.5rem;
    padding-top: 1.4rem;
    font-size: 0.85rem;
    color: #9aa0c0;
}

.site-footer .bottom a {
    display: inline;
    color: #9aa0c0;
    margin-bottom: 0;
    font-size: inherit;
}

.site-footer .bottom a:hover {
    color: #fff;
}

@media (max-width: 860px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
        padding: 1rem;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: var(--card);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }

    .nav.open {
        display: flex;
    }

    .nav .btn {
        text-align: center;
    }

    .nav-toggle {
        display: block;
    }

    .site-footer .cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 4rem 0 3rem;
    }

    .section {
        padding: 2.75rem 0;
    }

    .post-content {
        padding: 1.25rem;
    }

    .post-footer-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .post-footer-nav .btn {
        text-align: center;
    }
}
