/* =====================================================
   QRENNT — FX LAYER (общий для всех страниц)
   Шрифты, заставка запуска, объекты hero, эффекты.
   Подключается ПОСЛЕ style.css / about.css / ... и symbols.css
   ===================================================== */

:root {
  --fx-green: #70e6a0;
  --fx-bright: #a0ffc1;
  --fx-bg: #050907;
  --fx-ease: cubic-bezier(.2, .75, .1, 1);

  /* Onest и JetBrains Mono поддерживают кириллицу (Space Grotesk — нет) */
  --fx-sans: "Onest", "Helvetica Neue", Arial, system-ui, sans-serif;
  --fx-display: "Unbounded", "Onest", system-ui, sans-serif;
  --fx-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* переопределяем переменные шрифтов всех страниц */
  --font-main: var(--fx-sans);
  --font-display: var(--fx-sans);
  --body: var(--fx-sans);
  --display: var(--fx-sans);
  --font: var(--fx-sans);
}

html, body { overflow-x: clip; }

body { font-family: var(--fx-sans); }

h1, h2, h3 { font-weight: 800; }

.hero h1 {
  letter-spacing: -.045em;
  font-weight: 800;
  line-height: .92;
  font-size: clamp(54px, 8vw, 112px);
}

/* моно-подписи */
.section-label,
.hero-topline,
.floating-word,
.button-hint,
.review-status,
.service-index,
.hero-bottom-info {
  font-family: var(--fx-mono);
  letter-spacing: .14em;
}

.logo { font-weight: 800; letter-spacing: -.02em; }

/* ============ ГЛОБАЛЬНЫЕ СЛОИ ============ */

.fx-grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 9000;
  pointer-events: none;
  opacity: .07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: fxGrain 1.2s steps(6) infinite;
}

.fx-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 9100;
  pointer-events: none;
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
  background: linear-gradient(90deg, #1ea35d, var(--fx-bright));
  box-shadow: 0 0 12px rgba(112, 230, 160, .7);
}

.fx-glow,
.fx-ring { display: none; }

@media (hover: hover) and (pointer: fine) {
  .fx-glow {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    width: 560px;
    height: 560px;
    margin: -280px 0 0 -280px;
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(60, 220, 130, .10), transparent 62%);
    will-change: transform;
  }

  .fx-ring {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    z-index: 9500;
    pointer-events: none;
    border: 1px solid rgba(160, 255, 193, .6);
    border-radius: 50%;
    opacity: 0;
    transition: opacity .3s, width .3s var(--fx-ease), height .3s var(--fx-ease),
                margin .3s var(--fx-ease), background .3s, border-color .3s;
    will-change: transform;
  }

  .fx-ring.is-on { opacity: 1; }

  .fx-ring.is-hover {
    width: 62px;
    height: 62px;
    margin: -31px 0 0 -31px;
    background: rgba(112, 230, 160, .10);
    border-color: rgba(160, 255, 193, .9);
  }
}

/* переход между страницами */
.fx-curtain {
  position: fixed;
  inset: 0;
  z-index: 9800;
  background: var(--fx-bg);
  transform: translateY(100%);
  pointer-events: none;
  visibility: hidden;
}

.fx-curtain.is-cover { transform: none; visibility: visible; }
.fx-curtain.is-in { transform: none; visibility: visible; pointer-events: all; transition: transform .5s var(--fx-ease); }
.fx-curtain.is-leave { transform: translateY(-100%); visibility: visible; transition: transform .7s var(--fx-ease); }

/* подсветка карточек за курсором */
.fx-spot-layer {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s;
  background: radial-gradient(380px circle at var(--sx, 50%) var(--sy, 50%), rgba(112, 230, 160, .13), transparent 55%);
  z-index: 3;
}

.fx-spot:hover > .fx-spot-layer { opacity: 1; }

/* магнитные кнопки */
.fx-mag {
  translate: var(--mx, 0px) var(--my, 0px);
  transition: translate .35s var(--fx-ease);
}

/* ============ ЗАСТАВКА ЗАПУСКА ============ */

.launch {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #eaf6ee;
  font-family: var(--fx-sans);
  animation: fxLaunchFail .01s 7.5s forwards;
}

html.fx-skip-launch .launch { display: none; }
html.fx-launching { overflow: hidden; }

.launch-panel {
  position: absolute;
  left: 0;
  right: 0;
  height: 50.5%;
  background: var(--fx-bg);
  transition: transform 1s var(--fx-ease);
}

.launch-panel--top { top: 0; }
.launch-panel--bottom { bottom: 0; }
.launch.is-open .launch-panel--top { transform: translateY(-101%); }
.launch.is-open .launch-panel--bottom { transform: translateY(101%); }

