/* =============================================
   ReadyBlocks — Brand Theme
   Primary: #CE2029  |  Dark surfaces  |  Sharp
   ============================================= */

:root {
    /* Brand palette */
    --rb-red:         #CE2029;
    --rb-red-dk:      #8B0F1A;
    --rb-red-br:      #E8253A;
    --rb-red-dim:     rgba(206,32,41,.15);
    --rb-red-border:  rgba(206,32,41,.35);

    /* Dark surfaces */
    --bg:             #111111;
    --bg-2:           #181818;
    --bg-3:           #222222;
    --bg-4:           #2a2a2a;

    /* Text */
    --text:           #f0f0f0;
    --text-muted:     #6e6e6e;
    --text-dim:       #9a9a9a;
    --border:         #2a2a2a;
    --divider:        #1e1e1e;

    /* Typography */
    --font-display:   "Zen Dots", monospace;
    --font-body:      system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono:      "Fira Code", "Cascadia Code", monospace;

    /* Shape — brand requires sharp edges */
    --radius:         0px;

    /* Shadows */
    --shadow-sm:      0 1px 3px rgba(0,0,0,.6);
    --shadow-md:      0 4px 16px rgba(0,0,0,.5);
    --shadow-lg:      0 12px 32px rgba(0,0,0,.6);
    --shadow-red:     0 4px 20px rgba(206,32,41,.3);

    --max-w:          1200px;
    --narrow-w:       760px;
}

/* ── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--rb-red); text-decoration: none; transition: color .15s; }
a:hover { color: var(--rb-red-br); }
ul { list-style: none; }

/* ── Layout ────────────────────────────────── */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
}
.container--narrow {
    max-width: var(--narrow-w);
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Buttons ───────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    line-height: 1;
    transition: all .18s;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: .3px;
}
.btn-primary {
    background: var(--rb-red);
    color: #fff;
    border-color: var(--rb-red);
}
.btn-primary:hover {
    background: var(--rb-red-br);
    border-color: var(--rb-red-br);
    color: #fff;
    box-shadow: var(--shadow-red);
    transform: translateY(-1px);
}
.btn-outline {
    background: transparent;
    color: var(--rb-red);
    border-color: var(--rb-red);
}
.btn-outline:hover {
    background: var(--rb-red);
    color: #fff;
    transform: translateY(-1px);
}
.btn-ghost {
    background: rgba(255,255,255,.05);
    color: rgba(255,255,255,.8);
    border-color: rgba(255,255,255,.15);
}
.btn-ghost:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
    border-color: rgba(255,255,255,.3);
}
.btn-white {
    background: #fff;
    color: var(--rb-red);
    border-color: #fff;
}
.btn-white:hover {
    background: #f0f0f0;
    color: var(--rb-red-dk);
    transform: translateY(-1px);
}
.btn-ghost-light {
    background: transparent;
    color: rgba(255,255,255,.75);
    border-color: rgba(255,255,255,.25);
}
.btn-ghost-light:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
    border-color: rgba(255,255,255,.4);
}

/* ── Header ────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(17,17,17,.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.site-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-img {
    height: 38px;
    width: auto;
}

/* Nav */
.site-nav { display: flex; align-items: center; }
.nav-toggle { display: none; }
.nav-toggle-label { display: none; }
.nav-list {
    display: flex;
    align-items: center;
    gap: 2px;
}
.nav-list li a {
    display: block;
    padding: 7px 13px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: all .15s;
    text-decoration: none;
    letter-spacing: .2px;
}
.nav-list li a:hover,
.nav-list li a.current {
    color: var(--text);
    background: var(--bg-3);
}
.nav-list li .nav-cta {
    background: var(--rb-red);
    color: #fff;
    margin-left: 8px;
    padding: 7px 16px;
    font-weight: 600;
}
.nav-list li .nav-cta:hover {
    background: var(--rb-red-br);
    color: #fff;
    box-shadow: var(--shadow-red);
}

