/* global-theme.css — Возврат чистой, 100% рабочей логики инверсии светлой темы YOOtheme */
:root {
  --bg-color: #0b0806;
  --card-bg: rgba(26, 21, 18, 0.65);
  --accent-orange: #ff7a00;
  --text-primary: #ffffff;
  --text-muted: #a89f98;
  --border-color: rgba(255, 122, 0, 0.18);
  --input-bg: rgba(15, 12, 10, 0.8);
}

/* 1. YOOtheme CSS-инверсия при light-mode */
html.light-mode {
  filter: invert(100%) hue-rotate(180deg) !important;
  background-color: #ffffff !important;
}

/* Инвертируем обратно фотографии, медиа-файлы и иконки, чтобы цвета картинок оставались естественными */
html.light-mode img:not(.mascot-logo-white):not(.mascot-logo-dark),
html.light-mode video,
html.light-mode iframe,
html.light-mode canvas,
html.light-mode .avatar-circle,
html.light-mode .portfolio-card-mini img,
html.light-mode .theme-toggle-btn,
html.light-mode .theme-circle-wipe {
  filter: invert(100%) hue-rotate(180deg) !important;
}

body {
    /* Pad content to avoid overlap with Telegram status bar */
    padding-top: env(safe-area-inset-top, 0px) !important;
}

/* Логотипы маскота */
.mascot-logo-white { display: inline-block !important; }
.mascot-logo-dark { display: none !important; }
html.light-mode .mascot-logo-white { display: none !important; }
html.light-mode .mascot-logo-dark { display: inline-block !important; filter: invert(100%) hue-rotate(180deg) !important; }

/* 2. Кнопка темы */
.theme-toggle-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-toggle-btn:hover {
  border-color: var(--accent-orange);
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(255, 122, 0, 0.25);
}
.theme-toggle-icon {
  width: 16px;
  height: 16px;
  position: absolute;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}
.theme-toggle-sun {
  color: #ffb703;
  transform: scale(1) rotate(0deg);
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(255, 183, 3, 0.7));
}
.theme-toggle-moon {
  color: #38bdf8;
  transform: scale(0) rotate(-120deg);
  opacity: 0;
  filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.7));
}
html.light-mode .theme-toggle-sun {
  transform: scale(0) rotate(120deg);
  opacity: 0;
}
html.light-mode .theme-toggle-moon {
  transform: scale(1) rotate(0deg);
  opacity: 1;
}

/* 3. Анимация круговой развёртки (View Transitions API) */
.circle-wipe-active::view-transition-old(root) {
  animation: none;
  mix-blend-mode: normal;
  z-index: 1;
}
.circle-wipe-active::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
  z-index: 99999;
}

.theme-circle-wipe {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  margin-left: -5px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 999999;
  opacity: 0;
  transform: scale(0);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
  will-change: transform, opacity;
}
.theme-circle-wipe.animating {
  opacity: 1;
  transform: scale(350);
}

#themeToggleBtn {
  view-transition-name: theme-toggle-button;
}
