:root,
html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0A0A0A;
    --bg-deep: #2b2e36;
    --text-primary: #f4f4f2;
    --text-secondary: #d5d7dc;
    --text-muted: rgba(244, 244, 242, 0.58);
    --accent: #191b21;
    --surface: #111318;
    --surface-border: rgba(255, 255, 255, 0.1);
    --surface-shadow: rgba(0, 0, 0, 0.28);
    --reading-text: #dedfe2;
    --reading-muted: #a6a8ad;
    --heading: #ffffff;
    --divider: rgba(255, 255, 255, 0.14);
    --subtle-fill: rgba(255, 255, 255, 0.06);
    --code-fill: rgba(255, 255, 255, 0.1);
    --code-text: #ff8b8b;
    --orange-text: #f6b84b;
    --quote-border: rgba(255, 255, 255, 0.28);
    --media-border: rgba(255, 255, 255, 0.14);
    --link-color: #ff3a8f;
    --link-hover: #ff78b2;
    --theme-switch-bg: rgba(18, 19, 23, 0.76);
    --theme-switch-border: #2b2e36;
    --theme-switch-hover: rgba(32, 34, 40, 0.94);
    --theme-switch-icon: #f8f8f6;
    --theme-switch-shadow: rgba(0, 0, 0, 0.32);
    --edge: clamp(16px, 4vw, 48px);
    --measure: min(900px, calc(100vw - (var(--edge) * 2)));
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #ffffff;
    --bg-deep: #d9d9d9;
    --text-primary: #121212;
    --text-secondary: #303030;
    --text-muted: rgba(18, 18, 18, 0.55);
    --accent: #f1f1f1;
    --surface: #ffffff;
    --surface-border: rgba(0, 0, 0, 0.08);
    --surface-shadow: rgba(0, 0, 0, 0.08);
    --reading-text: #1f1f1f;
    --reading-muted: #5f5f5f;
    --heading: #101010;
    --divider: rgba(0, 0, 0, 0.12);
    --subtle-fill: rgba(0, 0, 0, 0.04);
    --code-fill: rgba(135, 131, 120, 0.15);
    --code-text: #a72f3d;
    --orange-text: #9a4d00;
    --quote-border: rgba(0, 0, 0, 0.3);
    --media-border: rgba(0, 0, 0, 0.13);
    --link-color: #064db8;
    --link-hover: #003783;
    --theme-switch-bg: rgba(249, 249, 251, 0.84);
    --theme-switch-border: #d8dae1;
    --theme-switch-hover: rgba(238, 240, 245, 0.96);
    --theme-switch-icon: #17191f;
    --theme-switch-shadow: rgba(20, 24, 35, 0.14);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

::-webkit-scrollbar {
    display: none;
}

::selection {
    background: #ff8cd4;
    color: rgba(0, 0, 0, 0.8);
}

::-moz-selection {
    background: #ff8cd4;
    color: rgba(0, 0, 0, 0.8);
}

body {
    font-family: "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.7;
    opacity: 0;
    filter: blur(8px);
    transition: opacity 360ms ease-in-out, filter 520ms ease-in-out, background-color 150ms ease, color 150ms ease;
}

body.theme-ready {
    opacity: 1;
    filter: none;
}

.page-shell {
    min-height: 100vh;
    position: relative;
}

.algae-section {
    width: 100%;
    height: 10vh;
    min-height: 72px;
    max-height: 140px;
    position: relative;
    overflow: hidden;
    background: transparent;
}

.algae-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        110deg,
        color-mix(in srgb, var(--bg-deep) 62%, transparent) 12%,
        color-mix(in srgb, var(--bg) 40%, white 8%) 36%,
        color-mix(in srgb, var(--bg-deep) 62%, transparent) 64%
    );
    background-size: 220% 100%;
    animation: shaderSkeleton 1.25s linear infinite;
    opacity: 1;
    transition: opacity 300ms ease;
    pointer-events: none;
    z-index: 0;
}

.algae-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: auto;
    opacity: 0;
    transition: opacity 420ms ease;
    z-index: 1;
}

.algae-section.shader-ready::before {
    opacity: 0;
}

.algae-section.shader-ready .algae-canvas {
    opacity: 1;
}

@keyframes shaderSkeleton {
    from {
        background-position: 0% 50%;
    }
    to {
        background-position: 100% 50%;
    }
}