/* ── Hero ──────────────────────────────────── */
.hero {
    background: var(--bg);
    padding: 96px 0 80px;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--border);
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 70% at 70% 50%, rgba(206,32,41,.07) 0%, transparent 70%),
        radial-gradient(ellipse 30% 50% at 10% 80%, rgba(206,32,41,.05) 0%, transparent 60%);
    pointer-events: none;
}
/* Red left accent bar */
.hero::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--rb-red) 0%, var(--rb-red-dk) 100%);
}
.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: var(--rb-red-dim);
    color: var(--rb-red-br);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 1px solid var(--rb-red-border);
    margin-bottom: 20px;
    font-family: var(--font-display);
}
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 4.5vw, 54px);
    font-weight: 400; /* Zen Dots is already heavy */
    color: var(--text);
    line-height: 1.12;
    letter-spacing: 1px;
    margin-bottom: 18px;
}
.hero-title span { color: var(--rb-red); }
.hero-description {
    font-size: 17px;
    color: var(--text-muted);
    max-width: 500px;
    margin-bottom: 32px;
    line-height: 1.75;
}
.hero-cta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 36px;
}
.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-3);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border);
    letter-spacing: .3px;
}

/* Code block decoration */
.hero-code { display: flex; align-items: center; justify-content: center; }
.code-block {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-top: 2px solid var(--rb-red);
    overflow: hidden;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
}
.code-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg-3);
    border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; }
.dot.red    { background: var(--rb-red); }
.dot.yellow { background: #a07000; }
.dot.green  { background: #1a5c1a; }
.code-filename {
    margin-left: 8px;
    color: var(--text-muted);
    font-size: 12px;
}
.code-block pre {
    padding: 20px;
    overflow-x: auto;
    background: transparent;
    margin: 0;
}
.code-block code {
    color: var(--text-dim);
    background: transparent;
    border: none;
    padding: 0;
    font-size: inherit;
}
.code-block .kw  { color: var(--rb-red); }
.code-block .cls { color: #f0f0f0; font-family: var(--font-display); font-size: 12px; }
.code-block .str { color: #aaa; }
.code-block .num { color: var(--rb-red-br); }
.code-block .cmt { color: #444; }

/* ── Section headings ──────────────────────── */
.section-header { margin-bottom: 48px; }
.section-title {
    font-family: var(--font-display);
    font-size: clamp(20px, 2.5vw, 28px);
    font-weight: 400;
    color: var(--text);
    letter-spacing: 1px;
    margin-bottom: 10px;
}
/* Red underline accent on section titles */
.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: var(--rb-red);
    margin-top: 10px;
}
.section-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 560px;
    line-height: 1.7;
}

/* ── Expertise ─────────────────────────────── */
.expertise {
    padding: 88px 0;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.expertise-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px; /* gap via border trick for sharp grid */
    background: var(--border);
    border: 1px solid var(--border);
}
.expertise-card {
    background: var(--bg-2);
    padding: 28px;
    transition: background .2s;
    position: relative;
}
.expertise-card:hover {
    background: var(--bg-3);
}
.expertise-card:hover .expertise-icon {
    background: var(--rb-red);
    color: #fff;
}
.expertise-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rb-red-dim);
    color: var(--rb-red);
    border: 1px solid var(--rb-red-border);
    margin-bottom: 16px;
    transition: all .2s;
}
.expertise-card h3 {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 10px;
    letter-spacing: .8px;
    text-transform: uppercase;
}
.expertise-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 16px;
}
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag-list span {
    padding: 3px 8px;
    background: var(--bg-4);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    letter-spacing: .3px;
}

/* ── Certifications bar ────────────────────── */
.certifications-bar {
    background: var(--bg);
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.certifications-bar .container {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.certs-label {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    font-family: var(--font-display);
}
.cert-list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}
.cert-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
}
.cert-badge {
    display: inline-block;
    padding: 2px 7px;
    background: var(--rb-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    white-space: nowrap;
    font-family: var(--font-display);
}
.cert-badge.udacity { background: var(--bg-3); color: var(--text-dim); border: 1px solid var(--border); }
.cert-item--badge { align-items: center; }
.cert-img { width: 48px; height: 48px; display: block; flex-shrink: 0; }

/* ── Stats strip ───────────────────────────── */
.experience-strip {
    background: var(--bg);
    padding: 56px 0;
    border-bottom: 1px solid var(--border);
}
.exp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
}
.exp-item {
    background: var(--bg);
    padding: 32px 24px;
    text-align: center;
    transition: background .2s;
}
.exp-item:hover { background: var(--bg-2); }
.exp-number {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(36px, 4vw, 52px);
    font-weight: 400;
    color: var(--rb-red);
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: 2px;
}
.exp-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: .3px;
    text-transform: uppercase;
    font-size: 11px;
}

