:root {
    --cx-bg: #080d12;
    --cx-bg-2: #0e161e;
    --cx-fg: #e2e8f0;
    --cx-muted: #64748b;
    --cx-dim: #334155;
    --cx-teal: #2dd4bf;
    --cx-teal-2: #14b8a6;
    --cx-coral: #fb7185;
    --cx-cream: #fcd34d;
    --cx-border: rgba(45, 212, 191, 0.18);
    --cx-border-2: rgba(45, 212, 191, 0.08);
    --cx-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

body.cx-body {
    background: var(--cx-bg);
    color: var(--cx-fg);
    font-family: var(--cx-mono);
    font-size: 16px;
    line-height: 1.7;
    background-image:
        radial-gradient(circle at 20% 15%, rgba(45, 212, 191, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 80% 85%, rgba(251, 113, 133, 0.03) 0%, transparent 45%),
        linear-gradient(rgba(45, 212, 191, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45, 212, 191, 0.018) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
    background-attachment: fixed;
}

.cx-wrap {
    max-width: 1040px;
    margin: 0 auto;
    padding: 48px 24px 120px;
}

.cx-back {
    color: var(--cx-muted);
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: inline-block;
    transition: color .15s;
}
.cx-back:hover { color: var(--cx-teal); }

/* ── Hero ───────────────────────────────────────────────────────── */
.cx-hero {
    margin: 40px 0 48px;
    border-left: 2px solid var(--cx-teal);
    padding: 6px 0 6px 26px;
    position: relative;
}
.cx-hero::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 14px;
    width: 12px;
    height: 12px;
    background: var(--cx-teal);
    border-radius: 50%;
    box-shadow: 0 0 18px rgba(45, 212, 191, 0.7);
}
.cx-hero-eyebrow {
    color: var(--cx-teal);
    font-size: 13px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 14px;
    text-shadow: 0 0 10px rgba(45, 212, 191, 0.35);
}
.cx-hero-title {
    font-size: clamp(34px, 6vw, 56px);
    font-weight: 600;
    letter-spacing: -0.03em;
    margin: 0 0 18px;
    color: #fff;
    font-family: var(--cx-mono);
}
.cx-hero-title::before {
    content: '~/';
    color: var(--cx-muted);
    font-weight: 400;
}
.cx-hero-tagline {
    color: var(--cx-muted);
    max-width: 66ch;
    font-size: 15px;
    line-height: 1.8;
}
.cx-hero-tagline strong { color: var(--cx-cream); font-weight: 600; }
.cx-hero-tagline em { color: var(--cx-coral); font-style: normal; }

/* ── Topic catalog (hub) ────────────────────────────────────────── */
.cx-catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
    margin: 40px 0 56px;
}

.cx-topic {
    display: block;
    padding: 22px 24px;
    background: var(--cx-bg-2);
    border: 1px solid var(--cx-border-2);
    border-left: 2px solid var(--cx-border);
    text-decoration: none;
    color: var(--cx-fg);
    transition: border-color .15s, background .15s, transform .15s;
    position: relative;
}
.cx-topic:hover {
    border-color: rgba(45, 212, 191, 0.4);
    border-left-color: var(--cx-teal);
    background: rgba(45, 212, 191, 0.04);
}
.cx-topic:hover .cx-topic-title { color: var(--cx-teal); }

.cx-topic.soon {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
.cx-topic.soon::after {
    content: 'yakında';
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--cx-muted);
    padding: 2px 8px;
    border: 1px dashed var(--cx-dim);
}

.cx-topic-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 6px;
}
.cx-topic-idx {
    color: var(--cx-muted);
    font-size: 11px;
    letter-spacing: 0.1em;
    font-variant-numeric: tabular-nums;
}
.cx-topic-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.015em;
    transition: color .15s;
}
.cx-topic-sub {
    color: var(--cx-muted);
    font-size: 12.5px;
    margin: 2px 0 14px;
    line-height: 1.55;
}
.cx-topic-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--cx-border-2);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cx-muted);
    font-variant-numeric: tabular-nums;
}
.cx-topic-meta .val { color: var(--cx-teal); }
.cx-topic-meta .val.coral { color: var(--cx-coral); }

/* ── Stats strip ────────────────────────────────────────────────── */
.cx-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1px;
    background: var(--cx-border);
    border: 1px solid var(--cx-border);
    margin-bottom: 40px;
}
.cx-stat {
    background: var(--cx-bg);
    padding: 18px 22px;
}
.cx-stat-label {
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cx-muted);
}
.cx-stat-value {
    font-size: 24px;
    color: var(--cx-teal);
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
}

