/* ============================================
   Aurora — scroll reveal, motion, modern polish
   Loaded last; overrides earlier section styles.
   ============================================ */

html { scroll-behavior: smooth; }

/* ── Ambient color field — gives glass something to refract everywhere ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(50% 40% at 12% 8%, rgba(0,87,184,0.14), transparent 60%),
    radial-gradient(46% 42% at 88% 22%, rgba(0,87,184,0.10), transparent 60%),
    radial-gradient(55% 45% at 70% 92%, rgba(61,125,216,0.10), transparent 62%),
    radial-gradient(45% 40% at 20% 85%, rgba(255,213,0,0.06), transparent 60%);
}
[data-theme="light"] body::before {
  background:
    radial-gradient(50% 40% at 12% 8%, rgba(0,87,184,0.08), transparent 60%),
    radial-gradient(46% 42% at 88% 22%, rgba(0,87,184,0.06), transparent 60%),
    radial-gradient(55% 45% at 70% 92%, rgba(61,125,216,0.08), transparent 62%),
    radial-gradient(45% 40% at 20% 85%, rgba(255,213,0,0.07), transparent 60%);
}
.page-wrapper { position: relative; z-index: 1; }

::selection {
  background: var(--color-accent-violet);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--color-accent-cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Scroll reveal ── */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition:
    opacity .8s cubic-bezier(.16,1,.3,1),
    transform .8s cubic-bezier(.16,1,.3,1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal="left"]  { transform: translate3d(-28px, 0, 0); }
[data-reveal="right"] { transform: translate3d(28px, 0, 0); }
[data-reveal="scale"] { transform: scale(.98); }
[data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* ── Section titles — gradient underline ── */
.section-title {
  position: relative;
  font-family: var(--font-family-head);
  font-size: clamp(28px, 3.4vw, var(--font-size-3xl));
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--color-text-primary);
}
/* dashed road-marking underline */
.section-title::after {
  content: '';
  display: block;
  margin-top: 14px;
  width: 0;
  height: 4px;
  background: repeating-linear-gradient(90deg,
    var(--color-brand-yellow) 0 14px,
    transparent 14px 24px);
  transition: width .8s cubic-bezier(.22,.61,.36,1) .15s;
}
.section-title.is-visible::after,
.is-visible .section-title::after { width: 86px; }
[data-theme="light"] .section-title::after {
  background: repeating-linear-gradient(90deg,
    var(--color-accent-blue) 0 14px,
    transparent 14px 24px);
}

.text-gradient {
  background: var(--grad-brand);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ── Stats — gradient numerals + count-up ── */
.stat-card .stat-value {
  background: linear-gradient(120deg, var(--color-text-primary), var(--color-accent-cyan));
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat-plus { color: var(--color-signal); -webkit-text-fill-color: var(--color-signal); }

/* ── Card motion: lift + glow + cursor spotlight ── */
.stat-card,
.priority-card,
.news-card-large,
.news-card-small,
.feature-banner-card,
.partner-card {
  transition:
    transform .4s cubic-bezier(.22,.61,.36,1),
    box-shadow .4s ease,
    border-color .4s ease;
}
/* Unify all cards onto translucent glass tokens (override hardcoded opaque bg) */
.stat-card,
.priority-card,
.news-card-large,
.news-card-small {
  background-color: var(--glass-bg) !important;
  border-color: var(--glass-border);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
}
/* cursor spotlight tint (separate property; survives bg-color above) */
.stat-card,
.priority-card,
.news-card-large,
.news-card-small {
  background-image: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 50%),
    rgba(0, 87, 184, 0.16),
    transparent 60%
  );
}
[data-theme="light"] .stat-card,
[data-theme="light"] .priority-card,
[data-theme="light"] .news-card-large,
[data-theme="light"] .news-card-small {
  background-image: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 50%),
    rgba(0, 87, 184, 0.05),
    transparent 60%
  );
}
.stat-card:hover,
.priority-card:hover,
.news-card-large:hover,
.news-card-small:hover,
.feature-banner-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-border-interactive);
  box-shadow: 0 12px 34px rgba(0, 87, 184, 0.14);
}
.partner-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 10px 26px rgba(0, 87, 184, 0.12);
}

