/* Dusk theme: tokens + overrides for hardcoded light colors in blog/site-content */

html[data-site-theme="dusk"] {
    color-scheme: dark;
    --site-bg: #0a0e14;
    --site-bg-accent: #121a26;
    --site-surface: #1a2332;
    --site-surface-solid: #1a2332;
    --site-surface-muted: #141c28;
    --site-border: rgba(148, 163, 184, 0.22);
    --site-border-strong: rgba(148, 163, 184, 0.38);
    --site-text: #f1f5f9;
    --site-text-muted: #b6c2d1;
    --site-text-faint: #8b9cb0;
    --site-accent: #7cb8ff;
    --site-accent-soft: rgba(124, 184, 255, 0.14);
    --site-accent-strong: rgba(124, 184, 255, 0.28);
    --site-shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 2px 8px rgba(0, 0, 0, 0.35);
    --site-shadow-md: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 12px 32px rgba(0, 0, 0, 0.45);
    --site-shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 20px 48px rgba(0, 0, 0, 0.55);
    --site-nav-text: #cbd5e1;
    --site-nav-primary: #7cb8ff;
    --site-nav-primary-hover: #93c5fd;
}

html[data-site-theme="dusk"] body.has-site-header {
    color: var(--site-text);
    background-color: var(--site-bg);
    background-image:
        radial-gradient(ellipse 85% 55% at 50% -15%, rgba(96, 165, 250, 0.12), transparent 55%),
        radial-gradient(ellipse 55% 45% at 100% 0%, rgba(167, 139, 250, 0.08), transparent 50%),
        radial-gradient(ellipse 45% 35% at 0% 100%, rgba(56, 189, 248, 0.06), transparent 50%);
}

