/* Shared theme colors. The original stylesheet supplies the light palette. */
:root {
    color-scheme: light;
    --theme-bg: #fff;
    --theme-surface: #f7f7f7;
    --theme-text: #282828;
    --theme-border: #ddd;
    --theme-accent: #68c3a3;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --theme-bg: #161b20;
    --theme-surface: #20272e;
    --theme-text: #e4e9ed;
    --theme-muted: #b4c0c9;
    --theme-border: #39454f;
    --theme-accent: #83d8b8;
    --theme-on-accent: #12271f;
}

/* Keep the switch beside the menu, including when navigation is collapsed. */
.navbar-custom > .container {
    position: relative;
}

.theme-toggle {
    position: absolute;
    top: 8px;
    right: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--theme-border);
    border-radius: 50%;
    background: var(--theme-bg);
    color: var(--theme-text);
    line-height: 1;
    z-index: 1;
}

.theme-toggle:hover,
.theme-toggle:focus {
    background: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-accent);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--theme-accent);
    outline-offset: 3px;
}

.theme-toggle[hidden],
.theme-icon-sun,
[data-theme="dark"] .theme-icon-moon {
    display: none;
}

[data-theme="dark"] .theme-icon-sun {
    display: block;
}

@media (min-width: 992px) {
    .navbar-custom .navbar-collapse {
        padding-right: 74px;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .navbar-custom .navbar-nav > li > a {
        padding-right: 11px;
        padding-left: 11px;
        font-size: 13px;
    }
}

/* Collapse at tablet widths so the logo, links and switch have enough room. */
@media (max-width: 991px) {
    .navbar-custom .navbar-header {
        float: none;
        min-height: 60px;
    }

    .navbar-custom .navbar-brand {
        max-width: calc(100% - 116px);
        height: auto;
        padding: 15px;
    }

    .navbar-custom .navbar-toggle {
        display: block;
        min-height: 44px;
        margin-top: 8px;
        margin-bottom: 8px;
        background: transparent;
        color: var(--theme-text);
    }

    .theme-toggle {
        right: 73px;
    }

    .navbar-custom .navbar-collapse {
        clear: both;
        border-top: 1px solid var(--theme-border);
        box-shadow: none;
    }

    .navbar-custom .navbar-collapse.collapse {
        display: none !important;
    }

    .navbar-custom .navbar-collapse.in {
        display: block !important;
    }

    .navbar-custom .navbar-nav {
        float: none !important;
        margin: 7.5px -15px;
    }

    .navbar-custom .navbar-nav > li {
        float: none;
    }

    .navbar-custom .navbar-nav > li > a {
        padding: 10px 15px;
    }
}

/* Main surfaces and type. Photograph and portfolio colors stay intact. */
[data-theme="dark"] body {
    background-color: var(--theme-bg);
    color: var(--theme-text);
}

[data-theme="dark"] .header,
[data-theme="dark"] .navbar-custom,
[data-theme="dark"] .navbar-custom .dropdown-menu,
[data-theme="dark"] #tt-preloader,
[data-theme="dark"] .timeline > li .posted-date {
    background-color: var(--theme-bg);
}

[data-theme="dark"] .works-section,
[data-theme="dark"] .biography,
[data-theme="dark"] .timeline-content,
[data-theme="dark"] .portfolio-bg,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .ux-process-popup .mfp-iframe-scaler,
[data-theme="dark"] .ux-process-popup .mfp-iframe {
    background-color: var(--theme-surface);
}

[data-theme="dark"] .section-title,
[data-theme="dark"] .navbar-custom .navbar-nav > li > a,
[data-theme="dark"] .navbar-custom .dropdown-menu > li > a,
[data-theme="dark"] .timeline > li .posted-date .month,
[data-theme="dark"] .ux-process-popup .mfp-close {
    color: var(--theme-text);
}

[data-theme="dark"] a,
[data-theme="dark"] #filter li a,
[data-theme="dark"] ul.list-check li::before,
[data-theme="dark"] .navbar-custom .navbar-nav > li.active > a,
[data-theme="dark"] .navbar-custom .nav li a:hover,
[data-theme="dark"] .navbar-custom .nav li a:focus {
    color: var(--theme-accent);
}

[data-theme="dark"] a:hover,
[data-theme="dark"] a:focus {
    color: #b0efda;
}

[data-theme="dark"] .header,
[data-theme="dark"] .header::after,
[data-theme="dark"] .navbar-custom .dropdown-menu,
[data-theme="dark"] .navbar-custom .dropdown-menu > li,
[data-theme="dark"] .biography,
[data-theme="dark"] .biography::after,
[data-theme="dark"] .biography ul li,
[data-theme="dark"] .timeline > li .timeline-panel,
[data-theme="dark"] .timeline-content::after,
[data-theme="dark"] .portfolio-bg,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer,
[data-theme="dark"] .ux-process-dialog-header,
[data-theme="dark"] .location-map {
    border-color: var(--theme-border);
}

[data-theme="dark"] .navbar-custom .nav .open > a,
[data-theme="dark"] .navbar-custom .dropdown-menu > li > a:hover,
[data-theme="dark"] .navbar-custom .dropdown-menu > li > a:focus {
    background-color: var(--theme-surface);
}

[data-theme="dark"] .navbar-custom .navbar-toggle .icon-bar,
[data-theme="dark"] .resume::before,
[data-theme="dark"] .resume::after,
[data-theme="dark"] .timeline::before {
    background-color: var(--theme-muted);
}

/* Transparent dark artwork needs a lighter treatment on a dark surface. */
[data-theme="dark"] .navbar-brand img,
[data-theme="dark"] .my-signature img {
    filter: brightness(0) invert(1);
}

[data-theme="dark"] .section-title::after {
    filter: brightness(0) invert(1);
    opacity: .35;
}

[data-theme="dark"] .myphoto {
    background-image: none;
}

[data-theme="dark"] .myphoto img {
    z-index: 0;
}

/* Reuse the original frame's shape with the dark card's background color. */
[data-theme="dark"] .myphoto::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background-color: var(--theme-surface);
    -webkit-mask: url("../images/photo-frame.png") bottom center / contain no-repeat;
    mask: url("../images/photo-frame.png") bottom center / contain no-repeat;
    pointer-events: none;
}

