/* ============================= 3. Атмосферный фон и Стекло ============================= */
.mt-amb {
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 620px at 6% -4%, rgba(242, 166, 90, .14), transparent 62%),
    radial-gradient(820px 620px at 96% 10%, rgba(164, 147, 214, .11), transparent 62%),
    radial-gradient(1000px 720px at 50% 108%, rgba(127, 184, 196, .09), transparent 62%),
    linear-gradient(rgba(243, 236, 227, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243, 236, 227, .045) 1px, transparent 1px);
  background-repeat: no-repeat, no-repeat, no-repeat, repeat, repeat;
  background-size: auto, auto, auto, 32px 32px, 32px 32px;
  background-attachment: scroll, scroll, scroll, local, local;
  animation: mtAmb 40s ease-in-out infinite;
}
@keyframes mtAmb {
  0%, 100% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
  50%      { background-position: 90px 40px, -110px 50px, 60px -50px, 0 0, 0 0; }
}
.mt-grid {
  background-image:
    linear-gradient(rgba(243, 236, 227, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243, 236, 227, .045) 1px, transparent 1px);
  background-size: 32px 32px;
}
.mt-orb {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  opacity: .6;
  animation: mtFloat 26s ease-in-out infinite;
}
@keyframes mtFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(50px, -36px) scale(1.06); }
}

/* Вложенное стекло через ::before (чтобы дропдаун языка размывал фон страницы, а не только шапку) */
.cz-glass {
  position: relative;
}
.cz-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(var(--glass), 0.62);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  pointer-events: none;
}
.cz-glass-soft::before {
  background: rgba(var(--glass), 0.55);
}
.cz-surface {
  background: rgba(27, 24, 21, 0.46) !important;
  border-color: rgba(243, 236, 227, 0.08) !important;
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}

/* Скроллбар */
.cz-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--line2) transparent;
  scroll-behavior: smooth;
}
.cz-scroll::-webkit-scrollbar {
  width: 10px;
}
.cz-scroll::-webkit-scrollbar-thumb {
  background: var(--line2);
  border-radius: 10px;
  border: 2px solid var(--bg);
}

/* ============================= 4. Ключевые анимации и Интерактив ============================= */
@property --cz-a {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes czSpin    { to { --cz-a: 360deg; } }
@keyframes czPulse   { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }
@keyframes czRise    { from { transform: translateY(16px); } to { transform: none; } }
@keyframes czBars    { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@keyframes czShine   { 0% { transform: translateX(-130%); } 55%, 100% { transform: translateX(130%); } }
@keyframes czFlow    { from { background-position: 0% 50%; } to { background-position: 200% 50%; } }
@keyframes czScan    { 0% { top: -12%; } 100% { top: 112%; } }
@keyframes czBlink   { 0%, 100% { opacity: 1; } 40% { opacity: .35; } }
@keyframes czPop     { 0% { transform: scale(.4); } 100% { transform: scale(1); } }
@keyframes czNoise   { 0% { background-position: 0 0; } 25% { background-position: 3px 1px; } 50% { background-position: -2px 3px; } 75% { background-position: 1px -2px; } 100% { background-position: 0 0; } }
@keyframes czBreathe { 0%, 100% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(.94); filter: brightness(1.25); } }
@keyframes czNudge   { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
@keyframes czMenu    { from { transform: translateY(-6px) scale(.98); } to { transform: none; } }
@keyframes czPower   { 0% { opacity: .35; } 100% { opacity: 1; } }

.cz-mark span { animation: czBlink 3.6s ease-in-out infinite; }
.cz-mark span:nth-child(2) { animation-delay: .9s; }
.cz-mark span:nth-child(3) { animation-delay: 1.8s; }
.cz-mark span:nth-child(4) { animation-delay: 2.7s; }

.cz-bars { height: 3px; overflow: hidden; }
.cz-bars-track { display: flex; width: 200%; height: 100%; animation: czBars 14s linear infinite; }
.cz-bars-track span { flex: 1; }

.cz-glow-text {
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: czFlow 7s linear infinite;
}

.cz-btn {
  transition: transform .2s cubic-bezier(.2,.8,.2,1), filter .2s, border-color .2s, background-color .2s, box-shadow .2s;
}
.cz-btn:hover {
  filter: brightness(1.07);
  transform: translateY(-2px);
}
.cz-btn:active {
  transform: translateY(0) scale(.99);
}

.cz-shimmer {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.cz-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 250, 240, .42) 50%, transparent 65%);
  transform: translateX(-130%);
  animation: czShine 5s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}
