:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] {
    color-scheme: light;
    --sd-bg: #f5faf7;
    --sd-surface: #fff;
    --sd-ink: #102e25;
    --sd-muted: #456158;
    --sd-line: #c6ddd2;
    --sd-accent: #087354;
    --sd-theme-tint: #e7f4ed;
    --sd-theme-hover: #065741;
}

body.sd-site .sd-theme-toggle {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    height: 44px;
    padding: 0;
    color: var(--sd-ink);
    background: var(--sd-surface);
    border: 1px solid var(--sd-line);
    border-radius: 50%;
}
body.sd-site .sd-theme-toggle:hover { color: var(--sd-accent); border-color: currentColor; }
[data-theme="dark"] .sd-theme-moon, [data-theme="light"] .sd-theme-sun { display: none; }

@media (prefers-reduced-motion: no-preference) {
    :root.sd-theme-revealing::view-transition-old(root),
    :root.sd-theme-revealing::view-transition-new(root) { mix-blend-mode: normal; }

    :root.sd-theme-revealing::view-transition-old(root) { animation: none; }
    :root.sd-theme-revealing::view-transition-new(root) {
        animation: sd-theme-reveal 480ms cubic-bezier(.22, .7, .3, 1) both;
    }

    @keyframes sd-theme-reveal {
        from { clip-path: circle(0 at var(--sd-theme-reveal-x) var(--sd-theme-reveal-y)); }
        to { clip-path: circle(150% at var(--sd-theme-reveal-x) var(--sd-theme-reveal-y)); }
    }
}

@media (max-width: 1023px) {
    body.sd-site .sd-header-actions { gap: 8px; }
}
@media (max-width: 430px) {
    body.sd-site .sd-header-actions .header-quote { display: none; }
}
@media (min-width: 1024px) and (max-width: 1280px) {
    body.sd-site .header-inner { gap: 15px; }
    body.sd-site .sd-header .main-nav { gap: 12px; }
    body.sd-site .sd-header-actions { gap: 8px; }
    body.sd-site .header-inner > .sd-brand img { width: 175px; }
}