.site-head {
    width: min(900px, calc(100vw - (var(--edge) * 2)));
    margin: 0 auto;
    padding: 16px 0 20px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-wrapper {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 44px;
    height: 44px;
    z-index: 20;
}

.logo-wrapper img {
    width: 100%;
    height: 100%;
    display: block;
}

.ellipse-path {
    stroke-dasharray: 3500;
    stroke-dashoffset: 3500;
    animation: drawPath 1.2s ease-out 0s forwards;
}

@keyframes drawPath {
    to {
        stroke-dashoffset: 0;
    }
}

.planet {
    offset-path: path("M336.684 935.454C160.31 1178.07 85.9825 1390.89 166.552 1472.9C281.63 1590.04 669.127 1395.99 1032.05 1039.46C1394.98 682.936 1595.9 298.951 1480.82 181.808C1404.97 104.599 1301.5 107.914 1074 258.5");
    offset-distance: 15%;
    offset-rotate: 0deg;
    transform: scale(0);
    animation: followPath 1.6s cubic-bezier(0.34, 1.56, 0.64, 1) 1.2s forwards;
}

@keyframes followPath {
    0% {
        offset-distance: 15%;
        transform: scale(0);
    }
    15% {
        transform: scale(1);
    }
    100% {
        offset-distance: 70%;
        transform: scale(1);
    }
}

.home-link,
.home-link:visited {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border-radius: 0;
    text-decoration: none;
    color: var(--text-primary);
    border: none;
    background: transparent;
    font-size: 16px;
    font-family: "Libertinus Serif", Georgia, "Times New Roman", serif;
    letter-spacing: 0.05em;
    transition: color 0.2s ease;
    margin-right: 2px;
    position: relative;
}

.home-link:hover {
    color: var(--text-primary);
}

.home-link::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 999px;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' viewBox='0 0 10 10'%3E%3Cpath d='M0,5 Q2.5,0 5,5 T10,5' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' viewBox='0 0 10 10'%3E%3Cpath d='M0,5 Q2.5,0 5,5 T10,5' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    -webkit-mask-size: 10px 2px;
    mask-size: 10px 2px;
    -webkit-mask-repeat: repeat-x;
    mask-repeat: repeat-x;
    opacity: 0;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), -webkit-mask-size 0.3s cubic-bezier(0.4, 0, 0.2, 1), mask-size 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.home-link:hover::after {
    height: 5px;
    bottom: -2px;
    opacity: 0.82;
    -webkit-mask-size: 10px 5px;
    mask-size: 10px 5px;
    animation: footerSquiggle 4s linear infinite;
}

.home-link svg {
    width: 12px;
    height: 12px;
    color: var(--text-primary);
}

.blog-main {
    width: min(900px, calc(100vw - (var(--edge) * 2)));
    margin: 0 auto;
    padding: 0 0 24px;
}