.launch-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(48% 42% at 50% 50%, rgba(40, 180, 105, .24), transparent 70%),
    linear-gradient(rgba(160, 255, 193, .05) 1px, transparent 1px) 0 0 / 100% 56px,
    linear-gradient(90deg, rgba(160, 255, 193, .05) 1px, transparent 1px) 0 0 / 56px 100%;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 50%, #000 30%, transparent 80%);
  mask-image: radial-gradient(70% 70% at 50% 50%, #000 30%, transparent 80%);
  transition: opacity .5s;
}

.launch.is-done .launch-glow { opacity: 0; }

.launch-core {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 26px;
  transition: opacity .5s, transform .7s var(--fx-ease);
}

.launch.is-done .launch-core { opacity: 0; transform: scale(1.06); }

.launch-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(80vw, 400px);
  aspect-ratio: 1;
  margin: calc(min(80vw, 400px) / -2) 0 0 calc(min(80vw, 400px) / -2);
  animation: fxSpin 18s linear infinite;
  opacity: .8;
}

.launch-ring svg { width: 100%; height: 100%; display: block; overflow: visible; }

.launch-ring text {
  fill: rgba(160, 255, 193, .55);
  font: 500 9.5px var(--fx-mono);
  letter-spacing: .32em;
}

.launch-word {
  position: relative;
  display: flex;
  overflow: hidden;
  padding: .1em .04em;
  font-family: var(--fx-display);
  font-weight: 700;
  font-size: clamp(30px, 8vw, 76px);
  letter-spacing: -.02em;
  line-height: 1;
}

.launch-word span {
  display: inline-block;
  opacity: 0;
  transform: translateY(110%);
  animation: fxLetter .9s var(--fx-ease) forwards;
  animation-delay: calc(var(--i) * .07s + .15s);
}

.launch-word span:first-child { color: var(--fx-green); }

.launch-meta {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font: 500 10px var(--fx-mono);
  letter-spacing: .24em;
  color: #7f9588;
}

.launch-meta b { min-width: 3.4ch; color: var(--fx-bright); font-weight: 600; text-align: right; }

.launch-bar {
  width: min(58vw, 260px);
  height: 2px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(160, 255, 193, .15);
}

.launch-bar i {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
  background: linear-gradient(90deg, #1ea35d, var(--fx-bright));
  box-shadow: 0 0 10px rgba(112, 230, 160, .8);
}

.launch-corner {
  position: absolute;
  z-index: 2;
  font: 500 9px var(--fx-mono);
  letter-spacing: .22em;
  color: rgba(160, 255, 193, .45);
  transition: opacity .4s;
}

.launch-corner.tl { top: 24px; left: 24px; }
.launch-corner.tr { top: 24px; right: 24px; }
.launch-corner.bl { bottom: 24px; left: 24px; }

.launch-skip {
  position: absolute;
  z-index: 3;
  right: 24px;
  bottom: 20px;
  padding: 8px 14px;
  border: 1px solid rgba(160, 255, 193, .25);
  border-radius: 20px;
  background: transparent;
  color: rgba(160, 255, 193, .75);
  font: 500 9px var(--fx-mono);
  letter-spacing: .22em;
  cursor: pointer;
  transition: opacity .4s, background .3s;
}

.launch-skip:hover { background: rgba(112, 230, 160, .12); }
.launch.is-done .launch-corner,
.launch.is-done .launch-skip { opacity: 0; pointer-events: none; }

/* ============ ВХОД КОНТЕНТА HERO ============ */

html.fx-launching .hero-content > *,
html.fx-launching .hero-visual,
html.fx-launching .site-header { opacity: 0; }

.fx-ready .site-header { animation: fxFade .9s .15s both; }
.fx-ready .hero-topline { animation: fxRise .9s var(--fx-ease) .10s both; }
.fx-ready .hero h1 > span { display: inline-block; animation: fxRise 1.1s var(--fx-ease) .22s both; }
.fx-ready .hero h1 > span + br + span { animation-delay: .36s; }
.fx-ready .hero-description { animation: fxRise 1s var(--fx-ease) .55s both; }
.fx-ready .hero-project-action { animation: fxRise 1s var(--fx-ease) .7s both; }
.fx-ready .hero-bottom-info { animation: fxFade 1s .95s both; }
.fx-ready .hero-visual { animation: fxScaleIn 1.5s var(--fx-ease) .2s both; }

/* ============ ОБЪЕКТЫ HERO ============ */

.fx-obj {
  position: absolute;
  z-index: 3;
  will-change: translate;
}

.fx-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border: 1px solid rgba(160, 255, 193, .22);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .07), rgba(112, 230, 160, .04));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .12);
  color: #d4ecdc;
  font: 600 9.5px var(--fx-mono);
  letter-spacing: .14em;
  white-space: nowrap;
  animation: fxFloat 7s ease-in-out infinite;
}

