/* Light theme overrides. Dark remains the default (no class). */

html.light body,
body.light {
    background: #f4f4f5;
    color: #1a1a1a;
}

html.light,
body.light {
    color-scheme: light;

    canvas#particles {
        opacity: 0.35;
        filter: invert(1) hue-rotate(180deg);
    }

    header {
        background: rgba(255, 255, 255, 0.92);
        border-bottom-color: #e4e4e7;
    }

    .logo-text {
        background: linear-gradient(135deg, #111111, #525252);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }

    .nav-btn {
        background: #111111;
        color: #ffffff;
    }

    .nav-btn:hover {
        background: #333333;
    }

    .nav-btn-secondary {
        background: transparent;
        border-color: #a1a1aa;
        color: #18181b;
    }

    .nav-btn-secondary:hover {
        background: rgba(0, 0, 0, 0.06);
        color: #111111;
    }

    .theme-toggle-btn .theme-icon-moon {
        display: none;
    }

    .theme-toggle-btn .theme-icon-sun {
        display: block;
    }

    h1 {
        background: linear-gradient(to right, #111111, #525252);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }

    h2 {
        border-left-color: #18181b;
        color: #18181b;
    }

    .btn-primary,
    a.btn-primary {
        background: linear-gradient(to right, #18181b, #3f3f46);
        color: #ffffff;
    }

    .btn-secondary,
    a.btn-secondary {
        border-color: #18181b;
        color: #18181b;
    }

    .btn-secondary:hover,
    a.btn-secondary:hover {
        border-color: #111111;
        background: rgba(0, 0, 0, 0.04);
    }

    .feature-card,
    .card,
    .highlight-preview,
    .code-card,
    .tool-card {
        background: #ffffff;
        border-color: #e4e4e7;
        color: #1a1a1a;
    }

    .feature-card h3,
    .card h3,
    .tool-card h3 {
        color: #111111;
    }

    .feature-card p,
    .card p,
    .muted,
    .subtitle,
    .buy-hero-sub,
    .buy-section-intro {
        color: #52525b;
    }

    .highlight-code,
    .highlight-code pre {
        background: #f4f4f5;
        border-color: #d4d4d8;
        color: #18181b;
    }

    .highlight-code {
        border-left-color: #18181b;
    }

    input,
    textarea,
    select {
        background: #f9f9f9;
        border-color: #d4d4d8;
        color: #18181b;
    }

    input:focus,
    textarea:focus,
    select:focus {
        border-color: #18181b;
    }

    .lang-switch button {
        background: #ffffff;
        border-color: #d4d4d8;
        color: #52525b;
    }

    .lang-switch button.active {
        background: #18181b;
        color: #ffffff;
        border-color: #18181b;
    }

    footer,
    .site-footer {
        background: #ffffff;
        border-top-color: #e4e4e7;
        color: #3f3f46;
    }

    .cookie-consent {
        background: rgba(255, 255, 255, 0.97);
        border-top-color: #d4d4d8;
    }

    .cookie-consent p {
        color: #3f3f46;
    }

    .cookie-consent-btn {
        background: #18181b;
        color: #ffffff;
    }

    .cookie-consent-btn:hover {
        background: #3f3f46;
    }

    .site-nav-overlay {
        background: rgba(15, 15, 15, 0.35);
    }

    .site-nav-drawer {
        background: #ffffff;
        border-right-color: #e4e4e7;
    }

    .site-nav-link {
        color: #3f3f46;
    }

    .site-nav-link:hover {
        background: rgba(0, 0, 0, 0.05);
        color: #111111;
    }

    .site-nav-link.active {
        background: rgba(0, 0, 0, 0.08);
        color: #111111;
    }

    .site-nav-label {
        color: #111111;
    }

    .site-nav-legal {
        border-top-color: #e4e4e7;
    }

    .site-nav-legal-name,
    .site-nav-legal-inn {
        color: #71717a;
    }

    /* Common page cards / panels */
    .buy-service-card,
    .lib-card,
    .research-card,
    .support-card,
    .calendar-card,
    .auth-card,
    .pg-auth-panel,
    .modal,
    .dialog {
        background: #ffffff;
        border-color: #e4e4e7;
        color: #1a1a1a;
    }

    .buy-service-card h3,
    .lib-card h3,
    .research-card h3 {
        color: #111111;
    }

    table,
    .table {
        color: #1a1a1a;
    }

    th,
    td {
        border-color: #e4e4e7;
    }

    .tag,
    .badge {
        background: #f4f4f5;
        border-color: #d4d4d8;
        color: #3f3f46;
    }

    h3 {
        color: #27272a;
    }

    .main-text {
        color: #3f3f46;
    }

    .btn,
    a.btn,
    .btn-primary,
    a.btn-primary {
        border: 0px;
        background: linear-gradient(to right, #e9e9e9, #dbdbdb);
        color: #313131;
    }

    .feature-card:hover,
    .community-card:hover {
        border-color: #18181b;
    }

    .card-link {
        color: #18181b;
    }

    .card-badge {
        background: #f4f4f5;
        color: #52525b;
        border-color: #d4d4d8;
    }

    .highlight-code pre {
        background: #e6e6e6;
        border-left-color: #18181b;
        color: #18181b;
    }

    pre code .hl-com {
        color: #71717a;
    }

    .preview-placeholder {
        color: #71717a;
    }

    .checklist li::before {
        color: #18181b;
    }

    .roadmap-list {
        background: #ffffff;
        border-color: #e4e4e7;
    }

    .roadmap-item {
        border-bottom-color: #e4e4e7;
    }

    .roadmap-status.done {
        color: #18181b;
    }

    .roadmap-status.pending {
        color: #71717a;
    }

    .community-card {
        background: #ffffff;
        border-color: #e4e4e7;
        color: #1a1a1a;
    }

    .community-card span:last-child {
        color: #71717a;
    }

    footer a {
        color: #18181b;
    }

    .copyright {
        color: #71717a;
    }

    .lang-switch {
        background: #ffffff;
        border-color: #18181b;
    }

    .lang-switch button:hover {
        background: #e4e4e7;
        color: #18181b;
    }

    .faq-item {
        background: rgba(0, 0, 0, 0.03);
    }

    .faq-item:hover {
        background: rgba(0, 0, 0, 0.06);
    }

    .faq-question {
        color: #18181b;
    }

    .faq-answer {
        color: rgba(24, 24, 27, 0.8);
    }

    .pg-auth-tabs {
        background: #f4f4f5;
        border-color: #e4e4e7;
    }

    .pg-auth-tab {
        color: #71717a;
    }

    .pg-auth-tab.active {
        background: #18181b;
        color: #ffffff;
    }

    .pg-auth-sub,
    .pg-field label {
        color: #71717a;
    }

    .pg-field input {
        background: #ffffff;
        border-color: #d4d4d8;
        color: #18181b;
    }

    .pg-field input:focus {
        border-color: #18181b;
    }

    .pg-auth-submit {
        background: linear-gradient(90deg, #18181b, #3f3f46);
        color: #ffffff;
    }

    .pg-auth-submit:hover:not(:disabled) {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    }

    .site-nav-link.active .site-nav-icon {
        color: #000000;
    }
    .site-nav-icon {
        color: #000000;
    }
    .logo-img {
        filter: brightness(0%);
    }
}

/* Default (dark): show moon */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    cursor: pointer;
}

.theme-toggle-btn .theme-icon {
    display: none;
}

.theme-toggle-btn .theme-icon-moon {
    display: block;
}

html.light .theme-toggle-btn .theme-icon-moon,
body.light .theme-toggle-btn .theme-icon-moon {
    display: none;
}

html.light .theme-toggle-btn .theme-icon-sun,
body.light .theme-toggle-btn .theme-icon-sun {
    display: block;
}

@media (max-width: 500px) {
    .theme-toggle-btn {
        width: 8.4vw;
        height: 8.4vw;
    }
    
}