:root {
  --theme-transition-duration: 160ms;
  --theme-transition-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --theme-meta-color-dark: #0a0705;
  --theme-meta-color-light: #f7f3ed;
  --theme-page-bg: #0a0705;
  --theme-page-gradient-start: #120d09;
  --theme-page-gradient-end: #0a0705;
  --theme-page-surface: rgba(255, 255, 255, 0.04);
  --theme-page-surface-strong: rgba(20, 14, 10, 0.78);
  --theme-page-surface-soft: rgba(255, 255, 255, 0.02);
  --theme-page-surface-glass: rgba(14, 10, 8, 0.58);
  --theme-overlay: rgba(0, 0, 0, 0.35);
  --theme-overlay-strong: rgba(8, 6, 5, 0.72);
  --theme-text: #f5f2ef;
  --theme-heading: #ffffff;
  --theme-muted: #9c9288;
  --theme-muted-strong: #cfc7be;
  --theme-border: rgba(255, 255, 255, 0.08);
  --theme-border-strong: rgba(255, 255, 255, 0.12);
  --theme-shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.18);
  --theme-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  --theme-accent: #f97316;
  --theme-accent-strong: #fb923c;
  --theme-accent-hover: #fdba74;
  --theme-accent-contrast: #ffffff;
  --theme-accent-soft-bg: rgba(249, 115, 22, 0.12);
  --theme-link: #fdba74;
  --theme-link-hover: #ffffff;
  --theme-button-primary-bg: #f97316;
  --theme-button-primary-bg-hover: #fb923c;
  --theme-button-primary-text: #ffffff;
  --theme-button-secondary-bg: #141210;
  --theme-button-secondary-bg-hover: #1c1a18;
  --theme-button-secondary-border: #6b7280;
  --theme-button-secondary-text: #9ca3af;
  --theme-button-secondary-text-hover: #d1d5db;
  --theme-input-bg: #141210;
  --theme-input-border: #6b7280;
  --theme-input-border-focus: #f97316;
  --theme-input-text: #f5f2ef;
  --theme-code-bg: rgba(255, 255, 255, 0.04);
  --theme-code-text: #f5f2ef;
  --theme-tooltip-bg: #141210;
  --theme-tooltip-text: #f5f2ef;
  --theme-switch-bg: rgba(0, 0, 0, 0.35);
  --theme-switch-border: rgba(255, 255, 255, 0.12);
  --theme-switch-text: #cfc7be;
  --theme-switch-hover-text: #ffffff;
  --theme-switch-active-bg: rgba(249, 115, 22, 0.18);
  --theme-switch-active-text: #ffffff;
  --theme-switch-active-border: rgba(249, 115, 22, 0.24);
  --theme-switch-shadow: none;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
  --theme-page-bg: #f7f3ed;
  --theme-page-gradient-start: #fbf8f4;
  --theme-page-gradient-end: #f2ebe2;
  --theme-page-surface: rgba(255, 255, 255, 0.72);
  --theme-page-surface-strong: rgba(255, 255, 255, 0.92);
  --theme-page-surface-soft: rgba(255, 255, 255, 0.56);
  --theme-page-surface-glass: rgba(255, 255, 255, 0.74);
  --theme-overlay: rgba(255, 255, 255, 0.52);
  --theme-overlay-strong: rgba(243, 236, 226, 0.62);
  --theme-text: #1d1711;
  --theme-heading: #1d1711;
  --theme-muted: #675b4d;
  --theme-muted-strong: #43372b;
  --theme-border: rgba(57, 43, 28, 0.12);
  --theme-border-strong: rgba(57, 43, 28, 0.18);
  --theme-shadow-soft: 0 12px 32px rgba(118, 88, 50, 0.1);
  --theme-shadow: 0 24px 80px rgba(118, 88, 50, 0.16);
  --theme-accent: #b86416;
  --theme-accent-strong: #d77a1c;
  --theme-accent-hover: #e58b2a;
  --theme-accent-contrast: #ffffff;
  --theme-accent-soft-bg: rgba(215, 122, 28, 0.12);
  --theme-link: #b86416;
  --theme-link-hover: #8a4c11;
  --theme-button-primary-bg: #d77a1c;
  --theme-button-primary-bg-hover: #e58b2a;
  --theme-button-primary-text: #ffffff;
  --theme-button-secondary-bg: #ffffff;
  --theme-button-secondary-bg-hover: #f4ece1;
  --theme-button-secondary-border: rgba(57, 43, 28, 0.16);
  --theme-button-secondary-text: #675b4d;
  --theme-button-secondary-text-hover: #1d1711;
  --theme-input-bg: #fffaf4;
  --theme-input-border: rgba(57, 43, 28, 0.16);
  --theme-input-border-focus: #d77a1c;
  --theme-input-text: #1d1711;
  --theme-code-bg: rgba(255, 255, 255, 0.72);
  --theme-code-text: #43372b;
  --theme-tooltip-bg: #fffaf4;
  --theme-tooltip-text: #43372b;
  --theme-switch-bg: rgba(255, 255, 255, 0.74);
  --theme-switch-border: rgba(57, 43, 28, 0.12);
  --theme-switch-text: #675b4d;
  --theme-switch-hover-text: #1d1711;
  --theme-switch-active-bg: rgba(215, 122, 28, 0.16);
  --theme-switch-active-text: #8a4c11;
  --theme-switch-active-border: rgba(215, 122, 28, 0.24);
  --theme-switch-shadow: 0 10px 24px rgba(118, 88, 50, 0.12);
}