/* ── Posts ─────────────────────────────────── */
.insights {
    padding: 88px 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
}
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    margin-bottom: 40px;
}
.posts-grid--3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
}
.post-card {
    background: var(--bg-2);
    display: flex;
    flex-direction: column;
    transition: background .2s;
}
.post-card:hover { background: var(--bg-3); }
.post-card--featured { grid-column: span 2; }
.post-card-image-wrap { overflow: hidden; position: relative; }
.post-card-image-wrap img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform .4s;
    filter: saturate(.85);
}
.post-card--featured .post-card-image-wrap img { height: 260px; }
.post-card:hover .post-card-image-wrap img {
    transform: scale(1.04);
    filter: saturate(1);
}
.post-card-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.post-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--rb-red);
    margin-bottom: 10px;
    text-decoration: none;
    font-family: var(--font-display);
}
.post-tag:hover { color: var(--rb-red-br); }
.post-card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    margin-bottom: 10px;
    flex: 1;
}
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--rb-red); }
.post-card-excerpt {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}
.post-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: auto;
    font-family: var(--font-mono);
}
.pagination-wrap {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

/* ── CTA ───────────────────────────────────── */
.cta-section {
    background: var(--rb-red);
    padding: 80px 0;
    position: relative;
    border-top: 1px solid var(--rb-red-dk);
    border-bottom: 1px solid var(--rb-red-dk);
}
.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 20px,
        rgba(0,0,0,.04) 20px,
        rgba(0,0,0,.04) 21px
    );
    pointer-events: none;
}
.cta-inner {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}
.cta-inner h2 {
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 36px);
    font-weight: 400;
    color: #fff;
    letter-spacing: 1px;
    margin-bottom: 14px;
}
.cta-inner p {
    font-size: 16px;
    color: rgba(255,255,255,.8);
    margin-bottom: 32px;
    line-height: 1.7;
}
.cta-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Footer ────────────────────────────────── */
.site-footer {
    background: var(--bg-2);
    color: var(--text-muted);
    padding: 56px 0 0;
    border-top: 1px solid var(--border);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--border);
}
.footer-logo {
    display: inline-block;
    text-decoration: none;
    margin-bottom: 14px;
}
.footer-logo img { height: 32px; width: auto; }
.footer-brand p {
    font-size: 14px;
    line-height: 1.7;
    max-width: 300px;
    margin-bottom: 20px;
}
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}
.social-links a {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    font-size: 14px;
    text-decoration: none;
    transition: color .15s;
}
.social-links a:hover { color: var(--rb-red); }
.footer-links h4,
.footer-contact h4 {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 400;
    color: var(--rb-red);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}
.footer-links ul { display: flex; flex-direction: column; gap: 8px; }
.footer-links li a {
    color: var(--text-muted);
    font-size: 14px;
    text-decoration: none;
    transition: color .15s;
}
.footer-links li a:hover { color: var(--text); }
.footer-contact p { font-size: 14px; margin-bottom: 8px; line-height: 1.6; }
.footer-contact a { color: var(--text-muted); text-decoration: none; transition: color .15s; }
.footer-contact a:hover { color: var(--rb-red); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    font-size: 12px;
    gap: 16px;
    color: var(--text-muted);
    border-top: 1px solid var(--divider);
}

