/* ==========================================================================
   Riva Solution – site styles (no framework). Tokens first, then base,
   layout, components, pages.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Brand palette (from the approved RIVA SOLUTION logo) */
  --navy: #011e42;          /* primary brand navy */
  --navy-deep: #021432;     /* darkest navy (wordmark, footer) */
  --navy-soft: #243d63;
  --blue: #0176dd;          /* electric blue accent */
  --blue-dark: #013c95;
  --blue-bright: #0098f0;
  --blue-soft: #e6f2fd;
  --blue-tint: #d6e9fb;
  --navy-rgb: 1, 30, 66;
  --blue-rgb: 1, 118, 221;
  --blue-bright-rgb: 0, 152, 240;

  /* Neutrals */
  --ink: var(--navy);
  --muted: #55657f;
  --white: #ffffff;
  --grey: #f5f7fb;
  --line: #e3e8f0;
  --line-strong: #cfd9ea;
  --on-dark: #b8c4dc;
  --on-dark-strong: #e6ecfa;
  --on-dark-muted: #7f90b3;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 16px;
  --container: 1180px;
  --header-h: 76px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --shadow: 0 18px 40px -22px rgba(var(--navy-rgb), .35);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 3px solid rgba(var(--blue-rgb), .55); outline-offset: 3px; border-radius: 6px; }
ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3 { margin: 0 0 .6em; line-height: 1.12; letter-spacing: -.025em; font-weight: 650; color: var(--navy); }
h1 { font-size: clamp(2.5rem, 5.2vw, 4.25rem); letter-spacing: -.035em; font-weight: 700; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); }
h3 { font-size: 1.25rem; letter-spacing: -.015em; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 12px; color: #fff; }

.eyebrow {
  margin: 0 0 1rem;
  font-size: .8125rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--blue);
}
.eyebrow--light { color: var(--blue-bright); }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.6; color: var(--muted); max-width: 46rem; }

/* ---------- Brand logo ---------- */
.brand { display: inline-flex; align-items: center; flex-shrink: 0; line-height: 0; }
.brand__logo { display: block; height: 44px; width: auto; max-width: 100%; }
.brand__logo--footer { height: 52px; }
@media (max-width: 520px) {
  .brand__logo { height: 34px; }
  .brand__logo--footer { height: 44px; }
}

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 6px 24px -16px rgba(var(--navy-rgb), .3); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 24px; }

