/* Brand visual layer — self-hosted Montserrat (exact face from brand screenshots) */
.theme-v2 {
  --v2-bg: #f3f4f7;
  --v2-ink: #121826;
  --v2-muted: #5c6170;
  --v2-accent: #e61d2e;
  --v2-navy: #1a2b5a;
  --v2-amber: #b8893d;
  --v2-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --v2-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --body: "Montserrat", "Arial Narrow", Arial, sans-serif;
  font-family: var(--body);
  font-optical-sizing: auto;
  font-size-adjust: from-font;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(230, 29, 46, 0.05), transparent 50%),
    radial-gradient(ellipse 70% 40% at 0% 20%, rgba(26, 43, 90, 0.06), transparent 45%),
    var(--v2-bg);
  color: var(--v2-ink);
}

/* Kill Roboto / Open Sans / system stacks from styles.css + styles-v2 */
.theme-v2,
.theme-v2 body,
.theme-v2 button,
.theme-v2 input,
.theme-v2 select,
.theme-v2 textarea,
.theme-v2 .btn,
.theme-v2 .section__title,
.theme-v2 .hero__title,
.theme-v2 .hero__subtitle,
.theme-v2 .hero__brand,
.theme-v2 .logo__text,
.theme-v2 .nav__link,
.theme-v2 .hotline__label,
.theme-v2 .hotline__number,
.theme-v2 h1,
.theme-v2 h2,
.theme-v2 h3,
.theme-v2 p,
.theme-v2 a,
.theme-v2 span,
.theme-v2 li {
  font-family: var(--body) !important;
}

/* Logo: lowercase ExtraBold geometric — matches brand mark */
.theme-v2 .logo__text {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  text-transform: lowercase;
  white-space: nowrap;
  color: var(--v2-ink);
}

/* Header: light bar over hero (readable nav, no clipped items) */
.theme-v2 .header {
  background: rgba(251, 251, 253, 0.94);
  border-bottom: 1px solid rgba(18, 24, 38, 0.08);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 1px 0 rgba(18, 24, 38, 0.03);
  transition:
    background 0.35s var(--v2-ease),
    border-color 0.35s var(--v2-ease),
    box-shadow 0.35s var(--v2-ease);
}