/* ── Chapter TOC ────────────────────────────────────────────────── */
.cx-toc {
    font-size: 15px;
}
.cx-toc-root {
    color: var(--cx-muted);
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.cx-toc-root.dim {
    color: #52525b;
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 22px;
}

.cx-row {
    display: grid;
    grid-template-columns: 48px 56px 1fr auto;
    gap: 16px;
    padding: 12px 14px;
    align-items: baseline;
    color: var(--cx-fg);
    text-decoration: none;
    border-left: 2px solid transparent;
    border-bottom: 1px dashed var(--cx-border-2);
    transition: background .12s, border-color .12s;
}
.cx-row:last-child { border-bottom: none; }
.cx-row:hover {
    background: rgba(45, 212, 191, 0.04);
    border-left-color: var(--cx-teal);
}
.cx-row:hover .cx-row-title { color: var(--cx-teal); }

.cx-row-idx {
    color: var(--cx-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.cx-row-num {
    color: var(--cx-cream);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}
.cx-row-title {
    color: var(--cx-fg);
    transition: color .12s;
    font-size: 15px;
}
.cx-row-arrow {
    color: var(--cx-dim);
    font-size: 14px;
}
.cx-row:hover .cx-row-arrow { color: var(--cx-teal); }

.cx-legend {
    margin-top: 72px;
    padding-top: 24px;
    border-top: 1px solid var(--cx-border);
    font-size: 13px;
    color: var(--cx-muted);
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}
.cx-legend-item::before { content: '◆ '; color: var(--cx-teal); margin-right: 4px; }
.cx-legend-item.coral::before { color: var(--cx-coral); }
.cx-legend-item.cream::before { color: var(--cx-cream); }

/* ── Chapter page ───────────────────────────────────────────────── */
.cx-chapter {
    max-width: 76ch;
    margin: 0 auto;
    padding: 48px 24px 120px;
}
.cx-chapter-head {
    border-left: 2px solid var(--cx-teal);
    padding: 6px 0 6px 24px;
    margin: 40px 0 48px;
    position: relative;
}
.cx-chapter-head::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 12px;
    width: 10px;
    height: 10px;
    background: var(--cx-teal);
    border-radius: 50%;
    box-shadow: 0 0 14px rgba(45, 212, 191, 0.6);
}
.cx-chapter-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--cx-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 14px;
    align-items: center;
    flex-wrap: wrap;
}
.cx-chapter-meta .eyebrow { color: var(--cx-teal); }
.cx-chapter-meta .crumb { color: var(--cx-muted); }
.cx-chapter-meta .crumb a { color: var(--cx-muted); text-decoration: none; }
.cx-chapter-meta .crumb a:hover { color: var(--cx-teal); }
.cx-chapter-title {
    font-size: clamp(24px, 3.6vw, 34px);
    font-weight: 600;
    color: #fff;
    margin: 0 0 14px;
    line-height: 1.28;
    letter-spacing: -0.015em;
    font-family: var(--cx-mono);
}

.cx-content {
    color: var(--cx-fg);
    font-size: 16px;
    line-height: 1.85;
}
.cx-content h1,
.cx-content h2,
.cx-content h3,
.cx-content h4 {
    color: var(--cx-teal);
    font-weight: 600;
    margin: 2.4em 0 0.6em;
    letter-spacing: -0.01em;
    font-family: var(--cx-mono);
}
.cx-content h1 { font-size: 24px; }
.cx-content h2 { font-size: 20px; }
.cx-content h3 { font-size: 17px; color: var(--cx-cream); }
.cx-content h4 { font-size: 16px; color: var(--cx-coral); opacity: 0.9; }
.cx-content h1::before,
.cx-content h2::before { content: '§ '; color: var(--cx-muted); font-weight: 400; }

.cx-content p { margin: 0 0 1.1em; }
.cx-content a {
    color: var(--cx-teal);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}
.cx-content a:hover { color: var(--cx-cream); }
.cx-content strong { color: #fff; font-weight: 600; }
.cx-content em { color: var(--cx-coral); font-style: italic; }
.cx-content code {
    background: rgba(45, 212, 191, 0.08);
    padding: 1px 6px;
    color: var(--cx-teal);
    font-size: 14px;
    border: 1px solid var(--cx-border);
    border-radius: 2px;
}
.cx-content pre {
    background: var(--cx-bg-2);
    border: 1px solid var(--cx-border);
    border-left: 2px solid var(--cx-teal);
    padding: 18px 20px;
    overflow-x: auto;
    font-size: 13.5px;
    margin: 1.4em 0;
    line-height: 1.6;
}
.cx-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--cx-fg);
}
.cx-content blockquote {
    border-left: 2px solid var(--cx-coral);
    padding: 2px 0 2px 20px;
    color: var(--cx-muted);
    margin: 1.4em 0;
    font-style: italic;
}
.cx-content ul,
.cx-content ol { padding-left: 24px; margin: 0 0 1.1em; }
.cx-content li { margin: 0.35em 0; }
.cx-content ul li::marker { color: var(--cx-teal); }
.cx-content ol li::marker { color: var(--cx-cream); }
.cx-content hr {
    border: none;
    border-top: 1px dashed var(--cx-border);
    margin: 2.4em 0;
}
.cx-content img,
.cx-content svg,
.cx-content object,
.cx-content embed {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.6em auto;
    border: 1px solid var(--cx-border);
    background: var(--cx-bg-2);
    padding: 12px;
}
.cx-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.4em 0;
    font-size: 14px;
}
.cx-content th,
.cx-content td {
    border: 1px solid var(--cx-border);
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}
.cx-content th {
    background: rgba(45, 212, 191, 0.06);
    color: var(--cx-teal);
    font-weight: 600;
}

.cx-chapter-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 80px;
    padding-top: 28px;
    border-top: 1px solid var(--cx-border);
}
.cx-chapter-nav a {
    color: var(--cx-muted);
    text-decoration: none;
    font-size: 14px;
    display: block;
    line-height: 1.5;
    transition: color .15s;
}
.cx-chapter-nav a.next { text-align: right; }
.cx-chapter-nav a:hover { color: var(--cx-teal); }
.cx-chapter-nav .label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 6px;
    color: var(--cx-teal);
}

@media (max-width: 720px) {
    .cx-row { grid-template-columns: auto 52px 1fr auto; gap: 10px; }
    .cx-row-idx { display: none; }
    .cx-legend { gap: 14px; }
}
