/*
 * Light / dark / high-contrast modes: hand-written parts. The colour overrides themselves are generated
 * from dist/main.css into theme-modes.css (tools/build-theme-modes.py); this file holds the appearance
 * button + sheet and the exceptions the generator cannot know (images, inline colours, later stylesheets).
 */

/* the appearance menus themselves are the shared design system's menu (design-system-uxactly.css) */

/* ---- dark ---- */
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="dark"] body { background-color: #0c0f24; color: #e8ebff; }
/* header logo, burger and mode button: they normally get their navy through a difference blend of a pale
   yellow (#ffffd9) with the light page; on a dark page that blend turns them cream-yellow, so dark mode
   switches the blend off and colours them directly */
:root[data-theme="dark"] .Blend { mix-blend-mode: normal; }
:root[data-theme="dark"] .Blend .Logo__path { fill: #e8ebff; }
:root[data-theme="dark"] .Blend .Logo svg path:not(.Logo__path),
:root[data-theme="dark"] .Blend .Logo svg circle { fill: #4d7dff; } /* the dot: brand blue, a bit lighter on dark */
:root[data-theme="dark"] .Hamburger__inner,
:root[data-theme="dark"] .Hamburger__inner::before,
:root[data-theme="dark"] .Hamburger__inner::after { background-color: #e8ebff; }
/* tag pills (also the filter chips) */
:root[data-theme="dark"] .Tags__item { background-color: #1b2552; color: #b9c9ff; }
:root[data-theme="dark"] .Tags__item--active { background-color: #0552fe; color: #fff; }
/* screenshots and photos stay as they are; only very bright images are toned down a little */
:root[data-theme="dark"] .Picture__image { filter: brightness(.94); }

/* ---- high contrast (light, strong) ---- */
:root[data-theme="contrast"] body { background-color: #fff; color: #000; }
:root[data-theme="contrast"] a { text-decoration-thickness: 2px; }
:root[data-theme="contrast"] .Tags__item { background: #fff; color: #000; box-shadow: inset 0 0 0 2px #000; }
:root[data-theme="contrast"] .Tags__item--active { background: #000; color: #fff; }
/* project grid: an opaque panel instead of milk glass so text never sits on a busy image */
:root[data-theme="contrast"] .PortfolioOthers--cards .PortfolioOthers__imageOverlay {
    background: #000 !important;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    opacity: .82;
}

/* Windows high-contrast / forced colours: let the system palette through, keep outlines visible */
@media (forced-colors: active) {
    .PortfolioOthers__imageOverlay { display: none !important; }
    .Tags__item { border: 1px solid CanvasText; }
}

/* dark: cards and form fields sit one step above the page (on the page colour they read as holes) */
:root[data-theme="dark"] :is(.Box, .Form__text, .Form__textarea) { background-color: #151b3d; }
@media only screen and (max-width: 767px) {
    :root[data-theme="dark"] .Contact .Contact__description { background-color: #151b3d; box-shadow: .1875rem .1875rem 1.25rem rgba(0, 0, 0, .4); }
    :root[data-theme="contrast"] .Contact .Contact__description { box-shadow: inset 0 0 0 2px #000; }
}
/* dark: the footer band one step darker than the page, so the diagonal still reads as an edge */
:root[data-theme="dark"] .Footer__navigation::before { filter: brightness(.55); }
@media only screen and (max-width: 767px) {
    :root[data-theme="dark"] .Footer__navigation { background: linear-gradient(to bottom, transparent 4.5rem, #05091a 4.5rem); }
}

/* filter chips (additions.css): their own mode colours, stronger than the plain tag rules above */
:root[data-theme="dark"] :is(.PortfolioFilter, .ProcessFilter__nav) .Tags__item { --chip-ink: #e8ebff; --chip-line: rgba(232, 235, 255, .2); --chip-glyph: #86a8ff; background: transparent; color: var(--chip-ink); }
:root[data-theme="dark"] :is(.PortfolioFilter, .ProcessFilter__nav) .Tags__item--active { --chip-ink: #fff; --chip-glyph: #fff; background: linear-gradient(135deg, #0552fe, #5c3dfe 55%, #992dfe); box-shadow: 0 .5rem 1.4rem rgba(0, 0, 0, .45); }
:root[data-theme="contrast"] :is(.PortfolioFilter, .ProcessFilter__nav) .Tags__item { --chip-ink: #000; --chip-line: #000; --chip-glyph: #000; background: #fff; color: #000; box-shadow: inset 0 0 0 2px #000; }
:root[data-theme="contrast"] :is(.PortfolioFilter, .ProcessFilter__nav) .Tags__item--active { --chip-ink: #fff; --chip-glyph: #fff; background: #000; box-shadow: none; }
@media (forced-colors: active) {
    :is(.PortfolioFilter, .ProcessFilter__nav) .Tags__item::before { background: CanvasText; }
    :is(.PortfolioFilter, .ProcessFilter__nav) .Tags__item--active { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}

/* phones: the project-card text sits under the image on the page, so it follows the page colours */
@media only screen and (max-width: 599px) {
    :root[data-theme="dark"] .PortfolioOthers--cards .PortfolioOthers__content,
    :root[data-theme="dark"] .PortfolioOthers--cards .PortfolioOthers__link:hover .PortfolioOthers__content { color: #e8ebff; }
    :root[data-theme="contrast"] .PortfolioOthers--cards .PortfolioOthers__content,
    :root[data-theme="contrast"] .PortfolioOthers--cards .PortfolioOthers__link:hover .PortfolioOthers__content { color: #000; }
}