.fx-chip b { color: var(--fx-bright); font-weight: 700; }
.fx-chip strong { font: 700 22px var(--fx-display); letter-spacing: -.02em; color: var(--fx-bright); }

.fx-chip .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fx-green);
  box-shadow: 0 0 0 0 rgba(112, 230, 160, .6), 0 0 14px var(--fx-green);
  animation: fxPulse 2s infinite;
}

.chip-status { left: 49%; top: 17%; }
.chip-code { left: 44%; bottom: 25%; animation-delay: -2.4s; }
.chip-stat { right: 3%; top: 63%; animation-delay: -4.6s; }
.chip-code b { font-size: 13px; }

/* 3D-куб */
.fx-cube-wrap { left: 41%; top: 57%; perspective: 700px; }

.fx-cube {
  --s: 62px;
  position: relative;
  width: var(--s);
  height: var(--s);
  transform-style: preserve-3d;
  animation: fxCube 16s linear infinite;
}

.fx-cube i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(160, 255, 193, .6);
  background: linear-gradient(135deg, rgba(112, 230, 160, .22), rgba(112, 230, 160, .02));
  box-shadow: inset 0 0 18px rgba(112, 230, 160, .18);
}

.fx-cube i:nth-child(1) { transform: translateZ(calc(var(--s) / 2)); }
.fx-cube i:nth-child(2) { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.fx-cube i:nth-child(3) { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.fx-cube i:nth-child(4) { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.fx-cube i:nth-child(5) { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.fx-cube i:nth-child(6) { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }

/* пирамидка-ромб и кольца */
.fx-diamond {
  right: 21%;
  top: 11%;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(160, 255, 193, .55);
  background: linear-gradient(135deg, rgba(112, 230, 160, .2), transparent);
  transform: rotate(45deg);
  animation: fxFloat2 9s ease-in-out infinite;
}

.fx-halo {
  right: 0;
  bottom: 6%;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  border: 1px dashed rgba(160, 255, 193, .25);
  animation: fxSpin 40s linear infinite reverse;
}

.fx-halo::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fx-bright);
  box-shadow: 0 0 14px var(--fx-bright);
}

.fx-spark {
  color: var(--fx-bright);
  font-size: 20px;
  filter: drop-shadow(0 0 8px rgba(160, 255, 193, .7));
  animation: fxTwinkle 3.4s ease-in-out infinite;
}

.spark-a { left: 62%; top: 9%; }
.spark-b { left: 40%; top: 40%; font-size: 13px; animation-delay: -1.2s; }
.spark-c { right: 6%; top: 38%; font-size: 15px; animation-delay: -2.2s; }

/* вращающийся круговой бейдж */
.fx-badge {
  position: absolute;
  z-index: 6;
  right: 5vw;
  bottom: 7%;
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(8, 16, 12, .7);
  border: 1px solid rgba(160, 255, 193, .25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--fx-bright);
  pointer-events: auto;
  transition: transform .4s var(--fx-ease), background .3s;
}

.fx-badge:hover { transform: scale(1.08); background: rgba(40, 140, 85, .35); }

.fx-badge svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: fxSpin 16s linear infinite;
}

.fx-badge text {
  fill: rgba(200, 255, 220, .9);
  font: 600 8.6px var(--fx-mono);
  letter-spacing: .2em;
}

.fx-badge .sym { font-size: 22px; }

/* ============ СТАТИСТИКА ============ */

.fx-stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 9vw;
  border: 1px solid var(--line, rgba(180, 220, 195, .13));
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .04), rgba(112, 230, 160, .02));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}

.fx-stat {
  position: relative;
  padding: 34px 28px 30px;
  display: grid;
  gap: 10px;
}

.fx-stat + .fx-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 1px;
  background: var(--line, rgba(180, 220, 195, .13));
}

.fx-num {
  font-family: var(--fx-display);
  font-weight: 600;
  font-size: clamp(30px, 4.2vw, 58px);
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--fx-bright);
  text-shadow: 0 0 30px rgba(112, 230, 160, .35);
}

