:root {
    --bg-deep: #030308;
    --bg-surface: rgba(8, 8, 16, 0.72);
    --bg-card: rgba(6, 6, 12, 0.6);
    --border: rgba(255, 255, 255, 0.06);
    --text: #e8eaef;
    --text-muted: #6b7280;
    --red: #ff2d55;
    --red-dim: rgba(255, 45, 85, 0.15);
    --red-glow: rgba(255, 45, 85, 0.45);
    /* Softer red reserved for reading text (inline code, headings) so long
       writeups stay readable in dark mode without dropping the neon accent. */
    --content-red: #f0b4be;
    --content-red-dim: rgba(240, 180, 190, 0.12);
    --content-red-border: rgba(240, 180, 190, 0.22);
    /* Inline code in prose — cyan-blue accent (matches theme, easy on the eyes) */
    --inline-code-fg: #8ed4ff;
    --inline-code-bg: rgba(0, 180, 255, 0.11);
    --inline-code-border: rgba(0, 180, 255, 0.26);
    --list-marker: #5eb8e8;
    /* Opaque table surfaces — no background canvas bleed-through */
    --table-bg: #090911;
    --table-head-bg: #0f1520;
    --table-cell-bg: #090911;
    --table-row-alt: #0d0d16;
    --table-row-hover: #121a2a;
    /* Syntax palette (Prism tokens) */
    --syn-comment: #7a8494;
    --syn-keyword: #ff9eb0;
    --syn-string: #98e6a0;
    --syn-number: #d2a8ff;
    --syn-function: #67c1ff;
    --syn-class: #ffb86a;
    --syn-variable: #79eaff;
    --syn-operator: #8ecfd6;
    --syn-punctuation: #9aa4b2;
    --syn-tag: #ff9ebb;
    --syn-attr: #ffd580;
    --syn-property: #67c1ff;
    --syn-directive: #c792ea;
    --syn-regex: #98e6a0;
    --syn-escape: #8ecfd6;
    --syn-plain: #e8eaef;
    --blue: #00b4ff;
    --blue-dim: rgba(0, 180, 255, 0.15);
    --blue-glow: rgba(0, 180, 255, 0.45);
    --purple: #a855f7;
    --purple-dim: rgba(168, 85, 247, 0.15);
    --bounty: #eab308;
    --bounty-dim: rgba(234, 179, 8, 0.15);
    --mobile: #39ff14;
    --mobile-dim: rgba(57, 255, 20, 0.15);
    --mobile-glow: rgba(57, 255, 20, 0.45);
    --font-hacker: 'Share Tech Mono', monospace;
    --font-mono: 'JetBrains Mono', monospace;
    --font-fa: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    --page-width: 1200px;
    --content-width: 960px;
}

@keyframes rb-gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes rb-glow {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 45, 85, 0.5)); }
    50% { filter: drop-shadow(0 0 10px rgba(0, 180, 255, 0.6)); }
}

@keyframes glitch-flicker {
    0%, 95%, 100% { opacity: 1; transform: translate(0); }
    96% { opacity: 0.85; transform: translate(-2px, 1px); }
    97% { opacity: 1; transform: translate(2px, -1px); }
    98% { opacity: 0.9; transform: translate(0); }
}

@keyframes letter-rb {
    0%, 100% {
        color: var(--red);
        text-shadow: 0 0 10px var(--red-glow), 0 0 24px rgba(255, 45, 85, 0.25);
    }
    50% {
        color: var(--blue);
        text-shadow: 0 0 10px var(--blue-glow), 0 0 24px rgba(0, 180, 255, 0.25);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes blink {
    50% { opacity: 0; }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

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

html { scroll-behavior: smooth; }

.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 200;
    padding: 0.65rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
}

.skip-link:focus {
    top: 1rem;
}

body {
    background: var(--bg-deep);
    color: var(--text);
    font-family: var(--font-mono);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.6;
    font-size: 0.875rem;
    transition: background-color 0.35s ease, color 0.35s ease;
}

body.ninja-cursor-active,
body.ninja-cursor-active * {
    cursor: none !important;
}

.ninja-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 28px;
    height: 28px;
    z-index: 10000;
    pointer-events: none;
    will-change: transform;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
    transition: filter 0.15s ease;
}

.ninja-cursor.is-tapping {
    filter: drop-shadow(0 2px 6px rgba(255, 45, 85, 0.55));
}

.ninja-tap-impact {
    position: fixed;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    border: 2px solid var(--red);
    box-shadow: 0 0 10px var(--red-glow);
    pointer-events: none;
    z-index: 9999;
    animation: ninja-tap-ring 0.38s ease-out forwards;
}

@keyframes ninja-tap-ring {
    from {
        transform: scale(0.35);
        opacity: 0.9;
    }
    to {
        transform: scale(2.4);
        opacity: 0;
    }
}

html[data-theme="light"] .ninja-tap-impact {
    border-color: var(--red);
    box-shadow: 0 0 8px rgba(217, 21, 69, 0.35);
}

.ninja-cursor svg {
    display: block;
    width: 100%;
    height: 100%;
}

html[data-theme="light"] .ninja-cursor {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

@media (pointer: coarse), (prefers-reduced-motion: reduce) {
    body.ninja-cursor-active,
    body.ninja-cursor-active * {
        cursor: auto !important;
    }

    .ninja-cursor {
        display: none !important;
    }
}

#network-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.scanlines {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

.gradient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
    transition: transform 0.4s ease-out;
}

.orb-red {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--red-glow) 0%, transparent 70%);
    top: -200px;
    left: -150px;
    opacity: var(--orb-red-opacity, 0.35);
    transition: opacity 0.6s ease;
}

.orb-blue {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, var(--blue-glow) 0%, transparent 70%);
    bottom: -180px;
    right: -120px;
    opacity: var(--orb-blue-opacity, 0.35);
    transition: opacity 0.6s ease;
}

.accent-ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: var(--accent-ambient-opacity, 0);
    background:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(var(--accent-r, 255), var(--accent-g, 45), var(--accent-b, 85), 0.14) 0%, transparent 55%),
        radial-gradient(ellipse 70% 45% at 80% 110%, rgba(var(--accent-r, 255), var(--accent-g, 45), var(--accent-b, 85), 0.08) 0%, transparent 50%);
    transition: opacity 0.8s ease;
}

html[data-team-accent="red"] .orb-red { opacity: var(--orb-red-opacity, 0.62); }
html[data-team-accent="red"] .orb-blue { opacity: var(--orb-blue-opacity, 0.06); }
html[data-team-accent="blue"] .orb-blue { opacity: var(--orb-blue-opacity, 0.62); }
html[data-team-accent="blue"] .orb-red { opacity: var(--orb-red-opacity, 0.06); }
html[data-team-accent="purple"] .orb-red { opacity: var(--orb-red-opacity, 0.18); }
html[data-team-accent="purple"] .orb-blue { opacity: var(--orb-blue-opacity, 0.18); }
html[data-team-accent="bounty"] .orb-red { opacity: var(--orb-red-opacity, 0.22); }
html[data-team-accent="bounty"] .orb-blue { opacity: var(--orb-blue-opacity, 0.14); }
html[data-team-accent="mobile"] .orb-red { opacity: var(--orb-red-opacity, 0.08); }
html[data-team-accent="mobile"] .orb-blue { opacity: var(--orb-blue-opacity, 0.10); }

html[data-team-accent="red"] body {
    background: var(--bg-deep);
}

html[data-team-accent="blue"] body {
    background: var(--bg-deep);
}

html[data-team-accent="purple"] body {
    background: var(--bg-deep);
}

html[data-team-accent="bounty"] body {
    background: var(--bg-deep);
}

html[data-team-accent="mobile"] body {
    background: var(--bg-deep);
}

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    z-index: 100;
    background: linear-gradient(90deg, var(--red), var(--blue));
    box-shadow: 0 0 8px var(--red-glow);
    transition: width 0.1s linear;
}

.page {
    position: relative;
    z-index: 2;
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.post-full,
.page-full,
.author-full {
    flex: 1;
    width: 100%;
}

/* Header */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
    position: relative;
    transition: border-bottom-color 0.7s ease, box-shadow 0.7s ease;
}