.cz-shimmer:hover {
  box-shadow: 0 18px 40px rgba(242, 166, 90, .28);
}

.cz-panel { position: relative; overflow: hidden; }
.cz-screen { animation: czPower 1.1s cubic-bezier(.2,.8,.2,1) both; }
.cz-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 90px;
  top: -12%;
  background: linear-gradient(180deg, transparent, rgba(242, 166, 90, .06), transparent);
  animation: czScan 6s linear infinite;
  pointer-events: none;
}
.cz-live-dot { animation: czPulse 1.8s ease-in-out infinite; }
.cz-spark span { transition: height .6s cubic-bezier(.2,.8,.2,1); }

/* Бегущий янтарный блик по контуру (.cz-ring и .cz-card) */
.cz-ring {
  position: relative;
  isolation: isolate;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--hue) 25%, transparent),
    0 0 22px color-mix(in srgb, var(--hue) 35%, transparent),
    inset 0 0 14px color-mix(in srgb, var(--hue) 12%, transparent);
}
.cz-ring::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  background: conic-gradient(from var(--cz-a), transparent 0deg, transparent 250deg, color-mix(in srgb, var(--hue) 55%, transparent) 330deg, transparent 360deg);
  filter: blur(7px);
  animation: czSpin 3s linear infinite;
  z-index: -1;
  pointer-events: none;
}
.cz-ring::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(from var(--cz-a), transparent 0deg, transparent 200deg, var(--hue) 300deg, #fff6ea 332deg, var(--hue) 346deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: czSpin 3s linear infinite;
  pointer-events: none;
}

.cz-card {
  position: relative;
  isolation: isolate;
  background-color: rgba(27, 24, 21, 0.5) !important;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  animation: czRise .7s cubic-bezier(.2,.8,.2,1) backwards;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, background-color .25s, border-color .25s;
}
.cz-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--cz-a), transparent 0deg, transparent 200deg, var(--hue) 300deg, #fff6ea 332deg, var(--hue) 346deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .3s;
  animation: czSpin 2.6s linear infinite paused;
  pointer-events: none;
}
.cz-card:hover, .cz-card:focus-visible {
  transform: translateY(-4px);
  background-color: rgba(36, 31, 27, 0.72) !important;
  border-color: transparent !important;
  box-shadow: 0 20px 44px rgba(0, 0, 0, .34), 0 0 36px color-mix(in srgb, var(--hue) 20%, transparent);
}
.cz-card:hover::before, .cz-card:focus-visible::before {
  opacity: 1;
  animation-play-state: running;
}
.cz-chip {
  position: relative;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
@keyframes czFocus {
  0%   { filter: blur(0); }
  30%  { filter: blur(3.5px); }
  100% { filter: blur(0); }
}
.cz-card:hover .cz-chip, .cz-card:focus-visible .cz-chip {
  animation: czFocus .7s cubic-bezier(.4,0,.2,1);
  transform: scale(1.08) rotate(-2deg);
  box-shadow: inset 0 0 0 1px rgba(255, 240, 220, .2), 0 8px 18px rgba(0, 0, 0, .4);
}
.cz-card .cz-open {
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .25s, transform .25s;
}
.cz-card:hover .cz-open, .cz-card:focus-visible .cz-open {
  opacity: 1;
  transform: none;
}
.cz-card:hover .cz-arrow {
  display: inline-flex;
  animation: czNudge 1s ease-in-out infinite;
}

/* Живые CSS-миниатюры (.cz-live) при наведении */
.cz-live {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity .7s cubic-bezier(.4,0,.2,1);
  animation-play-state: paused !important;
  pointer-events: none;
}
.cz-card:hover .cz-live, .cz-card:focus-visible .cz-live {
  opacity: 1;
  animation-play-state: running !important;
  transition-delay: .12s;
}
@keyframes czPanX      { from { background-position: 0 0; } to { background-position: 200% 0; } }
@keyframes czPanY      { from { background-position: 0 0; } to { background-position: 0 200%; } }
@keyframes czPanXY     { from { background-position: 0 0; } to { background-position: 48px 48px; } }
@keyframes czZoom      { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.55); } }
@keyframes czTilt      { 0%, 100% { transform: perspective(120px) rotateY(0); } 50% { transform: perspective(120px) rotateY(48deg); } }
@keyframes czInvert    { 0%, 40% { filter: invert(0); } 50%, 90% { filter: invert(1); } 100% { filter: invert(0); } }
@keyframes czLift      { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(3.2); } }
@keyframes czStrobe    { 0%, 46% { opacity: 1; } 50%, 96% { opacity: .15; } 100% { opacity: 1; } }
@keyframes czSoftFlick { 0%, 100% { filter: brightness(1); } 20% { filter: brightness(1.6); } 40% { filter: brightness(.8); } 60% { filter: brightness(1.4); } 80% { filter: brightness(.9); } }
@keyframes czSpinHue   { to { filter: hue-rotate(360deg); } }