/* ── Single Post ───────────────────────────── */
.post-header {
    padding: 56px 0 48px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
    background: var(--bg-2);
    border-left: 3px solid var(--rb-red);
    padding-left: 21px; /* offset the border */
}
.post-header .container--narrow { padding-left: 21px; }
.post-title {
    font-family: var(--font-display);
    font-size: clamp(24px, 3.5vw, 40px);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: .5px;
    color: var(--text);
    margin: 12px 0;
}
.post-excerpt {
    font-size: 18px;
    color: var(--text-muted);
    line-height: 1.65;
    margin-top: 14px;
}
.post-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 20px;
    flex-wrap: wrap;
    font-family: var(--font-mono);
}
.post-meta-sep { color: var(--rb-red); }
.post-author { display: flex; align-items: center; gap: 8px; }
.author-avatar { width: 28px; height: 28px; object-fit: cover; }
.post-feature-image { margin-bottom: 48px; }
.post-feature-image figure { overflow: hidden; }
.post-feature-image img { width: 100%; max-height: 520px; object-fit: cover; }
.post-feature-image figcaption {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    padding: 10px 0;
    font-style: italic;
}
.post-body { padding-bottom: 80px; }
.post-content {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text);
}
.post-content h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 400;
    color: var(--text);
    margin: 48px 0 18px;
    letter-spacing: .5px;
    padding-left: 12px;
    border-left: 3px solid var(--rb-red);
}
.post-content h3 {
    font-size: 19px;
    font-weight: 600;
    color: var(--text);
    margin: 36px 0 14px;
}
.post-content h4 { font-size: 16px; font-weight: 600; margin: 28px 0 12px; }
.post-content p  { margin-bottom: 22px; }
.post-content ul,
.post-content ol { margin: 0 0 22px 24px; }
.post-content li { margin-bottom: 8px; line-height: 1.75; }
.post-content blockquote {
    border-left: 3px solid var(--rb-red);
    padding: 4px 0 4px 20px;
    margin: 32px 0;
    color: var(--text-muted);
    font-style: italic;
    font-size: 18px;
    background: var(--bg-2);
}
.post-content code {
    font-family: var(--font-mono);
    font-size: .85em;
    background: var(--bg-3);
    padding: 2px 6px;
    border: 1px solid var(--border);
    color: var(--rb-red-br);
}
.post-content pre {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-top: 2px solid var(--rb-red);
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 28px;
}
.post-content pre code {
    background: none; border: none; padding: 0;
    color: var(--text-dim); font-size: 14px;
}
.post-content img { margin: 32px 0; }
.post-content a {
    color: var(--rb-red);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.post-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 48px 0;
}
.post-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.post-tags .post-tag {
    padding: 5px 12px;
    background: var(--bg-3);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    border: 1px solid var(--border);
    font-family: var(--font-mono);
}
.post-tags .post-tag:hover {
    background: var(--rb-red);
    color: #fff;
    border-color: var(--rb-red);
}

/* Related posts */
.related-posts {
    padding: 56px 0;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
}

/* ── Page ──────────────────────────────────── */
.page-single { padding-bottom: 80px; }
.page-header {
    padding: 56px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
    background: var(--bg-2);
}
.page-header h1 {
    font-family: var(--font-display);
    font-size: clamp(24px, 3.5vw, 40px);
    font-weight: 400;
    letter-spacing: .5px;
    color: var(--text);
}
.page-content {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text);
}

/* ── Archive ───────────────────────────────── */
.archive-header {
    background: var(--bg-2);
    padding: 64px 0 56px;
    border-bottom: 1px solid var(--border);
    border-left: 3px solid var(--rb-red);
}
.archive-label {
    display: inline-block;
    padding: 3px 10px;
    background: var(--rb-red-dim);
    color: var(--rb-red-br);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    border: 1px solid var(--rb-red-border);
    margin-bottom: 14px;
    font-family: var(--font-display);
}
.archive-header h1 {
    font-family: var(--font-display);
    font-size: clamp(24px, 3.5vw, 40px);
    font-weight: 400;
    letter-spacing: .5px;
    color: var(--text);
    margin-bottom: 10px;
}
.archive-header p { color: var(--text-muted); font-size: 15px; max-width: 480px; }
.archive-count { margin-top: 14px; font-size: 13px; color: var(--text-muted); font-family: var(--font-mono); }
.archive-feed { padding: 56px 0; background: var(--bg); }

/* ── Koenig editor ─────────────────────────── */
.kg-width-wide {
    margin-left:  calc(50% - 50vw + 24px);
    margin-right: calc(50% - 50vw + 24px);
    max-width:    min(1200px, calc(100vw - 48px));
    width:        min(1200px, calc(100vw - 48px));
}
.kg-width-full {
    margin-left:  calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width:    100vw;
    width:        100vw;
}
.kg-width-wide img,
.kg-width-full img { width: 100%; height: auto; }

