/* ═══════════════════════════════════════════════════════════
   Site enhance layer — gadgets, featured projects, patches
   ═══════════════════════════════════════════════════════════ */

/* Language: never show RU+EN at once (Resume / Резюме bug) */
#cv-open-btn .smq-text-ru { display: none !important; }
html[lang="ru"] #cv-open-btn .smq-text-en { display: none !important; }
html[lang="ru"] #cv-open-btn .smq-text-ru { display: inline !important; }
html[lang="kk"] #cv-open-btn .smq-text-en { display: none !important; }
html[lang="kk"] #cv-open-btn .smq-text-ru { display: inline !important; }
.smq-text-ru { display: none !important; }
html[lang="ru"] .smq-text-en { display: none !important; }
html[lang="ru"] .smq-text-ru { display: revert !important; }
html[lang="kk"] .smq-text-en { display: none !important; }
html[lang="kk"] .smq-text-ru { display: revert !important; }

.en-only { display: inline; }
.ru-only { display: none; }
html[lang="ru"] .en-only { display: none; }
html[lang="ru"] .ru-only { display: inline; }
html[lang="kk"] .en-only { display: none; }
html[lang="kk"] .ru-only { display: inline; }
.en-only-block { display: block; }
.ru-only-block { display: none; }
html[lang="ru"] .en-only-block { display: none; }
html[lang="ru"] .ru-only-block { display: block; }
html[lang="kk"] .en-only-block { display: none; }
html[lang="kk"] .ru-only-block { display: block; }

body:not([data-route="home"]) #ai-gadget,
body:not([data-route="home"]) #featured-projects,
body:not([data-route="home"]) #life-goals {
  display: none !important;
}

/* Leftover labels under facts */
.qf-kicker-gone,
.qf-tools-gone { display: none !important; }

/* ── AI gadget ───────────────────────────────────────────── */
#ai-gadget {
  position: relative;
  padding: 28px 20px 12px;
  isolation: isolate;
}
#ai-gadget::before {
  content: "";
  position: absolute;
  inset: 0 8%;
  background:
    radial-gradient(ellipse 70% 50% at 50% 40%, rgba(59, 130, 246, 0.16), transparent 70%),
    radial-gradient(ellipse 40% 30% at 20% 70%, rgba(244, 63, 94, 0.08), transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 70%, rgba(34, 211, 238, 0.1), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.gad {
  --gad-line: rgba(125, 211, 252, 0.28);
  --gad-hot: #38bdf8;
  --gad-warn: #fb7185;
  --gad-ok: #4ade80;
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  transform-style: preserve-3d;
  perspective: 1600px;
}

.gad-shell {
  position: relative;
  border-radius: 28px;
  background:
    linear-gradient(165deg, rgba(18, 24, 38, 0.96), rgba(8, 10, 16, 0.98));
  border: 1px solid rgba(125, 211, 252, 0.22);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(56, 189, 248, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transform: rotateX(6deg);
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s;
}
.gad.is-open .gad-shell {
  transform: rotateX(0deg);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 40px 100px rgba(0, 0, 0, 0.6),
    0 0 120px rgba(56, 189, 248, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.gad-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at 50% 30%, black, transparent 75%);
  pointer-events: none;
}
.gad-screws {
  position: absolute;
  inset: 10px;
  pointer-events: none;
  z-index: 5;
}
.gad-screws span {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: radial-gradient(circle at 30% 30%, #9ca3af, #374151);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35);
}
.gad-screws span:nth-child(1) { top: 0; left: 0; }
.gad-screws span:nth-child(2) { top: 0; right: 0; }
.gad-screws span:nth-child(3) { bottom: 0; left: 0; }
.gad-screws span:nth-child(4) { bottom: 0; right: 0; }

.gad-core {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 22px;
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  text-align: left;
  position: relative;
  z-index: 2;
}
.gad-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: "Cabinet Grotesk", "Satoshi", sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: #fff;
  background: linear-gradient(145deg, #38bdf8, #1d4ed8);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.45);
  animation: gadPulse 2.8s ease-in-out infinite;
}
@keyframes gadPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(56, 189, 248, 0.35); }
  50% { box-shadow: 0 0 32px rgba(56, 189, 248, 0.7); }
}
.gad-core-copy {
  flex: 1;
  min-width: 0;
}
.gad-kicker {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(125, 211, 252, 0.8);
}
.gad-core-title {
  font-family: "Cabinet Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 2px;
}
.gad-core-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.48);
  margin-top: 2px;
}
.gad-chevron {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: rgba(125, 211, 252, 0.8);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.gad.is-open .gad-chevron::after { content: " CLOSE"; }
.gad:not(.is-open) .gad-chevron::after { content: " OPEN"; }

.gad-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s;
}
.gad.is-open .gad-body {
  grid-template-rows: 1fr;
  opacity: 1;
}
.gad-body-inner {
  overflow: hidden;
  min-height: 0;
}