.cz-h-flow    { background-size: 300% 300% !important; animation: czFlow 4s linear infinite; }
.cz-h-hue     { animation: czSpinHue 4s linear infinite; }
.cz-h-huefast { animation: czSpinHue 1.6s linear infinite; }
.cz-h-slide   { background-size: 200% 100% !important; animation: czPanX 2.6s linear infinite; }
.cz-h-slidey  { background-size: 100% 200% !important; animation: czPanY 3s linear infinite; }
.cz-h-pan     { animation: czPanXY 2.4s linear infinite; }
.cz-h-noise   { animation: czNoise .3s steps(1) infinite; }
.cz-h-breathe { animation: czBreathe 2.4s ease-in-out infinite; }
.cz-h-zoom    { animation: czZoom 3.2s ease-in-out infinite; }
.cz-h-tilt    { animation: czTilt 3s ease-in-out infinite; }
.cz-h-invert  { animation: czInvert 2.6s ease-in-out infinite; }
.cz-h-lift    { animation: czLift 2.8s ease-in-out infinite; }
.cz-h-strobe  { animation: czStrobe 1.4s steps(1) infinite; }
.cz-h-flick   { animation: czSoftFlick 1.8s ease-in-out infinite; }
.cz-h-twinkle { animation: czPanXY 5s linear infinite; }

.cz-tick-on { animation: czPop .4s cubic-bezier(.3,1.6,.5,1); }
.cz-lang-menu { animation: czMenu .22s cubic-bezier(.2,.8,.2,1); }
.cz-lang-item { transition: background-color .15s; }
.cz-lang-item:hover { background: rgba(var(--ov), 0.06) !important; }
.cz-lang-item:focus-visible { outline: 2px solid #f2a65a; outline-offset: -2px; }
.cz-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Глоссарий терминов (.cz-term + .cz-tip) */
.cz-term {
  position: relative;
  border-bottom: 1.5px dotted color-mix(in srgb, currentColor 55%, transparent);
  cursor: help;
  outline: none;
}
.cz-term:hover, .cz-term:focus-visible {
  border-bottom-color: var(--hue, #f2a65a);
}
.cz-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  width: 300px;
  transform: translate(-50%, 6px);
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(var(--glass2), 0.88);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(var(--ov), 0.14);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .45);
  color: var(--text2);
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  white-space: normal;
  transition: opacity .22s ease, transform .22s cubic-bezier(.2,.8,.2,1);
}
.cz-tip b {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.cz-tip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -6px) rotate(45deg);
  background: inherit;
  border-right: 1px solid rgba(var(--ov), 0.14);
  border-bottom: 1px solid rgba(var(--ov), 0.14);
}
.cz-term:hover .cz-tip, .cz-term:focus-visible .cz-tip {
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: .12s;
}