/* Shared surfaces and controls. */
[data-theme="light"] body.sd-site .site-header.sd-header { background: var(--sd-bg); border-color: var(--sd-line); }
[data-theme="light"] body.sd-site .button { background: var(--sd-accent); border-color: var(--sd-accent); color: #fff; }
[data-theme="light"] body.sd-site .button:hover { background: var(--sd-theme-hover); border-color: var(--sd-theme-hover); }
[data-theme="light"] body.sd-site .button-outline { color: var(--sd-accent); background: transparent; border-color: var(--sd-line); }
[data-theme="light"] body.sd-site .button-outline:hover,
[data-theme="light"] body.sd-site .sd-small-link:hover { color: var(--sd-accent); background: var(--sd-theme-tint); border-color: var(--sd-accent); }
[data-theme="light"] body.sd-site .skip-link { color: #fff !important; }
[data-theme="light"] .sd-search-toggle,
[data-theme="light"] body.sd-site .menu-toggle { color: var(--sd-ink); }
[data-theme="light"] body.sd-site .menu-toggle span { background: currentColor; }
[data-theme="light"] :is(.services-dropdown, .sd-drawer-close) { background: var(--sd-surface); color: var(--sd-ink); border-color: var(--sd-line); }
[data-theme="light"] :is(.services-dropdown a:hover, .sd-drawer-close:hover) { background: var(--sd-theme-tint); }
[data-theme="light"] .sd-home { background: radial-gradient(ellipse at 90% 0%, #e3f2e9, transparent 680px); }
[data-theme="light"] .sd-card { background: var(--sd-surface); border-color: var(--sd-line); }
[data-theme="light"] body.sd-site .sd-small-link { border-color: var(--sd-line); }
[data-theme="light"] body.sd-site .sd-brand img { mix-blend-mode: multiply; filter: invert(1) hue-rotate(180deg); }

/* Home content. Media previews keep their own artwork colors. */
[data-theme="light"] .sd-hero-badge { background: var(--sd-theme-tint); border-color: var(--sd-line); }
[data-theme="light"] :is(.sd-hero-description, .sd-service-card > p, .sd-section-intro > p:not(.sd-eyebrow), .sd-about-copy > p:not(.sd-eyebrow), .sd-team-role, .sd-team-empty) { color: var(--sd-muted); }
[data-theme="light"] .sd-hero-stats strong { color: var(--sd-ink); }
[data-theme="light"] .sd-floating-tech > div { background: var(--sd-surface); border-color: var(--sd-line); }
[data-theme="light"] .sd-team { background: transparent; }
[data-theme="light"] body.sd-site .sd-team-socials a { color: var(--sd-accent) !important; }
[data-theme="light"] .sd-project-filters button { background: var(--sd-surface); color: var(--sd-ink); border-color: var(--sd-line); }
[data-theme="light"] .sd-project-filters button:is(.is-active, :hover) { background: var(--sd-accent); color: #fff; }
[data-theme="light"] .sd-theme-card { background: linear-gradient(180deg, #b4e7ce, var(--sd-bg) 98%); }
[data-theme="light"] .sd-client-stars { color: #946000; }
[data-theme="light"] .sd-popular-badge { background: var(--sd-accent); color: #fff; }
[data-theme="light"] .sd-hub-center { background: var(--sd-theme-tint); }
[data-theme="light"] .sd-tech-grid img[src$="nextdotjs.svg"],
[data-theme="light"] .sd-tech-grid img[src$="github.svg"],
[data-theme="light"] .sd-tech-grid img[src$="framer.svg"],
[data-theme="light"] .sd-floating-tech img[src$="nextdotjs.svg"] { filter: brightness(.15); }
[data-theme="light"] .sd-faq-question { color: #fff; }
[data-theme="light"] .sd-cta-dashboard-title > i { background: var(--sd-accent); }
[data-theme="light"] .sd-tracking-server { color: #fff; }
[data-theme="light"] .sd-tracking-event i { color: var(--sd-accent); }

/* Footer, dialogs and mobile navigation. */
[data-theme="light"] body.sd-site .site-footer { background: var(--sd-theme-tint); border-color: var(--sd-line); }
[data-theme="light"] body.sd-site :is(.footer-brand p, .footer-bottom) { color: var(--sd-muted); border-color: var(--sd-line); }
[data-theme="light"] :is(.sd-newsletter input, .sd-search-dialog input) { background: var(--sd-surface); color: var(--sd-ink); border-color: var(--sd-line); }
[data-theme="light"] .sd-newsletter input::placeholder { color: var(--sd-muted); }
[data-theme="light"] .sd-newsletter button { color: #fff; }
[data-theme="light"] .sd-form-error { color: #a12020; }
[data-theme="light"] :is(.sd-search-dialog, .sd-intro-dialog) { background: var(--sd-surface); color: var(--sd-ink); border-color: var(--sd-line); }
[data-theme="light"] .sd-dialog-close { color: var(--sd-ink); }
[data-theme="light"] .sd-intro-presentation > img { background: #00100d; border-radius: 8px; }
@media (max-width: 1023px) {
    [data-theme="light"] body.sd-site .sd-header .main-nav { background: var(--sd-bg); border-color: var(--sd-line); }
    [data-theme="light"] body.sd-site .sd-header .main-nav > a,
    [data-theme="light"] .sd-header :is(.nav-services, .sd-drawer-heading) { border-color: var(--sd-line); }
    [data-theme="light"] body.sd-site .sd-header .main-nav .is-current { background: var(--sd-theme-tint); color: var(--sd-accent); }
    [data-theme="light"] .sd-drawer-footer p { color: var(--sd-muted); }
    [data-theme="light"] .sd-mobile-dock::after { background: var(--sd-surface); border-color: var(--sd-line); }
    [data-theme="light"] .sd-mobile-dock::before { background: none; }
    [data-theme="light"] .sd-dock-wave path { fill: var(--sd-surface); stroke: var(--sd-line); }
    [data-theme="light"] body.sd-site .sd-dock-link { color: var(--sd-muted); }
    [data-theme="light"] body.sd-site .sd-dock-link:is(:hover, .is-active) { color: var(--sd-accent); }
    [data-theme="light"] .sd-dock-link.is-active .sd-dock-icon { background: var(--sd-accent); color: #fff; border-color: var(--sd-surface); }
}

/* Inner pages and forms. Photo banners remain high contrast in both modes. */
[data-theme="light"] .sd-inner-page :is(.page-banner, .contact-hero, .sd-hero) {
    --sd-ink: #f5faf8;
    --sd-muted: #c5dfd2;
    --sd-accent: #00e6a0;
    color: var(--sd-ink);
}
[data-theme="light"] body.sd-site.sd-inner-page :is(.page-banner, .contact-hero, .sd-hero) .button { color: #00271d; }
[data-theme="light"] body.sd-site.sd-inner-page :is(.page-banner, .contact-hero, .sd-hero) .button:hover { background: #43ffc1; border-color: #43ffc1; }
[data-theme="light"] body.sd-site .contact-hero-copy h1 span { color: #54ebbd; }
[data-theme="light"] .contact-wave path:last-child { fill: var(--sd-bg); }
[data-theme="light"] body.sd-site .contact-form-panel h2 > span { color: var(--sd-accent); }
[data-theme="light"] .sd-inner-page :is(.static-page, .contact-layout, .standalone-about, .journal-prose, .project-breadcrumb, .project-card-description, .project-card-location) { color: var(--sd-muted); }
[data-theme="light"] body.sd-site.sd-inner-page :is(.contact-information, .contact-form-panel, .contact-location, .contact-address, .ag-card, .ag-statistics, .journal-card, .journal-help, .journal-empty, .journal-toc, .showcase-card, .project-card, .sd-breadcrumb-bar, .sd-include-card, .sd-commitment, .sd-related-card, .sd-process, .sd-cta, .service-statistics, .service-review-card, .service-faq-grid details, .service-feature-tiles li, .sd-tech-page .sd-tech-grid > a) { background: var(--sd-surface); color: var(--sd-ink); border-color: var(--sd-line); }
[data-theme="light"] body.sd-site.sd-inner-page :is(.contact-information, .contact-form-panel, .contact-location-heading, .service-agro) :is(h2, h3, h4, label, strong),
[data-theme="light"] .sd-inner-page :is(.sd-section-title, .journal-prose strong, .project-breadcrumb [aria-current]) { color: var(--sd-ink); }
[data-theme="light"] body.sd-site.sd-inner-page :is(.contact-information p, .contact-information a, .contact-location-heading p, .contact-location-heading h2 > span, .ag-card-copy p, .ag-heading p, .journal-card-body > p, .journal-help p, .journal-toc > p, .sd-include-card p, .sd-process-grid p, .service-copy, .service-lead, .service-statistics span) { color: var(--sd-muted); }
[data-theme="light"] body.sd-site.sd-inner-page :is(.contact-icon, .sd-icon, .sd-step-icon, .ag-card-icon, .journal-category, .journal-author-icon) { color: var(--sd-accent) !important; background: var(--sd-theme-tint) !important; }
[data-theme="light"] body.sd-site.sd-inner-page :is(.journal-categories a, .gallery-filters .filter-button) { color: var(--sd-ink); background: var(--sd-surface); border-color: var(--sd-line); }
[data-theme="light"] body.sd-site.sd-inner-page :is(.journal-categories a.is-active, .gallery-filters .filter-button:is(.is-active, :hover)) { color: #fff; background: var(--sd-accent); }
[data-theme="light"] body.sd-site.sd-inner-page :is(.contact-info-row .contact-map-link, .sd-why li i, .service-quote-banner > i, .service-feature-tiles i) { color: var(--sd-accent); }
body.sd-site.sd-inner-page .contact-form :is(input, select, textarea) { background: var(--sd-bg); color: var(--sd-ink); border-color: var(--sd-line); }
body.sd-site.sd-inner-page .contact-form :is(input, textarea)::placeholder { color: var(--sd-muted); }
[data-theme="dark"] .contact-error { color: #ffb6ac; }

/* Quote request palette is separate from the public layout. */
body.sd-site #quote.quote-request { background: var(--sd-bg); color: var(--sd-ink); }
body.sd-site #quote :is(.qr-panel, .qr-dropzone, .qr-field input:not([type=file]), .qr-field select, .qr-field textarea) { background: var(--sd-surface); color: var(--sd-ink); border-color: var(--sd-line); }
body.sd-site #quote :is(.qr-heading p, .qr-benefits p, .qr-dropzone small, .qr-field :is(input, textarea)::placeholder) { color: var(--sd-muted); }
body.sd-site #quote :is(.qr-field > label, .qr-dropzone > i, .qr-dropzone p > span, #quote-file-name) { color: var(--sd-ink); }
body.sd-site #quote :is(.qr-accent, .qr-benefits li > span, .qr-dropzone.is-dragging) { background: color-mix(in srgb, var(--sd-accent) 13%, var(--sd-surface)); }
