/* ==========================================================================
   След фокуса на внутренних страницах (эксперимент)

   ROLLBACK:
   - убрать <link> и <script> из inner.html
   - убрать <aside data-focus-trail>
   - удалить этот файл и focus-trail.js
   ========================================================================== */

@media (min-width: 1000px) {
  body.gf-inner .gf-page__layout {
    grid-template-columns: minmax(0, 1fr) 5.75rem;
    column-gap: 1.25rem;
    align-items: start;
  }
}

.gf-focus-trail {
  display: none;
}

@media (min-width: 1000px) {
  .gf-focus-trail {
    display: block;
    position: sticky;
    top: calc(var(--gf-header-h, 3.75rem) + 1.75rem);
    height: calc(100svh - var(--gf-header-h, 3.75rem) - 3.5rem);
    width: 100%;
    pointer-events: none;
    user-select: none;
  }
}

.gf-focus-trail__rail {
  position: relative;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  cursor: pointer;
  touch-action: none;
}

.gf-focus-trail__track {
  position: absolute;
  top: 1.1rem;
  bottom: 1.1rem;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(77, 182, 165, 0.22) 8%,
    rgba(77, 182, 165, 0.35) 50%,
    rgba(77, 182, 165, 0.22) 92%,
    transparent 100%
  );
}

.gf-focus-trail__track-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(
    180deg,
    rgba(111, 208, 191, 0.2),
    rgba(111, 208, 191, 0.75)
  );
  transform-origin: top center;
}

.gf-focus-trail__marks {
  position: absolute;
  inset: 1.1rem 0;
  left: 50%;
  width: 0;
}

.gf-focus-trail__mark {
  position: absolute;
  left: 0;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: rgba(154, 163, 173, 0.45);
  transform: translateY(-50%);
  transition: background 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.gf-focus-trail__mark.is-passed {
  background: rgba(111, 208, 191, 0.85);
  box-shadow: 0 0 0 3px rgba(77, 182, 165, 0.14);
}

.gf-focus-trail__mark.is-near {
  background: rgba(143, 221, 208, 1);
  transform: translateY(-50%) scale(1.4);
  box-shadow: 0 0 0 5px rgba(77, 182, 165, 0.22);
}

.gf-focus-trail__focus {
  --gf-focus-open: 0.35;
  position: absolute;
  top: 0;
  left: 50%;
  width: 2.65rem;
  height: 2.65rem;
  margin-left: -1.325rem;
  transform: translate3d(0, 0, 0);
  will-change: transform;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.4));
  cursor: grab;
  touch-action: none;
}

.gf-focus-trail.is-dragging {
  cursor: grabbing;
}

.gf-focus-trail.is-dragging .gf-focus-trail__focus {
  cursor: grabbing;
}

.gf-focus-trail__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(143, 221, 208, 0.65);
  box-shadow:
    0 0 0 3px rgba(77, 182, 165, 0.12),
    inset 0 0 18px rgba(77, 182, 165, 0.12);
  background: rgba(10, 13, 18, 0.55);
}

.gf-focus-trail__aperture {
  position: absolute;
  inset: 11%;
  display: grid;
  place-items: center;
}

.gf-focus-trail__aperture svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 50%;
}

.gf-focus-trail__hole {
  fill: url(#gf-focus-hole-grad);
  opacity: 0.95;
}

.gf-focus-trail__reticle {
  opacity: calc(0.12 + var(--gf-focus-open) * 0.88);
  transition: opacity 120ms ease;
}

.gf-focus-trail__reticle-ring {
  fill: none;
  stroke: rgba(232, 244, 240, 0.92);
  stroke-width: 1.35;
}

.gf-focus-trail__reticle-dot {
  fill: rgba(160, 230, 215, 0.95);
}

.gf-focus-trail__reticle-cross {
  stroke: rgba(232, 244, 240, 0.88);
  stroke-width: 1.2;
  stroke-linecap: round;
}

.gf-focus-trail.is-breathing .gf-focus-trail__reticle {
  animation: gf-reticle-pulse 1.1s var(--gf-ease, ease) 1;
}

.gf-focus-trail__blade {
  fill: url(#gf-focus-blade-grad);
  stroke: rgba(210, 222, 230, 0.4);
  stroke-width: 0.9;
}

.gf-focus-trail__caption {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 0.1rem 0.32rem;
  border-radius: 999px;
  background: rgba(10, 13, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(210, 220, 228, 0.95);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 220ms ease,
    transform 260ms var(--gf-ease, ease),
    visibility 220ms;
}

/* Подпись только когда «в фокусе» у секции / цитаты */
.gf-focus-trail.is-in-focus .gf-focus-trail__caption {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.gf-focus-trail.is-breathing .gf-focus-trail__ring {
  animation: gf-focus-breath 1.1s var(--gf-ease, ease) 1;
}

@keyframes gf-focus-breath {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 3px rgba(77, 182, 165, 0.12),
      inset 0 0 18px rgba(77, 182, 165, 0.12);
  }
  45% {
    transform: scale(1.07);
    box-shadow:
      0 0 0 6px rgba(77, 182, 165, 0.2),
      inset 0 0 22px rgba(77, 182, 165, 0.22);
  }
}

@keyframes gf-reticle-pulse {
  0%,
  100% {
    opacity: calc(0.15 + var(--gf-focus-open) * 0.85);
  }
  45% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gf-focus-trail__focus {
    transition: none;
  }

  .gf-focus-trail.is-breathing .gf-focus-trail__ring,
  .gf-focus-trail.is-breathing .gf-focus-trail__reticle {
    animation: none;
  }
}