.fx-stat span {
  color: #8da094;
  font: 500 10px var(--fx-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1.7;
}

/* ============ КОНТУРНАЯ БЕГУЩАЯ СТРОКА ============ */

.fx-outline {
  position: relative;
  z-index: 2;
  margin: 70px 0 10px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.fx-outline-track {
  display: flex;
  width: max-content;
  animation: fxMarqueeRev 38s linear infinite;
}

.fx-outline-group {
  display: flex;
  align-items: center;
  gap: 38px;
  padding-right: 38px;
}

.fx-outline-group span {
  font-family: var(--fx-display);
  font-weight: 700;
  font-size: clamp(44px, 8vw, 120px);
  letter-spacing: -.02em;
  line-height: 1.1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(160, 255, 193, .35);
  white-space: nowrap;
}

.fx-outline-group span:nth-of-type(even) {
  color: rgba(112, 230, 160, .9);
  -webkit-text-stroke: 0;
}

.fx-outline-group i {
  color: var(--fx-green);
  font-size: clamp(26px, 4vw, 54px);
  font-style: normal;
  animation: fxSpin 12s linear infinite;
}

/* ============ ГИГАНТСКОЕ СЛОВО В ПОДВАЛЕ ============ */

.mega-word {
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding: 0 0 .06em;
  text-align: center;
  font-family: var(--fx-display);
  font-weight: 700;
  font-size: clamp(48px, 15.5vw, 260px);
  letter-spacing: -.04em;
  line-height: .95;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  color: transparent;
  background: linear-gradient(180deg, rgba(160, 255, 193, .55), rgba(40, 140, 85, .06) 78%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ============ ЛИНИЯ-АКЦЕНТ ЗАГОЛОВКОВ ============ */

.featured-heading h2,
.manifesto-section h2,
.about-me-section h2 { text-wrap: balance; }

/* ============ АНИМАЦИИ ============ */

@keyframes fxGrain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

@keyframes fxSpin { to { transform: rotate(360deg); } }

@keyframes fxLetter {
  from { opacity: 0; transform: translateY(110%); }
  to { opacity: 1; transform: none; }
}

@keyframes fxRise {
  from { opacity: 0; transform: translateY(38px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes fxFade { from { opacity: 0; } to { opacity: 1; } }

@keyframes fxScaleIn {
  from { opacity: 0; transform: scale(.86); }
  to { opacity: 1; transform: none; }
}

@keyframes fxFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes fxFloat2 {
  0%, 100% { transform: rotate(45deg) translate(0, 0); }
  50% { transform: rotate(60deg) translate(-8px, -16px); }
}

@keyframes fxPulse {
  0% { box-shadow: 0 0 0 0 rgba(112, 230, 160, .55), 0 0 14px var(--fx-green); }
  70% { box-shadow: 0 0 0 9px rgba(112, 230, 160, 0), 0 0 14px var(--fx-green); }
  100% { box-shadow: 0 0 0 0 rgba(112, 230, 160, 0), 0 0 14px var(--fx-green); }
}

@keyframes fxCube {
  from { transform: rotateX(-24deg) rotateY(0deg); }
  to { transform: rotateX(-24deg) rotateY(360deg); }
}

@keyframes fxTwinkle {
  0%, 100% { opacity: .35; transform: scale(.8) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(45deg); }
}

@keyframes fxMarqueeRev {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

@keyframes fxLaunchFail { to { opacity: 0; visibility: hidden; pointer-events: none; } }

/* ============ АДАПТИВ ============ */

@media (max-width: 1100px) {
  .chip-code, .fx-cube-wrap, .spark-b { display: none; }
  .chip-status { left: auto; right: 4%; top: 12%; }
  .chip-stat { right: 4%; top: 72%; }
}

@media (max-width: 900px) {
  .fx-stats { grid-template-columns: repeat(2, 1fr); margin: 0 7vw; }
  .fx-stat:nth-child(3)::before { display: none; }
  .fx-stat:nth-child(n + 3) { border-top: 1px solid var(--line, rgba(180, 220, 195, .13)); }
  .fx-badge { width: 96px; height: 96px; right: 6vw; bottom: 9%; }
  .fx-badge text { font-size: 7.4px; }
  .fx-halo { width: 130px; height: 130px; }
}

@media (max-width: 650px) {
  .fx-chip { padding: 8px 11px; font-size: 8px; border-radius: 11px; }
  .fx-chip strong { font-size: 16px; }
  .chip-status { right: 3%; top: 10%; }
  .chip-stat { display: none; }
  .fx-diamond { right: 12%; top: 22%; width: 32px; height: 32px; }
  .spark-a { left: 74%; top: 30%; }
  .fx-stat { padding: 24px 18px 22px; }
  .fx-outline { margin-top: 50px; }
  .launch-corner.tl, .launch-corner.tr { top: 16px; }
  .launch-corner.tl { left: 16px; }
  .launch-corner.tr { right: 16px; }
  .launch-corner.bl { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fx-grain, .fx-chip, .fx-cube, .fx-diamond, .fx-halo, .fx-spark,
  .fx-badge svg, .fx-outline-track, .fx-outline-group i, .launch-ring { animation: none !important; }

  .fx-ready .hero-topline,
  .fx-ready .hero h1 > span,
  .fx-ready .hero-description,
  .fx-ready .hero-project-action,
  .fx-ready .hero-bottom-info,
  .fx-ready .hero-visual,
  .fx-ready .site-header { animation: none !important; opacity: 1; }
}