.gad-deck {
  display: grid;
  grid-template-columns: 1fr 140px 1fr;
  gap: 0;
  border-top: 1px solid rgba(125, 211, 252, 0.14);
  min-height: 420px;
}

.gad-panel {
  padding: 22px 22px 18px;
  position: relative;
}
.gad-panel-left {
  background: linear-gradient(180deg, rgba(251, 113, 133, 0.07), transparent 40%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.gad-panel-right {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08), transparent 40%);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}
.gad-panel-h {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gad-panel-left .gad-panel-h { color: #fda4af; }
.gad-panel-right .gad-panel-h { color: #7dd3fc; }
.gad-dot {
  width: 7px; height: 7px; border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

.gad-quiz {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}
.gad-q { font-size: 12.5px; color: rgba(255, 255, 255, 0.78); margin-bottom: 4px; }
.gad-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gad-chip {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}
.gad-chip.is-on {
  border-color: rgba(251, 113, 133, 0.55);
  background: rgba(251, 113, 133, 0.15);
  color: #fecdd3;
}

.gad-sliders { display: grid; gap: 14px; }
.gad-slider label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 6px;
  font-family: "JetBrains Mono", monospace;
}
.gad-slider input[type="range"] {
  width: 100%;
  accent-color: #fb7185;
  height: 4px;
}
.gad-stress {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid rgba(251, 113, 133, 0.25);
  border-radius: 12px;
  background: rgba(251, 113, 133, 0.06);
}
.gad-stress-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #fda4af;
  margin-bottom: 8px;
}
.gad-stress-bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.gad-stress-fill {
  height: 100%;
  width: 40%;
  border-radius: 99px;
  background: linear-gradient(90deg, #fbbf24, #fb7185, #ef4444);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
  transition: width 0.35s ease;
}

.gad-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 8px;
  background:
    radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.16), transparent 68%);
  position: relative;
  overflow: hidden;
}
.gad-core-ring {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 1px dashed rgba(125, 211, 252, 0.4);
  display: grid;
  place-items: center;
  animation: gadSpin 12s linear infinite;
  position: relative;
}
.gad-core-ring::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px solid rgba(56, 189, 248, 0.5);
  animation: gadSpin 7s linear infinite reverse;
}
.gad-core-glyph {
  font-family: "Cabinet Grotesk", sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: #7dd3fc;
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.8);
  animation: none;
}
@keyframes gadSpin { to { transform: rotate(360deg); } }
.gad-stream {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  color: rgba(125, 211, 252, 0.55);
  letter-spacing: 0.08em;
  height: 48px;
  overflow: hidden;
  text-align: center;
  line-height: 1.5;
}
.gad-arrow {
  color: #7dd3fc;
  font-size: 18px;
  opacity: 0.7;
  animation: gadBlink 1.4s ease-in-out infinite;
}
@keyframes gadBlink {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

.gad-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.gad-metric {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  background: rgba(8, 16, 28, 0.65);
  box-shadow: inset 0 0 20px rgba(56, 189, 248, 0.06);
}
.gad-metric span {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(125, 211, 252, 0.7);
}
.gad-metric strong {
  display: block;
  margin-top: 6px;
  font-family: "Cabinet Grotesk", sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #e0f2fe;
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
}
.gad-metric.gad-value {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(29, 78, 216, 0.12));
}
.gad-metric.gad-value strong {
  font-size: 32px;
  color: #fff;
}

.gad-cta {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.55s 0.12s ease, opacity 0.35s 0.12s;
}
.gad.is-open .gad-cta {
  grid-template-rows: 1fr;
  opacity: 1;
}
.gad-cta-inner {
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 22px 20px;
  border-top: 1px solid rgba(125, 211, 252, 0.12);
  padding-top: 16px;
}
.gad-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 1px solid transparent;
}
.gad-btn-primary {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}
.gad-btn-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.16);
}

