/* SplatTop Style Bible */
:root {
    /* Brand Colors */
    --color-purple: #ab5ab7;
    --color-purple-dark: #7b28a4;
    --color-purple-light: #c183e1;

    /* Competition Accents */
    --color-fuchsia: #c026d3;
    --color-fuchsia-light: #d946ef;
    --color-fuchsia-lighter: #e879f9;

    /* Background Colors */
    --color-surface-dark: #0f172a;
    --color-surface-elevated: rgba(15, 23, 42, 0.55);
    --color-surface-subtle: rgba(255, 255, 255, 0.022);
    --color-surface-hint: rgba(13, 17, 23, 0.74);
    --color-gray-900: #1F2937;

    /* Text Colors */
    --color-text-primary: #ffffff;
    --color-text-secondary: #c9d1d9;
    --color-text-muted: #8b949e;

    /* Borders + Shadows */
    --border-soft: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(217, 70, 239, 0.35);
    --shadow-panel: 0 10px 26px rgba(1, 4, 9, 0.45);
    --shadow-elevated: 0 18px 42px rgba(1, 4, 9, 0.65);
    --shadow-accent:
        0 14px 36px rgba(1, 4, 9, 0.65),
        inset 0 0 0 1px rgba(217, 70, 239, 0.08);

    /* Typography */
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    --font-code: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-surface-dark);
    background-image:
        radial-gradient(1200px 600px at 10% -10%, rgba(217, 70, 239, 0.12), transparent 65%),
        radial-gradient(900px 480px at 90% 0%, rgba(192, 38, 211, 0.08), transparent 65%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 1) 55%);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 140px 140px;
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--color-purple-light);
    transition: color 200ms ease;
}

a:hover {
    color: var(--color-fuchsia-light);
}

.page-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: min(1100px, calc(100% - 2.5rem));
    margin: 0 auto;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-gray-900);
}

::-webkit-scrollbar-thumb {
    background: var(--color-purple);
    border-radius: 5px;
    border: 1px solid var(--color-gray-900);
}

/* Header / Navigation */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(15, 23, 42, 0.5));
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(18px);
    box-shadow: 0 8px 22px rgba(1, 4, 9, 0.28);
}

.site-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(217, 70, 239, 0.45), transparent);
    opacity: 0.6;
    pointer-events: none;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-title {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 12px 24px rgba(1, 4, 9, 0.35);
    color: var(--color-text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    letter-spacing: 0.03em;
    transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.site-title:hover {
    border-color: rgba(217, 70, 239, 0.4);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 14px 28px rgba(1, 4, 9, 0.4);
    transform: translateY(-1px);
}

.site-title__mark {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(232, 121, 249, 1), rgba(123, 40, 164, 0.85));
    box-shadow: 0 0 12px rgba(217, 70, 239, 0.6);
}

.site-title__text {
    text-shadow: 0 2px 6px rgba(1, 4, 9, 0.35);
}

/* Main Content */
.site-main {
    padding: clamp(1.5rem, 3vw, 2.5rem) 0 3rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

h1, h2, h3, h4 {
    color: var(--color-text-primary);
}

/* Hero */
.page-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border-radius: 20px;
    border: 1px solid rgba(217, 70, 239, 0.14);
    background: linear-gradient(140deg, rgba(217, 70, 239, 0.12), rgba(15, 23, 42, 0.78));
    box-shadow: var(--shadow-elevated);
    animation: fade-up 600ms ease both;
}

.page-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(217, 70, 239, 0.22), transparent 55%);
    opacity: 0.4;
    pointer-events: none;
}

.page-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.1;
    position: relative;
    z-index: 1;
}

.page-intro {
    color: var(--color-text-secondary);
    max-width: 62ch;
    position: relative;
    z-index: 1;
}

