/* The dark theme and the light/dark switch (site.yaml theme: toggle or dark; published 19 November 2026 after
   trying it on the preview address).  Everything dark is under html.theme-dark, which theme.js sets from the switch or the device's setting (or
   build.py sets for theme: dark).  The logos' neon letters and the dark theme's cloud-cat colour are made by build.py. */

/* Both versions of the header icons are in the page, and each logo is drawn in both versions in one picture (build.py
   cat_logo); show the ones for the current theme.  They follow html.logos-dark, which theme.js changes partway through
   the switch's transition (html.theme-dark, the colours, changes at its start). */
html:not(.logos-dark) .only-dark, html.logos-dark .only-light { display: none !important; }
html:not(.logos-dark) .logo-dark, html.logos-dark .logo-light { display: none; }

/* The switch, top right of the header (in the header's empty right-hand margin on wide screens). */
.header-inner { position: relative; }
.theme-switch {
  position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #8a8a8a; border-radius: 50%; background: #fff; color: #6e6e6e; cursor: pointer;
}
.theme-switch svg { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.theme-switch .icon-moon { stroke: none; }
.theme-switch .icon-sun { display: none; }
.theme-dark .theme-switch .icon-sun { display: block; }
.theme-dark .theme-switch .icon-moon { display: none; }
/* red under the mouse only (on touchscreens :hover sticks after a tap, which left the switch red; the owner, 19 November) */
@media (hover: hover) and (pointer: fine) { .theme-switch:hover { border-color: var(--red); color: var(--red); } }
@media (max-width: 700px) { .theme-switch { top: 10px; right: 10px; width: 36px; height: 36px; } }

/* The switch's transition (theme.js adds these classes for a moment when the switch is pressed).  The colours fade:
   with a view transition (the browser cross-fades pictures of the page before and after), or in older browsers with
   theme-anim (every element fades its own colours).  swap-dark: the dark logo is drawn over the light one; its neon
   letters flicker on while the rest of it fades in, then the light logo underneath fades away.  swap-light: the dark
   logo fades out over the light one.  The footer's plain letters fade in rather than flicker. */
::view-transition-group(root), ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.8s; animation-timing-function: ease; }
html.theme-anim * { transition: background-color 0.8s ease, color 0.8s ease, border-color 0.8s ease; }
html.theme-anim { transition: background-color 0.8s ease; }
/* While the switch animates, the white outlines are left out: the light logos' (there for phones' forced dark mode,
   build.py dark_safe) and the header icons' (the -dark-safe pictures give way to the plain ones, uninverted until the
   logos change).  On the darkening page they showed as white borders (the owner, 19 November); instead the dark
   parts are hard to see for a moment, until the neon comes on. */
html.theme-switching .cat-halo { display: none; }
html.theme-switching:not(.logos-dark) .only-light { display: none !important; }
html.theme-switching:not(.logos-dark) .only-dark { display: block !important; }
html.logos-dark.swap-dark .logo-light { display: inline; animation: swap-under 1.7s linear both; }
html.swap-dark .neon-rest { animation: logo-in 0.9s ease both; }
html.swap-dark .neon-ict { animation: neon-start 1.7s linear both; }
html.swap-dark .neon-nine { animation: neon-start 1.7s linear 0.35s both; }
html.swap-dark .site-footer .neon-letters { animation: logo-in 0.9s ease both; }
html.swap-light:not(.logos-dark) .logo-dark { display: inline; animation: logo-out 0.35s ease-out both; }
/* a fluorescent tube starting: dark, a few uneven flashes, a stutter, then steady */
@keyframes neon-start {
  0% { opacity: 0; } 5% { opacity: 0.85; } 7% { opacity: 0; } 15% { opacity: 0; } 17% { opacity: 1; } 19% { opacity: 0.1; }
  24% { opacity: 0.95; } 26% { opacity: 0.25; } 29% { opacity: 0; } 38% { opacity: 0; } 40% { opacity: 1; } 43% { opacity: 0.55; }
  46% { opacity: 1; } 49% { opacity: 0.8; } 52% { opacity: 1; } 100% { opacity: 1; }
}
@keyframes logo-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes logo-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes swap-under { 0%, 55% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  html.swap-dark .neon-ict, html.swap-dark .neon-nine { animation: logo-in 0.9s ease both; }
}