@media (max-width: 860px) {
  .gad-shell { transform: none; border-radius: 20px; }
  .gad-deck { grid-template-columns: 1fr; min-height: 0; }
  .gad-center { min-height: 120px; flex-direction: row; }
  .gad-stream { display: none; }
  .gad-panel-left, .gad-panel-right { border: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .gad-logo, .gad-core-ring, .gad-core-ring::after, .gad-arrow { animation: none; }
  .gad-shell { transform: none; }
}

/* ── Featured project windows ────────────────────────────── */
#featured-projects {
  padding: 40px 20px 12px;
}
.fp-inner { max-width: 1120px; margin: 0 auto; }
.fp-kicker {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(147, 197, 253, 0.8);
  margin-bottom: 10px;
}
.fp-title {
  font-family: "Cabinet Grotesk", sans-serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}
.fp-lead {
  color: rgba(255, 255, 255, 0.55);
  font-size: 15px;
  margin: 0 0 28px;
  max-width: 58ch;
}
.fp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.fp-window {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(22, 28, 42, 0.9), rgba(8, 10, 16, 0.96));
  overflow: hidden;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease, border-color 0.25s;
}
.fp-window:hover {
  transform: translateY(-4px);
  border-color: rgba(125, 211, 252, 0.28);
}
.fp-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.fp-dots { display: flex; gap: 6px; }
.fp-dots i {
  width: 9px; height: 9px; border-radius: 50%; display: block;
}
.fp-dots i:nth-child(1) { background: #fb7185; }
.fp-dots i:nth-child(2) { background: #fbbf24; }
.fp-dots i:nth-child(3) { background: #4ade80; }
.fp-url {
  flex: 1;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  padding: 4px 8px;
}
.fp-screen {
  position: relative;
  height: 168px;
  background:
    radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.2), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(167, 139, 250, 0.18), transparent 40%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 16px),
    #0b1018;
  overflow: hidden;
}
.fp-self .fp-screen {
  background:
    radial-gradient(circle at 50% 40%, rgba(167, 139, 250, 0.28), transparent 55%),
    #0b1018;
}
.fp-orbit {
  position: absolute;
  inset: 18px;
  border: 1px dashed rgba(167, 139, 250, 0.35);
  border-radius: 50%;
  animation: gadSpin 18s linear infinite;
}
.fp-orbit b {
  position: absolute;
  top: -5px; left: 50%;
  width: 10px; height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: #c4b5fd;
  box-shadow: 0 0 12px #a78bfa;
}
.fp-code {
  position: absolute;
  inset: 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  line-height: 1.55;
  color: rgba(125, 211, 252, 0.75);
  white-space: pre;
}
.fp-body { padding: 18px 18px 16px; flex: 1; display: flex; flex-direction: column; }
.fp-status {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #86efac;
  margin-bottom: 8px;
}
.fp-name {
  font-family: "Cabinet Grotesk", sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}
.fp-desc {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 14px;
}
.fp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.fp-tags span {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.65);
}
.fp-form { margin-top: auto; display: grid; gap: 8px; }
.fp-form input,
.fp-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}
.fp-form textarea { min-height: 72px; }
.fp-form button {
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
}
.fp-form button:hover { background: #1d4ed8; }
.fp-form .fp-ok { color: #86efac; font-size: 12px; min-height: 16px; }
.fp-form .fp-ok.is-err { color: #fca5a5; }

.proj-mock {
  height: 118px;
  border-radius: 12px 12px 0 0;
  margin: -4px -4px 12px;
  background: #0b1018;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}
.proj-mock-bar {
  height: 18px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
}
.proj-mock-bar i { width: 7px; height: 7px; border-radius: 50%; background: #64748b; }
.proj-mock-ui { padding: 10px 12px; display: grid; gap: 6px; }
.proj-mock-ui em {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.35), rgba(255, 255, 255, 0.08));
  font-style: normal;
}
.proj-mock-ui em:nth-child(2) { width: 72%; }
.proj-mock-ui em:nth-child(3) { width: 54%; }
.proj-ba {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
}
.proj-ba div {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.proj-ba .before { color: #fda4af; }
.proj-ba .after { color: #86efac; }

.xp-concurrent {
  display: inline-block;
  margin-left: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fbbf24;
  vertical-align: middle;
}

#featured-projects .fp-window,
#featured-projects .fp-window.rd-reveal,
#ai-gadget,
#ai-gadget .rd-reveal,
#life-goals,
#life-goals.rd-reveal,
#life-goals .fx-in {
  opacity: 1 !important;
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .fp-orbit { animation: none; }
  .fp-window:hover { transform: none; }
}