.site-nav { display: flex; align-items: center; gap: 32px; margin-left: auto; }
.site-nav__list { display: flex; gap: 6px; }
.site-nav__link {
  position: relative; display: block; padding: 8px 14px;
  font-size: .975rem; font-weight: 500; color: var(--navy-soft); border-radius: 8px;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.site-nav__link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px;
  background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.site-nav__link:hover { color: var(--blue); }
.site-nav__link:hover::after, .site-nav__link.is-active::after { transform: scaleX(1); }
.site-nav__link.is-active { color: var(--navy); font-weight: 600; }

.lang-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.lang-switch__link {
  padding: 4px 11px; font-size: .78rem; font-weight: 600; letter-spacing: .06em; color: var(--muted); border-radius: 999px;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.lang-switch__link:hover { color: var(--navy); }
.lang-switch__link.is-current { background: var(--navy); color: #fff; }

.nav-toggle {
  display: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; cursor: pointer; align-items: center; justify-content: center; flex-direction: column; gap: 5px;
}
.nav-toggle__bar { width: 18px; height: 2px; background: var(--navy); border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .site-header__inner { flex-wrap: wrap; }
  .js .nav-toggle { display: inline-flex; }
  .site-nav {
    order: 3; flex-basis: 100%; margin: 0; flex-direction: column; align-items: stretch; gap: 16px;
    padding: 8px 0 20px;
  }
  .site-nav__list { flex-direction: column; gap: 0; }
  .site-nav__link { padding: 14px 4px; font-size: 1.05rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .site-nav__link::after { display: none; }
  .site-nav__link.is-active { color: var(--blue); }
  .lang-switch { align-self: flex-start; }

  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: flex; animation: nav-in .28s var(--ease); }
  .js.nav-open .site-header { background: #fff; }
}
@keyframes nav-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: 14px 26px; font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.2;
  border-radius: 999px; border: 1.5px solid transparent; cursor: pointer;
  transition: transform .25s var(--ease), background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--blue); color: #fff; box-shadow: 0 10px 24px -12px rgba(var(--blue-rgb), .8); }
.btn--primary:hover { background: var(--blue-dark); color: #fff; }
.btn--ghost { border-color: var(--line); color: var(--navy); background: #fff; }
.btn--ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn--light { background: #fff; color: var(--navy); }
.btn--light:hover { background: var(--blue-soft); color: var(--navy); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2rem; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(4rem, 8vw, 7rem); }
.section--grey { background: var(--grey); }
.section__head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.section__head h2 { margin-bottom: .4em; }
.split { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.prose p { color: var(--muted); font-size: 1.15rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(var(--blue-rgb), .12), transparent 60%),
    linear-gradient(180deg, #fff 0%, var(--grey) 100%);
}
.hero__inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; padding-block: clamp(4rem, 9vw, 8rem); }
.hero__content h1 { max-width: 14ch; }
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2.5rem; }
.tags li {
  padding: 6px 14px; font-size: .875rem; font-weight: 500; color: var(--navy-soft);
  border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .8);
}
.hero__art { position: relative; aspect-ratio: 1 / 1; max-width: 460px; width: 100%; justify-self: end; }
.hero__panel { position: absolute; border-radius: 28px; }
.hero__panel--back { inset: 4% 0 14% 14%; background: linear-gradient(135deg, var(--blue-tint), var(--blue-soft)); animation: float 9s ease-in-out infinite; }
.hero__panel--mid { inset: 14% 10% 6% 4%; background: linear-gradient(135deg, var(--blue), var(--blue-bright)); opacity: .95; animation: float 9s ease-in-out -3s infinite; }
.hero__panel--front {
  inset: 26% 4% 16% 22%; background: var(--navy); box-shadow: var(--shadow);
  padding: 8%; display: flex; flex-direction: column; justify-content: center; gap: 14px;
  animation: float 9s ease-in-out -6s infinite;
}
.hero__line { display: block; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .22); }
.hero__line--1 { width: 72%; background: rgba(255, 255, 255, .5); }
.hero__line--2 { width: 90%; }
.hero__line--3 { width: 54%; }
.hero__dot { position: absolute; right: 8%; top: 10%; width: 14px; height: 14px; border-radius: 50%; background: var(--blue-bright); box-shadow: 0 0 0 6px rgba(var(--blue-bright-rgb), .25); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { max-width: 320px; justify-self: start; }
}

.page-hero {
  padding-block: clamp(4rem, 8vw, 7rem) clamp(3rem, 5vw, 4.5rem);
  background:
    radial-gradient(50rem 24rem at 90% -20%, rgba(var(--blue-rgb), .1), transparent 60%),
    linear-gradient(180deg, #fff 0%, var(--grey) 100%);
}
.page-hero h1 { max-width: 18ch; }

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 24px; }
.grid--services { grid-template-columns: repeat(6, 1fr); }
.grid--services > :nth-child(-n+3) { grid-column: span 2; }
.grid--services > :nth-child(n+4) { grid-column: span 3; }
.grid--three { grid-template-columns: repeat(3, 1fr); }
.grid--four { grid-template-columns: repeat(4, 1fr); }
.grid--steps { grid-template-columns: repeat(4, 1fr); counter-reset: none; }
@media (max-width: 1020px) {
  .grid--four, .grid--steps { grid-template-columns: repeat(2, 1fr); }
  .grid--three { grid-template-columns: repeat(2, 1fr); }
  .grid--services { grid-template-columns: repeat(2, 1fr); }
  .grid--services > :nth-child(n) { grid-column: auto; }
}
@media (max-width: 640px) {
  .grid--four, .grid--steps, .grid--three, .grid--services { grid-template-columns: 1fr; }
}

.card {
  position: relative; display: block; padding: 32px; color: inherit;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--line-strong); color: inherit; }
.card h3 { margin-bottom: .5em; }
.card p { margin: 0; color: var(--muted); font-size: 1rem; }
.card__icon {
  display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: 1.25rem;
  color: var(--blue); background: var(--blue-soft); border-radius: 14px;
}
.card__icon .icon { width: 26px; height: 26px; }
.card__num { display: block; margin-bottom: 1rem; font-size: .85rem; font-weight: 700; letter-spacing: .12em; color: var(--blue); }
.card__more { display: inline-flex; gap: .4em; margin-top: 1.25rem; font-size: .95rem; font-weight: 600; color: var(--blue); }
.card__more span { transition: transform .3s var(--ease); }
.card--link:hover .card__more span { transform: translateX(4px); }

.step { padding-top: 24px; border-top: 2px solid var(--line); position: relative; }
.step::before { content: ""; position: absolute; left: 0; top: -2px; width: 44px; height: 2px; background: var(--blue); }
.step__num { display: block; margin-bottom: .75rem; font-size: .85rem; font-weight: 700; letter-spacing: .12em; color: var(--blue); }
.step p { margin: 0; color: var(--muted); font-size: 1rem; }

.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chips a {
  display: inline-block; padding: 12px 22px; font-weight: 500; color: var(--navy);
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  transition: border-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.chips a:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-2px); }

.mission { padding: clamp(2rem, 5vw, 4rem); background: var(--navy); border-radius: 24px; color: #fff; }
.mission__text { margin: 0; max-width: 40rem; font-size: clamp(1.4rem, 2.8vw, 2.1rem); line-height: 1.35; font-weight: 500; letter-spacing: -.015em; }

/* ---------- Services page ---------- */
.service__inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.service__list { padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.service__list h3 { font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 1.25rem; }
.checklist li { position: relative; padding: 12px 0 12px 34px; border-top: 1px solid var(--line); font-weight: 500; }
.checklist li:first-child { border-top: 0; padding-top: 0; }
.checklist li::before {
  content: ""; position: absolute; left: 6px; top: 1.05em; width: 6px; height: 11px;
  border: solid var(--blue); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.checklist li:first-child::before { top: .3em; }
@media (max-width: 860px) { .service__inner { grid-template-columns: 1fr; } }

/* ---------- CTA band ---------- */
.cta-band { background: var(--navy); color: #fff; padding-block: clamp(3.5rem, 6vw, 5.5rem); }
.cta-band__inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: .3em; max-width: 24ch; }
.cta-band p { margin: 0; color: var(--on-dark); }

/* ---------- Status pages (404 / error) ---------- */
.status-page { min-height: 55vh; display: flex; align-items: center; }
.status-page__code { margin: 0 0 .5rem; font-size: clamp(4rem, 12vw, 8rem); font-weight: 800; line-height: 1; letter-spacing: -.05em; color: var(--blue-soft); -webkit-text-stroke: 2px var(--blue); }
.status-page .btn { margin-top: 1.5rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: var(--on-dark); padding-block: clamp(3rem, 6vw, 5rem) 2rem; font-size: .975rem; }
.site-footer a { color: var(--on-dark-strong); }
.site-footer a:hover { color: #fff; }
.site-footer__grid { display: grid; grid-template-columns: 1.3fr .8fr 1.4fr; gap: 3rem; padding-bottom: 3rem; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.site-footer__brand p { margin: 1.25rem 0 0; max-width: 22rem; }
.site-footer__title { margin: 0 0 1.25rem; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: #fff; }
.site-footer__list li + li { margin-top: .6rem; }
.contact-list { margin: 0; display: grid; gap: 14px; }
.contact-list div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; }
.contact-list dt { color: var(--on-dark-muted); }
.contact-list dd { margin: 0; color: var(--on-dark-strong); overflow-wrap: anywhere; }
.contact-list .is-placeholder { color: var(--on-dark-muted); font-style: italic; }
.site-footer__legal { margin: 2rem 0 0; font-size: .875rem; color: var(--on-dark-muted); }
@media (max-width: 860px) {
  .site-footer__grid { grid-template-columns: 1fr; gap: 2.25rem; }
  .contact-list div { grid-template-columns: 80px 1fr; }
}

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.grid > .reveal:nth-child(2) { transition-delay: .07s; }
.grid > .reveal:nth-child(3) { transition-delay: .14s; }
.grid > .reveal:nth-child(4) { transition-delay: .21s; }
.grid > .reveal:nth-child(5) { transition-delay: .28s; }
.grid > .reveal:nth-child(6) { transition-delay: .35s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* Brand v2 logo sizing */
.brand__logo { height: 52px; }
.brand__logo--footer { height: 58px; }
@media (max-width: 520px) {
  .brand__logo { height: 40px; }
  .brand__logo--footer { height: 50px; }
}
