/*
 * Obhod public-site polish layer.
 * Loaded after style.css/interface.css, so it only refines the existing design.
 * No inline styles, no external dependencies, no changes to product logic.
 */

:root {
  --yellow: #FFD400;
  --focus-ring: #FFD400;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-wrap: break-word;
}

/* Russian headings should wrap by words, not in the middle of a word. */
h1,
h2,
h3 {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

h1,
h2 {
  text-wrap: balance;
}

/* ---------- Header, logo and mobile menu ---------- */

.site-header .brand img,
.site-footer .brand img {
  max-width: 100%;
  height: auto;
}

.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 0;
}

.site-header nav a:focus-visible {
  outline-offset: 2px;
}

.site-header .nav-toggle {
  background: transparent;
  border: 1px solid #3c4449;
  border-radius: 10px;
  color: var(--text);
}

.site-header .nav-toggle:hover,
.site-header .nav-toggle:focus-visible {
  background: #ffffff0a;
  border-color: #ffd40080;
  box-shadow: none;
  transform: none;
}

.site-header .nav-toggle[aria-expanded="true"] {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #080808;
}

.site-header .nav-toggle[aria-expanded="true"]:hover {
  background: #ffe574;
}

.site-header .nav-toggle[aria-expanded="true"] .nav-toggle-bar {
  background: #080808;
}

/* Lock the page only while the mobile menu is open. */
body.menu-open {
  overflow: hidden;
}

/* ---------- Focus states ---------- */

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.help-search:focus-within {
  border-color: var(--yellow);
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.help-search input:focus-visible {
  outline: 0;
}

/* ---------- Footer ---------- */

.site-footer {
  row-gap: 18px;
}

.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}

.site-footer .footer-support {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 12px;
  color: var(--muted);
  transition: color .2s ease, background-color .2s ease;
}

.site-footer .footer-support:hover {
  color: #080808;
  background: var(--yellow);
}

.site-footer .footer-support .ui-icon {
  width: 22px;
  height: 22px;
}

.site-footer .footer-legal a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 3px 0;
  transition: color .2s ease;
}

.site-footer .footer-legal a:hover {
  color: var(--yellow);
}

/* ---------- Pricing: no orphan third card ---------- */

.ref-pricing {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

@media (max-width: 700px) {
  .ref-pricing {
    grid-template-columns: 1fr;
  }
}

/* ---------- Download cards and progress ---------- */

.primary-download > .button {
  margin-top: 20px;
}

#dl-progress {
  width: 100%;
  height: 10px;
  min-width: 0;
  flex: none;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: #242424;
  accent-color: var(--yellow);
}

#dl-progress::-webkit-progress-bar {
  background: #242424;
  border-radius: 999px;
}

#dl-progress::-webkit-progress-value {
  background: var(--yellow);
  border-radius: 999px;
}

#dl-progress::-moz-progress-bar {
  background: var(--yellow);
  border-radius: 999px;
}

#dl-progress-wrap {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

#dl-notes:empty,
#dl-hash:empty {
  display: none;
}

.download-direct {
  margin-top: 10px;
}

/* Replaces the two legacy inline styles that CSP would block. */
.keys-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem;
  line-height: 1.5;
}

.row-block {
  display: block;
}

.client-download {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 0;
}

.file-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

/* ---------- Account headings on narrow phones ---------- */

@media (max-width: 620px) {
  .legal-layout .document-content {
    margin-left: 0;
    margin-right: 0;
  }

  .card-head {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
  }

  .card-head h2 {
    flex: 1 1 100%;
  }

  .card-head > span:not(.status-pill) {
    white-space: nowrap;
  }

  .card-head .status-pill {
    max-width: 100%;
    white-space: normal;
  }
}

/* ---------- Narrow-screen layout fixes ---------- */

@media (max-width: 620px) {
  .benefit-grid,
  .step-grid {
    grid-template-columns: 1fr;
  }

  .benefit {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    column-gap: 14px;
    text-align: left;
    padding: 18px 16px;
  }

  .benefit > .ui-icon {
    grid-row: 1 / 3;
    width: 36px;
    height: 36px;
    margin: 0;
  }

  .benefit h3 {
    margin: 0;
    font-size: 15px;
  }

  .benefit p {
    grid-column: 2;
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.45;
    max-width: none;
  }

  .start-step {
    padding: 18px 16px;
  }

  .start-step h3 {
    margin-top: 10px;
  }

  .site-footer {
    column-gap: 10px;
  }
}

@media (max-width: 560px) {
  .popular-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .client-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .setup-grid {
    grid-template-columns: 1fr;
  }

  .guide-files > span {
    flex-basis: 100%;
    margin-right: 0;
  }

  .legal-layout .prose h1 {
    font-size: 26px;
    hyphens: auto;
  }
}