html[data-team-accent="red"] .site-header { border-bottom-color: rgba(255, 45, 85, 0.22); }
html[data-team-accent="blue"] .site-header { border-bottom-color: rgba(0, 180, 255, 0.22); }
html[data-team-accent="purple"] .site-header { border-bottom-color: rgba(168, 85, 247, 0.22); }
html[data-team-accent="bounty"] .site-header { border-bottom-color: rgba(234, 179, 8, 0.22); }
html[data-team-accent="mobile"] .site-header { border-bottom-color: rgba(57, 255, 20, 0.22); }

.logo {
    font-family: var(--font-hacker);
    font-size: 1.35rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-decoration: none;
    display: inline-flex;
    align-items: baseline;
    flex-shrink: 0;
}

.logo-letter {
    display: inline-block;
    animation: letter-rb 2.8s ease-in-out infinite;
}

.logo-letter:nth-child(1) { animation-delay: 0s; }
.logo-letter:nth-child(2) { animation-delay: 0.12s; }
.logo-letter:nth-child(3) { animation-delay: 0.24s; }
.logo-letter:nth-child(4) { animation-delay: 0.36s; }
.logo-letter:nth-child(5) { animation-delay: 0.48s; }
.logo-letter:nth-child(6) { animation-delay: 0.6s; }

/* Header category bar — minimal */
.header-categories {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 0.35rem;
    min-width: 0;
    flex-wrap: nowrap;
}

.header-cat-item {
    position: relative;
    flex-shrink: 1;
    min-width: 0;
}

/* Hover bridge — keeps dropdown open while moving the mouse down */
.header-cat-item::after {
    content: '';
    position: absolute;
    left: -0.25rem;
    right: -0.25rem;
    top: 100%;
    height: 0.85rem;
    z-index: 69;
}

.nav-simple-item {
    position: relative;
}

.nav-simple-trigger,
.nav-simple-link,
.nav-simple-heading {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.2s, background 0.2s;
    line-height: 1.4;
}

button.nav-simple-trigger {
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    padding: 0.75rem 1rem;
}

a.nav-simple-trigger,
.header-cat-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.65rem;
    white-space: nowrap;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.header-cat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
    color: inherit;
    opacity: 0.92;
    transition: opacity 0.2s;
}

.header-cat-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.header-cat-label {
    line-height: 1;
}

.header-cat-item:hover .header-cat-icon,
.header-cat-item:focus-within .header-cat-icon,
.header-cat-link.is-active .header-cat-icon {
    opacity: 1;
}

.header-cat-item[data-team="red"]:hover .header-cat-link,
.header-cat-item[data-team="red"] .header-cat-link.is-active { color: var(--red); }
.header-cat-item[data-team="blue"]:hover .header-cat-link,
.header-cat-item[data-team="blue"] .header-cat-link.is-active { color: var(--blue); }
.header-cat-item[data-team="purple"]:hover .header-cat-link,
.header-cat-item[data-team="purple"] .header-cat-link.is-active { color: var(--purple); }
.header-cat-item[data-team="bounty"]:hover .header-cat-link,
.header-cat-item[data-team="bounty"] .header-cat-link.is-active { color: var(--bounty); }
.header-cat-item[data-team="mobile"]:hover .header-cat-link,
.header-cat-item[data-team="mobile"] .header-cat-link.is-active { color: var(--mobile); }

.nav-simple-link {
    padding: 0.7rem 1rem;
}

.nav-simple-trigger:hover,
.nav-simple-link:hover,
.nav-simple-link.is-active {
    color: var(--text);
}

.nav-simple-panel {
    display: none;
    flex-direction: column;
    gap: 0;
}

.header-cat-dropdown {
    position: absolute;
    top: calc(100% + 0.85rem);
    left: 50%;
    transform: translateX(-50%);
    min-width: 280px;
    max-width: 320px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 0.65rem 0;
    background: rgba(8, 8, 14, 0.98);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
    z-index: 70;
}

.header-cat-dropdown::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: -1rem;
    right: -1rem;
    height: 0.85rem;
}

.header-cat-item:hover .header-cat-dropdown,
.header-cat-item:focus-within .header-cat-dropdown {
    display: flex;
}

.nav-simple-sub {
    padding: 0.55rem 1rem;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-top: 1px solid var(--border);
}

.nav-simple-sub:first-child {
    border-top: none;
}

.nav-simple-section {
    padding: 0.35rem 0;
    border-top: 1px solid var(--border);
}

.nav-simple-section:first-child {
    border-top: none;
}

.nav-simple-heading {
    padding: 0.55rem 1rem 0.35rem;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    color: var(--text);
}

.nav-simple-heading:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.nav-simple-topic {
    padding: 0.45rem 1rem 0.45rem 1.25rem;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: none;
}

.nav-simple-all {
    padding: 0.55rem 1rem;
    font-size: 0.68rem;
    opacity: 0.85;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.2rem;
}

.header-nav-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.header-nav-link {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.25s;
    position: relative;
}

.header-nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--red), var(--blue));
    transition: width 0.3s;
}

.header-nav-link:hover {
    color: var(--text);
}

.header-nav-link:hover::after {
    width: 100%;
}

.menu-wrap {
    position: relative;
}

.nav-menus {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    left: auto;
    z-index: 60;
}

.nav-menus.open {
    display: block;
}

.nav-flyout {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 280px;
    max-width: min(92vw, 320px);
    max-height: min(80vh, 620px);
    overflow-y: auto;
    padding: 0.65rem 0;
    background: rgba(8, 8, 14, 0.98);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
    animation: flyout-in 0.2s ease;
}

.nav-flyout-simple .nav-flyout-home {
    margin-bottom: 0;
}

.topics-flyout-menu {
    display: flex;
    flex-direction: column;
}

.nav-flyout-group .nav-flyout-nested {
    display: none;
    padding: 0;
    border-left: none;
    margin-left: 0;
}

.nav-flyout-group .nav-flyout-nested:not([hidden]) {
    display: flex;
    flex-direction: column;
}

