:root {
    --blog-card: #111b2f;
    --blog-card-soft: #17233a;
    --blog-lime: #90ea2a;
    --blog-text: #f8fafc;
    --blog-muted: #94a3b8;
    --blog-border: rgba(255, 255, 255, 0.1);
}

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

body {
    min-height: 100vh;
    color: var(--blog-text);
    -webkit-font-smoothing: antialiased;
}

body.modal-open {
    overflow: hidden;
}

.blog-container {
    width: min(1400px, 100%);
    margin: 0 auto;
    padding: calc(70px + var(--site-logo-overhang, 32px)) 30px 90px;
}

.blog-heading {
    max-width: 760px;
    margin-bottom: 42px;
}

.blog-heading > span,
.modal-kicker {
    color: var(--blog-lime);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.9px;
    text-transform: uppercase;
}

.blog-heading h1 {
    margin: 10px 0 12px;
    color: var(--blog-text);
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.05;
    letter-spacing: -1.5px;
}

.blog-heading p {
    margin: 0;
    color: #cbd5e1;
    font-size: 17px;
    line-height: 1.7;
}

.masonry-grid {
    column-count: 3;
    column-gap: 24px;
}

.card-white,
.card-legacy {
    break-inside: avoid;
    margin: 0 0 24px;
    border: 1px solid var(--blog-border);
    border-radius: 20px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.card-white {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: var(--blog-card);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card-white:hover {
    transform: translateY(-4px);
    border-color: rgba(144, 234, 42, 0.3);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
}

.card-white > img {
    width: 100%;
    height: auto;
    max-height: 360px;
    margin-bottom: 17px;
    border-radius: 14px;
    object-fit: cover;
}

.card-tag {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 3px 0 11px;
    color: var(--blog-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.card-tag span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--blog-lime);
}

.card-white h2 {
    margin: 0 0 9px;
    color: var(--blog-text);
    font-size: 19px;
    line-height: 1.35;
}

.card-white p {
    margin: 0 0 20px;
    color: var(--blog-muted);
    font-size: 14px;
    line-height: 1.65;
}

.read-article {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 8px;
    margin-top: auto;
    padding: 9px 13px;
    border: 1px solid rgba(144, 234, 42, 0.3);
    border-radius: 999px;
    background: rgba(144, 234, 42, 0.08);
    color: var(--blog-lime);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.read-article:hover {
    background: var(--blog-lime);
    color: #0f172a;
}

.card-legacy {
    padding: 28px;
    background: linear-gradient(145deg, var(--blog-card-soft), #0c1424);
}

.card-legacy > span {
    color: var(--blog-lime);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.card-legacy blockquote {
    margin: 18px 0;
    color: #fff;
    font-size: 21px;
    font-weight: 600;
    font-style: italic;
    line-height: 1.55;
}

.card-legacy p {
    margin: 0;
    color: var(--blog-muted);
    font-size: 12px;
    font-weight: 700;
}

.article-dialog {
    width: min(680px, calc(100% - 32px));
    max-height: 90vh;
    padding: 0;
    border: 1px solid var(--blog-border);
    border-radius: 24px;
    background: var(--blog-card);
    color: var(--blog-text);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65);
    overflow: hidden;
}

.article-dialog::backdrop {
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(8, 14, 26, 0.78);
    color: #fff;
    cursor: pointer;
}

.modal-header-img {
    display: block;
    width: 100%;
    height: 310px;
    object-fit: cover;
}

.modal-header-color {
    height: 120px;
    background:
        radial-gradient(circle at 70% 20%, rgba(144, 234, 42, 0.28), transparent 13rem),
        linear-gradient(135deg, #17233a, #080e1a);
}

.modal-text-content {
    padding: 38px 42px 44px;
}

.modal-title {
    margin: 10px 0 14px;
    color: #fff;
    font-size: clamp(25px, 5vw, 34px);
    line-height: 1.2;
}

.modal-lead {
    color: #cbd5e1;
    font-size: 17px;
    line-height: 1.7;
}

.modal-text-content h3 {
    margin: 28px 0 10px;
    color: #fff;
    font-size: 18px;
}

.modal-text-content p,
.modal-text-content li {
    color: var(--blog-muted);
    font-size: 14px;
    line-height: 1.75;
}

.modal-text-content ul,
.modal-text-content ol {
    margin: 12px 0 22px;
    padding-left: 23px;
}

@media (max-width: 1000px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 620px) {
    .blog-container {
        padding: calc(46px + var(--site-logo-overhang, 26px)) 14px 110px;
    }

    .blog-heading {
        padding: 0 7px;
    }

    .masonry-grid {
        column-count: 1;
    }

    .card-white,
    .card-legacy {
        margin-bottom: 16px;
        border-radius: 18px;
    }

    .card-white > img {
        max-height: 520px;
    }

    .article-dialog {
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
        border-radius: 20px;
    }

    .modal-content {
        max-height: calc(100vh - 20px);
    }

    .modal-header-img {
        height: 220px;
    }

    .modal-text-content {
        padding: 30px 23px 36px;
    }
}