/* ── Error pages ───────────────────────────── */
.error-page {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 24px;
}
.error-code {
    display: block;
    font-family: var(--font-display);
    font-size: 100px;
    font-weight: 400;
    color: var(--rb-red);
    line-height: 1;
    margin-bottom: 16px;
    letter-spacing: 4px;
}
.error-page h1 { font-size: 24px; font-weight: 600; margin-bottom: 12px; }
.error-page p  { color: var(--text-muted); margin-bottom: 28px; font-size: 15px; }

/* ── Responsive ────────────────────────────── */
@media (max-width: 1024px) {
    .hero .container    { grid-template-columns: 1fr; gap: 40px; }
    .hero-code          { display: none; }
    .expertise-grid     { grid-template-columns: repeat(2, 1fr); }
    .exp-grid           { grid-template-columns: repeat(2, 1fr); }
    .footer-grid        { grid-template-columns: 1fr 1fr; }
    .footer-brand       { grid-column: span 2; }
    .post-card--featured{ grid-column: span 1; }
}

@media (max-width: 768px) {
    /* Mobile nav */
    .nav-toggle-label {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        padding: 8px;
    }
    .nav-toggle-label span {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--text-muted);
        transition: all .2s;
    }
    .nav-toggle:checked + .nav-toggle-label span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle:checked + .nav-toggle-label span:nth-child(2) { opacity: 0; }
    .nav-toggle:checked + .nav-toggle-label span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .nav-list {
        display: none;
        position: absolute;
        top: 64px;
        left: 0; right: 0;
        background: var(--bg-2);
        flex-direction: column;
        padding: 12px;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        align-items: stretch;
    }
    .nav-list li a { padding: 10px 14px; }
    .nav-toggle:checked ~ .nav-list { display: flex; }

    .hero           { padding: 60px 0 56px; }
    .hero::after    { display: none; }
    .expertise      { padding: 64px 0; }
    .expertise-grid { grid-template-columns: 1fr; }
    .insights       { padding: 64px 0; }
    .posts-grid, .posts-grid--3 {
        grid-template-columns: 1fr;
        gap: 1px;
    }
    .exp-grid           { grid-template-columns: repeat(2, 1fr); }
    .cta-section        { padding: 56px 0; }
    .footer-grid        { grid-template-columns: 1fr; gap: 32px; }
    .footer-brand       { grid-column: span 1; }
    .footer-bottom      { flex-direction: column; text-align: center; }
    .certifications-bar .container { flex-direction: column; align-items: flex-start; gap: 12px; }
    .post-header        { border-left: none; padding-left: 0; }
    .post-header .container--narrow { padding-left: 24px; }
}

@media (max-width: 480px) {
    .hero-cta       { flex-direction: column; }
    .hero-cta .btn  { width: 100%; justify-content: center; }
    .cta-actions    { flex-direction: column; }
    .cta-actions .btn { width: 100%; justify-content: center; }
    .exp-grid       { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mustafa modal ─────────────────────────── */
.mmodal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.mmodal.is-open, .mmodal[style*="flex"] { display: flex !important; }
.mmodal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.75);
    backdrop-filter: blur(4px);
}
.mmodal-card {
    position: relative;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-top: 3px solid var(--rb-red);
    padding: 40px 36px 32px;
    max-width: 440px;
    width: 100%;
    animation: mmodal-in .18s ease;
}
@keyframes mmodal-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.mmodal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    transition: color .15s;
}
.mmodal-close:hover { color: var(--text); }
.mmodal-avatar {
    margin-bottom: 20px;
}
.mmodal-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--bg-3);
    border: 1px solid var(--border);
}
.mmodal-name {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--text);
    letter-spacing: .5px;
    margin-bottom: 4px;
}
.mmodal-title {
    font-size: 12px;
    color: var(--rb-red);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 18px;
}
.mmodal-bio {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0 0 10px;
}
.mmodal-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.mmodal-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-family: var(--font-mono);
    text-decoration: none;
    color: var(--text-dim);
    transition: color .15s;
    padding: 6px 0;
}
.mmodal-link:hover { color: var(--text); }
.mmodal-link svg { flex-shrink: 0; opacity: .7; }
.mmodal-link--email:hover  { color: var(--text); }
.mmodal-link--linkedin:hover { color: #0A66C2; }
.mmodal-link--cal:hover    { color: var(--rb-red); }

@media (max-width: 480px) {
    .mmodal-card { padding: 32px 24px 24px; }
}