/* The dark theme: near-black with a faint purple tint. */
.theme-dark {
  color-scheme: dark;
  --red: #ff4d63;
  --text: #c4c1d2;
  --black: #f4f0ff;
  --grey-band: #15131d;
  --line: #2e2b3b;
}
.theme-dark, .theme-dark body { background: #0b0a10; }
.theme-dark body { color: var(--text); }
.theme-dark .skip:focus { background: #0b0a10; }

/* header and slide-out menu */
.theme-dark .site-header { background: #0b0a10; }
/* the header icons' dark versions: with the switch they follow the logos (html.logos-dark), so they stay visible
   while the colours fade */
html.logos-dark .menu-button img, html.logos-dark .contact-line img[src*="icon-phone"],
html.theme-dark:not(.theme-toggle) .menu-button img, html.theme-dark:not(.theme-toggle) .contact-line img[src*="icon-phone"] {
  filter: invert(1) hue-rotate(180deg) brightness(1.15);
}
.theme-dark .theme-switch { background: #14121c; border-color: #5a5574; color: #ece8fa; }
.theme-dark .site-nav { background: #14121c; box-shadow: 2px 0 14px rgba(0, 0, 0, 0.6); }
.theme-dark .site-nav a, .theme-dark .nav-full .nav-contact a { color: #d4d0e6; }
.theme-dark .site-nav .nav-close, .theme-dark .nav-full .nav-close { color: #f4f0ff; border-color: #3b3850; }
.theme-dark .nav-full { background: #0b0a10; }
.theme-dark .nav-full a { color: #f4f0ff; }
.theme-dark .nav-overlay { background: rgba(0, 0, 0, 0.6); }
.theme-dark .remote-assist { color: #d4d0e6; border-color: #5a5574; }
.theme-dark .contact-line { color: #c4c1d2; }
/* the red the light theme gives the current page's menu link, and links and buttons under the mouse */
.theme-dark .site-nav a[aria-current="page"], .theme-dark .site-nav a:active { color: var(--red); }
@media (hover: hover) and (pointer: fine) {
  .theme-dark .site-nav a:hover, .theme-dark .site-footer a:hover { color: var(--red); }
  .theme-dark .remote-assist:hover, .theme-dark .theme-switch:hover { border-color: var(--red); color: var(--red); }
}

/* Text: the headings and red text take their colours from --black, --red and --text above, so red stays red. */

/* tables and the pricing cards */
.theme-dark table { border-color: #3a3650; }
.theme-dark th { background: #2a2540; color: #f4f0ff; }
.theme-dark td { color: #d0cde0; border-bottom-color: #3a3650; }
.theme-dark .plan-card:nth-child(1) { background: #17151f; }
.theme-dark .plan-card:nth-child(2) { background: #141824; }
.theme-dark .plan-card:nth-child(3) { background: #131a17; }
.theme-dark .plan-card:nth-child(4) { background: #1c1517; }

/* the makers' logos (Technology page): each is in the page twice where it has a dark version (build.py dark_logos;
   white names, brand colours kept, like the makers' own logos for dark backgrounds); show the one for the page's
   colours.  (Light tiles behind them were tried first and looked like random white boxes; the owner, 19 November.) */
html:not(.theme-dark) .on-dark, html.theme-dark .on-light { display: none !important; }

/* the footer */
.theme-dark .site-footer { color: #9c98ae; }
.theme-dark .site-footer a { color: #c4c1d2; }