/* Post Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.post-card {
    background: var(--color-surface-elevated);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    box-shadow: var(--shadow-panel);
    backdrop-filter: blur(16px);
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
    animation: card-in 700ms ease both;
}

.post-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(217, 70, 239, 0.8), transparent);
    opacity: 0;
    transition: opacity 200ms ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-accent);
    border-color: rgba(217, 70, 239, 0.25);
}

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

.post-card__media {
    display: block;
    height: 180px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.post-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms ease;
}

.post-card:hover .post-card__media img {
    transform: scale(1.03);
}

.post-card--no-media {
    background-image: linear-gradient(135deg, rgba(217, 70, 239, 0.06), rgba(15, 23, 42, 0.65));
}

.post-card__content {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.post-card__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid rgba(217, 70, 239, 0.3);
    background: rgba(217, 70, 239, 0.1);
    color: var(--color-text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.post-card__title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.post-card__title a {
    color: var(--color-text-primary);
    text-decoration: none;
}

.post-card__excerpt {
    color: var(--color-text-secondary);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 0 0;
    color: var(--color-text-secondary);
}

.pagination__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid rgba(217, 70, 239, 0.2);
    background: rgba(15, 23, 42, 0.6);
    color: var(--color-text-primary);
    text-decoration: none;
    transition: border-color 200ms ease, background 200ms ease, color 200ms ease;
}

.pagination__link:hover {
    border-color: rgba(217, 70, 239, 0.45);
    background: rgba(217, 70, 239, 0.12);
}

.pagination__link--disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination__status {
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

/* Post Detail */
.post {
    position: relative;
    overflow: hidden;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border-radius: 20px;
    border: 1px solid var(--border-soft);
    background: var(--color-surface-elevated);
    box-shadow: var(--shadow-elevated);
}

.post::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(217, 70, 239, 0.1), transparent 55%);
    pointer-events: none;
}

.post-header {
    position: relative;
    z-index: 1;
    margin-bottom: 2rem;
}

.post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
}

.post-sidebar {
    position: relative;
}

.post-toc {
    border-radius: 16px;
    border: 1px solid rgba(217, 70, 239, 0.2);
    background: rgba(15, 23, 42, 0.7);
    padding: 1.25rem 1.25rem 1.4rem;
    box-shadow: var(--shadow-panel);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--site-header-offset, 120px) - 32px);
}

.post-toc__progress {
    height: 6px;
    border-radius: 999px;
    background: rgba(217, 70, 239, 0.12);
    overflow: hidden;
    margin-bottom: 1rem;
}

.post-toc__progress-bar {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(217, 70, 239, 0.85), rgba(244, 114, 182, 0.85));
    transition: width 120ms ease;
}

.post-toc__header {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.post-toc__eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.post-toc__crumb {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.post-toc__title {
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.post-toc__nav {
    overflow-y: auto;
    padding-right: 0.2rem;
    flex: 1 1 auto;
    min-height: 0;
}

.post-toc__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.4rem;
}

.post-toc__item--h2 {
    padding-left: 0.7rem;
}

.post-toc__item--h3 {
    padding-left: 1.4rem;
}

.post-toc__item.is-hidden {
    display: none;
}

.post-toc__link {
    display: block;
    padding: 0.35rem 0.5rem;
    border-radius: 10px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
    border: 1px solid transparent;
}

.post-toc__link:hover {
    color: var(--color-text-primary);
    background: rgba(217, 70, 239, 0.08);
    border-color: rgba(217, 70, 239, 0.18);
}

.post-toc__link.is-active {
    color: #fdf4ff;
    background: rgba(217, 70, 239, 0.18);
    border-color: rgba(217, 70, 239, 0.35);
}

.post-toc--compact .post-toc__title,
.post-toc--compact .post-toc__nav {
    display: none;
}

.post-toc--compact .post-toc__header {
    margin-bottom: 0;
}

.post-toc--condensed .post-toc__item--sub {
    display: none;
}

.post-toc--condensed .post-toc__item--sub.is-active,
.post-toc--condensed .post-toc__item--sub.is-parent-active {
    display: block;
}

.post-toc-drawer-toggle {
    display: none;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(217, 70, 239, 0.35);
    background: rgba(217, 70, 239, 0.12);
    color: #f3e8ff;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.post-toc-drawer-toggle__icon {
    width: 14px;
    height: 10px;
    position: relative;
    display: inline-block;
}

.post-toc-drawer-toggle__icon::before,
.post-toc-drawer-toggle__icon::after,
.post-toc-drawer-toggle__icon span {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 999px;
    background: #f6e7fb;
}

.post-toc-drawer-toggle__icon::before {
    top: 0;
}

.post-toc-drawer-toggle__icon::after {
    bottom: 0;
}

.post-toc-drawer-toggle__icon span {
    top: 4px;
}

.post-toc-drawer-toggle:hover {
    border-color: rgba(217, 70, 239, 0.6);
    background: rgba(217, 70, 239, 0.2);
    color: #fff;
}

.post-toc-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.6);
    backdrop-filter: blur(2px);
    z-index: 180;
    opacity: 0;
    transition: opacity 180ms ease;
}