.article-shell {
    background: var(--bg);
    color: var(--reading-text);
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

.page {
    margin: 0;
    /* padding: clamp(20px, 4vw, 42px); */
}

.page-title {
    font-size: clamp(30px, 4.2vw, 42px);
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -0.02em;
    font-family: "Libertinus Serif", Georgia, "Times New Roman", serif;
    color: var(--heading);
    margin: 0;
}

.post-meta-date {
    margin: 14px 0 8px;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.post-meta-divider {
    height: 1px;
    width: 100%;
    background: var(--divider);
    margin: 0 0 18px;
}

.page-body {
    margin-top: 18px;
}

.page-header-icon {
    width: 64px;
    height: 64px;
    border-radius: 4px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 12px;
}

.page-header-icon .icon,
.page-header-icon img,
.page-header-icon svg {
    width: 64px;
    height: 64px;
    border-radius: 4px;
    display: block;
    object-fit: cover;
}

.page-header-icon .icon {
    font-size: 52px;
    line-height: 64px;
    text-align: center;
}

h1,
h2,
h3 {
    letter-spacing: -0.01em;
    line-height: 1.3;
    font-weight: 500;
    margin: 1.6em 0 0.4em;
    font-family: "Libertinus Serif", Georgia, "Times New Roman", serif;
    color: var(--heading);
}

h1 {
    font-size: 1.8rem;
}

h2 {
    font-size: 1.45rem;
}

h3 {
    font-size: 1.25rem;
}

h1 strong,
h2 strong,
h3 strong {
    font-weight: 500;
}

p,
ul,
ol,
blockquote,
figcaption {
    font-size: clamp(14px, 1.6vw, 15px);
    color: var(--reading-text);
}

p {
    margin: 0.5em 0;
}

ul,
ol {
    margin: 0.5em 0;
    padding-inline-start: 1.4em;
}

li {
    margin: 0.35em 0;
}

a,
a:visited {
    color: var(--link-color);
    text-decoration-line: underline;
    text-decoration-style: wavy;
    text-decoration-color: currentColor;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--link-hover);
}

figcaption {
    font-style: italic;
    opacity: 0.7;
}

figure {
    margin: 1.35em 0;
    page-break-inside: avoid;
}

.image {
    border: none;
    padding: 0;
    text-align: center;
}

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

video {
    border-radius: 3px;
}

.page img,
.page video {
    border: 1px solid var(--media-border);
}

.callout {
    border-radius: 6px;
    padding: 1rem;
    border: 1px solid var(--surface-border);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.callout-row {
    white-space: normal;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.callout-row p {
    margin: 0;
}

.callout-icon {
    font-size: 1.5em;
    line-height: 1;
}

.block-color-gray_background {
    background: var(--subtle-fill);
}

.block-color-orange {
    color: var(--orange-text);
}

code,
.code {
    background: var(--code-fill);
    border-radius: 3px;
    padding: 0.2em 0.4em;
    font-size: 85%;
    tab-size: 2;
}

code {
    color: var(--code-text);
}

blockquote {
    margin: 1em 0;
    padding-left: 1em;
    border-left: 3px solid var(--quote-border);
}

hr {
    border: none;
    border-bottom: 1px solid var(--divider);
    margin: 1.2em 0;
}

.table_of_contents-item {
    display: block;
    font-size: 0.875rem;
    line-height: 1.3;
    padding: 0.125rem;
}

.table_of_contents-indent-1 {
    margin-left: 1.5rem;
}

.table_of_contents-indent-2 {
    margin-left: 3rem;
}

.table_of_contents-indent-3 {
    margin-left: 4.5rem;
}

.table_of_contents-link {
    text-decoration: none;
    opacity: 0.7;
    border-bottom: 1px solid rgba(55, 53, 47, 0.18);
}

table,
th,
td {
    border: 1px solid var(--surface-border);
}

table {
    border-collapse: collapse;
}

th,
td {
    font-weight: 400;
    padding: 0.25em 0.5em;
    line-height: 1.5;
    text-align: left;
}

.blog-footer {
    width: min(900px, calc(100vw - (var(--edge) * 2)));
    /* margin: 30px 0 0 var(--edge); */
    padding: 20px 0 20px;
    border-top: 1px solid var(--divider);
}

.blog-footer-read-more {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-transform: none;
    font-family: "Libertinus Serif", Georgia, "Times New Roman", serif;
    color: var(--text-muted);
}

.blog-footer-link-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.blog-footer-link,
.blog-footer-link:visited {
    text-decoration: none;
    color: var(--link-color);
    font-family: "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 16px;
    position: relative;
    display: inline-block;
    padding-bottom: 0px;
}

.blog-footer-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 999px;
    background-color: currentColor;
    opacity: 0.42;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' viewBox='0 0 10 10'%3E%3Cpath d='M0,5 Q2.5,0 5,5 T10,5' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' viewBox='0 0 10 10'%3E%3Cpath d='M0,5 Q2.5,0 5,5 T10,5' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    -webkit-mask-size: 10px 2px;
    mask-size: 10px 2px;
    -webkit-mask-repeat: repeat-x;
    mask-repeat: repeat-x;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), -webkit-mask-size 0.3s cubic-bezier(0.4, 0, 0.2, 1), mask-size 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, opacity 0.3s ease, bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-footer-link:hover {
    color: var(--link-hover);
}

.blog-footer-link:hover::after {
    height: 5px;
    bottom: -2px;
    opacity: 0.82;
    background-color: currentColor;
    -webkit-mask-size: 10px 5px;
    mask-size: 10px 5px;
    animation: footerSquiggle 4s linear infinite;
}

.blog-footer-socials {
    margin-top: 36px;
    display: flex;
    gap: 28px;
    align-items: center;
}

.blog-footer-social-link,
.blog-footer-social-link:visited {
    text-decoration: none;
    color: var(--text-secondary);
    font-family: "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    position: relative;
    padding-bottom: 0px;
}

.blog-footer-social-link:hover {
    color: var(--link-color);
}

.blog-footer-social-link + .blog-footer-social-link::before {
    content: "\2022";
    color: var(--divider);
    position: absolute;
    left: -17px;
    top: 50%;
    transform: translateY(-52%);
    pointer-events: none;
}

@keyframes footerSquiggle {
    from {
        -webkit-mask-position: 0 0;
        mask-position: 0 0;
    }
    to {
        -webkit-mask-position: 100px 0;
        mask-position: 100px 0;
    }
}

@media (max-width: 760px) {
    .site-head {
        width: calc(100vw - (var(--edge) * 2));
        margin: 0 auto;
        padding: 14px 0 10px;
        gap: 0;
    }

    .brand-wrap {
        width: 0;
        gap: 0;
    }

    .logo-wrapper {
        width: 36px;
        height: 36px;
    }

    .home-link {
        font-size: 13px;
    }

    .home-link svg {
        width: 14px;
        height: 14px;
    }

    .article-shell {
        border-radius: 0;
    }

    .blog-main {
        width: calc(100vw - (var(--edge) * 2));
        margin: 0 auto;
    }

    .page {
        margin: 0;
    }

    .page-title {
        font-size: clamp(24px, 7vw, 34px);
    }

    .blog-footer {
        width: calc(100vw - (var(--edge) * 2));
        /* margin-left: var(--edge); */
        padding-bottom: 28px;
    }

    .blog-footer-socials {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .blog-footer-social-link + .blog-footer-social-link::before {
        content: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    body {
        transition: none;
        filter: none;
    }
}