/* Shared design tokens; dark is the deliberate first-visit default. */
:root {
    color-scheme: dark;
    --canvas: #111413;
    --surface: #191d1b;
    --surface-hover: #202622;
    --ink: #eeeee8;
    --muted: #a4ada6;
    --line: #333c35;
    --accent: #c0d2ae;
    --accent-ink: #1c2818;
    --code: #151a17;
    --selection: #40503b;
}
:root[data-theme="light"] {
    color-scheme: light;
    --canvas: #f5f4ef;
    --surface: #fdfcf8;
    --surface-hover: #eeeee5;
    --ink: #202720;
    --muted: #606b62;
    --line: #d4d9cd;
    --accent: #48613c;
    --accent-ink: #ffffff;
    --code: #e9ede4;
    --selection: #d7e2cb;
}
:where(.site-shell [class*="tw-border"]) { border-width: 0; border-style: solid; }
html { font-size: 16px; scroll-behavior: smooth; scroll-padding-top: 150px; }
.site-shell { background: var(--canvas); color: var(--ink); font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
.site-shell, .site-shell * { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
.site-shell .fa { font-family: FontAwesome; }
.site-shell .octicon, .site-shell .mega-octicon { font-family: octicons; }
.site-shell * { box-sizing: border-box; }
.site-shell ::selection { background: var(--selection); color: var(--ink); }
.site-shell a { color: var(--ink); text-decoration: none; transition: color .18s ease; }
.site-shell a:hover { color: var(--accent); }
.site-shell :focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.site-shell .content { min-height: 55vh; }
.site-wrap, .site-shell .container { width: calc(100% - 80px); max-width: 1160px; margin-left: auto; margin-right: auto; }
.site-shell .container { padding-left: 0; padding-right: 0; }
.site-shell .tw-text-muted { color: var(--muted); }
.site-shell .tw-text-accent { color: var(--accent); }
.site-shell h1, .site-shell h2, .site-shell h3 { color: var(--ink); overflow-wrap: anywhere; }
.site-shell .eyebrow { margin-bottom: 0; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .18em; line-height: 1.8; }
.editorial-header { position: sticky; top: 0; z-index: 100; background: var(--canvas); }
.wordmark { display: inline-flex; align-items: center; font-size: 32px; font-weight: 600; letter-spacing: -.07em; line-height: 1; }
.wordmark-name { margin-left: 12px; font-size: 10px; font-weight: 600; letter-spacing: .16em; }
.editorial-nav { min-width: 0; scrollbar-width: thin; }
.editorial-nav a { flex-shrink: 0; padding: 7px 0; color: var(--muted); font-size: 12px; white-space: nowrap; }
.editorial-nav a[aria-current="page"] { color: var(--ink); box-shadow: 0 1px 0 var(--accent); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink); line-height: 1.5; min-height: 40px; cursor: pointer; }
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { border-color: var(--accent); }
.theme-moon, [data-theme="light"] .theme-sun { display: none; }
[data-theme="light"] .theme-moon { display: block; }
.skip-link { position: fixed; left: 20px; top: -100px; z-index: 200; padding: 10px 18px; background: var(--surface); border: 1px solid var(--accent); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.hero-title { font-size: clamp(30px, 4.2vw, 56px); font-weight: 500; line-height: 1.45; letter-spacing: -.055em; }
.hero-description { font-size: 15px; line-height: 2; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.stat-number { font-family: Georgia, "Times New Roman", serif; font-size: 42px; line-height: 1; font-weight: 400; font-variant-numeric: tabular-nums; }
.site-shell .button-primary, .site-shell .button-secondary { display: inline-flex; gap: 32px; align-items: center; justify-content: space-between; padding: 13px 22px; border-radius: 6px; font-size: 13px; }
.site-shell .button-primary { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); }
.site-shell .button-primary:hover { filter: brightness(1.08); }
.site-shell .button-secondary { border: 1px solid var(--line); }
.site-shell .button-secondary:hover { border-color: var(--accent); }
.section-count { vertical-align: super; margin-left: 12px; font-size: 12px; color: var(--muted); font-weight: 400; }
.site-shell .text-link { color: var(--accent); font-size: 13px; }
.site-shell .source-link { color: var(--muted); }
.project-card { transition: border-color .2s ease, transform .2s ease, background-color .2s ease; }
.project-card:hover { transform: translateY(-3px); border-color: var(--accent); background: var(--surface-hover); }
.project-number { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; }
.project-tag { padding: 3px 9px; border: 1px solid var(--line); border-radius: 4px; font-size: 10px; line-height: 1.5; color: var(--muted); }
.journal-list { margin: 0; }
.journal-row a:hover h3 { color: var(--accent); }
.page-heading h1 { max-width: 920px; letter-spacing: -.035em; }
.site-shell .post { padding-top: 48px; padding-bottom: 80px; overflow-wrap: anywhere; }
.site-shell .post .col-md-8 { padding-right: 40px; }
.site-shell .post .col-md-12.markdown-body { max-width: 820px; margin: 0 auto; float: none; }
.site-shell .markdown-body { color: var(--ink); font-size: 16px; line-height: 1.95; }
.site-shell .markdown-body p { margin: 0 0 1.5em; }
.site-shell .markdown-body h1, .site-shell .markdown-body h2, .site-shell .markdown-body h3 { color: var(--ink); font-weight: 500; line-height: 1.5; margin-top: 2em; border-color: var(--line); }
.site-shell .markdown-body h2 { font-size: 26px; padding-bottom: 12px; }
.site-shell .markdown-body h3 { font-size: 21px; }
.site-shell .markdown-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.site-shell .markdown-body blockquote { color: var(--muted); border-left: 2px solid var(--accent); padding: 8px 24px; background: var(--surface); }
.site-shell .markdown-body hr { height: 1px; background: var(--line); border: 0; }
.site-shell .markdown-body img { max-width: 100%; border-radius: 6px; background: transparent; }
.site-shell pre, .site-shell code, .site-shell kbd, .site-shell samp, .site-shell code *, .site-shell pre * { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.site-shell pre, .site-shell .content .row pre, .site-shell .highlight, .site-shell .markdown-body pre { background: var(--code); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; background-image: none; font-size: 13px; line-height: 1.8; }
.site-shell pre, .site-shell .content .row .highlight > pre, .site-shell .highlight > pre { padding: 18px 20px; }
.site-shell .highlight { border: 0; }
.site-shell code, .site-shell .markdown-body code { color: var(--accent); background: var(--code); border-radius: 4px; }
.site-shell pre code, .site-shell .markdown-body pre code { color: inherit; padding: 0; background: transparent; }
.site-shell table { max-width: 100%; }
.site-shell table tr, .site-shell .markdown-body table tr { background: var(--surface); border-color: var(--line); }
.site-shell table tr:nth-child(2n), .site-shell .markdown-body table tr:nth-child(2n) { background: var(--canvas); }
.site-shell table th, .site-shell table td, .site-shell .markdown-body table th, .site-shell .markdown-body table td { border-color: var(--line); }
.site-shell table { display: block; overflow-x: auto; }
.site-shell pre table, .site-shell pre table tr, .site-shell pre table td, .site-shell code table, .site-shell code table tr, .site-shell code table td, .site-shell td.code pre, .site-shell td.gutter pre { background: var(--code); border: 0; padding: 0; color: var(--ink); }
.site-shell .content .row code table { width: auto; }
.site-shell .highlight .lineno { color: var(--muted); }
.site-shell .highlight .k, .site-shell .highlight .kc, .site-shell .highlight .kd, .site-shell .highlight .kn, .site-shell .highlight .kp, .site-shell .highlight .kr, .site-shell .highlight .kv, .site-shell .highlight .o, .site-shell .highlight .ow, .site-shell .highlight .ge, .site-shell .highlight .nn { color: var(--ink); }
:root[data-theme="dark"] .highlight .s, :root[data-theme="dark"] .highlight .s1, :root[data-theme="dark"] .highlight .s2, :root[data-theme="dark"] .highlight .sb, :root[data-theme="dark"] .highlight .sc, :root[data-theme="dark"] .highlight .sd, :root[data-theme="dark"] .highlight .se, :root[data-theme="dark"] .highlight .sh, :root[data-theme="dark"] .highlight .si, :root[data-theme="dark"] .highlight .sx, :root[data-theme="dark"] .highlight .ss, :root[data-theme="dark"] .highlight .sr { color: #c0d2ae; }
:root[data-theme="dark"] .highlight .nt, :root[data-theme="dark"] .highlight .nc, :root[data-theme="dark"] .highlight .kt, :root[data-theme="dark"] .highlight .nf, :root[data-theme="dark"] .highlight .ne, :root[data-theme="dark"] .highlight .nl, :root[data-theme="dark"] .highlight .nd, :root[data-theme="dark"] .highlight .ni { color: #e6c5a2; }
:root[data-theme="dark"] .highlight .na, :root[data-theme="dark"] .highlight .nb, :root[data-theme="dark"] .highlight .no, :root[data-theme="dark"] .highlight .nv, :root[data-theme="dark"] .highlight .vc, :root[data-theme="dark"] .highlight .vg, :root[data-theme="dark"] .highlight .vi, :root[data-theme="dark"] .highlight .m, :root[data-theme="dark"] .highlight .mi, :root[data-theme="dark"] .highlight .mf { color: #9bc6ce; }
.site-shell #posts-list.archive-list { margin: 0; padding: 0; border: 0; }
.site-shell #posts-list.archive-list li { margin: 0; }
.site-shell .sidebar-title { text-align: left; color: var(--muted); font-size: 14px; }
.site-shell .list-group-item, .site-shell .panel, .site-shell .panel-heading, .site-shell .panel-footer, .site-shell .btn-default { color: var(--ink); background: var(--surface); border-color: var(--line); }
.site-shell .list-group-item.active, .site-shell .list-group-item:hover { background: var(--surface-hover); color: var(--accent); border-color: var(--line); }
.site-shell .badge { background: var(--line); color: var(--ink); }
.site-shell .post-directory { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: none; padding: 14px 0; }
.site-shell .post-directory dt, .site-shell .post-directory dd { border-left: 2px solid transparent; padding: 5px 16px; font-weight: 400; font-size: 12px; }
.site-shell .post-directory dt:hover, .site-shell .post-directory dd:hover { background: var(--surface-hover); border-left-color: var(--accent); }
.site-shell .post-directory dt:hover a, .site-shell .post-directory dd:hover a { color: var(--accent); font-weight: 400; }
.site-shell .box-note, .site-shell .box-warning, .site-shell .box-error, .site-shell .box-success { background: var(--surface); color: var(--ink); border-top-color: var(--line); border-right-color: var(--line); border-bottom-color: var(--line); }
.site-shell .pagination .btn, .site-shell .pager li > a { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.site-shell .pagination .active, .site-shell .pagination .btn:hover, .site-shell .pager li > a:hover { background: var(--surface-hover); color: var(--accent); }
.site-shell .pagination .btn[disabled] { opacity: .45; }
.site-shell footer.editorial-footer { background: var(--canvas); color: var(--ink); padding: 0; border-color: var(--line); }
.site-shell .editorial-footer .tw-text-muted { color: var(--muted); }
.site-shell .error { position: static; transform: none; min-width: 0; padding: 120px 24px; }
.site-shell .error-emoji, .site-shell .error-text { color: var(--muted); }
@media (max-width: 991px) {
    .site-shell .post .col-md-8 { padding-right: 15px; }
    .site-shell #post-directory-module { position: static !important; width: 100% !important; }
    .site-shell .post .col-md-4 { margin-top: 40px; }
}
@media (max-width: 767px) {
    .site-wrap, .site-shell .container { width: calc(100% - 40px); }
    .editorial-nav { gap: 22px; padding-bottom: 4px; }
    .hero-title { font-size: clamp(26px, 6.8vw, 42px); }
    .hero-aside { max-width: 360px; }
    .page-heading h1 { font-size: 32px; }
    .site-shell .post { padding-top: 32px; padding-bottom: 48px; }
    .site-shell .markdown-body { font-size: 15px; }
    .site-shell .markdown-body h2 { font-size: 23px; }
    .wordmark-name { font-size: 9px; }
    .site-shell .pagination .btn-group { display: flex; flex-wrap: wrap; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .site-shell *, .site-shell *::before, .site-shell *::after { transition: none !important; animation: none !important; }
    .project-card:hover { transform: none; }
}