/* ── Buttons — signage yellow ── */
.btn-primary {
  position: relative;
  background: var(--color-brand-yellow) !important;
  color: #14181D !important;
  border: none;
  box-shadow: 0 8px 24px rgba(255, 213, 0, 0.22);
  transition: transform .3s ease, box-shadow .3s ease, filter .3s ease;
}
.btn-primary:hover {
  background: var(--color-brand-yellow-hover) !important;
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(255, 213, 0, 0.32) !important;
}
.btn-primary .arrow { transition: transform .3s ease; display: inline-block; }
.btn-primary:hover .arrow { transform: translateX(5px); }

/* ── Nav link accent ── */
.nav-link { transition: color var(--transition-fast); }

/* ============================================
   Page spine — one continuous route line from
   the hero to the last section, drawn by scroll
   (path built and scrubbed in reveal.js)
   ============================================ */
.page-spine {
  --spine-asphalt: #1B222B;
  --spine-edge: rgba(255, 255, 255, 0.4);
  --spine-dash: rgba(255, 255, 255, 0.72);
  position: absolute;
  inset: 0;
  /* Above section backgrounds (positioned .section-bg = z-index auto), but below
     content: each section's .container is z-index:1 and later in the DOM, so it
     still paints over the road. */
  z-index: 1;
  pointer-events: none;
}
[data-theme="light"] .page-spine {
  --spine-asphalt: #6E7987;
  --spine-edge: rgba(255, 255, 255, 0.9);
  --spine-dash: rgba(255, 255, 255, 0.95);
}
.page-spine svg { display: block; }
.page-spine path { fill: none; }
.spine-asphalt { stroke: var(--spine-asphalt); stroke-width: 18; }
.spine-edge    { stroke: var(--spine-edge);    stroke-width: 13; }
.spine-inner   { stroke: var(--spine-asphalt); stroke-width: 9.5; }
.spine-dash    { stroke: var(--spine-dash);    stroke-width: 2.2; stroke-dasharray: 13 10; }
.spine-car { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45)); }
.spine-end {
  fill: var(--spine-asphalt);
  stroke: var(--spine-edge);
  stroke-width: 3;
}

@media (max-width: 1359px) {
  .page-spine { display: none; }
}

/* extra vertical air so the road crossings never touch content */
.partners { padding-top: 56px; padding-bottom: 72px; }
.about-text-section { padding-top: 96px; padding-bottom: 96px; }
.priorities { padding-bottom: 96px; }
.feature-banner { padding-top: 96px; padding-bottom: 96px; }
.news { padding-top: 96px; }

/* ============================================
   Page rail — fixed section dots on the right
   edge; active dot follows scroll (reveal.js)
   ============================================ */
.page-rail {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.rail-dot {
  position: relative;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.rail-dot::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--color-text-secondary);
  background: transparent;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.rail-dot:hover::before {
  border-color: var(--color-brand-yellow);
  transform: scale(1.25);
}
.rail-dot.active::before {
  background: var(--color-brand-yellow);
  border-color: var(--color-brand-yellow);
  box-shadow: 0 0 10px 1px rgba(255, 213, 0, 0.5);
  transform: scale(1.15);
}
.rail-dot .rail-tick {
  position: absolute;
  top: 100%;
  width: 1.5px;
  height: 6px;
  background: var(--color-text-tertiary);
}
.rail-dot:last-child .rail-tick { display: none; }

@media (max-width: 1100px) {
  .page-rail { display: none; }
}

/* ============================================
   У цифрах — editorial split: intro left,
   hairline stat board right
   ============================================ */
.stats-split { padding-bottom: var(--space-xl); }
.stats-split .container {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(36px, 6vw, 96px);
  align-items: start;
}
.stats-intro { display: flex; flex-direction: column; gap: var(--space-lg); }
.stats-intro .stats-desc {
  font-size: var(--font-size-base-px);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-secondary);
  max-width: 42ch;
  margin: 0;
}