/* Light monochrome logos blend embedded white backgrounds into the dark surface. */
[data-theme="dark"] .customer-logos .slide {
    background-color: var(--theme-bg);
}

[data-theme="dark"] .customer-logos img {
    filter: grayscale(1) invert(1) brightness(2);
    mix-blend-mode: screen;
}

[data-theme="dark"] .portfolio > img,
[data-theme="dark"] .mfp-img {
    background-color: #fff;
}

[data-theme="dark"] .form-control {
    background-color: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border);
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--theme-muted);
    opacity: 1;
}

[data-theme="dark"] .form-control:focus {
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 2px rgba(131, 216, 184, .2);
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-info,
[data-theme="dark"] #filter li a.active,
[data-theme="dark"] #filter li a:hover,
[data-theme="dark"] .scroll-up a {
    background-color: var(--theme-accent);
    color: var(--theme-on-accent);
    border-color: rgba(0, 0, 0, .2);
}

[data-theme="dark"] .btn-info {
    background-color: #7ac9e5;
    color: #112832;
}

[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-primary:focus,
[data-theme="dark"] .btn-info:hover,
[data-theme="dark"] .btn-info:focus,
[data-theme="dark"] .scroll-up a:hover {
    background-color: #b0efda;
    color: var(--theme-on-accent);
}

[data-theme="dark"] #filter li a.active::after,
[data-theme="dark"] #filter li a:hover::after {
    border-top-color: var(--theme-accent);
}

[data-theme="dark"] .hire-section .btn-default {
    background-color: var(--theme-bg);
    color: var(--theme-text);
    border-color: var(--theme-border);
}

[data-theme="dark"] .hire-section .btn-default:hover,
[data-theme="dark"] .hire-section .btn-default:focus {
    background-color: var(--theme-surface);
    border-color: var(--theme-accent);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    background-color: #293b36;
    color: var(--theme-text);
}

[data-theme="dark"] .close {
    color: var(--theme-text);
    text-shadow: none;
    opacity: .8;
}

[data-theme="dark"] .close:hover,
[data-theme="dark"] .close:focus {
    color: var(--theme-accent);
    opacity: 1;
}

[data-theme="dark"] .timeline > li .timeline-content:hover {
    background-color: #293b36;
    color: var(--theme-text);
}

@media (min-width: 992px) {
    [data-theme="dark"] .timeline > li .timeline-panel::before {
        border-left-color: var(--theme-border);
    }

    [data-theme="dark"] .timeline > li .timeline-panel::after {
        border-left-color: var(--theme-surface);
    }

    [data-theme="dark"] .timeline > li.timeline-inverted .timeline-panel::before {
        border-right-color: var(--theme-border);
    }

    [data-theme="dark"] .timeline > li.timeline-inverted .timeline-panel::after {
        border-right-color: var(--theme-surface);
    }

    [data-theme="dark"] .timeline > li .timeline-panel:hover::after {
        border-left-color: #293b36;
    }

    [data-theme="dark"] .timeline > li.timeline-inverted .timeline-panel:hover::after {
        border-right-color: #293b36;
    }
}

/* The same preference also styles the local page inside the UX Process dialog. */
[data-theme="dark"] .ux-design-services .page-header,
[data-theme="dark"] .ux-design-services .introduce,
[data-theme="dark"] .ux-design-services .design-services,
[data-theme="dark"] .ux-design-services .design-processes,
[data-theme="dark"] .ux-design-services .footer {
    background-color: var(--theme-bg);
    color: var(--theme-text);
}

[data-theme="dark"] .ux-design-services h1,
[data-theme="dark"] .ux-design-services h2,
[data-theme="dark"] .ux-design-services h3,
[data-theme="dark"] .ux-design-services .text-container p {
    color: var(--theme-text);
}

[data-theme="dark"] .ux-design-services .page-header {
    background-image: linear-gradient(99deg, #1f6548, #205e73);
    border-bottom: 1px solid var(--theme-border);
}

[data-theme="dark"] .ux-design-services .step .label {
    background-color: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border);
}

[data-theme="dark"] a:focus-visible,
[data-theme="dark"] button:focus-visible,
[data-theme="dark"] .btn:focus-visible {
    outline: 2px solid var(--theme-accent);
    outline-offset: 3px;
}