.toc-drawer-open .post-toc-backdrop {
    display: block;
    opacity: 1;
}

.toc-drawer-open {
    overflow: hidden;
    padding-right: var(--scrollbar-offset, 0px);
}

@media (min-width: 1100px) {
    .post-layout {
        grid-template-columns: minmax(0, 1fr) 280px;
        align-items: start;
        gap: 2rem;
    }

    .post-sidebar {
        position: sticky;
        top: 120px;
        align-self: start;
    }
}

@media (max-width: 1099px) {
    .post-toc-drawer-toggle {
        display: inline-flex;
    }

    .post-sidebar {
        position: fixed;
        top: var(--site-header-offset, 72px);
        right: 0;
        bottom: 0;
        width: min(85vw, 320px);
        padding: 1rem;
        z-index: 190;
        transform: translateX(100%);
        transition: transform 200ms ease;
    }

    .post-toc {
        max-height: calc(100vh - var(--site-header-offset, 72px) - 24px);
        overflow-y: auto;
    }

    .toc-drawer-open .post-sidebar {
        transform: translateX(0%);
    }
}

.post-title {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.75rem;
}

.post-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    border: 1px solid var(--border-accent);
    background: rgba(217, 70, 239, 0.12);
    color: var(--color-text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.post-abstract {
    margin-top: 0.9rem;
    font-size: 1.1rem;
    color: rgba(201, 209, 217, 0.85);
    line-height: 1.6;
}

.post-readtime {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgba(201, 209, 217, 0.75);
}

.post-readtime__main,
.post-readtime__deep {
    font-weight: 600;
    color: rgba(201, 209, 217, 0.75);
}

.post-readtime__divider {
    opacity: 0.5;
}

.featured-image {
    margin: 1.5rem 0 2rem;
    box-shadow: var(--shadow-panel);
    max-height: 420px;
    width: 100%;
    object-fit: cover;
}

.post-content {
    position: relative;
    z-index: 1;
}

.post-content a:not(.para-anchor):not(.button-primary):not(.link-card),
.markdown-content a:not(.para-anchor):not(.button-primary):not(.link-card),
.rich-text a:not(.para-anchor):not(.button-primary):not(.link-card) {
    color: #f8eaff;
    text-decoration: none;
    border-bottom: 2px solid rgba(217, 70, 239, 0.85);
    box-shadow: inset 0 -0.5em 0 rgba(217, 70, 239, 0.2);
    padding: 0 0.08em;
    border-radius: 0.2em;
    transition: color 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.post-content a:not(.para-anchor):not(.button-primary):not(.link-card):hover,
.markdown-content a:not(.para-anchor):not(.button-primary):not(.link-card):hover,
.rich-text a:not(.para-anchor):not(.button-primary):not(.link-card):hover {
    color: #ffffff;
    border-bottom-color: rgba(217, 70, 239, 0.95);
    box-shadow: inset 0 -0.7em 0 rgba(217, 70, 239, 0.3);
}

.post-content a:not(.para-anchor):not(.button-primary):not(.link-card):focus-visible,
.markdown-content a:not(.para-anchor):not(.button-primary):not(.link-card):focus-visible,
.rich-text a:not(.para-anchor):not(.button-primary):not(.link-card):focus-visible {
    outline: none;
    border-bottom-color: rgba(217, 70, 239, 0.9);
    box-shadow:
        0 0 0 2px rgba(217, 70, 239, 0.35),
        inset 0 -0.7em 0 rgba(217, 70, 239, 0.32);
}

.content p, .markdown-content p, .rich-text p {
    margin-bottom: 1.25rem;
    color: var(--color-text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
}

.post-content p,
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6,
.post-content .collapsible-block__summary {
    position: relative;
    scroll-margin-top: var(--site-header-offset, 120px);
}

.post-content .para-anchor {
    position: absolute;
    left: -1.4rem;
    top: 0.2rem;
    font-size: 0.85rem;
    color: rgba(217, 70, 239, 0.6);
    text-decoration: none;
    opacity: 0;
    transition: opacity 120ms ease, color 120ms ease;
}

.post-content .para-anchor::before {
    content: "¶";
}

.copy-toast {
    position: fixed;
    z-index: 260;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(217, 70, 239, 0.4);
    color: #f3e8ff;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 160ms ease, transform 160ms ease;
    pointer-events: none;
    box-shadow: 0 12px 24px rgba(1, 4, 9, 0.35);
}

.copy-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.glossary-data {
    display: none;
}

.glossary-term {
    appearance: none;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: #f3e8ff;
    cursor: help;
    border-bottom: 1px dashed rgba(217, 70, 239, 0.55);
    transition: color 120ms ease, border-color 120ms ease;
}

.glossary-term:hover,
.glossary-term:focus {
    color: #ffffff;
    border-bottom-color: rgba(244, 114, 182, 0.9);
    outline: none;
}

.glossary-tooltip {
    position: fixed;
    max-width: min(320px, 80vw);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(217, 70, 239, 0.35);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    box-shadow: 0 18px 32px rgba(1, 4, 9, 0.4);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 140ms ease, transform 140ms ease;
    z-index: 240;
    pointer-events: none;
}

.glossary-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.glossary-tooltip__term {
    font-weight: 600;
    color: #fdf4ff;
    margin-bottom: 0.35rem;
}

.glossary-list {
    margin: 1.5rem 0;
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid rgba(217, 70, 239, 0.2);
    background: rgba(15, 23, 42, 0.6);
}

.glossary-list h3 {
    margin-top: 0;
}

.glossary-list dl {
    margin: 0;
}

.glossary-list dt {
    font-weight: 600;
    color: var(--color-text-primary);
    margin-top: 1rem;
}

.glossary-list dt:first-child {
    margin-top: 0;
}

.glossary-list dd {
    margin: 0.35rem 0 0;
    color: var(--color-text-secondary);
}

.takeaway {
    --takeaway-accent: rgba(56, 189, 248, 0.35);
    --takeaway-bg: rgba(56, 189, 248, 0.08);
    --takeaway-title: #cffafe;
    --takeaway-glow: rgba(56, 189, 248, 0.6);
    --takeaway-shadow: rgba(14, 116, 144, 0.25);
    display: flex;
    gap: 0.9rem;
    padding: 1.1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 16px;
    border: 1px solid var(--takeaway-accent);
    background: var(--takeaway-bg);
    box-shadow: 0 12px 28px var(--takeaway-shadow);
}

.takeaway__icon {
    width: 14px;
    height: 14px;
    margin-top: 0.35rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fdf4ff 0%, var(--takeaway-glow) 60%, rgba(255, 255, 255, 0) 100%);
    box-shadow: 0 0 12px var(--takeaway-glow);
}

.takeaway__title {
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--takeaway-title);
    margin-bottom: 0.35rem;
}

.takeaway__body {
    color: var(--color-text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

.takeaway__body p {
    margin: 0;
}

.takeaway__body p + p {
    margin-top: 0.6rem;
}

.takeaway--purple {
    --takeaway-accent: rgba(217, 70, 239, 0.35);
    --takeaway-bg: rgba(217, 70, 239, 0.1);
    --takeaway-title: #f6e7fb;
    --takeaway-glow: rgba(217, 70, 239, 0.7);
    --takeaway-shadow: rgba(88, 28, 135, 0.35);
}

.takeaway--pink {
    --takeaway-accent: rgba(236, 72, 153, 0.35);
    --takeaway-bg: rgba(236, 72, 153, 0.1);
    --takeaway-title: #fde2f2;
    --takeaway-glow: rgba(236, 72, 153, 0.7);
    --takeaway-shadow: rgba(131, 24, 67, 0.35);
}

.takeaway--gold {
    --takeaway-accent: rgba(253, 230, 138, 0.45);
    --takeaway-bg: rgba(253, 230, 138, 0.12);
    --takeaway-title: #fde68a;
    --takeaway-glow: rgba(253, 230, 138, 0.75);
    --takeaway-shadow: rgba(161, 98, 7, 0.35);
}

.post-content .para-anchor:hover {
    color: rgba(244, 114, 182, 0.95);
}

.post-content p:hover .para-anchor,
.post-content h1:hover .para-anchor,
.post-content h2:hover .para-anchor,
.post-content h3:hover .para-anchor,
.post-content h4:hover .para-anchor,
.post-content h5:hover .para-anchor,
.post-content h6:hover .para-anchor,
.post-content .collapsible-block__summary:hover .para-anchor {
    opacity: 1;
}

@media (max-width: 700px) {
    .post-content .para-anchor {
        left: -0.6rem;
        opacity: 0.35;
    }
}

.content ul, .content ol,
.markdown-content ul, .markdown-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
    color: var(--color-text-secondary);
}

.content li, .markdown-content li {
    margin-bottom: 0.5rem;
}

blockquote {
    border-left: 3px solid var(--color-purple);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    color: var(--color-text-secondary);
    font-style: italic;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

figure {
    margin: 1.5rem 0;
}

figure img {
    display: block;
    margin: 0 auto;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.post-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.55);
}

.post-content table thead th {
    text-align: left;
    padding: 0.75rem 0.9rem;
    color: #f3e8ff;
    background: rgba(217, 70, 239, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 600;
}

.post-content table tbody td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--color-text-secondary);
}

.post-content table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

pre, code {
    font-family: var(--font-code);
    background: var(--color-gray-900);
    border-radius: 10px;
}

pre {
    padding: 1.25rem;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin: 1.5rem 0;
}

code {
    padding: 0.2rem 0.4rem;
    font-size: 0.9em;
}

pre code {
    padding: 0;
    background: transparent;
}

/* Applet iframe */
.applet-frame,
.post-content iframe[src^="/static/applets/"] {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: var(--applet-frame-height, 0px);
    margin: 1.5rem 0;
    border: 0;
    border-radius: 16px;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    overflow-anchor: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.applet-frame[data-applet-full-height="true"],
.post-content iframe[src^="/static/applets/"][data-applet-full-height="true"] {
    min-height: 0;
}

.applet-frame::-webkit-scrollbar,
.post-content iframe[src^="/static/applets/"]::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.applet-frame.is-framed {
    border: 1px solid var(--border-soft);
    background: rgba(15, 23, 42, 0.55);
    box-shadow: var(--shadow-panel);
}

.post-nav {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-soft);
}

.post-nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    padding: 0.55rem 1.25rem;
    border-radius: 9999px;
    border: 1px solid rgba(217, 70, 239, 0.25);
    background: rgba(217, 70, 239, 0.08);
    transition: all 200ms ease;
}