.nav-flyout-group .nav-flyout-expand {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.nav-flyout-group .header-cat-icon {
    width: 0.9rem;
    height: 0.9rem;
}

.nav-flyout-expand[aria-expanded="true"] {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

@keyframes flyout-in {
    from { opacity: 0; transform: translateX(6px); }
    to { opacity: 1; transform: translateX(0); }
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 0.35rem 0;
}

.nav-flyout-link {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.65rem 0.85rem;
    border-radius: 0;
    transition: color 0.2s, background 0.2s;
}

.nav-flyout-link:hover,
.nav-flyout-link.is-active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

html[data-team-accent="red"] .menu-btn:hover,
html[data-team-accent="red"] .menu-btn[aria-expanded="true"] {
    border-color: rgba(255, 45, 85, 0.45);
    box-shadow: 0 0 18px var(--red-dim);
    color: var(--red);
}

html[data-team-accent="blue"] .menu-btn:hover,
html[data-team-accent="blue"] .menu-btn[aria-expanded="true"] {
    border-color: rgba(0, 180, 255, 0.45);
    box-shadow: 0 0 18px var(--blue-dim);
    color: var(--blue);
}

html[data-team-accent="purple"] .menu-btn:hover,
html[data-team-accent="purple"] .menu-btn[aria-expanded="true"] {
    border-color: rgba(168, 85, 247, 0.45);
    box-shadow: 0 0 18px rgba(168, 85, 247, 0.2);
    color: var(--purple);
}

html[data-team-accent="bounty"] .menu-btn:hover,
html[data-team-accent="bounty"] .menu-btn[aria-expanded="true"] {
    border-color: rgba(234, 179, 8, 0.45);
    box-shadow: 0 0 18px var(--bounty-dim);
    color: var(--bounty);
}

html[data-team-accent="mobile"] .menu-btn:hover,
html[data-team-accent="mobile"] .menu-btn[aria-expanded="true"] {
    border-color: rgba(57, 255, 20, 0.45);
    box-shadow: 0 0 18px var(--mobile-dim);
    color: var(--mobile);
}

.nav-cta {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
}

.nav-cta:hover {
    border-color: rgba(255, 45, 85, 0.3);
    box-shadow: 0 0 20px var(--red-dim);
}

.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 1rem;
    line-height: 1;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.menu-btn:hover {
    border-color: rgba(0, 180, 255, 0.3);
    box-shadow: 0 0 16px var(--blue-dim);
}

.menu-btn[aria-expanded="true"] {
    border-color: rgba(255, 45, 85, 0.35);
    box-shadow: 0 0 16px var(--red-dim);
}

.typewriter-text {
    font-family: var(--font-hacker);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-typewriter .line-blue {
    background: linear-gradient(90deg, var(--blue) 0%, var(--purple) 50%, var(--blue) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rb-gradient 4s ease infinite;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.4rem 0.65rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.theme-toggle:hover {
    color: var(--text);
    border-color: rgba(0, 180, 255, 0.3);
    box-shadow: 0 0 16px var(--blue-dim);
}

.theme-toggle-label { display: none; }

html[data-theme="dark"] .theme-toggle-label[data-show="dark"],
html[data-theme="light"] .theme-toggle-label[data-show="light"] {
    display: inline;
}

/* Hero */
.hero {
    padding: 5rem 0 4rem;
    text-align: center;
}

.hero-home {
    position: relative;
}

.hero-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(1.25rem, 4vw, 3rem);
    width: 100%;
    max-width: 100%;
    margin: 0 0 2.5rem;
    min-height: clamp(260px, 38vw, 420px);
}

/* Hero Globe — cyber attack map */
.hero-globe {
    position: relative;
    width: clamp(240px, 42vw, 400px);
    height: clamp(240px, 42vw, 400px);
    flex-shrink: 0;
    cursor: crosshair;
    pointer-events: auto;
    border-radius: 50%;
    transition: transform 0.4s ease, filter 0.4s ease;
    margin-left: clamp(0rem, 1vw, 0.5rem);
}

.hero-globe::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(0, 180, 255, 0.12);
    pointer-events: none;
    transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.hero-globe::after {
    content: '';
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    border: 1px dashed rgba(0, 180, 255, 0.06);
    pointer-events: none;
    animation: globe-orbit-ring 24s linear infinite;
}

@keyframes globe-orbit-ring {
    to { transform: rotate(360deg); }
}

.hero-globe.is-hovered,
.hero-globe:hover {
    transform: scale(1.03);
}

.hero-globe.is-hovered::before,
.hero-globe:hover::before {
    border-color: rgba(255, 45, 85, 0.3);
    box-shadow: 0 0 40px rgba(0, 180, 255, 0.18), 0 0 60px rgba(255, 45, 85, 0.1);
}

#globe-canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
}

.hero-globe-hud {
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 0.85rem;
    max-width: 100%;
    white-space: nowrap;
    pointer-events: none;
}

.hero-globe-tag {
    font-size: 0.55rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.75;
    transition: opacity 0.3s;
}

.hero-globe-tag-red { color: var(--red); }
.hero-globe-tag-blue { color: var(--blue); }
.hero-globe-tag-purple { color: var(--purple); }
.hero-globe-tag-bounty { color: var(--bounty); }
.hero-globe-tag-mobile { color: var(--mobile); }

.hero-globe.is-hovered .hero-globe-tag,
.hero-globe:hover .hero-globe-tag {
    opacity: 1;
}

.hero-title-block {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.hero-cycle {
    min-height: 9rem;
}

.hero-cycle-title {
    font-family: var(--font-hacker);
    font-size: clamp(2rem, 7vw, 3.75rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: 0.12em;
    margin-bottom: 0.5rem;
    animation: glitch-flicker 8s infinite;
}

.hero-cycle-title-text {
    display: inline;
}

.hero-cycle-title-text.line-red {
    color: var(--red);
    text-shadow: 0 0 20px var(--red-glow), 0 0 40px rgba(255, 45, 85, 0.2);
}

.hero-cycle-title-text.line-purple {
    color: var(--purple);
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.45), 0 0 40px rgba(168, 85, 247, 0.15);
}

.hero-cycle-title-text.line-blue {
    color: var(--blue);
    text-shadow: 0 0 20px var(--blue-glow), 0 0 40px rgba(0, 180, 255, 0.2);
}

.hero-cycle-title-text.line-mobile {
    color: var(--mobile);
    text-shadow: 0 0 20px var(--mobile-glow), 0 0 40px rgba(57, 255, 20, 0.2);
}

.hero-cycle-title-text.line-ninjas {
    background: linear-gradient(
        135deg,
        var(--red) 0%,
        var(--purple) 35%,
        var(--blue) 70%,
        var(--red) 100%
    );
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rb-gradient 5s ease infinite;
    filter: drop-shadow(0 0 24px rgba(168, 85, 247, 0.35));
}

.hero-cycle-sub {
    font-family: var(--font-mono);
    font-size: clamp(0.7rem, 2vw, 0.85rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    min-height: 1.5em;
    margin-bottom: 0.65rem;
}

.hero-cycle-desc {
    font-family: var(--font-mono);
    font-size: clamp(0.68rem, 1.8vw, 0.8rem);
    color: var(--text-muted);
    letter-spacing: 0.04em;
    line-height: 1.65;
    min-height: 2.8em;
    max-width: 420px;
}

.hero-cycle-cursor {
    color: var(--red);
    animation: blink 1s step-end infinite;
    margin-left: 1px;
    visibility: hidden;
}

.hero-cycle-cursor-sub {
    color: var(--text-muted);
}

.hero-ninjas-title {
    font-family: var(--font-hacker);
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.14em;
    margin-bottom: 0.75rem;
    animation: glitch-flicker 8s infinite;
}

.line-ninjas {
    background: linear-gradient(
        135deg,
        var(--red) 0%,
        var(--purple) 35%,
        var(--blue) 70%,
        var(--red) 100%
    );
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rb-gradient 5s ease infinite;
    filter: drop-shadow(0 0 24px rgba(168, 85, 247, 0.35));
}

.hero-typewriter {
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 2.2vw, 0.95rem);
    color: var(--text-muted);
    letter-spacing: 0.06em;
    min-height: 1.6em;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.typewriter-prefix {
    color: var(--red);
    margin-right: 0.35rem;
}

.typewriter-text {
    color: var(--blue);
}

.typewriter-cursor {
    color: var(--red);
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

.hero-compact {
    padding: 3rem 0 2.5rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2rem;
    background: var(--bg-surface);
    backdrop-filter: blur(8px);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 8px var(--red);
    animation: pulse 2s infinite;
}

.hero h1 {
    font-family: var(--font-hacker);
    font-size: clamp(2rem, 6vw, 3.75rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    animation: glitch-flicker 8s infinite;
}

.hero h1 .line-red {
    background: linear-gradient(135deg, var(--red) 0%, #ff6b8a 50%, var(--red) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rb-gradient 4s ease infinite;
    filter: drop-shadow(0 0 20px rgba(255, 45, 85, 0.35));
}

.hero h1 .line-blue {
    background: linear-gradient(135deg, var(--blue) 0%, #67e8f9 50%, var(--blue) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rb-gradient 4s ease infinite reverse;
    filter: drop-shadow(0 0 20px rgba(0, 180, 255, 0.35));
}

.hero-sub {
    max-width: 560px;
    margin: 0 auto 2.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat { text-align: center; }

.stat-value {
    font-family: var(--font-hacker);
    font-size: 1.75rem;
    font-weight: 400;
    letter-spacing: 0.1em;
}

.stat-value.red { color: var(--red); }
.stat-value.blue { color: var(--blue); }
.stat-value.purple { color: var(--purple); }

.stat-label {
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Sections */
section { padding: 3rem 0; }

.section-label {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.section-title {
    font-family: var(--font-hacker);
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    font-weight: 400;
    margin-bottom: 2.5rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Tag filter bar */
.tag-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    background: var(--bg-card);
    transition: all 0.25s;
}

.tag-pill:hover {
    color: var(--text);
    border-color: rgba(0, 180, 255, 0.3);
}

.tag-pill.active {
    color: var(--blue);
    border-color: rgba(0, 180, 255, 0.4);
    background: var(--blue-dim);
}

.tag-pill-count {
    opacity: 0.5;
}

.tag-pill.tag-team-red {
    color: var(--red);
    border-color: rgba(255, 45, 85, 0.22);
}

.tag-pill.tag-team-blue {
    color: var(--blue);
    border-color: rgba(0, 180, 255, 0.22);
}

.tag-pill.tag-team-purple {
    color: var(--purple);
    border-color: rgba(168, 85, 247, 0.22);
}

.tag-pill.tag-team-bounty {
    color: var(--bounty);
    border-color: rgba(234, 179, 8, 0.22);
}

.tag-pill.tag-team-mobile {
    color: var(--mobile);
    border-color: rgba(57, 255, 20, 0.22);
}

.tag-pill.tag-team-red:hover,
.tag-pill.tag-team-red.active {
    color: var(--red);
    border-color: rgba(255, 45, 85, 0.4);
    background: var(--red-dim);
}

.tag-pill.tag-team-blue:hover,
.tag-pill.tag-team-blue.active {
    color: var(--blue);
    border-color: rgba(0, 180, 255, 0.4);
    background: var(--blue-dim);
}

.tag-pill.tag-team-purple:hover,
.tag-pill.tag-team-purple.active {
    color: var(--purple);
    border-color: rgba(168, 85, 247, 0.4);
    background: var(--purple-dim);
}

.tag-pill.tag-team-bounty:hover,
.tag-pill.tag-team-bounty.active {
    color: var(--bounty);
    border-color: rgba(234, 179, 8, 0.4);
    background: var(--bounty-dim);
}

.tag-pill.tag-team-mobile:hover,
.tag-pill.tag-team-mobile.active {
    color: var(--mobile);
    border-color: rgba(57, 255, 20, 0.4);
    background: var(--mobile-dim);
}

/* Post grid */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
    animation: fade-up 0.5s ease both;
}

.post-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.35s;
    pointer-events: none;
}

.post-card.red::before {
    background: linear-gradient(135deg, var(--red-dim) 0%, transparent 60%);
}

.post-card.blue::before {
    background: linear-gradient(135deg, var(--blue-dim) 0%, transparent 60%);
}

.post-card.purple::before {
    background: linear-gradient(135deg, var(--purple-dim) 0%, transparent 60%);
}

.post-card.bounty::before {
    background: linear-gradient(135deg, var(--bounty-dim) 0%, transparent 60%);
}

.post-card.mobile::before {
    background: linear-gradient(135deg, var(--mobile-dim) 0%, transparent 60%);
}

.post-card:hover {
    transform: translateY(-6px);
}

.post-card.red:hover {
    border-color: rgba(255, 45, 85, 0.35);
    box-shadow: 0 20px 60px rgba(255, 45, 85, 0.12);
}

.post-card.blue:hover {
    border-color: rgba(0, 180, 255, 0.35);
    box-shadow: 0 20px 60px rgba(0, 180, 255, 0.12);
}

.post-card.purple:hover {
    border-color: rgba(168, 85, 247, 0.35);
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.12);
}

.post-card.bounty:hover {
    border-color: rgba(234, 179, 8, 0.35);
    box-shadow: 0 20px 60px rgba(234, 179, 8, 0.12);
}

.post-card.mobile:hover {
    border-color: rgba(57, 255, 20, 0.35);
    box-shadow: 0 20px 60px rgba(57, 255, 20, 0.12);
}

.post-card:hover::before { opacity: 1; }

.post-card-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.post-card:hover .post-card-image img {
    transform: scale(1.05);
}

.post-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 4, 10, 0.8);
    font-family: var(--font-hacker);
    font-size: 2rem;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    opacity: 0.4;
}

.post-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.post-card-meta .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-muted);
}

.post-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.post-card-tag {
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    border: 1px solid var(--border);
}

.post-card-tag.tag-team-red {
    color: var(--red);
    border-color: rgba(255, 45, 85, 0.25);
}

.post-card-tag.tag-team-blue {
    color: var(--blue);
    border-color: rgba(0, 180, 255, 0.25);
}

.post-card-tag.tag-team-purple {
    color: var(--purple);
    border-color: rgba(168, 85, 247, 0.25);
}

.post-card-tag.tag-team-bounty {
    color: var(--bounty);
    border-color: rgba(234, 179, 8, 0.25);
}

.post-card-tag.tag-team-mobile {
    color: var(--mobile);
    border-color: rgba(57, 255, 20, 0.25);
}

.post-card-title {
    font-family: var(--font-hacker);
    font-size: 1.05rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
    line-height: 1.4;
}

.post-card-excerpt {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.7;
    flex: 1;
    margin-bottom: 1rem;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.post-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.25s;
}

.post-card.red .post-card-link,
.post-card-link.tag-team-red { color: var(--red); }

.post-card.blue .post-card-link,
.post-card-link.tag-team-blue { color: var(--blue); }

.post-card.purple .post-card-link,
.post-card-link.tag-team-purple { color: var(--purple); }

.post-card.bounty .post-card-link,
.post-card-link.tag-team-bounty { color: var(--bounty); }

.post-card.mobile .post-card-link,
.post-card-link.tag-team-mobile { color: var(--mobile); }

.post-card:hover .post-card-link { gap: 0.75rem; }

.post-card-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.post-card-author img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border);
}

/* Featured post */
.featured-post {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    text-decoration: none;
    color: inherit;
    margin-bottom: 2rem;
    transition: border-color 0.35s, box-shadow 0.35s;
}

.featured-post:hover {
    border-color: rgba(255, 45, 85, 0.35);
    box-shadow: 0 20px 60px rgba(255, 45, 85, 0.1);
}

.featured-post-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    position: relative;
}

.featured-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.featured-post:hover .featured-post-image img {
    transform: scale(1.03);
}

.featured-post-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--red-dim), var(--blue-dim));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-hacker);
    font-size: 3rem;
    color: var(--text-muted);
    opacity: 0.3;
}

