/*
 * The colour theme's own parts, in both themes (assets/js/theme.js):
 *   .theme-toggle    the button next to the name in the top bar: it shows the OTHER theme ("Dark" in the light theme,
 *                    "Light" in the dark one) in that theme's colours
 *   .theme-fly       the same word flying in along an arc ("Dark" from behind the left edge, "Light" from the right)
 *   .theme-pick      the first-visit picker: the left half of the screen is the dark site (a live copy of the page in
 *                    a frame), the right half the light one; the picked half rolls over the whole screen
 */
.theme-toggle { flex: none; margin: 0 auto 0 4px; padding: 5px 14px; border-radius: 999px; border: 1.5px solid transparent;
  font: 800 .86rem/1.2 var(--sans); letter-spacing: .02em; cursor: pointer; white-space: nowrap; transition: transform .15s, box-shadow .15s; }
.theme-toggle[data-to="dark"] { background: #0b241c; color: #9ff3d6; border-color: #1f5a46; box-shadow: 0 0 16px rgba(47, 211, 176, .28); }
.theme-toggle[data-to="light"] { background: #eaf5ea; color: #10301f; border-color: #c9dccb; box-shadow: 0 0 16px rgba(234, 245, 234, .22); }
.theme-toggle:hover { transform: translateY(-1px); }
.theme-toggle:focus-visible { outline: 3px solid #ffc65c; outline-offset: 2px; }
.theme-toggle.landed { animation: theme-land .45s ease-out; }
@keyframes theme-land { 0% { transform: scale(1.28); } 55% { transform: scale(.92); } 100% { transform: scale(1); } }
/* phones: the name, the button and "Join in Telegram" fit on one row (a 360 px wide phone too) */
@media (max-width: 720px) { .theme-toggle { margin-left: 0; padding: 4px 9px; font-size: .76rem; } }
@media (max-width: 420px) {
  .topbar .brand { font-size: 1rem; }
  .topbar .nav-tg { gap: 5px; padding: 7px 9px; font-size: .76rem; }
}
.theme-fly { position: fixed; left: 0; top: 0; z-index: 2147483001; pointer-events: none; margin: 0; will-change: transform; }

/* the picker */
html.theme-picking { overflow: hidden; }
html.theme-picking .edge-line { visibility: hidden; }   /* the headline's lines wait until the theme is picked */
.theme-pick { position: fixed; inset: 0; z-index: 2147483000; touch-action: none; transition: opacity .28s; }
.theme-pick.closing { opacity: 0; }
.theme-pick-dark { position: absolute; inset: 0; background: #04130f; clip-path: inset(0 50% 0 0);
  transition: clip-path .72s cubic-bezier(.65, 0, .35, 1); }
.theme-pick-dark iframe { display: block; width: 100%; height: 100%; border: 0; opacity: 0; pointer-events: none; transition: opacity .35s; }
.theme-pick.ready .theme-pick-dark iframe { opacity: 1; }
.theme-pick-edge { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; pointer-events: none;
  background: linear-gradient(#4ff0b0, #ff6fae 50%, #ffc65c); box-shadow: 0 0 18px rgba(79, 240, 176, .8);
  transition: left .72s cubic-bezier(.65, 0, .35, 1); }
.theme-pick.to-dark .theme-pick-dark { clip-path: inset(0 0 0 0); }
.theme-pick.to-dark .theme-pick-edge { left: 100%; }
.theme-pick.to-light .theme-pick-dark { clip-path: inset(0 100% 0 0); }
.theme-pick.to-light .theme-pick-edge { left: 0; }
.theme-pick-half { position: absolute; top: 0; bottom: 0; width: 50%; margin: 0; padding: 0 0 20vh; border: 0; background: transparent;
  cursor: pointer; display: flex; align-items: flex-end; justify-content: center; -webkit-tap-highlight-color: transparent; }
.theme-pick-half[data-theme="dark"] { left: 0; }
.theme-pick-half[data-theme="light"] { right: 0; }
.theme-pick-half span { padding: 12px 24px; border-radius: 999px; font: 800 clamp(1.05rem, 2.4vw, 1.5rem)/1 "Nunito Sans", system-ui, sans-serif;
  white-space: nowrap; box-shadow: 0 10px 30px rgba(0, 0, 0, .32); transition: transform .15s, opacity .2s; }
.theme-pick-half[data-theme="dark"] span { background: #0b241c; color: #9ff3d6; border: 2px solid #2fd3b0; }
.theme-pick-half[data-theme="light"] span { background: #fff; color: #10301f; border: 2px solid #0d717e; }
.theme-pick-half:hover span, .theme-pick-half:focus-visible span { transform: scale(1.07); }
.theme-pick-half:focus-visible { outline: none; }
.theme-pick-half:focus-visible span { outline: 3px solid #ffc65c; outline-offset: 3px; }
.theme-pick-title { position: absolute; left: 50%; bottom: calc(20vh + 74px); transform: translateX(-50%); margin: 0; padding: 9px 20px;
  border-radius: 999px; background: rgba(16, 48, 37, .94); color: #fff; font: 800 clamp(1rem, 2vw, 1.25rem)/1.2 "Nunito Sans", system-ui, sans-serif;
  white-space: nowrap; pointer-events: none; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); transition: opacity .2s; }
.theme-pick.chosen .theme-pick-half span, .theme-pick.chosen .theme-pick-title { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .theme-pick, .theme-pick-dark, .theme-pick-edge, .theme-pick-dark iframe { transition: none; }
  .theme-toggle.landed { animation: none; }
}