/* ---------- Hero atmosphere + parallax layers ---------- */

.landing-hero {
  isolation: isolate;
}

.hero-atmosphere {
  position: absolute;
  inset: -12% -6%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-orb {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(64px);
  opacity: .55;
  pointer-events: none;
}

.hero-orb-a {
  width: 420px;
  height: 420px;
  left: -180px;
  top: -120px;
  background: radial-gradient(circle, rgba(255, 212, 0, .18), transparent 68%);
}

.hero-orb-b {
  width: 340px;
  height: 340px;
  right: 4%;
  bottom: -170px;
  background: radial-gradient(circle, rgba(255, 212, 0, .11), transparent 70%);
}

.landing-hero .hero-copy {
  position: relative;
  z-index: 2;
}

.landing-hero .globe-visual {
  z-index: 1;
}

@media (max-width: 620px) {
  .hero-orb {
    filter: blur(52px);
    opacity: .4;
  }

  .hero-orb-a {
    width: 300px;
    height: 300px;
    left: -170px;
    top: -80px;
  }

  .hero-orb-b {
    width: 260px;
    height: 260px;
    right: -10%;
    bottom: -130px;
  }
}

@media (hover: hover) and (min-width: 760px) {
  .globe-visual,
  .hero-orb {
    will-change: transform;
  }
}

/* ---------- Hover micro-interactions ---------- */

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .benefit,
  .start-step,
  .os-strip a,
  .tariff,
  .primary-download,
  .client-grid .ref-card,
  .file-card,
  .article-card,
  .setup-platform {
    transition:
      transform .3s cubic-bezier(.22, .8, .32, 1),
      border-color .25s ease,
      box-shadow .25s ease,
      background-color .25s ease;
  }

  .benefit:hover,
  .start-step:hover,
  .os-strip a:hover,
  .tariff:hover,
  .primary-download:hover,
  .client-grid .ref-card:hover,
  .file-card:hover,
  .article-card:hover,
  .setup-platform:hover {
    transform: translateY(-3px);
    border-color: #ffd40059;
    box-shadow: 0 14px 34px #00000052;
  }

  .os-strip a:hover .os-icon,
  .client-grid .ref-card:hover .os-icon,
  .primary-download:hover > .os-icon {
    transform: scale(1.06);
  }

  .os-icon,
  .article-card > .ui-icon:last-child {
    transition: transform .25s ease;
  }

  .article-card:hover > .ui-icon:last-child {
    transform: translateX(3px);
  }

  .benefit:hover > .ui-icon,
  .start-step:hover > .ui-icon {
    transform: translateY(-2px) scale(1.04);
  }

  .benefit > .ui-icon,
  .start-step > .ui-icon {
    transition: transform .25s ease;
  }
}

/* ---------- Scroll reveal (class added by polish.js) ---------- */

@keyframes obhod-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

html.js-motion [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
}

html.js-motion [data-reveal="hero"] {
  opacity: 1;
  transform: none;
}

html.js-motion [data-reveal].is-visible {
  opacity: 1;
  transform: none;
  transition:
    opacity .65s ease,
    transform .65s cubic-bezier(.22, .8, .32, 1),
    border-color .25s ease,
    box-shadow .25s ease;
}

html.js-motion :is([data-stagger], .ref-pricing) > * {
  opacity: 0;
  transform: translateY(16px);
}

html.js-motion :is([data-stagger], .ref-pricing).is-visible > * {
  opacity: 1;
  transform: none;
  transition:
    opacity .58s ease,
    transform .58s cubic-bezier(.22, .8, .32, 1),
    border-color .25s ease,
    box-shadow .25s ease;
}

html.js-motion :is([data-stagger], .ref-pricing).is-visible > *:nth-child(2) {
  transition-delay: 70ms;
}

html.js-motion :is([data-stagger], .ref-pricing).is-visible > *:nth-child(3) {
  transition-delay: 140ms;
}

html.js-motion :is([data-stagger], .ref-pricing).is-visible > *:nth-child(4) {
  transition-delay: 210ms;
}

html.js-motion :is([data-stagger], .ref-pricing).is-visible > *:nth-child(5) {
  transition-delay: 280ms;
}

html.js-motion :is([data-stagger], .ref-pricing).is-visible > *:nth-child(6) {
  transition-delay: 350ms;
}

/* ---------- Reduced motion: content is always readable ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  html.js-motion [data-reveal],
  html.js-motion [data-reveal="hero"],
  html.js-motion :is([data-stagger], .ref-pricing) > * {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  .hero-orb,
  .globe-visual {
    transform: none !important;
    will-change: auto;
  }
}