.post-nav a:hover {
    background: rgba(217, 70, 239, 0.18);
    color: var(--color-text-primary);
}

/* Home */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.link-card {
    display: block;
    padding: 1.2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: var(--color-surface-elevated);
    color: var(--color-text-primary);
    text-decoration: none;
    box-shadow: var(--shadow-panel);
    transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.link-card:hover {
    transform: translateY(-3px);
    border-color: rgba(217, 70, 239, 0.25);
    box-shadow: var(--shadow-accent);
}

.link-card__title {
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.link-card__meta {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Footer */
.site-footer {
    margin-top: auto;
    padding: 2rem 0 2.5rem;
    border-top: 1px solid var(--border-soft);
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Button Styles */
.button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(217, 70, 239, 0.95), rgba(192, 38, 211, 0.9));
    color: #fff;
    border: 1px solid rgba(217, 70, 239, 0.55);
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.55rem 1.25rem;
    box-shadow: 0 12px 30px rgba(217, 70, 239, 0.25);
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
    cursor: pointer;
    text-decoration: none;
}

.button-primary:hover {
    background: linear-gradient(135deg, rgba(232, 121, 249, 0.95), rgba(217, 70, 239, 0.92));
    box-shadow: 0 14px 32px rgba(217, 70, 239, 0.35);
    color: #fff;
}

.button-primary:active {
    transform: scale(0.98);
}

/* Collapsible Blocks */
.collapsible-block {
    margin: 1.5rem 0;
    border-radius: 12px;
    border: 1px solid var(--collapsible-accent, rgba(217, 70, 239, 0.2));
    background: rgba(15, 23, 42, 0.6);
    overflow: hidden;
}

.collapsible-block__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    background: var(--collapsible-accent-bg, rgba(217, 70, 239, 0.08));
    border-bottom: 1px solid transparent;
    transition: background 200ms ease, border-color 200ms ease;
    list-style: none;
}

.collapsible-block__summary::-webkit-details-marker {
    display: none;
}

.collapsible-block__summary::marker {
    display: none;
    content: "";
}

.collapsible-block__summary:hover {
    background: var(--collapsible-accent-hover, rgba(217, 70, 239, 0.14));
}

.collapsible-block[open] .collapsible-block__summary {
    border-bottom-color: var(--collapsible-accent, rgba(217, 70, 239, 0.2));
}

.collapsible-block__heading {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.collapsible-block__title {
    font-weight: 600;
    color: var(--color-text-primary);
}

.collapsible-block__readtime {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.collapsible-block__badge {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--collapsible-badge-bg, rgba(217, 70, 239, 0.18));
    border: 1px solid var(--collapsible-badge-border, rgba(217, 70, 239, 0.45));
    color: var(--collapsible-badge-text, #f6e7fb);
}

.collapsible-block__icon {
    width: 20px;
    height: 20px;
    position: relative;
    flex-shrink: 0;
}

.collapsible-block__icon::before,
.collapsible-block__icon::after {
    content: "";
    position: absolute;
    background: var(--collapsible-icon, var(--color-purple-light));
    border-radius: 2px;
    transition: transform 200ms ease;
}

.collapsible-block__icon::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    transform: translateY(-50%);
}

.collapsible-block__icon::after {
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);
}

.collapsible-block[open] .collapsible-block__icon::after {
    transform: translateX(-50%) rotate(90deg);
    opacity: 0;
}

.collapsible-block__content {
    padding: 1.25rem;
}

.collapsible-block__content > :first-child {
    margin-top: 0;
}

.collapsible-block__content > :last-child {
    margin-bottom: 0;
}

/* Nested collapsible blocks */
.collapsible-block .collapsible-block {
    margin: 1rem 0;
    background: rgba(15, 23, 42, 0.4);
}

/* KaTeX overflow handling for multiline math */
.post-content .katex-display,
.post-content .latex-block {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.collapsible-block--explainer {
    --collapsible-accent: rgba(56, 189, 248, 0.25);
    --collapsible-accent-bg: rgba(56, 189, 248, 0.1);
    --collapsible-accent-hover: rgba(56, 189, 248, 0.16);
    --collapsible-badge-bg: rgba(56, 189, 248, 0.18);
    --collapsible-badge-border: rgba(56, 189, 248, 0.4);
    --collapsible-badge-text: #cffafe;
    --collapsible-icon: rgba(56, 189, 248, 0.9);
}

.collapsible-block--technical {
    --collapsible-accent: rgba(193, 131, 225, 0.3);
    --collapsible-accent-bg: rgba(193, 131, 225, 0.12);
    --collapsible-accent-hover: rgba(193, 131, 225, 0.18);
    --collapsible-badge-bg: rgba(193, 131, 225, 0.22);
    --collapsible-badge-border: rgba(193, 131, 225, 0.45);
    --collapsible-badge-text: #f3e8ff;
    --collapsible-icon: rgba(193, 131, 225, 0.9);
}

.collapsible-block--extra {
    --collapsible-accent: rgba(236, 72, 153, 0.28);
    --collapsible-accent-bg: rgba(236, 72, 153, 0.1);
    --collapsible-accent-hover: rgba(236, 72, 153, 0.16);
    --collapsible-badge-bg: rgba(236, 72, 153, 0.2);
    --collapsible-badge-border: rgba(236, 72, 153, 0.45);
    --collapsible-badge-text: #fde2f2;
    --collapsible-icon: rgba(236, 72, 153, 0.9);
}

.collapsible-block--subquest {
    --collapsible-accent: rgba(253, 230, 138, 0.32);
    --collapsible-accent-bg: rgba(253, 230, 138, 0.12);
    --collapsible-accent-hover: rgba(253, 230, 138, 0.18);
    --collapsible-badge-bg: rgba(253, 230, 138, 0.2);
    --collapsible-badge-border: rgba(253, 230, 138, 0.5);
    --collapsible-badge-text: #fde68a;
    --collapsible-icon: rgba(253, 230, 138, 0.9);
}

/* Animations */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.post-card:nth-child(2) {
    animation-delay: 80ms;
}

.post-card:nth-child(3) {
    animation-delay: 140ms;
}

.post-card:nth-child(4) {
    animation-delay: 200ms;
}

.post-card:nth-child(5) {
    animation-delay: 260ms;
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        width: calc(100% - 1.5rem);
    }

    .post-card__media {
        height: 160px;
    }

    .post-card__content {
        padding: 1rem 1.1rem 1.25rem;
    }

    .post-nav a {
        width: 100%;
        justify-content: center;
    }

    .pagination {
        flex-direction: column;
    }

    .pagination__link {
        width: 100%;
    }
}
