/*
 * Ефектните елементи на визуалния редактор: „Херо с портал“ (ElHeroPortal),
 * „Bento карти“ (ElBento), „Екип (карти)“ (ElTeamCards), „Ефекти на сайта“
 * (ElSiteFx) и видът „Времева линия“ на „Стъпки“. Скриптът е в
 * /js/page-elements-fx.js. Цветовете идват от темата; работят и на светъл, и
 * на тъмен фон (стъклото и линиите са от currentColor).
 */
.tpe-fx { --fx-a1: #3ef0ff; --fx-a2: var(--tpe-accent); --fx-a3: #8b5cff; --fx-ok: #b8ff5c; --fx-glass: color-mix(in srgb, currentColor 5%, transparent); --fx-glass2: color-mix(in srgb, currentColor 9%, transparent); --fx-line: color-mix(in srgb, currentColor 12%, transparent); --fx-muted: color-mix(in srgb, currentColor 68%, transparent); }
@property --fx-a { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes fx-spin { to { --fx-a: 360deg; } }
@keyframes fx-float { 50% { transform: translateY(-12px); } }
@keyframes fx-flow { to { background-position: 300% 0; } }

/* ---------------------------------------------------------------- херо с портал */
.tpe-heroportal { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; padding: clamp(1rem, 4vw, 3rem) 0; }
.tpe-heroportal.is-media-left { grid-template-columns: .95fr 1.05fr; }
.tpe-heroportal.is-media-left .fx-hp-media { order: -1; }
.fx-pill { display: inline-flex; align-items: center; gap: .6rem; padding: .35rem .9rem .35rem .35rem; border-radius: 999px; background: var(--fx-glass); border: 1px solid var(--fx-line); font-size: .9rem; color: var(--fx-muted); text-decoration: none; }
.fx-pill b { background: var(--fx-ok); color: #031b0a; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; }
.fx-hp-title { font-size: clamp(2.4rem, 1.4rem + 4.4vw, 5.4rem); line-height: .98; font-weight: 900; letter-spacing: -.03em; margin: 1.2rem 0; }
.fx-grad { background: linear-gradient(90deg, var(--fx-a1), var(--fx-a2), var(--fx-a3), var(--fx-a1)); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: fx-flow 6s linear infinite; }
.fx-rot { display: inline-grid; vertical-align: bottom; height: 1.02em; overflow: hidden; }
.fx-rot > span { grid-area: 1 / 1; transform: translateY(105%); opacity: 0; transition: transform .55s cubic-bezier(.7, 0, .2, 1), opacity .35s; white-space: nowrap; }
.fx-rot > span.is-on { transform: none; opacity: 1; }
.fx-rot > span.is-out { transform: translateY(-105%); opacity: 0; }
.tpe-nojs .fx-rot > span:first-child, .fx-rot:not([data-fx-ready]) > span:first-child { transform: none; opacity: 1; }
.fx-hp-text { font-size: 1.15rem; line-height: 1.6; color: var(--fx-muted); max-width: 560px; }
.fx-hp-cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.75rem; }
.fx-btn { position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: .6rem; padding: .9rem 1.5rem; border-radius: 999px; font-weight: 700; text-decoration: none; border: 1px solid transparent; transition: transform .2s; }
.fx-btn:hover { transform: translateY(-2px); }
.fx-btn .fx-arr { transition: transform .2s; } .fx-btn:hover .fx-arr { transform: translateX(4px); }
.fx-btn-main { color: #fff !important; background: linear-gradient(135deg, var(--fx-a2), var(--fx-a3)); box-shadow: 0 10px 40px -12px var(--fx-a2); }
.fx-btn-main::before { content: ""; position: absolute; inset: -2px; border-radius: inherit; z-index: -1; background: conic-gradient(from var(--fx-a), var(--fx-a1), var(--fx-a2), var(--fx-a3), var(--fx-a1)); filter: blur(7px); opacity: .65; animation: fx-spin 4s linear infinite; }
.fx-btn-glass { color: inherit !important; background: var(--fx-glass2); border-color: var(--fx-line); }
.fx-btn-glass:hover { border-color: var(--fx-a1); }
.fx-trust { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: 1.8rem 0 0; padding: 0; list-style: none; font-size: .9rem; color: var(--fx-muted); }
.fx-trust li::before { content: "✓ "; color: var(--fx-ok); font-weight: 700; }
.fx-hp-media { position: relative; }
.fx-portal { position: relative; aspect-ratio: 1; max-width: 560px; margin-inline: auto; }
.fx-portal.is-rounded { aspect-ratio: 4 / 3; }
.fx-ring { position: absolute; inset: 0; border-radius: 50%; padding: 3px; background: conic-gradient(from var(--fx-a), var(--fx-a1), transparent 30%, var(--fx-a3), transparent 70%, var(--fx-a1)); animation: fx-spin 8s linear infinite; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.fx-portal.is-rounded .fx-ring { border-radius: 30px; }
.fx-disc { position: absolute; inset: 14px; border-radius: 50%; overflow: hidden; background: #0b1726 center / cover no-repeat; box-shadow: 0 0 120px -20px var(--fx-a2); }
.fx-portal.is-rounded .fx-disc { border-radius: 24px; }
.fx-disc img, .fx-disc video { width: 100%; height: 100%; object-fit: cover; display: block; }
.fx-disc video { position: absolute; inset: 0; opacity: 0; transition: opacity .6s; }
.fx-disc video.is-ready { opacity: 1; }
.fx-portal.is-zoom .fx-disc video, .fx-portal.is-zoom .fx-disc img { transform: scale(1.35); }
.fx-chip { position: absolute; display: flex; gap: .5rem; align-items: center; padding: .55rem .9rem; border-radius: 14px; background: color-mix(in srgb, var(--fx-bg, #031427) 78%, transparent); color: #eaf3ff; border: 1px solid rgba(255, 255, 255, .12); font-weight: 600; font-size: .9rem; white-space: nowrap; animation: fx-float 5s ease-in-out infinite; backdrop-filter: blur(10px); }
.fx-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--fx-ok); box-shadow: 0 0 10px var(--fx-ok); }
.fx-chip:nth-of-type(1) { top: 8%; left: -6%; } .fx-chip:nth-of-type(2) { top: 46%; right: -8%; animation-delay: -1.6s; } .fx-chip:nth-of-type(3) { bottom: 8%; left: 2%; animation-delay: -3.2s; } .fx-chip:nth-of-type(4) { bottom: -2%; right: 12%; animation-delay: -2.4s; }
@media (max-width: 991.98px) { .tpe-heroportal, .tpe-heroportal.is-media-left { grid-template-columns: 1fr; } .tpe-heroportal.is-media-left .fx-hp-media { order: 0; } .fx-portal { max-width: 420px; } }
@media (max-width: 575.98px) { .fx-chip { display: none; } }

/* ---------------------------------------------------------------- bento */
.tpe-bento .fx-bento { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(230px, auto); gap: 1rem; }
.fx-card { position: relative; display: flex; flex-direction: column; border-radius: 26px; padding: 1.6rem; background: var(--fx-glass); border: 1px solid var(--fx-line); overflow: hidden; color: inherit !important; text-decoration: none !important; transition: border-color .3s, transform .25s; grid-column: span 2; }
.fx-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px circle at var(--x, 50%) var(--y, 50%), color-mix(in srgb, var(--fx-a1) 18%, transparent), transparent 40%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.fx-card:hover { border-color: color-mix(in srgb, var(--fx-a1) 50%, transparent); }
.fx-card:hover::before { opacity: 1; }
.fx-card > * { position: relative; }
.fx-card.is-large { grid-column: span 4; grid-row: span 2; background: linear-gradient(160deg, color-mix(in srgb, var(--fx-a2) 22%, transparent), color-mix(in srgb, var(--fx-a3) 8%, transparent) 60%, var(--fx-glass)); }
.fx-card.is-tall { grid-row: span 2; }
.fx-card.is-wide { grid-column: span 4; }
.fx-card .fx-num { font-size: .8rem; color: var(--fx-muted); font-weight: 700; }
.fx-card .fx-ico { font-size: 1.8rem; color: var(--fx-a1); }
.fx-card h3 { font-size: 1.45rem; margin: .6rem 0 .5rem; letter-spacing: -.01em; color: inherit; }
.fx-card p { color: var(--fx-muted); line-height: 1.55; margin: 0; max-width: 440px; }
.fx-badge { position: absolute; right: 1.2rem; top: 1.2rem; font-weight: 700; font-size: .85rem; padding: .35rem .75rem; border-radius: 999px; background: var(--fx-glass2); border: 1px solid var(--fx-line); }
.fx-more { margin-top: auto; padding-top: 1rem; color: var(--fx-a1); font-weight: 600; }
.fx-code { margin-top: 1.4rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; line-height: 1.8; background: rgba(0, 0, 0, .35); color: #c5d6ee; border: 1px solid var(--fx-line); border-radius: 16px; padding: 1rem 1.2rem; max-width: 520px; white-space: pre-wrap; }
.fx-code .k { color: #b89bff; } .fx-code .s { color: var(--fx-ok); } .fx-code .f { color: var(--fx-a1); }
.fx-ticks { margin-top: 1.1rem; display: grid; gap: .55rem; padding: 0; list-style: none; }
.fx-ticks li { display: flex; justify-content: space-between; gap: .5rem; padding: .65rem .85rem; border-radius: 12px; background: rgba(0, 0, 0, .22); border: 1px solid var(--fx-line); font-size: .9rem; }
.fx-ticks li b { color: var(--fx-ok); }
.fx-bars { display: flex; align-items: end; gap: 6px; height: 72px; margin-top: 1.1rem; }
.fx-bars i { flex: 1; border-radius: 6px 6px 2px 2px; background: linear-gradient(var(--fx-a1), var(--fx-a2)); animation: fx-grow 2.6s ease-in-out infinite alternate; transform-origin: bottom; }
.fx-bars i:nth-child(2n) { animation-delay: -.8s; } .fx-bars i:nth-child(3n) { animation-delay: -1.4s; }
@keyframes fx-grow { from { transform: scaleY(.55); } }
@media (max-width: 991.98px) { .tpe-bento .fx-bento { grid-template-columns: 1fr 1fr; } .fx-card, .fx-card.is-large, .fx-card.is-wide { grid-column: span 2; grid-row: auto; } .fx-card.is-tall { grid-row: auto; } }
@media (max-width: 575.98px) { .tpe-bento .fx-bento { grid-template-columns: 1fr; } .fx-card, .fx-card.is-large, .fx-card.is-wide { grid-column: auto; } }

/* ---------------------------------------------------------------- екип (карти) */
.tpe-teamcards .fx-team { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 1rem; }
.fx-member { border-radius: 26px; padding: 1.3rem; background: var(--fx-glass); border: 1px solid var(--fx-line); transition: border-color .3s; }
.fx-member:hover { border-color: color-mix(in srgb, var(--fx-a1) 45%, transparent); }
.fx-avatar { position: relative; aspect-ratio: 1; border-radius: 20px; overflow: visible; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--fx-a2) 35%, transparent), color-mix(in srgb, var(--fx-a3) 14%, transparent) 60%, transparent); border: 1px solid var(--fx-line); margin-bottom: 1rem; padding: 8px 8px 0; }
.fx-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; }
.fx-avatar.is-photo { padding: 0; overflow: hidden; }
.fx-member h3 { font-size: 1.05rem; margin: 0; color: inherit; }
.fx-member .fx-role { color: var(--fx-a1); font-size: .85rem; font-weight: 600; margin: .25rem 0 .5rem; }
.fx-member p { color: var(--fx-muted); font-size: .9rem; line-height: 1.5; margin: 0; }
.fx-member .fx-quote { margin-top: .6rem; font-size: .85rem; color: color-mix(in srgb, var(--fx-a1) 80%, currentColor); font-style: italic; }
.fx-member:hover .fx-mascot { animation: fx-jump .7s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes fx-jump { 40% { transform: translateY(-16px) rotate(-3deg); } 70% { transform: translateY(2px); } }
.fx-smoke { position: absolute; inset: auto 0 6% 0; height: 30%; pointer-events: none; }
.fx-smoke i { position: absolute; bottom: 0; width: 34px; height: 34px; border-radius: 50%; background: rgba(234, 243, 255, .5); opacity: 0; }
.fx-member:hover .fx-smoke i { animation: fx-puff .8s ease-out; }
.fx-smoke i:nth-child(1) { left: 12%; } .fx-smoke i:nth-child(2) { left: 40%; animation-delay: .05s !important; } .fx-smoke i:nth-child(3) { left: 66%; animation-delay: .1s !important; }
@keyframes fx-puff { 0% { opacity: .7; transform: scale(.3); } 100% { opacity: 0; transform: translateY(-30px) scale(2.2); } }
@media (max-width: 991.98px) { .tpe-teamcards .fx-team { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 479.98px) { .tpe-teamcards .fx-team { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- персонажът (нинджа, SVG) */
.fx-mascot { width: 100%; height: 100%; overflow: visible; }
.fx-mascot .head { animation: fx-bob 3.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.fx-mascot .eyes { animation: fx-blink 4.2s infinite; transform-box: fill-box; transform-origin: 50% 50%; }
.fx-mascot .look { transition: transform .15s ease-out; }
.fx-mascot .glint { stroke-dasharray: 14 200; animation: fx-glint 3.6s ease-in-out infinite; }
.fx-mascot .prop { animation: fx-bob 2.8s ease-in-out infinite; transform-box: fill-box; }
@keyframes fx-bob { 50% { transform: translateY(-4px) rotate(-1deg); } }
@keyframes fx-blink { 0%, 90%, 100% { transform: scaleY(1); } 93% { transform: scaleY(.08); } }
@keyframes fx-glint { 0%, 60% { stroke-dashoffset: 200; } 100% { stroke-dashoffset: -40; } }

/* ---------------------------------------------------------------- стъпки: времева линия */
.tpe-steps.is-timeline .tpe-grid { position: relative; display: grid; grid-template-columns: 1fr; gap: 1rem; padding-left: 2.5rem; }
.tpe-steps.is-timeline .tpe-grid::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: color-mix(in srgb, currentColor 12%, transparent); }
.tpe-steps.is-timeline .fx-fill { position: absolute; left: 11px; top: 6px; width: 2px; height: var(--p, 0%); background: linear-gradient(#3ef0ff, var(--tpe-accent), #8b5cff); }
.tpe-steps.is-timeline .tpe-step { position: relative; display: block; padding: 1.4rem 1.6rem; border-radius: 22px; background: color-mix(in srgb, currentColor 5%, transparent); border: 1px solid color-mix(in srgb, currentColor 12%, transparent); }
.tpe-steps.is-timeline .tpe-step::before { content: ""; position: absolute; left: -2.25rem; top: 1.7rem; width: 16px; height: 16px; border-radius: 50%; background: var(--bs-body-bg, #fff); border: 2px solid #3ef0ff; }
.tpe-steps.is-timeline .tpe-step-num { position: static; display: inline-block; width: auto; height: auto; background: none; color: var(--tpe-accent); font-weight: 800; margin-bottom: .3rem; box-shadow: none; }
.tpe-steps.is-timeline .tpe-step h3 { margin: 0 0 .3rem; font-size: 1.2rem; }
.tpe-steps.is-timeline .tpe-step p { margin: 0; opacity: .72; }

/* ---------------------------------------------------------------- ефекти на сайта */
.fx-glow { position: fixed; left: -260px; top: -260px; width: 520px; height: 520px; border-radius: 50%; pointer-events: none; z-index: 1; background: radial-gradient(circle, color-mix(in srgb, var(--fx-glow, #5fabff) 13%, transparent), transparent 65%); will-change: transform; }
.fx-intro { position: fixed; inset: 0; z-index: 2000; pointer-events: none; display: none; }
.fx-intro.is-on { display: block; }
.fx-intro .half { position: absolute; left: -5%; right: -5%; height: 51%; background: var(--fx-intro-bg, #020c18); transition: transform .9s cubic-bezier(.8, 0, .2, 1); }
.fx-intro .top { top: 0; } .fx-intro .bot { bottom: 0; }
.fx-intro .cut { position: absolute; top: 50%; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, transparent, #fff, #3ef0ff); box-shadow: 0 0 30px #3ef0ff, 0 0 60px #0a7cff; transform: rotate(-3deg); transition: width .45s cubic-bezier(.7, 0, .3, 1); }
.fx-intro img { position: absolute; left: 50%; top: 50%; width: min(240px, 50vw); transform: translate(-50%, -50%); transition: opacity .3s; }
.fx-intro.slash .cut { width: 110%; }
.fx-intro.open .top { transform: translateY(-102%) rotate(-3deg); } .fx-intro.open .bot { transform: translateY(102%) rotate(-3deg); }
.fx-intro.open .cut, .fx-intro.open img { opacity: 0; transition: opacity .2s; }
.fx-star { position: fixed; z-index: 1900; width: 26px; height: 26px; pointer-events: none; margin: -13px 0 0 -13px; animation: fx-throw .7s cubic-bezier(.2, .7, .3, 1) forwards; }
.fx-spark { position: fixed; z-index: 1900; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; pointer-events: none; background: var(--fx-c, #3ef0ff); animation: fx-throw .6s ease-out forwards; }
@keyframes fx-throw { to { transform: translate(var(--dx), var(--dy)) rotate(720deg); opacity: 0; } }
.fx-peek { position: fixed; left: 0; bottom: 18%; z-index: 1040; width: 110px; height: 110px; transform: translateX(-100%) rotate(12deg); transition: transform .5s cubic-bezier(.3, 1.5, .5, 1); text-decoration: none !important; }
.fx-peek.is-on { transform: translateX(-38%) rotate(12deg); }
.fx-peek img { width: 100%; height: 100%; object-fit: contain; }
.fx-peek .fx-say { position: absolute; left: 92px; top: 6px; width: max-content; max-width: 230px; background: #fff; color: #021a2e; font-weight: 600; font-size: 14px; padding: 10px 14px; border-radius: 16px 16px 16px 4px; transform: rotate(-12deg); opacity: 0; transition: opacity .3s .3s; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.fx-peek.is-on .fx-say { opacity: 1; }
@media (hover: none) { .fx-peek, .fx-glow { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .tpe-fx *, .tpe-fx *::before, .fx-mascot * { animation: none !important; transition: none !important; }
  .fx-intro, .fx-peek, .fx-glow { display: none !important; }
}