/* bracket-cornered link */
.bracket-link {
  position: relative;
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 10px;
  margin-top: var(--space-sm);
  padding: 12px 22px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.bracket-link::before,
.bracket-link::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  transition: all var(--transition-base);
}
.bracket-link::before {
  top: 0;
  left: 0;
  border-top: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
}
.bracket-link::after {
  bottom: 0;
  right: 0;
  border-bottom: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
}
.bracket-link:hover { color: var(--color-accent-blue); }
.bracket-link:hover::before,
.bracket-link:hover::after { width: 100%; height: 100%; }

/* hairline stat board */
.stats-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--color-border-strong);
}
.stats-cell {
  padding: clamp(28px, 3.4vw, 52px) clamp(24px, 3vw, 44px);
}
.stats-cell:nth-child(2n) { border-left: 1px solid var(--color-border-strong); }
.stats-cell:nth-child(n+3) { border-top: 1px solid var(--color-border-strong); }
.stats-cell .stat-value {
  font-family: var(--font-family-head);
  font-size: clamp(44px, 5vw, 76px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
}
.stats-cell .stat-plus { color: var(--color-brand-yellow); }
.stats-cell .stat-label {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

@media (max-width: 900px) {
  .stats-split { padding-bottom: var(--space-xl); }
  .stats-split .container { grid-template-columns: 1fr; gap: 32px; }
  .stats-cell { padding: 22px 20px; }
}

/* ============================================
   е-ТТН panel — glass card like the rest,
   yellow road-marking accent edge
   ============================================ */
.feature-banner-card,
[data-theme="light"] .feature-banner-card {
  position: relative;
  overflow: hidden;
  padding: clamp(36px, 5vw, 64px) clamp(28px, 4.5vw, 60px);
  border-radius: var(--radius-xl);
  background-color: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--color-brand-yellow);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  box-shadow: var(--glass-shadow), var(--glass-inner-shadow);
}
.feature-banner-title {
  position: relative;
  z-index: 1;
  color: var(--color-text-primary);
  font-size: clamp(28px, 3.2vw, 42px);
  letter-spacing: -0.02em;
}
.feature-banner-desc {
  position: relative;
  z-index: 1;
  color: var(--color-text-secondary);
  font-size: var(--font-size-base-px);
  max-width: 56ch;
}
.feature-banner-card .btn-primary {
  position: relative;
  z-index: 1;
}


/* ── Light theme: yellow accents → sign-blue (contrast on concrete) ── */
[data-theme="light"] .stat-plus,
[data-theme="light"] .stats-cell .stat-plus {
  color: var(--color-accent-blue);
  -webkit-text-fill-color: var(--color-accent-blue);
}
[data-theme="light"] .feature-banner-card { border-left-color: var(--color-accent-blue); }
[data-theme="light"] .spine-car rect:first-child { fill: #2F6FD0; }
[data-theme="light"] .rail-dot:hover::before { border-color: var(--color-accent-blue); }
[data-theme="light"] .rail-dot.active::before {
  background: var(--color-accent-blue);
  border-color: var(--color-accent-blue);
  box-shadow: 0 0 10px 1px rgba(0, 87, 184, 0.4);
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none; }
  .section-title::after { transition: none; width: 76px; }
  .rail-dot::before { transition: none; }
  .bracket-link::before, .bracket-link::after { transition: none; }
  .stat-card, .priority-card, .news-card-large, .news-card-small,
  .feature-banner-card, .partner-card, .btn-primary { transition: none; }
}