/* Header & footer glass */
html[data-site-theme="dusk"] .site-header--solid,
html[data-site-theme="dusk"] .site-header.is-scrolled,
html[data-site-theme="dusk"] .site-header--portal {
    background: rgba(10, 14, 20, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    border-bottom: 1px solid var(--site-border);
}

html[data-site-theme="dusk"] .site-nav-link,
html[data-site-theme="dusk"] .site-nav-brand-text,
html[data-site-theme="dusk"] .site-nav-toggle {
    color: var(--site-nav-text);
}

html[data-site-theme="dusk"] .site-nav-link:hover,
html[data-site-theme="dusk"] .site-nav-link.active {
    color: var(--site-nav-primary);
}

html[data-site-theme="dusk"] .site-nav-mobile {
    background: rgba(10, 14, 20, 0.96);
    border-top: 1px solid var(--site-border);
}

html[data-site-theme="dusk"] .site-footer {
    background: rgba(10, 14, 20, 0.82) !important;
    border-top-color: var(--site-border) !important;
    color: var(--site-text-muted);
}

/* Elevated panels: solid fill, no muddy blur */
html[data-site-theme="dusk"] .blog-widget,
html[data-site-theme="dusk"] .post-row,
html[data-site-theme="dusk"] .blog-article,
html[data-site-theme="dusk"] .article-toc-card,
html[data-site-theme="dusk"] .post-card,
html[data-site-theme="dusk"] .search-moment-item,
html[data-site-theme="dusk"] body.has-site-header main .card,
html[data-site-theme="dusk"] .site-panel {
    background: var(--site-surface-solid);
    border-color: var(--site-border-strong);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: var(--site-shadow-sm);
}

html[data-site-theme="dusk"] .post-row:hover,
html[data-site-theme="dusk"] .blog-widget:hover {
    border-color: rgba(124, 184, 255, 0.35);
    box-shadow: var(--site-shadow-md);
}

html[data-site-theme="dusk"] .post-row:hover {
    transform: translateY(-2px);
}

/* Widget typography & dividers */
html[data-site-theme="dusk"] .blog-widget-title {
    color: var(--site-text);
    border-bottom-color: var(--site-border);
}

html[data-site-theme="dusk"] .blog-widget-title i {
    color: var(--site-accent);
}

html[data-site-theme="dusk"] .blog-widget-empty {
    color: var(--site-text-faint);
}

html[data-site-theme="dusk"] .blog-page-subtitle,
html[data-site-theme="dusk"] .posts-page-subtitle {
    color: var(--site-text-muted);
}

/* Chips & sidebar nav */
html[data-site-theme="dusk"] .blog-hot-chip {
    background: var(--site-surface-muted);
    color: var(--site-text-muted);
    border: 1px solid var(--site-border);
}

html[data-site-theme="dusk"] .blog-hot-chip:hover {
    background: var(--site-accent-soft);
    color: var(--site-accent);
    border-color: rgba(124, 184, 255, 0.35);
}

html[data-site-theme="dusk"] .blog-hot-chip.is-active {
    background: var(--site-accent-strong);
    color: #e0f2fe;
    border-color: rgba(124, 184, 255, 0.45);
}

html[data-site-theme="dusk"] .blog-hot-chip.is-pinned {
    background: rgba(251, 146, 60, 0.15);
    color: #fdba74;
    border-color: rgba(251, 146, 60, 0.35);
}

html[data-site-theme="dusk"] .blog-hot-chip.is-pinned:hover {
    background: rgba(251, 146, 60, 0.22);
    color: #fed7aa;
}

html[data-site-theme="dusk"] .blog-cat-item {
    color: var(--site-text-muted);
}

html[data-site-theme="dusk"] .blog-cat-item:hover {
    background: var(--site-accent-soft);
    color: var(--site-accent);
}

html[data-site-theme="dusk"] .blog-cat-item.active {
    background: var(--site-accent-strong);
    color: #e0f2fe;
}

html[data-site-theme="dusk"] .blog-cat-count {
    background: rgba(15, 23, 42, 0.55);
    color: var(--site-text-faint);
    border: 1px solid var(--site-border);
}

html[data-site-theme="dusk"] .blog-cat-item.active .blog-cat-count {
    background: rgba(15, 23, 42, 0.65);
    color: var(--site-accent);
}

/* Rank list */
html[data-site-theme="dusk"] .blog-rank-list li {
    border-bottom-color: var(--site-border);
}

html[data-site-theme="dusk"] .blog-rank-list a {
    color: var(--site-text);
}

html[data-site-theme="dusk"] .blog-rank-list a:hover {
    color: var(--site-accent);
}

html[data-site-theme="dusk"] .blog-rank-index {
    color: var(--site-text-faint);
}

html[data-site-theme="dusk"] .blog-rank-meta {
    color: var(--site-text-faint);
}

html[data-site-theme="dusk"] .blog-cloud-word {
    opacity: 0.92;
}

/* Pulse & random */
html[data-site-theme="dusk"] .blog-pulse-item {
    background: var(--site-surface-muted);
    border: 1px solid var(--site-border);
}

html[data-site-theme="dusk"] .blog-random-post {
    border-color: var(--site-border-strong);
    background: rgba(15, 23, 42, 0.35);
}

/* Post list */
html[data-site-theme="dusk"] .post-row-thumb {
    background: var(--site-surface-muted);
}

html[data-site-theme="dusk"] .post-row-title a {
    color: var(--site-text);
}

html[data-site-theme="dusk"] .post-row-title a:hover {
    color: var(--site-accent);
}

html[data-site-theme="dusk"] .post-row-meta {
    color: var(--site-text-faint);
}

html[data-site-theme="dusk"] .post-row-meta a {
    color: var(--site-accent);
}

html[data-site-theme="dusk"] .post-row-excerpt {
    color: var(--site-text-muted);
}

html[data-site-theme="dusk"] .post-row-tags a {
    color: var(--site-text-faint);
}

html[data-site-theme="dusk"] .post-row-tags a:hover {
    color: var(--site-accent);
}

html[data-site-theme="dusk"] .post-card-title a {
    color: var(--site-text);
}

html[data-site-theme="dusk"] .post-card-meta,
html[data-site-theme="dusk"] .post-card-excerpt {
    color: var(--site-text-muted);
}

/* Search UI */
html[data-site-theme="dusk"] .blog-google-search {
    border-color: var(--site-border-strong);
    box-shadow: var(--site-shadow-sm);
}

html[data-site-theme="dusk"] .blog-google-search input {
    color: var(--site-text);
}

html[data-site-theme="dusk"] .blog-google-search input::placeholder {
    color: var(--site-text-faint);
}

html[data-site-theme="dusk"] .blog-google-search-icon {
    color: var(--site-text-faint);
}

html[data-site-theme="dusk"] .blog-google-search-clear {
    color: var(--site-text-faint);
}

html[data-site-theme="dusk"] .blog-google-search-clear:hover {
    background: var(--site-accent-soft);
    color: var(--site-text);
}

html[data-site-theme="dusk"] .blog-search-trending-label {
    color: var(--site-text-faint);
}

html[data-site-theme="dusk"] .search-tabs {
    border-bottom-color: var(--site-border);
}

html[data-site-theme="dusk"] .search-tab {
    background: var(--site-surface-muted);
    color: var(--site-text-muted);
    border: 1px solid transparent;
}

html[data-site-theme="dusk"] .search-tab:hover {
    background: var(--site-accent-soft);
    color: var(--site-accent);
}

html[data-site-theme="dusk"] .search-tab.active {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    border-color: transparent;
}

html[data-site-theme="dusk"] .search-moment-meta {
    color: var(--site-text-faint);
}

html[data-site-theme="dusk"] .search-moment-content {
    color: var(--site-text);
}

html[data-site-theme="dusk"] .moment-item-card {
    background: var(--site-surface-solid);
    border: 1px solid var(--site-border-strong);
}

html[data-site-theme="dusk"] .moment-content {
    color: var(--site-text);
}

html[data-site-theme="dusk"] .moment-item-date {
    color: var(--site-text);
}

html[data-site-theme="dusk"] .moment-gallery-link {
    background: var(--site-surface-muted);
}

/* TOC & article */
html[data-site-theme="dusk"] .article-toc-title {
    color: var(--site-text);
    border-bottom-color: var(--site-border);
}

html[data-site-theme="dusk"] .article-toc-link {
    color: var(--site-text-muted);
}

html[data-site-theme="dusk"] .article-toc-link:hover {
    background: var(--site-accent-soft);
    color: var(--site-accent);
}

html[data-site-theme="dusk"] .article-toc-link.is-active {
    background: var(--site-accent-strong);
    color: #e0f2fe;
}

html[data-site-theme="dusk"] .article-toc-link--h4 {
    color: var(--site-text-faint);
}

html[data-site-theme="dusk"] .article-content pre,
html[data-site-theme="dusk"] .article-content code {
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid var(--site-border);
}

html[data-site-theme="dusk"] .article-content pre code {
    border: 0;
    background: transparent;
}

html[data-site-theme="dusk"] body.has-site-header .breadcrumb-item,
html[data-site-theme="dusk"] body.has-site-header .breadcrumb-item a {
    color: var(--site-text-faint);
}

html[data-site-theme="dusk"] body.has-site-header .breadcrumb-item.active {
    color: var(--site-text-muted);
}

html[data-site-theme="dusk"] body.has-site-header .text-muted {
    color: var(--site-text-muted) !important;
}

/* Footer friend links */
html[data-site-theme="dusk"] .footer-links-title,
html[data-site-theme="dusk"] .site-footer .footer-links-title {
    color: var(--site-text-faint);
}

html[data-site-theme="dusk"] .footer-link-item,
html[data-site-theme="dusk"] .site-footer .footer-link-item {
    background: var(--site-surface-muted);
    border-color: var(--site-border-strong);
    color: var(--site-text-muted);
}

html[data-site-theme="dusk"] .footer-link-item:hover,
html[data-site-theme="dusk"] .site-footer .footer-link-item:hover {
    color: var(--site-accent);
    border-color: rgba(124, 184, 255, 0.45);
    background: var(--site-accent-soft);
    box-shadow: none;
}

html[data-site-theme="dusk"] .timeline-list li:hover {
    background: var(--site-accent-soft);
}

html[data-site-theme="dusk"] body.has-site-header main .form-control,
html[data-site-theme="dusk"] body.has-site-header main .form-select {
    background-color: var(--site-surface-muted);
    border-color: var(--site-border-strong);
    color: var(--site-text);
}

html[data-site-theme="dusk"] body.has-site-header main .form-control:focus {
    border-color: rgba(124, 184, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(124, 184, 255, 0.18);
}

html[data-site-theme="dusk"] .site-read-progress span {
    box-shadow: 0 0 14px rgba(124, 184, 255, 0.55);
}

html[data-site-theme="dusk"] body.has-site-header .bg-light {
    background-color: var(--site-surface-muted) !important;
    color: var(--site-text);
    border-color: var(--site-border);
}

html[data-site-theme="dusk"] body.has-site-header .text-dark {
    color: var(--site-text) !important;
}

html[data-site-theme="dusk"] body.has-site-header .border,
html[data-site-theme="dusk"] body.has-site-header .border-top,
html[data-site-theme="dusk"] body.has-site-header .border-bottom {
    border-color: var(--site-border) !important;
}