.featured-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.3rem 0.75rem;
    background: rgba(255, 45, 85, 0.9);
    color: #fff;
    font-size: 0.55rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border-radius: 3px;
    font-family: var(--font-hacker);
}

.featured-post-content {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-post-content .section-label {
    color: var(--red);
    margin-bottom: 0.5rem;
}

.featured-post-title {
    font-family: var(--font-hacker);
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.featured-post-excerpt {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.featured-post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.featured-post-link {
    color: var(--red);
    margin-top: auto;
    padding-top: 1rem;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 0 1rem;
}

.pagination a,
.pagination span {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    transition: all 0.25s;
}

.pagination a:hover {
    color: var(--text);
    border-color: rgba(0, 180, 255, 0.3);
    box-shadow: 0 0 16px var(--blue-dim);
}

.pagination .pagination-info {
    color: var(--text-muted);
    border: none;
    padding: 0;
}

/* Single post */
.post-header {
    padding: 3rem 0 2rem;
    max-width: var(--content-width);
    margin: 0 auto;
    text-align: center;
}

.post-header .badge {
    margin-bottom: 1.5rem;
}

.post-title {
    font-family: var(--font-hacker);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    animation: glitch-flicker 8s infinite;
    unicode-bidi: plaintext;
}

.post-meta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.post-meta-bar a {
    color: var(--blue);
    text-decoration: none;
    transition: color 0.2s;
}

.post-meta-bar a:hover {
    color: var(--text);
    text-decoration: underline;
}

.post-meta-bar .post-author-link {
    font-weight: 500;
}

.post-feature-image {
    max-width: var(--content-width);
    margin: 0 auto 2.5rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.post-feature-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding-bottom: 3rem;
    font-size: 0.9rem;
    line-height: 1.85;
    direction: auto;
}

.post-content[dir="rtl"] h1,
.post-content[dir="rtl"] h2,
.post-content[dir="rtl"] h3,
.post-content[dir="rtl"] h4,
.post-content :dir(rtl),
.post-content .text-fa {
    direction: rtl;
    text-align: right;
    /* NEVER use plaintext here — it picks direction from the first English
       word and breaks Persian lines that start with Oracle/CVE/etc. */
    unicode-bidi: embed;
}

.post-content .text-en,
.post-content [dir="ltr"]:not(pre):not(.code-block):not(.code-block *) {
    direction: ltr;
    text-align: left;
    unicode-bidi: embed;
}

.post-content[dir="rtl"] pre,
.post-content[dir="rtl"] .code-block,
.post-content pre,
.post-content .code-block {
    direction: ltr;
    text-align: left;
}

.post-content[dir="rtl"] code,
.post-content .text-fa code,
.post-content pre code,
.post-content .code-block code {
    direction: ltr;
    text-align: left;
    unicode-bidi: isolate;
    font-family: var(--font-mono);
}

/* Persian / RTL typography */
.post-title[dir="rtl"],
.post-title.text-fa,
.post-content[dir="rtl"],
.post-content .text-fa,
.page-content[dir="rtl"],
.page-content .text-fa,
html[lang^="fa"] .post-title,
html[lang^="fa"] .post-content,
html[lang^="fa"] .page-content {
    font-family: var(--font-fa);
    letter-spacing: 0;
    text-transform: none;
    font-feature-settings: "kern" 1;
}

.post-title[dir="rtl"],
.post-title.text-fa,
html[lang^="fa"] .post-title {
    font-weight: 700;
    font-size: clamp(1.65rem, 4vw, 2.5rem);
    line-height: 1.55;
    animation: none;
    text-align: center;
}

.post-content[dir="rtl"],
.post-content[dir="rtl"] p,
.post-content[dir="rtl"] li,
.post-content .text-fa,
.page-content[dir="rtl"],
html[lang^="fa"] .post-content,
html[lang^="fa"] .page-content {
    font-size: 1.05rem;
    line-height: 2;
    font-weight: 400;
}

.post-content[dir="rtl"] h1,
.post-content[dir="rtl"] h2,
.post-content[dir="rtl"] h3,
.post-content[dir="rtl"] h4,
.post-content :dir(rtl) h1,
.post-content :dir(rtl) h2,
.post-content :dir(rtl) h3,
.post-content :dir(rtl) h4,
.post-content .text-fa h1,
.post-content .text-fa h2,
.post-content .text-fa h3,
.post-content .text-fa h4,
html[lang^="fa"] .post-content h1,
html[lang^="fa"] .post-content h2,
html[lang^="fa"] .post-content h3,
html[lang^="fa"] .post-content h4 {
    font-family: var(--font-fa);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.65;
}

.post-content[dir="rtl"] h2,
.post-content :dir(rtl) h2,
html[lang^="fa"] .post-content h2 {
    font-size: 1.7rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.55rem;
}

.post-content[dir="rtl"] h3,
.post-content :dir(rtl) h3,
html[lang^="fa"] .post-content h3 {
    font-size: 1.4rem;
    color: var(--text);
}

.post-content[dir="rtl"] blockquote,
.post-content :dir(rtl) blockquote,
.post-content .text-fa blockquote {
    font-style: normal;
    font-size: 1rem;
    line-height: 2;
    padding: 1rem 1.25rem;
}

.post-content[dir="rtl"] strong,
.post-content :dir(rtl) strong,
html[lang^="fa"] .post-content strong {
    font-weight: 600;
}

.post-content[dir="rtl"] .kg-callout-text,
.post-content[dir="rtl"] .kg-toggle-content,
.post-content[dir="rtl"] .kg-toggle-heading-text,
.post-content .text-fa .kg-callout-text,
.post-content .text-fa .kg-toggle-content {
    font-family: var(--font-fa);
    letter-spacing: 0;
    text-transform: none;
    line-height: 2;
}

.post-content > * + * { margin-top: 1.25rem; }

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    font-family: var(--font-hacker);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.3;
    margin-top: 2.75rem;
}

.post-content h1 {
    font-size: clamp(1.9rem, 3.5vw, 2.3rem);
    color: var(--text);
}

.post-content h2 {
    font-size: clamp(1.55rem, 2.8vw, 1.85rem);
    color: var(--text);
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--border);
}

.post-content h3 {
    font-size: clamp(1.2rem, 2.2vw, 1.4rem);
    color: var(--blue);
}

.post-content h4 {
    font-size: clamp(1.02rem, 1.9vw, 1.15rem);
    color: var(--content-red);
}

.post-content p { color: var(--text); }

.post-content a {
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* English URLs / terms inside Persian paragraphs stay readable */
.post-content .text-fa a,
.post-content [dir="rtl"] a {
    unicode-bidi: isolate;
}

.post-content a:hover { color: var(--red); }

.post-content strong { color: #fff; font-weight: 600; }

.post-content em {
    color: var(--text);
    opacity: 0.92;
    font-style: italic;
}

.post-content blockquote {
    border-inline-start: 3px solid var(--red);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--red-dim);
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: var(--text-muted);
}

.post-content blockquote:dir(rtl) {
    border-radius: 6px 0 0 6px;
}

.post-content ul,
.post-content ol {
    padding-inline-start: 1.5rem;
    color: var(--text);
}

.post-content li {
    margin-bottom: 0.4rem;
    color: var(--text);
}

.post-content li::marker { color: var(--list-marker); }

.post-content li strong {
    color: #fff;
}

.post-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 2.5rem 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.post-content figure { margin: 1.5rem 0; }

.post-content figcaption {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Tables — solid card (no glass / no canvas bleed-through) */
.post-content .kg-table-card,
.post-content figure:has(table),
.post-content .table-wrapper {
    margin: 1.75rem 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--table-bg);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.post-content .kg-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--table-bg);
}

.post-content .kg-table-container,
.post-content figure:has(table),
.post-content .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.post-content table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 0.84rem;
    line-height: 1.65;
    margin: 0;
    background: var(--table-bg);
}