.theme-v2 .header.header--compact {
  background: rgba(251, 251, 253, 0.98);
  border-bottom-color: rgba(18, 24, 38, 0.1);
  box-shadow: 0 8px 28px rgba(18, 24, 38, 0.08);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

.theme-v2 .header .container {
  max-width: min(1320px, 100%);
  width: 100%;
  padding-inline: 0;
}

.theme-v2 .header__inner {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  column-gap: clamp(1.25rem, 2.2vw, 2.25rem);
  row-gap: 0.5rem;
  min-height: 56px;
  padding: 0.65rem clamp(1rem, 2.2vw, 1.5rem);
}

.theme-v2 .logo {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.55rem;
  position: relative;
  z-index: 2;
}

.theme-v2 .nav {
  min-width: 0;
  justify-self: stretch;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.theme-v2 .nav__list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: clamp(0.55rem, 1vw, 1rem);
  margin: 0;
  padding: 0;
  width: 100%;
}

.theme-v2 .nav__list > li {
  flex: 0 0 auto;
}

.theme-v2 .nav__link {
  font-family: var(--body);
  font-weight: 600;
  font-size: clamp(0.78rem, 0.72rem + 0.14vw, 0.88rem);
  line-height: 1.25;
  white-space: nowrap;
  color: var(--v2-muted);
  padding: 0.4rem 0.15rem;
  position: relative;
  display: inline-flex;
  align-items: center;
}

.theme-v2 .nav__link--active,
.theme-v2 .nav__link:hover {
  color: var(--v2-ink);
}

.theme-v2 .nav__link::after {
  left: 0.1rem;
  right: 0.1rem;
  width: auto;
  bottom: 0.05rem;
}

.theme-v2 .nav__item--portal {
  display: none;
}

.theme-v2 .nav__link--portal,
.theme-v2 .header__portal {
  margin-inline-start: 0;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  background: rgba(230, 29, 46, 0.08);
  border: 1px solid rgba(230, 29, 46, 0.28);
  color: var(--v2-accent);
}

.theme-v2 .nav__link--portal:hover,
.theme-v2 .header__portal:hover {
  background: rgba(230, 29, 46, 0.14);
  color: #c41028;
}

.theme-v2 .nav__link--portal::after,
.theme-v2 .header__portal::after {
  display: none;
}

.theme-v2 .header__contact {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
  margin-inline-start: 0;
}

.theme-v2 .header__contact .social--header {
  display: none;
}

.theme-v2 .hotline {
  text-align: right;
  line-height: 1.15;
}

.theme-v2 .hotline__label {
  font-weight: 500;
  font-size: 0.62rem;
  letter-spacing: 0.01em;
  color: var(--v2-muted);
}

/* Hotline digits: Black weight, brand red */
.theme-v2 .hotline__number {
  font-size: clamp(0.88rem, 0.8rem + 0.25vw, 1.05rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: var(--v2-accent);
}

.theme-v2 .hotline__number:hover {
  color: #c41028;
}

.theme-v2 .burger span {
  background: var(--v2-ink);
}

/* Hero — left-aligned brand block (reference screenshots) */
.theme-v2 .hero__shade {
  background:
    linear-gradient(180deg, rgba(8, 12, 22, 0.5) 0%, rgba(8, 12, 22, 0.28) 38%, rgba(8, 12, 22, 0.82) 100%),
    linear-gradient(90deg, rgba(8, 12, 22, 0.72) 0%, rgba(8, 12, 22, 0.35) 48%, rgba(8, 12, 22, 0.2) 100%);
}

/*
 * Decorative RU flag: true white / blue / red.
 * soft-light over the warm hero photo turned the white stripe yellow.
 */
.theme-v2 .hero__flag {
  display: block;
  z-index: 1;
  inset: 0;
  left: auto;
  width: min(46%, 560px);
  background:
    linear-gradient(
      180deg,
      #ffffff 0%,
      #ffffff 33.333%,
      #0039a6 33.333%,
      #0039a6 66.666%,
      #d52b1e 66.666%,
      #d52b1e 100%
    ) !important;
  opacity: calc(0.34 - var(--hero-progress, 0) * 0.18);
  transform: translateX(calc(var(--hero-progress, 0) * 28px));
  mix-blend-mode: normal;
  filter: none;
  mask-image: linear-gradient(to left, #000 42%, transparent 100%);
  -webkit-mask-image: linear-gradient(to left, #000 42%, transparent 100%);
}

/* About photo: keep white stripe of RU flag in frame (not sky-only crop) */
.theme-v2 .about__media img {
  object-position: 42% 40%;
}

.theme-v2 .hero__stage {
  justify-content: flex-end;
  align-items: stretch;
}

.theme-v2 .hero__inner {
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 100%;
  padding: calc(var(--v2-header-h) + 2.5rem) 24px 4.5rem;
  box-sizing: border-box;
}

.theme-v2 .hero__text {
  text-align: left;
  max-width: 560px;
  margin: 0;
  width: 100%;
}

.theme-v2 .hero__brand {
  font-size: clamp(1.85rem, 4.4vw, 2.85rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 0.85rem;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.45);
  line-height: 1.06;
  animation: brand-in 0.9s var(--v2-ease-out) both;
}

.theme-v2 .hero__brand span,
.theme-v2 .hero__brand em {
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.theme-v2 .hero__brand em {
  color: var(--v2-accent);
}

.theme-v2 .hero__title {
  font-size: clamp(1.25rem, 2.7vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.28;
  max-width: 22ch;
  margin: 0 0 0.85rem;
  text-transform: none;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

.theme-v2 .hero__subtitle {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  font-weight: 400;
  max-width: 42ch;
  margin: 0 0 1.75rem;
  opacity: 0.92;
  line-height: 1.5;
}

.theme-v2 .hero__actions {
  justify-content: flex-start;
  gap: 0.85rem;
}

.theme-v2 .hero__actions .btn--ghost {
  border-color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
}

.theme-v2 .btn--red.btn--lg {
  font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 10px 32px rgba(200, 16, 46, 0.4);
}

.theme-v2 .hero__scroll-hint {
  font-family: var(--body);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.theme-v2 .about__heading,
.theme-v2 .feature-flow__header h2,
.theme-v2 .state-support__title,
.theme-v2 .section__title,
.theme-v2 .request__title {
  font-family: var(--body);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.theme-v2 .feature-flow {
  background:
    radial-gradient(ellipse 70% 55% at 8% 0%, rgba(200, 16, 46, 0.08), transparent 55%),
    linear-gradient(180deg, #e8edf5 0%, #dfe6f1 50%, #eef2f8 100%);
}

.theme-v2 .feedback {
  background:
    radial-gradient(ellipse 60% 50% at 80% 0%, rgba(200, 16, 46, 0.16), transparent 50%),
    linear-gradient(180deg, #1a2b5a 0%, #0c1220 100%);
}

.theme-v2 .footer {
  background: #0c1220;
  color: rgba(232, 228, 220, 0.72);
  border-top: 1px solid rgba(232, 228, 220, 0.08);
}

.theme-v2 .footer__nav a,
.theme-v2 .footer__legal a,
.theme-v2 .footer__copy,
.theme-v2 .footer__legal {
  color: rgba(232, 228, 220, 0.78);
}

.theme-v2 .footer__nav a:hover,
.theme-v2 .footer__legal a:hover {
  color: #ff6b7d;
}

.theme-v2 .social__btn--footer {
  background: rgba(232, 228, 220, 0.08);
  border-color: rgba(232, 228, 220, 0.12);
}

.theme-v2 .social__btn--footer svg {
  fill: #e8e4dc;
}

.theme-v2 .scroll-progress__bar {
  background: linear-gradient(90deg, var(--v2-accent), var(--v2-amber), var(--v2-navy));
}

@keyframes brand-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes mobile-bar-in {
  from {
    opacity: 0;
    transform: translate3d(0, 110%, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* IO fallback: smooth compositor-only reveal */
@supports not ((animation-timeline: view()) and (animation-range: entry)) {
  .theme-v2 .cascade-in,
  .theme-v2 .cascade-up,
  .theme-v2 .cascade-scale {
    transition:
      opacity 0.55s var(--v2-ease),
      transform 0.55s var(--v2-ease);
  }
}

/* Hover zoom only when a real pointer can hover */
@media (hover: hover) and (pointer: fine) {
  .theme-v2 .media-strip__item:hover img {
    transform: scale(1.04);
  }
}

@media (hover: none), (pointer: coarse) {
  .theme-v2 .media-strip__item:hover img,
  .theme-v2 .media-strip__item:active img {
    transform: none;
  }
}

/*
 * Full desktop nav needs ~1400px (7 long RU labels + logo + portal/hotline).
 * Below that: burger — never clip half-visible items (was overflow:hidden + 1199).
 */
@media (max-width: 1399px) {
  .theme-v2 {
    --cascade-y: 22px;
    --v2-header-h: 52px;
  }

  body.theme-v2 {
    padding-bottom: calc(var(--v2-mobile-bar-h) + env(safe-area-inset-bottom, 0px));
  }

  .theme-v2 .header__inner {
    grid-template-columns: minmax(0, 1fr) auto auto;
    column-gap: 0.75rem;
    padding: 0.6rem clamp(0.85rem, 3vw, 1.25rem);
  }

  /* Keep hotline+portal beside burger on tablets; phones use sticky bar below. */
  .theme-v2 .header__contact {
    display: flex !important;
    gap: 0.65rem;
  }

  .theme-v2 .nav {
    display: none;
  }

  .theme-v2 .nav.nav--mobile {
    display: block;
    position: fixed;
    top: var(--v2-header-h);
    left: 0;
    right: 0;
    z-index: 950;
    background: rgba(251, 251, 253, 0.98);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.75rem clamp(1rem, 4vw, 1.5rem) 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  }

  .theme-v2 .nav.nav--mobile .nav__list {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
  }

  .theme-v2 .nav.nav--mobile .nav__link {
    display: block;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.95rem;
    color: var(--v2-ink);
  }

  .theme-v2 .nav.nav--mobile .nav__item--portal {
    display: list-item;
  }

  .theme-v2 .nav.nav--mobile .nav__link--portal {
    margin: 0.65rem 0 0;
    text-align: center;
    border-bottom: 0;
    color: var(--v2-accent);
    background: rgba(200, 16, 46, 0.08);
    border-color: transparent;
    justify-content: center;
  }

  .theme-v2 .nav.nav--mobile .nav__link::after {
    display: none;
  }

  .theme-v2 .burger {
    display: flex !important;
    grid-column: auto;
  }

  .theme-v2 .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .theme-v2 .hero__actions .btn {
    width: 100%;
    max-width: 320px;
  }

  .theme-v2 .header,
  .theme-v2 .header.header--compact {
    background: rgba(251, 251, 253, 0.98);
    border-bottom-color: rgba(18, 24, 38, 0.1);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 8px 24px rgba(18, 24, 38, 0.06);
  }

  .theme-v2 .nav.nav--mobile {
    background: rgba(251, 251, 253, 0.98);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .mobile-actions {
    display: grid !important;
    gap: 0.55rem;
    padding: 0.65rem max(0.85rem, env(safe-area-inset-left, 0px))
      calc(0.65rem + env(safe-area-inset-bottom, 0px)) max(0.85rem, env(safe-area-inset-right, 0px));
    background: rgba(251, 251, 253, 0.98);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: 1px solid rgba(18, 24, 38, 0.08);
    box-shadow: 0 -10px 36px rgba(18, 24, 38, 0.12);
  }

  .mobile-actions.is-visible {
    animation: mobile-bar-in 0.48s var(--v2-ease) both;
  }

  .mobile-actions__call,
  .mobile-actions__help {
    min-height: 50px;
    border-radius: 16px;
    letter-spacing: -0.01em;
    transition:
      transform 0.18s var(--v2-ease),
      box-shadow 0.18s var(--v2-ease),
      background-color 0.18s ease;
  }

  .mobile-actions__call {
    box-shadow: 0 1px 0 rgba(18, 24, 38, 0.04);
  }

  .mobile-actions__help {
    box-shadow: 0 8px 22px rgba(230, 29, 46, 0.28);
  }

  .mobile-actions__call:active,
  .mobile-actions__help:active {
    transform: scale(0.975);
  }

  .theme-v2 .hero__brand {
    animation-duration: 0.7s;
  }

  .theme-v2 .feature-flow__rail-list,
  .theme-v2 .feature-panel__inner {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

@media (min-width: 1400px) {
  .mobile-actions {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .theme-v2 .header__inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .theme-v2 .header__contact {
    display: none !important;
  }

  .theme-v2 .hero__flag {
    display: none;
  }

  .theme-v2 {
    --cascade-y: 18px;
  }

  @keyframes brand-in {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .theme-v2 .btn--ghost,
  .theme-v2 .hero__scroll-hint {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-v2 .hero__brand,
  .mobile-actions.is-visible {
    animation: none !important;
  }

  .theme-v2 .cascade-in,
  .theme-v2 .cascade-up,
  .theme-v2 .cascade-scale,
  .mobile-actions__call,
  .mobile-actions__help {
    transition: none !important;
  }
}

/* —— Fluid site layout: any browser window size —— */
html:has(.theme-v2) {
  overflow-x: clip;
}

.theme-v2 {
  overflow-x: clip;
}

.theme-v2 .container {
  width: min(1140px, calc(100% - clamp(1.5rem, 5vw, 3rem)));
  max-width: 100%;
}

.theme-v2 .header .container {
  width: min(1320px, 100%);
}

.theme-v2 img,
.theme-v2 video,
.theme-v2 svg,
.theme-v2 iframe {
  max-width: 100%;
  height: auto;
}

.theme-v2 .help__grid,
.theme-v2 .state-support__grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
}

@media (max-width: 768px) {
  .theme-v2 .section,
  .theme-v2 .feature-flow,
  .theme-v2 .feedback.section {
    padding-inline: 0;
  }

  .theme-v2 .hero__inner {
    padding-inline: clamp(1rem, 4vw, 1.5rem);
  }

  .theme-v2 .hero__actions .btn {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .theme-v2 .logo__text {
    font-size: 0.72rem;
  }

  .theme-v2 .logo__star {
    width: 26px;
    height: 26px;
  }
}