.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  flex-wrap: wrap;
  padding: 0.24rem;
  border-radius: 999px;
  border: 1px solid var(--theme-switch-border, rgba(255, 255, 255, 0.16));
  background: var(--theme-switch-bg, rgba(14, 10, 8, 0.58));
  box-shadow: var(--theme-switch-shadow, none);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
}

.theme-btn {
  appearance: none;
  -webkit-appearance: none;
  min-height: 40px;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--theme-switch-text, inherit);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-btn:hover {
  transform: translateY(-1px);
  color: var(--theme-switch-hover-text, var(--theme-switch-text, inherit));
}

.theme-btn.active,
.theme-btn[aria-pressed="true"] {
  border-color: var(--theme-switch-active-border, transparent);
  background: var(--theme-switch-active-bg, rgba(255, 255, 255, 0.12));
  color: var(--theme-switch-active-text, #ffffff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.theme-panel {
  background: var(--theme-page-surface);
  border: 1px solid var(--theme-border);
  box-shadow: var(--theme-shadow-soft);
}

.theme-panel-strong {
  background: var(--theme-page-surface-strong);
  border: 1px solid var(--theme-border);
  box-shadow: var(--theme-shadow);
}

.theme-button-primary {
  background: var(--theme-button-primary-bg);
  color: var(--theme-button-primary-text);
  border: 1px solid transparent;
}

.theme-button-primary:hover {
  background: var(--theme-button-primary-bg-hover);
}

.theme-button-secondary {
  background: var(--theme-button-secondary-bg);
  color: var(--theme-button-secondary-text);
  border: 1px solid var(--theme-button-secondary-border);
}

.theme-button-secondary:hover {
  background: var(--theme-button-secondary-bg-hover);
  color: var(--theme-button-secondary-text-hover);
  border-color: var(--theme-accent);
}

.theme-input {
  background: var(--theme-input-bg);
  color: var(--theme-input-text);
  border: 1px solid var(--theme-input-border);
}

.theme-input:focus-visible {
  outline: 2px solid var(--theme-input-border-focus);
  outline-offset: 2px;
}

html.theme-animating body,
html.theme-animating nav,
html.theme-animating footer,
html.theme-animating .nav,
html.theme-animating .register-nav,
html.theme-animating .section-shell,
html.theme-animating .glass,
html.theme-animating .btn,
html.theme-animating .register-btn,
html.theme-animating .partner-card,
html.theme-animating .register-popup,
html.theme-animating .register-popup__dialog,
html.theme-animating .register-popup__workflow-step,
html.theme-animating .register-page__content,
html.theme-animating .register-step,
html.theme-animating .theme-switcher,
html.theme-animating .theme-btn,
html.theme-animating .lang-switcher button,
html.theme-animating .back-top,
html.theme-animating .scroll-video-layer,
html.theme-animating .scroll-video-layer__media,
html.theme-animating .scroll-video-layer__canvas {
  transition:
    background var(--theme-transition-duration) var(--theme-transition-ease),
    background-color var(--theme-transition-duration) var(--theme-transition-ease),
    color var(--theme-transition-duration) var(--theme-transition-ease),
    border-color var(--theme-transition-duration) var(--theme-transition-ease),
    box-shadow var(--theme-transition-duration) var(--theme-transition-ease),
    opacity var(--theme-transition-duration) var(--theme-transition-ease),
    filter var(--theme-transition-duration) var(--theme-transition-ease),
    text-shadow var(--theme-transition-duration) var(--theme-transition-ease);
}

html.theme-animating .scroll-video-layer::before,
html.theme-animating .scroll-video-layer::after,
html.theme-animating .section-shell::before,
html.theme-animating .section-shell--hero::after,
html.theme-animating .section-shell--partners::after {
  transition:
    background var(--theme-transition-duration) var(--theme-transition-ease),
    opacity var(--theme-transition-duration) var(--theme-transition-ease),
    filter var(--theme-transition-duration) var(--theme-transition-ease);
}

@media (hover: none), (pointer: coarse) {
  .theme-btn:hover {
    transform: none;
  }
}

@media (max-width: 560px) {
  .theme-switcher {
    gap: 0.2rem;
  }

  .theme-btn {
    min-height: 38px;
    padding: 0.4rem 0.68rem;
    font-size: 0.72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --theme-transition-duration: 0ms;
  }

  .theme-switcher,
  .theme-btn {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .theme-btn,
  .theme-btn:hover,
  .theme-btn.active,
  .theme-btn[aria-pressed="true"] {
    transition: none !important;
    transform: none !important;
  }

  html.theme-animating body,
  html.theme-animating nav,
  html.theme-animating footer,
  html.theme-animating .nav,
  html.theme-animating .register-nav,
  html.theme-animating .section-shell,
  html.theme-animating .glass,
  html.theme-animating .btn,
  html.theme-animating .register-btn,
  html.theme-animating .partner-card,
  html.theme-animating .register-popup,
  html.theme-animating .register-popup__dialog,
  html.theme-animating .register-popup__workflow-step,
  html.theme-animating .register-page__content,
  html.theme-animating .register-step,
  html.theme-animating .theme-switcher,
  html.theme-animating .theme-btn,
  html.theme-animating .lang-switcher button,
  html.theme-animating .back-top,
  html.theme-animating .scroll-video-layer,
  html.theme-animating .scroll-video-layer__media,
  html.theme-animating .scroll-video-layer__canvas,
  html.theme-animating .scroll-video-layer::before,
  html.theme-animating .scroll-video-layer::after,
  html.theme-animating .section-shell::before,
  html.theme-animating .section-shell--hero::after,
  html.theme-animating .section-shell--partners::after {
    transition: none !important;
  }
}