.post-content .kg-table-card table,
.post-content figure:has(table) table {
    margin: 0;
}

.post-content th,
.post-content td {
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--border);
    text-align: start;
    vertical-align: top;
}

.post-content th {
    background: var(--table-head-bg);
    font-family: var(--font-hacker);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.68rem;
    font-weight: 400;
    color: var(--blue);
    white-space: nowrap;
}

.post-content td {
    color: var(--text);
    background: var(--table-cell-bg);
}

.post-content tbody tr:nth-child(even) td {
    background: var(--table-row-alt);
}

.post-content tbody tr:hover td {
    background: var(--table-row-hover);
}

.post-content td code,
.post-content th code {
    font-size: 0.82em;
    white-space: nowrap;
}

.post-content td:first-child {
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.post-content pre {
    background: rgba(4, 4, 10, 0.95);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    font-size: 0.78rem;
    line-height: 1.7;
    position: relative;
}

.post-content pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
}

.post-content code {
    font-family: var(--font-mono);
    font-size: 0.85em;
}

.post-content :not(pre) > code {
    background: var(--inline-code-bg);
    color: var(--inline-code-fg);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    border: 1px solid var(--inline-code-border);
    direction: ltr;
    unicode-bidi: isolate;
    font-weight: 500;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ===== Fenced code — macOS-style window ===== */
.post-content .code-block {
    margin: 1.9rem 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #090911;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
    direction: ltr;
    text-align: left;
    max-width: 100%;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.code-block__bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.9rem;
    background: rgba(255, 255, 255, 0.035);
    border-bottom: 1px solid var(--border);
    user-select: none;
}

.code-block__dots {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.code-block__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    padding: 0;
    display: block;
}

.code-block__dot--red { background: #ff5f57; }
.code-block__dot--yellow { background: #febc2e; }
.code-block__dot--green { background: #28c840; }

.code-block.is-collapsible .code-block__dot--green {
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
}

.code-block.is-collapsible .code-block__dot--green:hover {
    transform: scale(1.18);
    box-shadow: 0 0 8px rgba(40, 200, 64, 0.6);
}

.code-block__lang {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-inline-start: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.code-block__actions {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.code-block__btn {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.28rem 0.6rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.code-block__btn:hover {
    color: var(--text);
    border-color: rgba(0, 180, 255, 0.35);
    background: var(--blue-dim);
}

.code-block__btn.is-copied {
    color: #28c840;
    border-color: rgba(40, 200, 64, 0.4);
}

/* The wrapped <pre> hands its chrome over to the bar. */
.post-content .code-block pre {
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    max-width: 100%;
}

.post-content .code-block pre::before {
    display: none;
}

.code-block__scroll {
    position: relative;
}

.code-block.is-collapsed .code-block__scroll {
    max-height: 22rem;
    overflow: hidden;
}

.code-block.is-collapsed .code-block__scroll::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 5rem;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(9, 9, 17, 0) 0%, #090911 100%);
}

.code-block__expand-hint {
    display: none;
    width: 100%;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border: none;
    border-top: 1px solid var(--border);
    padding: 0.6rem;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.code-block.is-collapsible .code-block__expand-hint {
    display: block;
}

.code-block__expand-hint:hover {
    color: var(--text);
    background: var(--blue-dim);
}

/* ===== Syntax highlighting (Prism — broad language/token coverage) ===== */
.post-content pre code[class*="language-"],
.post-content code[class*="language-"] {
    color: var(--syn-plain);
    text-shadow: none;
    background: none;
}

.post-content .token.comment,
.post-content .token.prolog,
.post-content .token.doctype,
.post-content .token.cdata,
.post-content .token.shebang,
.post-content .token.hashbang {
    color: var(--syn-comment);
    font-style: italic;
}

.post-content .token.punctuation,
.post-content .token.bracket,
.post-content .token.delimiter {
    color: var(--syn-punctuation);
}

.post-content .token.keyword,
.post-content .token.selector,
.post-content .token.important,
.post-content .token.atrule,
.post-content .token.rule,
.post-content .token.control-flow,
.post-content .token.directive,
.post-content .token.directive-hash,
.post-content .token.directive-name {
    color: var(--syn-keyword);
    font-weight: 500;
}

.post-content .token.boolean,
.post-content .token.number,
.post-content .token.constant,
.post-content .token.symbol,
.post-content .token.unit,
.post-content .token.hexcode,
.post-content .token.coord {
    color: var(--syn-number);
}

.post-content .token.string,
.post-content .token.char,
.post-content .token.attr-value,
.post-content .token.regex,
.post-content .token.template-string,
.post-content .token.heredoc,
.post-content .token.interpolation-punctuation {
    color: var(--syn-string);
}

.post-content .token.function,
.post-content .token.function-variable,
.post-content .token.method,
.post-content .token.title.function,
.post-content .token.console {
    color: var(--syn-function);
}

.post-content .token.class-name,
.post-content .token.title.class,
.post-content .token.maybe-class-name,
.post-content .token.builtin,
.post-content .token.type-definition,
.post-content .token.type-annotation,
.post-content .token.annotation,
.post-content .token.module,
.post-content .token.package,
.post-content .token.decorator {
    color: var(--syn-class);
}

.post-content .token.tag,
.post-content .token.property,
.post-content .token.literal-property,
.post-content .token.key,
.post-content .token.selector-id,
.post-content .token.selector-class {
    color: var(--syn-tag);
}

.post-content .token.attr-name,
.post-content .token.variable,
.post-content .token.parameter,
.post-content .token.interpolation,
.post-content .token.spreadsheet,
.post-content .token.table {
    color: var(--syn-variable);
}

.post-content .token.operator,
.post-content .token.entity,
.post-content .token.url,
.post-content .token.escape,
.post-content .token.template-punctuation,
.post-content .token.regex-flags {
    color: var(--syn-operator);
}

.post-content .token.namespace {
    color: var(--syn-class);
    opacity: 0.85;
}

.post-content .token.deleted { color: var(--syn-keyword); }
.post-content .token.inserted { color: var(--syn-string); }
.post-content .token.bold { font-weight: 700; }
.post-content .token.italic { font-style: italic; }

.post-content .kg-card { margin: 2rem 0; }

/* Koenig editor image sizes — required by Ghost theme validation */
.kg-width-wide {
    position: relative;
    width: 85vw;
    min-width: 100%;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    transform: translateX(calc(50vw - 50%));
}

.kg-width-wide img {
    max-width: 85vw;
    width: 100%;
    height: auto;
}

.kg-width-full {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.kg-width-full img {
    max-width: 100vw;
    width: 100%;
    height: auto;
}

.gh-content .kg-width-wide,
.gh-content .kg-width-full {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.post-content .kg-image-card img,
.post-content img.kg-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
}

.post-content .kg-gallery-container {
    display: grid;
    gap: 0.5rem;
}

.post-content .kg-bookmark-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-surface);
}

.post-content .kg-bookmark-container {
    display: flex;
    text-decoration: none;
    color: inherit;
}

.post-content .kg-bookmark-content {
    padding: 1.25rem;
    flex: 1;
}

.post-content .kg-bookmark-title {
    font-family: var(--font-hacker);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.post-content .kg-bookmark-description {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.post-content .kg-callout-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    background: var(--blue-dim);
    display: flex;
    gap: 1rem;
}

.post-content .kg-toggle-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.post-content .kg-toggle-heading {
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    font-family: var(--font-hacker);
    letter-spacing: 0.06em;
}

.post-content .kg-toggle-content {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

.post-content .kg-button-card a {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border: 1px solid rgba(255, 45, 85, 0.4);
    border-radius: 4px;
    color: var(--red);
    text-decoration: none;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: all 0.25s;
}

.post-content .kg-button-card a:hover {
    background: var(--red-dim);
    box-shadow: 0 0 20px var(--red-dim);
}

/* Post footer */
.post-footer {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 2rem 0 3rem;
    border-top: 1px solid var(--border);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.post-author-card {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-surface);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.post-author-card:hover {
    border-color: rgba(0, 180, 255, 0.35);
    box-shadow: 0 12px 36px rgba(0, 180, 255, 0.1);
    transform: translateY(-2px);
}

.post-author-card img,
.post-author-card-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
    object-fit: cover;
}

.post-author-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-hacker);
    font-size: 1.5rem;
    color: var(--content-red);
    background: var(--content-red-dim);
}

.post-author-label {
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.post-author-info h4 {
    font-family: var(--font-hacker);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.post-author-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 0.65rem;
}

.post-author-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--blue);
    transition: gap 0.25s;
}

.post-author-card:hover .post-author-cta {
    gap: 0.55rem;
}

/* ===== Post comments (collapsible panel) ===== */
.post-comments-zone {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 0 2.5rem;
}

.post-comments-zone__inner {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.post-comments-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: auto;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-surface);
    color: var(--text);
    cursor: pointer;
    font-family: var(--font-mono);
    text-align: left;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.post-comments-toggle:hover,
.post-comments-toggle.is-open {
    border-color: rgba(0, 180, 255, 0.35);
    box-shadow: 0 0 16px var(--blue-dim);
}

.post-comments-toggle__label {
    font-family: var(--font-hacker);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text);
    white-space: nowrap;
}

.post-comments-toggle__icon {
    flex-shrink: 0;
    font-size: 0.6rem;
    color: var(--blue);
    transition: transform 0.25s;
    line-height: 1;
}

.post-comments-toggle.is-open .post-comments-toggle__icon {
    transform: rotate(180deg);
}

.post-comments-panel {
    display: none;
    overflow: hidden;
    width: 100%;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    margin-top: 0;
}

.post-comments-panel.is-open {
    display: block;
    max-height: 8000px;
    opacity: 1;
    margin-top: 1rem;
}

.post-comments-panel[hidden] {
    display: none !important;
}

.post-comments-panel__body {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-surface);
    padding: 1.5rem 1.25rem;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

/* Ghost native comments widget */
.post-comments-panel .gh-comments,
.post-comments-panel .gh-comments-container {
    font-family: var(--font-mono);
    color: var(--text);
}

.post-comments-panel .gh-comments-title,
.post-comments-panel .gh-comments-header h2,
.post-comments-panel .gh-comments-header h3 {
    font-family: var(--font-hacker);
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.post-comments-panel .gh-comments-count {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.post-comments-panel .gh-comment {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem 1.1rem;
    margin-bottom: 0.75rem;
}

.post-comments-panel .gh-comment:last-child {
    margin-bottom: 0;
}

.post-comments-panel .gh-comment-header,
.post-comments-panel .gh-comment-meta {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.post-comments-panel .gh-comment-content,
.post-comments-panel .gh-comment-body {
    font-size: 0.85rem;
    line-height: 1.75;
    color: var(--text);
}

.post-comments-panel .gh-comment-content p,
.post-comments-panel .gh-comment-body p {
    margin-bottom: 0.5rem;
}

.post-comments-panel .gh-comment-content a,
.post-comments-panel .gh-comment-body a {
    color: var(--blue);
}

.post-comments-panel textarea,
.post-comments-panel input[type="text"],
.post-comments-panel input[type="email"] {
    width: 100%;
    background: rgba(4, 4, 10, 0.6);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    padding: 0.75rem 1rem;
    line-height: 1.6;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.post-comments-panel textarea:focus,
.post-comments-panel input:focus {
    outline: none;
    border-color: rgba(0, 180, 255, 0.4);
    box-shadow: 0 0 16px var(--blue-dim);
}

.post-comments-panel button,
.post-comments-panel .gh-btn,
.post-comments-panel [class*="comment"] button {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--text);
    padding: 0.55rem 1rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.post-comments-panel button:hover,
.post-comments-panel .gh-btn:hover {
    border-color: rgba(0, 180, 255, 0.35);
    box-shadow: 0 0 16px var(--blue-dim);
}

.post-comments-panel .gh-comments-placeholder,
.post-comments-panel .gh-comments-empty {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    padding: 1.5rem 1rem;
}

/* Related posts */
.related-posts {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
}

/* Author page */
.author-full {
    width: 100%;
}

.author-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 3rem 0 2.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2.5rem;
    max-width: var(--content-width);
    margin-left: auto;
    margin-right: auto;
}

.author-avatar {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
    object-fit: cover;
}

.author-avatar-placeholder {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-hacker);
    font-size: 2rem;
    color: var(--content-red);
    background: var(--content-red-dim);
    flex-shrink: 0;
    overflow: hidden;
}

.author-info {
    min-width: 0;
    flex: 1;
}

.author-info h1 {
    font-family: var(--font-hacker);
    font-size: clamp(1.5rem, 3vw, 2rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.65rem;
}

.author-bio,
.author-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.8;
    max-width: none;
}

.author-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin-top: 1rem;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.author-meta a {
    color: var(--blue);
    text-decoration: none;
    transition: color 0.2s;
}

.author-meta a:hover {
    color: var(--text);
    text-decoration: underline;
}

.author-posts {
    padding-bottom: 2rem;
}

.author-posts .section-label {
    margin-bottom: 0.5rem;
}

.author-posts .section-title {
    margin-bottom: 2rem;
}

/* Tag / archive header */
.archive-header {
    padding: 3rem 0 2rem;
    text-align: center;
}

.archive-header h1 {
    font-family: var(--font-hacker);
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.archive-header p {
    font-size: 0.8rem;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto;
}

.archive-stats {
    margin-top: 2rem;
}

.tag-topic-nav {
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-surface);
}

.tag-topic-nav-label {
    font-size: 0.65rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.tag-topic-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-topic-nav-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.tag-topic-nav-pill:hover,
.tag-topic-nav-pill.is-active {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

.tag-topic-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem 1.5rem;
}

.tag-topic-nav-heading {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text);
    text-decoration: none;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border);
}

.tag-topic-nav-heading:hover,
.tag-topic-nav-heading.is-active {
    color: var(--blue);
}

.tag-topic-nav-topics {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.tag-topic-nav-link {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.2rem 0;
    transition: color 0.2s;
}

.tag-topic-nav-link:hover,
.tag-topic-nav-link.is-active {
    color: var(--text);
}

.no-posts-hint {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    opacity: 0.75;
}

.archive-header[data-team="red"] h1 span { color: var(--red); }
.archive-header[data-team="blue"] h1 span { color: var(--blue); }
.archive-header[data-team="purple"] h1 span { color: var(--purple); }
.archive-header[data-team="bounty"] h1 span { color: var(--bounty); }
.archive-header[data-team="mobile"] h1 span { color: var(--mobile); }

.tag-topic-nav[data-team="red"] .tag-topic-nav-pill:hover,
.tag-topic-nav[data-team="red"] .tag-topic-nav-pill.is-active {
    color: var(--red);
    border-color: rgba(255, 45, 85, 0.35);
    background: var(--red-dim);
}

.tag-topic-nav[data-team="blue"] .tag-topic-nav-pill:hover,
.tag-topic-nav[data-team="blue"] .tag-topic-nav-pill.is-active {
    color: var(--blue);
    border-color: rgba(0, 180, 255, 0.35);
    background: var(--blue-dim);
}

.tag-topic-nav[data-team="purple"] .tag-topic-nav-pill:hover,
.tag-topic-nav[data-team="purple"] .tag-topic-nav-pill.is-active {
    color: var(--purple);
    border-color: rgba(168, 85, 247, 0.35);
    background: var(--purple-dim);
}

.tag-topic-nav[data-team="bounty"] .tag-topic-nav-pill:hover,
.tag-topic-nav[data-team="bounty"] .tag-topic-nav-pill.is-active {
    color: var(--bounty);
    border-color: rgba(234, 179, 8, 0.35);
    background: var(--bounty-dim);
}

.tag-topic-nav[data-team="mobile"] .tag-topic-nav-pill:hover,
.tag-topic-nav[data-team="mobile"] .tag-topic-nav-pill.is-active {
    color: var(--mobile);
    border-color: rgba(57, 255, 20, 0.35);
    background: var(--mobile-dim);
}

/* Page template */
.page-content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 2rem 0 3rem;
}

.page-content h1 {
    font-family: var(--font-hacker);
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 2rem;
    text-align: center;
}

/* Error page */
.error-page {
    text-align: center;
    padding: 6rem 0 8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 55vh;
}

.error-page-fun .error-terminal {
    width: min(100%, 560px);
    margin: 0 auto 2rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(4, 4, 10, 0.92);
    text-align: left;
    opacity: 0;
    transform: translateY(16px) scale(0.97);
    transition: opacity 0.45s ease, transform 0.45s ease, box-shadow 0.45s ease;
}

.error-terminal.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.error-terminal-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
}

.error-terminal-bar .terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.error-terminal-bar .terminal-dot.r { background: #ff5f57; }
.error-terminal-bar .terminal-dot.y { background: #febc2e; }
.error-terminal-bar .terminal-dot.g { background: #28c840; }

.error-terminal-title {
    flex: 1;
    text-align: center;
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

.error-terminal-body {
    padding: 1.5rem 1.75rem 1.75rem;
    min-height: 200px;
    position: relative;
}

.error-terminal-lines {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.error-terminal-line {
    font-size: 0.72rem;
    line-height: 1.65;
    word-break: break-word;
}

.error-terminal-line.error-terminal-cmd .prompt {
    color: var(--blue);
}

.error-terminal-line.error-terminal-cmd .cmd-text {
    color: var(--text);
}

.error-terminal-line.error-terminal-dim {
    color: var(--text-muted);
    font-size: 0.68rem;
}

.error-terminal-line.error-terminal-response {
    color: var(--text);
    font-size: 0.7rem;
}

.error-terminal-line.error-terminal-response.dim {
    color: var(--text-muted);
    font-size: 0.66rem;
}

.error-http-404 {
    color: var(--red);
    font-weight: 600;
}

.error-terminal-cursor {
    display: inline-block;
    color: var(--text);
    font-size: 0.72rem;
    animation: blink 1s step-end infinite;
    margin-top: 0.25rem;
}

.error-terminal-result {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    text-align: center;
}

.error-terminal-result.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.error-return-btn[hidden] {
    display: none;
}

.error-prompt {
    font-size: 0.72rem;
    margin-bottom: 1rem;
}

.error-prompt .prompt {
    color: var(--blue);
}

.error-prompt-dim {
    color: var(--text-muted);
    font-size: 0.65rem;
    margin-top: 0.75rem;
    margin-bottom: 0;
}

.error-code {
    font-family: var(--font-hacker);
    font-size: clamp(4rem, 12vw, 8rem);
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, var(--red), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    animation: rb-glow 3s ease infinite;
}

.error-page h2 {
    font-family: var(--font-hacker);
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.error-page p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0;
    line-height: 1.7;
}

.error-page-fun .btn {
    margin-top: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-surface);
    color: var(--text);
    text-decoration: none;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: all 0.25s;
    cursor: pointer;
    font-family: var(--font-mono);
}

.btn:hover {
    border-color: rgba(0, 180, 255, 0.3);
    box-shadow: 0 0 20px var(--blue-dim);
}

.btn-red:hover {
    border-color: rgba(255, 45, 85, 0.3);
    box-shadow: 0 0 20px var(--red-dim);
}

/* Footer */
.site-footer {
    padding: 3rem 0 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
}

.site-footer .copy {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.team-bar {
    display: flex;
    gap: 1.5rem;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.team-bar .red { color: var(--red); }
.team-bar .blue { color: var(--blue); }
.team-bar .purple { color: var(--purple); }
.team-bar .mobile { color: var(--mobile); }

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
}

.footer-links a:hover { color: var(--text); }

/* Ghost membership / portal overrides */
.gh-portal-triggerbtn { display: none; }

.no-posts {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.no-posts code {
    color: var(--red);
    background: var(--red-dim);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 900px) {
    .featured-post {
        grid-template-columns: 1fr;
    }

    .featured-post-content {
        padding: 1.75rem;
    }
}

@media (max-width: 1280px) {
    a.nav-simple-trigger,
    .header-cat-link {
        padding: 0.45rem 0.5rem;
        font-size: 0.66rem;
        letter-spacing: 0.06em;
        gap: 0.35rem;
    }

    .header-cat-icon {
        width: 0.95rem;
        height: 0.95rem;
    }

    .header-categories {
        gap: 0.2rem;
    }

    .logo {
        font-size: 1.2rem;
    }
}

@media (max-width: 1100px) {
    .header-categories {
        display: none;
    }
}

@media (max-width: 960px) {
    .header-nav-link:not(.nav-cta) {
        display: none;
    }

    .hero-brand {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        min-height: auto;
        margin-bottom: 2rem;
    }

    .hero-globe {
        width: clamp(200px, 65vw, 300px);
        height: clamp(200px, 65vw, 300px);
        order: -1;
        margin-left: 0;
    }

    .hero-title-block {
        text-align: center;
    }

    .hero-cycle-desc {
        max-width: none;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    .header-nav-wrap {
        gap: 0.35rem;
    }

    .header-nav-link.nav-cta {
        font-size: 0.6rem;
        padding: 0.45rem 0.65rem;
    }

    .hero { padding: 3.5rem 0 2.5rem; }

    .hero-stats { gap: 2rem; }

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

    .author-header {
        flex-direction: column;
        text-align: center;
    }

    .author-meta {
        justify-content: center;
    }
}

/* ── Light mode ── */
html[data-theme="light"] {
    --bg-deep: #e8eaee;
    --bg-surface: rgba(216, 220, 226, 0.9);
    --bg-card: rgba(208, 212, 218, 0.85);
    --border: rgba(0, 0, 0, 0.11);
    --text: #141820;
    --text-muted: #525a66;
    --red: #d91545;
    --red-dim: rgba(217, 21, 69, 0.08);
    --red-glow: rgba(217, 21, 69, 0.2);
    --content-red: #9f1239;
    --content-red-dim: rgba(159, 18, 57, 0.07);
    --content-red-border: rgba(159, 18, 57, 0.16);
    --inline-code-fg: #006688;
    --inline-code-bg: #e8f4fc;
    --inline-code-border: #b3d9ef;
    --list-marker: #0088cc;
    --table-bg: #f2f4f8;
    --table-head-bg: #e4eaf2;
    --table-cell-bg: #f7f8fb;
    --table-row-alt: #eceff4;
    --table-row-hover: #e2ebf5;
    --syn-comment: #6a737d;
    --syn-keyword: #a61e4d;
    --syn-tag: #a61e4d;
    --syn-string: #1e7a34;
    --syn-number: #6f42c1;
    --syn-function: #0077aa;
    --syn-class: #a04e00;
    --syn-variable: #005cc5;
    --syn-operator: #3d5466;
    --syn-punctuation: #444d56;
    --syn-attr: #8a4b00;
    --syn-property: #0077aa;
    --syn-directive: #6f42c1;
    --syn-regex: #1e7a34;
    --syn-escape: #0077aa;
    --syn-plain: #141820;
    --blue: #0088cc;
    --blue-dim: rgba(0, 136, 204, 0.08);
    --blue-glow: rgba(0, 136, 204, 0.2);
    --purple: #7c3aed;
    --purple-dim: rgba(124, 58, 237, 0.08);
    --bounty: #b45309;
    --bounty-dim: rgba(180, 83, 9, 0.1);
    --mobile: #15803d;
    --mobile-dim: rgba(21, 128, 61, 0.12);
    --mobile-glow: rgba(21, 128, 61, 0.22);
}

html[data-theme="light"] .scanlines {
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.018) 2px,
        rgba(0, 0, 0, 0.018) 4px
    );
}

html[data-theme="light"] .gradient-orb {
    opacity: 0;
    visibility: hidden;
}

html[data-theme="light"] #network-canvas {
    opacity: 0.78;
}

html[data-theme="light"] .post-card,
html[data-theme="light"] .featured-post,
html[data-theme="light"] .post-author-card,
html[data-theme="light"] .cap-card {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .post-content pre {
    background: rgba(202, 206, 212, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .post-content pre::before {
    background: rgba(0, 0, 0, 0.03);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

/* Code window + syntax tokens — light mode */
html[data-theme="light"] .post-content .code-block {
    background: #eef0f4;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .code-block__bar {
    background: rgba(0, 0, 0, 0.03);
}

html[data-theme="light"] .post-content .code-block pre {
    background: transparent;
}

html[data-theme="light"] .code-block.is-collapsed .code-block__scroll::after {
    background: linear-gradient(to bottom, rgba(238, 240, 244, 0) 0%, #eef0f4 100%);
}

html[data-theme="light"] .code-block__expand-hint {
    background: rgba(0, 0, 0, 0.03);
}

html[data-theme="light"] .post-content .kg-table-card,
html[data-theme="light"] .post-content figure:has(table),
html[data-theme="light"] .post-content .table-wrapper {
    background: var(--table-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .post-content th {
    background: var(--table-head-bg);
    color: #006699;
}

html[data-theme="light"] .post-content td {
    color: var(--text);
    background: var(--table-cell-bg);
}

html[data-theme="light"] .post-content tbody tr:nth-child(even) td {
    background: var(--table-row-alt);
}

html[data-theme="light"] .post-content tbody tr:hover td {
    background: var(--table-row-hover);
}

html[data-theme="light"] .post-content :not(pre) > code {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

html[data-theme="light"] .post-content strong,
html[data-theme="light"] .post-content li strong {
    color: #0a0c10;
}

html[data-theme="light"] .post-content[dir="rtl"] strong,
html[data-theme="light"] .post-content .text-fa strong {
    color: #0a0c10;
}

html[data-theme="light"] .post-comments-panel textarea,
html[data-theme="light"] .post-comments-panel input[type="text"],
html[data-theme="light"] .post-comments-panel input[type="email"] {
    background: #f7f8fb;
}

html[data-theme="light"] .post-comments-panel .gh-comment {
    background: rgba(255, 255, 255, 0.85);
}

html[data-theme="light"] .post-comments-panel__body {
    background: var(--bg-surface);
}

html[data-theme="light"] .post-card-image-placeholder,
html[data-theme="light"] .featured-post-image-placeholder {
    background: rgba(200, 204, 210, 0.95);
    color: rgba(0, 0, 0, 0.18);
}

html[data-theme="light"] .featured-badge {
    background: rgba(217, 21, 69, 0.92);
}

html[data-theme="light"] .nav-flyout {
    background: rgba(220, 224, 230, 0.98);
}

html[data-theme="light"] .header-cat-dropdown {
    background: rgba(220, 224, 230, 0.98);
}

html[data-theme="light"] .error-page-fun .error-terminal {
    background: rgba(208, 212, 218, 0.95);
}

html[data-theme="light"] .theme-toggle:hover {
    border-color: rgba(0, 0, 0, 0.18);
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.06);
}

/* Hero globe — light mode */
html[data-theme="light"] .hero-globe::before {
    border-color: rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .hero-globe.is-hovered::before,
html[data-theme="light"] .hero-globe:hover::before {
    border-color: rgba(217, 21, 69, 0.35);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
}
